diff --git a/.gitignore b/.gitignore index 812f56fc36d..5b29a556792 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ Mage.Server.Plugins/Mage.Deck.Limited/target Mage.Server.Plugins/Mage.Game.CommanderDuel/target Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/target/ Mage.Server.Plugins/Mage.Game.FreeForAll/target +Mage.Server.Plugins/Mage.Game.MomirDuel/target Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/target Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/target Mage.Server.Plugins/Mage.Player.AI.DraftBot/target @@ -50,7 +51,7 @@ Mage.Updater/target mage.updater.client/target releases -Utils/author.txt +Utils/author.txt .DS_Store .metadata .project @@ -88,4 +89,6 @@ Mage.Server.Plugins/Mage.Draft.8PlayerBooster/target /Utils/*_unimplemented.txt *.netbeans_automatic_build *.txt -Mage.Client/serverlist.txt \ No newline at end of file +Mage.Client/serverlist.txt +/bin/ +/target/ \ No newline at end of file diff --git a/Mage.Client/plugins/mage-theme-plugin.jar b/Mage.Client/plugins/mage-theme-plugin.jar deleted file mode 100644 index 1448724874d..00000000000 Binary files a/Mage.Client/plugins/mage-theme-plugin.jar and /dev/null differ diff --git a/Mage.Client/pom.xml b/Mage.Client/pom.xml index e48d07e8091..46cd82bba88 100644 --- a/Mage.Client/pom.xml +++ b/Mage.Client/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.3 + 1.4.5 org.mage diff --git a/Mage.Client/release/sample-decks/2013/Standard/DailyMTG/Adam Cotner's Skaabs!..dck b/Mage.Client/release/sample-decks/2013/Standard/DailyMTG/Adam Cotner's Skaabs!.dck similarity index 100% rename from Mage.Client/release/sample-decks/2013/Standard/DailyMTG/Adam Cotner's Skaabs!..dck rename to Mage.Client/release/sample-decks/2013/Standard/DailyMTG/Adam Cotner's Skaabs!.dck diff --git a/Mage.Client/release/sample-decks/Commander/Commander 2015/Call the Spirits (WB).dck b/Mage.Client/release/sample-decks/Commander/Commander 2015/Call the Spirits (WB).dck new file mode 100644 index 00000000000..c00e539a8e2 --- /dev/null +++ b/Mage.Client/release/sample-decks/Commander/Commander 2015/Call the Spirits (WB).dck @@ -0,0 +1,78 @@ +1 [C15:77] Open the Vaults +1 [C15:76] Monk Idealist +1 [C15:75] Mesa Enchantress +1 [C15:74] Marshal's Anthem +1 [C15:73] Kor Sanctifiers +1 [C15:281] Command Tower +1 [C15:72] Karmic Justice +1 [C15:283] Evolving Wilds +1 [C15:70] Ghostblade Eidolon +1 [C15:285] Ghost Quarter +1 [C15:121] Doomwake Giant +1 [C15:122] Dreadbringer Lampads +1 [C15:320] Vivid Meadow +1 [C15:125] Fallen Ideal +11 [C15:323] Plains +1 [C15:126] Fate Unraveler +1 [C15:79] Seal of Cleansing +1 [C15:248] Burnished Hart +1 [C15:127] Gild +1 [C15:128] Grave Peril +1 [C15:129] Nighthowler +1 [C15:80] Sigil of the Empty Throne +1 [C15:84] Vow of Duty +1 [C15:81] Silent Sentinel +1 [C15:274] Wayfarer's Bauble +1 [C15:277] Barren Moor +1 [C15:234] Teysa, Envoy of Ghosts +1 [C15:311] Tainted Field +1 [C15:235] Treasury Thrull +1 [C15:114] Ancient Craving +1 [C15:46] Karlov of the Ghost Council +1 [C15:313] Temple of the False God +1 [C15:237] Underworld Coinsmith +1 [C15:116] Black Market +1 [C15:314] Terramorphic Expanse +1 [C15:319] Vivid Marsh +1 [C15:55] Thought Vessel +1 [C15:52] Sandstone Oracle +1 [C15:261] Orzhov Cluestone +1 [C15:140] Vow of Malice +1 [C15:262] Orzhov Signet +1 [C15:19] Deadly Tempest +1 [C15:18] Daxos's Torment +1 [C15:17] Corpse Augur +1 [C15:16] Banshee of the Dread Choir +1 [C15:268] Sol Ring +1 [C15:301] Reliquary Tower +1 [C15:57] Ajani's Chosen +1 [C15:302] Scoured Barrens +1 [C15:303] Secluded Steppe +1 [C15:229] Necromancer's Covenant +1 [C15:22] Thief of Blood +1 [C15:66] Dawn to Dusk +1 [C15:64] Celestial Archon +1 [C15:63] Celestial Ancient +1 [C15:62] Cage of Hands +1 [C15:61] Banishing Light +1 [C15:250] Crystal Chimes +1 [C15:60] Aura of Silence +1 [C15:130] Phyrexian Arena +1 [C15:295] New Benalia +1 [C15:133] Phyrexian Reclamation +1 [C15:298] Orzhov Basilica +13 [C15:331] Swamp +1 [C15:299] Orzhov Guildgate +1 [C15:135] Seal of Doom +1 [C15:257] Lightning Greaves +1 [C15:8] Shielded by Faith +1 [C15:68] Dictate of Heliod +1 [C15:67] Dawnglare Invoker +1 [C15:138] Underworld Connections +1 [C15:7] Righteous Confluence +1 [C15:215] Death Grasp +1 [C15:6] Oreskos Explorer +1 [C15:4] Herald of the Host +1 [C15:3] Grasp of Fate +1 [C15:1] Bastion Protector +SB: 1 [C15:43] Daxos the Returned diff --git a/Mage.Client/release/sample-decks/Commander/Commander 2015/Plunder the Graves (GB).dck b/Mage.Client/release/sample-decks/Commander/Commander 2015/Plunder the Graves (GB).dck new file mode 100644 index 00000000000..3f6ecd43882 --- /dev/null +++ b/Mage.Client/release/sample-decks/Commander/Commander 2015/Plunder the Graves (GB).dck @@ -0,0 +1,77 @@ +1 [C15:33] Bloodspore Thrinax +1 [C15:281] Command Tower +1 [C15:283] Evolving Wilds +1 [C15:120] Diabolic Servitude +1 [C15:286] Golgari Guildgate +1 [C15:39] Skullwinder +1 [C15:287] Golgari Rot Farm +1 [C15:200] Sakura-Tribe Elder +1 [C15:38] Pathbreaker Ibex +1 [C15:123] Eater of Hope +1 [C15:288] Grim Backwoods +1 [C15:201] Satyr Wayfinder +1 [C15:37] Great Oak Guardian +1 [C15:124] Extractor Demon +1 [C15:245] Bonehoard +1 [C15:289] High Market +1 [C15:202] Spider Spawning +1 [C15:35] Centaur Vinecrasher +1 [C15:34] Caller of the Pack +1 [C15:204] Terastodon +1 [C15:206] Tribute to the Wild +1 [C15:207] Verdant Force +1 [C15:208] Viridian Emissary +1 [C15:191] Mulch +1 [C15:192] Mycoloth +1 [C15:196] Overwhelming Stampede +1 [C15:198] Primal Growth +1 [C15:232] Putrefy +1 [C15:112] Altar's Reap +1 [C15:48] Mazirek, Kraul Death Priest +1 [C15:113] Ambition's Cost +1 [C15:312] Tainted Wood +1 [C15:115] Barter in Blood +1 [C15:314] Terramorphic Expanse +1 [C15:117] Blood Bairn +1 [C15:238] Vulturous Zombie +1 [C15:118] Butcher of Malakir +1 [C15:119] Champion of Stray Souls +1 [C15:318] Vivid Grove +1 [C15:319] Vivid Marsh +1 [C15:55] Thought Vessel +1 [C15:183] Eternal Witness +1 [C15:186] Indrik Stomphowler +1 [C15:187] Kessig Cagebreakers +1 [C15:17] Corpse Augur +1 [C15:221] Golgari Charm +1 [C15:16] Banshee of the Dread Choir +1 [C15:222] Grisly Salvage +1 [C15:223] Jarad, Golgari Lich Lord +1 [C15:267] Skullclamp +1 [C15:300] Polluted Mire +1 [C15:224] Korozda Guildmage +1 [C15:268] Sol Ring +1 [C15:226] Lotleth Troll +1 [C15:307] Slippery Karst +1 [C15:22] Thief of Blood +1 [C15:21] Scourge of Nel Toth +1 [C15:20] Dread Summons +1 [C15:292] Jungle Hollow +1 [C15:173] Acidic Slime +1 [C15:131] Phyrexian Plaguelord +1 [C15:132] Phyrexian Rager +1 [C15:253] Eldrazi Monument +1 [C15:210] Viridian Zealot +13 [C15:331] Swamp +1 [C15:211] Wall of Blossoms +1 [C15:255] Golgari Signet +1 [C15:134] Rise from the Grave +1 [C15:212] Wood Elves +1 [C15:179] Cloudthresher +1 [C15:257] Lightning Greaves +1 [C15:136] Sever the Bloodline +1 [C15:137] Shriekmaw +1 [C15:23] Wretched Confluence +1 [C15:139] Victimize +12 [C15:339] Forest +SB: 1 [C15:49] Meren of Clan Nel Toth diff --git a/Mage.Client/release/sample-decks/Commander/Commander 2015/Seize Control (UR).dck b/Mage.Client/release/sample-decks/Commander/Commander 2015/Seize Control (UR).dck new file mode 100644 index 00000000000..ee3dfe19a30 --- /dev/null +++ b/Mage.Client/release/sample-decks/Commander/Commander 2015/Seize Control (UR).dck @@ -0,0 +1,75 @@ +1 [C15:31] Warchief Giant +1 [C15:30] Rite of the Raging Storm +1 [C15:281] Command Tower +1 [C15:162] Magmaquake +1 [C15:283] Evolving Wilds +1 [C15:163] Mizzium Mortars +1 [C15:240] Call the Skybreaker +1 [C15:169] Urza's Rage +14 [C15:327] Island +1 [C15:88] Blue Sun's Zenith +1 [C15:87] Blatant Thievery +1 [C15:42] Arjun, the Shifting Flame +1 [C15:85] AEtherize +1 [C15:151] Dragon Mage +1 [C15:153] Faithless Looting +1 [C15:275] Worn Powerstone +1 [C15:110] Thought Reflection +1 [C15:231] Prophetic Bolt +1 [C15:111] Windfall +1 [C15:233] Steam Augury +1 [C15:310] Swiftwater Cliffs +1 [C15:313] Temple of the False God +1 [C15:89] Blustersquall +1 [C15:314] Terramorphic Expanse +1 [C15:316] Vivid Crag +1 [C15:317] Vivid Creek +1 [C15:90] Brainstorm +1 [C15:11] Gigantoplasm +1 [C15:55] Thought Vessel +1 [C15:10] Broodbirth Viper +1 [C15:54] Seal of the Guildpact +1 [C15:98] Mystic Retrieval +1 [C15:96] Lone Revenant +1 [C15:95] Jace's Archivist +1 [C15:94] Fact or Fiction +1 [C15:93] Echoing Truth +1 [C15:141] Act of Aggression +1 [C15:92] Dominate +1 [C15:263] Psychosis Crawler +1 [C15:220] Goblin Electromancer +1 [C15:144] Chain Reaction +1 [C15:145] Charmbreaker Devils +1 [C15:101] Preordain +1 [C15:146] Comet Storm +1 [C15:268] Sol Ring +1 [C15:103] Reins of Power +1 [C15:14] Mystic Confluence +1 [C15:301] Reliquary Tower +1 [C15:302] Rogue's Passage +1 [C15:13] Mirror Match +1 [C15:104] Repeal +1 [C15:12] Illusory Ambusher +1 [C15:149] Desperate Ravings +1 [C15:105] Rite of Replication +1 [C15:227] Melek, Izzet Paragon +1 [C15:106] Sleep +1 [C15:107] Stolen Goods +1 [C15:108] Stroke of Genius +1 [C15:109] Talrand, Sky Summoner +1 [C15:309] Spinerock Knoll +1 [C15:290] Izzet Boilerworks +1 [C15:170] Vandalblast +1 [C15:291] Izzet Guildgate +1 [C15:172] Word of Seizing +1 [C15:29] Mizzix's Mastery +1 [C15:28] Meteor Blast +1 [C15:256] Izzet Signet +1 [C15:9] AEthersnatch +1 [C15:24] Awaken the Sky Tyrant +1 [C15:214] Counterflux +13 [C15:335] Mountain +1 [C15:216] Epic Experiment +1 [C15:217] Etherium-Horn Sorcerer +1 [C15:218] Firemind's Foresight +SB: 1 [C15:50] Mizzix of the Izmagnus diff --git a/Mage.Client/release/sample-decks/Commander/Commander 2015/Swell the Host (GU).dck b/Mage.Client/release/sample-decks/Commander/Commander 2015/Swell the Host (GU).dck new file mode 100644 index 00000000000..e9b21032d22 --- /dev/null +++ b/Mage.Client/release/sample-decks/Commander/Commander 2015/Swell the Host (GU).dck @@ -0,0 +1,77 @@ +1 [C15:32] Arachnogenesis +1 [C15:281] Command Tower +1 [C15:283] Evolving Wilds +1 [C15:241] Cold-Eyed Selkie +1 [C15:242] Snakeform +1 [C15:39] Skullwinder +1 [C15:243] Wistful Selkie +1 [C15:200] Sakura-Tribe Elder +1 [C15:37] Great Oak Guardian +1 [C15:289] High Market +1 [C15:322] Zoetic Cavern +1 [C15:36] Ezuri's Predation +1 [C15:203] Stingerfling Spider +1 [C15:34] Caller of the Pack +1 [C15:205] Thelonite Hermit +11 [C15:327] Island +1 [C15:209] Viridian Shaman +1 [C15:190] Loaming Shaman +1 [C15:86] Bident of Thassa +1 [C15:193] Noble Quarry +1 [C15:40] Verdant Confluence +1 [C15:194] Ohran Viper +1 [C15:271] Swiftfoot Boots +1 [C15:272] Sword of Vengeance +1 [C15:195] Overrun +1 [C15:197] Patagia Viper +1 [C15:230] Prime Speaker Zegana +1 [C15:199] Rampant Growth +1 [C15:47] Kaseto, Orochi Archmage +1 [C15:236] Trygon Predator +1 [C15:314] Terramorphic Expanse +1 [C15:315] Thornwood Falls +1 [C15:239] Biomantic Mastery +1 [C15:317] Vivid Creek +1 [C15:318] Vivid Grove +1 [C15:91] Day of the Dragons +1 [C15:99] Ninja of the Deep Hours +1 [C15:55] Thought Vessel +1 [C15:10] Broodbirth Viper +1 [C15:97] Mulldrifter +1 [C15:53] Scytheclaw +1 [C15:180] Cobra Trap +1 [C15:181] Desert Twister +1 [C15:182] Elvish Visionary +1 [C15:183] Eternal Witness +1 [C15:260] Orochi Hatchery +1 [C15:184] Experiment One +1 [C15:185] Forgotten Ancient +1 [C15:100] Plaxmanta +1 [C15:265] Simic Keyrune +1 [C15:188] Kodama's Reach +1 [C15:266] Simic Signet +1 [C15:189] Krosan Grip +1 [C15:102] Rapid Hybridization +1 [C15:15] Synthetic Destiny +1 [C15:268] Sol Ring +1 [C15:301] Reliquary Tower +1 [C15:225] Lorescale Coatl +1 [C15:269] Solemn Simulacrum +1 [C15:13] Mirror Match +1 [C15:12] Illusory Ambusher +1 [C15:56] Command Beacon +1 [C15:228] Mystic Snake +1 [C15:305] Simic Growth Chamber +1 [C15:306] Simic Guildgate +1 [C15:293] Llanowar Reborn +1 [C15:294] Mosswort Bridge +1 [C15:174] Arbor Colossus +1 [C15:175] Bane of Progress +1 [C15:296] Novijen, Heart of Progress +1 [C15:176] Beastmaster Ascension +1 [C15:297] Oran-Rief, the Vastwood +1 [C15:177] Caller of the Claw +1 [C15:178] Chameleon Colossus +1 [C15:213] Coiling Oracle +14 [C15:339] Forest +SB: 1 [C15:44] Ezuri, Claw of Progress diff --git a/Mage.Client/release/sample-decks/Commander/Commander 2015/Wade into Battle (RW).dck b/Mage.Client/release/sample-decks/Commander/Commander 2015/Wade into Battle (RW).dck new file mode 100644 index 00000000000..461da3856cb --- /dev/null +++ b/Mage.Client/release/sample-decks/Commander/Commander 2015/Wade into Battle (RW).dck @@ -0,0 +1,77 @@ +1 [C15:31] Warchief Giant +1 [C15:30] Rite of the Raging Storm +1 [C15:280] Boros Guildgate +1 [C15:160] Inferno Titan +1 [C15:281] Command Tower +1 [C15:161] Magma Giant +1 [C15:282] Drifting Meadow +1 [C15:71] Jareth, Leonine Titan +1 [C15:283] Evolving Wilds +1 [C15:284] Forgotten Cave +1 [C15:164] Stinkdrinker Daredevil +1 [C15:165] Stoneshock Giant +1 [C15:166] Sunrise Sovereign +1 [C15:320] Vivid Meadow +1 [C15:167] Taurean Mauler +1 [C15:244] Basalt Monolith +1 [C15:321] Wind-Scarred Crag +1 [C15:168] Thundercloud Shaman +1 [C15:246] Boros Cluestone +11 [C15:323] Plains +1 [C15:247] Boros Signet +1 [C15:78] Orim's Thunder +1 [C15:249] Coldsteel Heart +1 [C15:41] Anya, Merciless Angel +1 [C15:270] Staff of Nin +1 [C15:83] Victory's Herald +1 [C15:150] Disaster Radius +1 [C15:82] Sun Titan +1 [C15:273] Urza's Incubator +1 [C15:152] Earthquake +1 [C15:275] Worn Powerstone +1 [C15:154] Fall of the Hammer +1 [C15:155] Fumiko the Lowblood +1 [C15:276] Ancient Amphitheater +1 [C15:156] Hamletback Goliath +1 [C15:157] Hammerfist Giant +1 [C15:278] Blasted Landscape +1 [C15:158] Hostility +1 [C15:279] Boros Garrison +1 [C15:159] Hunted Dragon +1 [C15:314] Terramorphic Expanse +1 [C15:316] Vivid Crag +1 [C15:55] Thought Vessel +1 [C15:52] Sandstone Oracle +1 [C15:51] Blade of Selves +1 [C15:142] Borderland Behemoth +1 [C15:264] Seer's Sundial +1 [C15:143] Breath of Darigaaz +1 [C15:59] Arbiter of Knollridge +1 [C15:58] Angel of Serenity +1 [C15:268] Sol Ring +1 [C15:147] Curse of the Nightly Hunt +1 [C15:148] Desolation Giant +1 [C15:303] Secluded Steppe +1 [C15:308] Smoldering Crater +1 [C15:65] Crib Swap +1 [C15:171] Warstorm Surge +1 [C15:61] Banishing Light +1 [C15:251] Darksteel Ingot +1 [C15:252] Dreamstone Hedron +1 [C15:254] Fellwar Stone +1 [C15:28] Meteor Blast +1 [C15:27] Magus of the Wheel +1 [C15:26] Fiery Confluence +1 [C15:25] Dream Pillager +1 [C15:257] Lightning Greaves +1 [C15:69] Faith's Fetters +1 [C15:258] Loxodon Warhammer +14 [C15:335] Mountain +1 [C15:67] Dawnglare Invoker +1 [C15:259] Mind Stone +1 [C15:6] Oreskos Explorer +1 [C15:5] Kalemne's Captain +1 [C15:4] Herald of the Host +1 [C15:219] Gisela, Blade of Goldnight +1 [C15:2] Dawnbreak Reclaimer +SB: 1 [C15:45] Kalemne, Disciple of Iroas diff --git a/Mage.Client/release/sample-decks/Momir Basic/Momir Basic.dck b/Mage.Client/release/sample-decks/Momir Basic/Momir Basic.dck new file mode 100644 index 00000000000..1295622aa28 --- /dev/null +++ b/Mage.Client/release/sample-decks/Momir Basic/Momir Basic.dck @@ -0,0 +1,23 @@ +NAME:Mormir Basic +3 [BFZ:259] Island +3 [BFZ:261] Swamp +3 [BFZ:250] Plains +3 [BFZ:272] Forest +3 [BFZ:260] Swamp +3 [BFZ:271] Forest +3 [BFZ:270] Forest +3 [BFZ:265] Mountain +2 [BFZ:254] Plains +3 [BFZ:264] Swamp +3 [BFZ:274] Forest +1 [BFZ:252] Plains +3 [BFZ:262] Swamp +3 [BFZ:251] Plains +2 [BFZ:273] Forest +3 [BFZ:258] Island +2 [BFZ:269] Mountain +3 [BFZ:268] Mountain +3 [BFZ:257] Island +3 [BFZ:267] Mountain +3 [BFZ:266] Mountain +2 [BFZ:255] Island diff --git a/Mage.Client/serverlist.txt b/Mage.Client/serverlist.txt index 46138917a32..db223b403ff 100644 --- a/Mage.Client/serverlist.txt +++ b/Mage.Client/serverlist.txt @@ -1,7 +1,6 @@ XMage.de 1 (Europe/Germany) fast :xmage.de:17171 woogerworks (North America/USA) :xmage.woogerworks.info:17171 -XMage.info 1 (Europe/France) slow :176.31.186.181:17171 -XMage.info 2 (Europe/France) slow :176.31.186.181:17000 -IceMage (Europe/Netherlands) :ring0.cc:17171 +XMage.info 1 (Europe/France) new network code -> see forum :176.31.186.181:17171 +XMage BR (South America/Brazil) :ec2-54-233-67-0.sa-east-1.compute.amazonaws.com:17171 Seedds Server (Asia) :115.29.203.80:17171 localhost -> connect to your local server (must be started):localhost:17171 diff --git a/Mage.Client/sounds/OnAddArtifact.wav b/Mage.Client/sounds/OnAddArtifact.wav index e9488ecad8e..2d6295ca752 100644 Binary files a/Mage.Client/sounds/OnAddArtifact.wav and b/Mage.Client/sounds/OnAddArtifact.wav differ diff --git a/Mage.Client/sounds/OnAddPermanent.wav b/Mage.Client/sounds/OnAddPermanent.wav index ac338bf4c86..7ca048e5141 100644 Binary files a/Mage.Client/sounds/OnAddPermanent.wav and b/Mage.Client/sounds/OnAddPermanent.wav differ diff --git a/Mage.Client/sounds/OnAttack.wav b/Mage.Client/sounds/OnAttack.wav index 48f3b7ac287..815db42ae67 100644 Binary files a/Mage.Client/sounds/OnAttack.wav and b/Mage.Client/sounds/OnAttack.wav differ diff --git a/Mage.Client/sounds/OnBlock.wav b/Mage.Client/sounds/OnBlock.wav index 984ab5f9145..28bf3ddde51 100644 Binary files a/Mage.Client/sounds/OnBlock.wav and b/Mage.Client/sounds/OnBlock.wav differ diff --git a/Mage.Client/sounds/OnButtonCancel.wav b/Mage.Client/sounds/OnButtonCancel.wav index cb0b80dbf8a..9b0c04ca6f8 100644 Binary files a/Mage.Client/sounds/OnButtonCancel.wav and b/Mage.Client/sounds/OnButtonCancel.wav differ diff --git a/Mage.Client/sounds/OnButtonOk.wav b/Mage.Client/sounds/OnButtonOk.wav index 7c33054ce49..f0e09ff85b9 100644 Binary files a/Mage.Client/sounds/OnButtonOk.wav and b/Mage.Client/sounds/OnButtonOk.wav differ diff --git a/Mage.Client/sounds/OnCountdown1.wav b/Mage.Client/sounds/OnCountdown1.wav index 5ab29bf462b..08fbe61614b 100644 Binary files a/Mage.Client/sounds/OnCountdown1.wav and b/Mage.Client/sounds/OnCountdown1.wav differ diff --git a/Mage.Client/sounds/OnDraftSelect.wav b/Mage.Client/sounds/OnDraftSelect.wav index cd8a5c09dbd..a7aa354a744 100644 Binary files a/Mage.Client/sounds/OnDraftSelect.wav and b/Mage.Client/sounds/OnDraftSelect.wav differ diff --git a/Mage.Client/sounds/OnDraw.wav b/Mage.Client/sounds/OnDraw.wav index 144d2009d1f..a91c5ec6f4d 100644 Binary files a/Mage.Client/sounds/OnDraw.wav and b/Mage.Client/sounds/OnDraw.wav differ diff --git a/Mage.Client/sounds/OnEndTurn.wav b/Mage.Client/sounds/OnEndTurn.wav index 56a6c525e2f..261e7482e33 100644 Binary files a/Mage.Client/sounds/OnEndTurn.wav and b/Mage.Client/sounds/OnEndTurn.wav differ diff --git a/Mage.Client/sounds/OnGameStart.wav b/Mage.Client/sounds/OnGameStart.wav index 791a85b591a..08d76fefdb0 100644 Binary files a/Mage.Client/sounds/OnGameStart.wav and b/Mage.Client/sounds/OnGameStart.wav differ diff --git a/Mage.Client/sounds/OnHover.wav b/Mage.Client/sounds/OnHover.wav index fae205369b0..459fd070553 100644 Binary files a/Mage.Client/sounds/OnHover.wav and b/Mage.Client/sounds/OnHover.wav differ diff --git a/Mage.Client/sounds/OnNextPage.wav b/Mage.Client/sounds/OnNextPage.wav index e109a11679c..c8aae197d5d 100644 Binary files a/Mage.Client/sounds/OnNextPage.wav and b/Mage.Client/sounds/OnNextPage.wav differ diff --git a/Mage.Client/sounds/OnNextPhase.wav b/Mage.Client/sounds/OnNextPhase.wav index 7d321fc19fb..09cfb019cac 100644 Binary files a/Mage.Client/sounds/OnNextPhase.wav and b/Mage.Client/sounds/OnNextPhase.wav differ diff --git a/Mage.Client/sounds/OnPlayerJoined.wav b/Mage.Client/sounds/OnPlayerJoined.wav index 0182728328d..98a94af7515 100644 Binary files a/Mage.Client/sounds/OnPlayerJoined.wav and b/Mage.Client/sounds/OnPlayerJoined.wav differ diff --git a/Mage.Client/sounds/OnPlayerLeft.wav b/Mage.Client/sounds/OnPlayerLeft.wav index c0590e8489f..13c6a54aa3b 100644 Binary files a/Mage.Client/sounds/OnPlayerLeft.wav and b/Mage.Client/sounds/OnPlayerLeft.wav differ diff --git a/Mage.Client/sounds/OnPlayerLost.wav b/Mage.Client/sounds/OnPlayerLost.wav index 4fd3e50fb19..4960cf90d4d 100644 Binary files a/Mage.Client/sounds/OnPlayerLost.wav and b/Mage.Client/sounds/OnPlayerLost.wav differ diff --git a/Mage.Client/sounds/OnPlayerQuit.wav b/Mage.Client/sounds/OnPlayerQuit.wav index d9b2826d1ec..4d97f17e4fe 100644 Binary files a/Mage.Client/sounds/OnPlayerQuit.wav and b/Mage.Client/sounds/OnPlayerQuit.wav differ diff --git a/Mage.Client/sounds/OnPlayerQuitTournament.wav b/Mage.Client/sounds/OnPlayerQuitTournament.wav index c92220b59c0..8857e7980f7 100644 Binary files a/Mage.Client/sounds/OnPlayerQuitTournament.wav and b/Mage.Client/sounds/OnPlayerQuitTournament.wav differ diff --git a/Mage.Client/sounds/OnPlayerSubmittedDeck.wav b/Mage.Client/sounds/OnPlayerSubmittedDeck.wav index cfa7603c0fd..1e89502f8fd 100644 Binary files a/Mage.Client/sounds/OnPlayerSubmittedDeck.wav and b/Mage.Client/sounds/OnPlayerSubmittedDeck.wav differ diff --git a/Mage.Client/sounds/OnPlayerWhispered.wav b/Mage.Client/sounds/OnPlayerWhispered.wav index ad26c3a9d41..7e58c8a5a1c 100644 Binary files a/Mage.Client/sounds/OnPlayerWhispered.wav and b/Mage.Client/sounds/OnPlayerWhispered.wav differ diff --git a/Mage.Client/sounds/OnPlayerWon.wav b/Mage.Client/sounds/OnPlayerWon.wav index 3c9eda4625e..91f00881dde 100644 Binary files a/Mage.Client/sounds/OnPlayerWon.wav and b/Mage.Client/sounds/OnPlayerWon.wav differ diff --git a/Mage.Client/sounds/OnPrevPage.wav b/Mage.Client/sounds/OnPrevPage.wav index 9cafab28a64..85b7179063c 100644 Binary files a/Mage.Client/sounds/OnPrevPage.wav and b/Mage.Client/sounds/OnPrevPage.wav differ diff --git a/Mage.Client/sounds/OnSkipButton.wav b/Mage.Client/sounds/OnSkipButton.wav index 7d321fc19fb..db8a44c52f7 100644 Binary files a/Mage.Client/sounds/OnSkipButton.wav and b/Mage.Client/sounds/OnSkipButton.wav differ diff --git a/Mage.Client/sounds/OnSkipButtonCancel.wav b/Mage.Client/sounds/OnSkipButtonCancel.wav index cb0b80dbf8a..d58aa0144a4 100644 Binary files a/Mage.Client/sounds/OnSkipButtonCancel.wav and b/Mage.Client/sounds/OnSkipButtonCancel.wav differ diff --git a/Mage.Client/sounds/OnStackNew.wav b/Mage.Client/sounds/OnStackNew.wav index 4fd917b8e84..4610b5fe33c 100644 Binary files a/Mage.Client/sounds/OnStackNew.wav and b/Mage.Client/sounds/OnStackNew.wav differ diff --git a/Mage.Client/sounds/OnSummon-.wav b/Mage.Client/sounds/OnSummon-.wav index 1facee015c8..63e57d3df3e 100644 Binary files a/Mage.Client/sounds/OnSummon-.wav and b/Mage.Client/sounds/OnSummon-.wav differ diff --git a/Mage.Client/sounds/OnSummon.wav b/Mage.Client/sounds/OnSummon.wav index f41a49e9a68..bf5bed88cce 100644 Binary files a/Mage.Client/sounds/OnSummon.wav and b/Mage.Client/sounds/OnSummon.wav differ diff --git a/Mage.Client/sounds/OnTapPermanent.wav b/Mage.Client/sounds/OnTapPermanent.wav index 7c33054ce49..8760020598e 100644 Binary files a/Mage.Client/sounds/OnTapPermanent.wav and b/Mage.Client/sounds/OnTapPermanent.wav differ diff --git a/Mage.Client/sounds/OnTournamentStart.wav b/Mage.Client/sounds/OnTournamentStart.wav index a6aa47f24fc..94df53fcd9f 100644 Binary files a/Mage.Client/sounds/OnTournamentStart.wav and b/Mage.Client/sounds/OnTournamentStart.wav differ diff --git a/Mage.Client/src/main/java/mage/client/MageFrame.java b/Mage.Client/src/main/java/mage/client/MageFrame.java index 73b71ead8b3..4494e6951da 100644 --- a/Mage.Client/src/main/java/mage/client/MageFrame.java +++ b/Mage.Client/src/main/java/mage/client/MageFrame.java @@ -83,7 +83,7 @@ import mage.cards.repository.CardCriteria; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; import mage.client.cards.BigCard; -import mage.client.chat.ChatPanel; +import mage.client.chat.ChatPanelBasic; import mage.client.components.MageComponents; import mage.client.components.MageDesktopManager; import mage.client.components.MageJDesktop; @@ -165,7 +165,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { private static boolean grayMode = false; private static boolean fullscreenMode = false; - private static final Map chats = new HashMap<>(); + private static final Map chats = new HashMap<>(); private static final Map games = new HashMap<>(); private static final Map drafts = new HashMap<>(); private static final MageUI ui = new MageUI(); @@ -358,6 +358,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { } else { connectDialog.showDialog(); } + setWindowTitle(); } }); @@ -369,10 +370,10 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { } } - public void setWindowTitle() { + private void setWindowTitle() { setTitle(TITLE_NAME + " Client: " - + version == null ? "" : version.toString() + " Server: " - + ((session != null && session.isConnected()) ? session.getVersionInfo() : "")); + + (version == null ? "" : version.toString()) + " Server: " + + ((session != null && session.isConnected()) ? session.getVersionInfo() : "")); } private void addTooltipContainer() { @@ -959,12 +960,12 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { if (JOptionPane.showConfirmDialog(this, "Are you sure you want to disconnect?", "Confirm disconnect", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { session.disconnect(false); tablesPane.clearChat(); - setWindowTitle(); showMessage("You have disconnected"); } } else { connectDialog.showDialog(); } + setWindowTitle(); }//GEN-LAST:event_btnConnectActionPerformed public void btnAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAboutActionPerformed @@ -1249,11 +1250,11 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { return ui; } - public static ChatPanel getChat(UUID chatId) { + public static ChatPanelBasic getChat(UUID chatId) { return chats.get(chatId); } - public static void addChat(UUID chatId, ChatPanel chatPanel) { + public static void addChat(UUID chatId, ChatPanelBasic chatPanel) { chats.put(chatId, chatPanel); } diff --git a/Mage.Client/src/main/java/mage/client/cards/BigCard.java b/Mage.Client/src/main/java/mage/client/cards/BigCard.java index 6265dc288a9..75fa5508789 100644 --- a/Mage.Client/src/main/java/mage/client/cards/BigCard.java +++ b/Mage.Client/src/main/java/mage/client/cards/BigCard.java @@ -161,6 +161,7 @@ public class BigCard extends JComponent { } public void addJXPanel(UUID cardId, JXPanel jxPanel) { + this.cardId = cardId; bigImage = null; synchronized (this) { if (this.panel != null) { remove(this.panel); } diff --git a/Mage.Client/src/main/java/mage/client/cards/Card.java b/Mage.Client/src/main/java/mage/client/cards/Card.java index ca322655e8c..1ef0d5c415f 100644 --- a/Mage.Client/src/main/java/mage/client/cards/Card.java +++ b/Mage.Client/src/main/java/mage/client/cards/Card.java @@ -1,45 +1,84 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ /* * Card.java * * Created on 17-Dec-2009, 9:20:50 PM */ - package mage.client.cards; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import javax.swing.Popup; +import javax.swing.PopupFactory; +import javax.swing.text.BadLocationException; +import javax.swing.text.Style; +import javax.swing.text.StyleConstants; +import javax.swing.text.StyleContext; +import javax.swing.text.StyledDocument; import mage.cards.CardDimensions; import mage.cards.MagePermanent; import mage.cards.Sets; import mage.cards.TextPopup; import mage.cards.action.ActionCallback; import mage.client.MageFrame; +import static mage.client.constants.Constants.CONTENT_MAX_XOFFSET; +import static mage.client.constants.Constants.FRAME_MAX_HEIGHT; +import static mage.client.constants.Constants.FRAME_MAX_WIDTH; +import static mage.client.constants.Constants.NAME_FONT_MAX_SIZE; +import static mage.client.constants.Constants.NAME_MAX_YOFFSET; +import static mage.client.constants.Constants.POWBOX_TEXT_MAX_LEFT; +import static mage.client.constants.Constants.POWBOX_TEXT_MAX_TOP; +import static mage.client.constants.Constants.SYMBOL_MAX_XOFFSET; +import static mage.client.constants.Constants.SYMBOL_MAX_YOFFSET; +import static mage.client.constants.Constants.TYPE_MAX_YOFFSET; import mage.client.game.PlayAreaPanel; import mage.client.util.Config; import mage.client.util.DefaultActionCallback; @@ -48,18 +87,11 @@ import mage.client.util.gui.ArrowBuilder; import mage.constants.CardType; import mage.constants.EnlargeMode; import mage.remote.Session; -import mage.view.*; - -import javax.swing.*; -import javax.swing.text.*; -import java.awt.*; -import java.awt.event.*; -import java.awt.image.BufferedImage; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import static mage.client.constants.Constants.*; +import mage.view.AbilityView; +import mage.view.CardView; +import mage.view.CounterView; +import mage.view.PermanentView; +import mage.view.StackAbilityView; /** * @@ -77,15 +109,18 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis protected final UUID gameId; protected final BigCard bigCard; protected CardView card; - protected Popup popup; - protected boolean popupShowing; + protected Popup tooltipPopup; + protected boolean tooltipShowing; - protected TextPopup popupText = new TextPopup(); + protected TextPopup tooltipText = new TextPopup(); protected BufferedImage background; protected BufferedImage image = new BufferedImage(FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT, BufferedImage.TYPE_INT_RGB); protected BufferedImage small; protected String backgroundName; + // if this is set, it's opened if the user right clicks on the card panel + private JPopupMenu popupMenu; + /** * Creates new form Card * @@ -126,7 +161,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis @Override public void update(PermanentView permanent) { - this.update((CardView)permanent); + this.update((CardView) permanent); } @Override @@ -141,7 +176,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis background = ImageHelper.getBackground(card, backgroundName); } - popupText.setText(getText(cardType)); + tooltipText.setText(getText(cardType)); gImage.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); gImage.setColor(Color.BLACK); @@ -159,8 +194,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis gImage.drawString(card.getName(), CONTENT_MAX_XOFFSET, NAME_MAX_YOFFSET); if (card.getCardTypes().contains(CardType.CREATURE)) { gImage.drawString(card.getPower() + "/" + card.getToughness(), POWBOX_TEXT_MAX_LEFT, POWBOX_TEXT_MAX_TOP); - } - else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { + } else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { gImage.drawString(card.getLoyalty(), POWBOX_TEXT_MAX_LEFT, POWBOX_TEXT_MAX_TOP); } @@ -174,8 +208,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis gSmall.drawString(card.getName(), Config.dimensions.contentXOffset, Config.dimensions.nameYOffset); if (card.getCardTypes().contains(CardType.CREATURE)) { gSmall.drawString(card.getPower() + "/" + card.getToughness(), Config.dimensions.powBoxTextLeft, Config.dimensions.powBoxTextTop); - } - else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { + } else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { gSmall.drawString(card.getLoyalty(), Config.dimensions.powBoxTextLeft, Config.dimensions.powBoxTextTop); } @@ -194,11 +227,10 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis protected String getText(String cardType) { StringBuilder sb = new StringBuilder(); if (card instanceof StackAbilityView || card instanceof AbilityView) { - for (String rule: getRules()) { + for (String rule : getRules()) { sb.append("\n").append(rule); } - } - else { + } else { sb.append(card.getName()); if (card.getManaCost().size() > 0) { sb.append("\n").append(card.getManaCost()); @@ -209,11 +241,10 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis } if (card.getCardTypes().contains(CardType.CREATURE)) { sb.append("\n").append(card.getPower()).append("/").append(card.getToughness()); - } - else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { + } else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { sb.append("\n").append(card.getLoyalty()); } - for (String rule: getRules()) { + for (String rule : getRules()) { sb.append("\n").append(rule); } if (card.getExpansionSetCode() != null && card.getExpansionSetCode().length() > 0) { @@ -233,8 +264,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis StringBuilder sb = new StringBuilder(); if (card.getCardTypes().contains(CardType.LAND)) { sb.append("land").append(card.getSuperTypes()).append(card.getSubTypes()); - } - else if (card.getCardTypes() != null && (card.getCardTypes().contains(CardType.CREATURE) || card.getCardTypes().contains(CardType.PLANESWALKER))) { + } else if (card.getCardTypes() != null && (card.getCardTypes().contains(CardType.CREATURE) || card.getCardTypes().contains(CardType.PLANESWALKER))) { sb.append("creature"); } sb.append(card.getColor()).append(card.getRarity()).append(card.getExpansionSetCode()); @@ -246,10 +276,11 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis StyledDocument doc = text.getStyledDocument(); try { - for (String rule: getRules()) { + for (String rule : getRules()) { doc.insertString(doc.getLength(), rule + "\n", doc.getStyle("small")); } - } catch (BadLocationException e) {} + } catch (BadLocationException e) { + } text.setCaretPosition(0); } @@ -257,12 +288,11 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis protected List getRules() { if (card.getCounters() != null) { List rules = new ArrayList<>(card.getRules()); - for (CounterView counter: card.getCounters()) { + for (CounterView counter : card.getCounters()) { rules.add(counter.getCount() + " x " + counter.getName()); } return rules; - } - else { + } else { return card.getRules(); } } @@ -270,17 +300,17 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis protected String getType(CardView card) { StringBuilder sbType = new StringBuilder(); - for (String superType: card.getSuperTypes()) { + for (String superType : card.getSuperTypes()) { sbType.append(superType).append(" "); } - for (CardType cardType: card.getCardTypes()) { + for (CardType cardType : card.getCardTypes()) { sbType.append(cardType.toString()).append(" "); } if (card.getSubTypes().size() > 0) { sbType.append("- "); - for (String subType: card.getSubTypes()) { + for (String subType : card.getSubTypes()) { sbType.append(subType).append(" "); } } @@ -288,10 +318,10 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis return sbType.toString(); } - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents @@ -343,7 +373,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis @Override public void mouseMoved(MouseEvent arg0) { this.bigCard.showTextComponent(); - this.bigCard.setCard(card.getId(), EnlargeMode.NORMAL, image, getRules()); + this.bigCard.setCard(card.getId(), EnlargeMode.NORMAL, image, getRules()); } @Override @@ -362,18 +392,18 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis @Override public void mouseEntered(MouseEvent arg0) { - if (!popupShowing) { - if (popup != null) { - popup.hide(); + if (!tooltipShowing) { + if (tooltipPopup != null) { + tooltipPopup.hide(); } PopupFactory factory = PopupFactory.getSharedInstance(); - popup = factory.getPopup(this, popupText, (int) this.getLocationOnScreen().getX() + Config.dimensions.frameWidth, (int) this.getLocationOnScreen().getY() + 40); - popup.show(); - //hack to get popup to resize to fit text - popup.hide(); - popup = factory.getPopup(this, popupText, (int) this.getLocationOnScreen().getX() + Config.dimensions.frameWidth, (int) this.getLocationOnScreen().getY() + 40); - popup.show(); - popupShowing = true; + tooltipPopup = factory.getPopup(this, tooltipText, (int) this.getLocationOnScreen().getX() + Config.dimensions.frameWidth, (int) this.getLocationOnScreen().getY() + 40); + tooltipPopup.show(); + //hack to get tooltipPopup to resize to fit text + tooltipPopup.hide(); + tooltipPopup = factory.getPopup(this, tooltipText, (int) this.getLocationOnScreen().getX() + Config.dimensions.frameWidth, (int) this.getLocationOnScreen().getY() + 40); + tooltipPopup.show(); + tooltipShowing = true; // Draw Arrows for targets List targets = card.getTargets(); @@ -383,14 +413,14 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis if (playAreaPanel != null) { Point target = playAreaPanel.getLocationOnScreen(); Point me = this.getLocationOnScreen(); - ArrowBuilder.getBuilder().addArrow(gameId, (int)me.getX() + 35, (int)me.getY(), (int)target.getX() + 40, (int)target.getY() - 40, Color.red, ArrowBuilder.Type.TARGET); + ArrowBuilder.getBuilder().addArrow(gameId, (int) me.getX() + 35, (int) me.getY(), (int) target.getX() + 40, (int) target.getY() - 40, Color.red, ArrowBuilder.Type.TARGET); } else { for (PlayAreaPanel pa : MageFrame.getGame(gameId).getPlayers().values()) { MagePermanent permanent = pa.getBattlefieldPanel().getPermanents().get(uuid); if (permanent != null) { Point target = permanent.getLocationOnScreen(); Point me = this.getLocationOnScreen(); - ArrowBuilder.getBuilder().addArrow(gameId, (int)me.getX() + 35, (int)me.getY(), (int)target.getX() + 40, (int)target.getY() + 10, Color.red, ArrowBuilder.Type.TARGET); + ArrowBuilder.getBuilder().addArrow(gameId, (int) me.getX() + 35, (int) me.getY(), (int) target.getX() + 40, (int) target.getY() + 10, Color.red, ArrowBuilder.Type.TARGET); } } } @@ -401,12 +431,12 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis @Override public void mouseExited(MouseEvent arg0) { - if(getMousePosition(true) != null) { + if (getMousePosition(true) != null) { return; } - if (popup != null) { - popup.hide(); - popupShowing = false; + if (tooltipPopup != null) { + tooltipPopup.hide(); + tooltipShowing = false; ArrowBuilder.getBuilder().removeArrowsByType(gameId, ArrowBuilder.Type.TARGET); ArrowBuilder.getBuilder().removeArrowsByType(gameId, ArrowBuilder.Type.PAIRED); ArrowBuilder.getBuilder().removeArrowsByType(gameId, ArrowBuilder.Type.SOURCE); @@ -421,8 +451,8 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis @Override public void focusLost(FocusEvent arg0) { - if (popup != null) { - popup.hide(); + if (tooltipPopup != null) { + tooltipPopup.hide(); } this.repaint(); } @@ -437,42 +467,54 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis // End of variables declaration//GEN-END:variables @Override - public void componentResized(ComponentEvent e) { } + public void componentResized(ComponentEvent e) { + } @Override - public void componentMoved(ComponentEvent e) { } + public void componentMoved(ComponentEvent e) { + } @Override - public void componentShown(ComponentEvent e) { } + public void componentShown(ComponentEvent e) { + } @Override public void componentHidden(ComponentEvent e) { - if (popup != null) { - popup.hide(); + if (tooltipPopup != null) { + tooltipPopup.hide(); } } @Override - public List getLinks() {return null;} + public List getLinks() { + return null; + } @Override - public boolean isTapped() {return false;} + public boolean isTapped() { + return false; + } @Override - public boolean isFlipped() {return false;} + public boolean isFlipped() { + return false; + } @Override - public void onBeginAnimation() {} + public void onBeginAnimation() { + } @Override - public void onEndAnimation() {} + public void onEndAnimation() { + } @Override - public void setAlpha(float transparency) {} + public void setAlpha(float transparency) { + } @Override public CardView getOriginal() { - return card; + return card; } @Override @@ -539,6 +581,14 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis public void setTextOffset(int yOffset) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } - - + + @Override + public JPopupMenu getPopupMenu() { + return popupMenu; + } + + @Override + public void setPopupMenu(JPopupMenu popupMenu) { + this.popupMenu = popupMenu; + } } diff --git a/Mage.Client/src/main/java/mage/client/cards/CardArea.java b/Mage.Client/src/main/java/mage/client/cards/CardArea.java index 1d40d21f806..783724d1a4e 100644 --- a/Mage.Client/src/main/java/mage/client/cards/CardArea.java +++ b/Mage.Client/src/main/java/mage/client/cards/CardArea.java @@ -1,56 +1,64 @@ /* -* Copyright 2012 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2012 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.client.cards; -import mage.cards.CardDimensions; -import mage.cards.MageCard; -import mage.client.plugins.impl.Plugins; -import mage.client.util.CardsViewUtil; -import mage.client.util.Config; -import mage.view.AbilityView; -import mage.view.CardView; -import mage.view.CardsView; -import mage.view.SimpleCardsView; -import org.mage.card.arcane.CardPanel; - -import javax.swing.*; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.List; import java.util.UUID; +import javax.swing.JLayeredPane; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import mage.cards.CardDimensions; +import mage.cards.MageCard; +import mage.client.plugins.impl.Plugins; +import mage.client.util.Config; +import mage.client.util.Event; +import mage.client.util.Listener; +import mage.view.AbilityView; +import mage.view.CardView; +import mage.view.CardsView; +import mage.view.SimpleCardView; +import org.mage.card.arcane.CardPanel; -public class CardArea extends JPanel { +public class CardArea extends JPanel implements MouseListener { + + protected CardEventSource cardEventSource = new CardEventSource(); private boolean reloaded = false; private final javax.swing.JLayeredPane cardArea; private final javax.swing.JScrollPane scrollPane; - private int yTextOffset; + private int yTextOffset; /** * Create the panel. @@ -68,28 +76,23 @@ public class CardArea extends JPanel { } public void cleanUp() { - for(Component comp: cardArea.getComponents()) { - if (comp instanceof CardPanel) { - ((CardPanel) comp).cleanUp(); - cardArea.remove(comp); - } - } - } - - public void loadCards(SimpleCardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, MouseListener listener) { - loadCards(CardsViewUtil.convertSimple(showCards), bigCard, dimension, gameId, listener); + for (Component comp : cardArea.getComponents()) { + if (comp instanceof CardPanel) { + ((CardPanel) comp).cleanUp(); + cardArea.remove(comp); + } + } } - public void loadCards(CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, MouseListener listener) { + public void loadCards(CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId) { this.reloaded = true; cardArea.removeAll(); if (showCards != null && showCards.size() < 10) { yTextOffset = 10; - loadCardsFew(showCards, bigCard, gameId, listener); - } - else { + loadCardsFew(showCards, bigCard, gameId); + } else { yTextOffset = 0; - loadCardsMany(showCards, bigCard, gameId, listener, dimension); + loadCardsMany(showCards, bigCard, gameId, dimension); } cardArea.revalidate(); @@ -97,28 +100,28 @@ public class CardArea extends JPanel { this.repaint(); } - public void loadCardsNarrow(CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, MouseListener listener) { + public void loadCardsNarrow(CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId) { this.reloaded = true; cardArea.removeAll(); - yTextOffset = 0; - loadCardsMany(showCards, bigCard, gameId, listener, dimension); + yTextOffset = 0; + loadCardsMany(showCards, bigCard, gameId, dimension); cardArea.revalidate(); this.revalidate(); this.repaint(); } - private void loadCardsFew(CardsView showCards, BigCard bigCard, UUID gameId, MouseListener listener) { + private void loadCardsFew(CardsView showCards, BigCard bigCard, UUID gameId) { Rectangle rectangle = new Rectangle(Config.dimensions.frameWidth, Config.dimensions.frameHeight); Dimension dimension = new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight); for (CardView card : showCards.values()) { - addCard(card, bigCard, gameId, rectangle, dimension, Config.dimensions, listener); + addCard(card, bigCard, gameId, rectangle, dimension, Config.dimensions); rectangle.translate(Config.dimensions.frameWidth, 0); } cardArea.setPreferredSize(new Dimension(Config.dimensions.frameWidth * showCards.size(), Config.dimensions.frameHeight)); } - private void addCard(CardView card, BigCard bigCard, UUID gameId, Rectangle rectangle, Dimension dimension, CardDimensions cardDimensions, MouseListener listener) { + private void addCard(CardView card, BigCard bigCard, UUID gameId, Rectangle rectangle, Dimension dimension, CardDimensions cardDimensions) { if (card instanceof AbilityView) { CardView tmp = ((AbilityView) card).getSourceCard(); tmp.overrideRules(card.getRules()); @@ -127,28 +130,26 @@ public class CardArea extends JPanel { tmp.setAbility(card); // cross-reference, required for ability picker card = tmp; } - MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, dimension, gameId, true); + MageCard cardPanel = Plugins.getInstance().getMageCard(card, bigCard, dimension, gameId, true); - cardImg.setBounds(rectangle); - if (listener != null) { - cardImg.addMouseListener(listener); - } - cardArea.add(cardImg); - cardArea.moveToFront(cardImg); - cardImg.update(card); - cardImg.setCardBounds(rectangle.x, rectangle.y, cardDimensions.frameWidth, cardDimensions.frameHeight); - cardImg.setTextOffset(yTextOffset); - cardImg.showCardTitle(); + cardPanel.setBounds(rectangle); + cardPanel.addMouseListener(this); + cardArea.add(cardPanel); + cardArea.moveToFront(cardPanel); + cardPanel.update(card); + cardPanel.setCardBounds(rectangle.x, rectangle.y, cardDimensions.frameWidth, cardDimensions.frameHeight); + cardPanel.setTextOffset(yTextOffset); + cardPanel.showCardTitle(); } - private void loadCardsMany(CardsView showCards, BigCard bigCard, UUID gameId, MouseListener listener, CardDimensions cardDimensions) { + private void loadCardsMany(CardsView showCards, BigCard bigCard, UUID gameId, CardDimensions cardDimensions) { int columns = 1; if (showCards != null && showCards.size() > 0) { Rectangle rectangle = new Rectangle(cardDimensions.frameWidth, cardDimensions.frameHeight); Dimension dimension = new Dimension(cardDimensions.frameWidth, cardDimensions.frameHeight); int count = 0; for (CardView card : showCards.values()) { - addCard(card, bigCard, gameId, rectangle, dimension, cardDimensions, listener); + addCard(card, bigCard, gameId, rectangle, dimension, cardDimensions); if (count >= 20) { rectangle.translate(cardDimensions.frameWidth, -400); columns++; @@ -169,11 +170,11 @@ public class CardArea extends JPanel { public void clearReloaded() { this.reloaded = false; } - + public void selectCards(List selected) { for (Component component : cardArea.getComponents()) { if (component instanceof MageCard) { - MageCard mageCard = (MageCard)component; + MageCard mageCard = (MageCard) component; if (selected.contains(mageCard.getOriginal().getId())) { mageCard.setSelected(true); } @@ -184,7 +185,7 @@ public class CardArea extends JPanel { public void markCards(List marked) { for (Component component : cardArea.getComponents()) { if (component instanceof MageCard) { - MageCard mageCard = (MageCard)component; + MageCard mageCard = (MageCard) component; if (marked.contains(mageCard.getOriginal().getId())) { mageCard.setChoosable(true); } @@ -192,4 +193,82 @@ public class CardArea extends JPanel { } } + public void setPopupMenu(JPopupMenu popupMenu) { + for (Component component : cardArea.getComponents()) { + if (component instanceof MageCard) { + MageCard mageCard = (MageCard) component; + mageCard.setPopupMenu(popupMenu); + } + } + } + + public void addCardEventListener(Listener listener) { + cardEventSource.addListener(listener); + } + + public void clearCardEventListeners() { + cardEventSource.clearListeners(); + } + + @Override + public void mouseClicked(MouseEvent e) { + } + + @Override + public void mousePressed(MouseEvent e) { + if (e.getClickCount() >= 1 && !e.isConsumed()) { + Object obj = e.getSource(); + if (e.getClickCount() == 2) { + e.consume(); + if (obj instanceof Card) { + if (e.isAltDown()) { + cardEventSource.altDoubleClick(((Card) obj).getOriginal(), "alt-double-click"); + } else { + cardEventSource.doubleClick(((Card) obj).getOriginal(), "double-click"); + } + } else if (obj instanceof MageCard) { + if (e.isAltDown()) { + cardEventSource.altDoubleClick(((MageCard) obj).getOriginal(), "alt-double-click"); + } else { + cardEventSource.doubleClick(((MageCard) obj).getOriginal(), "double-click"); + } + } + } + if (obj instanceof MageCard) { + checkMenu(e, ((MageCard) obj).getOriginal()); + } else { + checkMenu(e, null); + } + } + } + + @Override + public void mouseReleased(MouseEvent e) { + if (!e.isConsumed()) { + Object obj = e.getSource(); + if (obj instanceof MageCard) { + checkMenu(e, ((MageCard) obj).getOriginal()); + } else { + checkMenu(e, null); + } + } else { + cardEventSource.actionConsumedEvent("action-consumed"); + } + } + + private void checkMenu(MouseEvent Me, SimpleCardView card) { + if (Me.isPopupTrigger()) { + Me.consume(); + cardEventSource.showPopupMenuEvent(card, Me.getComponent(), Me.getX(), Me.getY(), "show-popup-menu"); + } + } + + @Override + public void mouseEntered(MouseEvent e) { + } + + @Override + public void mouseExited(MouseEvent e) { + } + } diff --git a/Mage.Client/src/main/java/mage/client/cards/CardEventSource.java b/Mage.Client/src/main/java/mage/client/cards/CardEventSource.java index 5aa243ffc10..01528dd06b0 100644 --- a/Mage.Client/src/main/java/mage/client/cards/CardEventSource.java +++ b/Mage.Client/src/main/java/mage/client/cards/CardEventSource.java @@ -1,49 +1,48 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.client.cards; import java.awt.Component; +import java.io.Serializable; import mage.client.util.Event; import mage.client.util.EventDispatcher; import mage.client.util.EventSource; import mage.client.util.Listener; import mage.view.SimpleCardView; -import java.io.Serializable; - /** * * @author BetaSteward_at_googlemail.com */ public class CardEventSource implements EventSource, Serializable { - protected final EventDispatcher dispatcher = new EventDispatcher() {}; + protected final EventDispatcher dispatcher = new EventDispatcher() { + }; @Override public void addListener(Listener listener) { @@ -74,6 +73,9 @@ public class CardEventSource implements EventSource, Serializable { dispatcher.fireEvent(new Event(card, message, x, y, component)); } + public void actionConsumedEvent(String message) { + dispatcher.fireEvent(new Event(null, message)); + } @Override public void clearListeners() { diff --git a/Mage.Client/src/main/java/mage/client/cards/CardGrid.java b/Mage.Client/src/main/java/mage/client/cards/CardGrid.java index a2369fe3149..9940628f998 100644 --- a/Mage.Client/src/main/java/mage/client/cards/CardGrid.java +++ b/Mage.Client/src/main/java/mage/client/cards/CardGrid.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -31,7 +31,6 @@ * * Created on 30-Mar-2010, 9:25:40 PM */ - package mage.client.cards; import java.awt.Component; @@ -54,6 +53,7 @@ import mage.client.plugins.impl.Plugins; import mage.client.util.Config; import mage.client.util.Event; import mage.client.util.Listener; +import mage.utils.CardUtil; import mage.view.CardView; import mage.view.CardsView; import org.mage.card.arcane.CardPanel; @@ -82,7 +82,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, } public void clear() { - for(MouseListener ml: this.getMouseListeners()) { + for (MouseListener ml : this.getMouseListeners()) { this.removeMouseListener(ml); } this.clearCardEventListeners(); @@ -101,7 +101,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, this.bigCard = bigCard; this.gameId = gameId; if (merge) { - for (CardView card: showCards.values()) { + for (CardView card : showCards.values()) { if (!cards.containsKey(card.getId())) { addCard(card, bigCard, gameId, drawImage); } @@ -115,7 +115,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, } } else { this.clearCards(); - for (CardView card: showCards.values()) { + for (CardView card : showCards.values()) { addCard(card, bigCard, gameId, drawImage); } } @@ -144,7 +144,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, int curRow = 0; if (cards.size() > 0) { Rectangle rectangle = new Rectangle(Config.dimensions.frameWidth, Config.dimensions.frameHeight); - List sortedCards = new ArrayList(cards.values()); + List sortedCards = new ArrayList<>(cards.values()); switch (sortSetting.getSortBy()) { case NAME: Collections.sort(sortedCards, new CardNameComparator()); @@ -155,15 +155,16 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, case COLOR: Collections.sort(sortedCards, new CardColorComparator()); break; - case COLOR_DETAILED: - Collections.sort(sortedCards, new CardColorDetailedComparator()); + case COLOR_IDENTITY: + Collections.sort(sortedCards, new CardColorDetailedIdentity()); break; case CASTING_COST: Collections.sort(sortedCards, new CardCostComparator()); break; + } MageCard lastCard = null; - for (MageCard cardImg: sortedCards) { + for (MageCard cardImg : sortedCards) { if (sortSetting.isPilesToggle()) { if (lastCard == null) { lastCard = cardImg; @@ -187,8 +188,9 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, curRow = 0; } break; - case COLOR_DETAILED: - if (cardImg.getOriginal().getColor().hashCode() != lastCard.getOriginal().getColor().hashCode()) { + case COLOR_IDENTITY: + if (CardUtil.getColorIdentitySortValue(cardImg.getOriginal().getManaCost(), cardImg.getOriginal().getColor(), cardImg.getOriginal().getRules()) + != CardUtil.getColorIdentitySortValue(lastCard.getOriginal().getManaCost(), lastCard.getOriginal().getColor(), lastCard.getOriginal().getRules())) { curColumn++; curRow = 0; } @@ -206,8 +208,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, moveToFront(cardImg); curRow++; lastCard = cardImg; - } - else { + } else { rectangle.setLocation(curColumn * Config.dimensions.frameWidth, curRow * 20); cardImg.setBounds(rectangle); cardImg.setCardBounds(rectangle.x, rectangle.y, Config.dimensions.frameWidth, Config.dimensions.frameHeight); @@ -221,15 +222,15 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, } } resizeArea(); - revalidate(); - repaint(); + revalidate(); + repaint(); } private void clearCards() { // remove possible mouse listeners, preventing gc - for (MageCard mageCard: cards.values()) { + for (MageCard mageCard : cards.values()) { if (mageCard instanceof CardPanel) { - ((CardPanel)mageCard).cleanUp(); + ((CardPanel) mageCard).cleanUp(); } } this.cards.clear(); @@ -237,7 +238,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, } private void removeAllCardImg() { - for (Component comp: getComponents()) { + for (Component comp : getComponents()) { if (comp instanceof Card || comp instanceof MageCard) { remove(comp); } @@ -245,14 +246,14 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, } private void removeCardImg(UUID cardId) { - for (Component comp: getComponents()) { + for (Component comp : getComponents()) { if (comp instanceof Card) { - if (((Card)comp).getCardId().equals(cardId)) { + if (((Card) comp).getCardId().equals(cardId)) { remove(comp); comp = null; } } else if (comp instanceof MageCard) { - if (((MageCard)comp).getOriginal().getId().equals(cardId)) { + if (((MageCard) comp).getOriginal().getId().equals(cardId)) { remove(comp); comp = null; } @@ -275,10 +276,10 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, cardEventSource.clearListeners(); } - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents @@ -296,10 +297,8 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, ); }// //GEN-END:initComponents - // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables - @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 && !e.isConsumed()) { @@ -322,22 +321,26 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, } @Override - public void mousePressed(MouseEvent e) {} + public void mousePressed(MouseEvent e) { + } @Override - public void mouseReleased(MouseEvent e) {} + public void mouseReleased(MouseEvent e) { + } @Override - public void mouseEntered(MouseEvent e) {} + public void mouseEntered(MouseEvent e) { + } @Override - public void mouseExited(MouseEvent e) {} + public void mouseExited(MouseEvent e) { + } private void resizeArea() { Dimension area = new Dimension(0, 0); Dimension size = getPreferredSize(); - for (Component comp: getComponents()) { + for (Component comp : getComponents()) { Rectangle r = comp.getBounds(); if (r.x + r.width > area.width) { area.width = r.x + r.width; @@ -348,13 +351,13 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener, } if (size.height != area.height || size.width != area.width) { setPreferredSize(area); - } + } } @Override public void refresh() { revalidate(); - repaint(); + repaint(); } @Override @@ -379,8 +382,7 @@ class CardRarityComparator implements Comparator { int val = o1.getOriginal().getRarity().compareTo(o2.getOriginal().getRarity()); if (val == 0) { return o1.getOriginal().getName().compareTo(o2.getOriginal().getName()); - } - else { + } else { return val; } } @@ -394,8 +396,7 @@ class CardCostComparator implements Comparator { int val = Integer.valueOf(o1.getOriginal().getConvertedManaCost()).compareTo(Integer.valueOf(o2.getOriginal().getConvertedManaCost())); if (val == 0) { return o1.getOriginal().getName().compareTo(o2.getOriginal().getName()); - } - else { + } else { return val; } } @@ -409,23 +410,22 @@ class CardColorComparator implements Comparator { int val = o1.getOriginal().getColor().compareTo(o2.getOriginal().getColor()); if (val == 0) { return o1.getOriginal().getName().compareTo(o2.getOriginal().getName()); - } - else { + } else { return val; } } } -class CardColorDetailedComparator implements Comparator { +class CardColorDetailedIdentity implements Comparator { @Override public int compare(MageCard o1, MageCard o2) { - int val = o1.getOriginal().getColor().hashCode() - o2.getOriginal().getColor().hashCode(); + int val = CardUtil.getColorIdentitySortValue(o1.getOriginal().getManaCost(), o1.getOriginal().getColor(), o1.getOriginal().getRules()) + - CardUtil.getColorIdentitySortValue(o2.getOriginal().getManaCost(), o2.getOriginal().getColor(), o2.getOriginal().getRules()); if (val == 0) { return o1.getOriginal().getName().compareTo(o2.getOriginal().getName()); - } - else { + } else { return val; } } diff --git a/Mage.Client/src/main/java/mage/client/cards/CardsList.java b/Mage.Client/src/main/java/mage/client/cards/CardsList.java index 489f18d08ef..e4bf5d2b67f 100644 --- a/Mage.Client/src/main/java/mage/client/cards/CardsList.java +++ b/Mage.Client/src/main/java/mage/client/cards/CardsList.java @@ -1,37 +1,36 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ /* * CardsList.java * * Created on Dec 18, 2009, 10:40:12 AM */ - package mage.client.cards; import java.awt.Color; @@ -59,7 +58,7 @@ import mage.client.constants.Constants.DeckEditorMode; import mage.client.constants.Constants.SortBy; import static mage.client.constants.Constants.SortBy.CASTING_COST; import static mage.client.constants.Constants.SortBy.COLOR; -import static mage.client.constants.Constants.SortBy.COLOR_DETAILED; +import static mage.client.constants.Constants.SortBy.COLOR_IDENTITY; import static mage.client.constants.Constants.SortBy.RARITY; import mage.client.deckeditor.SortSetting; import mage.client.deckeditor.table.TableModel; @@ -67,7 +66,7 @@ import mage.client.deckeditor.table.UpdateCountsCallback; import mage.client.dialog.PreferencesDialog; import mage.client.plugins.impl.Plugins; import mage.client.util.CardViewColorComparator; -import mage.client.util.CardViewColorDetailedComparator; +import mage.client.util.CardViewColorIdentityComparator; import mage.client.util.CardViewCostComparator; import mage.client.util.CardViewNameComparator; import mage.client.util.CardViewRarityComparator; @@ -86,7 +85,7 @@ import org.mage.card.arcane.CardPanel; * @author BetaSteward_at_googlemail.com */ public class CardsList extends javax.swing.JPanel implements MouseListener, ICardGrid { - + protected CardEventSource cardEventSource = new CardEventSource(); private Dimension cardDimension; private CardsView cards; @@ -98,8 +97,10 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar private TableModel mainModel; private JTable mainTable; private ICardGrid currentView; - - /** Creates new form Cards */ + + /** + * Creates new form Cards + */ public CardsList() { initComponents(); makeTransparent(); @@ -115,22 +116,22 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar mainModel.removeTableModelListener(mainTable); mainModel.clear(); } - if(cardArea != null) { - for(MouseListener ml: cardArea.getMouseListeners()) { + if (cardArea != null) { + for (MouseListener ml : cardArea.getMouseListeners()) { cardArea.removeMouseListener(ml); } } - if(mainTable != null) { - for(MouseListener ml: mainTable.getMouseListeners()) { + if (mainTable != null) { + for (MouseListener ml : mainTable.getMouseListeners()) { mainTable.removeMouseListener(ml); } } if (currentView != null) { currentView.clearCardEventListeners(); } - for (Component comp :cardArea.getComponents()) { - if (comp instanceof CardPanel) { - ((CardPanel)comp).cleanUp(); + for (Component comp : cardArea.getComponents()) { + if (comp instanceof CardPanel) { + ((CardPanel) comp).cleanUp(); } } mageCards.clear(); @@ -208,20 +209,20 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar // activate spinner for card number change mainModel.setNumberEditable(true); TableColumnModel tcm = mainTable.getColumnModel(); - TableColumn tc = tcm.getColumn(0); + TableColumn tc = tcm.getColumn(0); tc.setMaxWidth(55); tc.setMinWidth(55); tc.setPreferredWidth(55); - tc.setCellEditor(new TableSpinnerEditor(this)); + tc.setCellEditor(new TableSpinnerEditor(this)); } } - + public void handleSetNumber(int number) { if (mainTable.getSelectedRowCount() == 1) { mainModel.setNumber(mainTable.getSelectedRow(), number); - } + } } - + public void handleDoubleClick() { if (mainTable.getSelectedRowCount() > 0) { int[] n = mainTable.getSelectedRows(); @@ -232,7 +233,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar } } } - + public void handleAltDoubleClick() { if (mainTable.getSelectedRowCount() > 0) { int[] n = mainTable.getSelectedRows(); @@ -243,7 +244,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar } } } - + public ICardGrid getMainModel() { return mainModel; } @@ -256,7 +257,6 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar return list; } - public void loadCards(CardsView showCards, BigCard bigCard, UUID gameId) { int selectedRow = -1; if (currentView.equals(mainModel)) { @@ -270,7 +270,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar chkPiles.setSelected(sortSetting.isPilesToggle()); currentView.loadCards(showCards, sortSetting, bigCard, gameId); if (selectedRow >= 0) { - selectedRow = Math.min(selectedRow, mainTable.getRowCount()-1); + selectedRow = Math.min(selectedRow, mainTable.getRowCount() - 1); if (selectedRow >= 0) { mainTable.setRowSelectionInterval(selectedRow, selectedRow); } @@ -281,7 +281,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar if (cards == null) { cards = new CardsView(); } - currentView.loadCards(cards, sortSetting, bigCard, gameId); + currentView.loadCards(cards, sortSetting, bigCard, gameId); } @Override @@ -295,22 +295,21 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar Comparator comparator = null; Map oldMageCards = mageCards; mageCards = new LinkedHashMap<>(); - + //Find card view - for(UUID uuid : cards.keySet()){ - if(oldMageCards.containsKey(uuid)){ + for (UUID uuid : cards.keySet()) { + if (oldMageCards.containsKey(uuid)) { mageCards.put(uuid, oldMageCards.get(uuid)); oldMageCards.remove(uuid); - } - else{ + } else { mageCards.put(uuid, addCard(cards.get(uuid), bigCard, gameId)); } } //Remove unused cards - for(MageCard card : oldMageCards.values()){ + for (MageCard card : oldMageCards.values()) { cardArea.remove(card); } - + if (cards != null && cards.size() > 0) { Rectangle rectangle = new Rectangle(Config.dimensions.frameWidth, Config.dimensions.frameHeight); List sortedCards = new ArrayList<>(cards.values()); @@ -324,25 +323,25 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar case COLOR: comparator = new CardViewColorComparator(); break; - case COLOR_DETAILED: - comparator = new CardViewColorDetailedComparator(); + case COLOR_IDENTITY: + comparator = new CardViewColorIdentityComparator(); break; case CASTING_COST: comparator = new CardViewCostComparator(); break; } - if(comparator != null){ + if (comparator != null) { Collections.sort(sortedCards, new CardViewNameComparator()); Collections.sort(sortedCards, comparator); } CardView lastCard = null; - for (CardView card: sortedCards) { + for (CardView card : sortedCards) { if (sortSetting.isPilesToggle()) { if (lastCard == null) { lastCard = card; } - if(comparator != null){ - if(comparator.compare(card, lastCard) > 0){ + if (comparator != null) { + if (comparator.compare(card, lastCard) > 0) { curColumn++; maxRow = Math.max(maxRow, curRow); curRow = 0; @@ -350,7 +349,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar } rectangle.setLocation(curColumn * Config.dimensions.frameWidth, curRow * 20); setCardBounds(mageCards.get(card.getId()), rectangle); - + curRow++; lastCard = card; } else { @@ -368,21 +367,21 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar maxRow = Math.max(maxRow, curRow); maxColumn = Math.max(maxColumn, curColumn); updateCounts(); - cardArea.setPreferredSize(new Dimension((maxColumn+1) * Config.dimensions.frameWidth, Config.dimensions.frameHeight + maxRow*20)); + cardArea.setPreferredSize(new Dimension((maxColumn + 1) * Config.dimensions.frameWidth, Config.dimensions.frameHeight + maxRow * 20)); cardArea.revalidate(); this.revalidate(); this.repaint(); this.setVisible(true); } - - private void updateCounts(){ + + private void updateCounts() { int landCount = 0; int creatureCount = 0; int sorceryCount = 0; int instantCount = 0; int enchantmentCount = 0; - for (CardView card: cards.values()) { - if (card.getCardTypes().contains(CardType.LAND)) { + for (CardView card : cards.values()) { + if (card.getCardTypes().contains(CardType.LAND)) { landCount++; } if (card.getCardTypes().contains(CardType.CREATURE)) { @@ -398,7 +397,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar enchantmentCount++; } } - + int count = cards != null ? cards.size() : 0; this.lblCount.setText(Integer.toString(count)); this.lblCreatureCount.setText(Integer.toString(creatureCount)); @@ -418,7 +417,6 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar cardImg.addMouseListener(this); return cardImg; } - private void setCardBounds(MageCard card, Rectangle rectangle) { card.setBounds(rectangle); @@ -456,10 +454,10 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar mainModel.clearCardEventListeners(); } - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents @@ -678,9 +676,9 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar currentView = mainModel; panelCardArea.setViewportView(mainTable); cbSortBy.setEnabled(false); - chkPiles.setEnabled(false); + chkPiles.setEnabled(false); PreferencesDialog.saveValue(PreferencesDialog.KEY_DRAFT_VIEW, "listView"); - redrawCards(); + redrawCards(); }//GEN-LAST:event_jToggleListViewActionPerformed private void cbSortByActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbSortByActionPerformed @@ -698,8 +696,8 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar panelCardArea.setViewportView(cardArea); cbSortBy.setEnabled(true); chkPiles.setEnabled(true); - PreferencesDialog.saveValue(PreferencesDialog.KEY_DRAFT_VIEW, "cardView"); - redrawCards(); + PreferencesDialog.saveValue(PreferencesDialog.KEY_DRAFT_VIEW, "cardView"); + redrawCards(); }//GEN-LAST:event_jToggleCardViewActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables @@ -725,28 +723,26 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar @Override public void mousePressed(MouseEvent e) { - if (e.getClickCount() >= 1 && !e.isConsumed()) { + if (e.getClickCount() >= 1 && !e.isConsumed()) { Object obj = e.getSource(); if (e.getClickCount() == 2) { e.consume(); if (obj instanceof Card) { if (e.isAltDown()) { - cardEventSource.altDoubleClick(((Card)obj).getOriginal(), "alt-double-click"); - } - else { - cardEventSource.doubleClick(((Card)obj).getOriginal(), "double-click"); + cardEventSource.altDoubleClick(((Card) obj).getOriginal(), "alt-double-click"); + } else { + cardEventSource.doubleClick(((Card) obj).getOriginal(), "double-click"); } } else if (obj instanceof MageCard) { if (e.isAltDown()) { - cardEventSource.altDoubleClick(((MageCard)obj).getOriginal(), "alt-double-click"); - } - else { - cardEventSource.doubleClick(((MageCard)obj).getOriginal(), "double-click"); + cardEventSource.altDoubleClick(((MageCard) obj).getOriginal(), "alt-double-click"); + } else { + cardEventSource.doubleClick(((MageCard) obj).getOriginal(), "double-click"); } } } if (obj instanceof MageCard) { - checkMenu(e, ((MageCard)obj).getOriginal()); + checkMenu(e, ((MageCard) obj).getOriginal()); } else { checkMenu(e, null); } @@ -758,14 +754,14 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar if (!e.isConsumed()) { Object obj = e.getSource(); if (obj instanceof MageCard) { - checkMenu(e, ((MageCard)obj).getOriginal()); + checkMenu(e, ((MageCard) obj).getOriginal()); } else { checkMenu(e, null); } } } - private void checkMenu(MouseEvent Me, SimpleCardView card){ + private void checkMenu(MouseEvent Me, SimpleCardView card) { if (Me.isPopupTrigger()) { Me.consume(); cardEventSource.showPopupMenuEvent(card, Me.getComponent(), Me.getX(), Me.getY(), "show-popup-menu"); diff --git a/Mage.Client/src/main/java/mage/client/cards/Permanent.java b/Mage.Client/src/main/java/mage/client/cards/Permanent.java index e7401b39de4..a01e368641d 100644 --- a/Mage.Client/src/main/java/mage/client/cards/Permanent.java +++ b/Mage.Client/src/main/java/mage/client/cards/Permanent.java @@ -254,20 +254,20 @@ public class Permanent extends Card { @Override public void mouseEntered(MouseEvent arg0) { - if (!popupShowing) { - if (popup != null) { - popup.hide(); + if (!tooltipShowing) { + if (tooltipPopup != null) { + tooltipPopup.hide(); } PopupFactory factory = PopupFactory.getSharedInstance(); int x = (int) this.getLocationOnScreen().getX() + (permanent.isTapped()?Config.dimensions.frameHeight:Config.dimensions.frameWidth); int y = (int) this.getLocationOnScreen().getY() + 40; - popup = factory.getPopup(this, popupText, x, y); - popup.show(); - //hack to get popup to resize to fit text - popup.hide(); - popup = factory.getPopup(this, popupText, x, y); - popup.show(); - popupShowing = true; + tooltipPopup = factory.getPopup(this, tooltipText, x, y); + tooltipPopup.show(); + //hack to get tooltipPopup to resize to fit text + tooltipPopup.hide(); + tooltipPopup = factory.getPopup(this, tooltipText, x, y); + tooltipPopup.show(); + tooltipShowing = true; } } diff --git a/Mage.Client/src/main/java/mage/client/chat/ChatPanelBasic.form b/Mage.Client/src/main/java/mage/client/chat/ChatPanelBasic.form new file mode 100644 index 00000000000..70c347f0639 --- /dev/null +++ b/Mage.Client/src/main/java/mage/client/chat/ChatPanelBasic.form @@ -0,0 +1,69 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java b/Mage.Client/src/main/java/mage/client/chat/ChatPanelBasic.java similarity index 52% rename from Mage.Client/src/main/java/mage/client/chat/ChatPanel.java rename to Mage.Client/src/main/java/mage/client/chat/ChatPanelBasic.java index b20e0a9f6f4..b096fef13c9 100644 --- a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java +++ b/Mage.Client/src/main/java/mage/client/chat/ChatPanelBasic.java @@ -35,82 +35,65 @@ package mage.client.chat; import java.awt.Color; import java.awt.event.KeyEvent; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; import java.util.UUID; -import javax.swing.Icon; import javax.swing.JTextField; -import javax.swing.table.AbstractTableModel; -import javax.swing.table.JTableHeader; -import javax.swing.table.TableColumnModel; import mage.client.MageFrame; -import static mage.client.dialog.PreferencesDialog.KEY_USERS_COLUMNS_ORDER; -import static mage.client.dialog.PreferencesDialog.KEY_USERS_COLUMNS_WIDTH; -import mage.client.util.MageTableRowSorter; -import mage.client.util.gui.TableUtil; -import mage.client.util.gui.countryBox.CountryCellRenderer; -import mage.remote.MageRemoteException; import mage.remote.Session; import mage.view.ChatMessage.MessageColor; import mage.view.ChatMessage.MessageType; -import mage.view.RoomUsersView; -import mage.view.UsersView; import org.mage.card.arcane.ManaSymbols; /** * * @author BetaSteward_at_googlemail.com, nantuko */ -public class ChatPanel extends javax.swing.JPanel { +public class ChatPanelBasic extends javax.swing.JPanel { - private UUID chatId; - private Session session; - private final List players = new ArrayList<>(); - private final UserTableModel userTableModel; + protected UUID chatId; + protected Session session; /** * Chat message color for opponents. */ - private static final String OPPONENT_COLOR = "#FF7F50"; + protected static final String OPPONENT_COLOR = "#FF7F50"; /** * Chat message color for client player. */ - private static final String MY_COLOR = "#7FFFD4"; + protected static final String MY_COLOR = "#7FFFD4"; /** * Chat message color for timestamps. */ - private static final String TIMESTAMP_COLOR = "#CCCC33"; + protected static final String TIMESTAMP_COLOR = "#CCCC33"; /** * Chat message color for messages. */ - private static final String MESSAGE_COLOR = "White"; + protected static final String MESSAGE_COLOR = "White"; /** * Chat message color for personal infos. */ - private static final String USER_INFO_COLOR = "Yellow"; + protected static final String USER_INFO_COLOR = "Yellow"; /** * Chat message color for status infos. */ - private static final String STATUS_COLOR = "#FFCC33"; + protected static final String STATUS_COLOR = "#FFCC33"; /** * Alpha value for transparency (255 = not transparent) */ - private static final int ALPHA = 80; + public static final int CHAT_ALPHA = 80; /** * This will be a chat that will be connected to {this} and will handle * redirected messages; Mostly used to redirect user messages to another * window. */ - private ChatPanel connectedChat; + protected ChatPanelBasic connectedChat; /** * Parent chat this chat connected to. Used to send messages using parent * chat as it is the only one connected to server. */ - private ChatPanel parentChatRef; + protected ChatPanelBasic parentChatRef; /** * Selected extended view mode. */ - private VIEW_MODE extendedViewMode = VIEW_MODE.NONE; + protected VIEW_MODE extendedViewMode = VIEW_MODE.NONE; public enum VIEW_MODE { @@ -120,57 +103,31 @@ public class ChatPanel extends javax.swing.JPanel { * Controls the output start messages as the chat panel is created * */ - private ChatType chatType = ChatType.DEFAULT; - - private static final int[] defaultColumnsWidth = {20, 100, 100, 80, 80}; + protected ChatType chatType = ChatType.DEFAULT; public enum ChatType { DEFAULT, GAME, TABLES, TOURNAMENT } - private boolean startMessageDone = false; + protected boolean startMessageDone = false; /** - * Creates new form ChatPanel - */ - public ChatPanel() { - this(false); - } - - /** - * @param addPlayersTab if true, adds chat/players tabs - */ - /** + * * Creates new form ChatPanel * - * @param addPlayersTab */ - public ChatPanel(boolean addPlayersTab) { - userTableModel = new UserTableModel(); + public ChatPanelBasic() { initComponents(); - setBackground(new Color(0, 0, 0, ALPHA)); - jTablePlayers.setBackground(new Color(0, 0, 0, ALPHA)); - jTablePlayers.setForeground(Color.white); - jTablePlayers.setRowSorter(new MageTableRowSorter(userTableModel)); - - TableUtil.setColumnWidthAndOrder(jTablePlayers, defaultColumnsWidth, KEY_USERS_COLUMNS_WIDTH, KEY_USERS_COLUMNS_ORDER); - jTablePlayers.setDefaultRenderer(Icon.class, new CountryCellRenderer()); + setBackground(new Color(0, 0, 0, CHAT_ALPHA)); if (jScrollPaneTxt != null) { - jScrollPaneTxt.setBackground(new Color(0, 0, 0, ALPHA)); - jScrollPaneTxt.getViewport().setBackground(new Color(0, 0, 0, ALPHA)); - } - if (jScrollPanePlayers != null) { - jScrollPanePlayers.setBackground(new Color(0, 0, 0, ALPHA)); - jScrollPanePlayers.getViewport().setBackground(new Color(0, 0, 0, ALPHA)); - } - if (!addPlayersTab) { - simplifyComponents(); + jScrollPaneTxt.setBackground(new Color(0, 0, 0, CHAT_ALPHA)); + jScrollPaneTxt.getViewport().setBackground(new Color(0, 0, 0, CHAT_ALPHA)); } } public void cleanUp() { - TableUtil.saveColumnWidthAndOrderToPrefs(jTablePlayers, KEY_USERS_COLUMNS_WIDTH, KEY_USERS_COLUMNS_ORDER); + } public ChatType getChatType() { @@ -254,7 +211,7 @@ public class ChatPanel extends javax.swing.JPanel { this.txtConversation.append(text.toString()); } - private String getColoredText(String color, String text) { + protected String getColoredText(String color, String text) { StringBuilder sb = new StringBuilder(); sb.append(" choices; diff --git a/Mage.Client/src/main/java/mage/client/constants/Constants.java b/Mage.Client/src/main/java/mage/client/constants/Constants.java index 969a9654c67..1ea8c4a1e9d 100644 --- a/Mage.Client/src/main/java/mage/client/constants/Constants.java +++ b/Mage.Client/src/main/java/mage/client/constants/Constants.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.client.constants; import java.io.File; @@ -37,6 +36,7 @@ import javax.swing.border.Border; * @author BetaSteward_at_googlemail.com */ public final class Constants { + private Constants() { throw new AssertionError(); } @@ -69,7 +69,7 @@ public final class Constants { public static final int POWBOX_TEXT_MAX_LEFT = 212; public static final int DAMAGE_MAX_LEFT = 180; - public static final Border EMPTY_BORDER = BorderFactory.createEmptyBorder(2,2,2,2); + public static final Border EMPTY_BORDER = BorderFactory.createEmptyBorder(2, 2, 2, 2); public static final double SCALE_FACTOR = 0.5; @@ -80,26 +80,29 @@ public final class Constants { public static final String RESOURCE_PATH_SET = IO.imageBaseDir + "sets" + File.separator; public static final String RESOURCE_PATH_SET_SMALL = RESOURCE_PATH_SET + File.separator + "small" + File.separator; public static final String BASE_SOUND_PATH = "sounds" + File.separator; - public static final String BASE_MUSICS_PATH = "music" + File.separator ; - + public static final String BASE_MUSICS_PATH = "music" + File.separator; + public interface IO { + String imageBaseDir = "plugins" + File.separator + "images" + File.separator; String IMAGE_PROPERTIES_FILE = "image.url.properties"; } public enum DeckEditorMode { + FREE_BUILDING, LIMITED_BUILDING, SIDEBOARDING } public enum SortBy { - CASTING_COST ("Casting Cost"), - RARITY ("Rarity"), - COLOR ("Color"), - COLOR_DETAILED ("Color Detailed"), - NAME ("Name"), - UNSORTED ("Unsorted"); + + CASTING_COST("Casting Cost"), + RARITY("Rarity"), + COLOR("Color"), + COLOR_IDENTITY("Color Identity"), + NAME("Name"), + UNSORTED("Unsorted"); private final String text; @@ -120,8 +123,8 @@ public final class Constants { return RARITY; case "Color": return COLOR; - case "Color Detailed": - return COLOR_DETAILED; + case "Color Identity": + return COLOR_IDENTITY; case "Name": return NAME; default: diff --git a/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java b/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java index 2a7d8570191..67429dd5e8c 100644 --- a/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java +++ b/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java @@ -27,21 +27,24 @@ */ package mage.client.deck.generator; -import java.util.*; - +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; import mage.cards.Card; import mage.cards.decks.Deck; import mage.cards.repository.CardCriteria; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; -import mage.cards.repository.ExpansionInfo; import mage.cards.repository.ExpansionRepository; import mage.client.dialog.PreferencesDialog; import mage.client.util.sets.ConstructedFormats; import mage.constants.CardType; import mage.constants.ColoredManaSymbol; import mage.constants.Rarity; - +import mage.util.TournamentUtil; /** * Generates random card pool and builds a deck. @@ -57,6 +60,7 @@ public class DeckGenerator { /** * Builds a deck out of the selected block/set/format. + * * @return a path to the generated deck. */ public static String generateDeck() { @@ -70,7 +74,6 @@ public class DeckGenerator { return PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_DECK_FILE, null); } - protected static Deck buildDeck() { String selectedColors = genDialog.getSelectedColors(); @@ -100,6 +103,7 @@ public class DeckGenerator { /** * If the user has selected random colors, pick them randomly for the user. + * * @param selectedColors a string of the colors selected. * @return a String representation of the new colors chosen. */ @@ -130,9 +134,10 @@ public class DeckGenerator { } /** - * Generates all the cards to use in the deck. - * Adds creatures, non-creatures, lands (including non-basic). - * Fixes the deck, adjusting for size and color of the cards retrieved. + * Generates all the cards to use in the deck. Adds creatures, + * non-creatures, lands (including non-basic). Fixes the deck, adjusting for + * size and color of the cards retrieved. + * * @param deckSize how big the deck is to generate. * @param allowedColors which colors are allowed in the deck. * @param setsToUse which sets to use to retrieve cards for this deck. @@ -148,16 +153,18 @@ public class DeckGenerator { creatureCriteria.setCodes(sets); creatureCriteria.notTypes(CardType.LAND); creatureCriteria.types(CardType.CREATURE); - if (!(genDialog.useArtifacts())) + if (!(genDialog.useArtifacts())) { creatureCriteria.notTypes(CardType.ARTIFACT); + } // Non-creatures (sorcery, instant, enchantment, artifact etc.) final CardCriteria nonCreatureCriteria = new CardCriteria(); nonCreatureCriteria.setCodes(sets); nonCreatureCriteria.notTypes(CardType.LAND); nonCreatureCriteria.notTypes(CardType.CREATURE); - if (!(genDialog.useArtifacts())) + if (!(genDialog.useArtifacts())) { nonCreatureCriteria.notTypes(CardType.ARTIFACT); + } // Non-basic land final CardCriteria nonBasicLandCriteria = new CardCriteria(); @@ -176,15 +183,18 @@ public class DeckGenerator { return genPool.getDeck(); } - /** - * Generates all spells for the deck. - * Each card is retrieved from the database and checked against the converted mana cost (CMC) needed for the current card pool. - * If a card's CMC matches the CMC range required by the pool, it is added to the deck. - * This ensures that the majority of cards fit a fixed mana curve for the deck, and it is playable. - * Creatures and non-creatures are retrieved separately to ensure the deck contains a reasonable mix of both. + * Generates all spells for the deck. Each card is retrieved from the + * database and checked against the converted mana cost (CMC) needed for the + * current card pool. If a card's CMC matches the CMC range required by the + * pool, it is added to the deck. This ensures that the majority of cards + * fit a fixed mana curve for the deck, and it is playable. Creatures and + * non-creatures are retrieved separately to ensure the deck contains a + * reasonable mix of both. + * * @param criteria the criteria to search for in the database. - * @param spellCount the number of spells that match the criteria needed in the deck. + * @param spellCount the number of spells that match the criteria needed in + * the deck. */ private static void generateSpells(CardCriteria criteria, int spellCount) { List cardPool = CardRepository.instance.findCards(criteria); @@ -211,8 +221,9 @@ public class DeckGenerator { } else { if (reservesAdded < (genPool.getDeckSize() / 2)) { added = genPool.tryAddReserve(card, cardCMC); - if(added) + if (added) { reservesAdded++; + } } } } @@ -230,11 +241,13 @@ public class DeckGenerator { } /** - * Generates all the lands for the deck. - * Generates non-basic if selected by the user and if the deck isn't monocolored. - * Will fetch non-basic lands if required and then fill up the remaining space with basic lands. - * Basic lands are adjusted according to the mana symbols seen in the cards used in this deck. - * Usually the lands will be well balanced relative to the color of cards. + * Generates all the lands for the deck. Generates non-basic if selected by + * the user and if the deck isn't monocolored. Will fetch non-basic lands if + * required and then fill up the remaining space with basic lands. Basic + * lands are adjusted according to the mana symbols seen in the cards used + * in this deck. Usually the lands will be well balanced relative to the + * color of cards. + * * @param criteria the criteria of the lands to search for in the database. * @param landsCount the amount of lands required for this deck. * @param basicLands information about the basic lands from the sets used. @@ -280,47 +293,13 @@ public class DeckGenerator { /** * Returns a map of colored mana symbol to basic land cards of that color. + * * @param setsToUse which sets to retrieve basic lands from. * @return a map of color to basic lands. */ private static Map> generateBasicLands(List setsToUse) { - List landSets = new LinkedList<>(); - - // decide from which sets basic lands are taken from - for (String setCode :setsToUse) { - ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode); - if (expansionInfo.hasBasicLands()) { - landSets.add(expansionInfo.getCode()); - } - } - - // if sets have no basic land, take land from block - if (landSets.isEmpty()) { - for (String setCode :setsToUse) { - ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode); - List blockSets = ExpansionRepository.instance.getSetsFromBlock(expansionInfo.getBlockName()); - for (ExpansionInfo blockSet: blockSets) { - if (blockSet.hasBasicLands()) { - landSets.add(blockSet.getCode()); - } - } - } - } - // if still no set with lands found, take one by random - if (landSets.isEmpty()) { - // if sets have no basic lands and also it has no parent or parent has no lands get last set with lands - // select a set with basic lands by random - Random generator = new Random(); - List basicLandSets = ExpansionRepository.instance.getSetsWithBasicLandsByReleaseDate(); - if (basicLandSets.size() > 0) { - landSets.add(basicLandSets.get(generator.nextInt(basicLandSets.size())).getCode()); - } - } - - if (landSets.isEmpty()) { - throw new IllegalArgumentException("No set with basic land was found"); - } + Set landSets = TournamentUtil.getLandSetCodeForDeckSets(setsToUse); CardCriteria criteria = new CardCriteria(); if (!landSets.isEmpty()) { @@ -329,7 +308,7 @@ public class DeckGenerator { Map> basicLandMap = new HashMap<>(); - for(ColoredManaSymbol c: ColoredManaSymbol.values()) { + for (ColoredManaSymbol c : ColoredManaSymbol.values()) { String landName = DeckGeneratorPool.getBasicLandName(c.toString()); criteria.rarities(Rarity.LAND).name(landName); List cards = CardRepository.instance.findCards(criteria); @@ -339,11 +318,14 @@ public class DeckGenerator { } /** - * Once any non-basic lands are added, add basic lands until the deck is filled. + * Once any non-basic lands are added, add basic lands until the deck is + * filled. + * * @param landsNeeded how many remaining lands are needed. * @param percentage the percentage needed for each color in the final deck. * @param count how many of each color can be produced by non-basic lands. - * @param basicLands list of information about basic lands from the database. + * @param basicLands list of information about basic lands from the + * database. */ private static void addBasicLands(int landsNeeded, Map percentage, Map count, Map> basicLands) { int colorTotal = 0; @@ -369,8 +351,9 @@ public class DeckGenerator { int currentCount = count.get(color.toString()); double thisPercentage = 0.0; // Calculate the percentage of lands so far that produce this color - if (currentCount > 0) + if (currentCount > 0) { thisPercentage = (currentCount / (double) colorTotal) * 100.0; + } // Check if the color is the most "needed" (highest percentage) we have seen so far if (neededPercentage - thisPercentage > minPercentage) { // Put this color land forward to be added @@ -378,7 +361,7 @@ public class DeckGenerator { minPercentage = (neededPercentage - thisPercentage); } } - if(colorToAdd != null) { + if (colorToAdd != null) { genPool.addCard(getBasicLand(colorToAdd, basicLands)); count.put(colorToAdd.toString(), count.get(colorToAdd.toString()) + 1); colorTotal++; @@ -389,15 +372,17 @@ public class DeckGenerator { /** * Return a random basic land of the chosen color. + * * @param color the color the basic land should produce. - * @param basicLands list of information about basic lands from the database. + * @param basicLands list of information about basic lands from the + * database. * @return a single basic land that produces the color needed. */ private static Card getBasicLand(ColoredManaSymbol color, Map> basicLands) { Random random = new Random(); String landName = DeckGeneratorPool.getBasicLandName(color.toString()); - return basicLands.get(landName).get(random.nextInt(basicLands.size() - 1)).getMockCard().copy(); + List basicLandsInfo = basicLands.get(landName); + return basicLandsInfo.get(random.nextInt(basicLandsInfo.size() - 1)).getMockCard().copy(); } - } diff --git a/Mage.Client/src/main/java/mage/client/deck/generator/DeckGeneratorPool.java b/Mage.Client/src/main/java/mage/client/deck/generator/DeckGeneratorPool.java index d45838990ee..3e92fef086e 100644 --- a/Mage.Client/src/main/java/mage/client/deck/generator/DeckGeneratorPool.java +++ b/Mage.Client/src/main/java/mage/client/deck/generator/DeckGeneratorPool.java @@ -385,6 +385,12 @@ public class DeckGeneratorPool if(spellSize < nonLandSize) { int spellsNeeded = nonLandSize-spellSize; + + // If we haven't got enough spells in reserve to fulfil the amount we need, we can't continue. + if(reserveSpells.size() < spellsNeeded) { + throw new IllegalStateException("Not enough cards found to generate deck. Please try again"); + } + List spellsToAdd = new ArrayList<>(spellsNeeded); // Initial reservoir @@ -401,7 +407,6 @@ public class DeckGeneratorPool // Add randomly selected spells needed deckCards.addAll(spellsToAdd); } - // More spells than needed else if(spellSize > (deckSize - landCount)) { @@ -410,8 +415,11 @@ public class DeckGeneratorPool deckCards.remove(random.nextInt(deckCards.size())); } } - if(deckCards.size() != nonLandSize) + + // Not strictly necessary as we check when adding cards, but worth double checking anyway. + if(deckCards.size() != nonLandSize) { throw new IllegalStateException("Not enough cards found to generate deck. Please try again"); + } // Return the fixed amount return deckCards; diff --git a/Mage.Client/src/main/java/mage/client/dialog/AddLandDialog.java b/Mage.Client/src/main/java/mage/client/dialog/AddLandDialog.java index f198e866d29..9b25eea3712 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/AddLandDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/AddLandDialog.java @@ -57,7 +57,7 @@ public class AddLandDialog extends MageDialog { private static final Logger logger = Logger.getLogger(MageDialog.class); private Deck deck; - private final Set setCodesland = new HashSet<>(); + private final Set landSetCodes = new HashSet<>(); private static final int DEFAULT_SEALED_DECK_CARD_NUMBER = 40; @@ -71,27 +71,27 @@ public class AddLandDialog extends MageDialog { public void showDialog(Deck deck, DeckEditorMode mode) { this.deck = deck; - SortedSet landSets = new TreeSet<>(); + SortedSet landSetNames = new TreeSet<>(); if (!mode.equals(DeckEditorMode.FREE_BUILDING)) { // decide from which sets basic lands are taken from for (String setCode : deck.getExpansionSetCodes()) { ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode); if (expansionInfo != null && expansionInfo.hasBasicLands()) { - this.setCodesland.add(expansionInfo.getCode()); - landSets.add(expansionInfo.getName()); + this.landSetCodes.add(expansionInfo.getCode()); + landSetNames.add(expansionInfo.getName()); } } // if sets have no basic land, take land from block - if (this.setCodesland.isEmpty()) { + if (this.landSetCodes.isEmpty()) { for (String setCode : deck.getExpansionSetCodes()) { ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode); if (expansionInfo != null) { List blockSets = ExpansionRepository.instance.getSetsFromBlock(expansionInfo.getBlockName()); for (ExpansionInfo blockSet : blockSets) { if (blockSet.hasBasicLands()) { - this.setCodesland.add(blockSet.getCode()); - landSets.add(blockSet.getName()); + this.landSetCodes.add(blockSet.getCode()); + landSetNames.add(blockSet.getName()); } } } @@ -99,19 +99,19 @@ public class AddLandDialog extends MageDialog { } } // if still no set with lands found, add list of all available - if (this.setCodesland.isEmpty()) { + if (this.landSetCodes.isEmpty()) { List basicLandSets = ExpansionRepository.instance.getSetsWithBasicLandsByReleaseDate(); for (ExpansionInfo expansionInfo : basicLandSets) { - landSets.add(expansionInfo.getName()); + landSetNames.add(expansionInfo.getName()); } } - if (landSets.isEmpty()) { + if (landSetNames.isEmpty()) { throw new IllegalArgumentException("No set with basic land was found"); } - if (landSets.size() > 1) { - landSets.add(""); + if (landSetNames.size() > 1) { + landSetNames.add(""); } - cbLandSet.setModel(new DefaultComboBoxModel(landSets.toArray())); + cbLandSet.setModel(new DefaultComboBoxModel(landSetNames.toArray())); MageFrame.getDesktop().add(this, JLayeredPane.PALETTE_LAYER); this.setVisible(true); @@ -123,7 +123,7 @@ public class AddLandDialog extends MageDialog { CardCriteria criteria = new CardCriteria(); if (landSetName.equals("")) { - criteria.setCodes(setCodesland.toArray(new String[setCodesland.size()])); + criteria.setCodes(landSetCodes.toArray(new String[landSetCodes.size()])); } else { ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByName(landSetName); if (expansionInfo == null) { diff --git a/Mage.Client/src/main/java/mage/client/dialog/CardInfoWindowDialog.java b/Mage.Client/src/main/java/mage/client/dialog/CardInfoWindowDialog.java index 284852f6c0b..59b6a23fa66 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/CardInfoWindowDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/CardInfoWindowDialog.java @@ -36,8 +36,6 @@ package mage.client.dialog; import java.awt.Point; import java.beans.PropertyVetoException; import java.util.UUID; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.ImageIcon; import javax.swing.SwingUtilities; import javax.swing.event.InternalFrameAdapter; @@ -50,6 +48,7 @@ import mage.client.util.gui.GuiDisplayUtil; import mage.view.CardsView; import mage.view.ExileView; import mage.view.SimpleCardsView; +import org.apache.log4j.Logger; import org.mage.plugins.card.utils.impl.ImageManagerImpl; /** @@ -58,6 +57,8 @@ import org.mage.plugins.card.utils.impl.ImageManagerImpl; */ public class CardInfoWindowDialog extends MageDialog { + private static final Logger logger = Logger.getLogger(CardInfoWindowDialog.class); + public static enum ShowType { REVEAL, REVEAL_TOP_LIBRARY, LOOKED_AT, EXILE, GRAVEYARD, OTHER @@ -123,7 +124,7 @@ public class CardInfoWindowDialog extends MageDialog { try { this.setIcon(false); } catch (PropertyVetoException ex) { - Logger.getLogger(CardInfoWindowDialog.class.getName()).log(Level.SEVERE, null, ex); + logger.error(null, ex); } } } else { diff --git a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java index 0eec9111ea9..ba8cbb2bf65 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java @@ -1,46 +1,39 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ /* * ConnectDialog.java * * Created on 20-Jan-2010, 9:37:07 PM */ - package mage.client.dialog; -import mage.client.MageFrame; -import mage.client.util.Config; -import mage.remote.Connection; -import org.apache.log4j.Logger; - -import javax.swing.*; -import java.awt.*; +import java.awt.Cursor; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; @@ -63,10 +56,17 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import javax.swing.JOptionPane; +import javax.swing.SwingWorker; +import mage.client.MageFrame; +import static mage.client.dialog.PreferencesDialog.KEY_CONNECTION_URL_SERVER_LIST; import static mage.client.dialog.PreferencesDialog.KEY_CONNECT_AUTO_CONNECT; import static mage.client.dialog.PreferencesDialog.KEY_CONNECT_FLAG; +import mage.client.util.Config; import mage.client.util.gui.countryBox.CountryItemEditor; +import mage.remote.Connection; import mage.remote.Connection.ProxyType; +import org.apache.log4j.Logger; /** * @author BetaSteward_at_googlemail.com @@ -101,11 +101,11 @@ public class ConnectDialog extends MageDialog { this.txtUserName.setText(MageFrame.getPreferences().get("userName", "")); this.chkAutoConnect.setSelected(Boolean.parseBoolean(MageFrame.getPreferences().get(KEY_CONNECT_AUTO_CONNECT, "false"))); this.chkForceUpdateDB.setSelected(false); // has always to be set manually to force comparison - + String selectedFlag = MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world"); // set the selected country/flag for (int i = 0; i < cbFlag.getItemCount(); i++) { - String[] name = (String[])cbFlag.getItemAt(i); + String[] name = (String[]) cbFlag.getItemAt(i); if (name[1].equals(selectedFlag)) { cbFlag.setSelectedIndex(i); break; @@ -124,10 +124,9 @@ public class ConnectDialog extends MageDialog { } /** - * This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents @@ -293,7 +292,7 @@ public class ConnectDialog extends MageDialog { private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed MageFrame.getPreferences().put("autoConnect", Boolean.toString(chkAutoConnect.isSelected())); - MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor)cbFlag.getEditor()).getImageItem()); + MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor) cbFlag.getEditor()).getImageItem()); if (task != null && !task.isDone()) { task.cancel(true); } else { @@ -329,7 +328,7 @@ public class ConnectDialog extends MageDialog { connection.setPort(Integer.valueOf(this.txtPort.getText().trim())); connection.setUsername(this.txtUserName.getText().trim()); connection.setForceDBComparison(this.chkForceUpdateDB.isSelected()); - MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor)cbFlag.getEditor()).getImageItem()); + MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor) cbFlag.getEditor()).getImageItem()); ProxyType configProxyType = Connection.ProxyType.valueByText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PROXY_TYPE, "None")); @@ -354,8 +353,8 @@ public class ConnectDialog extends MageDialog { } // pref settings - MageFrame.getInstance().setUserPrefsToConnection(connection); - + MageFrame.getInstance().setUserPrefsToConnection(connection); + logger.debug("connecting: " + connection.getProxyType() + " " + connection.getProxyHost() + " " + connection.getProxyPort()); task = new ConnectTask(); task.execute(); @@ -385,7 +384,7 @@ public class ConnectDialog extends MageDialog { get(CONNECTION_TIMEOUT_MS, TimeUnit.MILLISECONDS); setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); if (result) { - lblStatus.setText(""); + lblStatus.setText(""); connected(); MageFrame.getInstance().showGames(false); } else { @@ -412,7 +411,6 @@ public class ConnectDialog extends MageDialog { this.hideDialog(); } - private void keyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_keyTyped char c = evt.getKeyChar(); if (!Character.isDigit(c)) { @@ -428,8 +426,12 @@ public class ConnectDialog extends MageDialog { private void findPublicServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed BufferedReader in = null; try { - - URL serverListURL = new URL(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONNECTION_URL_SERVER_LIST, "http://xmage.de/files/server-list.txt")); + String serverUrl = PreferencesDialog.getCachedValue(KEY_CONNECTION_URL_SERVER_LIST, "http://xmage.de/files/server-list.txt"); + if (serverUrl.contains("xmage.info/files/")) { + serverUrl = serverUrl.replace("xmage.info/files/", "xmage.de/files/"); // replace old URL if still saved + PreferencesDialog.saveValue(KEY_CONNECTION_URL_SERVER_LIST, serverUrl); + } + URL serverListURL = new URL(serverUrl); Connection.ProxyType configProxyType = Connection.ProxyType.valueByText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PROXY_TYPE, "None")); Proxy p = null; @@ -465,12 +467,12 @@ public class ConnectDialog extends MageDialog { boolean URLNotFound = false; try { in = new BufferedReader(new InputStreamReader(serverListURL.openConnection(p).getInputStream())); - } catch (SocketTimeoutException |FileNotFoundException | UnknownHostException ex ) { + } catch (SocketTimeoutException | FileNotFoundException | UnknownHostException ex) { logger.warn("Could not read serverlist from: " + serverListURL.toString()); File f = new File("serverlist.txt"); if (f.exists() && !f.isDirectory()) { logger.info("Using buffered serverlist: serverlist.txt"); - URLNotFound = true; + URLNotFound = true; in = new BufferedReader(new FileReader("serverlist.txt")); } } @@ -518,7 +520,7 @@ public class ConnectDialog extends MageDialog { JOptionPane.showMessageDialog(null, "Wrong server data format."); } } - + } catch (Exception ex) { logger.error(ex, ex); } finally { @@ -539,7 +541,6 @@ public class ConnectDialog extends MageDialog { // TODO add your handling code here: }//GEN-LAST:event_chkForceUpdateDBActionPerformed - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCancel; private javax.swing.JButton btnConnect; diff --git a/Mage.Client/src/main/java/mage/client/dialog/FeedbackDialog.java b/Mage.Client/src/main/java/mage/client/dialog/FeedbackDialog.java index dc3c892658e..dfe0a233092 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/FeedbackDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/FeedbackDialog.java @@ -40,7 +40,7 @@ import javax.swing.*; */ public class FeedbackDialog extends javax.swing.JDialog { - private static final transient Logger log = Logger.getLogger(PreferencesDialog.class); + private static final Logger log = Logger.getLogger(PreferencesDialog.class); private String[] feedbackTypes = {"", "Bug or \"something doesn't work\"", "Feature or \"I need that function\"", diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java b/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java index 9f0dd4a6494..71135fc7983 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTableDialog.java @@ -1,30 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.client.dialog; import java.io.FileNotFoundException; @@ -71,7 +71,9 @@ public class NewTableDialog extends MageDialog { private static final String LIMITED = "Limited"; - /** Creates new form NewTableDialog */ + /** + * Creates new form NewTableDialog + */ public NewTableDialog() { session = MageFrame.getSession(); lastSessionId = ""; @@ -79,13 +81,13 @@ public class NewTableDialog extends MageDialog { player1Panel.showLevel(false); this.spnNumWins.setModel(new SpinnerNumberModel(1, 1, 5, 1)); this.spnFreeMulligans.setModel(new SpinnerNumberModel(0, 0, 5, 1)); - MageFrame.getUI().addButton(MageComponents.NEW_TABLE_OK_BUTTON, btnOK); + MageFrame.getUI().addButton(MageComponents.NEW_TABLE_OK_BUTTON, btnOK); } - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents @@ -361,7 +363,7 @@ public class NewTableDialog extends MageDialog { GameTypeView gameType = (GameTypeView) cbGameType.getSelectedItem(); MatchOptions options = new MatchOptions(this.txtName.getText(), gameType.getName()); options.getPlayerTypes().add("Human"); - for (TablePlayerPanel player: players) { + for (TablePlayerPanel player : players) { options.getPlayerTypes().add(player.getPlayerType()); } options.setDeckType((String) this.cbDeckType.getSelectedItem()); @@ -370,9 +372,9 @@ public class NewTableDialog extends MageDialog { options.setAttackOption((MultiplayerAttackOption) this.cbAttackOption.getSelectedItem()); options.setSkillLevel((SkillLevel) this.cbSkillLevel.getSelectedItem()); options.setRange((RangeOfInfluence) this.cbRange.getSelectedItem()); - options.setWinsNeeded((Integer)this.spnNumWins.getValue()); + options.setWinsNeeded((Integer) this.spnNumWins.getValue()); options.setRollbackTurnsAllowed(chkRollbackTurnsAllowed.isSelected()); - options.setFreeMulligans((Integer)this.spnFreeMulligans.getValue()); + options.setFreeMulligans((Integer) this.spnFreeMulligans.getValue()); options.setPassword(this.txtPassword.getText()); if (!checkMatchOptions(options)) { return; @@ -391,9 +393,8 @@ public class NewTableDialog extends MageDialog { this.player1Panel.getPlayerName(), "Human", 1, DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()), - this.txtPassword.getText()) - ) { - for (TablePlayerPanel player: players) { + this.txtPassword.getText())) { + for (TablePlayerPanel player : players) { if (!player.getPlayerType().equals("Human")) { if (!player.joinTable(roomId, table.getTableId())) { // error message must be send by the server @@ -423,7 +424,7 @@ public class NewTableDialog extends MageDialog { }//GEN-LAST:event_cbGameTypeActionPerformed private void numPlayersChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_numPlayersChanged - int numPlayers = (Integer)this.spnNumPlayers.getValue() - 1; + int numPlayers = (Integer) this.spnNumPlayers.getValue() - 1; createPlayers(numPlayers); }//GEN-LAST:event_numPlayersChanged @@ -432,9 +433,10 @@ public class NewTableDialog extends MageDialog { }//GEN-LAST:event_spnNumWinsnumPlayersChanged /** - * Checks about not valid game option combinations and shows an error message - * - * @return + * Checks about not valid game option combinations and shows an error + * message + * + * @return */ private boolean checkMatchOptions(MatchOptions options) { switch (options.getDeckType()) { @@ -451,11 +453,17 @@ public class NewTableDialog extends MageDialog { return false; } break; + case "Variant Magic - Momir Basic": + if (!options.getGameType().startsWith("Momir Basic")) { + JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Deck type Momir Basic needs also a Momir Basic game type", "Error", JOptionPane.ERROR_MESSAGE); + return false; + } + break; } switch (options.getGameType()) { case "Commander Two Player Duel": case "Commander Free For All": - if (!options.getDeckType().equals("Variant Magic - Commander") && !options.getDeckType().equals("Variant Magic - Duel Commander") ) { + if (!options.getDeckType().equals("Variant Magic - Commander") && !options.getDeckType().equals("Variant Magic - Duel Commander")) { JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Deck type Commander needs also a Commander game type", "Error", JOptionPane.ERROR_MESSAGE); return false; } @@ -466,16 +474,16 @@ public class NewTableDialog extends MageDialog { return false; } break; - } + } return true; } - + private void setGameOptions() { GameTypeView gameType = (GameTypeView) cbGameType.getSelectedItem(); int oldValue = (Integer) this.spnNumPlayers.getValue(); this.spnNumPlayers.setModel(new SpinnerNumberModel(gameType.getMinPlayers(), gameType.getMinPlayers(), gameType.getMaxPlayers(), 1)); this.spnNumPlayers.setEnabled(gameType.getMinPlayers() != gameType.getMaxPlayers()); - if (oldValue >= gameType.getMinPlayers() && oldValue <= gameType.getMaxPlayers()){ + if (oldValue >= gameType.getMinPlayers() && oldValue <= gameType.getMaxPlayers()) { this.spnNumPlayers.setValue(oldValue); } this.cbAttackOption.setEnabled(gameType.isUseAttackOption()); @@ -495,17 +503,16 @@ public class NewTableDialog extends MageDialog { playerPanel.init(players.size() + 2, playerType); players.add(playerPanel); playerPanel.addPlayerTypeEventListener( - new Listener () { - @Override - public void event(Event event) { - drawPlayers(); + new Listener() { + @Override + public void event(Event event) { + drawPlayers(); + } } - } ); } - - } - // remove player panels no longer needed + + } // remove player panels no longer needed else if (numPlayers < players.size()) { while (players.size() != numPlayers) { players.remove(players.size() - 1); @@ -516,7 +523,7 @@ public class NewTableDialog extends MageDialog { private void drawPlayers() { this.pnlOtherPlayers.removeAll(); - for (TablePlayerPanel panel: players) { + for (TablePlayerPanel panel : players) { this.pnlOtherPlayers.add(panel); } this.pack(); @@ -531,7 +538,7 @@ public class NewTableDialog extends MageDialog { } public void showDialog(UUID roomId) { - this.roomId = roomId; + this.roomId = roomId; if (!lastSessionId.equals(MageFrame.getSession().getSessionId())) { lastSessionId = session.getSessionId(); this.player1Panel.setPlayerName(session.getUserName()); @@ -543,8 +550,8 @@ public class NewTableDialog extends MageDialog { cbAttackOption.setModel(new DefaultComboBoxModel(MultiplayerAttackOption.values())); cbSkillLevel.setModel(new DefaultComboBoxModel(SkillLevel.values())); // Update the existing player panels (neccessary if server was changes = new session) - int i=2; - for (TablePlayerPanel tablePlayerPanel :players) { + int i = 2; + for (TablePlayerPanel tablePlayerPanel : players) { tablePlayerPanel.init(i++, tablePlayerPanel.getPlayerType()); } setGameSettingsFromPrefs(); @@ -565,7 +572,7 @@ public class NewTableDialog extends MageDialog { private void selectLimitedByDefault() { for (int i = 0; i < cbDeckType.getItemCount(); i++) { - String name = (String)cbDeckType.getItemAt(i); + String name = (String) cbDeckType.getItemAt(i); if (name.equals(LIMITED)) { cbDeckType.setSelectedIndex(i); break; @@ -574,9 +581,9 @@ public class NewTableDialog extends MageDialog { } /** - * set the table settings from java prefs + * set the table settings from java prefs */ - private void setGameSettingsFromPrefs () { + private void setGameSettingsFromPrefs() { txtName.setText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_NAME, "Game")); txtPassword.setText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_PASSWORD, "")); @@ -585,7 +592,6 @@ public class NewTableDialog extends MageDialog { prefPlayerTypes.addAll(Arrays.asList(playerTypes.split(","))); this.spnNumPlayers.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_PLAYERS, "2"))); - String gameTypeName = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_GAME_TYPE, "Two Player Duel"); for (GameTypeView gtv : session.getGameTypes()) { if (gtv.getName().equals(gameTypeName)) { @@ -594,7 +600,7 @@ public class NewTableDialog extends MageDialog { } } int timeLimit = Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_TIME_LIMIT, "1500")); - for (MatchTimeLimit mtl :MatchTimeLimit.values()) { + for (MatchTimeLimit mtl : MatchTimeLimit.values()) { if (mtl.getTimeLimit() == timeLimit) { this.cbTimeLimit.setSelectedItem(mtl); break; @@ -608,32 +614,32 @@ public class NewTableDialog extends MageDialog { this.spnNumWins.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_WINS, "2"))); this.chkRollbackTurnsAllowed.setSelected(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_ROLLBACK_TURNS_ALLOWED, "Yes").equals("Yes")); - int range = Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_RANGE, "1")); - for (RangeOfInfluence roi :RangeOfInfluence.values()) { + for (RangeOfInfluence roi : RangeOfInfluence.values()) { if (roi.getRange() == range) { this.cbRange.setSelectedItem(roi); break; } } String attackOption = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_ATTACK_OPTION, "Attack Multiple Players"); - for (MultiplayerAttackOption mao :MultiplayerAttackOption.values()) { + for (MultiplayerAttackOption mao : MultiplayerAttackOption.values()) { if (mao.toString().equals(attackOption)) { this.cbAttackOption.setSelectedItem(mao); break; } } String skillLevelDefault = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_SKILL_LEVEL, "Casual"); - for (SkillLevel skillLevel :SkillLevel.values()) { + for (SkillLevel skillLevel : SkillLevel.values()) { if (skillLevel.toString().equals(skillLevelDefault)) { this.cbSkillLevel.setSelectedItem(skillLevel); break; } - } + } } /** - * Save the settings to java prefs to reload it next time the dialog will be created + * Save the settings to java prefs to reload it next time the dialog will be + * created * * @param options * @param deckFile @@ -645,7 +651,7 @@ public class NewTableDialog extends MageDialog { PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_TIME_LIMIT, Integer.toString(options.getPriorityTime())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_GAME_TYPE, options.getGameType()); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_WINS, Integer.toString(options.getWinsNeeded())); - PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_ROLLBACK_TURNS_ALLOWED, options.isRollbackTurnsAllowed() ? "Yes": "No"); + PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_ROLLBACK_TURNS_ALLOWED, options.isRollbackTurnsAllowed() ? "Yes" : "No"); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_FREE_MULLIGANS, Integer.toString(options.getFreeMulligans())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_DECK_FILE, deckFile); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_PLAYERS, spnNumPlayers.getValue().toString()); @@ -655,7 +661,7 @@ public class NewTableDialog extends MageDialog { StringBuilder playerTypesString = new StringBuilder(); ListIterator iterator = players.listIterator(); while (iterator.hasNext()) { - if (playerTypesString.length()>0) { + if (playerTypesString.length() > 0) { playerTypesString.append(","); } TablePlayerPanel tpp = (TablePlayerPanel) iterator.next(); diff --git a/Mage.Client/src/main/java/mage/client/dialog/PickPileDialog.java b/Mage.Client/src/main/java/mage/client/dialog/PickPileDialog.java index d2e63313b46..698e14ea6cb 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PickPileDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/PickPileDialog.java @@ -1,33 +1,41 @@ /* -* Copyright 2012 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2012 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.client.dialog; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Point; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.UUID; +import javax.swing.JButton; +import javax.swing.JLayeredPane; +import javax.swing.JPanel; import mage.cards.CardDimensions; import mage.client.MageFrame; import mage.client.cards.BigCard; @@ -35,18 +43,12 @@ import mage.client.cards.CardArea; import mage.client.util.SettingsManager; import mage.client.util.gui.GuiDisplayUtil; import mage.view.CardsView; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.UUID; import org.mage.card.arcane.CardPanel; /** -* -* @author BetaSteward_at_googlemail.com -*/ + * + * @author BetaSteward_at_googlemail.com + */ public class PickPileDialog extends MageDialog { private final CardArea pile1; @@ -94,24 +96,24 @@ public class PickPileDialog extends MageDialog { } public void cleanUp() { - for(Component comp: pile1.getComponents()) { - if (comp instanceof CardPanel) { - ((CardPanel) comp).cleanUp(); - pile1.remove(comp); - } - } - for(Component comp: pile2.getComponents()) { - if (comp instanceof CardPanel) { - ((CardPanel) comp).cleanUp(); - pile2.remove(comp); - } - } + for (Component comp : pile1.getComponents()) { + if (comp instanceof CardPanel) { + ((CardPanel) comp).cleanUp(); + pile1.remove(comp); + } + } + for (Component comp : pile2.getComponents()) { + if (comp instanceof CardPanel) { + ((CardPanel) comp).cleanUp(); + pile2.remove(comp); + } + } } - + public void loadCards(String name, CardsView pile1, CardsView pile2, BigCard bigCard, CardDimensions dimension, UUID gameId) { this.title = name; - this.pile1.loadCardsNarrow(pile1, bigCard, dimension, gameId, null); - this.pile2.loadCardsNarrow(pile2, bigCard, dimension, gameId, null); + this.pile1.loadCardsNarrow(pile1, bigCard, dimension, gameId); + this.pile2.loadCardsNarrow(pile2, bigCard, dimension, gameId); if (getParent() != MageFrame.getDesktop() /*|| this.isClosed*/) { MageFrame.getDesktop().add(this, JLayeredPane.MODAL_LAYER); diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form index e35b22b89bd..8008ce940d9 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form @@ -25,13 +25,13 @@ - + - + @@ -69,8 +69,11 @@ - + + + + @@ -82,8 +85,8 @@ - - + + @@ -200,18 +203,18 @@ - - + - - - + + + + - + @@ -231,7 +234,7 @@ - + @@ -333,16 +336,23 @@ - + - + + + + - + + + + + @@ -357,6 +367,16 @@ + + + + + + + + + + @@ -364,8 +384,8 @@ - - + + @@ -511,8 +531,8 @@ - - + + @@ -520,7 +540,7 @@ - + @@ -611,7 +631,7 @@ - + @@ -658,6 +678,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -674,11 +733,11 @@ - + - - + + @@ -713,29 +772,34 @@ - - - - - - - - - - + + + + - - + + + + + + + + + - - - + + + + + + + - + @@ -843,36 +907,37 @@ - - + + + + + + + + + + + + + + + + + + + + - - + + + + + + - - - - - - - - - - - - - - - - - - - - - @@ -1150,120 +1215,54 @@ - + + + + - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - @@ -1273,41 +1272,26 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - + - + @@ -1321,17 +1305,26 @@ + + + + + + + + + - + - + @@ -1345,17 +1338,59 @@ + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1369,17 +1404,26 @@ + + + + + + + + + - + - + @@ -1393,29 +1437,30 @@ + + + + + + + + + - + - + - - - - - - - - @@ -1425,17 +1470,26 @@ + + + + + + + + + - + - + @@ -1449,17 +1503,26 @@ + + + + + + + + + - + - + @@ -1473,17 +1536,26 @@ + + + + + + + + + - + - + @@ -1497,17 +1569,26 @@ + + + + + + + + + - + - + @@ -1521,17 +1602,26 @@ + + + + + + + + + - + - + @@ -1545,17 +1635,419 @@ + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1578,19 +2070,18 @@ - + - - + + + - - - + - + @@ -1606,7 +2097,7 @@ - + @@ -1803,7 +2294,7 @@ - + @@ -1819,7 +2310,7 @@ - + diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java index bd764f48ce6..2d464312ebe 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java @@ -42,9 +42,7 @@ import java.awt.event.MouseEvent; import java.awt.image.BufferedImage; import java.io.File; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; -import java.util.Set; import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; import javax.swing.BorderFactory; @@ -63,6 +61,9 @@ import mage.client.MageFrame; import mage.client.util.Config; import mage.client.util.ImageHelper; import mage.client.util.gui.BufferedImageBuilder; +import static mage.constants.Constants.DEFAULT_AVATAR_ID; +import static mage.constants.Constants.MAX_AVATAR_ID; +import static mage.constants.Constants.MIN_AVATAR_ID; import mage.players.net.UserData; import mage.players.net.UserGroup; import mage.players.net.UserSkipPrioritySteps; @@ -77,7 +78,7 @@ import org.apache.log4j.Logger; */ public class PreferencesDialog extends javax.swing.JDialog { - private static final transient Logger log = Logger.getLogger(PreferencesDialog.class); + private static final Logger log = Logger.getLogger(PreferencesDialog.class); public static final String KEY_HAND_USE_BIG_CARDS = "handUseBigCards"; public static final String KEY_SHOW_TOOLTIPS_ANY_ZONE = "showTooltipsInAnyZone"; @@ -91,6 +92,7 @@ public class PreferencesDialog extends javax.swing.JDialog { public static final String KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER = "gameAskMoveToGraveORder"; public static final String KEY_GAME_LOG_AUTO_SAVE = "gameLogAutoSave"; + public static final String KEY_DRAFT_LOG_AUTO_SAVE = "draftLogAutoSave"; public static final String KEY_CARD_IMAGES_USE_DEFAULT = "cardImagesUseDefault"; public static final String KEY_CARD_IMAGES_PATH = "cardImagesPath"; @@ -134,6 +136,9 @@ public class PreferencesDialog extends javax.swing.JDialog { public static final String KEY_STOP_BLOCK = "stopDeclareBlockersStep"; public static final String KEY_STOP_ALL_MAIN_PHASES = "stopOnAllMainPhases"; public static final String KEY_STOP_ALL_END_PHASES = "stopOnAllEndPhases"; + public static final String KEY_PASS_PRIORITY_CAST = "passPriorityCast"; + public static final String KEY_PASS_PRIORITY_ACTIVATION = "passPriorityActivation"; + public static final String KEY_AUTO_ORDER_TRIGGER = "autoOrderTrigger"; // mana auto payment public static final String KEY_GAME_MANA_AUTOPAYMENT = "gameManaAutopayment"; @@ -260,29 +265,12 @@ public class PreferencesDialog extends javax.swing.JDialog { public static String PHASE_ON = "on"; public static String PHASE_OFF = "off"; - public static final int DEFAULT_AVATAR_ID = 51; - private static int selectedAvatarId = DEFAULT_AVATAR_ID; - private static final Set available_avatars = new HashSet<>(); private static final Map panels = new HashMap<>(); private static final Border GREEN_BORDER = BorderFactory.createLineBorder(Color.GREEN, 3); private static final Border BLACK_BORDER = BorderFactory.createLineBorder(Color.BLACK, 3); - static { - available_avatars.add(51); - available_avatars.add(13); - available_avatars.add(9); - available_avatars.add(53); - available_avatars.add(10); - available_avatars.add(39); - available_avatars.add(19); - available_avatars.add(30); - available_avatars.add(25); - - available_avatars.add(22); - available_avatars.add(77); - available_avatars.add(62); - } + private static int selectedAvatarId; private final JFileChooser fc = new JFileChooser(); @@ -362,6 +350,7 @@ public class PreferencesDialog extends javax.swing.JDialog { cbAskMoveToGraveOrder = new javax.swing.JCheckBox(); main_gamelog = new javax.swing.JPanel(); cbGameLogAutoSave = new javax.swing.JCheckBox(); + cbDraftLogAutoSave = new javax.swing.JCheckBox(); tabPhases = new javax.swing.JPanel(); jLabelHeadLine = new javax.swing.JLabel(); jLabelYourTurn = new javax.swing.JLabel(); @@ -392,6 +381,9 @@ public class PreferencesDialog extends javax.swing.JDialog { cbStopBlock = new javax.swing.JCheckBox(); cbStopOnAllMain = new javax.swing.JCheckBox(); cbStopOnAllEnd = new javax.swing.JCheckBox(); + cbPassPriorityCast = new javax.swing.JCheckBox(); + cbPassPriorityActivation = new javax.swing.JCheckBox(); + cbAutoOrderTrigger = new javax.swing.JCheckBox(); tabImages = new javax.swing.JPanel(); panelCardImages = new javax.swing.JPanel(); cbUseDefaultImageFolder = new javax.swing.JCheckBox(); @@ -425,20 +417,30 @@ public class PreferencesDialog extends javax.swing.JDialog { tabAvatars = new javax.swing.JPanel(); avatarPane = new javax.swing.JScrollPane(); avatarPanel = new javax.swing.JPanel(); - jLabel12 = new javax.swing.JLabel(); jPanel10 = new javax.swing.JPanel(); - jPanel13 = new javax.swing.JPanel(); jPanel11 = new javax.swing.JPanel(); jPanel12 = new javax.swing.JPanel(); + jPanel13 = new javax.swing.JPanel(); jPanel14 = new javax.swing.JPanel(); jPanel15 = new javax.swing.JPanel(); - jLabel13 = new javax.swing.JLabel(); jPanel16 = new javax.swing.JPanel(); jPanel17 = new javax.swing.JPanel(); jPanel18 = new javax.swing.JPanel(); jPanel19 = new javax.swing.JPanel(); jPanel20 = new javax.swing.JPanel(); jPanel21 = new javax.swing.JPanel(); + jPanel22 = new javax.swing.JPanel(); + jPanel23 = new javax.swing.JPanel(); + jPanel24 = new javax.swing.JPanel(); + jPanel25 = new javax.swing.JPanel(); + jPanel26 = new javax.swing.JPanel(); + jPanel27 = new javax.swing.JPanel(); + jPanel28 = new javax.swing.JPanel(); + jPanel29 = new javax.swing.JPanel(); + jPanel30 = new javax.swing.JPanel(); + jPanel31 = new javax.swing.JPanel(); + jPanel32 = new javax.swing.JPanel(); + jPanel33 = new javax.swing.JPanel(); tabConnection = new javax.swing.JPanel(); lblProxyType = new javax.swing.JLabel(); cbProxyType = new javax.swing.JComboBox(); @@ -600,16 +602,16 @@ public class PreferencesDialog extends javax.swing.JDialog { main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(main_gameLayout.createSequentialGroup() .addContainerGap() - .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(cbAllowRequestToShowHandCards, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(showPlayerNamesPermanently, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(nonLandPermanentsInOnePile, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(showAbilityPickerForced, javax.swing.GroupLayout.Alignment.LEADING)) - .addComponent(cbShowStormCounter, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(cbConfirmEmptyManaPool, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(cbAskMoveToGraveOrder, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(cbConfirmEmptyManaPool, javax.swing.GroupLayout.DEFAULT_SIZE, 485, Short.MAX_VALUE) + .addComponent(cbAllowRequestToShowHandCards, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(cbShowStormCounter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(cbAskMoveToGraveOrder, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(7, Short.MAX_VALUE)) ); main_gameLayout.setVerticalGroup( main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -627,7 +629,7 @@ public class PreferencesDialog extends javax.swing.JDialog { .addComponent(cbConfirmEmptyManaPool) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cbAskMoveToGraveOrder) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) ); nonLandPermanentsInOnePile.getAccessibleContext().setAccessibleName("nonLandPermanentsInOnePile"); @@ -643,18 +645,32 @@ public class PreferencesDialog extends javax.swing.JDialog { } }); + cbDraftLogAutoSave.setSelected(true); + cbDraftLogAutoSave.setText("Auto save draft logs (to \"../Mage.Client/gamelogs/\" directory)"); + cbDraftLogAutoSave.setToolTipText("The logs of all your games will be saved to the mentioned folder if this option is switched on."); + cbDraftLogAutoSave.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cbDraftLogAutoSaveActionPerformed(evt); + } + }); + javax.swing.GroupLayout main_gamelogLayout = new javax.swing.GroupLayout(main_gamelog); main_gamelog.setLayout(main_gamelogLayout); main_gamelogLayout.setHorizontalGroup( main_gamelogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(main_gamelogLayout.createSequentialGroup() .addContainerGap() - .addComponent(cbGameLogAutoSave, javax.swing.GroupLayout.PREFERRED_SIZE, 528, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(main_gamelogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(cbDraftLogAutoSave, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(cbGameLogAutoSave, javax.swing.GroupLayout.DEFAULT_SIZE, 473, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); main_gamelogLayout.setVerticalGroup( main_gamelogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(cbGameLogAutoSave, javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(main_gamelogLayout.createSequentialGroup() + .addComponent(cbGameLogAutoSave) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cbDraftLogAutoSave)) ); javax.swing.GroupLayout tabMainLayout = new javax.swing.GroupLayout(tabMain); @@ -665,8 +681,10 @@ public class PreferencesDialog extends javax.swing.JDialog { .addContainerGap() .addGroup(tabMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(main_card, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(main_game, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(main_gamelog, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(main_gamelog, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(tabMainLayout.createSequentialGroup() + .addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); tabMainLayout.setVerticalGroup( @@ -675,8 +693,8 @@ public class PreferencesDialog extends javax.swing.JDialog { .addContainerGap() .addComponent(main_card, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, 189, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(main_gamelog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); @@ -685,7 +703,7 @@ public class PreferencesDialog extends javax.swing.JDialog { tabsPanel.addTab("Main", tabMain); - jLabelHeadLine.setText("Choose phases your game will stop on:"); + jLabelHeadLine.setText("Choose phases your game will stop on if not skipped by a skip action (e.g. F6):"); jLabelYourTurn.setText("Your turn"); @@ -706,7 +724,7 @@ public class PreferencesDialog extends javax.swing.JDialog { jLabelEndOfTurn.setText("End of turn:"); phases_stopSettings.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Stop settings")); - phases_stopSettings.setLayout(new java.awt.GridLayout(4, 1)); + phases_stopSettings.setLayout(new java.awt.GridLayout(7, 1)); cbStopAttack.setSelected(true); cbStopAttack.setText("Stop on declare attackers step if you skip steps (F4/F5/F7) and attackers are available"); @@ -750,6 +768,39 @@ public class PreferencesDialog extends javax.swing.JDialog { }); phases_stopSettings.add(cbStopOnAllEnd); + cbPassPriorityCast.setText("Pass priority automatically after you have put a spell on the stack"); + cbPassPriorityCast.setToolTipText("If activated the system passes priority automatically for you if you have put a spell on the stack."); + cbPassPriorityCast.setActionCommand(""); + cbPassPriorityCast.setPreferredSize(new java.awt.Dimension(300, 25)); + cbPassPriorityCast.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cbPassPriorityCastActionPerformed(evt); + } + }); + phases_stopSettings.add(cbPassPriorityCast); + + cbPassPriorityActivation.setText("Pass priority automatically after you have put an activated ability on the stack"); + cbPassPriorityActivation.setToolTipText("If activated the system passes priority for you automatically after you have put an activated ability on the stack."); + cbPassPriorityActivation.setActionCommand(""); + cbPassPriorityActivation.setPreferredSize(new java.awt.Dimension(300, 25)); + cbPassPriorityActivation.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cbPassPriorityActivationActionPerformed(evt); + } + }); + phases_stopSettings.add(cbPassPriorityActivation); + + cbAutoOrderTrigger.setText("Set order for your triggers automatically if all have the same text"); + cbAutoOrderTrigger.setToolTipText("If activated the order to put on the stack your triggers that trigger at the same time
\nis set automatically if all have the same text."); + cbAutoOrderTrigger.setActionCommand(""); + cbAutoOrderTrigger.setPreferredSize(new java.awt.Dimension(300, 25)); + cbAutoOrderTrigger.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cbAutoOrderTriggerActionPerformed(evt); + } + }); + phases_stopSettings.add(cbAutoOrderTrigger); + javax.swing.GroupLayout tabPhasesLayout = new javax.swing.GroupLayout(tabPhases); tabPhases.setLayout(tabPhasesLayout); tabPhasesLayout.setHorizontalGroup( @@ -860,11 +911,11 @@ public class PreferencesDialog extends javax.swing.JDialog { .addComponent(jLabelEndOfTurn) .addComponent(checkBoxEndTurnOthers)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(phases_stopSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(13, Short.MAX_VALUE)) + .addComponent(phases_stopSettings, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE) + .addContainerGap()) ); - tabsPanel.addTab("Phases", tabPhases); + tabsPanel.addTab("Phases & Priority", tabPhases); panelCardImages.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Card images:")); @@ -907,24 +958,27 @@ public class PreferencesDialog extends javax.swing.JDialog { panelCardImages.setLayout(panelCardImagesLayout); panelCardImagesLayout.setHorizontalGroup( panelCardImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(panelCardImagesLayout.createSequentialGroup() - .addGap(24, 24, 24) - .addComponent(txtImageFolderPath) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnBrowseImageLocation)) .addGroup(panelCardImagesLayout.createSequentialGroup() .addGroup(panelCardImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(cbUseDefaultImageFolder) - .addComponent(cbCheckForNewImages) .addGroup(panelCardImagesLayout.createSequentialGroup() - .addGroup(panelCardImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelCardImagesLayout.createSequentialGroup() - .addContainerGap() - .addComponent(labelPreferedImageLanguage)) - .addComponent(cbSaveToZipFiles, javax.swing.GroupLayout.Alignment.LEADING)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(cbPreferedImageLanguage, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(panelCardImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(cbUseDefaultImageFolder) + .addComponent(cbCheckForNewImages) + .addGroup(panelCardImagesLayout.createSequentialGroup() + .addGroup(panelCardImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelCardImagesLayout.createSequentialGroup() + .addContainerGap() + .addComponent(labelPreferedImageLanguage)) + .addComponent(cbSaveToZipFiles, javax.swing.GroupLayout.Alignment.LEADING)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(cbPreferedImageLanguage, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 190, Short.MAX_VALUE)) + .addGroup(panelCardImagesLayout.createSequentialGroup() + .addGap(24, 24, 24) + .addComponent(txtImageFolderPath) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnBrowseImageLocation))) + .addContainerGap()) ); panelCardImagesLayout.setVerticalGroup( panelCardImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -1006,32 +1060,29 @@ public class PreferencesDialog extends javax.swing.JDialog { .addGroup(panelBackgroundImagesLayout.createSequentialGroup() .addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelBackgroundImagesLayout.createSequentialGroup() - .addGap(19, 19, 19) - .addComponent(jLabel14)) - .addGroup(panelBackgroundImagesLayout.createSequentialGroup() - .addGap(25, 25, 25) - .addComponent(jLabel15))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(panelBackgroundImagesLayout.createSequentialGroup() - .addComponent(txtBattlefieldImagePath, javax.swing.GroupLayout.PREFERRED_SIZE, 336, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(panelBackgroundImagesLayout.createSequentialGroup() + .addGap(19, 19, 19) + .addComponent(jLabel14)) + .addGroup(panelBackgroundImagesLayout.createSequentialGroup() + .addGap(25, 25, 25) + .addComponent(jLabel15))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnBrowseBattlefieldImage)) - .addGroup(panelBackgroundImagesLayout.createSequentialGroup() - .addComponent(txtBackgroundImagePath, javax.swing.GroupLayout.PREFERRED_SIZE, 332, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtBackgroundImagePath) + .addComponent(txtBattlefieldImagePath)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnBrowseBackgroundImage))) - .addGap(0, 0, Short.MAX_VALUE)) - .addGroup(panelBackgroundImagesLayout.createSequentialGroup() - .addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(cbUseRandomBattleImage) - .addComponent(cbUseDefaultBattleImage) - .addComponent(cbUseDefaultBackground)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnBrowseBackgroundImage, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(btnBrowseBattlefieldImage, javax.swing.GroupLayout.Alignment.TRAILING))) + .addGroup(panelBackgroundImagesLayout.createSequentialGroup() + .addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(cbUseRandomBattleImage) + .addComponent(cbUseDefaultBattleImage) + .addComponent(cbUseDefaultBackground)) + .addGap(0, 0, Short.MAX_VALUE))) + .addContainerGap()) ); - - panelBackgroundImagesLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {txtBackgroundImagePath, txtBattlefieldImagePath}); - panelBackgroundImagesLayout.setVerticalGroup( panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelBackgroundImagesLayout.createSequentialGroup() @@ -1060,8 +1111,8 @@ public class PreferencesDialog extends javax.swing.JDialog { .addGroup(tabImagesLayout.createSequentialGroup() .addContainerGap() .addGroup(tabImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(panelCardImages, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(panelBackgroundImages, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(panelCardImages, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(panelBackgroundImages, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); tabImagesLayout.setVerticalGroup( @@ -1193,249 +1244,459 @@ public class PreferencesDialog extends javax.swing.JDialog { tabsPanel.addTab("Sounds", tabSounds); - jLabel12.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N - jLabel12.setText("Choose your avatar:"); + avatarPane.setMaximumSize(new java.awt.Dimension(508, 772)); + avatarPane.setMinimumSize(new java.awt.Dimension(508, 772)); + avatarPane.setPreferredSize(new java.awt.Dimension(508, 772)); + + avatarPanel.setMaximumSize(new java.awt.Dimension(508, 772)); + avatarPanel.setMinimumSize(new java.awt.Dimension(508, 772)); + avatarPanel.setPreferredSize(new java.awt.Dimension(508, 772)); + avatarPanel.setLayout(new java.awt.GridLayout(6, 4, 20, 20)); jPanel10.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel10.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel10.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel10.setPreferredSize(new java.awt.Dimension(102, 102)); javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10); jPanel10.setLayout(jPanel10Layout); jPanel10Layout.setHorizontalGroup( jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); jPanel10Layout.setVerticalGroup( jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); - jPanel13.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); - - javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13); - jPanel13.setLayout(jPanel13Layout); - jPanel13Layout.setHorizontalGroup( - jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) - ); - jPanel13Layout.setVerticalGroup( - jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) - ); + avatarPanel.add(jPanel10); jPanel11.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel11.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel11.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel11.setPreferredSize(new java.awt.Dimension(102, 102)); javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11); jPanel11.setLayout(jPanel11Layout); jPanel11Layout.setHorizontalGroup( jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); jPanel11Layout.setVerticalGroup( jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); + avatarPanel.add(jPanel11); + jPanel12.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel12.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel12.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel12.setPreferredSize(new java.awt.Dimension(102, 102)); javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12); jPanel12.setLayout(jPanel12Layout); jPanel12Layout.setHorizontalGroup( jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); jPanel12Layout.setVerticalGroup( jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); + avatarPanel.add(jPanel12); + + jPanel13.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel13.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel13.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel13.setPreferredSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13); + jPanel13.setLayout(jPanel13Layout); + jPanel13Layout.setHorizontalGroup( + jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + jPanel13Layout.setVerticalGroup( + jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 0, Short.MAX_VALUE) + ); + + avatarPanel.add(jPanel13); + jPanel14.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel14.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel14.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel14.setPreferredSize(new java.awt.Dimension(102, 102)); javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14); jPanel14.setLayout(jPanel14Layout); jPanel14Layout.setHorizontalGroup( jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); jPanel14Layout.setVerticalGroup( jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); + avatarPanel.add(jPanel14); + jPanel15.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel15.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel15.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel15.setPreferredSize(new java.awt.Dimension(102, 102)); javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15); jPanel15.setLayout(jPanel15Layout); jPanel15Layout.setHorizontalGroup( jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); jPanel15Layout.setVerticalGroup( jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); - jLabel13.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N - jLabel13.setText("New avatars:"); + avatarPanel.add(jPanel15); jPanel16.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel16.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel16.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel16.setPreferredSize(new java.awt.Dimension(102, 102)); javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16); jPanel16.setLayout(jPanel16Layout); jPanel16Layout.setHorizontalGroup( jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); jPanel16Layout.setVerticalGroup( jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); + avatarPanel.add(jPanel16); + jPanel17.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel17.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel17.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel17.setPreferredSize(new java.awt.Dimension(102, 102)); javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17); jPanel17.setLayout(jPanel17Layout); jPanel17Layout.setHorizontalGroup( jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); jPanel17Layout.setVerticalGroup( jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); + avatarPanel.add(jPanel17); + jPanel18.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel18.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel18.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel18.setPreferredSize(new java.awt.Dimension(102, 102)); javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18); jPanel18.setLayout(jPanel18Layout); jPanel18Layout.setHorizontalGroup( jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); jPanel18Layout.setVerticalGroup( jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); + avatarPanel.add(jPanel18); + jPanel19.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel19.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel19.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel19.setPreferredSize(new java.awt.Dimension(102, 102)); javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19); jPanel19.setLayout(jPanel19Layout); jPanel19Layout.setHorizontalGroup( jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); jPanel19Layout.setVerticalGroup( jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); + avatarPanel.add(jPanel19); + jPanel20.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel20.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel20.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel20.setPreferredSize(new java.awt.Dimension(102, 102)); javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20); jPanel20.setLayout(jPanel20Layout); jPanel20Layout.setHorizontalGroup( jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); jPanel20Layout.setVerticalGroup( jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); + avatarPanel.add(jPanel20); + jPanel21.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel21.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel21.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel21.setPreferredSize(new java.awt.Dimension(102, 102)); javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21); jPanel21.setLayout(jPanel21Layout); jPanel21Layout.setHorizontalGroup( jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); jPanel21Layout.setVerticalGroup( jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 110, Short.MAX_VALUE) ); - javax.swing.GroupLayout avatarPanelLayout = new javax.swing.GroupLayout(avatarPanel); - avatarPanel.setLayout(avatarPanelLayout); - avatarPanelLayout.setHorizontalGroup( - avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(avatarPanelLayout.createSequentialGroup() - .addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(avatarPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel12)) - .addGroup(avatarPanelLayout.createSequentialGroup() - .addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(avatarPanelLayout.createSequentialGroup() - .addGap(30, 30, 30) - .addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel19, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(33, 33, 33) - .addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(avatarPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(avatarPanelLayout.createSequentialGroup() - .addGap(20, 20, 20) - .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(33, 33, 33) - .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(jLabel13)))) - .addGap(32, 32, 32) - .addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + avatarPanel.add(jPanel21); + + jPanel22.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel22.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel22.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel22.setPreferredSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22); + jPanel22.setLayout(jPanel22Layout); + jPanel22Layout.setHorizontalGroup( + jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) ); - avatarPanelLayout.setVerticalGroup( - avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(avatarPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel12) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(26, 26, 26) - .addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(23, 23, 23) - .addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 18, 18) - .addGroup(avatarPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(avatarPanelLayout.createSequentialGroup() - .addComponent(jLabel13) - .addGap(18, 18, 18) - .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(25, 25, 25)) + jPanel22Layout.setVerticalGroup( + jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) ); + avatarPanel.add(jPanel22); + + jPanel23.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel23.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel23.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel23.setPreferredSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel23Layout = new javax.swing.GroupLayout(jPanel23); + jPanel23.setLayout(jPanel23Layout); + jPanel23Layout.setHorizontalGroup( + jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + jPanel23Layout.setVerticalGroup( + jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + + avatarPanel.add(jPanel23); + + jPanel24.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel24.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel24.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel24.setPreferredSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel24Layout = new javax.swing.GroupLayout(jPanel24); + jPanel24.setLayout(jPanel24Layout); + jPanel24Layout.setHorizontalGroup( + jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + jPanel24Layout.setVerticalGroup( + jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + + avatarPanel.add(jPanel24); + + jPanel25.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel25.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel25.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel25.setPreferredSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel25Layout = new javax.swing.GroupLayout(jPanel25); + jPanel25.setLayout(jPanel25Layout); + jPanel25Layout.setHorizontalGroup( + jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + jPanel25Layout.setVerticalGroup( + jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + + avatarPanel.add(jPanel25); + + jPanel26.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel26.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel26.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel26.setPreferredSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel26Layout = new javax.swing.GroupLayout(jPanel26); + jPanel26.setLayout(jPanel26Layout); + jPanel26Layout.setHorizontalGroup( + jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + jPanel26Layout.setVerticalGroup( + jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + + avatarPanel.add(jPanel26); + + jPanel27.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel27.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel27.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel27.setPreferredSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel27Layout = new javax.swing.GroupLayout(jPanel27); + jPanel27.setLayout(jPanel27Layout); + jPanel27Layout.setHorizontalGroup( + jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + jPanel27Layout.setVerticalGroup( + jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + + avatarPanel.add(jPanel27); + + jPanel28.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel28.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel28.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel28.setPreferredSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel28Layout = new javax.swing.GroupLayout(jPanel28); + jPanel28.setLayout(jPanel28Layout); + jPanel28Layout.setHorizontalGroup( + jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + jPanel28Layout.setVerticalGroup( + jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + + avatarPanel.add(jPanel28); + + jPanel29.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel29.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel29.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel29.setPreferredSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel29Layout = new javax.swing.GroupLayout(jPanel29); + jPanel29.setLayout(jPanel29Layout); + jPanel29Layout.setHorizontalGroup( + jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + jPanel29Layout.setVerticalGroup( + jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + + avatarPanel.add(jPanel29); + + jPanel30.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel30.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel30.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel30.setPreferredSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel30Layout = new javax.swing.GroupLayout(jPanel30); + jPanel30.setLayout(jPanel30Layout); + jPanel30Layout.setHorizontalGroup( + jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + jPanel30Layout.setVerticalGroup( + jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + + avatarPanel.add(jPanel30); + + jPanel31.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel31.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel31.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel31.setPreferredSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel31Layout = new javax.swing.GroupLayout(jPanel31); + jPanel31.setLayout(jPanel31Layout); + jPanel31Layout.setHorizontalGroup( + jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + jPanel31Layout.setVerticalGroup( + jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + + avatarPanel.add(jPanel31); + + jPanel32.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel32.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel32.setMinimumSize(new java.awt.Dimension(102, 102)); + jPanel32.setPreferredSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel32Layout = new javax.swing.GroupLayout(jPanel32); + jPanel32.setLayout(jPanel32Layout); + jPanel32Layout.setHorizontalGroup( + jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + jPanel32Layout.setVerticalGroup( + jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + + avatarPanel.add(jPanel32); + + jPanel33.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 1, true)); + jPanel33.setMaximumSize(new java.awt.Dimension(102, 102)); + jPanel33.setMinimumSize(new java.awt.Dimension(102, 102)); + + javax.swing.GroupLayout jPanel33Layout = new javax.swing.GroupLayout(jPanel33); + jPanel33.setLayout(jPanel33Layout); + jPanel33Layout.setHorizontalGroup( + jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + jPanel33Layout.setVerticalGroup( + jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 110, Short.MAX_VALUE) + ); + + avatarPanel.add(jPanel33); + avatarPane.setViewportView(avatarPanel); javax.swing.GroupLayout tabAvatarsLayout = new javax.swing.GroupLayout(tabAvatars); tabAvatars.setLayout(tabAvatarsLayout); tabAvatarsLayout.setHorizontalGroup( tabAvatarsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(avatarPane, javax.swing.GroupLayout.DEFAULT_SIZE, 590, Short.MAX_VALUE) + .addGroup(tabAvatarsLayout.createSequentialGroup() + .addComponent(avatarPane, javax.swing.GroupLayout.PREFERRED_SIZE, 527, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)) ); tabAvatarsLayout.setVerticalGroup( tabAvatarsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(avatarPane, javax.swing.GroupLayout.DEFAULT_SIZE, 359, Short.MAX_VALUE) + .addComponent(avatarPane, javax.swing.GroupLayout.PREFERRED_SIZE, 418, Short.MAX_VALUE) ); tabsPanel.addTab("Avatars", tabAvatars); @@ -1574,7 +1835,7 @@ public class PreferencesDialog extends javax.swing.JDialog { .addContainerGap() .addComponent(lblURLServerList, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtURLServerList, javax.swing.GroupLayout.PREFERRED_SIZE, 421, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(txtURLServerList, javax.swing.GroupLayout.PREFERRED_SIZE, 370, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(connection_serversLayout.createSequentialGroup() .addGap(141, 141, 141) .addComponent(jLabel17))) @@ -1585,7 +1846,7 @@ public class PreferencesDialog extends javax.swing.JDialog { .addGroup(connection_serversLayout.createSequentialGroup() .addGroup(connection_serversLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(lblURLServerList, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(txtURLServerList, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(txtURLServerList, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel17)) ); @@ -1596,15 +1857,14 @@ public class PreferencesDialog extends javax.swing.JDialog { tabConnectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(tabConnectionLayout.createSequentialGroup() .addContainerGap() - .addGroup(tabConnectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(tabConnectionLayout.createSequentialGroup() + .addGroup(tabConnectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(pnlProxySettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, tabConnectionLayout.createSequentialGroup() .addComponent(lblProxyType) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(cbProxyType, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, Short.MAX_VALUE)) - .addComponent(pnlProxySettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(cbProxyType, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(connection_servers, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addContainerGap()) + .addContainerGap(16, Short.MAX_VALUE)) ); tabConnectionLayout.setVerticalGroup( tabConnectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -1617,7 +1877,7 @@ public class PreferencesDialog extends javax.swing.JDialog { .addComponent(cbProxyType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(pnlProxySettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(54, Short.MAX_VALUE)) + .addContainerGap(107, Short.MAX_VALUE)) ); pnlProxySettings.getAccessibleContext().setAccessibleDescription(""); @@ -1645,12 +1905,12 @@ public class PreferencesDialog extends javax.swing.JDialog { layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap(405, Short.MAX_VALUE) .addComponent(saveButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) - .addComponent(tabsPanel) + .addComponent(tabsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -1681,8 +1941,9 @@ public class PreferencesDialog extends javax.swing.JDialog { save(prefs, dialog.cbConfirmEmptyManaPool, KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true", "false", UPDATE_CACHE_POLICY); save(prefs, dialog.cbAskMoveToGraveOrder, KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true", "false", UPDATE_CACHE_POLICY); save(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true", "false", UPDATE_CACHE_POLICY); + save(prefs, dialog.cbDraftLogAutoSave, KEY_DRAFT_LOG_AUTO_SAVE, "true", "false", UPDATE_CACHE_POLICY); - // Phases + // Phases & Priority save(prefs, dialog.checkBoxUpkeepYou, UPKEEP_YOU); save(prefs, dialog.checkBoxDrawYou, DRAW_YOU); save(prefs, dialog.checkBoxMainYou, MAIN_YOU); @@ -1703,6 +1964,9 @@ public class PreferencesDialog extends javax.swing.JDialog { save(prefs, dialog.cbStopBlock, KEY_STOP_BLOCK, "true", "false", UPDATE_CACHE_POLICY); save(prefs, dialog.cbStopOnAllMain, KEY_STOP_ALL_MAIN_PHASES, "true", "false", UPDATE_CACHE_POLICY); save(prefs, dialog.cbStopOnAllEnd, KEY_STOP_ALL_END_PHASES, "true", "false", UPDATE_CACHE_POLICY); + save(prefs, dialog.cbPassPriorityCast, KEY_PASS_PRIORITY_CAST, "true", "false", UPDATE_CACHE_POLICY); + save(prefs, dialog.cbPassPriorityActivation, KEY_PASS_PRIORITY_ACTIVATION, "true", "false", UPDATE_CACHE_POLICY); + save(prefs, dialog.cbAutoOrderTrigger, KEY_AUTO_ORDER_TRIGGER, "true", "false", UPDATE_CACHE_POLICY); // images save(prefs, dialog.cbUseDefaultImageFolder, KEY_CARD_IMAGES_USE_DEFAULT, "true", "false", UPDATE_CACHE_POLICY); @@ -1736,10 +2000,11 @@ public class PreferencesDialog extends javax.swing.JDialog { save(prefs, dialog.txtURLServerList, KEY_CONNECTION_URL_SERVER_LIST); // Avatar - if (available_avatars.contains(selectedAvatarId)) { - prefs.put(KEY_AVATAR, String.valueOf(selectedAvatarId)); - updateCache(KEY_AVATAR, String.valueOf(selectedAvatarId)); + if (selectedAvatarId < MIN_AVATAR_ID || selectedAvatarId > MAX_AVATAR_ID) { + selectedAvatarId = DEFAULT_AVATAR_ID; } + prefs.put(KEY_AVATAR, String.valueOf(selectedAvatarId)); + updateCache(KEY_AVATAR, String.valueOf(selectedAvatarId)); try { MageFrame.getSession().updatePreferencesForServer(getUserData()); @@ -2001,6 +2266,22 @@ public class PreferencesDialog extends javax.swing.JDialog { // TODO add your handling code here: }//GEN-LAST:event_cbAskMoveToGraveOrderActionPerformed + private void cbDraftLogAutoSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbDraftLogAutoSaveActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_cbDraftLogAutoSaveActionPerformed + + private void cbPassPriorityCastActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbPassPriorityCastActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_cbPassPriorityCastActionPerformed + + private void cbPassPriorityActivationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbPassPriorityActivationActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_cbPassPriorityActivationActionPerformed + + private void cbAutoOrderTriggerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbAutoOrderTriggerActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_cbAutoOrderTriggerActionPerformed + private void showProxySettings() { if (cbProxyType.getSelectedItem() == Connection.ProxyType.SOCKS) { this.pnlProxy.setVisible(true); @@ -2079,6 +2360,7 @@ public class PreferencesDialog extends javax.swing.JDialog { load(prefs, dialog.cbAskMoveToGraveOrder, KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true"); load(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true"); + load(prefs, dialog.cbDraftLogAutoSave, KEY_DRAFT_LOG_AUTO_SAVE, "true"); load(prefs, dialog.checkBoxUpkeepYou, UPKEEP_YOU, "on", "on"); load(prefs, dialog.checkBoxDrawYou, DRAW_YOU, "on", "on"); @@ -2100,6 +2382,9 @@ public class PreferencesDialog extends javax.swing.JDialog { load(prefs, dialog.cbStopBlock, KEY_STOP_BLOCK, "true", "true"); load(prefs, dialog.cbStopOnAllMain, KEY_STOP_ALL_MAIN_PHASES, "true", "false"); load(prefs, dialog.cbStopOnAllEnd, KEY_STOP_ALL_END_PHASES, "true", "false"); + load(prefs, dialog.cbPassPriorityCast, KEY_PASS_PRIORITY_CAST, "true", "false"); + load(prefs, dialog.cbPassPriorityActivation, KEY_PASS_PRIORITY_ACTIVATION, "true", "false"); + load(prefs, dialog.cbAutoOrderTrigger, KEY_AUTO_ORDER_TRIGGER, "true", "true"); } @@ -2196,7 +2481,7 @@ public class PreferencesDialog extends javax.swing.JDialog { } catch (NumberFormatException n) { selectedAvatarId = DEFAULT_AVATAR_ID; } finally { - if (!available_avatars.contains(selectedAvatarId)) { + if (selectedAvatarId < MIN_AVATAR_ID || selectedAvatarId > MAX_AVATAR_ID) { selectedAvatarId = DEFAULT_AVATAR_ID; } } @@ -2280,6 +2565,7 @@ public class PreferencesDialog extends javax.swing.JDialog { private static void load(Preferences prefs, JCheckBox checkBox, String propName, String yesValue, String defaultValue) { String prop = prefs.get(propName, defaultValue); checkBox.setSelected(prop.equals(yesValue)); + updateCache(propName, prop); } private static void load(Preferences prefs, JTextField field, String propName, String defaultValue) { @@ -2362,26 +2648,37 @@ public class PreferencesDialog extends javax.swing.JDialog { private void addAvatars() { try { - addAvatar(jPanel10, 51, true, false); + addAvatar(jPanel10, 10, true, false); + addAvatar(jPanel11, 11, false, false); + addAvatar(jPanel12, 12, false, false); addAvatar(jPanel13, 13, false, false); - addAvatar(jPanel11, 9, false, false); - addAvatar(jPanel12, 53, false, false); - addAvatar(jPanel14, 10, false, false); - addAvatar(jPanel15, 39, false, false); + addAvatar(jPanel14, 14, false, false); + addAvatar(jPanel15, 15, false, false); + addAvatar(jPanel16, 16, false, false); + addAvatar(jPanel17, 17, false, false); + addAvatar(jPanel18, 18, false, false); addAvatar(jPanel19, 19, false, false); - addAvatar(jPanel20, 30, false, false); - addAvatar(jPanel21, 25, false, false); + addAvatar(jPanel20, 20, false, false); + addAvatar(jPanel21, 21, false, false); + addAvatar(jPanel22, 22, false, false); + addAvatar(jPanel23, 23, false, false); + addAvatar(jPanel24, 24, false, false); + addAvatar(jPanel25, 25, false, false); + addAvatar(jPanel26, 26, false, false); + addAvatar(jPanel27, 27, false, false); + addAvatar(jPanel28, 28, false, false); + addAvatar(jPanel29, 29, false, false); + addAvatar(jPanel30, 30, false, false); + addAvatar(jPanel31, 31, false, false); + addAvatar(jPanel32, 32, false, false); - addAvatar(jPanel16, 22, false, false); - addAvatar(jPanel17, 77, false, false); - addAvatar(jPanel18, 62, false, false); } catch (Exception e) { log.error(e, e); } } public void setSelectedId(int id) { - if (available_avatars.contains(id)) { + if (id >= MIN_AVATAR_ID && id <= MAX_AVATAR_ID) { for (JPanel panel : panels.values()) { panel.setBorder(BLACK_BORDER); } @@ -2394,7 +2691,8 @@ public class PreferencesDialog extends javax.swing.JDialog { String path = "/avatars/" + String.valueOf(id) + ".jpg"; panels.put(id, jPanel); Image image = ImageHelper.getImageFromResources(path); - Rectangle r = new Rectangle(90, 90); + + Rectangle r = new Rectangle(jPanel.getWidth() - 5, jPanel.getHeight() - 5); BufferedImage bufferedImage; if (!locked) { bufferedImage = BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB); @@ -2425,16 +2723,22 @@ public class PreferencesDialog extends javax.swing.JDialog { } public static UserData getUserData() { + if (selectedAvatarId == 0) { + getSelectedAvatar(); + } return new UserData(UserGroup.PLAYER, PreferencesDialog.selectedAvatarId, - PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true").equals("true"), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_ABILITY_PICKER_FORCED, "true").equals("true"), PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"), PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"), getUserSkipPrioritySteps(), MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world"), PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true").equals("true"), PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_MANA_AUTOPAYMENT, "true").equals("true"), - PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_MANA_AUTOPAYMENT_ONLY_ONE, "true").equals("true") + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_MANA_AUTOPAYMENT_ONLY_ONE, "true").equals("true"), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PASS_PRIORITY_CAST, "true").equals("true"), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PASS_PRIORITY_ACTIVATION, "true").equals("true"), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_AUTO_ORDER_TRIGGER, "true").equals("true") ); } @@ -2447,14 +2751,18 @@ public class PreferencesDialog extends javax.swing.JDialog { private javax.swing.JButton btnBrowseImageLocation; private javax.swing.JCheckBox cbAllowRequestToShowHandCards; private javax.swing.JCheckBox cbAskMoveToGraveOrder; + private javax.swing.JCheckBox cbAutoOrderTrigger; private javax.swing.JCheckBox cbCheckForNewImages; private javax.swing.JCheckBox cbConfirmEmptyManaPool; + private javax.swing.JCheckBox cbDraftLogAutoSave; private javax.swing.JCheckBox cbEnableBattlefieldBGM; private javax.swing.JCheckBox cbEnableDraftSounds; private javax.swing.JCheckBox cbEnableGameSounds; private javax.swing.JCheckBox cbEnableOtherSounds; private javax.swing.JCheckBox cbEnableSkipButtonsSounds; private javax.swing.JCheckBox cbGameLogAutoSave; + private javax.swing.JCheckBox cbPassPriorityActivation; + private javax.swing.JCheckBox cbPassPriorityCast; private javax.swing.JComboBox cbPreferedImageLanguage; private javax.swing.JComboBox cbProxyType; private javax.swing.JCheckBox cbSaveToZipFiles; @@ -2485,8 +2793,6 @@ public class PreferencesDialog extends javax.swing.JDialog { private javax.swing.JCheckBox displayBigCardsInHand; private javax.swing.JButton exitButton; private javax.swing.JLabel jLabel11; - private javax.swing.JLabel jLabel12; - private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel16; @@ -2513,6 +2819,18 @@ public class PreferencesDialog extends javax.swing.JDialog { private javax.swing.JPanel jPanel19; private javax.swing.JPanel jPanel20; private javax.swing.JPanel jPanel21; + private javax.swing.JPanel jPanel22; + private javax.swing.JPanel jPanel23; + private javax.swing.JPanel jPanel24; + private javax.swing.JPanel jPanel25; + private javax.swing.JPanel jPanel26; + private javax.swing.JPanel jPanel27; + private javax.swing.JPanel jPanel28; + private javax.swing.JPanel jPanel29; + private javax.swing.JPanel jPanel30; + private javax.swing.JPanel jPanel31; + private javax.swing.JPanel jPanel32; + private javax.swing.JPanel jPanel33; private javax.swing.JLabel labelPreferedImageLanguage; private javax.swing.JLabel lblProxyPassword; private javax.swing.JLabel lblProxyPort; diff --git a/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java b/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java index 433aecd21cd..dffa208b6c7 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/ShowCardsDialog.java @@ -1,82 +1,76 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ /* * ShowCardsDialog.java * * Created on 3-Feb-2010, 8:59:11 PM */ - package mage.client.dialog; import java.awt.Component; import java.awt.Point; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; import java.io.Serializable; import java.util.Map; import java.util.UUID; -import javax.swing.ImageIcon; import javax.swing.JLayeredPane; +import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import mage.cards.CardDimensions; import mage.client.MageFrame; import mage.client.cards.BigCard; import mage.client.cards.CardArea; -import mage.client.util.CardsViewUtil; +import mage.client.util.Event; +import mage.client.util.Listener; import mage.client.util.SettingsManager; import mage.client.util.gui.GuiDisplayUtil; +import mage.game.events.PlayerQueryEvent.QueryType; import mage.view.CardsView; -import mage.view.SimpleCardsView; import org.mage.card.arcane.CardPanel; -import org.mage.plugins.card.utils.impl.ImageManagerImpl; /** * @author BetaSteward_at_googlemail.com */ -public class ShowCardsDialog extends MageDialog implements MouseListener { +public class ShowCardsDialog extends MageDialog { - - // remember if this dialog was already auto positioned, so don't do it after the first time private boolean positioned; - /** * Creates new form ShowCardsDialog */ public ShowCardsDialog() { this.positioned = false; - + this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); initComponents(); this.setModal(false); - + } public void cleanUp() { @@ -89,33 +83,37 @@ public class ShowCardsDialog extends MageDialog implements MouseListener { } } - public void loadCards(String name, SimpleCardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal) { - loadCards(name, CardsViewUtil.convertSimple(showCards), bigCard, dimension, gameId, modal); - } - - public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal) { - loadCards(name, showCards, bigCard, dimension, gameId, modal, null); - } - - public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal, Map options) { + public void loadCards(String name, CardsView showCards, BigCard bigCard, + CardDimensions dimension, UUID gameId, boolean modal, Map options, + JPopupMenu popupMenu, Listener eventListener) { this.title = name; this.setTitelBarToolTip(name); - cardArea.loadCards(showCards, bigCard, dimension, gameId, this); + cardArea.clearCardEventListeners(); + cardArea.loadCards(showCards, bigCard, dimension, gameId); if (options != null) { if (options.containsKey("chosen")) { - java.util.List chosenCards = (java.util.List)options.get("chosen"); + java.util.List chosenCards = (java.util.List) options.get("chosen"); cardArea.selectCards(chosenCards); } if (options.containsKey("choosable")) { - java.util.List choosableCards = (java.util.List)options.get("choosable"); + java.util.List choosableCards = (java.util.List) options.get("choosable"); cardArea.markCards(choosableCards); } + if (options.containsKey("queryType") && QueryType.PICK_ABILITY.equals(options.get("queryType"))) { + cardArea.setPopupMenu(popupMenu); + } + } + if (popupMenu != null) { + this.cardArea.setPopupMenu(popupMenu); + } + if (eventListener != null) { + this.cardArea.addCardEventListener(eventListener); } if (getParent() != MageFrame.getDesktop() /*|| this.isClosed*/) { MageFrame.getDesktop().add(this, JLayeredPane.DEFAULT_LAYER); } - pack(); + pack(); this.revalidate(); this.repaint(); @@ -147,36 +145,9 @@ public class ShowCardsDialog extends MageDialog implements MouseListener { setResizable(true); getContentPane().setLayout(new java.awt.BorderLayout()); getContentPane().add(cardArea, java.awt.BorderLayout.CENTER); - this.addMouseListener(this); pack(); } private CardArea cardArea; - - @Override - public void mouseClicked(MouseEvent e) { - this.hideDialog(); - } - - @Override - public void mousePressed(MouseEvent e) { - // only hide dialog, if a cardPanel was selected - if (e.getSource() instanceof CardPanel) { - this.hideDialog(); - } - } - - @Override - public void mouseReleased(MouseEvent e) { - } - - @Override - public void mouseEntered(MouseEvent e) { - } - - @Override - public void mouseExited(MouseEvent e) { - } - } diff --git a/Mage.Client/src/main/java/mage/client/dialog/TableWaitingDialog.form b/Mage.Client/src/main/java/mage/client/dialog/TableWaitingDialog.form index 226f944a8db..be222cd34b6 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/TableWaitingDialog.form +++ b/Mage.Client/src/main/java/mage/client/dialog/TableWaitingDialog.form @@ -28,13 +28,13 @@ - +
- +
@@ -91,9 +91,10 @@
- + + @@ -122,10 +123,7 @@
- - - - + diff --git a/Mage.Client/src/main/java/mage/client/dialog/TableWaitingDialog.java b/Mage.Client/src/main/java/mage/client/dialog/TableWaitingDialog.java index 156ea32b0a1..9840c82582b 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/TableWaitingDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/TableWaitingDialog.java @@ -41,7 +41,7 @@ import javax.swing.Icon; import javax.swing.SwingWorker; import javax.swing.table.AbstractTableModel; import mage.client.MageFrame; -import mage.client.chat.ChatPanel; +import mage.client.chat.ChatPanelBasic; import mage.client.components.MageComponents; import mage.client.components.tray.MageTray; import static mage.client.dialog.PreferencesDialog.KEY_TABLE_WAITING_COLUMNS_ORDER; @@ -86,7 +86,7 @@ public class TableWaitingDialog extends MageDialog { this.setSize(prefWidth, prefHeight); } - chatPanel.useExtendedView(ChatPanel.VIEW_MODE.NONE); + chatPanel.useExtendedView(ChatPanelBasic.VIEW_MODE.NONE); tableSeats.createDefaultColumnsFromModel(); TableUtil.setColumnWidthAndOrder(tableSeats, defaultColumnsWidth, KEY_TABLE_WAITING_COLUMNS_WIDTH, KEY_TABLE_WAITING_COLUMNS_ORDER); tableSeats.setDefaultRenderer(Icon.class, new CountryCellRenderer()); @@ -183,7 +183,7 @@ public class TableWaitingDialog extends MageDialog { jSplitPane1 = new javax.swing.JSplitPane(); jScrollPane1 = new javax.swing.JScrollPane(); tableSeats = new javax.swing.JTable(); - chatPanel = new mage.client.chat.ChatPanel(false); + chatPanel = new mage.client.chat.ChatPanelBasic(); setResizable(true); setTitle("Waiting for players"); @@ -219,9 +219,10 @@ public class TableWaitingDialog extends MageDialog { } }); - jSplitPane1.setDividerLocation(320); + jSplitPane1.setDividerLocation(300); jSplitPane1.setDividerSize(3); jSplitPane1.setResizeWeight(1.0); + jSplitPane1.setToolTipText(""); tableSeats.setModel(tableWaitModel); tableSeats.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); @@ -239,12 +240,12 @@ public class TableWaitingDialog extends MageDialog { .addComponent(btnMoveDown) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnMoveUp) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 326, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnStart) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnCancel) .addContainerGap()) - .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 644, Short.MAX_VALUE) + .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -308,7 +309,7 @@ public class TableWaitingDialog extends MageDialog { private javax.swing.JButton btnMoveDown; private javax.swing.JButton btnMoveUp; private javax.swing.JButton btnStart; - private mage.client.chat.ChatPanel chatPanel; + private mage.client.chat.ChatPanelBasic chatPanel; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JSplitPane jSplitPane1; private javax.swing.JTable tableSeats; diff --git a/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java b/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java index da4ea2b4255..679cb823d06 100644 --- a/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java +++ b/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java @@ -31,7 +31,6 @@ * * Created on Jan 7, 2011, 2:15:48 PM */ - package mage.client.draft; import java.awt.Component; @@ -41,7 +40,16 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.text.SimpleDateFormat; +import java.util.Collection; +import java.util.Date; import java.util.HashSet; +import java.util.LinkedList; import java.util.Map; import java.util.Set; import java.util.UUID; @@ -53,9 +61,12 @@ import javax.swing.JOptionPane; import javax.swing.JPopupMenu; import javax.swing.KeyStroke; import javax.swing.Timer; +import mage.cards.repository.CardInfo; +import mage.cards.repository.CardRepository; import mage.client.MageFrame; import mage.client.components.tray.MageTray; import mage.client.deckeditor.SortSettingDraft; +import mage.client.dialog.PreferencesDialog; import mage.client.plugins.impl.Plugins; import mage.client.util.CardsViewUtil; import mage.client.util.Event; @@ -69,6 +80,7 @@ import mage.view.DraftPickView; import mage.view.DraftView; import mage.view.SimpleCardView; import mage.view.SimpleCardsView; +import org.apache.log4j.Logger; /** * @@ -76,6 +88,8 @@ import mage.view.SimpleCardsView; */ public class DraftPanel extends javax.swing.JPanel { + private static final Logger logger = Logger.getLogger(DraftPanel.class); + private UUID draftId; private Session session; private Timer countdown; @@ -94,16 +108,31 @@ public class DraftPanel extends javax.swing.JPanel { // id of card with popup menu protected UUID cardIdPopupMenu; + // Filename for the draft log (only updated if writing the log). + private String logFilename; + + // Number of the current booster (for draft log writing). + private int packNo; + + // Number of the current card pick (for draft log writing). + private int pickNo; + + // Cached booster data to be written into the log (see logLastPick). + private String currentBoosterHeader; + private String[] currentBooster; + private static final CardsView emptyView = new CardsView(); - /** Creates new form DraftPanel */ + /** + * Creates new form DraftPanel + */ public DraftPanel() { initComponents(); draftBooster.setOpaque(false); draftPicks.setSortSetting(SortSettingDraft.getInstance()); draftPicks.setOpaque(false); - + popupMenuPickedArea = new JPopupMenu(); addPopupMenuPickArea(); this.add(popupMenuPickedArea); @@ -115,18 +144,17 @@ public class DraftPanel extends javax.swing.JPanel { draftLeftPane.setOpaque(false); countdown = new Timer(1000, - new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - if (--timeout > 0) { - setTimeout(timeout); - } - else { - setTimeout(0); - countdown.stop(); + new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (--timeout > 0) { + setTimeout(timeout); + } else { + setTimeout(0); + countdown.stop(); + } } } - } ); } @@ -149,15 +177,29 @@ public class DraftPanel extends javax.swing.JPanel { if (!session.joinDraft(draftId)) { hideDraft(); } + + if (isLogging()) { + // If we are logging the draft create a file that will contain + // the log. + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss"); + logFilename = "Draft_" + sdf.format(new Date()) + "_" + draftId + ".txt"; + try { + Files.write(pathToDraftLog(), "".getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); + } catch (IOException ex) { + logger.error(null, ex); + } + } else { + logFilename = null; + } } - public void updateDraft(DraftView draftView) { - if (draftView.getSets().size() != 3){ + public void updateDraft(DraftView draftView) { + if (draftView.getSets().size() != 3) { // Random draft this.txtPack1.setText("Random Boosters"); this.txtPack2.setText("Random Boosters"); this.txtPack3.setText("Random Boosters"); - }else{ + } else { this.txtPack1.setText(draftView.getSets().get(0)); this.txtPack2.setText(draftView.getSets().get(1)); this.txtPack3.setText(draftView.getSets().get(2)); @@ -167,17 +209,20 @@ public class DraftPanel extends javax.swing.JPanel { this.chkPack3.setSelected(draftView.getBoosterNum() > 2); this.txtCardNo.setText(Integer.toString(draftView.getCardNum())); + packNo = draftView.getBoosterNum(); + pickNo = draftView.getCardNum(); + int right = draftView.getPlayers().size() / 2; int left = draftView.getPlayers().size() - right; int height = left * 18; lblTableImage.setSize(new Dimension(lblTableImage.getWidth(), height)); - Image tableImage = ImageHelper.getImageFromResources(draftView.getBoosterNum() == 2 ? "/draft/table_left.png":"/draft/table_right.png"); + Image tableImage = ImageHelper.getImageFromResources(draftView.getBoosterNum() == 2 ? "/draft/table_left.png" : "/draft/table_right.png"); BufferedImage resizedTable = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(tableImage, BufferedImage.TYPE_INT_ARGB), lblTableImage.getWidth()); lblTableImage.setIcon(new ImageIcon(resizedTable)); - + int count = 0; int numberPlayers = draftView.getPlayers().size(); - for(String playerName: draftView.getPlayers()) { + for (String playerName : draftView.getPlayers()) { count++; setPlayerNameToLabel(playerName, count, numberPlayers); } @@ -188,13 +233,13 @@ public class DraftPanel extends javax.swing.JPanel { int right = players / 2; int left = players - right; if (index <= left) { - // left side down (1 - 8) + // left side down (1 - 8) tablePosition = index; } else { // right side up (16 - 9) tablePosition = 9 + right - (index - left); } - switch(tablePosition) { + switch (tablePosition) { case 1: lblPlayer01.setText(name); break; @@ -247,50 +292,51 @@ public class DraftPanel extends javax.swing.JPanel { } public void loadBooster(DraftPickView draftPickView) { + logLastPick(draftPickView); // upper area that shows the picks loadCardsToPickedCardsArea(draftPickView.getPicks()); this.draftPicks.clearCardEventListeners(); - this.draftPicks.addCardEventListener(new Listener () { - @Override - public void event(Event event) { - if (event.getEventName().equals("show-popup-menu")) { - if (event.getSource() != null) { - // Popup Menu Card - cardIdPopupMenu = ((SimpleCardView)event.getSource()).getId(); - popupMenuCardPanel.show(event.getComponent(), event.getxPos(), event.getyPos()); - } else { - // Popup Menu area - popupMenuPickedArea.show(event.getComponent(), event.getxPos(), event.getyPos()); - } + this.draftPicks.addCardEventListener(new Listener() { + @Override + public void event(Event event) { + if (event.getEventName().equals("show-popup-menu")) { + if (event.getSource() != null) { + // Popup Menu Card + cardIdPopupMenu = ((SimpleCardView) event.getSource()).getId(); + popupMenuCardPanel.show(event.getComponent(), event.getxPos(), event.getyPos()); + } else { + // Popup Menu area + popupMenuPickedArea.show(event.getComponent(), event.getxPos(), event.getyPos()); } } } + } ); // lower area that shows the booster draftBooster.loadBooster(CardsViewUtil.convertSimple(draftPickView.getBooster()), bigCard); this.draftBooster.clearCardEventListeners(); this.draftBooster.addCardEventListener( - new Listener () { - @Override - public void event(Event event) { - if (event.getEventName().equals("pick-a-card")) { - SimpleCardView source = (SimpleCardView) event.getSource(); - DraftPickView view = session.sendCardPick(draftId, source.getId(), cardsHidden); - if (view != null) { - loadCardsToPickedCardsArea(view.getPicks()); - draftBooster.loadBooster(emptyView, bigCard); - Plugins.getInstance().getActionCallback().hidePopup(); - setMessage("Waiting for other players"); + new Listener() { + @Override + public void event(Event event) { + if (event.getEventName().equals("pick-a-card")) { + SimpleCardView source = (SimpleCardView) event.getSource(); + DraftPickView view = session.sendCardPick(draftId, source.getId(), cardsHidden); + if (view != null) { + loadCardsToPickedCardsArea(view.getPicks()); + draftBooster.loadBooster(emptyView, bigCard); + Plugins.getInstance().getActionCallback().hideTooltipPopup(); + setMessage("Waiting for other players"); + } + } + if (event.getEventName().equals("mark-a-card")) { + SimpleCardView source = (SimpleCardView) event.getSource(); + session.sendCardMark(draftId, source.getId()); } } - if (event.getEventName().equals("mark-a-card")) { - SimpleCardView source = (SimpleCardView) event.getSource(); - session.sendCardMark(draftId, source.getId()); - } } - } ); setMessage("Pick a card"); if (!MageFrame.getInstance().isActive()) { @@ -307,7 +353,7 @@ public class DraftPanel extends javax.swing.JPanel { private void loadCardsToPickedCardsArea(SimpleCardsView pickedCards) { this.pickedCards = pickedCards; - for (Map.Entry entry: pickedCards.entrySet()) { + for (Map.Entry entry : pickedCards.entrySet()) { if (!cardsHidden.contains(entry.getKey())) { pickedCardsShown.put(entry.getKey(), entry.getValue()); } @@ -315,22 +361,22 @@ public class DraftPanel extends javax.swing.JPanel { draftPicks.loadCards(CardsViewUtil.convertSimple(pickedCardsShown), bigCard, null); } - private void setTimeout(int s){ - int minute = s/60; - int second = s - (minute*60); + private void setTimeout(int s) { + int minute = s / 60; + int second = s - (minute * 60); String text; - if(minute < 10){ + if (minute < 10) { text = "0" + Integer.toString(minute) + ":"; - }else{ + } else { text = Integer.toString(minute) + ":"; } - if(second < 10){ + if (second < 10) { text = text + "0" + Integer.toString(second); - }else{ + } else { text = text + Integer.toString(second); } this.txtTimeRemaining.setText(text); - if (s==6 && !draftBooster.isEmptyGrid()) { + if (s == 6 && !draftBooster.isEmptyGrid()) { AudioManager.playOnCountdown1(); } } @@ -341,7 +387,7 @@ public class DraftPanel extends javax.swing.JPanel { c = c.getParent(); } if (c != null) { - ((DraftPane)c).removeDraft(); + ((DraftPane) c).removeDraft(); } } @@ -375,7 +421,6 @@ public class DraftPanel extends javax.swing.JPanel { }); // popupMenuPickedArea.addSeparator(); - } private void addPopupMenuCardPanel() { @@ -394,7 +439,6 @@ public class DraftPanel extends javax.swing.JPanel { }); // popupMenuCardPanel.addSeparator(); - } private void hideThisCard(UUID card) { @@ -413,10 +457,97 @@ public class DraftPanel extends javax.swing.JPanel { draftPicks.loadCards(CardsViewUtil.convertSimple(pickedCardsShown), bigCard, null); } - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + // Log the last card picked into the draft log together with booster + // contents. + // We don't get any event when the card is selected due to timeout + // that's why instead of proactively logging our pick we instead + // log *last* pick from the list of picks. + // To make this possible we cache the list of cards from the + // previous booster and it's sequence number (pack number / pick number) + // in fields currentBooster and currentBoosterHeader. + private void logLastPick(DraftPickView pickView) { + if (!isLogging()) { + return; + } + if (currentBooster != null) { + String lastPick = getCardName(getLastPick(pickView.getPicks().values())); + if (lastPick != null && currentBooster.length > 1) { + logPick(lastPick); + } + currentBooster = null; + } + setCurrentBoosterForLog(pickView.getBooster()); + if (currentBooster.length == 1) { + logPick(currentBooster[0]); + } + } + + private static boolean isLogging() { + String autoSave = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_DRAFT_LOG_AUTO_SAVE, "true"); + return autoSave.equals("true"); + } + + private void setCurrentBoosterForLog(SimpleCardsView booster) { + LinkedList cards = new LinkedList<>(); + for (SimpleCardView simple : booster.values()) { + String cardName = getCardName(simple); + if (cardName != null) { + cards.add(cardName); + } + } + + currentBoosterHeader = "Pack " + packNo + " pick " + pickNo + ":\n"; + currentBooster = cards.toArray(new String[cards.size()]); + } + + private void logPick(String pick) { + StringBuilder b = new StringBuilder(); + b.append(currentBoosterHeader); + for (String name : currentBooster) { + b.append(pick.equals(name) ? "--> " : " "); + b.append(name); + b.append('\n'); + } + b.append('\n'); + appendToDraftLog(b.toString()); + } + + private Path pathToDraftLog() { + File saveDir = new File("gamelogs"); + if (!saveDir.exists()) { + saveDir.mkdirs(); + } + return new File(saveDir, logFilename).toPath(); + } + + private void appendToDraftLog(String data) { + try { + Files.write(pathToDraftLog(), data.getBytes(), StandardOpenOption.APPEND); + } catch (IOException ex) { + logger.error(null, ex); + } + } + + private static SimpleCardView getLastPick(Collection picks) { + SimpleCardView last = null; + for (SimpleCardView pick : picks) { + last = pick; + } + return last; + } + + private static String getCardName(SimpleCardView card) { + if (card == null) { + return null; + } + CardInfo cardInfo = CardRepository.instance.findCard(card.getExpansionSetCode(), card.getCardNumber()); + return cardInfo != null ? cardInfo.getName() : null; + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents diff --git a/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java b/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java index 5daa90a9f71..6b68931c35e 100644 --- a/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java @@ -42,12 +42,14 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import mage.client.MageFrame; -import mage.client.chat.ChatPanel; +import mage.client.chat.ChatPanelBasic; import mage.client.components.MageTextArea; import mage.client.dialog.MageDialog; import mage.client.util.audio.AudioManager; import mage.client.util.gui.ArrowBuilder; -import mage.constants.Constants; +import static mage.constants.Constants.Option.ORIGINAL_ID; +import static mage.constants.Constants.Option.SECOND_MESSAGE; +import static mage.constants.Constants.Option.SPECIAL_BUTTON; import mage.constants.PlayerAction; import mage.remote.Session; import org.apache.log4j.Logger; @@ -69,7 +71,7 @@ public class FeedbackPanel extends javax.swing.JPanel { private Session session; private FeedbackMode mode; private MageDialog connectedDialog; - private ChatPanel connectedChatPanel; + private ChatPanelBasic connectedChatPanel; private int lastMessageId; private static final ScheduledExecutorService worker = Executors.newSingleThreadScheduledExecutor(); @@ -85,6 +87,7 @@ public class FeedbackPanel extends javax.swing.JPanel { public void init(UUID gameId) { this.gameId = gameId; session = MageFrame.getSession(); + helper.init(gameId); } public void getFeedback(FeedbackMode mode, String message, boolean special, Map options, int messageId) { @@ -95,61 +98,42 @@ public class FeedbackPanel extends javax.swing.JPanel { } this.lastMessageId = messageId; } - - this.lblMessage.setText(message); - this.helper.setMessage(message); + this.helper.setBasicMessage(message); + this.helper.setOriginalId(null); // reference to the feedback causing ability + String lblText = addAdditionalText(message, options); + this.helper.setTextArea(lblText); + this.lblMessage.setText(lblText); this.mode = mode; switch (this.mode) { case INFORM: - this.btnLeft.setVisible(false); - this.btnRight.setVisible(false); - this.helper.setState("", false, "", false); + setButtonState("", "", mode); break; case QUESTION: - this.btnLeft.setVisible(true); - this.btnLeft.setText("Yes"); - this.btnRight.setVisible(true); - this.btnRight.setText("No"); - this.helper.setState("Yes", true, "No", true); + setButtonState("Yes", "No", mode); + if (options != null && options.containsKey(ORIGINAL_ID)) { + this.helper.setOriginalId((UUID) options.get(ORIGINAL_ID)); + } break; case CONFIRM: - this.btnLeft.setVisible(true); - this.btnLeft.setText("OK"); - this.btnRight.setVisible(true); - this.btnRight.setText("Cancel"); - this.helper.setState("Ok", true, "Cancel", true); + setButtonState("OK", "Cancel", mode); break; case CANCEL: - this.btnLeft.setVisible(false); - this.btnRight.setVisible(true); - this.btnRight.setText("Cancel"); - this.helper.setState("", false, "Cancel", true); + setButtonState("", "Cancel", mode); this.helper.setUndoEnabled(false); break; case SELECT: - this.btnLeft.setVisible(false); - this.btnRight.setVisible(true); - this.btnRight.setText("Done"); - this.helper.setState("", false, "Done", true); + setButtonState("", "Done", mode); break; case END: - this.btnLeft.setVisible(false); - this.btnRight.setVisible(true); - this.btnRight.setText("Close game"); - this.helper.setState("", false, "Close game", true); + setButtonState("", "Close game", mode); ArrowBuilder.getBuilder().removeAllArrows(gameId); endWithTimeout(); break; } - if (options != null && options.containsKey(Constants.Option.SPECIAL_BUTTON)) { - String specialText = (String) options.get(Constants.Option.SPECIAL_BUTTON); - this.btnSpecial.setVisible(true); - this.btnSpecial.setText(specialText); - this.helper.setSpecial(specialText, true); + if (options != null && options.containsKey(SPECIAL_BUTTON)) { + this.setSpecial((String) options.get(SPECIAL_BUTTON), true); } else { - this.btnSpecial.setVisible(special); - this.btnSpecial.setText("Special"); - this.helper.setSpecial("Special", special); + this.setSpecial("Special", special); } requestFocusIfPossible(); @@ -162,6 +146,32 @@ public class FeedbackPanel extends javax.swing.JPanel { this.helper.setVisible(true); } + private void setButtonState(String leftText, String rightText, FeedbackMode mode) { + btnLeft.setVisible(!leftText.isEmpty()); + btnLeft.setText(leftText); + btnRight.setVisible(!rightText.isEmpty()); + btnRight.setText(rightText); + this.helper.setState(leftText, !leftText.isEmpty(), rightText, !rightText.isEmpty(), mode); + } + + private String addAdditionalText(String message, Map options) { + if (options != null && options.containsKey(SECOND_MESSAGE)) { + return message + getSmallText((String) options.get(SECOND_MESSAGE)); + } else { + return message; + } + } + + protected String getSmallText(String text) { + return "
" + text + "
"; + } + + private void setSpecial(String text, boolean visible) { + this.btnSpecial.setText(text); + this.btnSpecial.setVisible(visible); + this.helper.setSpecial(text, visible); + } + /** * Close game window by pressing OK button after 8 seconds */ @@ -313,7 +323,7 @@ public class FeedbackPanel extends javax.swing.JPanel { return this.mode; } - public void setConnectedChatPanel(ChatPanel chatPanel) { + public void setConnectedChatPanel(ChatPanelBasic chatPanel) { this.connectedChatPanel = chatPanel; } diff --git a/Mage.Client/src/main/java/mage/client/game/GamePanel.java b/Mage.Client/src/main/java/mage/client/game/GamePanel.java index 2d172a6a33f..0a44146935b 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -66,8 +66,10 @@ import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JLayeredPane; +import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; +import javax.swing.JPopupMenu; import javax.swing.KeyStroke; import javax.swing.SwingWorker; import javax.swing.border.Border; @@ -80,7 +82,7 @@ import mage.cards.action.ActionCallback; import mage.choices.Choice; import mage.client.MageFrame; import mage.client.cards.BigCard; -import mage.client.chat.ChatPanel; +import mage.client.chat.ChatPanelBasic; import mage.client.combat.CombatManager; import mage.client.components.HoverButton; import mage.client.components.MageComponents; @@ -100,7 +102,9 @@ import mage.client.plugins.adapters.MageActionCallback; import mage.client.plugins.impl.Plugins; import mage.client.util.CardsViewUtil; import mage.client.util.Config; +import mage.client.util.Event; import mage.client.util.GameManager; +import mage.client.util.Listener; import mage.client.util.audio.AudioManager; import mage.client.util.gui.ArrowBuilder; import mage.client.util.gui.MageDialogState; @@ -118,7 +122,13 @@ import static mage.constants.PhaseStep.FIRST_COMBAT_DAMAGE; import static mage.constants.PhaseStep.UNTAP; import static mage.constants.PhaseStep.UPKEEP; import mage.constants.PlayerAction; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_ABILITY_FIRST; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_ABILITY_LAST; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_NAME_FIRST; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_NAME_LAST; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_RESET_ALL; import mage.constants.Zone; +import mage.game.events.PlayerQueryEvent; import mage.remote.Session; import mage.view.AbilityPickerView; import mage.view.CardView; @@ -131,6 +141,7 @@ import mage.view.PlayerView; import mage.view.RevealedView; import mage.view.SimpleCardsView; import org.apache.log4j.Logger; +import org.mage.card.arcane.CardPanel; import org.mage.plugins.card.utils.impl.ImageManagerImpl; /** @@ -143,6 +154,13 @@ public final class GamePanel extends javax.swing.JPanel { private static final String YOUR_HAND = "Your hand"; private static final int X_PHASE_WIDTH = 55; private static final int STACK_MIN_CARDS_OFFSET_Y = 7; + + private static final String CMD_AUTO_ORDER_FIRST = "cmdAutoOrderFirst"; + private static final String CMD_AUTO_ORDER_LAST = "cmdAutoOrderLast"; + private static final String CMD_AUTO_ORDER_NAME_FIRST = "cmdAutoOrderNameFirst"; + private static final String CMD_AUTO_ORDER_NAME_LAST = "cmdAutoOrderNameLast"; + private static final String CMD_AUTO_ORDER_RESET_ALL = "cmdAutoOrderResetAll"; + private final Map players = new HashMap<>(); // non modal frames @@ -174,9 +192,22 @@ public final class GamePanel extends javax.swing.JPanel { private MageDialogState choiceWindowState; + private enum PopUpMenuType { + + TRIGGER_ORDER + } + // CardView popupMenu was invoked last + private CardView cardViewPopupMenu; + + // popup menu for triggered abilities order + private JPopupMenu popupMenuTriggerOrder; + public GamePanel() { initComponents(); + initPopupMenuTriggerOrder(); + //this.add(popupMenuTriggerOrder); + pickNumber = new PickNumberDialog(); MageFrame.getDesktop().add(pickNumber, JLayeredPane.MODAL_LAYER); @@ -281,7 +312,7 @@ public final class GamePanel extends javax.swing.JPanel { pickTargetDialog.cleanUp(); pickTargetDialog.removeDialog(); } - Plugins.getInstance().getActionCallback().hidePopup(); + Plugins.getInstance().getActionCallback().hideTooltipPopup(); try { Component popupContainer = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER); popupContainer.setVisible(false); @@ -957,31 +988,37 @@ public final class GamePanel extends javax.swing.JPanel { * @param messageId */ public void pickTarget(String message, CardsView cardView, GameView gameView, Set targets, boolean required, Map options, int messageId) { - ShowCardsDialog dialog = null; - if (options != null && options.containsKey("targetZone")) { - if (Zone.HAND.equals(options.get("targetZone"))) { // mark selectable target cards in hand - List choosen = null; - if (options.containsKey("chosen")) { - choosen = (List) options.get("chosen"); - } - for (CardView card : gameView.getHand().values()) { - if (targets == null || targets.isEmpty()) { - card.setPlayable(false); - card.setChoosable(true); - } else if (targets.contains(card.getId())) { - card.setPlayable(false); - card.setChoosable(true); + PopUpMenuType popupMenuType = null; + if (options != null) { + if (options.containsKey("targetZone")) { + if (Zone.HAND.equals(options.get("targetZone"))) { // mark selectable target cards in hand + List choosen = null; + if (options.containsKey("chosen")) { + choosen = (List) options.get("chosen"); } - if (choosen != null && choosen.contains(card.getId())) { - card.setSelected(true); + for (CardView card : gameView.getHand().values()) { + if (targets == null || targets.isEmpty()) { + card.setPlayable(false); + card.setChoosable(true); + } else if (targets.contains(card.getId())) { + card.setPlayable(false); + card.setChoosable(true); + } + if (choosen != null && choosen.contains(card.getId())) { + card.setSelected(true); + } } } } + if (options.containsKey("queryType") && PlayerQueryEvent.QueryType.PICK_ABILITY.equals(options.get("queryType"))) { + popupMenuType = PopUpMenuType.TRIGGER_ORDER; + } } updateGame(gameView); Map options0 = options == null ? new HashMap() : options; + ShowCardsDialog dialog = null; if (cardView != null && cardView.size() > 0) { - dialog = showCards(message, cardView, required, options0); + dialog = showCards(message, cardView, required, options0, popupMenuType); options0.put("dialog", dialog); } this.feedbackPanel.getFeedback(required ? FeedbackMode.INFORM : FeedbackMode.CANCEL, message, gameView.getSpecial(), options0, messageId); @@ -1066,10 +1103,14 @@ public final class GamePanel extends javax.swing.JPanel { ((MageActionCallback) callback).hideGameUpdate(gameId); } - private ShowCardsDialog showCards(String title, CardsView cards, boolean required, Map options) { + private ShowCardsDialog showCards(String title, CardsView cards, boolean required, Map options, PopUpMenuType popupMenuType) { hideAll(); ShowCardsDialog showCards = new ShowCardsDialog(); - showCards.loadCards(title, cards, bigCard, Config.dimensionsEnlarged, gameId, required, options); + JPopupMenu popupMenu = null; + if (PopUpMenuType.TRIGGER_ORDER.equals(popupMenuType)) { + popupMenu = popupMenuTriggerOrder; + } + showCards.loadCards(title, cards, bigCard, Config.dimensionsEnlarged, gameId, required, options, popupMenu, getShowCardsEventListener(showCards)); return showCards; } @@ -1163,12 +1204,12 @@ public final class GamePanel extends javax.swing.JPanel { btnSkipForward = new javax.swing.JButton(); btnPreviousPlay = new javax.swing.JButton(); pnlBattlefield = new javax.swing.JPanel(); - gameChatPanel = new mage.client.chat.ChatPanel(); - gameChatPanel.useExtendedView(ChatPanel.VIEW_MODE.GAME); - userChatPanel = new mage.client.chat.ChatPanel(); + gameChatPanel = new mage.client.chat.ChatPanelBasic(); + gameChatPanel.useExtendedView(ChatPanelBasic.VIEW_MODE.GAME); + userChatPanel = new mage.client.chat.ChatPanelBasic(); userChatPanel.setParentChat(gameChatPanel); - userChatPanel.useExtendedView(ChatPanel.VIEW_MODE.CHAT); - userChatPanel.setChatType(ChatPanel.ChatType.GAME); + userChatPanel.useExtendedView(ChatPanelBasic.VIEW_MODE.CHAT); + userChatPanel.setChatType(ChatPanelBasic.ChatType.GAME); gameChatPanel.setConnectedChat(userChatPanel); gameChatPanel.disableInput(); gameChatPanel.setMinimumSize(new java.awt.Dimension(100, 48)); @@ -1942,6 +1983,106 @@ public final class GamePanel extends javax.swing.JPanel { hoverButtons.put(name, button); } + // Event listener for the ShowCardsDialog + private Listener getShowCardsEventListener(final ShowCardsDialog dialog) { + return new Listener() { + @Override + public void event(Event event) { + if (event.getEventName().equals("show-popup-menu")) { + if (event.getComponent() != null && event.getComponent() instanceof CardPanel) { + JPopupMenu menu = ((CardPanel) event.getComponent()).getPopupMenu(); + if (menu != null) { + cardViewPopupMenu = ((CardView) event.getSource()); + menu.show(event.getComponent(), event.getxPos(), event.getyPos()); + } + } + } + if (event.getEventName().equals("action-consumed")) { + dialog.removeDialog(); + } + } + }; + } + + public void handleTriggerOrderPopupMenuEvent(ActionEvent e) { + UUID abilityId = null; + String abilityRuleText = null; + if (cardViewPopupMenu instanceof CardView && cardViewPopupMenu.getAbility() != null) { + abilityId = cardViewPopupMenu.getAbility().getId(); + if (!cardViewPopupMenu.getAbility().getRules().isEmpty() + && !cardViewPopupMenu.getAbility().getRules().get(0).isEmpty()) { + abilityRuleText = cardViewPopupMenu.getAbility().getRules().get(0); + } + } + switch (e.getActionCommand()) { + case CMD_AUTO_ORDER_FIRST: + session.sendPlayerAction(TRIGGER_AUTO_ORDER_ABILITY_FIRST, gameId, abilityId); + session.sendPlayerUUID(gameId, abilityId); + break; + case CMD_AUTO_ORDER_LAST: + session.sendPlayerAction(TRIGGER_AUTO_ORDER_ABILITY_LAST, gameId, abilityId); + session.sendPlayerUUID(gameId, null); // Don't use this but refresh the displayed abilities + break; + case CMD_AUTO_ORDER_NAME_FIRST: + if (abilityRuleText != null) { + session.sendPlayerAction(TRIGGER_AUTO_ORDER_NAME_FIRST, gameId, abilityRuleText); + session.sendPlayerUUID(gameId, abilityId); + } + break; + case CMD_AUTO_ORDER_NAME_LAST: + if (abilityRuleText != null) { + session.sendPlayerAction(TRIGGER_AUTO_ORDER_NAME_LAST, gameId, abilityRuleText); + session.sendPlayerUUID(gameId, null); // Don't use this but refresh the displayed abilities + } + break; + case CMD_AUTO_ORDER_RESET_ALL: + session.sendPlayerAction(TRIGGER_AUTO_ORDER_RESET_ALL, gameId, null); + break; + } + for (ShowCardsDialog dialog : pickTarget) { + dialog.removeDialog(); + } + } + + private void initPopupMenuTriggerOrder() { + + ActionListener actionListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + handleTriggerOrderPopupMenuEvent(e); + } + }; + + popupMenuTriggerOrder = new JPopupMenu(); + + // String tooltipText = ""; + JMenuItem menuItem; + menuItem = new JMenuItem("Put this ability always first on the stack"); + menuItem.setActionCommand(CMD_AUTO_ORDER_FIRST); + menuItem.addActionListener(actionListener); + popupMenuTriggerOrder.add(menuItem); + + menuItem = new JMenuItem("Put this ability always last on the stack"); + menuItem.setActionCommand(CMD_AUTO_ORDER_LAST); + menuItem.addActionListener(actionListener); + popupMenuTriggerOrder.add(menuItem); + + menuItem = new JMenuItem("Put all abilities with that rule text always first on the stack"); + menuItem.setActionCommand(CMD_AUTO_ORDER_NAME_FIRST); + menuItem.addActionListener(actionListener); + popupMenuTriggerOrder.add(menuItem); + + menuItem = new JMenuItem("Put all abilities with that rule text always last on the stack"); + menuItem.setActionCommand(CMD_AUTO_ORDER_NAME_LAST); + menuItem.addActionListener(actionListener); + popupMenuTriggerOrder.add(menuItem); + + menuItem = new JMenuItem("Reset all order settings for triggered abilities"); + menuItem.setActionCommand(CMD_AUTO_ORDER_RESET_ALL); + menuItem.addActionListener(actionListener); + popupMenuTriggerOrder.add(menuItem); + } + public String getGameLog() { return gameChatPanel.getText(); } @@ -1984,9 +2125,9 @@ public final class GamePanel extends javax.swing.JPanel { private javax.swing.JButton btnStopWatching; - private mage.client.chat.ChatPanel gameChatPanel; + private mage.client.chat.ChatPanelBasic gameChatPanel; private mage.client.game.FeedbackPanel feedbackPanel; - private mage.client.chat.ChatPanel userChatPanel; + private mage.client.chat.ChatPanelBasic userChatPanel; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JSplitPane jSplitPane0; diff --git a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java index 829493e0e1c..8a06f33d539 100644 --- a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java @@ -28,17 +28,34 @@ package mage.client.game; import java.awt.Color; +import java.awt.Component; import java.awt.Dimension; import java.awt.GridBagLayout; +import java.awt.Point; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.UUID; import javax.swing.BoxLayout; import javax.swing.JButton; +import javax.swing.JMenuItem; import javax.swing.JPanel; +import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import javax.swing.ToolTipManager; import javax.swing.UIManager; +import mage.client.MageFrame; import mage.client.components.MageTextArea; +import mage.client.game.FeedbackPanel.FeedbackMode; +import static mage.client.game.FeedbackPanel.FeedbackMode.QUESTION; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_ID_NO; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_ID_YES; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_RESET_ALL; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_TEXT_NO; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_TEXT_YES; +import mage.remote.Session; /** * Panel with buttons that copy the state of feedback panel. @@ -64,12 +81,34 @@ public class HelperPanel extends JPanel { private final int defaultDismissTimeout = ToolTipManager.sharedInstance().getDismissDelay(); private final Object tooltipBackground = UIManager.get("info"); + private static final String CMD_AUTO_ANSWER_ID_YES = "cmdAutoAnswerIdYes"; + private static final String CMD_AUTO_ANSWER_ID_NO = "cmdAutoAnswerIdNo"; + private static final String CMD_AUTO_ANSWER_NAME_YES = "cmdAutoAnswerNameYes"; + private static final String CMD_AUTO_ANSWER_NAME_NO = "cmdAutoAnswerNameNo"; + private static final String CMD_AUTO_ANSWER_RESET_ALL = "cmdAutoAnswerResetAll"; + + // popup menu for set automatic answers + private JPopupMenu popupMenuAskYes; + private JPopupMenu popupMenuAskNo; + + // originalId of feedback causing ability + private UUID originalId; + private String message; + + private UUID gameId; + private Session session; + public HelperPanel() { initComponents(); } - private void initComponents() { + public void init(UUID gameId) { + this.gameId = gameId; + session = MageFrame.getSession(); + } + private void initComponents() { + initPopupMenuTriggerOrder(); setBackground(new Color(0, 0, 0, 100)); //setLayout(new GridBagLayout()); setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); @@ -108,72 +147,44 @@ public class HelperPanel extends JPanel { btnUndo.setVisible(false); container.add(btnUndo); - btnLeft.addActionListener(new java.awt.event.ActionListener() { + MouseListener checkPopupAdapter = new MouseAdapter() { + @Override + public void mousePressed(MouseEvent me) { + checkPopupMenu(me); + } + + @Override + public void mouseReleased(MouseEvent me) { + checkPopupMenu(me); + } + + }; + + btnLeft.addMouseListener(checkPopupAdapter); + btnLeft.addActionListener(new ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { if (linkLeft != null) { - { - Thread worker = new Thread() { - @Override - public void run() { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - setState("", false, "", false); - setSpecial("", false); - linkLeft.doClick(); - } - }); - } - }; - worker.start(); - } + clickButton(linkLeft); } } }); - btnRight.addActionListener(new java.awt.event.ActionListener() { + btnRight.addMouseListener(checkPopupAdapter); + btnRight.addActionListener(new ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { if (linkRight != null) { - Thread worker = new Thread() { - @Override - public void run() { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - setState("", false, "", false); - setSpecial("", false); - linkRight.doClick(); - } - }); - } - }; - worker.start(); + clickButton(linkRight); } } }); - btnSpecial.addActionListener(new java.awt.event.ActionListener() { + btnSpecial.addActionListener(new ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { if (linkSpecial != null) { - { - Thread worker = new Thread() { - @Override - public void run() { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - setState("", false, "", false); - setSpecial("", false); - linkSpecial.doClick(); - } - }); - } - }; - worker.start(); - } + clickButton(linkSpecial); } } }); @@ -200,7 +211,7 @@ public class HelperPanel extends JPanel { } }); - // sets a darker background and higher simiss time fpr tooltip in the feedback / helper panel + // sets a darker background and higher simiss time fur tooltip in the feedback / helper panel textArea.addMouseListener(new MouseAdapter() { @Override @@ -217,15 +228,50 @@ public class HelperPanel extends JPanel { }); } - public void setState(String txtLeft, boolean leftVisible, String txtRight, boolean rightVisible) { + private void checkPopupMenu(MouseEvent me) { + if (me.isPopupTrigger() + && originalId != null) { // only Yes/No requests from abilities can be automated + JButton source = (JButton) me.getSource(); + if (source.getActionCommand().startsWith(QUESTION.toString())) { + showPopupMenu(me.getComponent(), source.getActionCommand()); + me.consume(); + } + } + } + + private void clickButton(final JButton button) { + Thread worker = new Thread() { + @Override + public void run() { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + setState("", false, "", false, null); + setSpecial("", false); + button.doClick(); + } + }); + } + }; + worker.start(); + } + + public void setState(String txtLeft, boolean leftVisible, String txtRight, boolean rightVisible, FeedbackMode mode) { this.btnLeft.setVisible(leftVisible); if (!txtLeft.isEmpty()) { this.btnLeft.setText(txtLeft); + if (mode != null) { + this.btnLeft.setActionCommand(mode.toString() + txtLeft); + } } this.btnRight.setVisible(rightVisible); if (!txtRight.isEmpty()) { this.btnRight.setText(txtRight); + if (mode != null) { + this.btnRight.setActionCommand(mode.toString() + txtRight); + } } + } public void setSpecial(String txtSpecial, boolean specialVisible) { @@ -251,25 +297,116 @@ public class HelperPanel extends JPanel { this.linkUndo = undo; } - public void setMessage(String message) { -// if (message.startsWith("Use alternative cost")) { -// message = "Use alternative cost?"; -// } else if (message.contains("Use ")) { -// if (message.length() < this.getWidth() / 10) { -// message = getSmallText(message); -// } else { -// message = "Use ability?" + getSmallText(message.substring(0, this.getWidth() / 10)); -// } -// } - textArea.setText(message, this.getWidth()); + public void setOriginalId(UUID originalId) { + this.originalId = originalId; } - protected String getSmallText(String text) { - return "
" + text + "
"; + public void setBasicMessage(String message) { + this.message = message; + this.textArea.setText(message, this.getWidth()); + } + + public void setTextArea(String message) { + this.textArea.setText(message, this.getWidth()); } @Override public void requestFocus() { this.btnRight.requestFocus(); } + + private void initPopupMenuTriggerOrder() { + + ActionListener actionListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + handleAutoAnswerPopupMenuEvent(e); + } + }; + + popupMenuAskYes = new JPopupMenu(); + popupMenuAskNo = new JPopupMenu(); + + // String tooltipText = ""; + JMenuItem menuItem; + menuItem = new JMenuItem("Always Yes for the same text and ability"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_ID_YES); + menuItem.addActionListener(actionListener); + menuItem.setToolTipText("If the same question from the same ability would
be asked again, it's automatically answered with Yes."); + popupMenuAskYes.add(menuItem); + + menuItem = new JMenuItem("Always No for the same text and ability"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_ID_NO); + menuItem.setToolTipText("If the same question from the same ability would
be asked again, it's automatically answered with No."); + menuItem.addActionListener(actionListener); + popupMenuAskNo.add(menuItem); + + menuItem = new JMenuItem("Always Yes for the same text"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_NAME_YES); + menuItem.setToolTipText("If the same question would be asked again (regardless from which source),
it's automatically answered with Yes."); + menuItem.addActionListener(actionListener); + popupMenuAskYes.add(menuItem); + + menuItem = new JMenuItem("Always No for the same text"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_NAME_NO); + menuItem.setToolTipText("If the same question would be asked again (regardless from which source),
it's automatically answered with No."); + menuItem.addActionListener(actionListener); + popupMenuAskNo.add(menuItem); + + menuItem = new JMenuItem("Delete all automatic Yes/No settings"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_RESET_ALL); + menuItem.addActionListener(actionListener); + popupMenuAskYes.add(menuItem); + + menuItem = new JMenuItem("Delete all automatic Yes/No settings"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_RESET_ALL); + menuItem.addActionListener(actionListener); + popupMenuAskNo.add(menuItem); + } + + public void handleAutoAnswerPopupMenuEvent(ActionEvent e) { + switch (e.getActionCommand()) { + case CMD_AUTO_ANSWER_ID_YES: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_ID_YES, gameId, originalId.toString() + "#" + message); + clickButton(btnLeft); + break; + case CMD_AUTO_ANSWER_ID_NO: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_ID_NO, gameId, originalId.toString() + "#" + message); + clickButton(btnRight); + break; + case CMD_AUTO_ANSWER_NAME_YES: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_TEXT_YES, gameId, message); + clickButton(btnLeft); + break; + case CMD_AUTO_ANSWER_NAME_NO: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_TEXT_NO, gameId, message); + clickButton(btnRight); + break; + case CMD_AUTO_ANSWER_RESET_ALL: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_RESET_ALL, gameId, null); + break; + } + } + + private void showPopupMenu(Component callingComponent, String actionCommand) { + // Get the location of the point 'on the screen' + Point p = callingComponent.getLocationOnScreen(); + // Show the JPopupMenu via program + // Parameter desc + // ---------------- + // this - represents current frame + // 0,0 is the co ordinate where the popup + // is shown + JPopupMenu menu; + if (actionCommand.endsWith("Yes")) { + menu = popupMenuAskYes; + } else { + menu = popupMenuAskNo; + } + menu.show(this, 0, 0); + + // Now set the location of the JPopupMenu + // This location is relative to the screen + menu.setLocation(p.x, p.y + callingComponent.getHeight()); + } } diff --git a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java index a3d2f246c4d..44f2f509b54 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java @@ -278,6 +278,30 @@ public class PlayAreaPanel extends javax.swing.JPanel { } }); + menuItem = new JMenuItem("Triggered abilities - reset auto stack order"); + menuItem.setMnemonic(KeyEvent.VK_T); + menuItem.setToolTipText("Deletes all triggered ability order settings you added during the game."); + automaticConfirmsMenu.add(menuItem); + // Reset the replacement effcts that were auto selected for the game + menuItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + gamePanel.getSession().sendPlayerAction(PlayerAction.TRIGGER_AUTO_ORDER_RESET_ALL, gameId, null); + } + }); + + menuItem = new JMenuItem("Use requests - reset automatic answers"); + menuItem.setMnemonic(KeyEvent.VK_T); + menuItem.setToolTipText("Deletes all defined automatic answers for Yes/No usage requests."); + automaticConfirmsMenu.add(menuItem); + // Reset the replacement effcts that were auto selected for the game + menuItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + gamePanel.getSession().sendPlayerAction(PlayerAction.REQUEST_AUTO_ANSWER_RESET_ALL, gameId, null); + } + }); + JMenu handCardsMenu = new JMenu("Cards on hand"); handCardsMenu.setMnemonic(KeyEvent.VK_H); popupMenu.add(handCardsMenu); diff --git a/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java b/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java index 01ffad75880..347b69c1267 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayerPanelExt.java @@ -69,6 +69,9 @@ import mage.client.util.ImageHelper; import mage.client.util.gui.BufferedImageBuilder; import mage.client.util.gui.countryBox.CountryUtil; import mage.components.ImagePanel; +import static mage.constants.Constants.DEFAULT_AVATAR_ID; +import static mage.constants.Constants.MAX_AVATAR_ID; +import static mage.constants.Constants.MIN_AVATAR_ID; import mage.constants.ManaType; import mage.remote.Session; import mage.utils.timer.PriorityTimer; @@ -92,7 +95,7 @@ public class PlayerPanelExt extends javax.swing.JPanel { private static final int AVATAR_COUNT = 77; - private static final String DEFAULT_AVATAR_PATH = "/avatars/51.jpg"; + private static final String DEFAULT_AVATAR_PATH = "/avatars/" + DEFAULT_AVATAR_ID + ".jpg"; private static final int PANEL_WIDTH = 94; private static final int PANEL_HEIGHT = 242; @@ -105,6 +108,7 @@ public class PlayerPanelExt extends javax.swing.JPanel { private int avatarId = -1; private String flagName; + private String basicTooltipText; private PriorityTimer timer; @@ -156,25 +160,7 @@ public class PlayerPanelExt extends javax.swing.JPanel { public void update(PlayerView player) { this.player = player; - if (flagName == null) { // do only once - avatar.setText(this.player.getName()); - if (!player.getUserData().getFlagName().equals(flagName)) { - flagName = player.getUserData().getFlagName(); - this.avatar.setTopTextImage(CountryUtil.getCountryFlagIcon(flagName).getImage()); - } - // TODO: Add the wins to the tooltiptext of the avatar - String countryname = CountryUtil.getCountryName(flagName); - if (countryname == null) { - countryname = "Unknown"; - } - String tooltip = "Name: " + player.getName() + "
Country: " + countryname; - avatar.setToolTipText(tooltip); - avatar.repaint(); - - // used if avatar image can't be used - this.btnPlayer.setText(player.getName()); - this.btnPlayer.setToolTipText(tooltip); - } + updateAvatar(); int playerLife = player.getLife(); if (playerLife > 99) { Font font = lifeLabel.getFont(); @@ -238,8 +224,8 @@ public class PlayerPanelExt extends javax.swing.JPanel { if (!MageFrame.isLite()) { int id = player.getUserData().getAvatarId(); - if (id <= 0) { - id = PreferencesDialog.DEFAULT_AVATAR_ID; + if (!(id >= 1000) && (id <= 0 || (id <= MIN_AVATAR_ID && id > MAX_AVATAR_ID))) { + id = DEFAULT_AVATAR_ID; } if (id != avatarId) { avatarId = id; @@ -284,6 +270,39 @@ public class PlayerPanelExt extends javax.swing.JPanel { update(player.getManaPool()); } + /** + * Updates the avatar image and tooltip text + */ + private void updateAvatar() { + if (flagName == null) { // do only once + avatar.setText(this.player.getName()); + if (!player.getUserData().getFlagName().equals(flagName)) { + flagName = player.getUserData().getFlagName(); + this.avatar.setTopTextImage(CountryUtil.getCountryFlagIcon(flagName).getImage()); + } + // TODO: Add the wins to the tooltiptext of the avatar + String countryname = CountryUtil.getCountryName(flagName); + if (countryname == null) { + countryname = "Unknown"; + } + basicTooltipText = "Name: " + player.getName() + + "
Country: " + countryname + + "
Deck hash code: " + player.getDeckHashCode() + + "
Wins: " + player.getWins() + " of " + player.getWinsNeeded() + " (to win the match)"; + } + // Extend tooltip + StringBuilder tooltipText = new StringBuilder(basicTooltipText); + if (player.getExperience() > 0) { + tooltipText.append("
Experience counters: ").append(player.getExperience()); + } + avatar.setToolTipText(tooltipText.toString()); + avatar.repaint(); + + // used if avatar image can't be used + this.btnPlayer.setText(player.getName()); + this.btnPlayer.setToolTipText(tooltipText.toString()); + } + private String getPriorityTimeLeftString(PlayerView player) { int priorityTimeLeft = player.getPriorityTimeLeft(); return getPriorityTimeLeftString(priorityTimeLeft); @@ -799,7 +818,7 @@ public class PlayerPanelExt extends javax.swing.JPanel { } private void btnCommandZoneActionPerformed(java.awt.event.ActionEvent evt) { - DialogManager.getManager(gameId).showEmblemsDialog(CardsViewUtil.convertCommandObject(player.getCommadObjectList()), bigCard, gameId); + DialogManager.getManager(gameId).showEmblemsDialog(CardsViewUtil.convertCommandObject(player.getCommandObjectList()), bigCard, gameId); } private void btnExileZoneActionPerformed(java.awt.event.ActionEvent evt) { diff --git a/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java b/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java index c55072a95fa..c236a42741b 100644 --- a/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java +++ b/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java @@ -65,12 +65,12 @@ public class MageActionCallback implements ActionCallback { public static final int MIN_X_OFFSET_REQUIRED = 20; - private Popup popup; + private Popup tooltipPopup; private JPopupMenu jPopupMenu; private BigCard bigCard; protected static final DefaultActionCallback defaultCallback = DefaultActionCallback.getInstance(); protected static Session session = MageFrame.getSession(); - private CardView popupCard; + private CardView tooltipCard; private TransferData popupData; private JComponent cardInfoPane; private volatile boolean popupTextWindowOpen = false; @@ -92,7 +92,7 @@ public class MageActionCallback implements ActionCallback { private boolean isDragging; private Point initialCardPos; private Point initialMousePos; - private Set cardPanels = new HashSet(); + private final Set cardPanels = new HashSet<>(); public MageActionCallback() { enlargeMode = EnlargeMode.NORMAL; @@ -117,10 +117,10 @@ public class MageActionCallback implements ActionCallback { @Override public void mouseEntered(MouseEvent e, final TransferData data) { - hidePopup(); + hideTooltipPopup(); cancelTimeout(); - this.popupCard = data.card; + this.tooltipCard = data.card; this.popupData = data; Component parentComponent = SwingUtilities.getRoot(data.component); @@ -135,10 +135,10 @@ public class MageActionCallback implements ActionCallback { ArrowUtil.drawArrowsForPairedCards(data, parentPoint); ArrowUtil.drawArrowsForEnchantPlayers(data, parentPoint); - showPopup(data, parentComponent, parentPoint); + showTooltipPopup(data, parentComponent, parentPoint); } - private void showPopup(final TransferData data, final Component parentComponent, final Point parentPoint) { + private void showTooltipPopup(final TransferData data, final Component parentComponent, final Point parentPoint) { if (data.component != null) { String showTooltips = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true"); if (showTooltips.equals("false")) { @@ -154,12 +154,12 @@ public class MageActionCallback implements ActionCallback { } data.locationOnScreen = data.component.getLocationOnScreen(); } - popup = factory.getPopup(data.component, data.popupText, (int) data.locationOnScreen.getX() + data.popupOffsetX, (int) data.locationOnScreen.getY() + data.popupOffsetY + 40); - popup.show(); + tooltipPopup = factory.getPopup(data.component, data.popupText, (int) data.locationOnScreen.getX() + data.popupOffsetX, (int) data.locationOnScreen.getY() + data.popupOffsetY + 40); + tooltipPopup.show(); // hack to get popup to resize to fit text - popup.hide(); - popup = factory.getPopup(data.component, data.popupText, (int) data.locationOnScreen.getX() + data.popupOffsetX, (int) data.locationOnScreen.getY() + data.popupOffsetY + 40); - popup.show(); + tooltipPopup.hide(); + tooltipPopup = factory.getPopup(data.component, data.popupText, (int) data.locationOnScreen.getX() + data.popupOffsetX, (int) data.locationOnScreen.getY() + data.popupOffsetY + 40); + tooltipPopup.show(); } else { sumbitShowPopupTask(data, parentComponent, parentPoint); } @@ -171,7 +171,7 @@ public class MageActionCallback implements ActionCallback { public void run() { ThreadUtils.sleep(300); - if (popupCard == null || !popupCard.equals(data.card) || session == null || !popupTextWindowOpen || !enlargedWindowState.equals(EnlargedWindowState.CLOSED)) { + if (tooltipCard == null || !tooltipCard.equals(data.card) || session == null || !popupTextWindowOpen || !enlargedWindowState.equals(EnlargedWindowState.CLOSED)) { return; } @@ -229,13 +229,15 @@ public class MageActionCallback implements ActionCallback { initialMousePos = new Point((int) mouse.getX(), (int) mouse.getY()); initialCardPos = data.component.getLocation(); // Closes popup & enlarged view if a card/Permanent is selected - hidePopup(); + hideTooltipPopup(); } @Override public void mouseReleased(MouseEvent e, TransferData transferData) { CardPanel card = ((CardPanel) transferData.component); - if (card.getZone() != null && card.getZone().equalsIgnoreCase("hand")) { + if (e.isPopupTrigger() /*&& card.getPopupMenu() != null*/) { + hideTooltipPopup(); + } else if (card.getZone() != null && card.getZone().equalsIgnoreCase("hand")) { int maxXOffset = 0; if (isDragging) { Point mouse = new Point(e.getX(), e.getY()); @@ -250,13 +252,15 @@ public class MageActionCallback implements ActionCallback { transferData.component.requestFocusInWindow(); defaultCallback.mouseClicked(e, transferData.gameId, session, transferData.card); // Closes popup & enlarged view if a card/Permanent is selected - hidePopup(); + hideTooltipPopup(); } + e.consume(); } else { transferData.component.requestFocusInWindow(); defaultCallback.mouseClicked(e, transferData.gameId, session, transferData.card); // Closes popup & enlarged view if a card/Permanent is selected - hidePopup(); + hideTooltipPopup(); + e.consume(); } } @@ -264,7 +268,7 @@ public class MageActionCallback implements ActionCallback { if (this.startedDragging && prevCard != null && card != null) { for (Component component : card.getCardArea().getComponents()) { if (component instanceof CardPanel) { - if (cardPanels.contains(component)) { + if (cardPanels.contains((CardPanel) component)) { component.setLocation(component.getLocation().x, component.getLocation().y - GO_DOWN_ON_DRAG_Y_OFFSET); } } @@ -288,6 +292,10 @@ public class MageActionCallback implements ActionCallback { // drag'n'drop is allowed for HAND zone only return; } + if (!SwingUtilities.isLeftMouseButton(e)) { + // only allow draging with the left mouse button + return; + } isDragging = true; prevCard = card; Point p = card.getCardLocation(); @@ -323,7 +331,7 @@ public class MageActionCallback implements ActionCallback { for (Component component : container.getComponents()) { if (component instanceof CardPanel) { if (!component.equals(card)) { - if (!cardPanels.contains(component)) { + if (!cardPanels.contains((CardPanel) component)) { component.setLocation(component.getLocation().x, component.getLocation().y + GO_DOWN_ON_DRAG_Y_OFFSET); } cardPanels.add((CardPanel) component); @@ -405,10 +413,10 @@ public class MageActionCallback implements ActionCallback { * */ @Override - public void hidePopup() { - this.popupCard = null; - if (popup != null) { - popup.hide(); + public void hideTooltipPopup() { + this.tooltipCard = null; + if (tooltipPopup != null) { + tooltipPopup.hide(); } if (jPopupMenu != null) { jPopupMenu.setVisible(false); @@ -421,7 +429,7 @@ public class MageActionCallback implements ActionCallback { Component popupContainer = MageFrame.getUI().getComponent(MageComponents.POPUP_CONTAINER); popupContainer.setVisible(false); } catch (Exception e2) { - e2.printStackTrace(); + logger.warn("Can't set tooltip to visible = false", e2); } } @@ -433,7 +441,7 @@ public class MageActionCallback implements ActionCallback { } public void hideAll(UUID gameId) { - hidePopup(); + hideTooltipPopup(); startHideTimeout(); this.popupTextWindowOpen = false; if (gameId != null) { @@ -483,7 +491,7 @@ public class MageActionCallback implements ActionCallback { cardView = popupData.card; } if (this.popupTextWindowOpen) { - hidePopup(); + hideTooltipPopup(); } if (cardView != null) { if (cardView.isToRotate()) { @@ -506,7 +514,7 @@ public class MageActionCallback implements ActionCallback { cardPreviewContainer.setVisible(false); } catch (InterruptedException e) { - e.printStackTrace(); + logger.warn("Can't hide enlarged card", e); } } } @@ -582,7 +590,7 @@ public class MageActionCallback implements ActionCallback { } } catch (Exception e) { - e.printStackTrace(); + logger.warn("Problem dring display of enlarged card", e); } } }); diff --git a/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java b/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java index 733a87391cb..ee1dcbcef4e 100644 --- a/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java +++ b/Mage.Client/src/main/java/mage/client/plugins/impl/Plugins.java @@ -58,7 +58,6 @@ public class Plugins implements MagePlugins { pm.addPluginsFrom(new File(PLUGINS_DIRECTORY).toURI()); this.cardPlugin = new CardPluginImpl(); this.counterPlugin = pm.getPlugin(CounterPlugin.class); - //this.themePlugin = pm.getPlugin(ThemePlugin.class); this.themePlugin = new ThemePluginImpl(); logger.info("Done."); } diff --git a/Mage.Client/src/main/java/mage/client/remote/CallbackClientImpl.java b/Mage.Client/src/main/java/mage/client/remote/CallbackClientImpl.java index 4ace6713242..1ba022d1896 100644 --- a/Mage.Client/src/main/java/mage/client/remote/CallbackClientImpl.java +++ b/Mage.Client/src/main/java/mage/client/remote/CallbackClientImpl.java @@ -33,9 +33,7 @@ import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import mage.cards.decks.Deck; import mage.client.MageFrame; -import mage.client.chat.ChatPanel; -import static mage.client.chat.ChatPanel.ChatType.TABLES; -import static mage.client.chat.ChatPanel.ChatType.TOURNAMENT; +import mage.client.chat.ChatPanelBasic; import mage.client.constants.Constants.DeckEditorMode; import mage.client.draft.DraftPanel; import mage.client.game.GamePanel; @@ -116,9 +114,9 @@ public class CallbackClientImpl implements CallbackClient { break; case "chatMessage": { ChatMessage message = (ChatMessage) callback.getData(); - ChatPanel panel = MageFrame.getChat(callback.getObjectId()); + ChatPanelBasic panel = MageFrame.getChat(callback.getObjectId()); if (panel != null) { - // play the to the message connected sound + // play the sound related to the message if (message.getSoundToPlay() != null) { switch (message.getSoundToPlay()) { case PlayerLeft: @@ -383,9 +381,9 @@ public class CallbackClientImpl implements CallbackClient { }); } - private void createChatStartMessage(ChatPanel chatPanel) { + private void createChatStartMessage(ChatPanelBasic chatPanel) { chatPanel.setStartMessageDone(true); - ChatPanel usedPanel = chatPanel; + ChatPanelBasic usedPanel = chatPanel; if (chatPanel.getConnectedChat() != null) { usedPanel = chatPanel.getConnectedChat(); } diff --git a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form b/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.form similarity index 72% rename from Mage.Client/src/main/java/mage/client/chat/ChatPanel.form rename to Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.form index f423543b402..9ef7f54408f 100644 --- a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form +++ b/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.form @@ -16,16 +16,14 @@ - - + - + - @@ -43,39 +41,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -119,12 +84,16 @@
+ + + + + + + + +
- - - - - diff --git a/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java b/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java new file mode 100644 index 00000000000..0c96d1588b5 --- /dev/null +++ b/Mage.Client/src/main/java/mage/client/table/PlayersChatPanel.java @@ -0,0 +1,278 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +/* + * ChatPanel.java + * + * Created on 15-Dec-2009, 11:04:31 PM + */ +package mage.client.table; + +import java.awt.Color; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import javax.swing.Icon; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.JTableHeader; +import javax.swing.table.TableColumnModel; +import mage.client.chat.ChatPanelBasic; +import static mage.client.chat.ChatPanelBasic.CHAT_ALPHA; +import mage.client.chat.ChatPanelSeparated; +import mage.client.components.ColorPane; +import static mage.client.dialog.PreferencesDialog.KEY_USERS_COLUMNS_ORDER; +import static mage.client.dialog.PreferencesDialog.KEY_USERS_COLUMNS_WIDTH; +import mage.client.util.MageTableRowSorter; +import mage.client.util.gui.TableUtil; +import mage.client.util.gui.countryBox.CountryCellRenderer; +import mage.remote.MageRemoteException; +import mage.view.RoomUsersView; +import mage.view.UsersView; + +/** + * + * @author BetaSteward_at_googlemail.com, nantuko + */ +public class PlayersChatPanel extends javax.swing.JPanel { + + private final List players = new ArrayList<>(); + private final UserTableModel userTableModel; + private final ChatPanelSeparated userChatPanel; + private final ColorPane systemMessagesPane; + private static final int[] defaultColumnsWidth = {20, 100, 100, 80, 80}; + + + /* + * Creates new form ChatPanel + * + */ + public PlayersChatPanel() { + userTableModel = new UserTableModel(); // needs to be set before initComponents(); + + initComponents(); + setBackground(new Color(0, 0, 0, CHAT_ALPHA)); + + jTablePlayers.setBackground(new Color(0, 0, 0, CHAT_ALPHA)); + jTablePlayers.setForeground(Color.white); + jTablePlayers.setRowSorter(new MageTableRowSorter(userTableModel)); + + TableUtil.setColumnWidthAndOrder(jTablePlayers, defaultColumnsWidth, KEY_USERS_COLUMNS_WIDTH, KEY_USERS_COLUMNS_ORDER); + jTablePlayers.setDefaultRenderer(Icon.class, new CountryCellRenderer()); + + systemMessagesPane = new ColorPane(); + + userChatPanel = new ChatPanelSeparated(); + userChatPanel.setSystemMessagesPane(systemMessagesPane); + + if (jTabbedPaneText != null) { + jTabbedPaneText.setBackground(new Color(0, 0, 0, CHAT_ALPHA)); + if (userChatPanel != null) { + userChatPanel.setBackground(new Color(0, 0, 0, CHAT_ALPHA)); + jTabbedPaneText.addTab("Talk", userChatPanel); + } + if (systemMessagesPane != null) { + systemMessagesPane.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); + systemMessagesPane.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N + systemMessagesPane.setFocusCycleRoot(false); + systemMessagesPane.setMargin(new java.awt.Insets(2, 2, 2, 2)); + systemMessagesPane.setOpaque(false); + systemMessagesPane.setExtBackgroundColor(new Color(0, 0, 0, CHAT_ALPHA)); // Alpha = 255 not transparent + systemMessagesPane.setSelectionColor(Color.LIGHT_GRAY); + jTabbedPaneText.addTab("System", systemMessagesPane); + + } + } + if (jScrollPanePlayers != null) { + + jScrollPanePlayers.setBackground(new Color(0, 0, 0, CHAT_ALPHA)); + jScrollPanePlayers.getViewport().setBackground(new Color(0, 0, 0, CHAT_ALPHA)); + } + } + + public ChatPanelBasic getUserChatPanel() { + return userChatPanel; + } + + public void cleanUp() { + TableUtil.saveColumnWidthAndOrderToPrefs(jTablePlayers, KEY_USERS_COLUMNS_WIDTH, KEY_USERS_COLUMNS_ORDER); + userChatPanel.cleanUp(); + } + + public void setSplitDividerLocation(int location) { + if (jSplitPane1 != null) { + jSplitPane1.setDividerLocation(location); + } + } + + public int getSplitDividerLocation() { + if (jSplitPane1 == null) { + return 0; + } + return this.jSplitPane1.getDividerLocation(); + } + + class UserTableModel extends AbstractTableModel { + + private final String[] columnNames = new String[]{"Loc", "Players", "Info", "Games", "Connection"}; + private UsersView[] players = new UsersView[0]; + + public void loadData(Collection roomUserInfoList) throws MageRemoteException { + RoomUsersView roomUserInfo = roomUserInfoList.iterator().next(); + this.players = roomUserInfo.getUsersView().toArray(new UsersView[0]); + JTableHeader th = jTablePlayers.getTableHeader(); + TableColumnModel tcm = th.getColumnModel(); + + tcm.getColumn(jTablePlayers.convertColumnIndexToView(1)).setHeaderValue("Players (" + this.players.length + ")"); + tcm.getColumn(jTablePlayers.convertColumnIndexToView(3)).setHeaderValue( + "Games " + roomUserInfo.getNumberActiveGames() + + (roomUserInfo.getNumberActiveGames() != roomUserInfo.getNumberGameThreads() ? " (T:" + roomUserInfo.getNumberGameThreads() : " (") + + " limit: " + roomUserInfo.getNumberMaxGames() + ")"); + th.repaint(); + this.fireTableDataChanged(); + } + + @Override + public int getRowCount() { + return players.length; + } + + @Override + public int getColumnCount() { + return columnNames.length; + } + + @Override + public Object getValueAt(int arg0, int arg1) { + switch (arg1) { + case 0: + return players[arg0].getFlagName(); + case 1: + return players[arg0].getUserName(); + case 2: + return players[arg0].getInfoState(); + case 3: + return players[arg0].getInfoGames(); + case 4: + return players[arg0].getInfoPing(); + } + return ""; + } + + @Override + public String getColumnName(int columnIndex) { + String colName = ""; + + if (columnIndex <= getColumnCount()) { + colName = columnNames[columnIndex]; + } + + return colName; + } + + @Override + public Class getColumnClass(int columnIndex) { + switch (columnIndex) { + case 0: + return Icon.class; + default: + return String.class; + } + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return false; + } + + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jSplitPane1 = new javax.swing.JSplitPane(); + jScrollPanePlayers = new javax.swing.JScrollPane(); + jTablePlayers = new javax.swing.JTable(); + jTabbedPaneText = new javax.swing.JTabbedPane(); + + jSplitPane1.setBorder(null); + jSplitPane1.setDividerSize(10); + jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); + jSplitPane1.setResizeWeight(0.25); + + jScrollPanePlayers.setBorder(null); + + jTablePlayers.setModel(this.userTableModel); + jTablePlayers.setToolTipText("Connected players"); + jTablePlayers.setAutoscrolls(false); + jTablePlayers.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + jTablePlayers.setFocusable(false); + jTablePlayers.setGridColor(new java.awt.Color(255, 255, 255)); + jTablePlayers.setOpaque(false); + jTablePlayers.setRequestFocusEnabled(false); + jTablePlayers.setRowSelectionAllowed(false); + jTablePlayers.setUpdateSelectionOnSort(false); + jTablePlayers.setVerifyInputWhenFocusTarget(false); + jScrollPanePlayers.setViewportView(jTablePlayers); + + jSplitPane1.setTopComponent(jScrollPanePlayers); + jSplitPane1.setRightComponent(jTabbedPaneText); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(jSplitPane1) + .addGap(0, 0, 0)) + ); + }// //GEN-END:initComponents + + public void setRoomUserInfo(List> view) { + try { + userTableModel.loadData(view.get(0)); + } catch (Exception ex) { + this.players.clear(); + } + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JScrollPane jScrollPanePlayers; + private javax.swing.JSplitPane jSplitPane1; + private javax.swing.JTabbedPane jTabbedPaneText; + private javax.swing.JTable jTablePlayers; + // End of variables declaration//GEN-END:variables +} diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.form b/Mage.Client/src/main/java/mage/client/table/TablesPanel.form index 77d59264027..95b426c7da7 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.form +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.form @@ -503,7 +503,7 @@ - + @@ -516,7 +516,7 @@ - + @@ -540,7 +540,7 @@ - + @@ -554,7 +554,7 @@ - + @@ -570,21 +570,6 @@ - - - - - - - - - - - - - - - @@ -595,7 +580,7 @@ - + @@ -679,7 +664,14 @@ + + + + + + + - + \ No newline at end of file diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java index 1a56c2873dc..1fa0b11e792 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java @@ -69,7 +69,7 @@ import javax.swing.SwingWorker; import javax.swing.table.AbstractTableModel; import mage.cards.decks.importer.DeckImporterUtil; import mage.client.MageFrame; -import mage.client.chat.ChatPanel; +import mage.client.chat.ChatPanelBasic; import mage.client.components.MageComponents; import mage.client.dialog.JoinTableDialog; import mage.client.dialog.NewTableDialog; @@ -143,16 +143,16 @@ public class TablesPanel extends javax.swing.JPanel { tableCompleted.setRowSorter(new MageTableRowSorter(matchesModel)); - chatPanel.useExtendedView(ChatPanel.VIEW_MODE.NONE); - chatPanel.setBorder(null); - chatPanel.setChatType(ChatPanel.ChatType.TABLES); + chatPanelMain.getUserChatPanel().useExtendedView(ChatPanelBasic.VIEW_MODE.NONE); + chatPanelMain.getUserChatPanel().setBorder(null); + chatPanelMain.getUserChatPanel().setChatType(ChatPanelBasic.ChatType.TABLES); filterButtons = new JToggleButton[]{btnStateWaiting, btnStateActive, btnStateFinished, btnTypeMatch, btnTypeTourneyConstructed, btnTypeTourneyLimited, btnFormatBlock, btnFormatStandard, btnFormatModern, btnFormatLegacy, btnFormatVintage, btnFormatCommander, btnFormatTinyLeader, btnFormatLimited, btnFormatOther, btnSkillBeginner, btnSkillCasual, btnSkillSerious}; - JComponent[] components = new JComponent[]{chatPanel, jSplitPane1, jScrollPane1, jScrollPane2, topPanel, jPanel3}; + JComponent[] components = new JComponent[]{chatPanelMain, jSplitPane1, jScrollPane1, jScrollPane2, topPanel, jPanel3}; for (JComponent component : components) { component.setOpaque(false); } @@ -274,7 +274,7 @@ public class TablesPanel extends javax.swing.JPanel { public void cleanUp() { saveSettings(); - chatPanel.cleanUp(); + chatPanelMain.cleanUp(); } private void saveDividerLocations() { @@ -284,7 +284,7 @@ public class TablesPanel extends javax.swing.JPanel { PreferencesDialog.saveValue(PreferencesDialog.KEY_MAGE_PANEL_LAST_SIZE, sb); PreferencesDialog.saveValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_1, Integer.toString(this.jSplitPane1.getDividerLocation())); PreferencesDialog.saveValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_2, Integer.toString(this.jSplitPane2.getDividerLocation())); - PreferencesDialog.saveValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_3, Integer.toString(chatPanel.getSplitDividerLocation())); + PreferencesDialog.saveValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_3, Integer.toString(chatPanelMain.getSplitDividerLocation())); } private void restoreSettings() { @@ -333,8 +333,8 @@ public class TablesPanel extends javax.swing.JPanel { } } location = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_3, null); - if (location != null && chatPanel != null) { - chatPanel.setSplitDividerLocation(Integer.parseInt(location)); + if (location != null && chatPanelMain != null) { + chatPanelMain.setSplitDividerLocation(Integer.parseInt(location)); } } } @@ -376,7 +376,7 @@ public class TablesPanel extends javax.swing.JPanel { updateTablesTask.execute(); } if (updatePlayersTask == null || updatePlayersTask.isDone()) { - updatePlayersTask = new UpdatePlayersTask(session, roomId, this.chatPanel); + updatePlayersTask = new UpdatePlayersTask(session, roomId, this.chatPanelMain); updatePlayersTask.execute(); } if (this.btnStateFinished.isSelected()) { @@ -426,7 +426,7 @@ public class TablesPanel extends javax.swing.JPanel { MageFrame.getDesktop().add(joinTableDialog, JLayeredPane.MODAL_LAYER); } if (chatRoomId != null) { - this.chatPanel.connect(chatRoomId); + this.chatPanelMain.getUserChatPanel().connect(chatRoomId); startTasks(); this.setVisible(true); this.repaint(); @@ -461,7 +461,7 @@ public class TablesPanel extends javax.swing.JPanel { } else { this.jPanel2.setVisible(true); this.jLabel2.setText(serverMessages.get(0)); - this.jButton1.setVisible(serverMessages.size() > 1); + this.jButtonNext.setVisible(serverMessages.size() > 1); } } @@ -473,7 +473,7 @@ public class TablesPanel extends javax.swing.JPanel { } } stopTasks(); - this.chatPanel.disconnect(); + this.chatPanelMain.getUserChatPanel().disconnect(); Component c = this.getParent(); while (c != null && !(c instanceof TablesPane)) { @@ -484,8 +484,8 @@ public class TablesPanel extends javax.swing.JPanel { } } - public ChatPanel getChatPanel() { - return this.chatPanel; + public ChatPanelBasic getChatPanel() { + return chatPanelMain.getUserChatPanel(); } private void setTableFilter() { @@ -501,7 +501,7 @@ public class TablesPanel extends javax.swing.JPanel { // type List> typeFilterList = new ArrayList<>(); if (btnTypeMatch.isSelected()) { - typeFilterList.add(RowFilter.regexFilter("Two|Commander|Free|Tiny", TableTableModel.COLUMN_GAME_TYPE)); + typeFilterList.add(RowFilter.regexFilter("Two|Commander|Free|Tiny|Momir", TableTableModel.COLUMN_GAME_TYPE)); } if (btnTypeTourneyConstructed.isSelected()) { typeFilterList.add(RowFilter.regexFilter("Constructed", TableTableModel.COLUMN_GAME_TYPE)); @@ -537,7 +537,7 @@ public class TablesPanel extends javax.swing.JPanel { formatFilterList.add(RowFilter.regexFilter("^Limited", TableTableModel.COLUMN_DECK_TYPE)); } if (btnFormatOther.isSelected()) { - formatFilterList.add(RowFilter.regexFilter("^Constructed - Pauper|^Constructed - Extended|^Constructed - Historical|^Constructed - Super", TableTableModel.COLUMN_DECK_TYPE)); + formatFilterList.add(RowFilter.regexFilter("^Momir Basic|^Constructed - Pauper|^Constructed - Extended|^Constructed - Historical|^Constructed - Super", TableTableModel.COLUMN_DECK_TYPE)); } List> skillFilterList = new ArrayList<>(); @@ -628,15 +628,15 @@ public class TablesPanel extends javax.swing.JPanel { jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); - jButton1 = new javax.swing.JButton(); + jButtonNext = new javax.swing.JButton(); jSplitPane1 = new javax.swing.JSplitPane(); - chatPanel = new mage.client.chat.ChatPanel(true); jPanel3 = new javax.swing.JPanel(); jSplitPane2 = new javax.swing.JSplitPane(); jScrollPane1 = new javax.swing.JScrollPane(); tableTables = new javax.swing.JTable(); jScrollPane2 = new javax.swing.JScrollPane(); tableCompleted = new javax.swing.JTable(); + chatPanelMain = new mage.client.table.PlayersChatPanel(); topPanel.setBackground(java.awt.Color.white); topPanel.setOpaque(false); @@ -1022,13 +1022,13 @@ public class TablesPanel extends javax.swing.JPanel { jLabel2.setText("You are playing Mage version 0.7.5. Welcome! -- Mage dev team --"); - jButton1.setText("Next"); - jButton1.setMaximumSize(new java.awt.Dimension(55, 25)); - jButton1.setMinimumSize(new java.awt.Dimension(55, 25)); - jButton1.setPreferredSize(new java.awt.Dimension(55, 25)); - jButton1.addActionListener(new java.awt.event.ActionListener() { + jButtonNext.setText("Next"); + jButtonNext.setMaximumSize(new java.awt.Dimension(55, 25)); + jButtonNext.setMinimumSize(new java.awt.Dimension(55, 25)); + jButtonNext.setPreferredSize(new java.awt.Dimension(55, 25)); + jButtonNext.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - jButton1ActionPerformed(evt); + jButtonNextActionPerformed(evt); } }); @@ -1037,7 +1037,7 @@ public class TablesPanel extends javax.swing.JPanel { jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jButtonNext, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) @@ -1048,7 +1048,7 @@ public class TablesPanel extends javax.swing.JPanel { jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jButtonNext, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2) .addComponent(jLabel1)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) @@ -1058,9 +1058,6 @@ public class TablesPanel extends javax.swing.JPanel { jSplitPane1.setDividerSize(10); jSplitPane1.setResizeWeight(1.0); - chatPanel.setMinimumSize(new java.awt.Dimension(100, 43)); - jSplitPane1.setRightComponent(chatPanel); - jSplitPane2.setBorder(null); jSplitPane2.setDividerSize(10); jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); @@ -1085,7 +1082,7 @@ public class TablesPanel extends javax.swing.JPanel { jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 798, Short.MAX_VALUE) + .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 810, Short.MAX_VALUE) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -1093,6 +1090,7 @@ public class TablesPanel extends javax.swing.JPanel { ); jSplitPane1.setLeftComponent(jPanel3); + jSplitPane1.setRightComponent(chatPanelMain); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); @@ -1154,7 +1152,7 @@ public class TablesPanel extends javax.swing.JPanel { newTableDialog.showDialog(roomId); }//GEN-LAST:event_btnNewTableActionPerformed - private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + private void jButtonNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNextActionPerformed synchronized (this) { if (messages != null && !messages.isEmpty()) { currentMessage++; @@ -1164,7 +1162,7 @@ public class TablesPanel extends javax.swing.JPanel { this.jLabel2.setText(messages.get(currentMessage)); } } - }//GEN-LAST:event_jButton1ActionPerformed + }//GEN-LAST:event_jButtonNextActionPerformed private void btnFilterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFilterActionPerformed setTableFilter(); @@ -1206,10 +1204,10 @@ public class TablesPanel extends javax.swing.JPanel { private javax.swing.JToggleButton btnTypeMatch; private javax.swing.JToggleButton btnTypeTourneyConstructed; private javax.swing.JToggleButton btnTypeTourneyLimited; - private mage.client.chat.ChatPanel chatPanel; + private mage.client.table.PlayersChatPanel chatPanelMain; private javax.swing.JToolBar filterBar1; private javax.swing.JToolBar filterBar2; - private javax.swing.JButton jButton1; + private javax.swing.JButton jButtonNext; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel2; @@ -1413,11 +1411,11 @@ class UpdatePlayersTask extends SwingWorker> { private final Session session; private final UUID roomId; - private final ChatPanel chat; + private final PlayersChatPanel chat; private static final Logger logger = Logger.getLogger(UpdatePlayersTask.class); - UpdatePlayersTask(Session session, UUID roomId, ChatPanel chat) { + UpdatePlayersTask(Session session, UUID roomId, PlayersChatPanel chat) { this.session = session; this.roomId = roomId; this.chat = chat; diff --git a/Mage.Client/src/main/java/mage/client/tournament/TournamentPanel.form b/Mage.Client/src/main/java/mage/client/tournament/TournamentPanel.form index 7be5a2a059a..11305f2904d 100644 --- a/Mage.Client/src/main/java/mage/client/tournament/TournamentPanel.form +++ b/Mage.Client/src/main/java/mage/client/tournament/TournamentPanel.form @@ -349,10 +349,7 @@ - - - - + diff --git a/Mage.Client/src/main/java/mage/client/tournament/TournamentPanel.java b/Mage.Client/src/main/java/mage/client/tournament/TournamentPanel.java index 576bdbf4cf0..9c50628a9c2 100644 --- a/Mage.Client/src/main/java/mage/client/tournament/TournamentPanel.java +++ b/Mage.Client/src/main/java/mage/client/tournament/TournamentPanel.java @@ -49,7 +49,7 @@ import javax.swing.JOptionPane; import javax.swing.SwingWorker; import javax.swing.table.AbstractTableModel; import mage.client.MageFrame; -import mage.client.chat.ChatPanel; +import mage.client.chat.ChatPanelBasic; import mage.client.dialog.PreferencesDialog; import static mage.client.dialog.PreferencesDialog.KEY_TOURNAMENT_MATCH_COLUMNS_ORDER; import static mage.client.dialog.PreferencesDialog.KEY_TOURNAMENT_MATCH_COLUMNS_WIDTH; @@ -105,8 +105,8 @@ public class TournamentPanel extends javax.swing.JPanel { tableMatches.createDefaultColumnsFromModel(); TableUtil.setColumnWidthAndOrder(tableMatches, defaultColumnsWidthMatches, KEY_TOURNAMENT_MATCH_COLUMNS_WIDTH, KEY_TOURNAMENT_MATCH_COLUMNS_ORDER); - chatPanel1.useExtendedView(ChatPanel.VIEW_MODE.NONE); - chatPanel1.setChatType(ChatPanel.ChatType.TOURNAMENT); + chatPanel1.useExtendedView(ChatPanelBasic.VIEW_MODE.NONE); + chatPanel1.setChatType(ChatPanelBasic.ChatType.TOURNAMENT); Action action = new AbstractAction() { @Override @@ -317,7 +317,7 @@ public class TournamentPanel extends javax.swing.JPanel { tablePlayers = new javax.swing.JTable(); jScrollPane2 = new javax.swing.JScrollPane(); tableMatches = new javax.swing.JTable(); - chatPanel1 = new mage.client.chat.ChatPanel(); + chatPanel1 = new mage.client.chat.ChatPanelBasic(); setPreferredSize(new java.awt.Dimension(908, 580)); @@ -484,8 +484,6 @@ public class TournamentPanel extends javax.swing.JPanel { jSplitPane1.setBottomComponent(jScrollPane2); jSplitPane2.setLeftComponent(jSplitPane1); - - chatPanel1.setStartMessageDone(true); jSplitPane2.setRightComponent(chatPanel1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); @@ -524,7 +522,7 @@ public class TournamentPanel extends javax.swing.JPanel { private javax.swing.JPanel actionPanel; private javax.swing.JButton btnCloseWindow; private javax.swing.JButton btnQuitTournament; - private mage.client.chat.ChatPanel chatPanel1; + private mage.client.chat.ChatPanelBasic chatPanel1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JSplitPane jSplitPane1; diff --git a/Mage.Client/src/main/java/mage/client/unusedFiles/CombatDialog.java b/Mage.Client/src/main/java/mage/client/unusedFiles/CombatDialog.java index b5fc4b3ffd3..57a0b6cf80e 100644 --- a/Mage.Client/src/main/java/mage/client/unusedFiles/CombatDialog.java +++ b/Mage.Client/src/main/java/mage/client/unusedFiles/CombatDialog.java @@ -36,7 +36,6 @@ package mage.client.unusedFiles; import mage.client.cards.BigCard; -import mage.client.unusedFiles.CombatGroup; import mage.view.CombatGroupView; import javax.swing.*; @@ -44,9 +43,8 @@ import java.awt.*; import java.beans.PropertyVetoException; import java.util.List; import java.util.UUID; -import java.util.logging.Level; -import java.util.logging.Logger; import mage.client.dialog.MageDialog; +import org.apache.log4j.Logger; /** * @@ -54,6 +52,8 @@ import mage.client.dialog.MageDialog; */ public class CombatDialog extends MageDialog { + private static final Logger logger = Logger.getLogger(CombatDialog.class); + private UUID gameId; private BigCard bigCard; private int lastX = 500; @@ -100,7 +100,7 @@ public class CombatDialog extends MageDialog { try { this.setSelected(true); } catch (PropertyVetoException ex) { - Logger.getLogger(CombatDialog.class.getName()).log(Level.SEVERE, null, ex); + logger.error(null, ex); } pack(); this.revalidate(); diff --git a/Mage.Client/src/main/java/mage/client/unusedFiles/PlayerPanel.java b/Mage.Client/src/main/java/mage/client/unusedFiles/PlayerPanel.java index 6e35211152e..b1f0a8774e7 100644 --- a/Mage.Client/src/main/java/mage/client/unusedFiles/PlayerPanel.java +++ b/Mage.Client/src/main/java/mage/client/unusedFiles/PlayerPanel.java @@ -1,37 +1,36 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ /* * PlayerPanel.java * * Created on Nov 18, 2009, 3:01:31 PM */ - package mage.client.unusedFiles; //package mage.client.game; @@ -58,7 +57,9 @@ public class PlayerPanel extends javax.swing.JPanel { private ShowCardsDialog graveyard; private BigCard bigCard; - /** Creates new form PlayerPanel */ + /** + * Creates new form PlayerPanel + */ public PlayerPanel() { initComponents(); } @@ -79,19 +80,17 @@ public class PlayerPanel extends javax.swing.JPanel { this.btnPlayerName.setText(player.getName()); if (player.isActive()) { this.btnPlayerName.setBackground(Color.DARK_GRAY); - } - else if (player.hasLeft()) { + } else if (player.hasLeft()) { this.btnPlayerName.setBackground(Color.RED); - } - else { + } else { this.btnPlayerName.setBackground(Color.LIGHT_GRAY); } } - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents @@ -201,10 +200,9 @@ public class PlayerPanel extends javax.swing.JPanel { if (graveyard == null) { graveyard = new ShowCardsDialog(); } - graveyard.loadCards(player.getName() + " graveyard", player.getGraveyard(), bigCard, Config.dimensions, gameId, false); + graveyard.loadCards(player.getName() + " graveyard", player.getGraveyard(), bigCard, Config.dimensions, gameId, false, null, null, null); }//GEN-LAST:event_btnGraveActionPerformed - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnGrave; private javax.swing.JButton btnPlayerName; diff --git a/Mage.Client/src/main/java/mage/client/util/CardViewColorDetailedComparator.java b/Mage.Client/src/main/java/mage/client/util/CardViewColorIdentityComparator.java similarity index 86% rename from Mage.Client/src/main/java/mage/client/util/CardViewColorDetailedComparator.java rename to Mage.Client/src/main/java/mage/client/util/CardViewColorIdentityComparator.java index 179254b961c..36be3025d11 100644 --- a/Mage.Client/src/main/java/mage/client/util/CardViewColorDetailedComparator.java +++ b/Mage.Client/src/main/java/mage/client/util/CardViewColorIdentityComparator.java @@ -25,21 +25,21 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.client.util; import java.util.Comparator; +import mage.utils.CardUtil; import mage.view.CardView; /** * * @author BetaSteward_at_googlemail.com */ -public class CardViewColorDetailedComparator implements Comparator { +public class CardViewColorIdentityComparator implements Comparator { @Override public int compare(CardView o1, CardView o2) { - return o1.getColor().hashCode() - o2.getColor().hashCode(); + return CardUtil.getColorIdentitySortValue(o1.getManaCost(), o1.getColor(), o1.getRules()) + - CardUtil.getColorIdentitySortValue(o2.getManaCost(), o2.getColor(), o2.getRules()); } - -} \ No newline at end of file +} diff --git a/Mage.Client/src/main/java/mage/client/util/CardViewCostComparator.java b/Mage.Client/src/main/java/mage/client/util/CardViewCostComparator.java index 22eae462b06..a77d685a489 100644 --- a/Mage.Client/src/main/java/mage/client/util/CardViewCostComparator.java +++ b/Mage.Client/src/main/java/mage/client/util/CardViewCostComparator.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.client.util; import java.util.Comparator; @@ -39,7 +38,7 @@ public class CardViewCostComparator implements Comparator { @Override public int compare(CardView o1, CardView o2) { - return Integer.valueOf(o1.getConvertedManaCost()).compareTo(Integer.valueOf(o2.getConvertedManaCost())); + return Integer.valueOf(o1.getConvertedManaCost()).compareTo(o2.getConvertedManaCost()); } } diff --git a/Mage.Client/src/main/java/mage/client/util/DeckUtil.java b/Mage.Client/src/main/java/mage/client/util/DeckUtil.java index 1b240c389ce..930b1c777db 100644 --- a/Mage.Client/src/main/java/mage/client/util/DeckUtil.java +++ b/Mage.Client/src/main/java/mage/client/util/DeckUtil.java @@ -43,7 +43,7 @@ import org.apache.log4j.Logger; */ public class DeckUtil { - private static final transient Logger log = Logger.getLogger(DeckUtil.class); + private static final Logger log = Logger.getLogger(DeckUtil.class); private DeckUtil() { } diff --git a/Mage.Client/src/main/java/mage/client/util/Listener.java b/Mage.Client/src/main/java/mage/client/util/Listener.java index 8c7ce8dc99f..6fb209b684c 100644 --- a/Mage.Client/src/main/java/mage/client/util/Listener.java +++ b/Mage.Client/src/main/java/mage/client/util/Listener.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.client.util; import java.io.Serializable; @@ -33,7 +32,9 @@ import java.io.Serializable; /** * * @author BetaSteward_at_googlemail.com + * @param */ public interface Listener extends Serializable { + void event(E event); } diff --git a/Mage.Client/src/main/java/mage/client/util/audio/AudioManager.java b/Mage.Client/src/main/java/mage/client/util/audio/AudioManager.java index 9e9dd416a29..a27a48f1a3a 100644 --- a/Mage.Client/src/main/java/mage/client/util/audio/AudioManager.java +++ b/Mage.Client/src/main/java/mage/client/util/audio/AudioManager.java @@ -303,7 +303,7 @@ public class AudioManager { private static void checkAndPlayClip(MageClip mageClip) { try { - if (mageClip != null) { + if (mageClip != null && mageClip.getClip() != null) { boolean playSound = false; switch (mageClip.getAudioGroup()) { case GameSounds: diff --git a/Mage.Client/src/main/java/mage/client/util/gui/Arrow.java b/Mage.Client/src/main/java/mage/client/util/gui/Arrow.java index b513ea79665..0befa70bed9 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/Arrow.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/Arrow.java @@ -11,11 +11,11 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import java.awt.geom.Area; import java.awt.geom.GeneralPath; - import javax.swing.JFrame; import javax.swing.JPanel; public class Arrow extends JPanel { + private static final long serialVersionUID = -4631054277822828303L; private int startX; @@ -27,21 +27,25 @@ public class Arrow extends JPanel { private Composite composite; private Color color = Color.red; - public Arrow () { + public Arrow() { setOpaque(false); setOpacity(0.6f); } - protected void paintComponent (Graphics g) { + protected void paintComponent(Graphics g) { super.paintComponent(g); float ex = endX - startX; float ey = endY - startY; - if (ex == 0 && ey == 0) return; - float length = (float)Math.sqrt(ex * ex + ey * ey); - float bendPercent = (float)Math.asin(ey / length); - if (endX > startX) bendPercent = -bendPercent; + if (ex == 0 && ey == 0) { + return; + } + float length = (float) Math.sqrt(ex * ex + ey * ey); + float bendPercent = (float) Math.asin(ey / length); + if (endX > startX) { + bendPercent = -bendPercent; + } Area arrow = getArrow(length, bendPercent); - Graphics2D g2d = (Graphics2D)g; + Graphics2D g2d = (Graphics2D) g; g2d.translate(startX, startY); g2d.rotate(Math.atan2(ey, ex)); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); @@ -52,16 +56,16 @@ public class Arrow extends JPanel { g2d.draw(arrow); } - private Area getArrow (float length, float bendPercent) { + private Area getArrow(float length, float bendPercent) { float p1x = 0, p1y = 0; float p2x = length, p2y = 0; float cx = length / 2, cy = length / 8f * bendPercent; float adjSize, ex, ey, abs_e; - adjSize = (float)(bodyWidth / 2 / Math.sqrt(2)); + adjSize = (float) (bodyWidth / 2 / Math.sqrt(2)); ex = p2x - cx; ey = p2y - cy; - abs_e = (float)Math.sqrt(ex * ex + ey * ey); + abs_e = (float) Math.sqrt(ex * ex + ey * ey); ex /= abs_e; ey /= abs_e; GeneralPath bodyPath = new GeneralPath(); @@ -71,10 +75,10 @@ public class Arrow extends JPanel { bodyPath.quadTo(cx, cy, p2x - (ey + ex) * adjSize, p2y + (ex - ey) * adjSize); bodyPath.closePath(); - adjSize = (float)(headSize / Math.sqrt(2)); + adjSize = (float) (headSize / Math.sqrt(2)); ex = p2x - cx; ey = p2y - cy; - abs_e = (float)Math.sqrt(ex * ex + ey * ey); + abs_e = (float) Math.sqrt(ex * ex + ey * ey); ex /= abs_e; ey /= abs_e; GeneralPath headPath = new GeneralPath(); @@ -88,23 +92,23 @@ public class Arrow extends JPanel { return area; } - public int getBodyWidth () { + public int getBodyWidth() { return bodyWidth; } - public void setBodyWidth (int bodyWidth) { + public void setBodyWidth(int bodyWidth) { this.bodyWidth = bodyWidth; } - public float getHeadSize () { + public float getHeadSize() { return headSize; } - public void setHeadSize (float headSize) { + public void setHeadSize(float headSize) { this.headSize = headSize; } - public void setArrowLocation (int startX, int startY, int endX, int endY) { + public void setArrowLocation(int startX, int startY, int endX, int endY) { this.startX = startX; this.startY = startY; this.endX = endX; @@ -112,7 +116,7 @@ public class Arrow extends JPanel { repaint(); } - public void setOpacity (float opacity) { + public void setOpacity(float opacity) { composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, opacity); } @@ -120,7 +124,7 @@ public class Arrow extends JPanel { this.color = color; } - public static void main (String[] args) { + public static void main(String[] args) { final JFrame frame = new JFrame(); frame.setLayout(new BorderLayout()); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); @@ -130,11 +134,13 @@ public class Arrow extends JPanel { frame.setResizable(false); frame.setVisible(true); frame.getContentPane().addMouseMotionListener(new MouseMotionListener() { - public void mouseMoved (MouseEvent e) { + @Override + public void mouseMoved(MouseEvent e) { arrow.setArrowLocation(320, 240, e.getX(), e.getY()); } - public void mouseDragged (MouseEvent e) { + @Override + public void mouseDragged(MouseEvent e) { } }); } diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java index 774fea3adb1..5f50c709569 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java @@ -29,6 +29,7 @@ import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; +import javax.swing.JPopupMenu; import mage.cards.MagePermanent; import mage.cards.TextPopup; import mage.cards.action.ActionCallback; @@ -63,15 +64,16 @@ import org.mage.plugins.card.utils.impl.ImageManagerImpl; */ @SuppressWarnings({"unchecked", "rawtypes"}) public class CardPanel extends MagePermanent implements MouseListener, MouseMotionListener, MouseWheelListener, ComponentListener { + private static final long serialVersionUID = -3272134219262184410L; - private static final Logger log = Logger.getLogger(CardPanel.class); + private static final Logger logger = Logger.getLogger(CardPanel.class); private static final int WIDTH_LIMIT = 90; // card width limit to create smaller counter public static final double TAPPED_ANGLE = Math.PI / 2; public static final double FLIPPED_ANGLE = Math.PI; public static final float ASPECT_RATIO = 3.5f / 2.5f; - public static final int POPUP_X_GAP = 1; // prevent popup window from blinking + public static final int POPUP_X_GAP = 1; // prevent tooltip window from blinking public static CardPanel dragAnimationPanel; @@ -120,7 +122,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti private GlowText ptText; private boolean displayEnabled = true; private boolean isAnimationPanel; - public int cardXOffset, cardYOffset, cardWidth, cardHeight; + public int cardXOffset, cardYOffset, cardWidth, cardHeight; private boolean isSelected; private boolean isPlayable; @@ -132,8 +134,8 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti private ActionCallback callback; - protected boolean popupShowing; - protected TextPopup popupText = new TextPopup(); + protected boolean tooltipShowing; + protected TextPopup tooltipText = new TextPopup(); protected UUID gameId; private TransferData data = new TransferData(); @@ -152,6 +154,9 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti private int yTextOffset = 10; + // if this is set, it's opened if the user right clicks on the card panel + private JPopupMenu popupMenu; + public CardPanel(CardView newGameCard, UUID gameId, final boolean loadImage, ActionCallback callback, final boolean foil, Dimension dimension) { this.gameCard = newGameCard; this.callback = callback; @@ -165,7 +170,6 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti //for container debug (don't remove) //setBorder(BorderFactory.createLineBorder(Color.green)); - if (this.gameCard.canTransform()) { buttonPanel = new JPanel(); buttonPanel.setLayout(null); @@ -222,14 +226,14 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } if (newGameCard.isAbility()) { if (AbilityType.TRIGGERED.equals(newGameCard.getAbilityType())) { - setTypeIcon(ImageManagerImpl.getInstance().getTriggeredAbilityImage(),"Triggered Ability"); + setTypeIcon(ImageManagerImpl.getInstance().getTriggeredAbilityImage(), "Triggered Ability"); } else if (AbilityType.ACTIVATED.equals(newGameCard.getAbilityType())) { - setTypeIcon(ImageManagerImpl.getInstance().getActivatedAbilityImage(),"Activated Ability"); + setTypeIcon(ImageManagerImpl.getInstance().getActivatedAbilityImage(), "Activated Ability"); } } if (this.gameCard.isToken()) { - setTypeIcon(ImageManagerImpl.getInstance().getTokenIconImage(),"Token Permanent"); + setTypeIcon(ImageManagerImpl.getInstance().getTokenIconImage(), "Token Permanent"); } // icon to inform about permanent is copying something @@ -299,7 +303,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti imagePanel.setScalingMultiPassType(MultipassType.none); String cardType = getType(newGameCard); - popupText.setText(getText(cardType, newGameCard)); + tooltipText.setText(getText(cardType, newGameCard)); Util.threadPool.submit(new Runnable() { @Override @@ -326,9 +330,9 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } setText(gameCard); } catch (Exception e) { - e.printStackTrace(); + logger.fatal("Problem during image animation", e); } catch (Error err) { - err.printStackTrace(); + logger.error("Problem during image animation", err); } } }); @@ -344,7 +348,6 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti typeButton.setLocation(2, 2); typeButton.setSize(25, 25); - iconPanel.setVisible(true); typeButton.setIcon(new ImageIcon(bufferedImage)); if (toolTipText != null) { @@ -355,17 +358,17 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti public void cleanUp() { if (dayNightButton != null) { - for(ActionListener al: dayNightButton.getActionListeners()) { + for (ActionListener al : dayNightButton.getActionListeners()) { dayNightButton.removeActionListener(al); } } - for(MouseListener ml: this.getMouseListeners() ){ + for (MouseListener ml : this.getMouseListeners()) { this.removeMouseListener(ml); } - for(MouseMotionListener ml: this.getMouseMotionListeners() ){ + for (MouseMotionListener ml : this.getMouseMotionListeners()) { this.removeMouseMotionListener(ml); } - for(MouseWheelListener ml: this.getMouseWheelListeners() ){ + for (MouseWheelListener ml : this.getMouseWheelListeners()) { this.removeMouseWheelListener(ml); } // this holds reference to ActionCallback forever so set it to null to prevent @@ -394,7 +397,6 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } } - @Override public void setZone(String zone) { this.zone = zone; @@ -502,7 +504,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } else if (isPlayable) { g2d.setColor(new Color(153, 102, 204, 200)); //g2d.fillRoundRect(cardXOffset + 1, cardYOffset + 1, cardWidth - 2, cardHeight - 2, cornerSize, cornerSize); - g2d.fillRoundRect(cardXOffset, cardYOffset , cardWidth , cardHeight , cornerSize, cornerSize); + g2d.fillRoundRect(cardXOffset, cardYOffset, cardWidth, cardHeight, cornerSize, cornerSize); } if (canAttack) { @@ -512,10 +514,10 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti //TODO:uncomment /* - if (gameCard.isAttacking()) { - g2d.setColor(new Color(200,10,10,200)); - g2d.fillRoundRect(cardXOffset+1, cardYOffset+1, cardWidth-2, cardHeight-2, cornerSize, cornerSize); - }*/ + if (gameCard.isAttacking()) { + g2d.setColor(new Color(200,10,10,200)); + g2d.fillRoundRect(cardXOffset+1, cardYOffset+1, cardWidth-2, cardHeight-2, cornerSize, cornerSize); + }*/ } @Override @@ -562,8 +564,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti if (counterPanel != null) { counterPanel.setLocation(cardXOffset + borderSize, cardYOffset + borderSize); counterPanel.setSize(cardWidth - borderSize * 2, cardHeight - borderSize * 2); - int size = cardWidth > WIDTH_LIMIT ? 40: 20; - + int size = cardWidth > WIDTH_LIMIT ? 40 : 20; minusCounterLabel.setLocation(counterPanel.getWidth() - size, counterPanel.getHeight() - size * 2); minusCounterLabel.setSize(size, size); @@ -577,7 +578,6 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti otherCounterLabel.setLocation(5, counterPanel.getHeight() - size); otherCounterLabel.setSize(size, size); - } int fontHeight = Math.round(cardHeight * (27f / 680)); boolean showText = (!isAnimationPanel && fontHeight < 12); @@ -823,7 +823,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti this.gameCard = card; String cardType = getType(card); - popupText.setText(getText(cardType, card)); + tooltipText.setText(getText(cardType, card)); if (hasSickness && CardUtil.isCreature(gameCard) && isPermanent) { overlayPanel.setVisible(true); @@ -864,11 +864,11 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti minusCounterLabel.setVisible(false); loyaltyCounterLabel.setVisible(false); otherCounterLabel.setVisible(false); - for (CounterView counterView:card.getCounters()) { + for (CounterView counterView : card.getCounters()) { if (counterView.getCount() == 0) { continue; } - switch(counterView.getName()) { + switch (counterView.getName()) { case "+1/+1": if (counterView.getCount() != plusCounter) { plusCounter = counterView.getCount(); @@ -913,10 +913,10 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } private static ImageIcon getCounterImageWithAmount(int amount, BufferedImage image, int cardWidth) { - int factor = cardWidth > WIDTH_LIMIT ? 2 :1; + int factor = cardWidth > WIDTH_LIMIT ? 2 : 1; int xOffset = amount > 9 ? 2 : 5; - int fontSize = factor == 1 ? amount < 10 ? 12 : amount < 100 ? 10 : amount < 1000 ? 7: 6 - :amount < 10 ? 19 : amount < 100 ? 15 : amount < 1000 ? 12: amount < 10000 ?9 : 8; + int fontSize = factor == 1 ? amount < 10 ? 12 : amount < 100 ? 10 : amount < 1000 ? 7 : 6 + : amount < 10 ? 19 : amount < 100 ? 15 : amount < 1000 ? 12 : amount < 10000 ? 9 : 8; BufferedImage newImage; if (cardWidth > WIDTH_LIMIT) { newImage = ImageManagerImpl.deepCopy(image); @@ -925,7 +925,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti } Graphics graphics = newImage.getGraphics(); graphics.setColor(Color.BLACK); - graphics.setFont(new Font("Arial Black", amount > 100 ? Font.PLAIN : Font.BOLD, fontSize )); + graphics.setFont(new Font("Arial Black", amount > 100 ? Font.PLAIN : Font.BOLD, fontSize)); graphics.drawString(Integer.toString(amount), xOffset * factor, 11 * factor); return new ImageIcon(newImage); } @@ -977,12 +977,12 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti if (gameCard.hideInfo()) { return; } - if (!popupShowing) { + if (!tooltipShowing) { synchronized (this) { - if (!popupShowing) { + if (!tooltipShowing) { TransferData transferData = getTransferDataForMouseEntered(); if (this.isShowing()) { - popupShowing = true; + tooltipShowing = true; callback.mouseEntered(e, transferData); } } @@ -1013,13 +1013,13 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti if (getMousePosition(true) != null) { return; } - if (popupShowing) { + if (tooltipShowing) { synchronized (this) { - if (popupShowing) { - popupShowing = false; + if (tooltipShowing) { + tooltipShowing = false; data.component = this; data.card = this.gameCard; - data.popupText = popupText; + data.popupText = tooltipText; callback.mouseExited(e, data); } } @@ -1047,7 +1047,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti private TransferData getTransferDataForMouseEntered() { data.component = this; data.card = this.gameCard; - data.popupText = popupText; + data.popupText = tooltipText; data.gameId = this.gameId; data.locationOnScreen = data.component.getLocationOnScreen(); // we need this for popup data.popupOffsetX = isTapped() ? cardHeight + cardXOffset + POPUP_X_GAP : cardWidth + cardXOffset + POPUP_X_GAP; @@ -1145,7 +1145,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti dayNightButton.setIcon(new ImageIcon(night)); } if (this.gameCard.getSecondCardFace() == null) { - log.error("no second side for card to transform!"); + logger.error("no second side for card to transform!"); return; } if (!isPermanent) { // use only for custom transformation (when pressing day-night button) @@ -1210,5 +1210,14 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti yTextOffset = yOffset; } + @Override + public JPopupMenu getPopupMenu() { + return popupMenu; + } + + @Override + public void setPopupMenu(JPopupMenu popupMenu) { + this.popupMenu = popupMenu; + } } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java b/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java index 7c99afe5997..6dd83a15359 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/CardPluginImpl.java @@ -81,6 +81,7 @@ public class CardPluginImpl implements CardPlugin { @PluginLoaded public void newPlugin(CardPlugin plugin) { + log.info(plugin.toString() + " has been loaded."); } @Override diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/CardImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/CardImageSource.java index 497bc1c1883..b84f07cc1ad 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/CardImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/CardImageSource.java @@ -9,7 +9,7 @@ import org.mage.plugins.card.images.CardDownloadData; public interface CardImageSource { String generateURL(CardDownloadData card) throws Exception; - String generateTokenUrl(CardDownloadData card); + String generateTokenUrl(CardDownloadData card) throws Exception; String getSourceName(); Float getAverageSize(); } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java index 4ad6037eccd..b18182f5e80 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/GathererSets.java @@ -36,7 +36,7 @@ public class GathererSets implements Iterable { private static final String[] withMythics = {"M10", "M11", "M12", "M13", "M14", "M15", "ORI", "DDF", "DDG", "DDH", "DDI", "DDJ", "DDK", "DDL", "DDM", "DDN", - "DD3", "DD3B", "DDO", + "DD3", "DD3B", "DDO", "DDP", "FVD", "FVE", "FVL", "FVR", "V12", "V13", "V14", "V15", "ALA", "CON", "ARB", @@ -49,7 +49,7 @@ public class GathererSets implements Iterable { "THS", "BNG", "JOU", "CNS", "VMA", "TPR", "KTK", "FRF", "DTK", - "BFZ"}; + "BFZ", "EXP", "OGW"}; private static final HashMap symbolsReplacements = new HashMap<>(); static { diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MagicCardsImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MagicCardsImageSource.java index bec0386a467..5b2ab1a20b1 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MagicCardsImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MagicCardsImageSource.java @@ -13,9 +13,12 @@ import org.mage.plugins.card.utils.CardImageUtils; public class MagicCardsImageSource implements CardImageSource { private static CardImageSource instance = new MagicCardsImageSource(); - + private static final Map setNameTokenReplacement = new HashMap() { { + put("C15", "commander-2015"); + put("ORG", "oath-of-the-gatewatch"); + put("EXP", "zendikar-expeditions"); put("BFZ", "battle-for-zendikar"); put("FVL", "from-the-vault-legends"); put("FVD", "from-the-vault-dragons"); @@ -31,8 +34,8 @@ public class MagicCardsImageSource implements CardImageSource { put("MM2", "modern-masters-2015"); put("PTC", "prerelease-events"); put("DTK", "dragons-of-tarkir"); - put("GRC","wpngateway"); - put("MBP","media-inserts"); + put("GRC", "wpngateway"); + put("MBP", "media-inserts"); put("MLP", "launch-party"); put("WMCQ", "world-magic-cup-qualifier"); put("GPX", "grand-prix"); @@ -40,7 +43,7 @@ public class MagicCardsImageSource implements CardImageSource { put("MGDC", "magic-game-day-cards"); put("FNMP", "friday-night-magic"); put("FRF", "fate-reforged"); - put("C14", "commander-2014-edition"); + put("C14", "commander-2014"); put("KTK", "khans-of-tarkir"); put("VMA", "vintage-masters"); put("CNS", "conspiracy"); @@ -103,6 +106,7 @@ public class MagicCardsImageSource implements CardImageSource { put("DDM", "duel-decks-jace-vs-vraska"); put("DDN", "duel-decks-speed-vs-cunning"); put("DDO", "duel-decks-elspeth-vs-kiora"); + put("DDP", "duel-decks-zendikar-vs-eldrazi"); } private static final long serialVersionUID = 1L; }; @@ -129,7 +133,7 @@ public class MagicCardsImageSource implements CardImageSource { String set = CardImageUtils.updateSet(cardSet, true); String preferedLanguage = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_IMAGES_PREF_LANGUAGE, "en"); - + StringBuilder url = new StringBuilder("http://magiccards.info/scans/").append(preferedLanguage).append("/"); url.append(set.toLowerCase()).append("/").append(collectorId); @@ -153,7 +157,12 @@ public class MagicCardsImageSource implements CardImageSource { @Override public String generateTokenUrl(CardDownloadData card) { - String name = card.getName().replaceAll(" ", "-").replace(",", "").toLowerCase(); + String name = card.getName(); + // add type to name if it's not 0 + if (card.getType() > 0) { + name = name + " " + card.getType(); + } + name = name.replaceAll(" ", "-").replace(",", "").toLowerCase(); String set = "not-supported-set"; if (setNameTokenReplacement.containsKey(card.getSet())) { set = setNameTokenReplacement.get(card.getSet()); diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java index 0728084c111..78995593cd7 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/MythicspoilerComSource.java @@ -36,7 +36,10 @@ import java.net.Proxy; import java.net.URL; import java.net.URLEncoder; import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Set; import java.util.prefs.Preferences; import mage.client.MageFrame; import mage.remote.Connection; @@ -56,6 +59,7 @@ public class MythicspoilerComSource implements CardImageSource { private static CardImageSource instance; private static Map setsAliases; private static Map cardNameAliases; + private static Map> cardNameAliasesStart; private final Map> sets; public static CardImageSource getInstance() { @@ -71,8 +75,9 @@ public class MythicspoilerComSource implements CardImageSource { } public MythicspoilerComSource() { - sets = new HashMap<>(); + sets = new LinkedHashMap<>(); setsAliases = new HashMap<>(); + setsAliases.put("exp", "bfz"); cardNameAliases = new HashMap<>(); // set+wrong name from web side => correct card name cardNameAliases.put("MM2-otherwordlyjourney", "otherworldlyjourney"); @@ -81,12 +86,24 @@ public class MythicspoilerComSource implements CardImageSource { cardNameAliases.put("THS-soldierofpantheon", "soldierofthepantheon"); cardNameAliases.put("THS-vulpinegolaith", "vulpinegoliath"); cardNameAliases.put("ORI-kothopedhoarderofsouls", "kothophedsoulhoarder"); + cardNameAliases.put("BFZ-unisonstrike", "tandemtactics"); + cardNameAliases.put("BFZ-eldrazidevastator", "eldrazidevastator"); + cardNameAliases.put("BFZ-kozliekschanneler", "kozilekschanneler"); + + cardNameAliasesStart = new HashMap<>(); + HashSet names = new HashSet<>(); + names.add("eldrazidevastator.jpg"); + cardNameAliasesStart.put("BFZ", names); } private Map getSetLinks(String cardSet) { Map setLinks = new HashMap<>(); try { String setNames = setsAliases.get(cardSet.toLowerCase()); + Set aliasesStart = new HashSet<>(); + if (cardNameAliasesStart.containsKey(cardSet)) { + aliasesStart.addAll(cardNameAliasesStart.get(cardSet)); + } if (setNames == null) { setNames = cardSet.toLowerCase(); } @@ -119,33 +136,42 @@ public class MythicspoilerComSource implements CardImageSource { } Elements cardsImages = doc.select("img[src^=cards/]"); // starts with cards/ + if (!aliasesStart.isEmpty()) { + for (String text : aliasesStart) { + cardsImages.addAll(doc.select("img[src^=" + text + "]")); + } + } if (cardsImages.isEmpty()) { break; } for (Element cardsImage : cardsImages) { String cardLink = cardsImage.attr("src"); + String cardName = null; if (cardLink.startsWith("cards/") && cardLink.endsWith(".jpg")) { - String cardName = cardLink.substring(6, cardLink.length() - 4); - if (cardName != null && !cardName.isEmpty()) { - if (cardNameAliases.containsKey(cardSet + "-" + cardName)) { - cardName = cardNameAliases.get(cardSet + "-" + cardName); - } - if (cardName.endsWith("1") || cardName.endsWith("2") || cardName.endsWith("3") || cardName.endsWith("4") || cardName.endsWith("5")) { - if (!cardName.startsWith("forest") - && !cardName.startsWith("swamp") - && !cardName.startsWith("mountain") - && !cardName.startsWith("island") - && !cardName.startsWith("plains")) { - cardName = cardName.substring(0, cardName.length() - 1); - } - } - setLinks.put(cardName, baseUrl + cardLink); - } + cardName = cardLink.substring(6, cardLink.length() - 4); + } else if (aliasesStart.contains(cardLink)) { + cardName = cardLink.substring(0, cardLink.length() - 4);; + } + if (cardName != null && !cardName.isEmpty()) { + if (cardNameAliases.containsKey(cardSet + "-" + cardName)) { + cardName = cardNameAliases.get(cardSet + "-" + cardName); + } + if (cardName.endsWith("1") || cardName.endsWith("2") || cardName.endsWith("3") || cardName.endsWith("4") || cardName.endsWith("5")) { + if (!cardName.startsWith("forest") + && !cardName.startsWith("swamp") + && !cardName.startsWith("mountain") + && !cardName.startsWith("island") + && !cardName.startsWith("plains")) { + cardName = cardName.substring(0, cardName.length() - 1); + } + } + setLinks.put(cardName, baseUrl + cardLink); } - } + } + } catch (IOException ex) { System.out.println("Exception when parsing the mythicspoiler page: " + ex.getMessage()); } diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/TokensMtgImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/TokensMtgImageSource.java new file mode 100644 index 00000000000..fbdfb89d912 --- /dev/null +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/TokensMtgImageSource.java @@ -0,0 +1,324 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package org.mage.plugins.card.dl.sources; + +import org.apache.log4j.Logger; +import org.mage.plugins.card.images.CardDownloadData; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * + * @author Quercitron + */ +public class TokensMtgImageSource implements CardImageSource { + + private static final Logger logger = Logger.getLogger(TokensMtgImageSource.class); + + private static CardImageSource instance = new TokensMtgImageSource(); + + public static CardImageSource getInstance() { + if (instance == null) { + instance = new TokensMtgImageSource(); + } + return instance; + } + + @Override + public String getSourceName() { + return "tokens.mtg.onl"; + } + + @Override + public Float getAverageSize() { + return 26.7f; + } + + @Override + public String generateURL(CardDownloadData card) throws Exception { + return null; + } + + private static final String[] EMBLEMS = { + "Ajani", + "Chandra", + "Dack", + "Daretti", + "Domri", + "Elspeth", + "Garruk", + "Gideon", + "Jace", + "Kiora", + "Koth", + "Liliana", + "Narset", + "Nixilis", + "Sarkhan", + "Sorin", + "Tamiyo", + "Teferi", + "Venser", + }; + + private static final Map SET_NAMES_REPLACEMENT = new HashMap() { + { + put("con", "CFX"); + put("fnmp", "FNM"); + } + }; + + @Override + public String generateTokenUrl(CardDownloadData card) throws IOException { + String name = card.getName(); + String set = card.getSet(); + int type = card.getType(); + + // handle emblems + if (name.toLowerCase().contains("emblem")) { + for (String emblem : EMBLEMS) { + if (name.toLowerCase().contains(emblem.toLowerCase())){ + name = emblem + " Emblem"; + break; + } + } + } + + // we should replace some set names + if (SET_NAMES_REPLACEMENT.containsKey(set.toLowerCase())) { + set = SET_NAMES_REPLACEMENT.get(set.toLowerCase()); + } + + // Image URL contains token number + // e.g. http://tokens.mtg.onl/tokens/ORI_010-Thopter.jpg -- token number 010 + // We don't know these numbers, but we can take them from a file + // with tokens information that can be downloaded from the site. + List tokensData = getTokensData(); + + if (tokensData.isEmpty()) { + return null; + } + + List matchedTokens = new ArrayList(); + for (TokenData token : tokensData) { + if (name.equalsIgnoreCase(token.getName()) && set.equalsIgnoreCase(token.getExpansionSetCode())) { + matchedTokens.add(token); + } + } + + if (matchedTokens.isEmpty()) { + logger.info("Could not find data for token " + name + ", set " + set + "."); + return null; + } + + TokenData tokenData; + if (type == 0) { + if (matchedTokens.size() > 1) { + logger.info("Multiple images were found for token " + name + ", set " + set + "."); + } + tokenData = matchedTokens.get(0); + } else { + if (type > matchedTokens.size()) { + logger.warn("Not enough images for token with type " + type + ", name " + name + ", set " + set + "."); + return null; + } + tokenData = matchedTokens.get(card.getType() - 1); + } + + String url = "http://tokens.mtg.onl/tokens/" + tokenData.getExpansionSetCode().trim() + "_" + + tokenData.getNumber().trim() + "-" + tokenData.getName().trim()+ ".jpg"; + url = url.replace(' ', '-'); + return url; + } + + private List tokensData; + + private final Object tokensDataSync = new Object(); + + private List getTokensData() throws IOException { + if (tokensData == null) { + synchronized (tokensDataSync) { + if (tokensData == null) { + tokensData = new ArrayList(); + + // get tokens data from resource file + InputStream inputStream = null; + try { + inputStream = this.getClass().getResourceAsStream("/tokens-mtg-onl-list.csv"); + List fileTokensData = parseTokensData(inputStream); + tokensData.addAll(fileTokensData); + } catch (Exception exception) { + logger.warn("Failed to get tokens description from resource file tokens-mtg-onl-list.csv", exception); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (Exception e) { + logger.error("Input stream close failed:", e); + } + } + } + + // description on site may contain new information + // try to add it + try { + URL url = new URL("http://tokens.mtg.onl/data/SetsWithTokens.csv"); + inputStream = url.openStream(); + List siteTokensData = parseTokensData(inputStream); + + List newTokensData = new ArrayList(); + for (TokenData siteData : siteTokensData) { + boolean isNew = true; + for (TokenData fileData : tokensData) { + if (siteData.getName().equalsIgnoreCase(fileData.getName()) + && siteData.getNumber().equalsIgnoreCase(fileData.getNumber()) + && siteData.getExpansionSetCode().equalsIgnoreCase(fileData.getExpansionSetCode())) { + isNew = false; + break; + } + } + if (isNew) { + newTokensData.add(siteData); + } + } + + tokensData.addAll(newTokensData); + } catch (Exception exception) { + logger.warn("Failed to get tokens description from tokens.mtg.onl", exception); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (Exception e) { + logger.error("Input stream close failed:", e); + } + } + } + } + } + } + + return tokensData; + } + + private List parseTokensData(InputStream inputStream) throws IOException { + List tokensData = new ArrayList(); + + InputStreamReader inputReader = null; + BufferedReader reader = null; + try { + // we have to specify encoding to read special comma + inputReader = new InputStreamReader(inputStream, "Cp1252"); + reader = new BufferedReader(inputReader); + + reader.readLine(); // skip header + String line = reader.readLine(); + // states + // 0 - wait set name + // 1 - wait cards + // 2 - process cards + int state = 0; + String set = null; + while (line != null) { + if (line.trim().isEmpty()) { + if (state == 2) { + state = 0; + } + } else { + if (state == 0) { + set = line.substring(0, 3); + state = 1; + } else { + if (state == 1) { + state = 2; + } + String[] split = line.split(","); + // replace special comma for cards like 'Ashaya‚ the Awoken World' + String name = split[0].replace('‚', ','); + String number = split[1]; + TokenData token = new TokenData(name, number, set); + tokensData.add(token); + } + } + + line = reader.readLine(); + } + } finally { + if (inputReader != null) { + try { + inputReader.close(); + } catch (Exception e) { + logger.error("Input reader close failed:", e); + } + } + if (reader != null) { + try { + reader.close(); + } catch (Exception e) { + logger.error("Buffered reader close failed:", e); + } + } + } + + return tokensData; + } + + final class TokenData { + final private String name; + final private String number; + final private String expansionSetCode; + + public TokenData(String name, String number, String expansionSetCode) { + this.name = name; + this.number = number; + this.expansionSetCode = expansionSetCode; + } + + public String getName() { + return name; + } + + public String getNumber() { + return number; + } + + public String getExpansionSetCode() { + return expansionSetCode; + } + } + +} diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java index 08a6a7287d8..9a1c93babe8 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/dl/sources/WizardCardsImageSource.java @@ -99,6 +99,7 @@ public class WizardCardsImageSource implements CardImageSource { setsAliases.put("BTD", "Beatdown Box Set"); setsAliases.put("C13", "Commander 2013 Edition"); setsAliases.put("C14", "Commander 2014"); + setsAliases.put("C15", "Commander 2015"); setsAliases.put("CHK", "Champions of Kamigawa"); setsAliases.put("CHR", "Chronicles"); setsAliases.put("CMD", "Magic: The Gathering-Commander"); @@ -123,6 +124,7 @@ public class WizardCardsImageSource implements CardImageSource { setsAliases.put("DDM", "Duel Decks: Jace vs. Vraska"); setsAliases.put("DDN", "Duel Decks: Speed vs. Cunning"); setsAliases.put("DDO", "Duel Decks: Elspeth vs. Kiora"); + setsAliases.put("DDP", "Duel Decks: Zendikar vs. Eldrazi"); setsAliases.put("DGM", "Dragon's Maze"); setsAliases.put("DIS", "Dissension"); setsAliases.put("DKA", "Dark Ascension"); diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPictures.java b/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPictures.java index 4467e0ab2af..fae3f0ca071 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPictures.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/images/DownloadPictures.java @@ -49,17 +49,12 @@ import mage.client.constants.Constants; import mage.client.dialog.PreferencesDialog; import mage.client.util.sets.ConstructedFormats; import mage.remote.Connection; -import static mage.remote.Connection.ProxyType.HTTP; -import static mage.remote.Connection.ProxyType.SOCKS; import net.java.truevfs.access.TFile; import net.java.truevfs.access.TFileOutputStream; import net.java.truevfs.access.TVFS; import net.java.truevfs.kernel.spec.FsSyncException; import org.apache.log4j.Logger; -import org.mage.plugins.card.dl.sources.CardImageSource; -import org.mage.plugins.card.dl.sources.MagicCardsImageSource; -import org.mage.plugins.card.dl.sources.MythicspoilerComSource; -import org.mage.plugins.card.dl.sources.WizardCardsImageSource; +import org.mage.plugins.card.dl.sources.*; import org.mage.plugins.card.properties.SettingsManager; import org.mage.plugins.card.utils.CardImageUtils; @@ -140,7 +135,16 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab p0.add(jLabel1); p0.add(Box.createVerticalStrut(5)); - ComboBoxModel jComboBox1Model = new DefaultComboBoxModel(new String[] { "magiccards.info", "wizards.com", "mythicspoiler.com" /*, "mtgimage.com (HQ)" , "mtgathering.ru HQ", "mtgathering.ru MQ", "mtgathering.ru LQ"*/}); + ComboBoxModel jComboBox1Model = new DefaultComboBoxModel(new String[] { + "magiccards.info", + "wizards.com", + "mythicspoiler.com", + "tokens.mtg.onl", + //"mtgimage.com (HQ)", + //"mtgathering.ru HQ", + //"mtgathering.ru MQ", + //"mtgathering.ru LQ", + }); jComboBox1 = new JComboBox(); cardImageSource = MagicCardsImageSource.getInstance(); @@ -161,6 +165,9 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab case 2: cardImageSource = MythicspoilerComSource.getInstance(); break; + case 3: + cardImageSource = TokensMtgImageSource.getInstance(); + break; } int count = DownloadPictures.this.cards.size(); float mb = (count * cardImageSource.getAverageSize()) / 1024; @@ -221,7 +228,7 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab // JOptionPane Object[] options = { startDownloadButton, closeButton = new JButton("Cancel") }; - dlg = new JOptionPane(p0, JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[1]); + dlg = new JOptionPane(p0, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, options, options[1]); } public static boolean checkForNewCards(List allCards) { @@ -363,23 +370,27 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab while (line != null) { line = line.trim(); if (line.startsWith("|")) { // new format - String[] params = line.split("\\|"); - if (params.length >= 4) { + String[] params = line.split("\\|", -1); + if (params.length >= 5) { + int type = 0; + if (params[4] != null && ! params[4].isEmpty()) { + type = Integer.parseInt(params[4].trim()); + } if (params[1].toLowerCase().equals("generate") && params[2].startsWith("TOK:")) { String set = params[2].substring(4); - CardDownloadData card = new CardDownloadData(params[3], set, 0, false, 0, "", true); + CardDownloadData card = new CardDownloadData(params[3], set, 0, false, type, "", true); list.add(card); } else if (params[1].toLowerCase().equals("generate") && params[2].startsWith("EMBLEM:")) { String set = params[2].substring(7); - CardDownloadData card = new CardDownloadData("Emblem " + params[3], set, 0, false,0, "", true); + CardDownloadData card = new CardDownloadData("Emblem " + params[3], set, 0, false, type, "", true); list.add(card); } else if (params[1].toLowerCase().equals("generate") && params[2].startsWith("EMBLEM-:")) { String set = params[2].substring(8); - CardDownloadData card = new CardDownloadData(params[3] + " Emblem", set, 0, false, 0, "", true); + CardDownloadData card = new CardDownloadData(params[3] + " Emblem", set, 0, false, type, "", true); list.add(card); } else if (params[1].toLowerCase().equals("generate") && params[2].startsWith("EMBLEM!:")) { String set = params[2].substring(8); - CardDownloadData card = new CardDownloadData(params[3], set, 0, false, 0, "", true); + CardDownloadData card = new CardDownloadData(params[3], set, 0, false, type, "", true); list.add(card); } } else { diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java b/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java index 33cbb1a7dbe..6389c70ecff 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java @@ -25,8 +25,8 @@ import org.mage.plugins.card.utils.CardImageUtils; /** * This class stores ALL card images in a cache with soft values. this means - * that the images may be garbage collected when they are not needed any more, but will - * be kept as long as possible. + * that the images may be garbage collected when they are not needed any more, + * but will be kept as long as possible. * * Key format: "####" * @@ -46,8 +46,7 @@ public class ImageCache { private static final Map imageCache; /** - * Common pattern for keys. - * Format: "##" + * Common pattern for keys. Format: "##" */ private static final Pattern KEY_PATTERN = Pattern.compile("(.*)#(.*)#(.*)#(.*)#(.*)"); @@ -104,16 +103,16 @@ public class ImageCache { thumbnailFile = new TFile(thumbnailPath); } catch (Exception ex) { } - boolean exists =false; + boolean exists = false; if (thumbnailFile != null) { try { exists = thumbnailFile.exists(); - } catch(Exception ex) { + } catch (Exception ex) { exists = false; } } if (exists) { - log.debug("loading thumbnail for " + key + ", path="+thumbnailPath); + log.debug("loading thumbnail for " + key + ", path=" + thumbnailPath); return loadImage(thumbnailFile); } else { BufferedImage image = loadImage(file); @@ -187,30 +186,15 @@ public class ImageCache { } public static BufferedImage getThumbnail(CardView card) { - String key = getKey(card) + "#thumb"; - if (card.getUsesVariousArt()) { - key += "#usesVariousArt"; - } - // log.debug("#key: " + key); - return getImage(key); + return getImage(getKey(card, card.getName(), "#thumb")); } public static BufferedImage getImageOriginal(CardView card) { - String key = getKey(card); - if (card.getUsesVariousArt()) { - key += "#usesVariousArt"; - } - // log.warn("#key: " + key); - return getImage(key); + return getImage(getKey(card, card.getName(), "")); } public static BufferedImage getImageOriginalAlternateName(CardView card) { - String key = getKeyAlternateName(card, card.getAlternateName()); - if (card.getUsesVariousArt()) { - key += "#usesVariousArt"; - } - // log.warn("#key: " + key); - return getImage(key); + return getImage(getKey(card, card.getAlternateName(), "")); } /** @@ -230,7 +214,7 @@ public class ImageCache { if (ex.getCause() instanceof NullPointerException) { return null; } - log.error(ex,ex); + log.error(ex, ex); return null; } } @@ -238,32 +222,25 @@ public class ImageCache { /** * Returns the map key for a card, without any suffixes for the image size. */ - private static String getKey(CardView card) { - StringBuilder sb = new StringBuilder(card.getName()).append("#"); - sb.append(card.getExpansionSetCode()).append("#"); - sb.append(card.getType()).append("#"); - sb.append(card.getCardNumber()).append("#"); - sb.append(card.getTokenSetCode() == null ? "":card.getTokenSetCode()); - return sb.toString(); - } - - /** - * Returns the map key for the flip image of a card, without any suffixes for the image size. - */ - private static String getKeyAlternateName(CardView card, String alternateName) { - StringBuilder sb = new StringBuilder(alternateName).append("#"); - sb.append(card.getExpansionSetCode()).append("#"); - sb.append(card.getType()).append("#"); - sb.append(card.getCardNumber()).append("#"); - sb.append(card.getTokenSetCode() == null ? "":card.getTokenSetCode()); - return sb.toString(); + private static String getKey(CardView card, String name, String suffix) { + return name + "#" + card.getExpansionSetCode() + "#" + card.getType() + "#" + card.getCardNumber() + "#" + + (card.getTokenSetCode() == null ? "" : card.getTokenSetCode()) + + suffix + + (card.getUsesVariousArt() ? "#usesVariousArt" : ""); + } +// /** +// * Returns the map key for the flip image of a card, without any suffixes for the image size. +// */ +// private static String getKeyAlternateName(CardView card, String alternateName) { +// return alternateName + "#" + card.getExpansionSetCode() + "#" +card.getType()+ "#" + card.getCardNumber() + "#" +// + (card.getTokenSetCode() == null ? "":card.getTokenSetCode()); +// } /** * Load image from file * - * @param file - * file to load image from + * @param file file to load image from * @return {@link BufferedImage} */ public static BufferedImage loadImage(TFile file) { @@ -297,7 +274,7 @@ public class ImageCache { ImageIO.write(image, "jpg", outputStream); } } catch (IOException e) { - log.error(e,e); + log.error(e, e); imageFile.delete(); } return image; @@ -305,6 +282,7 @@ public class ImageCache { /** * Returns an image scaled to the size given + * * @param original * @return */ @@ -344,6 +322,7 @@ public class ImageCache { /** * Returns an image scaled to the size appropriate for the card picture * panel + * * @param original * @param sizeNeed * @return @@ -356,6 +335,7 @@ public class ImageCache { /** * Returns the image appropriate to display the card in the picture panel + * * @param card * @param width * @param height @@ -365,11 +345,7 @@ public class ImageCache { if (Constants.THUMBNAIL_SIZE_FULL.width + 10 > width) { return getThumbnail(card); } - String key = getKey(card); - if (card.getUsesVariousArt()) { - key += "#usesVariousArt"; - } - // log.warn("getImage: " + key); + String key = getKey(card, card.getName(), ""); BufferedImage original = getImage(key); if (original == null) { log.debug(key + " not found"); diff --git a/Mage.Client/src/main/resources/avatars/10.jpg b/Mage.Client/src/main/resources/avatars/10.jpg index fb5b2744649..7ce97fc81e3 100644 Binary files a/Mage.Client/src/main/resources/avatars/10.jpg and b/Mage.Client/src/main/resources/avatars/10.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/11.jpg b/Mage.Client/src/main/resources/avatars/11.jpg new file mode 100644 index 00000000000..2b665f235a2 Binary files /dev/null and b/Mage.Client/src/main/resources/avatars/11.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/12.jpg b/Mage.Client/src/main/resources/avatars/12.jpg new file mode 100644 index 00000000000..d57f3963ee1 Binary files /dev/null and b/Mage.Client/src/main/resources/avatars/12.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/13.jpg b/Mage.Client/src/main/resources/avatars/13.jpg index 2b665f235a2..b08ae1c24ab 100644 Binary files a/Mage.Client/src/main/resources/avatars/13.jpg and b/Mage.Client/src/main/resources/avatars/13.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/14.jpg b/Mage.Client/src/main/resources/avatars/14.jpg index d57f3963ee1..e45b888a9ea 100644 Binary files a/Mage.Client/src/main/resources/avatars/14.jpg and b/Mage.Client/src/main/resources/avatars/14.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/15.jpg b/Mage.Client/src/main/resources/avatars/15.jpg new file mode 100644 index 00000000000..d7fcc94512b Binary files /dev/null and b/Mage.Client/src/main/resources/avatars/15.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/16.jpg b/Mage.Client/src/main/resources/avatars/16.jpg new file mode 100644 index 00000000000..75b41b0ce63 Binary files /dev/null and b/Mage.Client/src/main/resources/avatars/16.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/17.jpg b/Mage.Client/src/main/resources/avatars/17.jpg new file mode 100644 index 00000000000..12905b63ec3 Binary files /dev/null and b/Mage.Client/src/main/resources/avatars/17.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/18.jpg b/Mage.Client/src/main/resources/avatars/18.jpg new file mode 100644 index 00000000000..d02ccd4c29d Binary files /dev/null and b/Mage.Client/src/main/resources/avatars/18.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/19.jpg b/Mage.Client/src/main/resources/avatars/19.jpg index b08ae1c24ab..bbffc049eea 100644 Binary files a/Mage.Client/src/main/resources/avatars/19.jpg and b/Mage.Client/src/main/resources/avatars/19.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/48.jpg b/Mage.Client/src/main/resources/avatars/20.jpg similarity index 100% rename from Mage.Client/src/main/resources/avatars/48.jpg rename to Mage.Client/src/main/resources/avatars/20.jpg diff --git a/Mage.Client/src/main/resources/avatars/21.jpg b/Mage.Client/src/main/resources/avatars/21.jpg new file mode 100644 index 00000000000..fb5b2744649 Binary files /dev/null and b/Mage.Client/src/main/resources/avatars/21.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/22.jpg b/Mage.Client/src/main/resources/avatars/22.jpg index e45b888a9ea..12c2a87b7bf 100644 Binary files a/Mage.Client/src/main/resources/avatars/22.jpg and b/Mage.Client/src/main/resources/avatars/22.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/23.jpg b/Mage.Client/src/main/resources/avatars/23.jpg index d7fcc94512b..64459f61716 100644 Binary files a/Mage.Client/src/main/resources/avatars/23.jpg and b/Mage.Client/src/main/resources/avatars/23.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/57.jpg b/Mage.Client/src/main/resources/avatars/24.jpg similarity index 100% rename from Mage.Client/src/main/resources/avatars/57.jpg rename to Mage.Client/src/main/resources/avatars/24.jpg diff --git a/Mage.Client/src/main/resources/avatars/25.jpg b/Mage.Client/src/main/resources/avatars/25.jpg index 75b41b0ce63..68b2b338648 100644 Binary files a/Mage.Client/src/main/resources/avatars/25.jpg and b/Mage.Client/src/main/resources/avatars/25.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/62.jpg b/Mage.Client/src/main/resources/avatars/26.jpg similarity index 100% rename from Mage.Client/src/main/resources/avatars/62.jpg rename to Mage.Client/src/main/resources/avatars/26.jpg diff --git a/Mage.Client/src/main/resources/avatars/66.jpg b/Mage.Client/src/main/resources/avatars/27.jpg similarity index 100% rename from Mage.Client/src/main/resources/avatars/66.jpg rename to Mage.Client/src/main/resources/avatars/27.jpg diff --git a/Mage.Client/src/main/resources/avatars/71.jpg b/Mage.Client/src/main/resources/avatars/28.jpg similarity index 100% rename from Mage.Client/src/main/resources/avatars/71.jpg rename to Mage.Client/src/main/resources/avatars/28.jpg diff --git a/Mage.Client/src/main/resources/avatars/29.jpg b/Mage.Client/src/main/resources/avatars/29.jpg index 12905b63ec3..ee79324b94d 100644 Binary files a/Mage.Client/src/main/resources/avatars/29.jpg and b/Mage.Client/src/main/resources/avatars/29.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/30.jpg b/Mage.Client/src/main/resources/avatars/30.jpg index d02ccd4c29d..cf70d9b85e8 100644 Binary files a/Mage.Client/src/main/resources/avatars/30.jpg and b/Mage.Client/src/main/resources/avatars/30.jpg differ diff --git a/Mage.Client/src/main/resources/avatars/77.jpg b/Mage.Client/src/main/resources/avatars/31.jpg similarity index 100% rename from Mage.Client/src/main/resources/avatars/77.jpg rename to Mage.Client/src/main/resources/avatars/31.jpg diff --git a/Mage.Client/src/main/resources/avatars/9.jpg b/Mage.Client/src/main/resources/avatars/32.jpg similarity index 100% rename from Mage.Client/src/main/resources/avatars/9.jpg rename to Mage.Client/src/main/resources/avatars/32.jpg diff --git a/Mage.Client/src/main/resources/avatars/39.jpg b/Mage.Client/src/main/resources/avatars/39.jpg deleted file mode 100644 index bbffc049eea..00000000000 Binary files a/Mage.Client/src/main/resources/avatars/39.jpg and /dev/null differ diff --git a/Mage.Client/src/main/resources/avatars/51.jpg b/Mage.Client/src/main/resources/avatars/51.jpg deleted file mode 100644 index 7ce97fc81e3..00000000000 Binary files a/Mage.Client/src/main/resources/avatars/51.jpg and /dev/null differ diff --git a/Mage.Client/src/main/resources/avatars/52.jpg b/Mage.Client/src/main/resources/avatars/52.jpg deleted file mode 100644 index 12c2a87b7bf..00000000000 Binary files a/Mage.Client/src/main/resources/avatars/52.jpg and /dev/null differ diff --git a/Mage.Client/src/main/resources/avatars/53.jpg b/Mage.Client/src/main/resources/avatars/53.jpg deleted file mode 100644 index 64459f61716..00000000000 Binary files a/Mage.Client/src/main/resources/avatars/53.jpg and /dev/null differ diff --git a/Mage.Client/src/main/resources/avatars/6.jpg b/Mage.Client/src/main/resources/avatars/6.jpg deleted file mode 100644 index 68b2b338648..00000000000 Binary files a/Mage.Client/src/main/resources/avatars/6.jpg and /dev/null differ diff --git a/Mage.Client/src/main/resources/avatars/72.jpg b/Mage.Client/src/main/resources/avatars/72.jpg deleted file mode 100644 index ee79324b94d..00000000000 Binary files a/Mage.Client/src/main/resources/avatars/72.jpg and /dev/null differ diff --git a/Mage.Client/src/main/resources/avatars/75.jpg b/Mage.Client/src/main/resources/avatars/75.jpg deleted file mode 100644 index cf70d9b85e8..00000000000 Binary files a/Mage.Client/src/main/resources/avatars/75.jpg and /dev/null differ diff --git a/Mage.Client/src/main/resources/avatars/special/21.gif b/Mage.Client/src/main/resources/avatars/special/21.gif new file mode 100644 index 00000000000..5de3fb6134a Binary files /dev/null and b/Mage.Client/src/main/resources/avatars/special/21.gif differ diff --git a/Mage.Client/src/main/resources/card-pictures-tok.txt b/Mage.Client/src/main/resources/card-pictures-tok.txt index 9cf60742b90..cdd9a2fa5cb 100644 --- a/Mage.Client/src/main/resources/card-pictures-tok.txt +++ b/Mage.Client/src/main/resources/card-pictures-tok.txt @@ -1,442 +1,601 @@ -#Generate|TOK:MM2|Eldrazi Spawn 1| -#Generate|TOK:MM2|Eldrazi Spawn 2| -#Generate|TOK:MM2|Eldrazi Spawn 3| -#Generate|TOK:MM2|Elephant| -#Generate|TOK:MM2|Faerie Rogue| -#Generate|TOK:MM2|Germ| -#Generate|TOK:MM2|Golem| -#Generate|TOK:MM2|Insect| -#Generate|TOK:MM2|Myr| -#Generate|TOK:MM2|Saproling| -#Generate|TOK:MM2|Snake| -#Generate|TOK:MM2|Soldier| -#Generate|TOK:MM2|Spirit| -#Generate|TOK:MM2|Thrull| -#Generate|TOK:MM2|Wolf| -#Generate|TOK:MM2|Wurm| +|Generate|TOK:C15|Angel|| +|Generate|TOK:C15|Bear|| +|Generate|TOK:C15|Beast|| +|Generate|TOK:C15|Cat|| +|Generate|TOK:C15|Dragon|| +|Generate|TOK:C15|Drake|| +|Generate|TOK:C15|Elemental Shaman|| +|Generate|TOK:C15|Elemental|| +|Generate|TOK:C15|Elephant|| +|Generate|TOK:C15|Frog Lizard|| +|Generate|TOK:C15|Germ|| +|Generate|TOK:C15|Gold|| +|Generate|TOK:C15|Knight|1| +|Generate|TOK:C15|Knight|2| +|Generate|TOK:C15|Lightning Rager|| +|Generate|TOK:C15|Saproling|| +|Generate|TOK:C15|Shapeshifter|| +|Generate|TOK:C15|Snake|1| +|Generate|TOK:C15|Snake|2| +|Generate|TOK:C15|Spider|| +|Generate|TOK:C15|Spirit|1| +|Generate|TOK:C15|Spirit|2| +|Generate|TOK:C15|Wolf|| +|Generate|TOK:C15|Zombie|| -#Generate|TOK:TPR|Goblin| -#Generate|TOK:TPR|Pegasus| -#Generate|TOK:TPR|Rat| -#Generate|TOK:TPR|Reflection| -#Generate|TOK:TPR|Saproling| -#Generate|TOK:TPR|Sliver| -#Generate|TOK:TPR|Spike| -#Generate|TOK:TPR|Spirit| -#Generate|TOK:TPR|Thopter| -#Generate|TOK:TPR|Zombie| +|Generate|TOK:BFZ|Dragon|| +|Generate|TOK:BFZ|Eldrazi|| +|Generate|TOK:BFZ|Eldrazi Scion|1| +|Generate|TOK:BFZ|Eldrazi Scion|2| +|Generate|TOK:BFZ|Eldrazi Scion|3| +|Generate|TOK:BFZ|Elemental|1| +|Generate|TOK:BFZ|Elemental|2| +|Generate|TOK:BFZ|Knight Ally|| +|Generate|TOK:BFZ|Kor Ally|| +|Generate|TOK:BFZ|Octopus|| +|Generate|TOK:BFZ|Plant|| +|Generate|EMBLEM!:BFZ|Emblem Gideon, Ally of Zendikar|| +|Generate|EMBLEM!:BFZ|Emblem Kiora, Master of the Depths|| +|Generate|EMBLEM!:BFZ|Emblem Ob Nixilis Reignited|| -#|Generate|TOK:ORI|Ashaya, the Awoken World| -#|Generate|TOK:ORI|Angel| -#|Generate|TOK:ORI|Demon| -#|Generate|TOK:ORI|Elemental| -#|Generate|TOK:ORI|Elf Warrior| -#|Generate|TOK:ORI|Goblin| -#|Generate|TOK:ORI|Knight| -#|Generate|TOK:ORI|Soldier| -#|Generate|TOK:ORI|Thopter 1| -#|Generate|TOK:ORI|Thopter 2| -#|Generate|TOK:ORI|Zombie| -#|Generate|EMBLEM!:ORI|Emblem Chandra, Roaring Flame| -#|Generate|EMBLEM!:ORI|Emblem Jace, Telepath Unbound| -#|Generate|EMBLEM!:ORI|Emblem Liliana, Defiant Necromancer| +|Generate|TOK:DDP|Eldrazi Spawn|1| +|Generate|TOK:DDP|Eldrazi Spawn|2| +|Generate|TOK:DDP|Eldrazi Spawn|3| +|Generate|TOK:DDP|Hellion|| +|Generate|TOK:DDP|Plant|| -#|Generate|TOK:PTC|Angel| -#|Generate|TOK:PTC|Avatar| -#|Generate|TOK:PTC|Beast| -#|Generate|TOK:PTC|Dragon| -#|Generate|TOK:PTC|Elemental| -#|Generate|TOK:PTC|Harpy| -#|Generate|TOK:PTC|Hippo| -#|Generate|TOK:PTC|Soldier| -#|Generate|TOK:PTC|Wolf| -#|Generate|TOK:PTC|Wurm| +|Generate|TOK:MM2|Eldrazi Spawn|1| +|Generate|TOK:MM2|Eldrazi Spawn|2| +|Generate|TOK:MM2|Eldrazi Spawn|3| +|Generate|TOK:MM2|Elephant|| +|Generate|TOK:MM2|Faerie Rogue|| +|Generate|TOK:MM2|Germ|| +|Generate|TOK:MM2|Golem|| +|Generate|TOK:MM2|Insect|| +|Generate|TOK:MM2|Myr|| +|Generate|TOK:MM2|Saproling|| +|Generate|TOK:MM2|Snake|| +|Generate|TOK:MM2|Soldier|| +|Generate|TOK:MM2|Spirit|| +|Generate|TOK:MM2|Thrull|| +|Generate|TOK:MM2|Wolf|| +|Generate|TOK:MM2|Worm|| -#|Generate|TOK:DTK|Djinn Monk| -#|Generate|TOK:DTK|Dragon| -#|Generate|TOK:DTK|Goblin| -#|Generate|TOK:DTK|Morph| -#|Generate|TOK:DTK|Warrior| -#|Generate|TOK:DTK|Zombie| -#|Generate|TOK:DTK|Zombie Horror| -#|Generate|EMBLEM!:DTK|Emblem Narset Transcendent| +#Generate|TOK:TPR|Goblin|| +#Generate|TOK:TPR|Pegasus|| +#Generate|TOK:TPR|Rat|| +#Generate|TOK:TPR|Reflection|| +#Generate|TOK:TPR|Saproling|| +#Generate|TOK:TPR|Sliver|| +#Generate|TOK:TPR|Spike|| +#Generate|TOK:TPR|Spirit|| +#Generate|TOK:TPR|Thopter|| +#Generate|TOK:TPR|Zombie|| -#|Generate|TOK:GRC|Bird| -#|Generate|TOK:GRC|Golem| -#|Generate|TOK:GRC|Human| -#|Generate|TOK:GRC|Myr| -#|Generate|TOK:GRC|Saproling| +|Generate|TOK:ORI|Ashaya, the Awoken World|| +|Generate|TOK:ORI|Angel|| +|Generate|TOK:ORI|Demon|| +|Generate|TOK:ORI|Elemental|| +|Generate|TOK:ORI|Elf Warrior|| +|Generate|TOK:ORI|Goblin|| +|Generate|TOK:ORI|Knight|| +|Generate|TOK:ORI|Soldier|| +|Generate|TOK:ORI|Thopter|1| +|Generate|TOK:ORI|Thopter|2| +|Generate|TOK:ORI|Zombie|| +|Generate|EMBLEM!:ORI|Emblem Chandra, Roaring Flame|| +|Generate|EMBLEM!:ORI|Emblem Jace, Telepath Unbound|| +|Generate|EMBLEM!:ORI|Emblem Liliana, Defiant Necromancer|| -#|Generate|TOK:MBP:Beast| -#|Generate|TOK:MBP|Cat| -#|Generate|TOK:MBP|Dragon| -#|Generate|TOK:MBP|Elephant| -#|Generate|TOK:MBP|Goblin| -#|Generate|TOK:MBP|Zombie| +#|Generate|TOK:PTC|Angel|| +#|Generate|TOK:PTC|Avatar|| +#|Generate|TOK:PTC|Beast|| +#|Generate|TOK:PTC|Dragon|| +#|Generate|TOK:PTC|Elemental|| +#|Generate|TOK:PTC|Harpy|| +#|Generate|TOK:PTC|Hippo|| +#|Generate|TOK:PTC|Soldier|| +#|Generate|TOK:PTC|Wolf|| +#|Generate|TOK:PTC|Wurm|| -#|Generate|TOK:MLP|Thopter| +|Generate|TOK:DTK|Djinn Monk|| +|Generate|TOK:DTK|Dragon|| +|Generate|TOK:DTK|Goblin|| +|Generate|TOK:DTK|Morph|| +|Generate|TOK:DTK|Warrior|| +|Generate|TOK:DTK|Zombie|| +|Generate|TOK:DTK|Zombie Horror|| +|Generate|EMBLEM!:DTK|Emblem Narset|| -#|Generate|TOK:WMCQ|Angel| +|Generate|TOK:DDO|Soldier|| +|Generate|TOK:DDO|Kraken|| -#|Generate|TOK:GPX|Elephant| -#|Generate|TOK:GPX|Germ| +|Generate|TOK:FRF|Monk|1| +|Generate|TOK:FRF|Monk|2| +|Generate|TOK:FRF|Spirit|| +|Generate|TOK:FRF|Warrior|| +|Generate|TOK:FRF|Manifest|| -#|Generate|TOK:JR|Angel| -#|Generate|TOK:JR|Faerie Rogue| -#|Generate|TOK:JR|Soldier| -#|Generate|TOK:JR|Squirrel| +#|Generate|TOK:GRC|Bird|| +#|Generate|TOK:GRC|Golem|| +#|Generate|TOK:GRC|Human|| +#|Generate|TOK:GRC|Myr|| +#|Generate|TOK:GRC|Saproling|| -#|Generate|TOK:MGDC|Centaur| -#|Generate|TOK:MGDC|Knight| -#|Generate|TOK:MGDC|Rhino| -#|Generate|TOK:MGDC|Sliver| +#|Generate|TOK:MBP:Beast|| +#|Generate|TOK:MBP|Cat|| +#|Generate|TOK:MBP|Dragon|| +#|Generate|TOK:MBP|Elephant|| +#|Generate|TOK:MBP|Goblin|| +#|Generate|TOK:MBP|Zombie|| -#|Generate|TOK:FNMP|Centaur| -|Generate|TOK:FNMP|Human| -|Generate|TOK:FNMP|Wolf| -#|Generate|TOK:FNMP|Wurm| +#|Generate|TOK:MLP|Thopter|| -|Generate|TOK:DDN|Goblin| +#|Generate|TOK:WMCQ|Angel|| -#|Generate|TOK:KTK|Bear| -#|Generate|TOK:KTK|Bird| -#|Generate|TOK:KTK|Goblin| -#|Generate|TOK:KTK|Morph| -#|Generate|TOK:KTK|Snake| -#|Generate|TOK:KTK|Spirit Warrior| -#|Generate|TOK:KTK|Spirit| -#|Generate|TOK:KTK|Vampire| -#|Generate|TOK:KTK|Warrior 1| -#|Generate|TOK:KTK|Warrior 2| -#|Generate|TOK:KTK|Zombie| -#|Generate|EMBLEM!:KTK|Emblem Sarkhan, the Dragonspeaker| -#|Generate|EMBLEM!:KTK|Emblem Sorin, Solemn Visitor| +#|Generate|TOK:GPX|Elephant|| +#|Generate|TOK:GPX|Germ|| -|Generate|TOK:M15|Sliver| -|Generate|TOK:M15|Soldier| -|Generate|TOK:M15|Zombie| -|Generate|TOK:M15|Goblin| -|Generate|TOK:M15|Beast 1| -|Generate|TOK:M15|Insect| -|Generate|TOK:M15|Spirit| -|Generate|TOK:M15|Squid| -|Generate|TOK:M15|Beast 2| -|Generate|TOK:M15|Dragon| -|Generate|TOK:M15|Treefolk Warrior| -|Generate|TOK:M15|Land Mine| -|Generate|EMBLEM!:M15|Emblem Ajani| -|Generate|EMBLEM!:M15|Emblem Garruk| +#|Generate|TOK:JR|Angel|| +#|Generate|TOK:JR|Faerie Rogue|| +#|Generate|TOK:JR|Soldier|| +#|Generate|TOK:JR|Squirrel|| -|Generate|TOK:CNS|Zombie| -|Generate|TOK:CNS|Spirit| -|Generate|TOK:CNS|Demon| -|Generate|TOK:CNS|Ogre| -|Generate|TOK:CNS|Elephant| -|Generate|TOK:CNS|Squirrel| -|Generate|TOK:CNS|Wolf| -|Generate|TOK:CNS|Construct| -|Generate|EMBLEM!:CNS|Emblem Dack Fayden| +#|Generate|TOK:MGDC|Centaur|| +#|Generate|TOK:MGDC|Knight|| +#|Generate|TOK:MGDC|Rhino|| +#|Generate|TOK:MGDC|Sliver|| -|Generate|TOK:JOU|Sphinx| -|Generate|TOK:JOU|Zombie| -|Generate|TOK:JOU|Minotaur| -|Generate|TOK:JOU|Hydra| -|Generate|TOK:JOU|Spider| -|Generate|TOK:JOU|Snake| +#|Generate|TOK:FNMP|Centaur|| +|Generate|TOK:FNMP|Human|| +|Generate|TOK:FNMP|Wolf|| +#|Generate|TOK:FNMP|Wurm|| -|Generate|TOK:DDM|Assassin| +|Generate|TOK:DD3D|Elemental Shaman|| -|Generate|TOK:BNG|Bird 1| -|Generate|TOK:BNG|Cat Soldier| -|Generate|TOK:BNG|Soldier| -|Generate|TOK:BNG|Bird 2| -|Generate|TOK:BNG|Kraken| -|Generate|TOK:BNG|Zombie| -|Generate|TOK:BNG|Elemental| -|Generate|TOK:BNG|Centaur| -|Generate|TOK:BNG|Wolf| -|Generate|TOK:BNG|Gold| -|Generate|EMBLEM:BNG|Kiora, the Crashing Wave| +|Generate|TOK:DD3C|Beast|1| +|Generate|TOK:DD3C|Beast|2| +|Generate|TOK:DD3C|Elephant|| +|Generate|TOK:DD3C|Bat|| -|Generate|TOK:M14|Sliver| -|Generate|TOK:M14|Angel| -|Generate|TOK:M14|Cat| -|Generate|TOK:M14|Goat| -|Generate|TOK:M14|Zombie| -|Generate|TOK:M14|Dragon| -|Generate|TOK:M14|Elemental 1| -|Generate|TOK:M14|Elemental 2| -|Generate|TOK:M14|Beast| -|Generate|TOK:M14|Saproling| -|Generate|TOK:M14|Wolf| -|Generate|EMBLEM:M14|Liliana of the Dark Realms| -|Generate|EMBLEM:M14|Garruk, Caller of Beasts| +|Generate|TOK:DD3B|Elemental|| +|Generate|TOK:DD3B|Elf Warrior|| +|Generate|TOK:|DD3B|Goblin|| -|Generate|TOK:THS|Cleric| -|Generate|TOK:THS|Soldier 1| -|Generate|TOK:THS|Soldier 2| -|Generate|TOK:THS|Bird| -|Generate|TOK:THS|Elemental| -|Generate|TOK:THS|Harpy| -|Generate|TOK:THS|Soldier 3| -|Generate|TOK:THS|Boar| -|Generate|TOK:THS|Satyr| -|Generate|TOK:THS|Golem| -|Generate|EMBLEM-:THS|Elspeth, Suns Champion| +|Generate|TOK:DD3A|Spirit|| +|Generate|TOK:DD3A|Demon|| +|Generate|TOK:DD3A|Thrull|| -|Generate|TOK:DDL|Griffin| -|Generate|TOK:DDL|Beast| +|Generate|TOK:C14|Angel|| +|Generate|TOK:C14|Cat|| +|Generate|TOK:C14|Goat|| +|Generate|TOK:C14|Kor Soldier|| +|Generate|TOK:C14|Pegasus|| +|Generate|TOK:C14|Soldier|| +|Generate|TOK:C14|Spirit|| +|Generate|TOK:C14|Fish|| +|Generate|TOK:C14|Kraken|| +|Generate|TOK:C14|Whale|| +|Generate|TOK:C14|Zombie|1| +|Generate|TOK:C14|Demon|1| +|Generate|TOK:C14|Demon|2| +|Generate|TOK:C14|Germ|| +|Generate|TOK:C14|Horror|| +|Generate|TOK:C14|Zombie|2| +|Generate|TOK:C14|Goblin|| +|Generate|TOK:C14|Ape|| +|Generate|TOK:C14|Beast|1| +|Generate|TOK:C14|Beast|2| +|Generate|TOK:C14|Elemental|| +|Generate|TOK:C14|Elephant|| +|Generate|TOK:C14|Elf Druid|| +|Generate|TOK:C14|Elf Warrior|| +|Generate|TOK:C14|Treefolk|| +|Generate|TOK:C14|Wolf|| +|Generate|TOK:C14|Gargoyle|| +|Generate|TOK:C14|Myr|| +|Generate|TOK:C14|Pentavite|| +|Generate|TOK:C14|Stoneforged Blade|| +|Generate|TOK:C14|Tuktuk the Returned|| +|Generate|TOK:C14|Wurm|1| +|Generate|TOK:C14|Wurm|2| +|Generate|EMBLEM!:C14|Emblem Teferi| +|Generate|EMBLEM!:C14|Emblem Nixilis| +|Generate|EMBLEM!:C14|Emblem Daretti| -|Generate|TOK:MMA|Giant Warrior| -|Generate|TOK:MMA|Kithkin Soldier| -|Generate|TOK:MMA|Soldier| -|Generate|TOK:MMA|Illusion| -|Generate|TOK:MMA|Bat| -|Generate|TOK:MMA|Goblin Rogue| -|Generate|TOK:MMA|Spider| -|Generate|TOK:MMA|Zombie| -|Generate|TOK:MMA|Dragon| -|Generate|TOK:MMA|Goblin| -|Generate|TOK:MMA|Elemental| -|Generate|TOK:MMA|Saproling| -|Generate|TOK:MMA|Treefolk Shaman| -|Generate|TOK:MMA|Faerie Rogue| -|Generate|TOK:MMA|Worm| -|Generate|EMBLEM:MMA|Elspeth, Knight Errant| +|Generate|TOK:DDN|Goblin|| -|Generate|TOK:DGM|Elemental| +|Generate|TOK:KTK|Bear|| +|Generate|TOK:KTK|Bird|| +|Generate|TOK:KTK|Goblin|| +|Generate|TOK:KTK|Morph|| +|Generate|TOK:KTK|Snake|| +|Generate|TOK:KTK|Spirit Warrior|| +|Generate|TOK:KTK|Spirit|| +|Generate|TOK:KTK|Vampire|| +|Generate|TOK:KTK|Warrior|1| +|Generate|TOK:KTK|Warrior|2| +|Generate|TOK:KTK|Warrior|3| +|Generate|TOK:KTK|Zombie|| +|Generate|EMBLEM!:KTK|Emblem Sarkhan|| +|Generate|EMBLEM!:KTK|Emblem Sorin|| -|Generate|TOK:DDK|Spirit| +|Generate|TOK:M15|Sliver|| +|Generate|TOK:M15|Soldier|| +|Generate|TOK:M15|Zombie|| +|Generate|TOK:M15|Goblin|| +|Generate|TOK:M15|Beast|1| +|Generate|TOK:M15|Insect|| +|Generate|TOK:M15|Spirit|| +|Generate|TOK:M15|Squid|1| +|Generate|TOK:M15|Squid|2| +|Generate|TOK:M15|Wolf|| +|Generate|TOK:M15|Beast|2| +|Generate|TOK:M15|Dragon|| +|Generate|TOK:M15|Treefolk Warrior|| +|Generate|TOK:M15|Land Mine|| +|Generate|EMBLEM!:M15|Emblem Ajani|| +|Generate|EMBLEM!:M15|Emblem Garruk|| -|Generate|TOK:GTC|Angel| -|Generate|TOK:GTC|Rat| -|Generate|TOK:GTC|Frog Lizard| -|Generate|TOK:GTC|Cleric| -|Generate|TOK:GTC|Horror| -|Generate|TOK:GTC|Soldier| -|Generate|TOK:GTC|Spirit| -|Generate|EMBLEM:GTC|Domri Rade| +|Generate|TOK:CNS|Zombie|| +|Generate|TOK:CNS|Spirit|| +|Generate|TOK:CNS|Demon|| +|Generate|TOK:CNS|Ogre|| +|Generate|TOK:CNS|Elephant|| +|Generate|TOK:CNS|Squirrel|| +|Generate|TOK:CNS|Wolf|| +|Generate|TOK:CNS|Construct|| +|Generate|EMBLEM!:CNS|Emblem Dack Fayden|| -|Generate|TOK:RTR|Bird| -|Generate|TOK:RTR|Knight| -|Generate|TOK:RTR|Soldier| -|Generate|TOK:RTR|Assassin| -|Generate|TOK:RTR|Dragon| -|Generate|TOK:RTR|Goblin| -|Generate|TOK:RTR|Centaur 1| -|Generate|TOK:RTR|Ooze| -|Generate|TOK:RTR|Rhino| -|Generate|TOK:RTR|Saproling| -|Generate|TOK:RTR|Wurm| -|Generate|TOK:RTR|Elemental| -|Generate|TOK:RTR|Centaur 2| +|Generate|TOK:JOU|Sphinx|| +|Generate|TOK:JOU|Zombie|| +|Generate|TOK:JOU|Minotaur|1| +|Generate|TOK:JOU|Minotaur|2| +|Generate|TOK:JOU|Hydra|| +|Generate|TOK:JOU|Spider|| +|Generate|TOK:JOU|Snake|| -|Generate|EMBLEM-:M13|Liliana of the Dark Realms| +|Generate|TOK:DDM|Assassin|| -|Generate|TOK:DDJ|Saproling| +|Generate|TOK:BNG|Bird|1| +|Generate|TOK:BNG|Cat Soldier|| +|Generate|TOK:BNG|Soldier|1| +|Generate|TOK:BNG|Soldier|2| +|Generate|TOK:BNG|Bird|2| +|Generate|TOK:BNG|Kraken|| +|Generate|TOK:BNG|Zombie|| +|Generate|TOK:BNG|Elemental|| +|Generate|TOK:BNG|Centaur|| +|Generate|TOK:BNG|Wolf|| +|Generate|TOK:BNG|Gold|| +|Generate|EMBLEM:BNG|Kiora, the Crashing Wave|| -|Generate|TOK:M13|Cat| -|Generate|TOK:M13|Goat| -|Generate|TOK:M13|Soldier| -|Generate|TOK:M13|Drake| -|Generate|TOK:M13|Zombie| -|Generate|TOK:M13|Goblin| -|Generate|TOK:M13|Hellion| -|Generate|TOK:M13|Beast| -|Generate|TOK:M13|Saproling| -|Generate|TOK:M13|Wurm| +|Generate|TOK:THS|Cleric|| +|Generate|TOK:THS|Soldier|1| +|Generate|TOK:THS|Soldier|2| +|Generate|TOK:THS|Soldier|3| +|Generate|TOK:THS|Bird|| +|Generate|TOK:THS|Elemental|| +|Generate|TOK:THS|Harpy|| +|Generate|TOK:THS|Soldier|3| +|Generate|TOK:THS|Boar|| +|Generate|TOK:THS|Satyr|| +|Generate|TOK:THS|Golem|1| +|Generate|TOK:THS|Golem|2| +|Generate|EMBLEM-:THS|Elspeth, Suns Champion|| -|Generate|EMBLEM:AVR|Tamiyo, the Moon Sage| +|Generate|TOK:M14|Sliver|1| +|Generate|TOK:M14|Sliver|2| +|Generate|TOK:M14|Angel|| +|Generate|TOK:M14|Cat|| +|Generate|TOK:M14|Goat|| +|Generate|TOK:M14|Zombie|| +|Generate|TOK:M14|Dragon|| +|Generate|TOK:M14|Elemental|1| +|Generate|TOK:M14|Elemental|2| +|Generate|TOK:M14|Beast|| +|Generate|TOK:M14|Saproling|| +|Generate|TOK:M14|Wolf|| +|Generate|EMBLEM:M14|Liliana of the Dark Realms|| +|Generate|EMBLEM:M14|Garruk, Caller of Beasts|| -|Generate|TOK:AVR|Angel| -|Generate|TOK:AVR|Human 1| -|Generate|TOK:AVR|Spirit 1| -|Generate|TOK:AVR|Spirit 2| -|Generate|TOK:AVR|Demon| -|Generate|TOK:AVR|Zombie| -|Generate|TOK:AVR|Human 2| +|Generate|TOK:DDL|Griffin|| +|Generate|TOK:DDL|Beast|| -|Generate|EMBLEM:DDI|Venser, the Sojourner| -|Generate|EMBLEM:DDI|Koth of the Hammer| +|Generate|TOK:MMA|Giant Warrior|| +|Generate|TOK:MMA|Kithkin Soldier|| +|Generate|TOK:MMA|Soldier|| +|Generate|TOK:MMA|Illusion|| +|Generate|TOK:MMA|Bat|| +|Generate|TOK:MMA|Goblin Rogue|| +|Generate|TOK:MMA|Spider|| +|Generate|TOK:MMA|Zombie|| +|Generate|TOK:MMA|Dragon|| +|Generate|TOK:MMA|Goblin|| +|Generate|TOK:MMA|Elemental|| +|Generate|TOK:MMA|Saproling|| +|Generate|TOK:MMA|Treefolk Shaman|| +|Generate|TOK:MMA|Faerie Rogue|| +|Generate|TOK:MMA|Worm|| +|Generate|EMBLEM:MMA|Elspeth, Knight Errant|| -|Generate|TOK:DKA|Human| -|Generate|TOK:DKA|Vampire| +|Generate|TOK:DGM|Elemental|| +|Generate|TOK:DGM|Bird|| -|Generate|TOK:ISD|Angel| -|Generate|TOK:ISD|Spirit| -|Generate|TOK:ISD|Homunculus| -|Generate|TOK:ISD|Demon| -|Generate|TOK:ISD|Vampire| -|Generate|TOK:ISD|Wolf 1| -|Generate|TOK:ISD|Zombie 1| -|Generate|TOK:ISD|Zombie 2| -|Generate|TOK:ISD|Zombie 3| -|Generate|TOK:ISD|Ooze| -|Generate|TOK:ISD|Spider| -|Generate|TOK:ISD|Wolf 2| +|Generate|TOK:DDK|Spirit|| -|Generate|TOK:DDH|Griffin| -|Generate|TOK:DDH|Saproling| +|Generate|TOK:GTC|Angel|| +|Generate|TOK:GTC|Rat|| +|Generate|TOK:GTC|Frog Lizard|| +|Generate|TOK:GTC|Cleric|| +|Generate|TOK:GTC|Horror|| +|Generate|TOK:GTC|Soldier|1| +|Generate|TOK:GTC|Soldier|2| +|Generate|TOK:GTC|Spirit|| +|Generate|EMBLEM:GTC|Domri Rade|| -|Generate|TOK:M12|Bird| -|Generate|TOK:M12|Soldier| -|Generate|TOK:M12|Zombie| -|Generate|TOK:M12|Beast| -|Generate|TOK:M12|Saproling| -|Generate|TOK:M12|Wurm| -|Generate|TOK:M12|Pentavite| +|Generate|TOK:RTR|Bird|| +|Generate|TOK:RTR|Knight|1| +|Generate|TOK:RTR|Knight|2| +|Generate|TOK:RTR|Soldier|| +|Generate|TOK:RTR|Assassin|| +|Generate|TOK:RTR|Dragon|| +|Generate|TOK:RTR|Goblin|| +|Generate|TOK:RTR|Centaur|1| +|Generate|TOK:RTR|Centaur|2| +|Generate|TOK:RTR|Ooze|| +|Generate|TOK:RTR|Rhino|| +|Generate|TOK:RTR|Saproling|| +|Generate|TOK:RTR|Wurm|| +|Generate|TOK:RTR|Elemental|| -|Generate|TOK:NPH|Beast| -|Generate|TOK:NPH|Beast| -|Generate|TOK:NPH|Goblin| -|Generate|TOK:NPH|Golem| -|Generate|TOK:NPH|Myr| +|Generate|TOK:DDJ|Saproling|| -|Generate|TOK:DDG|Goblin| +|Generate|EMBLEM-:M13|Liliana of the Dark Realms|| +|Generate|TOK:M13|Cat|| +|Generate|TOK:M13|Goat|| +|Generate|TOK:M13|Soldier|| +|Generate|TOK:M13|Drake|| +|Generate|TOK:M13|Zombie|| +|Generate|TOK:M13|Goblin|1| +|Generate|TOK:M13|Goblin|2| +|Generate|TOK:M13|Hellion|| +|Generate|TOK:M13|Beast|| +|Generate|TOK:M13|Saproling|| +|Generate|TOK:M13|Wurm|| -|Generate|TOK:MBS|Germ| -|Generate|TOK:MBS|Zombie| -|Generate|TOK:MBS|Golem| -|Generate|TOK:MBS|Horror| -|Generate|TOK:MBS|Thopter| -|Generate|TOK:MBS|Zombie| -|Generate|TOK:MBS|Zombie| +|Generate|EMBLEM:AVR|Tamiyo, the Moon Sage|| +|Generate|TOK:AVR|Angel|1| +|Generate|TOK:AVR|Angel|2| +|Generate|TOK:AVR|Angel|3| +|Generate|TOK:AVR|Human|1| +|Generate|TOK:AVR|Human|2| +|Generate|TOK:AVR|Spirit|1| +|Generate|TOK:AVR|Spirit|2| +|Generate|TOK:AVR|Demon|1| +|Generate|TOK:AVR|Demon|2| +|Generate|TOK:AVR|Demon|3| +|Generate|TOK:AVR|Zombie|| -|Generate|TOK:DDF|Soldier| +|Generate|EMBLEM:DDI|Venser, the Sojourner|| +|Generate|EMBLEM:DDI|Koth of the Hammer|| -|Generate|TOK:SOM|Cat| -|Generate|TOK:SOM|Soldier| -|Generate|TOK:SOM|Goblin| -|Generate|TOK:SOM|Insect| -|Generate|TOK:SOM|Wolf| -|Generate|TOK:SOM|Golem| -|Generate|TOK:SOM|Myr| -|Generate|TOK:SOM|Wurm 1| -|Generate|TOK:SOM|Wurm 2| +|Generate|TOK:DKA|Human|| +|Generate|TOK:DKA|Vampire|| +|Generate|EMBLEM:DKA|Sorin, Lord of Innistrad| -|Generate|TOK:M11|Avatar| -|Generate|TOK:M11|Bird| -|Generate|TOK:M11|Zombie| -|Generate|TOK:M11|Beast| -|Generate|TOK:M11|Ooze 1| -|Generate|TOK:M11|Ooze 2| +|Generate|TOK:ISD|Angel|| +|Generate|TOK:ISD|Spirit|| +|Generate|TOK:ISD|Homunculus|| +|Generate|TOK:ISD|Demon|| +|Generate|TOK:ISD|Vampire|| +|Generate|TOK:ISD|Wolf|1| +|Generate|TOK:ISD|Zombie|1| +|Generate|TOK:ISD|Zombie|2| +|Generate|TOK:ISD|Zombie|3| +|Generate|TOK:ISD|Ooze|| +|Generate|TOK:ISD|Spider|| +|Generate|TOK:ISD|Wolf|2| -|Generate|TOK:ROE|Eldrazi Spawn 1| -|Generate|TOK:ROE|Eldrazi Spawn 2| -|Generate|TOK:ROE|Eldrazi Spawn 3| -|Generate|TOK:ROE|Elemental| -|Generate|TOK:ROE|Ooze| -|Generate|TOK:ROE|Tuktuk the Returned| +|Generate|TOK:DDH|Griffin|| +|Generate|TOK:DDH|Saproling|| -|Generate|TOK:DDE|Saproling| -|Generate|TOK:DDE|Hornet| -|Generate|TOK:DDE|Minion| +|Generate|TOK:M12|Bird|| +|Generate|TOK:M12|Soldier|| +|Generate|TOK:M12|Zombie|| +|Generate|TOK:M12|Beast|| +|Generate|TOK:M12|Saproling|| +|Generate|TOK:M12|Wurm|| +|Generate|TOK:M12|Pentavite|| -|Generate|TOK:WWK|Soldier Ally| -|Generate|TOK:WWK|Dragon| -|Generate|TOK:WWK|Ogre| -|Generate|TOK:WWK|Elephant| -|Generate|TOK:WWK|Plant| -|Generate|TOK:WWK|Construct| +|Generate|TOK:NPH|Beast|| +|Generate|TOK:NPH|Beast|| +|Generate|TOK:NPH|Goblin|| +|Generate|TOK:NPH|Golem|| +|Generate|TOK:NPH|Myr|| -|Generate|TOK:ZEN|Angel| -|Generate|TOK:ZEN|Bird| -|Generate|TOK:ZEN|Kor Soldier| -|Generate|TOK:ZEN|Illusion| -|Generate|TOK:ZEN|Merfolk| -|Generate|TOK:ZEN|Vampire| -|Generate|TOK:ZEN|Zombie Giant| -|Generate|TOK:ZEN|Elemental| -|Generate|TOK:ZEN|Beast| -|Generate|TOK:ZEN|Snake| -|Generate|TOK:ZEN|Wolf| +|Generate|TOK:DDG|Goblin|| -|Generate|TOK:M10|Avatar| -|Generate|TOK:M10|Beast| -|Generate|TOK:M10|Gargoyle| -|Generate|TOK:M10|Goblin| -|Generate|TOK:M10|Insect| -|Generate|TOK:M10|Soldier| -|Generate|TOK:M10|Wolf| -|Generate|TOK:M10|Zombie| +|Generate|TOK:MBS|Germ|| +|Generate|TOK:MBS|Zombie|| +|Generate|TOK:MBS|Golem|| +|Generate|TOK:MBS|Horror|| +|Generate|TOK:MBS|Thopter|| +|Generate|TOK:MBS|Zombie|| +|Generate|TOK:MBS|Zombie|| -|Generate|TOK:DDD|Beast 1| -|Generate|TOK:DDD|Beast 2| -|Generate|TOK:DDD|Elephant| +|Generate|TOK:DDF|Soldier|| -|Generate|TOK:ARB|Bird Soldier| -|Generate|TOK:ARB|Lizard| -|Generate|TOK:ARB|Dragon| -|Generate|TOK:ARB|Zombie Wizard| +|Generate|TOK:SOM|Cat|| +|Generate|TOK:SOM|Soldier|| +|Generate|TOK:SOM|Goblin|| +|Generate|TOK:SOM|Insect|| +|Generate|TOK:SOM|Wolf|| +|Generate|TOK:SOM|Golem|| +|Generate|TOK:SOM|Myr|| +|Generate|TOK:SOM|Wurm|1| +|Generate|TOK:SOM|Wurm|2| -|Generate|TOK:DDC|Spirit| -|Generate|TOK:DDC|Demon| -|Generate|TOK:DDC|Thrull| +|Generate|TOK:M11|Avatar|| +|Generate|TOK:M11|Bird|| +|Generate|TOK:M11|Zombie|| +|Generate|TOK:M11|Beast|| +|Generate|TOK:M11|Ooze|1| +|Generate|TOK:M11|Ooze|2| -|Generate|TOK:CON|Angel| -|Generate|TOK:CON|Elemental| +|Generate|TOK:ROE|Eldrazi Spawn|1| +|Generate|TOK:ROE|Eldrazi Spawn|2| +|Generate|TOK:ROE|Eldrazi Spawn|3| +|Generate|TOK:ROE|Elemental|| +|Generate|TOK:ROE|Hellion|| +|Generate|TOK:ROE|Ooze|| +|Generate|TOK:ROE|Tuktuk the Returned|| -|Generate|TOK:DD2|Elemental Shaman| +|Generate|TOK:DDE|Saproling|| +|Generate|TOK:DDE|Hornet|| +|Generate|TOK:DDE|Minion|| -|Generate|TOK:ALA|Soldier| -|Generate|TOK:ALA|Beast| -|Generate|TOK:ALA|Homunculus| -|Generate|TOK:ALA|Thopter| -|Generate|TOK:ALA|Skeleton| -|Generate|TOK:ALA|Zombie| -|Generate|TOK:ALA|Dragon| -|Generate|TOK:ALA|Goblin| -|Generate|TOK:ALA|Ooze| -|Generate|TOK:ALA|Saproling| +|Generate|TOK:WWK|Soldier Ally|| +|Generate|TOK:WWK|Dragon|| +|Generate|TOK:WWK|Ogre|| +|Generate|TOK:WWK|Elephant|| +|Generate|TOK:WWK|Plant|| +|Generate|TOK:WWK|Construct|| -|Generate|TOK:EVE|Goat| -|Generate|TOK:EVE|Bird| -|Generate|TOK:EVE|Beast| -|Generate|TOK:EVE|Spirit| -|Generate|TOK:EVE|Elemental| -|Generate|TOK:EVE|Worm| -|Generate|TOK:EVE|Goblin Soldier| +|Generate|TOK:ZEN|Angel|| +|Generate|TOK:ZEN|Bird|| +|Generate|TOK:ZEN|Kor Soldier|| +|Generate|TOK:ZEN|Illusion|| +|Generate|TOK:ZEN|Merfolk|| +|Generate|TOK:ZEN|Vampire|| +|Generate|TOK:ZEN|Zombie Giant|| +|Generate|TOK:ZEN|Elemental|| +|Generate|TOK:ZEN|Beast|| +|Generate|TOK:ZEN|Snake|| +|Generate|TOK:ZEN|Wolf|| -|Generate|TOK:SHM|Kithkin Soldier| -|Generate|TOK:SHM|Spirit| -|Generate|TOK:SHM|Rat| -|Generate|TOK:SHM|Elemental 1| -|Generate|TOK:SHM|Elf Warrior 1| -|Generate|TOK:SHM|Spider| -|Generate|TOK:SHM|Wolf| -|Generate|TOK:SHM|Faerie Rogue| -|Generate|TOK:SHM|Elemental 2| -|Generate|TOK:SHM|Giant Warrior| -|Generate|TOK:SHM|Goblin Warrior| -|Generate|TOK:SHM|Elf Warrior 2| +|Generate|TOK:M10|Avatar|| +|Generate|TOK:M10|Beast|| +|Generate|TOK:M10|Gargoyle|| +|Generate|TOK:M10|Goblin|| +|Generate|TOK:M10|Insect|| +|Generate|TOK:M10|Soldier|| +|Generate|TOK:M10|Wolf|| +|Generate|TOK:M10|Zombie|| -|Generate|TOK:EVG|Elemental| -|Generate|TOK:EVG|Elf Warrior| -|Generate|TOK:EVG|Goblin| +|Generate|TOK:DDD|Beast|1| +|Generate|TOK:DDD|Beast|2| +|Generate|TOK:DDD|Elephant|| -|Generate|TOK:MOR|Giant Warrior| -|Generate|TOK:MOR|Faerie Rogue| -|Generate|TOK:MOR|Treefolk Shaman| +|Generate|TOK:ARB|Bird Soldier|| +|Generate|TOK:ARB|Lizard|| +|Generate|TOK:ARB|Dragon|| +|Generate|TOK:ARB|Zombie Wizard|| -|Generate|TOK:LRW|Avatar| -|Generate|TOK:LRW|Elemental 1| -|Generate|TOK:LRW|Kithkin Soldier| -|Generate|TOK:LRW|Merfolk Wizard| -|Generate|TOK:LRW|Goblin Rogue| -|Generate|TOK:LRW|Elemental Shaman| -|Generate|TOK:LRW|Beast| -|Generate|TOK:LRW|Elemental 2| -|Generate|TOK:LRW|Elf Warrior| -|Generate|TOK:LRW|Wolf| -|Generate|TOK:LRW|Shapeshifter| +|Generate|TOK:DDC|Spirit|| +|Generate|TOK:DDC|Demon|| +|Generate|TOK:DDC|Thrull|| -|Generate|TOK:10E|Soldier| -|Generate|TOK:10E|Zombie| -|Generate|TOK:10E|Dragon| -|Generate|TOK:10E|Goblin| -|Generate|TOK:10E|Saproling| -|Generate|TOK:10E|Wasp| +|Generate|TOK:CON|Angel|| +|Generate|TOK:CON|Elemental|| -|Generate|TOK:CSP|Marit Lage| +|Generate|TOK:DD2|Elemental Shaman|| -|Generate|TOK:CHK|Spirit| \ No newline at end of file +|Generate|TOK:ALA|Soldier|| +|Generate|TOK:ALA|Beast|| +|Generate|TOK:ALA|Homunculus|| +|Generate|TOK:ALA|Thopter|| +|Generate|TOK:ALA|Skeleton|| +|Generate|TOK:ALA|Zombie|| +|Generate|TOK:ALA|Dragon|| +|Generate|TOK:ALA|Goblin|| +|Generate|TOK:ALA|Ooze|| +|Generate|TOK:ALA|Saproling|| + +|Generate|TOK:EVE|Goat|| +|Generate|TOK:EVE|Bird|| +|Generate|TOK:EVE|Beast|| +|Generate|TOK:EVE|Spirit|| +|Generate|TOK:EVE|Elemental|| +|Generate|TOK:EVE|Worm|| +|Generate|TOK:EVE|Goblin Soldier|| + +|Generate|TOK:SHM|Kithkin Soldier|| +|Generate|TOK:SHM|Spirit|| +|Generate|TOK:SHM|Rat|| +|Generate|TOK:SHM|Elemental|1| +|Generate|TOK:SHM|Elf Warrior|1| +|Generate|TOK:SHM|Spider|| +|Generate|TOK:SHM|Wolf|| +|Generate|TOK:SHM|Faerie Rogue|| +|Generate|TOK:SHM|Elemental|2| +|Generate|TOK:SHM|Giant Warrior|| +|Generate|TOK:SHM|Goblin Warrior|| +|Generate|TOK:SHM|Elf Warrior|2| + +|Generate|TOK:EVG|Elemental|| +|Generate|TOK:EVG|Elf Warrior|| +|Generate|TOK:EVG|Goblin|| + +|Generate|TOK:MOR|Giant Warrior|| +|Generate|TOK:MOR|Faerie Rogue|| +|Generate|TOK:MOR|Treefolk Shaman|| + +|Generate|TOK:LRW|Avatar|| +|Generate|TOK:LRW|Elemental|1| +|Generate|TOK:LRW|Kithkin Soldier|| +|Generate|TOK:LRW|Merfolk Wizard|| +|Generate|TOK:LRW|Goblin Rogue|| +|Generate|TOK:LRW|Elemental Shaman|| +|Generate|TOK:LRW|Beast|| +|Generate|TOK:LRW|Elemental|2| +|Generate|TOK:LRW|Elf Warrior|| +|Generate|TOK:LRW|Wolf|| +|Generate|TOK:LRW|Shapeshifter|| + +|Generate|TOK:10E|Soldier|| +|Generate|TOK:10E|Zombie|| +|Generate|TOK:10E|Dragon|| +|Generate|TOK:10E|Goblin|| +|Generate|TOK:10E|Saproling|| +|Generate|TOK:10E|Wasp|| + +|Generate|TOK:CSP|Marit Lage|| + +|Generate|TOK:CHK|Spirit|| +#|Generate|TOK:CHK|Dragon Spirit|| + +#|Generate|TOK:5DN|Kaldra|| + +|Generate|TOK:DST|Beast|| + +|Generate|TOK:MRD|Demon|| +|Generate|TOK:MRD|Myr|| +|Generate|TOK:MRD|Pentavite|| + +|Generate|TOK:8ED|Rukh|| + +|Generate|TOK:SCG|Angel|| + +|Generate|TOK:LGN|Goblin|| +|Generate|TOK:LGN|Sliver|| + +|Generate|TOK:ONS|Bear|| +|Generate|TOK:ONS|Dragon|| +|Generate|TOK:ONS|Insect|| +|Generate|TOK:ONS|Soldier|| + +|Generate|TOK:ODY|Bear|| +|Generate|TOK:ODY|Beast|| +|Generate|TOK:ODY|Elephant|| +|Generate|TOK:ODY|Squirrel|| +|Generate|TOK:ODY|Wurm|| +|Generate|TOK:ODY|Zombie|| + +|Generate|TOK:APC|Goblin Soldier|| + +|Generate|TOK:PLS|Spirit|| + +|Generate|TOK:INV|Bird|| +|Generate|TOK:INV|Elephant|| +|Generate|TOK:INV|Saproling|| \ No newline at end of file diff --git a/Mage.Client/src/main/resources/image.url.properties b/Mage.Client/src/main/resources/image.url.properties index fb9c408f3ab..4d00fec3336 100644 --- a/Mage.Client/src/main/resources/image.url.properties +++ b/Mage.Client/src/main/resources/image.url.properties @@ -64,6 +64,6 @@ ddd=gvl unh=uh dde=pvc # Remove setname as soon as the images can be downloaded -ignore.urls=TOK,MM2,V15,BFZ +ignore.urls=TOK, OGW # sets ordered by release time (newest goes first) -token.lookup.order=BFZ,FVD,FVE,FVL,FVR,V12,V13,V14,V15,TPR,MPRP,DD3,DDO,ORI,MM2,PTC,DTK,FRF,KTK,M15,VMA,CNS,JOU,BNG,THS,DDL,M14,MMA,DGM,GTC,RTR,M13,AVR,DDI,DKA,ISD,M12,NPH,MBS,SOM,M11,ROE,DDE,WWK,ZEN,M10,GVL,ARB,DVD,CFX,JVC,ALA,EVE,SHM,EVG,MOR,LRW,10E,CLS,CHK,GRC \ No newline at end of file +token.lookup.order=C15,OGW,EXP,DDP,BFZ,FVD,FVE,FVL,FVR,V12,V13,V14,V15,TPR,MPRP,DD3,DDO,ORI,MM2,PTC,DTK,FRF,KTK,M15,VMA,CNS,JOU,BNG,THS,DDL,M14,MMA,DGM,GTC,RTR,M13,AVR,DDI,DKA,ISD,M12,NPH,MBS,SOM,M11,ROE,DDE,WWK,ZEN,M10,GVL,ARB,DVD,CFX,JVC,ALA,EVE,SHM,EVG,MOR,LRW,10E,CLS,CHK,GRC \ No newline at end of file diff --git a/Mage.Client/src/main/resources/tokens-mtg-onl-list.csv b/Mage.Client/src/main/resources/tokens-mtg-onl-list.csv new file mode 100644 index 00000000000..2a64a370e06 --- /dev/null +++ b/Mage.Client/src/main/resources/tokens-mtg-onl-list.csv @@ -0,0 +1,712 @@ +Token name, Number, Color, P/T, Promo, Type, Artist, Text + +UGL - Unglued (1998-08-11) + +Pegasus, 89, W, 1|1, -, Creature - Pegasus, Mark Zug, Flying +Soldier, 90, W, 1|1, -, Creature - Soldier, Daren Bader, - +Zombie, 91, B, 2|2, -, Creature - Zombie, Christopher Rush, - +Goblin, 92, R, 1|1, -, Creature - Goblin, Pete Venters, - +Sheep, 93, G, 1|1, -, Creature - Sheep, Kev Walker, - +Squirrel, 94, G, 1|1, -, Creature - Squirrel, Ron Spencer, - + +ATH - Anthologies (1998-11-01) + +Pegasus, 89, W, 1|1, -, Creature - Pegasus, Mark Zug, Flying +Goblin, 92, R, 1|1, -, Creature - Goblin, Pete Venters, - + +INV - Invasion (2000-10-02) + +Bird, T1, U, 1|1, Player Rewards, Creature - Bird, Michael Sutfin, Flying +Elephant, T2, G, 3|3, Player Rewards, Creature - Elephant, Terese Nielsen, - +Saproling, T3, G, 1|1, Player Rewards, Creature - Saproling, Jeff Laubenstein, - + +PLS - Planeshift (2001-02-05) + +Spirit, T1, W, 1|1, Player Rewards, Creature - Spirit, John Matson, Flying + +APC - Apocalypse (2001-06-04) + +Goblin Soldier, T1, R W, 1|1, Player Rewards, Creature - Goblin Soldier, Ron Spears, - + +ODY - Odyssey (2001-10-01) + +Bear, T1, G, 2|2, Player Rewards, Creature - Bear, Heather Hudson, - +Beast, T2, G, 4|4, Player Rewards, Creature - Beast, Larry Elmore, - +Elephant, T3, G, 3|3, Player Rewards, Creature - Elephant, Arnie Swekel, - +Squirrel, T4, G, 1|1, Player Rewards, Creature - Squirrel, Ron Spencer, - +Wurm, T5, G, 6|6, Player Rewards, Creature - Wurm, Alan Pollack, - +Zombie, T6, B, 2|2, Player Rewards, Creature - Zombie, Dana Knutson, - + +ONS - Onslaught (2002-10-07) + +Bear, T1, G, 2|2, Player Rewards, Creature - Bear, Glen Angus, - +Dragon, T2, R, 5|5, Player Rewards, Creature - Dragon, Glen Angus, Flying +Insect, T3, G, 1|1, Player Rewards, Creature - Insect, Anthony S. Waters, - +Soldier, T4, W, 1|1, Player Rewards, Creature - Soldier, Ron Spencer, - + +LGN - Legions (2003-02-03) + +Goblin, T1, R, 1|1, Player Rewards, Creature - Goblin, Darrell Riche, - +Sliver, T2, -, 1|1, Player Rewards, Creature - Sliver, Tony Szczudlo, - + +SCG - Scourge (2003-05-26) + +Angel, T1, W, 4|4, Player Rewards, Creature - Angel, Scott M. Fischer, Flying + +8ED - Eighth Edition (2003-07-28) + +Rukh, T1, R, 4|4, Player Rewards, Creature - Rukh, Edward P. Beard Jr., Flying + +MRD - Mirrodin (2003-10-02) + +Demon, T1, B, *|*, Player Rewards, Creature - Demon, Pete Venters, - +Myr, T2, -, 1|1, Player Rewards, Creature - Myr, Wayne England, - +Pentavite, T3, -, 1|1, Player Rewards, Artifact Creature - Pentavite, Greg Staples, - + +DST - Darksteel (2004-02-06) + +Beast, T1, G, 3|3, Player Rewards, Creature - Beast, Edward P. Beard Jr., - + +CHK - Champions of Kamigawa (2004-10-01) + +Spirit, T1, -, 1|1, Player Rewards, Creature - Spirit, Hugh Jamieson, - + +CSP - Coldsnap (2006-07-21) + +Marit Lage, T1, B, 20|20, Pre-Release, Creature - Avatar, Stephan Martiniere, Flying indestructible + +10E - Tenth Edition (2007-07-13) + +Soldier, 1, W, 1|1, -, Creature - Soldier, Parente, - +Zombie, 2, B, 2|2, -, Creature - Zombie, Carl Critchlow, - +Dragon, 3, R, 5|5, -, Creature - Dragon, Jim Pavelec, Flying +Goblin, 4, R, 1|1, -, Creature - Goblin, Dave Kendall, - +Saproling, 5, G, 1|1, -, Creature - Saproling, Cyril Van Der Haegen, - +Wasp, 6, -, 1|1, -, Artifact Creature - Insect, Ron Spencer, Flying + +LRW - Lorwyn (2007-10-12) + +Avatar, 1, W, *|*, -, Creature - Avatar, Vance Kovacs, This creature's power and toughness are each equal to your life total. +Elemental, 2, W, 4|4, -, Creature - Elemental, Anthony S. Waters, Flying +Kithkin Soldier, 3, W, 1|1, -, Creature - Kithkin Soldier, Greg Hildebrandt, - +Merfolk Wizard, 4, U, 1|1, -, Creature - Merfolk Wizard, Mark Poole, - +Goblin Rogue, 5, B, 1|1, -, Creature - Goblin Rogue, Richard Sardinha, - +Elemental Shaman, 6, R, 3|1, -, Creature - Elemental Shaman, Jim Pavelec, - +Beast, 7, G, 3|3, -, Creature - Beast, John Donahue, - +Elemental, 8, G, 4|4, -, Creature - Elemental, Brandon Kitkouski, - +Elf Warrior, 9, G, 1|1, -, Creature - Elf Warrior, Dominick Domingo, - +Wolf, 10, G, 2|2, -, Creature - Wolf, Pete Venters, - +Shapeshifter, 11, -, 1|1, -, Creature - Shapeshifter, Franz Vohwinkel, Changeling + +EVG - Duel Decks: Elves vs. Goblins (2007-11-16) + +Elemental, T1, G, 7|7, -, Creature - Elemental, Anthony S. Waters, Trample +Elf Warrior, T2, G, 1|1, -, Creature - Elf Warrior, Dominick Domingo, - +Goblin, T3, R, 1|1, -, Creature - Goblin, Dave Kendall, - + +MOR - Morningtide (2008-02-01) + +Giant Warrior, 1, W, 5|5, -, Creature - Giant Warrior, Steve Ellis, - +Faerie Rogue, 2, B, 1|1, -, Creature - Faerie Rogue, Jim Nelson, Flying +Treefolk Shaman, 3, G, 2|5, -, Creature - Treefolk Shaman, Richard Sardinha, - + +SHM - Shadowmoor (2008-05-02) + +Kithkin Soldier, 1, W, 1|1, -, Creature - Kithkin Soldier, Randy Gallegos, - +Spirit, 2, W, 1|1, -, Creature - Spirit, Jeremy Enecio, Flying +Rat, 3, B, 1|1, -, Creature - Rat, Carl Critchlow, - +Elemental, 4, R, 1|1, -, Creature - Elemental, Cyril Van Der Haegen, Haste +Elf Warrior, 5, G, 1|1, -, Creature - Elf Warrior, William O'Connor, - +Spider, 6, G, 1|2, -, Creature - Spider, Thomas M. Baxa, Reach +Wolf, 7, G, 2|2, -, Creature - Wolf, Lars Grant-West, - +Faerie Rogue, 8, U B, 1|1, -, Creature - Faerie Rogue, E. M. Gist, Flying +Elemental, 9, B R, 5|5, -, Creature - Elemental, Dave Dorman, - +Giant Warrior, 10, R G, 4|4, -, Creature - Giant Warrior, Trevor Hairsine, Haste +Goblin Warrior, 11, R G, 1|1, -, Creature - Goblin Warrior, Dave Allsop, - +Elf Warrior, 12, G W, 1|1, -, Creature - Elf Warrior, Carl Frank, - + +EVE - Eventide (2008-07-25) + +Goat, 1, W, -, -, Creature - Goat, Terese Nielsen, - +Bird, 2, U, 1|1, -, Creature - Bird, Heather Hudson, Flying +Beast, 3, G, 3|3, -, Creature - Beast, William O'Connor, - +Spirit, 4, W B, 1|1, -, Creature - Spirit, Larry MacDougall, Flying +Elemental, 5, U R, 5|5, -, Creature - Elemental, Randy Gallegos, Flying +Worm, 6, B G, 1|1, -, Creature - Worm, Chuck Lukacs, - +Goblin Soldier, 7, R W, 1|1, -, Creature - Goblin Soldier, Jeff Miracola, - + +ALA - Shards of Alara (2008-10-03) + +Soldier, 1, W, 1|1, -, Creature - Soldier, Alan Pollack, - +Homunculus, 2, U, -, -, Artifact Creature - Homunculus, Howard Lyon, - +Thopter, 3, U, 1|1, -, Artifact Creature - Thopter, Andrew Murray, Flying +Skeleton, 4, B, 1|1, -, Creature - Skeleton, Thomas M. Baxa, {B}: Regenerate this creature. +Zombie, 5, B, 2|2, -, Creature - Zombie, Dave Kendall, - +Dragon, 6, R, 4|4, -, Creature - Dragon, Vance Kovacs, Flying +Goblin, 7, R, 1|1, -, Creature - Goblin, Brandon Kitkouski, - +Ooze, 8, G, *|*, -, Creature - Ooze, Anthony S. Waters, - +Saproling, 9, G, 1|1, -, Creature - Saproling, Trevor Claxton, - +Beast, 10, R G W, 8|8, -, Creature - Beast, Parente, - + +DD2 - Duel Decks: Jace vs. Chandra (2008-11-07) + +Elemental Shaman, T1, R, 3|1, -, Creature - Elemental Shaman, Jim Pavelec, - + +CFX - Conflux (2009-02-06) + +Angel, 1, W, 4|4, -, Creature - Angel, Cyril Van Der Haegen, Flying +Elemental, 2, R, 3|1, -, Creature - Elemental, Vance Kovacs, - + +DDC - Duel Decks: Divine vs. Demonic (2009-04-10) + +Spirit, T1, W, 1|1, -, Creature - Spirit, Luca Zontini, Flying +Demon, T2, B, *|*, -, Creature - Demon, Pete Venters, Flying +Thrull, T3, B, -, -, Creature - Thrull, Veronique Meignaud, - + +ARB - Alara Reborn (2009-04-30) + +Bird Soldier, 1, W, 1|1, -, Creature - Bird Soldier, Matt Cavotta, Flying +Lizard, 2, G, 2|2, -, Creature - Lizard, Anthony S. Waters, - +Dragon, 3, R G, 1|1, -, Creature - Dragon, Jaime Jones, Flying devour 2 +Zombie Wizard, 4, U B, 1|1, -, Creature - Zombie Wizard, Dave Allsop, - + +M10 - Magic 2010 (2009-07-17) + +Avatar, 1, W, *|*, -, Creature - Avatar, Vance Kovacs, This creature's power and toughness are each equal to your life total. +Soldier, 2, W, 1|1, -, Creature - Soldier, Parente, - +Zombie, 3, B, 2|2, -, Creature - Zombie, Bud Cook, - +Goblin, 4, R, 1|1, -, Creature - Goblin, Dave Kendall, - +Beast, 5, G, 3|3, -, Creature - Beast, John Donahue, - +Insect, 6, G, 1|1, -, Creature - Insect, Ron Spencer, - +Wolf, 7, G, 2|2, -, Creature - Wolf, Lars Grant-West, - +Gargoyle, 8, -, 3|4, -, Artifact Creature - Gargoyle, Paul Bonner, Flying + +ZEN - Zendikar (2009-10-02) + +Angel, 1, W, 4|4, -, Creature - Angel, Adi Granov, Flying +Bird, 2, W, 1|1, -, Creature - Bird, Howard Lyon, Flying +Kor Soldier, 3, W, 1|1, -, Creature - Kor Soldier, Daren Bader, - +Illusion, 4, U, 2|2, -, Creature - Illusion, Cyril Van Der Haegen, - +Merfolk, 5, U, 1|1, -, Creature - Merfolk, Warren Mahy, - +Vampire, 6, B, *|*, -, Creature - Vampire, Kekai Kotaki, - +Zombie Giant, 7, B, 5|5, -, Creature - Zombie Giant, Igor Kieryluk, - +Elemental, 8, R, 7|1, -, Creature - Elemental, Anthony Francisco, Trample haste +Beast, 9, G, 4|4, -, Creature - Beast, Steve Prescott, - +Snake, 10, G, 1|1, -, Creature - Snake, Austin Hsu, - +Wolf, 11, G, 2|2, -, Creature - Wolf, Daren Bader, - + +DDD - Duel Decks: Garruk vs. Liliana (2009-10-30) + +Beast, T1, G, 3|3, -, Creature - Beast, John Donahue, - +Beast, T2, G, 4|4, -, Creature - Beast, Steve Prescott, - +Elephant, T3, G, 3|3, -, Creature - Elephant, Arnie Swekel, - + +WWK - Worldwake (2010-02-05) + +Soldier Ally, 1, W, 1|1, -, Creature - Soldier Ally, Kekai Kotaki, - +Dragon, 2, R, 5|5, -, Creature - Dragon, Raymond Swanland, Flying +Ogre, 3, R, 3|3, -, Creature - Ogre, Paul Bonner, - +Elephant, 4, G, 3|3, -, Creature - Elephant, Lars Grant-West, - +Plant, 5, G, -, -, Creature - Plant, Daren Bader, - +Construct, 6, -, 6|12, -, Artifact Creature - Construct, Jung Park, Trample + +DDE - Duel Decks: Phyrexia vs. the Coalition (2010-03-19) + +Hornet, T1, -, 1|1, -, Artifact Creature - Insect, Ron Spencer, Flying haste +Minion, T2, B, *|*, -, Creature - Minion, Dave Kendall, - +Saproling, T3, G, 1|1, -, Creature - Saproling, Warren Mahy, - + +ROE - Rise of the Eldrazi (2010-04-23) + +Eldrazi Spawn, 1a, -, -, -, Creature - Eldrazi Spawn, Aleksi Briclot, Sacrifice this creature: Add {1} to your mana pool. +Eldrazi Spawn, 1b, -, -, -, Creature - Eldrazi Spawn, Mark Tedin, Sacrifice this creature: Add {1} to your mana pool. +Eldrazi Spawn, 1c, -, -, -, Creature - Eldrazi Spawn, Veronique Meignaud, Sacrifice this creature: Add {1} to your mana pool. +Elemental, 2, R, *|*, -, Creature - Elemental, Jung Park, - +Hellion, 3, R, 4|4, -, Creature - Hellion, Anthony Francisco, - +Ooze, 4, G, *|*, -, Creature - Ooze, Daniel Ljunggren, - +Tuktuk The Returned, 5, -, 5|5, -, Legendary Artifact Creature - Goblin Golem, Franz Vohwinkel, - + +M11 - Magic 2011 (2010-07-16) + +Avatar, 1, W, *|*, -, Creature - Avatar, Vance Kovacs, This creature's power and toughness are each equal to your life total. +Bird, 2, W, 3|3, -, Creature - Bird, Paul Bonner, Flying +Zombie, 3, B, 2|2, -, Creature - Zombie, Bud Cook, - +Beast, 4, G, 3|3, -, Creature - Beast, John Donahue, - +Ooze, 5, G, 2|2, -, Creature - Ooze, Raymond Swanland, When this creature dies put two 1/1 green Ooze creature tokens onto the battlefield. +Ooze, 6, G, 1|1, -, Creature - Ooze, Raymond Swanland, - + +DDF - Duel Decks: Elspeth vs. Tezzeret (2010-09-03) + +Soldier, T1, W, 1|1, -, Creature - Soldier, Parente, - + +SOM - Scars of Mirrodin (2010-10-01) + +Cat, 1, W, 2|2, -, Creature - Cat, Scott Chou, - +Soldier, 2, W, 1|1, -, Creature - Soldier, Goran Josic, - +Goblin, 3, R, 1|1, -, Creature - Goblin, Goran Josic, - +Insect, 4, G, 1|1, -, Creature - Insect, Adrian Smith, Infect +Wolf, 5, G, 2|2, -, Creature - Wolf, Chris Rahn, - +Golem, 6, -, 3|3, -, Artifact Creature - Golem, Nic Klein, - +Myr, 7, -, 1|1, -, Artifact Creature - Myr, Ryan Pancoast, - +Wurm, 8, -, 3|3, -, Artifact Creature - Wurm, Raymond Swanland, Deathtouch +Wurm, 9, -, 3|3, -, Artifact Creature - Wurm, Raymond Swanland, Lifelink +Poison Counter, -, -, -, -, Emblem, -, - + +MBS - Mirrodin Besieged (2011-02-04) + +Germ, 1, B, -, -, Creature - Germ, Igor Kieryluk, - +Zombie, 2, B, 2|2, -, Creature - Zombie, Dave Kendall, - +Golem, 3, -, 9|9, -, Artifact Creature - Golem, Svetlin Velinov, - +Horror, 4, -, *|*, -, Artifact Creature - Horror, Scott Chou, - +Thopter, 5, -, 1|1, -, Artifact Creature - Thopter, Volkan Baga, Flying +Poison Counter, -, -, -, -, Emblem, -, - + +DDG - Duel Decks: Knights vs. Dragons (2011-04-01) + +Goblin, T1, R, 1|1, -, Creature - Goblin, Brandon Kitkouski, - + +NPH - New Phyrexia (2011-05-13) + +Beast, 1, G, 3|3, -, Creature - Beast, Dave Allsop, - +Goblin, 2, R, 1|1, -, Creature - Goblin, Jaime Jones, - +Golem, 3, -, 3|3, -, Artifact Creature - Golem, Volkan Baga, - +Myr, 4, -, 1|1, -, Artifact Creature - Myr, Matt Stewart, - +Poison Counter, -, -, -, -, Emblem, -, - + +M12 - Magic 2012 (2011-07-15) + +Bird, 1, W, 3|3, -, Creature - Bird, Paul Bonner, Flying +Soldier, 2, W, 1|1, -, Creature - Soldier, Parente, - +Zombie, 3, B, 2|2, -, Creature - Zombie, Carl Critchlow, - +Beast, 4, G, 3|3, -, Creature - Beast, John Donahue, - +Saproling, 5, G, 1|1, -, Creature - Saproling, Cyril Van Der Haegen, - +Wurm, 6, G, 6|6, -, Creature - Wurm, Anthony Francisco, - +Pentavite, 7, -, 1|1, -, Artifact Creature - Pentavite, Greg Staples, Flying + +DDH - Duel Decks: Ajani vs. Nicol Bolas (2011-09-02) + +Griffin, T1, W, 2|2, -, Creature - Griffin, Jim Nelson, Flying +Saproling, T2, G, 1|1, -, Creature - Saproling, Cyril Van Der Haegen, - + +ISD - Innistrad (2011-09-30) + +Angel, 1, W, 4|4, -, Creature - Angel, Winona Nelson, Flying +Spirit, 2, W, 1|1, -, Creature - Spirit, Kev Walker, Flying +Homunculus, 3, U, 2|2, -, Creature - Homunculus, Johann Bodin, - +Demon, 4, B, 5|5, -, Creature - Demon, Kev Walker, Flying +Vampire, 5, B, 2|2, -, Creature - Vampire, Svetlin Velinov, Flying +Wolf, 6, B, 1|1, -, Creature - Wolf, Daniel Ljunggren, Deathtouch +Zombie, 7, B, 2|2, -, Creature - Zombie, Lucas Graciano, - +Zombie, 8, B, 2|2, -, Creature - Zombie, Christopher Moeller, - +Zombie, 9, B, 2|2, -, Creature - Zombie, Cynthia Sheppard, - +Ooze, 10, G, *|*, -, Creature - Ooze, Erica Yang, This creature's power and toughness are each equal to the number of slime counters on Gutter Grime. +Spider, 11, G, 1|2, -, Creature - Spider, Daniel Ljunggren, Reach +Wolf, 12, G, 2|2, -, Creature - Wolf, David Palumbo, - +Wolf, T12, G, 2|2, Judge, Creature - Wolf, David Palumbo, - + +DKA - Dark Ascension (2012-02-03) + +Human, 1, W, 1|1, -, Creature - Human, John Stanko, - +Vampire, 2, B, 1|1, -, Creature - Vampire, Peter Mohrbacher, Lifelink +Sorin Emblem, 3, -, -, -, Emblem - Sorin, Michael Komrack, Creatures you control get +1/+0. + +DDI - Duel Decks: Venser vs. Koth (2012-03-30) + +Koth Emblem, E1, -, -, -, Emblem - Koth, Eric Deschamps, Mountains you control have Tap: This land deals 1 damage to target creature or player.' +Venser Emblem, E2, -, -, -, Emblem - Venser, Eric Deschamps, Whenever you cast a spell exile target permanent. + +FNM - Friday Night Magic (2012-04-01) + +Human, T1a, W, 1|1, Full Moon, Creature - Human, Lars Grant-West, - +Wolf, T1b, G, 2|2, Full Moon, Creature - Wolf, Lars Grant-West, - + +AVR - Avacyn Restored (2012-05-04) + +Angel, 1, W, 4|4, -, Creature - Angel, Anthony Palumbo, Flying +Human, 2, W, 1|1, -, Creature - Human, Michael C. Hayes, - +Spirit, 3, W, 1|1, -, Creature - Spirit, Ryan Yee, Flying +Spirit, 4, U, 1|1, -, Creature - Spirit, Dan Scott, Flying +Demon, 5, B, 5|5, -, Creature - Demon, Kev Walker, Flying +Zombie, 6, B, 2|2, -, Creature - Zombie, Lucas Graciano, - +Human, 7, R, 1|1, -, Creature - Human, Ryan Pancoast, Haste +Tamiyo Emblem, 8, -, -, -, Emblem - Tamiyo, Eric Deschamps, You have no maximum hand size. Whenever a card is put into your graveyard from anywhere you may return it to your hand. +Angel, T1, W, 4|4, Pre-Release, Creature - Angel, James Ryman, Flying +Angel, T1F, W, 4|4, Pre-Release, Creature - Angel, James Ryman, Flying +Demon, T5, B, 5|5, Pre-Release, Creature - Demon, Karl Kopinski, Flying +Demon, T5F, B, 5|5, Pre-Release, Creature - Demon, Karl Kopinski, Flying + +M13 - Magic 2013 (2012-07-13) + +Goblin, 1, R, 1|1, League, Creature - Goblin, Jim Nelson, - +Cat, 1, W, 2|2, -, Creature - Cat, Jesper Ejsing, - +Goat, 2, W, -, -, Creature - Goat, Adam Paquette, - +Soldier, 3, W, 1|1, -, Creature - Soldier, Greg Staples, - +Drake, 4, U, 2|2, -, Creature - Drake, Svetlin Velinov, Flying +Zombie, 5, B, 2|2, -, Creature - Zombie, Lucas Graciano, - +Goblin, 6, R, 1|1, -, Creature - Goblin, Karl Kopinski, - +Hellion, 7, R, 4|4, -, Creature - Hellion, Anthony Francisco, - +Beast, 8, G, 3|3, -, Creature - Beast, John Donahue, - +Saproling, 9, G, 1|1, -, Creature - Saproling, Brad Rigney, - +Wurm, 10, G, 6|6, -, Creature - Wurm, Anthony Francisco, - +Liliana Emblem, 11, -, -, -, Emblem - Liliana, D. Alexander Gregory, Swamps you control have Tap: Add {B}{B}{B}{B} to your mana pool.' + +DDJ - Duel Decks: Izzet vs. Golgari (2012-09-07) + +Saproling, T1, G, 1|1, -, Creature - Saproling, Brad Rigney, - + +RTR - Return to Ravnica (2012-10-05) + +Centaur, 1, G, 3|3, Judge, Creature - Centaur, James Ryman, - +Knight, 1, W, 2|2, League, Creature - Knight, Lucas Graciano, Vigilance +Bird, 1, W, 1|1, -, Creature - Bird, James Ryman, Flying +Knight, 2, W, 2|2, -, Creature - Knight, Matt Stewart, Vigilance +Soldier, 3, W, 1|1, -, Creature - Soldier, Steve Prescott, - +Assassin, 4, B, 1|1, -, Creature - Assassin, Svetlin Velinov, Whenever this creature deals combat damage to a player that player loses the game. +Dragon, 5, R, 6|6, -, Creature - Dragon, Mark Zug, Flying +Goblin, 6, R, 1|1, -, Creature - Goblin, Christopher Moeller, - +Centaur, 7, G, 3|3, -, Creature - Centaur, Slawomir Maniak, - +Ooze, 8, G, *|*, -, Creature - Ooze, Marco Nelor, - +Rhino, 9, G, 4|4, -, Creature - Rhino, Tomasz Jedruszek, Trample +Saproling, 10, G, 1|1, -, Creature - Saproling, Raoul Vitale, - +Wurm, 11, G, 5|5, -, Creature - Wurm, Anthony Palumbo, Trample +Elemental, 12, G W, 8|8, -, Creature - Elemental, Yeong-Hao Han, Vigilance + +GTC - Gatecrash (2013-02-01) + +Soldier, 1, R W, 1|1, League, Creature - Soldier, Zoltan Boros, Haste +Angel, 1, W, 4|4, -, Creature - Angel, Steve Argyle, Flying +Rat, 2, B, 1|1, -, Creature - Rat, Nils Hamm, - +Frog Lizard, 3, G, 3|3, -, Creature - Frog Lizard, Jack Wang, - +Cleric, 4, W B, 1|1, -, Creature - Cleric, Jason Chan, {3}{W}{B}{B} {T} Sacrifice this creature: Return a card named Deathpact Angel from your graveyard to the battlefield. +Horror, 5, U B, 1|1, -, Creature - Horror, Adam Paquette, Flying +Soldier, 6, R W, 1|1, -, Creature - Soldier, David Palumbo, Haste +Spirit, 7, W B, 1|1, -, Creature - Spirit, Cliff Childs, Flying +Domri Emblem, 8, -, -, -, Emblem - Domri, Tyler Jacobson, Creatures you control have double strike trample hexproof and haste. + +DDK - Duel Decks: Sorin vs. Tibalt (2013-03-15) + +Spirit, T1, W, 1|1, -, Creature - Spirit, Ryan Yee, Flying + +DGM - Dragon's Maze (2013-05-03) + +Bird, 1, W, 1|1, League, Creature - Bird, Martina Pilcerova, Flying +Elemental, 1, G W, *|*, -, Creature - Elemental, Mark Winters, This creature's power and toughness are each equal to the number of creatures you control. + +MMA - Modern Masters (2013-06-07) + +Giant Warrior, 1, W, 5|5, -, Creature - Giant Warrior, Svetlin Velinov, - +Kithkin Soldier, 2, W, 1|1, -, Creature - Kithkin Soldier, Randy Gallegos, - +Soldier, 3, W, 1|1, -, Creature - Soldier, Goran Josic, - +Illusion, 4, U, 1|1, -, Creature - Illusion, Veronique Meignaud, - +Bat, 5, B, 1|1, -, Creature - Bat, Wayne Reynolds, Flying +Goblin Rogue, 6, B, 1|1, -, Creature - Goblin Rogue, Dave Kendall, - +Spider, 7, B, 2|4, -, Creature - Spider, Lars Grant-West, Reach +Zombie, 8, B, 2|2, -, Creature - Zombie, Bud Cook, - +Dragon, 9, R, 4|4, -, Creature - Dragon, Vance Kovacs, Flying +Goblin, 10, R, 1|1, -, Creature - Goblin, Dave Kendall, - +Elemental, 11, G, 4|4, -, Creature - Elemental, Brandon Kitkouski, - +Saproling, 12, G, 1|1, -, Creature - Saproling, Warren Mahy, - +Treefolk Shaman, 13, G, 2|5, -, Creature - Treefolk Shaman, Zack Stella, - +Faerie Rogue, 14, U B, 1|1, -, Creature - Faerie Rogue, E. M. Gist, Flying +Worm, 15, B G, 1|1, -, Creature - Worm, Chuck Lukacs, - +Elspeth Emblem, 16, -, -, -, Emblem - Elspeth, Volkan Baga, Artifacts creatures enchantments and lands you control have indestructible. + +M14 - Magic 2014 Core Set (2013-07-19) + +Sliver, 1, -, 1|1, -, Creature - Sliver, Igor Kieryluk, - +Angel, 1, W, 4|4, -, Creature - Angel, James Ryman, Flying +Cat, 3, W, 2|2, -, Creature - Cat, Jesper Ejsing, - +Goat, 4, W, -, -, Creature - Goat, Adam Paquette, - +Zombie, 5, B, 2|2, -, Creature - Zombie, Lucas Graciano, - +Dragon, 6, R, 2|2, -, Creature - Dragon, Jack Wang, Flying {R}: This creature gets +1/+0 until end of turn. +Elemental, 7, R, 1|1, -, Creature - Elemental, Jaime Jones, - +Elemental, 8, R, 1|1, -, Creature - Elemental, Winona Nelson, - +Beast, 9, G, 3|3, -, Creature - Beast, John Donahue, - +Saproling, 10, G, 1|1, -, Creature - Saproling, Brad Rigney, - +Wolf, 11, G, 2|2, -, Creature - Wolf, Lars Grant-West, - +Liliana Emblem, 12, -, -, -, Emblem - Liliana, D. Alexander Gregory, Swamps you control have Tap: Add {B}{B}{B}{B} to your mana pool.' +Garruk Emblem, 13, -, -, -, Emblem - Garruk, Karl Kopinski, Whenever you cast a creature spell you may search your library for a creature card put it onto the battlefield then shuffle your library. +Sliver, T1, -, 1|1, League, Creature - Sliver, Vincent Proce, - + +DDL - Duel Decks: Heroes vs. Monsters (2013-09-06) + +Griffin, T1, W, 2|2, -, Creature - Griffin, Johann Bodin, Flying +Beast, T2, G, 3|3, -, Creature - Beast, Jesper Ejsing, - + +THS - Theros (2013-09-27) + +Golem, 1, -, 3|3, Judge, Enchantment Artifact Creature - Golem, Yeong-Hao Han, - +Soldier, 1, W, 1|1, League, Creature - Soldier, Johann Bodin, - +Cleric, 1, W, 2|1, -, Enchantment Creature - Cleric, Johann Bodin, - +Soldier, 2, W, 1|1, -, Creature - Soldier, Seb McKinnon, - +Soldier, 3, W, 1|1, -, Creature - Soldier, Svetlin Velinov, - +Bird, 4, U, 2|2, -, Creature - Bird, Peter Mohrbacher, Flying +Elemental, 5, U, 1|0, -, Creature - Elemental, Karl Kopinski, - +Harpy, 6, B, 1|1, -, Creature - Harpy, Nils Hamm, Flying +Soldier, 7, R, 1|1, -, Creature - Soldier, Johann Bodin, - +Boar, 8, G, 2|2, -, Creature - Boar, James Ryman, - +Satyr, 9, R G, 2|2, -, Creature - Satyr, Johann Bodin, - +Golem, 10, -, 3|3, -, Enchantment Artifact Creature - Golem, Yeong-Hao Han, - +Elspeth Emblem, 11, -, -, -, Emblem - Elspeth, Eric Deschamps, Creatures you control get +2/+2 and have flying. + +BNG - Born of the Gods (2014-02-07) + +Soldier, 1, W, 1|1, League, Enchantment Creature - Soldier, Ryan Barger, - +Bird, 1, W, 1|1, -, Creature - Bird, Clint Cearly, Flying +Cat Soldier, 2, W, 1|1, -, Creature - Cat Soldier, Scott Chou, Vigilance +Soldier, 3, W, 1|1, -, Enchantment Creature - Soldier, David Palumbo, - +Bird, 4, U, 2|2, -, Enchantment Creature - Bird, Mike Sass, Flying +Kraken, 5, U, 9|9, -, Creature - Kraken, Dan Scott, - +Zombie, 6, B, 2|2, -, Enchantment Creature - Zombie, Winona Nelson, - +Elemental, 7, R, 3|1, -, Enchantment Creature - Elemental, Greg Staples, - +Centaur, 8, G, 3|3, -, Enchantment Creature - Centaur, Ryan Barger, - +Wolf, 9, G, 2|2, -, Creature - Wolf, Raoul Vitale, - +Gold, 10, -, -, -, Artifact, Richard Wright, Sacrifice this artifact: Add one mana of any color to your mana pool. +Kiora Emblem, 11, -, -, -, Emblem - Kiora, Scott M. Fischer, At the beginning of your end step put a 9/9 blue Kraken creature token onto the battlefield. + +DDM - Duel Decks: Jace vs. Vraska (2014-03-14) + +Assassin, T1, B, 1|1, -, Creature - Assassin, Svetlin Velinov, Whenever this creature deals combat damage to a player that player loses the game. + +JOU - Journey into Nyx (2014-05-02) + +Minotaur, 1, R, 2|3, League, Creature - Minotaur, Scott Murphy, - +Sphinx, 1, U, 4|4, -, Creature - Sphinx, Jesper Ejsing, Flying +Zombie, 2, B, *|*, -, Creature - Zombie, Zack Stella, - +Minotaur, 3, R, 2|3, -, Creature - Minotaur, Craig J Spearing, - +Hydra, 4, G, *|*, -, Creature - Hydra, Steve Prescott, - +Spider, 5, G, 1|3, -, Enchantment Creature - Spider, Yohann Schepacz, Reach +Snake, 6, G B, 1|1, -, Enchantment Creature - Snake, Greg Staples, Deathtouch + +MD1 - Modern Event Deck 2014 (2014-05-30) + +Soldier, 1, W, 1|1, -, Creature - Soldier, Goran Josic, - +Spirit, 2, W, 1|1, -, Creature - Spirit, Kev Walker, Flying +Myr, 3, -, 1|1, -, Artifact Creature - Myr, Matt Stewart, - +Elspeth Emblem, 4, -, -, -, Emblem - Elspeth, Volkan Baga, Artifacts creatures enchantments and lands you control have indestructible. + +CNS - Conspiracy (2014-06-06) + +Spirit, 1, W, 1|1, -, Creature - Spirit, Jeff Simpson, Flying +Demon, 2, B, *|*, -, Creature - Demon, Evan Shipard, Flying +Zombie, 3, B, 2|2, -, Creature - Zombie, Lucas Graciano, - +Ogre, 4, R, 4|4, -, Creature - Ogre, Dave Kendall, - +Elephant, 5, G, 3|3, -, Creature - Elephant, Lars Grant-West, - +Squirrel, 6, G, 1|1, -, Creature - Squirrel, Daniel Ljunggren, - +Wolf, 7, G, 2|2, -, Creature - Wolf, Raoul Vitale, - +Construct, 8, -, 1|1, -, Artifact Creature - Construct, Adam Paquette, Defender +Dack Emblem, 9, -, -, -, Emblem - Dack, Eric Deschamps, Whenever you cast a spell that targets one or more permanents gain control of those permanents. + +M15 - Magic 2015 Core Set (2014-07-18) + +Wolf, 001, G, 1|1, Pre-Release, Creature - Wolf, David Palumbo, - +Sliver, 001, -, 1|1, -, Creature - Sliver, Igor Kieryluk, - +Squid, 001, U, 1|1, League, Creature - Squid, Richard Wright, Islandwalk +Soldier, 002, W, 1|1, -, Creature - Soldier, Greg Staples, - +Spirit, 003, W, 1|1, -, Creature - Spirit, Mike Sass, Flying +Squid, 004, U, 1|1, -, Creature - Squid, Jack Wang, Islandwalk +Beast, 005, B, 3|3, -, Creature - Beast, John Donahue, Deathtouch +Zombie, 006, B, 2|2, -, Creature - Zombie, Lucas Graciano, - +Dragon, 007, R, 2|2, -, Creature - Dragon, Jack Wang, Flying {R}: This creature gets +1/+0 until end of turn. +Goblin, 008, R, 1|1, -, Creature - Goblin, Karl Kopinski, - +Beast, 009, G, 3|3, -, Creature - Beast, Dave Kendall, - +Insect, 010, G, 1|1, -, Creature - Insect, Martina Pilcerova, Flying deathtouch +Treefolk Warrior, 011, G, *|*, -, Creature - Treefolk Warrior, Todd Lockwood, This creature's power and toughness are each equal to the number of Forests you control. +Land Mine, 012, -, -, -, Artifact, Kev Walker, {R} Sacrifice this artifact: This artifact deals 2 damage to target attacking creature without flying. +Ajani Emblem, 013, -, -, -, Emblem - Ajani, Chris Rahn, If a source would deal damage to you or a planeswalker you control prevent all but 1 of that damage. +Garruk Emblem, 014, -, -, -, Emblem - Garruk, Tyler Jacobson, Whenever a creature attacks you it gets +5/+5 and gains trample until end of turn. + +DDN - Duel Decks: Speed vs. Cunning (2014-09-05) + +Goblin, 082, R, 1|1, -, Creature - Goblin, Karl Kopinski, - + +KTK - Khans of Tarkir (2014-09-26) + +Warrior, 001, W, 1|1, League, Creature - Warrior, Winona Nelson, - +Bird, 001, W, 3|4, -, Creature - Bird, Mark Zug, Flying +Spirit, 002, W, 1|1, -, Creature - Spirit, Mike Sass, Flying +Warrior, 003, W, 1|1, -, Creature - Warrior, Ryan Barger, - +Warrior, 004, W, 1|1, -, Creature - Warrior, Yefim Kligerman, - +Vampire, 005, B, 2|2, -, Creature - Vampire, Cynthia Sheppard, Flying +Zombie, 006, B, 2|2, -, Creature - Zombie, Wayne Reynolds, - +Goblin, 007, R, 1|1, -, Creature - Goblin, Kev Walker, - +Bear, 008, G, 4|4, -, Creature - Bear, Kev Walker, - +Snake, 009, G, 1|1, -, Creature - Snake, Lars Grant-West, - +Spirit Warrior, 010, B G, *|*, -, Creature - Spirit Warrior, Ryan Alexander Lee, - +Morph, 011, -, 2|2, -, Creature, Raymond Swanland, (You can cover a face-down creature with this reminder card. A card with morph can be turned face up any time for its morph cost.) +Sarkhan Emblem, 012, -, -, -, Emblem - Sarkhan, Daarken, At the beginning of your draw step draw two additional cards. At the beginning of your end step discard your hand. +Sorin Emblem, 013, -, -, -, Emblem - Sorin, Cynthia Sheppard, At the beginning of each opponent's upkeep that player sacrifices a creature. + +C14 - Commander 2014 (2014-11-07) + +Angel, 001, W, 4|4, -, Creature - Angel, Anthony Palumbo, Flying +Cat, 002, W, 2|2, -, Creature - Cat, Scott Chou, - +Goat, 003, W, -, -, Creature - Goat, Adam Paquette, - +Kor Soldier, 004, W, 1|1, -, Creature - Kor Soldier, Daren Bader, - +Pegasus, 005, W, 1|1, -, Creature - Pegasus, Greg Hildebrandt, Flying +Soldier, 006, W, 1|1, -, Creature - Soldier, Goran Josic, - +Spirit, 007, W, 1|1, -, Creature - Spirit, Ryan Yee, Flying +Fish, 008, U, 3|3, -, Creature - Fish, Dan Scott, When this creature dies put a 6/6 blue Whale creature token onto the battlefield with "When this creature dies put a 9/9 blue Kraken creature token onto the battlefield." +Kraken, 009, U, 9|9, -, Creature - Kraken, Dan Scott, - +Whale, 010, U, 6|6, -, Creature - Whale, Dan Scott, When this creature dies put a 9/9 blue Kraken creature token onto the battlefield. +Zombie, 011, U, *|*, -, Creature - Zombie, Dave Kendall, - +Demon, 012, B, *|*, -, Creature - Demon, Pete Venters, Flying +Demon, 013, B, 5|5, -, Creature - Demon, Kev Walker, Flying +Germ, 014, B, -, -, Creature - Germ, Igor Kieryluk, - +Horror, 015, B, *|*, -, Creature - Horror, Jason Felix, - +Zombie, 016, B, 2|2, -, Creature - Zombie, Lucas Graciano, - +Goblin, 017, R, 1|1, -, Creature - Goblin, Dave Kendall, - +Ape, 018, G, 3|3, -, Creature - Ape, Lars Grant-West, - +Beast, 019, G, 3|3, -, Creature - Beast, Dave Allsop, - +Beast, 020, G, 4|4, -, Creature - Beast, Steve Prescott, - +Elemental, 021, G, 5|3, -, Creature - Elemental, Nils Hamm, - +Elephant, 022, G, 3|3, -, Creature - Elephant, Lars Grant-West, - +Elf Druid, 023, G, 1|1, -, Creature - Elf Druid, Raymond Swanland, {T}: Add {G} to your mana pool. +Elf Warrior, 024, G, 1|1, -, Creature - Elf Warrior, William O'Connor, - +Treefolk, 025, G, *|*, -, Creature - Treefolk, Filip Burburan, - +Wolf, 026, G, 2|2, -, Creature - Wolf, Daren Bader, - +Gargoyle, 027, -, 3|4, -, Artifact Creature - Gargoyle, Paul Bonner, Flying +Myr, 028, -, 1|1, -, Artifact Creature - Myr, Ryan Pancoast, - +Pentavite, 029, -, 1|1, -, Artifact Creature - Pentavite, Greg Staples, Flying +Stoneforged Blade, 030, -, -, -, Artifact - Equipment, Eric Deschamps, Indestructible Equipped creature gets +5/+5 and has double strike. Equip {0} +Tuktuk The Returned, 031, -, 5|5, -, Legendary Artifact Creature - Goblin Golem, Franz Vohwinkel, - +Wurm, 032, -, 3|3, -, Artifact Creature - Wurm, Raymond Swanland, Deathtouch +Wurm, 033, -, 3|3, -, Artifact Creature - Wurm, Raymond Swanland, Lifelink +Teferi Emblem, 034, -, -, -, Emblem - Teferi, Tyler Jacobson, You may activate loyalty abilities of planeswalkers you control on any player's turn any time you could cast an instant. +Nixilis Emblem, 035, -, -, -, Emblem - Nixilis, Daarken, {1}{B} Sacrifice a creature: You gain X life and draw X cards where X is the sacrificed creature's power. +Daretti Emblem, 036, -, -, -, Emblem - Daretti, Dan Scott, Whenever an artifact is put into your graveyard from the battlefield return that card to the battlefield at the beginning of the next end step. + +DD3_EVG - Duel Decks Anthology Elves vs. Goblins (2014-12-05) + +Elemental, 001, G, 7|7, -, Creature - Elemental, Anthony S. Waters, Trample +Elf Warrior, 002, G, 1|1, -, Creature - Elf Warrior, Dominick Domingo, - +Goblin, 003, R, 1|1, -, Creature - Goblin, Dave Kendall, - + +DD3_JVC - Duel Decks Anthology Jace vs. Chandra (2014-12-05) + +Elemental Shaman, 004, R, 3|1, -, Creature - Elemental Shaman, Jim Pavelec, - + +DD3_DVD - Duel Decks Anthology Divine vs. Demonic (2014-12-05) + +Spirit, 005, W, 1|1, -, Creature - Spirit, Luca Zontini, Flying +Demon, 006, B, *|*, -, Creature - Demon, Pete Venters, Flying +Thrull, 007, B, -, -, Creature - Thrull, Veronique Meignaud, - + +DD3_GVL - Duel Decks Anthology Garruk vs. Liliana (2014-12-05) + +Beast, 008, G, 3|3, -, Creature - Beast, John Donahue, - +Beast, 009, G, 4|4, -, Creature - Beast, Steve Prescott, - +Elephant, 010, G, 3|3, -, Creature - Elephant, Arnie Swekel, - +Bat, 011, B, 1|1, -, Creature - Bat, Wayne Reynolds, Flying + +FRF - Fate Reforged (2015-01-23) + +Monk, 001, W, 1|1, -, Creature - Monk, Steven Belledin, Prowess +Monk, 001T, W, 1|1, League, Creature - Monk, Magali Villeneuve, Prowess +Spirit, 002, W, 1|1, -, Creature - Spirit, Aaron Miller, Flying +Warrior, 003, B, 2|1, -, Creature - Warrior, Zoltan Boros, - +Manifest, 004, -, 2|2, -, Creature, Raymond Swanland, (You can cover a face-down manifested creature with this reminder card. A manifested creature card can be turned face up any time for its mana cost. A face-down card can also be turned face up for its morph cost.) + +DDO - Duel Decks: Elspeth vs. Kiora (2015-02-27) + +Soldier, 066, W, 1|1, -, Creature - Soldier, Svetlin Velinov, - +Kraken, 067, U, 9|9, -, Creature - Kraken, Dan Scott, - + +DTK - Dragons of Tarkir (2015-03-27) + +Warrior, 001, W, 1|1, -, Creature - Warrior, Aaron Miller, - +Djinn Monk, 002, U, 2|2, -, Creature - Djinn Monk, Izzy, Flying +Zombie, 003, B, 2|2, -, Creature - Zombie, Vincent Proce, - +Zombie Horror, 004, B, *|*, -, Creature - Zombie Horror, Nils Hamm, - +Dragon, 005, R, 4|4, -, Creature - Dragon, Gabor Szikszai, Flying +Goblin, 006, R, 1|1, -, Creature - Goblin, Mike Bierek, - +Morph, 007, -, 2|2, -, Creature, Raymond Swanland, (You can cover a face-down creature with this reminder card. A card with morph can be turned face up any time for its morph cost.) +Narset Emblem, 008, -, -, -, Emblem - Narset, Magali Villeneuve, Your opponents can't cast noncreature spells. + +MM2 - Modern Masters 2015 Edition (2015-05-22) + +Eldrazi Spawn, 001, -, -, -, Creature - Eldrazi Spawn, Aleksi Briclot, Sacrifice this creature: Add {1} to your mana pool. +Eldrazi Spawn, 002, -, -, -, Creature - Eldrazi Spawn, Mark Tedin, Sacrifice this creature: Add {1} to your mana pool. +Eldrazi Spawn, 003, -, -, -, Creature - Eldrazi Spawn, Veronique Meignaud, Sacrifice this creature: Add {1} to your mana pool. +Soldier, 004, W, 1|1, -, Creature - Soldier, Greg Staples, - +Spirit, 005, W, 1|1, -, Creature - Spirit, Mike Sass, Flying +Faerie Rogue, 006, B, 1|1, -, Creature - Faerie Rogue, Dave Allsop, Flying +Germ, 007, B, -, -, Creature - Germ, Igor Kieryluk, - +Thrull, 008, B, 1|1, -, Creature - Thrull, Mark Tedin, - +Elephant, 009, G, 3|3, -, Creature - Elephant, Lars Grant-West, - +Insect, 010, G, 1|1, -, Creature - Insect, Ron Spencer, - +Saproling, 011, G, 1|1, -, Creature - Saproling, Warren Mahy, - +Snake, 012, G, 1|1, -, Creature - Snake, Austin Hsu, - +Wolf, 013, G, 2|2, -, Creature - Wolf, Daren Bader, - +Worm, 014, B G, 1|1, -, Creature - Worm, Chuck Lukacs, - +Golem, 015, -, 3|3, -, Artifact Creature - Golem, Nic Klein, - +Myr, 016, -, 1|1, -, Artifact Creature - Myr, Ryan Pancoast, - + +ORI - Magic Origins (2015-07-17) + +Angel, 001, W, 4|4, -, Creature - Angel, Cyril Van Der Haegen, Flying +Knight, 002, W, 2|2, -, Creature - Knight, Matt Stewart, Vigilance +Soldier, 003, W, 1|1, -, Creature - Soldier, Steve Prescott, - +Demon, 004, B, 5|5, -, Creature - Demon, Kev Walker, Flying +Zombie, 005, B, 2|2, -, Creature - Zombie, Lucas Graciano, - +Goblin, 006, R, 1|1, -, Creature - Goblin, Brandon Kitkouski, - +Ashaya the Awoken World, 007, G, 4|4, -, Legendary Creature - Elemental, Raymond Swanland, - +Elemental, 008, G, 2|2, -, Creature - Elemental, Marco Nelor, - +Elf Warrior, 009, G, 1|1, -, Creature - Elf Warrior, William O'Connor, - +Thopter, 010, -, 1|1, -, Artifact Creature - Thopter, Adam Paquette, Flying +Thopter, 011, -, 1|1, -, Artifact Creature - Thopter, Svetlin Velinov, Flying +Jace Emblem, 012, -, -, -, Emblem - Jace, Jaime Jones, Whenever you cast a spell target opponent puts the top five cards of his or her library into his or her graveyard. +Liliana Emblem, 013, -, -, -, Emblem - Liliana, Karla Ortiz, Whenever a creature dies return it to the battlefield under your control at the beginning of the next end step. +Chandra Emblem, 014, -, -, -, Emblem - Chandra, Eric Deschamps, At the beginning of your upkeep this emblem deals 3 damage to you. + +DDP - Duel Decks: Zendikar vs. Eldrazi (2015-08-28) + +Eldrazi Spawn, 076, -, -, -, Creature - Eldrazi Spawn, Aleksi Briclot, Sacrifice this creature: Add {1} to your mana pool. +Eldrazi Spawn, 077, -, -, -, Creature - Eldrazi Spawn, Veronique Meignaud, Sacrifice this creature: Add {1} to your mana pool. +Eldrazi Spawn, 078, -, -, -, Creature - Eldrazi Spawn, Mark Tedin, Sacrifice this creature: Add {1} to your mana pool. +Hellion, 079, R, 4|4, -, Creature - Hellion, Anthony Francisco, - +Plant, 080, G, -, -, Creature - Plant, Daren Bader, - + +BFZ - Battle for Zendikar (2015-10-09) + +Eldrazi, 001, -, 10|10, -, Creature - Eldrazi, Jack Wang, - +Eldrazi Scion, 002, -, 1|1, -, Creature - Eldrazi Scion, Izzy, Sacrifice this creature: Add {1} to your mana pool. +Eldrazi Scion, 003, -, 1|1, -, Creature - Eldrazi Scion, Winona Nelson, Sacrifice this creature: Add {1} to your mana pool. +Eldrazi Scion, 004, -, 1|1, -, Creature - Eldrazi Scion, Svetlin Velinov, Sacrifice this creature: Add {1} to your mana pool. +Knight Ally, 005, W, 2|2, -, Creature - Knight Ally, Josu Hernaiz, - +Kor Ally, 006, W, 1|1, -, Creature - Kor Ally, Jeremy Wilson, - +Octopus, 007, U, 8|8, -, Creature - Octopus, Craig J Spearing, - +Dragon, 008, R, 5|5, -, Creature - Dragon, Raymond Swanland, Flying +Plant, 009, G, 1|1, -, Creature - Plant, Sam Burley, - +Elemental, 009, R, 3|1, -, Creature - Elemental, Victor Adame Minguez, Trample Haste +Elemental, 011, G R, 5|5, -, Creature - Elemental, Brad Rigney, - +Gideon Emblem, 012, -, -, -, Emblem - Gideon, Eric Deschamps, - +Nixilis Emblem, 013, -, -, -, Emblem - Nixilis, Chris Rahn, - +Kiora Emblem, 014, -, -, -, Emblem - Kiora, Jason Chan, - + +C15 - Commander 2015 (2015-11-13) + +Shapeshifter, 001, -, 1|1, -, Creature - Shapeshifter, Franz Vohwinkel, Changeling +Angel, 002, W, 4|4, -, Creature - Angel, Cyril Van Der Haegen, Flying +Cat, 003, W, 2|2, -, Creature - Cat, Jesper Ejsing, - +Knight, 004, W, 2|2, -, Creature - Knight, Hideaki Takamura, First strike +Knight, 005, W, 2|2, -, Creature - Knight, Matt Stewart, Vigilance +Drake, 006, U, 2|2, -, Creature - Drake, Svetlin Velinov, Flying +Germ, 007, B, -, -, Creature - Germ, Igor Kieryluk, - +Zombie, 008, B, 2|2, -, Creature - Zombie, Lucas Graciano, - +Dragon, 009, R, 5|5, -, Creature - Dragon, Jim Pavelec, Flying +Elemental Shaman, 010, R, 3|1, -, Creature - Elemental Shaman, Jim Pavelec, - +Lightning Rager, 011, R, 5|1, -, Creature - Elemental, Svetlin Velinov, Trample Haste At the beginning of your end step sacrifice this creature. +Bear, 012, G, 2|2, -, Creature - Bear, Heather Hudson, - +Beast, 013, G, 4|4, -, Creature - Beast, Svetlin Velinov, - +Elephant, 014, G, 3|3, -, Creature - Elephant, Lars Grant-West, - +Frog Lizard, 015, G, 3|3, -, Creature - Frog Lizard, Jack Wang, - +Saproling, 016, G, 1|1, -, Creature - Saproling, Brad Rigney, - +Snake, 017, G, 1|1, -, Creature - Snake, Dan Scott, - +Spider, 018, G, 1|2, -, Creature - Spider, Daniel Ljunggren, Reach +Wolf, 019, G, 2|2, -, Creature - Wolf, David Palumbo, - +Elemental, 020, U R, 5|5, -, Creature - Elemental, Randy Gallegos, Flying +Snake, 021, G U, 1|1, -, Creature - Snake, Christopher Moeller, - +Spirit, 022, W B, 1|1, -, Creature - Spirit, Cliff Childs, Flying +Spirit, 023, -, *|*, -, Enchantment Creature - Spirit, Adam Paquette, This creature's power and toughness are each equal to the number of experience counters you have. +Gold, 024, -, -, -, Artifact, Richard Wright, Sacrifice this artifact: Add one mana of any color to your mana pool. diff --git a/Mage.Client/src/test/java/mage/client/game/TokensMtgImageSourceTest.java b/Mage.Client/src/test/java/mage/client/game/TokensMtgImageSourceTest.java new file mode 100644 index 00000000000..b33b81d0b99 --- /dev/null +++ b/Mage.Client/src/test/java/mage/client/game/TokensMtgImageSourceTest.java @@ -0,0 +1,32 @@ +package mage.client.game; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; +import org.mage.plugins.card.dl.sources.CardImageSource; +import org.mage.plugins.card.dl.sources.TokensMtgImageSource; +import org.mage.plugins.card.images.CardDownloadData; + +/** + * + * @author Quercitron + */ +@Ignore +public class TokensMtgImageSourceTest { + + @Test + public void generateTokenUrlTest() throws Exception { + CardImageSource imageSource = TokensMtgImageSource.getInstance(); + + String url = imageSource.generateTokenUrl(new CardDownloadData("Thopter", "ORI", 0, false, 1, "ORI")); + Assert.assertEquals("http://tokens.mtg.onl/tokens/ORI_010-Thopter.jpg", url); + url = imageSource.generateTokenUrl(new CardDownloadData("Thopter", "ORI", 0, false, 2, "ORI")); + Assert.assertEquals("http://tokens.mtg.onl/tokens/ORI_011-Thopter.jpg", url); + + url = imageSource.generateTokenUrl(new CardDownloadData("Ashaya, the Awoken World", "ORI", 0, false, 0, "ORI")); + Assert.assertEquals("http://tokens.mtg.onl/tokens/ORI_007-Ashaya,-the-Awoken-World.jpg", url); + + url = imageSource.generateTokenUrl(new CardDownloadData("Emblem Gideon, Ally of Zendikar", "BFZ", 0, false, 0, null)); + Assert.assertEquals("http://tokens.mtg.onl/tokens/BFZ_012-Gideon-Emblem.jpg", url); + } +} diff --git a/Mage.Common/pom.xml b/Mage.Common/pom.xml index 09ab27aea29..b35033d97f5 100644 --- a/Mage.Common/pom.xml +++ b/Mage.Common/pom.xml @@ -7,7 +7,7 @@ org.mage mage-root - 1.4.3 + 1.4.5 mage-common diff --git a/Mage.Common/src/mage/cards/MageCard.java b/Mage.Common/src/mage/cards/MageCard.java index 320e9d11390..275c3773c03 100644 --- a/Mage.Common/src/mage/cards/MageCard.java +++ b/Mage.Common/src/mage/cards/MageCard.java @@ -1,35 +1,61 @@ package mage.cards; +import java.awt.Image; +import java.util.UUID; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; import mage.cards.action.ActionCallback; import mage.view.CardView; -import javax.swing.*; -import java.awt.*; -import java.util.UUID; - public abstract class MageCard extends JPanel { + private static final long serialVersionUID = 6089945326434301879L; public abstract void onBeginAnimation(); + public abstract void onEndAnimation(); + public abstract boolean isTapped(); + public abstract boolean isFlipped(); + public abstract void setAlpha(float transparency); + public abstract float getAlpha(); + public abstract CardView getOriginal(); + // sets the vertical text offset for the card name on the image public abstract void setTextOffset(int yOffset); + public abstract void setCardBounds(int x, int y, int width, int height); + public abstract void update(CardView card); + public abstract void updateImage(); + public abstract Image getImage(); + public abstract void setZone(String zone); + public abstract String getZone(); + public abstract void updateCallback(ActionCallback callback, UUID gameId); + public abstract void toggleTransformed(); + public abstract boolean isTransformed(); + public abstract void showCardTitle(); + public abstract void setSelected(boolean selected); + public abstract void setCardAreaRef(JPanel cardArea); + public abstract void setChoosable(boolean isChoosable); + + public abstract void setPopupMenu(JPopupMenu popupMenu); + + public abstract JPopupMenu getPopupMenu(); + } diff --git a/Mage.Common/src/mage/cards/action/ActionCallback.java b/Mage.Common/src/mage/cards/action/ActionCallback.java index c355ff4faeb..a2b1345f019 100644 --- a/Mage.Common/src/mage/cards/action/ActionCallback.java +++ b/Mage.Common/src/mage/cards/action/ActionCallback.java @@ -12,6 +12,6 @@ public interface ActionCallback { void mouseEntered(MouseEvent e, TransferData data); void mouseExited(MouseEvent e, TransferData data); void mouseWheelMoved(MouseWheelEvent e, TransferData data); - void hidePopup(); + void hideTooltipPopup(); } diff --git a/Mage.Common/src/mage/cards/action/impl/EmptyCallback.java b/Mage.Common/src/mage/cards/action/impl/EmptyCallback.java index 425225a573a..9db675f342a 100644 --- a/Mage.Common/src/mage/cards/action/impl/EmptyCallback.java +++ b/Mage.Common/src/mage/cards/action/impl/EmptyCallback.java @@ -35,7 +35,7 @@ public class EmptyCallback implements ActionCallback { } @Override - public void hidePopup() { + public void hideTooltipPopup() { } @Override diff --git a/Mage.Common/src/mage/constants/Constants.java b/Mage.Common/src/mage/constants/Constants.java index a5b586c63a8..fd8bf95052c 100644 --- a/Mage.Common/src/mage/constants/Constants.java +++ b/Mage.Common/src/mage/constants/Constants.java @@ -67,6 +67,10 @@ public final class Constants { public static final double SCALE_FACTOR = 0.5; + public static final int MIN_AVATAR_ID = 10; + public static final int MAX_AVATAR_ID = 32; + public static final int DEFAULT_AVATAR_ID = 10; + /** * Time each player has during the game to play using his\her priority. */ @@ -83,6 +87,10 @@ public final class Constants { public static final String POSSIBLE_ATTACKERS = "possibleAttackers"; public static final String SPECIAL_BUTTON = "specialButton"; + // used to control automatic answers of optional effects + public static final String ORIGINAL_ID = "originalId"; + public static final String SECOND_MESSAGE = "secondMessage"; + public static final String HINT_TEXT = "hintText"; } diff --git a/Mage.Common/src/mage/remote/MageVersionException.java b/Mage.Common/src/mage/remote/MageVersionException.java index 4da5aec0ddc..33108ab2d6b 100644 --- a/Mage.Common/src/mage/remote/MageVersionException.java +++ b/Mage.Common/src/mage/remote/MageVersionException.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -38,8 +38,8 @@ public class MageVersionException extends MageException { private final MageVersion serverVersion; - public MageVersionException(MageVersion clientVersion, MageVersion serverVersion) { - super("Wrong client version " + clientVersion + ", expecting version " + serverVersion + ". \r\n\r\nPlease download needed version from http://XMage.info or http://www.slightlymagic.net/forum/viewforum.php?f=70"); + public MageVersionException(MageVersion clientVersion, MageVersion serverVersion) { + super("Wrong client version " + clientVersion + ", expecting version " + serverVersion + ". \r\n\r\nPlease download needed version from http://XMage.de or http://www.slightlymagic.net/forum/viewforum.php?f=70"); this.serverVersion = serverVersion; } diff --git a/Mage.Common/src/mage/remote/SessionImpl.java b/Mage.Common/src/mage/remote/SessionImpl.java index 8017868ba74..3b4036d4c26 100644 --- a/Mage.Common/src/mage/remote/SessionImpl.java +++ b/Mage.Common/src/mage/remote/SessionImpl.java @@ -468,9 +468,7 @@ public class SessionImpl implements Session { @Override public void handleConnectionException(Throwable throwable, Client client) { - logger.info("connection to server lost - " + throwable.getMessage()); - throwable.printStackTrace(); - + logger.info("connection to server lost - " + throwable.getMessage(), throwable); reconnect(throwable); } } diff --git a/Mage.Common/src/mage/utils/CardUtil.java b/Mage.Common/src/mage/utils/CardUtil.java index fb3331ed4be..f5c7c9c6a85 100644 --- a/Mage.Common/src/mage/utils/CardUtil.java +++ b/Mage.Common/src/mage/utils/CardUtil.java @@ -1,5 +1,7 @@ package mage.utils; +import java.util.List; +import mage.ObjectColor; import mage.cards.Card; import mage.cards.MagePermanent; import mage.constants.CardType; @@ -13,6 +15,12 @@ import mage.view.CardView; */ public class CardUtil { + private static final String regexBlack = ".*\\x7b.{0,2}B.{0,2}\\x7d.*"; + private static final String regexBlue = ".*\\x7b.{0,2}U.{0,2}\\x7d.*"; + private static final String regexRed = ".*\\x7b.{0,2}R.{0,2}\\x7d.*"; + private static final String regexGreen = ".*\\x7b.{0,2}G.{0,2}\\x7d.*"; + private static final String regexWhite = ".*\\x7b.{0,2}W.{0,2}\\x7d.*"; + public static boolean isCreature(CardView card) { return is(card, CardType.CREATURE); } @@ -48,4 +56,34 @@ public class CardUtil { public static boolean isLand(Card card) { return card.getCardType().contains(CardType.LAND); } + + public static int getColorIdentitySortValue(List manaCost, ObjectColor originalColor, List rules) { + ObjectColor color = new ObjectColor(originalColor); + for (String rule : rules) { + rule = rule.replaceAll("(?i)", ""); // Ignoring reminder text in italic + if (rule.matches(regexBlack)) { + color.setBlack(true); + } + if (rule.matches(regexBlue)) { + color.setBlue(true); + } + if (rule.matches(regexGreen)) { + color.setGreen(true); + } + if (rule.matches(regexRed)) { + color.setRed(true); + } + if (rule.matches(regexWhite)) { + color.setWhite(true); + } + } + + int hash = 3; + hash = 23 * hash + (color.isWhite() || manaCost.contains("{W}") ? 1 : 0); + hash = 23 * hash + (color.isBlue() || manaCost.contains("{U}") ? 1 : 0); + hash = 23 * hash + (color.isBlack() || manaCost.contains("{B}") ? 1 : 0); + hash = 23 * hash + (color.isRed() || manaCost.contains("{R}") ? 1 : 0); + hash = 23 * hash + (color.isGreen() || manaCost.contains("{G}") ? 1 : 0); + return hash; + } } diff --git a/Mage.Common/src/mage/utils/MageVersion.java b/Mage.Common/src/mage/utils/MageVersion.java index 805d71e91be..4680bcb2b55 100644 --- a/Mage.Common/src/mage/utils/MageVersion.java +++ b/Mage.Common/src/mage/utils/MageVersion.java @@ -40,7 +40,7 @@ public class MageVersion implements Serializable, Comparable { */ public final static int MAGE_VERSION_MAJOR = 1; public final static int MAGE_VERSION_MINOR = 4; - public final static int MAGE_VERSION_PATCH = 3; + public final static int MAGE_VERSION_PATCH = 5; public final static String MAGE_VERSION_MINOR_PATCH = "v0"; public final static String MAGE_VERSION_INFO = ""; diff --git a/Mage.Common/src/mage/utils/properties/PropertiesUtil.java b/Mage.Common/src/mage/utils/properties/PropertiesUtil.java index 50d1bfdbb1f..87a936131f8 100644 --- a/Mage.Common/src/mage/utils/properties/PropertiesUtil.java +++ b/Mage.Common/src/mage/utils/properties/PropertiesUtil.java @@ -1,7 +1,6 @@ package mage.utils.properties; -import com.j256.ormlite.logger.Logger; -import com.j256.ormlite.logger.LoggerFactory; +import org.apache.log4j.Logger; import java.io.IOException; import java.io.InputStream; @@ -12,7 +11,7 @@ import java.util.Properties; */ public class PropertiesUtil { - private static final Logger logger = LoggerFactory.getLogger(PropertiesUtil.class); + private static final Logger logger = Logger.getLogger(PropertiesUtil.class); private static final String LOG_JDBC_URL = "jdbc:h2:file:./db/mage.h2;AUTO_SERVER=TRUE"; private static final String FEEDBACK_JDBC_URL = "jdbc:h2:file:./db/feedback.h2;AUTO_SERVER=TRUE"; @@ -25,7 +24,7 @@ public class PropertiesUtil { try { properties.load(in); } catch (IOException e) { - logger.error(e, "Couldn't load properties"); + logger.error("Couldn't load properties", e); } } else { logger.warn("No xmage.properties were found on classpath"); diff --git a/Mage.Common/src/mage/view/CardView.java b/Mage.Common/src/mage/view/CardView.java index 6c90e5a66b4..5be823cbe31 100644 --- a/Mage.Common/src/mage/view/CardView.java +++ b/Mage.Common/src/mage/view/CardView.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.UUID; import mage.MageObject; import mage.ObjectColor; -import mage.abilities.Modes; +import mage.abilities.Mode; import mage.abilities.SpellAbility; import mage.abilities.costs.mana.ManaCosts; import mage.cards.Card; @@ -153,7 +153,7 @@ public class CardView extends SimpleCardView { * for morph / face down cards to know which player may see information for * the card * @param showFaceDownCard if true and the card is not on the battelfield, - * also a face dwon card is shown in the view dwon cards will be shown + * also a face down card is shown in the view, face down cards will be shown */ public CardView(Card card, Game game, boolean controlled, boolean showFaceDownCard) { super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.getTokenSetCode(), game != null); @@ -191,6 +191,7 @@ public class CardView extends SimpleCardView { this.power = Integer.toString(card.getPower().getValue()); this.toughness = Integer.toString(card.getToughness().getValue()); this.cardTypes = card.getCardType(); + this.faceDown = ((Permanent) card).isFaceDown(game); } else { // this.hideInfo = true; return; @@ -310,19 +311,16 @@ public class CardView extends SimpleCardView { this.mageObjectType = MageObjectType.SPELL; Spell spell = (Spell) card; for (SpellAbility spellAbility : spell.getSpellAbilities()) { - for (UUID modeId : spellAbility.getModes().getSelectedModes()) { - spellAbility.getModes().setActiveMode(modeId); - if (spellAbility.getTargets().size() > 0) { + for (Mode mode : spellAbility.getModes().getSelectedModes()) { + if (mode.getTargets().size() > 0) { setTargets(spellAbility.getTargets()); } } } // show for modal spell, which mode was choosen if (spell.getSpellAbility().isModal()) { - Modes modes = spell.getSpellAbility().getModes(); - for (UUID modeId : modes.getSelectedModes()) { - modes.setActiveMode(modeId); - this.rules.add("Chosen mode: " + spell.getSpellAbility().getEffects().getText(modes.get(modeId)) + ""); + for (Mode mode : spell.getSpellAbility().getModes().getSelectedModes()) { + this.rules.add("Chosen mode: " + mode.getEffects().getText(mode) + ""); } } } diff --git a/Mage.Common/src/mage/view/CardsView.java b/Mage.Common/src/mage/view/CardsView.java index 2b72e78a1c2..606918a3eec 100644 --- a/Mage.Common/src/mage/view/CardsView.java +++ b/Mage.Common/src/mage/view/CardsView.java @@ -89,6 +89,9 @@ public class CardsView extends LinkedHashMap { case EXILED: case GRAVEYARD: sourceObject = game.getCard(ability.getSourceId()); + if (sourceObject == null) { + sourceObject = game.getPermanent(ability.getSourceId()); + } isCard = true; break; case BATTLEFIELD: @@ -152,6 +155,9 @@ public class CardsView extends LinkedHashMap { for (UUID uuid : abilityTargets) { MageObject mageObject = game.getObject(uuid); if (mageObject != null) { + if ((mageObject instanceof Card) && ((Card) mageObject).isFaceDown(game)) { + continue; + } names.add(GameLog.getColoredObjectIdNameForTooltip(mageObject)); } } diff --git a/Mage.Common/src/mage/view/EmblemView.java b/Mage.Common/src/mage/view/EmblemView.java index e4971d5cecb..1681f05de90 100644 --- a/Mage.Common/src/mage/view/EmblemView.java +++ b/Mage.Common/src/mage/view/EmblemView.java @@ -28,6 +28,13 @@ public class EmblemView implements CommandObjectView, Serializable { rules = emblem.getAbilities().getRules(sourceCard.getName()); } + public EmblemView(Emblem emblem) { + id = emblem.getId(); + name = emblem.getName(); + expansionSetCode = emblem.getExpansionSetCodeForImage(); + rules = emblem.getAbilities().getRules(emblem.getName()); + } + @Override public String getExpansionSetCode() { return expansionSetCode; diff --git a/Mage.Common/src/mage/view/GameView.java b/Mage.Common/src/mage/view/GameView.java index 9f078a75b91..7060d19ab91 100644 --- a/Mage.Common/src/mage/view/GameView.java +++ b/Mage.Common/src/mage/view/GameView.java @@ -62,7 +62,7 @@ public class GameView implements Serializable { private static final long serialVersionUID = 1L; - private static final transient Logger logger = Logger.getLogger(GameView.class); + private static final Logger logger = Logger.getLogger(GameView.class); private final int priorityTime; private final List players = new ArrayList<>(); @@ -103,7 +103,12 @@ public class GameView implements Serializable { Card card = game.getCard(stackObject.getSourceId()); if (card != null) { if (object != null) { - stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, card.getName(), new CardView(card))); + if (object instanceof Permanent) { + boolean controlled = ((Permanent) object).getControllerId().equals(createdForPlayerId); + stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, ((Permanent) object).getName(), new CardView(((Permanent) object), game, controlled, false))); + } else { + stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, card.getName(), new CardView(card, game, false, false))); + } } else { stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, "", new CardView(card))); } @@ -118,6 +123,7 @@ public class GameView implements Serializable { checkPaid(stackObject.getId(), (StackAbility) stackObject); } else if (object instanceof Emblem) { Card sourceCard = game.getCard(((Emblem) object).getSourceId()); + CardView cardView; if (sourceCard != null) { if (!sourceCard.getCardType().contains(CardType.PLANESWALKER)) { if (sourceCard.getSecondCardFace() != null) { @@ -126,20 +132,26 @@ public class GameView implements Serializable { } ((StackAbility) stackObject).setName("Emblem " + sourceCard.getName()); ((StackAbility) stackObject).setExpansionSetCode(sourceCard.getExpansionSetCode()); + cardView = new CardView(new EmblemView(((Emblem) object), sourceCard)); } else { - throw new IllegalArgumentException("Source card for emblem not found."); + cardView = new CardView(new EmblemView((Emblem) object)); } stack.put(stackObject.getId(), - new StackAbilityView(game, (StackAbility) stackObject, object.getName(), new CardView(new EmblemView(((Emblem) object), sourceCard)))); + new StackAbilityView(game, (StackAbility) stackObject, object.getName(), cardView)); checkPaid(stackObject.getId(), ((StackAbility) stackObject)); } else { - StackAbility stackAbility = ((StackAbility) object); - stackAbility.newId(); - stack.put(stackObject.getId(), new CardView(((StackAbility) stackObject))); - checkPaid(stackObject.getId(), ((StackAbility) stackObject)); + if (object instanceof StackAbility) { + StackAbility stackAbility = ((StackAbility) object); + stackAbility.newId(); + stack.put(stackObject.getId(), new CardView(((StackAbility) stackObject))); + checkPaid(stackObject.getId(), ((StackAbility) stackObject)); + } else { + logger.fatal("Object can't be cast to StackAbility: " + object.getName() + " " + object.toString() + " " + object.getClass().toString()); + } } } else { - logger.error("Stack Object for stack ability not found: " + stackObject.getStackAbility().getRule()); + // can happen if a player times out while ability is on the stack + logger.debug("Stack Object for stack ability not found: " + stackObject.getStackAbility().getRule()); } } else { // Spell @@ -174,7 +186,7 @@ public class GameView implements Serializable { } if (isPlayer) { // has only to be set for active palyer with priority (e.g. pay mana by delve or Quenchable Fire special action) - if (state.getPriorityPlayerId() == createdForPlayerId && createdForPlayer != null) { + if (createdForPlayer != null && createdForPlayerId.equals(state.getPriorityPlayerId())) { this.special = state.getSpecialActions().getControlledBy(state.getPriorityPlayerId(), createdForPlayer.isInPayManaMode()).size() > 0; } } else { diff --git a/Mage.Common/src/mage/view/PermanentView.java b/Mage.Common/src/mage/view/PermanentView.java index 2b7fe476f00..9ec311a269d 100644 --- a/Mage.Common/src/mage/view/PermanentView.java +++ b/Mage.Common/src/mage/view/PermanentView.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.view; import java.util.ArrayList; @@ -44,6 +43,7 @@ import mage.players.Player; * @author BetaSteward_at_googlemail.com */ public class PermanentView extends CardView { + private static final long serialVersionUID = 1L; private boolean tapped; @@ -78,7 +78,7 @@ public class PermanentView extends CardView { } this.attachedTo = permanent.getAttachedTo(); if (isToken()) { - original = new CardView(((PermanentToken)permanent).getToken()); + original = new CardView(((PermanentToken) permanent).getToken()); original.expansionSetCode = permanent.getExpansionSetCode(); tokenSetCode = original.getTokenSetCode(); } else { @@ -98,7 +98,7 @@ public class PermanentView extends CardView { this.alternateName = permanent.getFlipCardName(); this.originalName = this.getName(); } else { - if (controlled // controller may always know + if (controlled // controller may always know || (!morphed && !manifested)) { // others don't know for morph or transformed cards this.alternateName = original.getName(); this.originalName = this.getName(); @@ -113,11 +113,11 @@ public class PermanentView extends CardView { this.nameOwner = ""; } } else { - this.nameOwner = ""; + this.nameOwner = ""; } - + if (permanent.isFaceDown(game) && card != null) { - if (controlled){ + if (controlled) { // must be a morphed or manifested card for (Ability permanentAbility : permanent.getAbilities()) { if (permanentAbility instanceof TurnFaceUpAbility && !permanentAbility.getRuleVisible()) { @@ -131,17 +131,17 @@ public class PermanentView extends CardView { this.displayName = card.getName(); this.expansionSetCode = card.getExpansionSetCode(); this.cardNumber = card.getCardNumber(); - } else{ - if (permanent.isMorphed()) { - this.rules.add("If the controller has priority, he or she may turn this permanent face up." + - " This is a special action; it doesn’t use the stack. To do this he or she pays the morph costs," + - " then turns this permanent face up."); - }else if (permanent.isManifested()) { - this.rules.add("A manifested creature card can be turned face up any time for it's mana cost." + - " A face-down card can also be turned face up for its morph cost."); + } else { + if (permanent.isManifested()) { + this.rules.add("A manifested creature card can be turned face up any time for it's mana cost." + + " A face-down card can also be turned face up for its morph cost."); + } else if (permanent.isMorphed()) { + this.rules.add("If the controller has priority, he or she may turn this permanent face up." + + " This is a special action; it doesn’t use the stack. To do this he or she pays the morph costs," + + " then turns this permanent face up."); } } - } + } // determines if shown in it's own column if (permanent.getAttachedTo() != null) { attachedToPermanent = game.getPermanent(permanent.getAttachedTo()) != null; @@ -170,7 +170,7 @@ public class PermanentView extends CardView { return phasedIn; } - public boolean hasSummoningSickness(){ + public boolean hasSummoningSickness() { return summoningSickness; } @@ -209,6 +209,7 @@ public class PermanentView extends CardView { public boolean isMorphed() { return morphed; } + public boolean isManifested() { return manifested; } diff --git a/Mage.Common/src/mage/view/PlayerView.java b/Mage.Common/src/mage/view/PlayerView.java index ce66a5ffbe0..49b5b3d8e54 100644 --- a/Mage.Common/src/mage/view/PlayerView.java +++ b/Mage.Common/src/mage/view/PlayerView.java @@ -58,6 +58,10 @@ public class PlayerView implements Serializable { private final String name; private final int life; private final int poison; + private final int experience; + private final int wins; + private final int winsNeeded; + private final long deckHashCode; private final int libraryCount; private final int handCount; private final boolean isActive; @@ -85,6 +89,10 @@ public class PlayerView implements Serializable { this.name = player.getName(); this.life = player.getLife(); this.poison = player.getCounters().getCount(CounterType.POISON); + this.experience = player.getCounters().getCount(CounterType.EXPERIENCE); + this.wins = player.getMatchPlayer().getWins(); + this.winsNeeded = player.getMatchPlayer().getWinsNeeded(); + this.deckHashCode = player.getMatchPlayer().getDeck().getDeckHashCode(); this.libraryCount = player.getLibrary().size(); this.handCount = player.getHand().size(); this.manaPool = new ManaPoolView(player.getManaPool()); @@ -132,6 +140,8 @@ public class PlayerView implements Serializable { } } commandList.add(new EmblemView(emblem, sourceCard)); + } else { + commandList.add(new EmblemView(emblem)); } } } else if (commandObject instanceof Commander) { @@ -181,10 +191,26 @@ public class PlayerView implements Serializable { return this.poison; } + public int getExperience() { + return this.experience; + } + public int getLibraryCount() { return this.libraryCount; } + public int getWins() { + return wins; + } + + public int getWinsNeeded() { + return winsNeeded; + } + + public long getDeckHashCode() { + return deckHashCode; + } + public int getHandCount() { return this.handCount; } @@ -229,7 +255,7 @@ public class PlayerView implements Serializable { return this.userData; } - public List getCommadObjectList() { + public List getCommandObjectList() { return commandList; } diff --git a/Mage.Common/src/mage/view/SeatView.java b/Mage.Common/src/mage/view/SeatView.java index f8f79a397e2..d812dadebd6 100644 --- a/Mage.Common/src/mage/view/SeatView.java +++ b/Mage.Common/src/mage/view/SeatView.java @@ -30,6 +30,7 @@ package mage.view; import java.io.Serializable; import java.util.UUID; import mage.game.Seat; +import mage.players.net.UserData; /** * @@ -48,7 +49,11 @@ public class SeatView implements Serializable { if (seat.getPlayer() != null) { this.playerId = seat.getPlayer().getId(); this.playerName = seat.getPlayer().getName(); - this.flagName = seat.getPlayer().getUserData().getFlagName(); + if (seat.getPlayer().getUserData() == null) { + this.flagName = UserData.getDefaultFlagName(); + } else { + this.flagName = seat.getPlayer().getUserData().getFlagName(); + } } else { // Empty seat this.playerName = ""; diff --git a/Mage.Common/src/mage/view/StackAbilityView.java b/Mage.Common/src/mage/view/StackAbilityView.java index 6fb4d3c4863..815c0ec13d1 100644 --- a/Mage.Common/src/mage/view/StackAbilityView.java +++ b/Mage.Common/src/mage/view/StackAbilityView.java @@ -31,6 +31,7 @@ import java.util.ArrayList; import java.util.List; import java.util.UUID; import mage.MageObject; +import mage.abilities.Mode; import mage.abilities.Modes; import mage.abilities.effects.Effect; import mage.cards.Card; @@ -98,13 +99,12 @@ public class StackAbilityView extends CardView { private void updateTargets(Game game, StackAbility ability) { List names = new ArrayList<>(); - for (UUID modeId : ability.getModes().getSelectedModes()) { - ability.getModes().setActiveMode(modeId); - if (ability.getTargets().size() > 0) { - setTargets(ability.getTargets()); + for (Mode mode : ability.getModes().getSelectedModes()) { + if (mode.getTargets().size() > 0) { + setTargets(mode.getTargets()); } else { List targetList = new ArrayList<>(); - for (Effect effect : ability.getEffects()) { + for (Effect effect : mode.getEffects()) { TargetPointer targetPointer = effect.getTargetPointer(); if (targetPointer instanceof FixedTarget) { targetList.add(((FixedTarget) targetPointer).getTarget()); @@ -132,9 +132,8 @@ public class StackAbilityView extends CardView { // show for modal ability, which mode was choosen if (ability.isModal()) { Modes modes = ability.getModes(); - for (UUID modeId : modes.getSelectedModes()) { - modes.setActiveMode(modeId); - this.rules.add("Chosen mode: " + ability.getEffects().getText(modes.get(modeId)) + ""); + for (Mode mode : modes.getSelectedModes()) { + this.rules.add("Chosen mode: " + mode.getEffects().getText(mode) + ""); } } } diff --git a/Mage.Common/src/mage/view/UserDataView.java b/Mage.Common/src/mage/view/UserDataView.java index 242fa32ec2d..c60bbe88c54 100644 --- a/Mage.Common/src/mage/view/UserDataView.java +++ b/Mage.Common/src/mage/view/UserDataView.java @@ -20,10 +20,14 @@ public class UserDataView implements Serializable { String flagName; protected boolean askMoveToGraveOrder; - static UserData getDefaultUserDataView() { + static UserData getDefaultUserData() { return UserData.getDefaultUserDataView(); } + public static UserDataView getDefaultUserDataView() { + return new UserDataView(getDefaultUserData()); + } + public UserDataView(int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName, boolean askMoveToGraveOrder) { this.avatarId = avatarId; diff --git a/Mage.Plugins/Mage.Counter.Plugin/pom.xml b/Mage.Plugins/Mage.Counter.Plugin/pom.xml index df8cc7328b3..9005ebb0e46 100644 --- a/Mage.Plugins/Mage.Counter.Plugin/pom.xml +++ b/Mage.Plugins/Mage.Counter.Plugin/pom.xml @@ -7,7 +7,7 @@ org.mage mage-plugins - 1.4.3 + 1.4.5 mage-counter-plugin diff --git a/Mage.Plugins/Mage.Theme.Plugin/pom.xml b/Mage.Plugins/Mage.Theme.Plugin/pom.xml deleted file mode 100644 index eebc730e4a8..00000000000 --- a/Mage.Plugins/Mage.Theme.Plugin/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - 4.0.0 - - - org.mage - mage-plugins - 1.4.3 - - - mage-theme-plugin - jar - 0.5 - Mage Theme Plugin - Contains resources for drawing background - - - - ${project.groupId} - mage-common - ${mage-version} - - - log4j - log4j - provided - - - ${project.groupId} - mage-client - 1.4.3 - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.7 - 1.7 - - - - - mage-theme-plugin - - diff --git a/Mage.Plugins/Mage.Theme.Plugin/src/main/java/org/mage/plugins/theme/ThemePluginImpl.java b/Mage.Plugins/Mage.Theme.Plugin/src/main/java/org/mage/plugins/theme/ThemePluginImpl.java deleted file mode 100644 index f2a10884a10..00000000000 --- a/Mage.Plugins/Mage.Theme.Plugin/src/main/java/org/mage/plugins/theme/ThemePluginImpl.java +++ /dev/null @@ -1,210 +0,0 @@ -package org.mage.plugins.theme; - -import mage.components.ImagePanel; -import mage.interfaces.plugin.ThemePlugin; -import mage.client.dialog.PreferencesDialog; -import net.xeoh.plugins.base.annotations.PluginImplementation; -import net.xeoh.plugins.base.annotations.events.Init; -import net.xeoh.plugins.base.annotations.events.PluginLoaded; -import net.xeoh.plugins.base.annotations.meta.Author; -import org.apache.log4j.Logger; - -import javax.imageio.ImageIO; -import javax.swing.*; -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.*; -import java.io.InputStream; -import java.util.Map; - -@PluginImplementation -@Author(name = "nantuko") -public class ThemePluginImpl implements ThemePlugin { - - private static final Logger log = Logger.getLogger(ThemePluginImpl.class); - private static BufferedImage background; - private List flist = new List(); - private String BackgroundDir = "plugins" + File.separator + "plugin.data" + File.separator - + "background" + File.separator; - @Init - public void init() { - } - - @PluginLoaded - public void newPlugin(ThemePlugin plugin) { - log.info(plugin.toString() + " has been loaded."); - } - - public String toString() { - return "[Theme plugin, version 0.5]"; - } - - public boolean loadimages(){ - File filedir = new File(BackgroundDir); - File[] filelist = filedir.listFiles(); - if(filelist == null) return false; - if(filelist.length == 0) return false; - for(File f:filelist){ - String filename = f.getName().toLowerCase(); - if(filename != null && (filename.endsWith(".png") || filename.endsWith(".jpg") - || filename.endsWith(".bmp"))){ - flist.add(filename); - } - } - if(flist.getItemCount() == 0) return false; - return true; - } - - public void applyInGame(Map ui) { - BufferedImage background; - try { - - if(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_BATTLEFIELD_IMAGE_DEFAULT, - "true").equals("true")){ - - background = loadbuffer_default(); - - }else if(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_BATTLEFIELD_IMAGE_RANDOM, - "true").equals("true")){ - - background = loadbuffer_random(); - - }else if(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_BATTLEFIELD_IMAGE, "") != null){ - - background = loadbuffer_selected(); - - }else{ - background = loadbuffer_default(); - } - - - - /* - if(loadimages()){ - int it = (int)Math.abs(Math.random()*(flist.getItemCount())); - filename = BackgroundDir + flist.getItem(it); - background = ImageIO.read(new File(filename)); - }else{ - filename = "/dragon.png"; - InputStream is = this.getClass().getResourceAsStream(filename); - if (is == null) - throw new FileNotFoundException("Couldn't find " + filename + " in resources."); - background = ImageIO.read(is); - } - */ - if (background == null) { - throw new FileNotFoundException("Couldn't find background file in resources."); - } - - if (ui.containsKey("gamePanel") && ui.containsKey("jLayeredPane")) { - ImagePanel bgPanel = new ImagePanel(background, ImagePanel.TILED); - - unsetOpaque(ui.get("jSplitPane1")); - unsetOpaque(ui.get("pnlBattlefield")); - unsetOpaque(ui.get("jPanel3")); - unsetOpaque(ui.get("hand")); - unsetOpaque(ui.get("gameChatPanel")); - unsetOpaque(ui.get("userChatPanel")); - - ui.get("gamePanel").remove(ui.get("jLayeredPane")); - bgPanel.add(ui.get("jLayeredPane")); - ui.get("gamePanel").add(bgPanel); - } else { - log.error("error: no components"); - } - } catch (Exception e) { - log.error(e.getMessage(), e); - return; - } - } - - - private BufferedImage loadbuffer_default() throws IOException{ - String filename = "/dragon.png"; - BufferedImage res; - InputStream is = this.getClass().getResourceAsStream(filename); - res = ImageIO.read(is); - return res; - } - - private BufferedImage loadbuffer_random() throws IOException{ - BufferedImage res; - if(loadimages()){ - int it = (int)Math.abs(Math.random()*(flist.getItemCount())); - String filename = BackgroundDir + flist.getItem(it); - res = ImageIO.read(new File(filename)); - return res; - } - return null; - } - - private BufferedImage loadbuffer_selected() throws IOException{ - BufferedImage res; - String path = PreferencesDialog.getCachedValue(PreferencesDialog. - KEY_BATTLEFIELD_IMAGE, ""); - if(path != null){ - res = ImageIO.read(new File(path)); - return res; - } - return null; - } - - - public JComponent updateTable(Map ui) { - ImagePanel bgPanel = createImagePanelInstance(); - - unsetOpaque(ui.get("jScrollPane1")); - unsetOpaque(ui.get("jPanel1")); - unsetOpaque(ui.get("tablesPanel")); - JComponent viewport = ui.get("jScrollPane1ViewPort"); - if (viewport != null) { - viewport.setBackground(new Color(255,255,255,50)); - } - return bgPanel; - } - - private ImagePanel createImagePanelInstance() { - if (background == null) { - synchronized (ThemePluginImpl.class) { - if (background == null) { - String filename = "/background.png"; - try { - if(PreferencesDialog.getCachedValue(PreferencesDialog. - KEY_BACKGROUND_IMAGE_DEFAULT, "true").equals("true")){ - InputStream is = this.getClass().getResourceAsStream(filename); - if (is == null) - throw new FileNotFoundException("Couldn't find " + filename + " in resources."); - background = ImageIO.read(is); - }else if(PreferencesDialog.getCachedValue(PreferencesDialog. - KEY_BACKGROUND_IMAGE, "") != null){ - String path = PreferencesDialog.getCachedValue(PreferencesDialog. - KEY_BATTLEFIELD_IMAGE, ""); - if(path != null){ - background = ImageIO.read(new File(path)); - }else{ - InputStream is = this.getClass().getResourceAsStream(filename); - if (is == null) - throw new FileNotFoundException("Couldn't find " + filename + " in resources."); - background = ImageIO.read(is); - } - } - - if (background == null) - throw new FileNotFoundException("Couldn't find " + filename + " in resources."); - } catch (Exception e) { - log.error(e.getMessage(), e); - return null; - } - } - } - } - return new ImagePanel(background, ImagePanel.SCALED); - } - - private void unsetOpaque(JComponent c) { - if (c != null) { - c.setOpaque(false); - } - } -} diff --git a/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/background.png b/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/background.png deleted file mode 100644 index 01acc151f2c..00000000000 Binary files a/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/background.png and /dev/null differ diff --git a/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/dk_gray.jpg b/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/dk_gray.jpg deleted file mode 100644 index 2e0776d6068..00000000000 Binary files a/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/dk_gray.jpg and /dev/null differ diff --git a/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/dragon.png b/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/dragon.png deleted file mode 100644 index 634f56c21c8..00000000000 Binary files a/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/dragon.png and /dev/null differ diff --git a/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/green.jpg b/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/green.jpg deleted file mode 100644 index f5705253297..00000000000 Binary files a/Mage.Plugins/Mage.Theme.Plugin/src/main/resources/green.jpg and /dev/null differ diff --git a/Mage.Plugins/pom.xml b/Mage.Plugins/pom.xml index 4e6b8ad8521..b8ec0e9e444 100644 --- a/Mage.Plugins/pom.xml +++ b/Mage.Plugins/pom.xml @@ -7,7 +7,7 @@ org.mage mage-root - 1.4.3 + 1.4.5 mage-plugins @@ -16,7 +16,6 @@ Mage Plugins POM - Mage.Theme.Plugin Mage.Counter.Plugin diff --git a/Mage.Server.Console/pom.xml b/Mage.Server.Console/pom.xml index 77cb534fd1d..01ecd66db97 100644 --- a/Mage.Server.Console/pom.xml +++ b/Mage.Server.Console/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.3 + 1.4.5 org.mage diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml b/Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml index dabc671779d..64f1bfa7580 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-deck-constructed diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/BattleForZendikarBlock.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/BattleForZendikarBlock.java new file mode 100644 index 00000000000..10fc42fd8bc --- /dev/null +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/BattleForZendikarBlock.java @@ -0,0 +1,44 @@ +/* +* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.deck; + +import mage.cards.decks.Constructed; + +/** + * + * @author fireshoes + */ +public class BattleForZendikarBlock extends Constructed { + + public BattleForZendikarBlock() { + super("Constructed - Battle for Zendikar Block"); + setCodes.add("BFZ"); + setCodes.add("OGW"); + } +} diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/DuelCommander.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/DuelCommander.java index feb71b5e85a..a380531598e 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/DuelCommander.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/DuelCommander.java @@ -64,11 +64,12 @@ public class DuelCommander extends Commander { banned.add("Mox Pearl"); banned.add("Mox Ruby"); banned.add("Mox Sapphire"); - banned.add("Mystical Tutor"); // banned effective July 17, 2015 + banned.add("Mystical Tutor"); banned.add("Natural Order"); banned.add("Necropotence"); banned.add("Oath of Druids"); banned.add("Protean Hulk"); + banned.add("Sensei's Divining Top"); banned.add("Serra Ascendant"); banned.add("Shahrazad"); banned.add("Sol Ring"); diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalStandard.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalType2.java similarity index 94% rename from Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalStandard.java rename to Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalType2.java index 9fef3463b57..08e2025ddb2 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalStandard.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/HistoricalType2.java @@ -23,7 +23,7 @@ import mage.constants.SetType; * * @author Marthinwurer (at gmail.com) */ -public class HistoricalStandard extends Constructed { +public class HistoricalType2 extends Constructed { /* * This array stores the set codes of each standard up to @@ -34,9 +34,9 @@ public class HistoricalStandard extends Constructed { {"DRK", "FEM", "4ED"}, // 2nd standard: 4th, Fallen Empires, Ice Age, Chronicles, Homelands, // Alliances, and Mirage. - {"FEM", "4ED", "ICE", "HML", "ALL", "MIR"}, + {"FEM", "4ED", "ICE", "CHR", "HML", "ALL", "MIR"}, // 3rd standard: 4th, Chronicles, Alliances, Mirage, Visions. - {"4ED", "ALL", "MIR", "VIS"}, + {"4ED", "CHR", "ALL", "MIR", "VIS"}, // 4th Standard: Ice Age, Homelands, Alliances, Mirage, Visions, 5th, // and Weatherlight. {"ICE", "HML", "ALL", "MIR", "VIS", "5ED", "WTH"}, @@ -73,9 +73,9 @@ public class HistoricalStandard extends Constructed { // 18th Standard {"9ED", "RAV", "GPT", "DIS", "CSP", "TSP", "TSB", "PLC", "FUT"}, // 19th Standard - {"10E", "RAV", "GPT", "DIS", "CSP", "TSP", "PLC", "FUT"}, + {"10E", "RAV", "GPT", "DIS", "CSP", "TSP", "TSB", "PLC", "FUT"}, // 20th Standard - {"10E", "CSP", "TSP", "PLC", "FUT", "LRW", "MOR", "SHM", "EVE"}, + {"10E", "CSP", "TSP", "TSB", "PLC", "FUT", "LRW", "MOR", "SHM", "EVE"}, // 21st Standard {"10E", "LRW", "MOR", "SHM", "EVE", "ALA", "CON", "ARB"} }; @@ -84,15 +84,17 @@ public class HistoricalStandard extends Constructed { * Constructor. Don't need to mess with any of the sets yet; that will be * done in the overridden validate function. */ - public HistoricalStandard() { - super("Constructed - Historical Standard"); + public HistoricalType2() { + super("Constructed - Historical Type 2"); // banned cards banned.add("Balance"); + banned.add("Earthcraft"); banned.add("Memory Jar"); banned.add("Mind Over Matter"); banned.add("Mind Twist"); banned.add("Skullclamp"); + banned.add("Time Spiral"); banned.add("Tolarian Academy"); banned.add("Yawgmoth's Bargain"); } diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Legacy.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Legacy.java index f06a58d238f..f8c24589b7b 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Legacy.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Legacy.java @@ -46,7 +46,6 @@ public class Legacy extends Constructed { banned.add("Balance"); banned.add("Bazaar of Baghdad"); banned.add("Black Lotus"); - banned.add("Black Vise"); banned.add("Brago's Favor"); banned.add("Bronze Tablet"); banned.add("Channel"); @@ -56,6 +55,7 @@ public class Legacy extends Constructed { banned.add("Demonic Attorney"); banned.add("Demonic Consultation"); banned.add("Demonic Tutor"); + banned.add("Dig Through Time"); banned.add("Double Stroke"); banned.add("Earthcraft"); banned.add("Falling Star"); @@ -104,7 +104,7 @@ public class Legacy extends Constructed { banned.add("Timmerian Fiends"); banned.add("Tinker"); banned.add("Tolarian Academy"); - banned.add("Treasure Cruise"); // banned effective January 23, 2015 + banned.add("Treasure Cruise"); banned.add("Unexpected Potential"); banned.add("Vampiric Tutor"); banned.add("Wheel of Fortune"); diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Momir.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Momir.java new file mode 100644 index 00000000000..48a05c3c81e --- /dev/null +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Momir.java @@ -0,0 +1,70 @@ +/* + * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.deck; + +import mage.cards.Card; +import mage.cards.decks.Deck; +import mage.cards.decks.DeckValidator; + +import java.util.*; + +/** + * + * @author nigelzor + */ +public class Momir extends DeckValidator { + + public Momir() { + this("Momir Basic"); + } + + public Momir(String name) { + super(name); + } + + @Override + public boolean validate(Deck deck) { + boolean valid = true; + + if (deck.getCards().size() != 60) { + invalid.put("Deck", "Must contain 60 cards: has " + deck.getCards().size() + " cards"); + valid = false; + } + + List basicLandNames = new ArrayList<>(Arrays.asList("Forest", "Island", "Mountain", "Swamp", "Plains")); + for (Card card : deck.getCards()) { + if (!basicLandNames.contains(card.getName())) { + invalid.put(card.getName(), "Only basic lands are allowed"); + valid = false; + } + } + + return valid; + } + +} diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/ShardsOfAlaraBlock.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/ShardsOfAlaraBlock.java index 44fc5e3e6b3..c8915b5a8b1 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/ShardsOfAlaraBlock.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/ShardsOfAlaraBlock.java @@ -37,7 +37,7 @@ import mage.cards.decks.Constructed; public class ShardsOfAlaraBlock extends Constructed { public ShardsOfAlaraBlock() { - super("Constructed - Shards Of Alara Block"); + super("Constructed - Shards of Alara Block"); setCodes.add("ALA"); setCodes.add("CON"); setCodes.add("ARB"); diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperStandard.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperType2.java similarity index 95% rename from Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperStandard.java rename to Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperType2.java index 4eb4d5c4e8a..70780d45796 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperStandard.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/SuperType2.java @@ -18,13 +18,13 @@ import mage.constants.SetType; * * This class was originally made to work with the historical standard ruleset. * Data taken from http://thattournament.website/historic-tournament.php (site - * changed, originally thtp://mtgt.nfshost.com/historic-tournament.php) + * changed, originally http://mtgt.nfshost.com/historic-tournament.php) * * If there are any questions or corrections, feel free to contact me. * * @author Marthinwurer (at gmail.com) */ -public class SuperStandard extends Constructed { +public class SuperType2 extends Constructed { /* * This array stores the set codes of each standard up to @@ -49,9 +49,9 @@ public class SuperStandard extends Constructed { // 18th Standard {"9ED", "RAV", "GPT", "DIS", "CSP", "TSP", "TSB", "PLC", "FUT"}, // 19th Standard - {"10E", "RAV", "GPT", "DIS", "CSP", "TSP", "PLC", "FUT"}, + {"10E", "RAV", "GPT", "DIS", "CSP", "TSP", "TSB", "PLC", "FUT"}, // 20th Standard - {"10E", "CSP", "TSP", "PLC", "FUT", "LRW", "MOR", "SHM", "EVE"}, + {"10E", "CSP", "TSP", "TSB", "PLC", "FUT", "LRW", "MOR", "SHM", "EVE"}, // 21st Standard {"10E", "LRW", "MOR", "SHM", "EVE", "ALA", "CON", "ARB"} }; @@ -60,8 +60,8 @@ public class SuperStandard extends Constructed { * Constructor. Don't need to mess with any of the sets yet; that will be * done in the overridden validate function. */ - public SuperStandard() { - super("Constructed - Super Standard"); + public SuperType2() { + super("Constructed - Super Type 2"); banned.add("Ancient Den"); banned.add("Disciple of the Vault"); diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Vintage.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Vintage.java index c329a3accac..ef3efea54f2 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Vintage.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Vintage.java @@ -70,8 +70,10 @@ public class Vintage extends Constructed { restricted.add("Black Lotus"); restricted.add("Brainstorm"); restricted.add("Channel"); + restricted.add("Chalice of the Void"); restricted.add("Demonic Consultation"); restricted.add("Demonic Tutor"); + restricted.add("Dig Through Time"); restricted.add("Fastbond"); restricted.add("Flash"); restricted.add("Imperial Seal"); @@ -93,13 +95,12 @@ public class Vintage extends Constructed { restricted.add("Ponder"); restricted.add("Sol Ring"); restricted.add("Strip Mine"); - restricted.add("Thirst for Knowledge"); restricted.add("Time Vault"); restricted.add("Time Walk"); restricted.add("Timetwister"); restricted.add("Tinker"); restricted.add("Tolarian Academy"); - restricted.add("Treasure Cruise"); // banned effective January 23, 2015 + restricted.add("Treasure Cruise"); restricted.add("Trinisphere"); restricted.add("Vampiric Tutor"); restricted.add("Wheel of Fortune"); diff --git a/Mage.Server.Plugins/Mage.Deck.Limited/pom.xml b/Mage.Server.Plugins/Mage.Deck.Limited/pom.xml index 3ab629a71a6..35b61af4df8 100644 --- a/Mage.Server.Plugins/Mage.Deck.Limited/pom.xml +++ b/Mage.Server.Plugins/Mage.Deck.Limited/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-deck-limited diff --git a/Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml b/Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml index 66972c3a272..009e2da37e0 100644 --- a/Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml +++ b/Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-game-commanderduel diff --git a/Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/pom.xml b/Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/pom.xml index ccfa64fc609..faadbdb0d99 100644 --- a/Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/pom.xml +++ b/Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/pom.xml @@ -6,7 +6,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-game-commanderfreeforall diff --git a/Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml b/Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml index a608c789705..75f223eebdf 100644 --- a/Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml +++ b/Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-game-freeforall diff --git a/Mage.Server.Plugins/Mage.Game.MomirDuel/pom.xml b/Mage.Server.Plugins/Mage.Game.MomirDuel/pom.xml new file mode 100644 index 00000000000..828f8c1cdd5 --- /dev/null +++ b/Mage.Server.Plugins/Mage.Game.MomirDuel/pom.xml @@ -0,0 +1,50 @@ + + + + 4.0.0 + + + org.mage + mage-server-plugins + 1.4.5 + + + mage-game-momirduel + jar + Mage Game Momir Basic Two Player + + + + ${project.groupId} + mage + ${project.version} + + + + + src + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.7 + 1.7 + + + + maven-resources-plugin + + UTF-8 + + + + + + mage-game-momirduel + + + + + diff --git a/Mage.Server.Plugins/Mage.Game.MomirDuel/src/mage/game/MomirDuel.java b/Mage.Server.Plugins/Mage.Game.MomirDuel/src/mage/game/MomirDuel.java new file mode 100644 index 00000000000..e34dd81d2a9 --- /dev/null +++ b/Mage.Server.Plugins/Mage.Game.MomirDuel/src/mage/game/MomirDuel.java @@ -0,0 +1,159 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.game; + +import mage.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.VariableManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.InfoEffect; +import mage.cards.Card; +import mage.cards.repository.CardCriteria; +import mage.cards.repository.CardInfo; +import mage.cards.repository.CardRepository; +import mage.constants.*; +import mage.game.command.Emblem; +import mage.game.match.MatchType; +import mage.game.permanent.token.EmptyToken; +import mage.game.turn.TurnMod; +import mage.players.Player; +import mage.util.CardUtil; + +import java.util.*; + +/** + * + * @author nigelzor + */ +public class MomirDuel extends GameImpl { + + public MomirDuel(MultiplayerAttackOption attackOption, RangeOfInfluence range, int freeMulligans, int startLife) { + super(attackOption, range, freeMulligans, startLife); + } + + public MomirDuel(final MomirDuel game) { + super(game); + } + + @Override + public MatchType getGameType() { + return new MomirDuelType(); + } + + @Override + public int getNumPlayers() { + return 2; + } + + @Override + protected void init(UUID choosingPlayerId) { + Ability ability = new SimpleStaticAbility(Zone.COMMAND, new InfoEffect("Vanguard effects")); + for (UUID playerId : state.getPlayerList(startingPlayerId)) { + Player player = getPlayer(playerId); + if (player != null) { + addEmblem(new MomirEmblem(), ability, playerId); + } + } + getState().addAbility(ability, null); + super.init(choosingPlayerId); + state.getTurnMods().add(new TurnMod(startingPlayerId, PhaseStep.DRAW)); + } + + @Override + public Set getOpponents(UUID playerId) { + Set opponents = new HashSet<>(); + for (UUID opponentId: this.getPlayer(playerId).getInRange()) { + if (!opponentId.equals(playerId)) { + opponents.add(opponentId); + } + } + return opponents; + } + + @Override + public boolean isOpponent(Player player, UUID playerToCheck) { + return !player.getId().equals(playerToCheck); + } + + @Override + public MomirDuel copy() { + return new MomirDuel(this); + } + +} + +// faking Vanguard as an Emblem; need to come back to this and add a new type of CommandObject +class MomirEmblem extends Emblem { + + public MomirEmblem() { + setName("Momir Vig, Simic Visionary"); + + // {X}, Discard a card: Put a token into play as a copy of a random creature card with converted mana cost X. Play this ability only any time you could play a sorcery and only once each turn. + LimitedTimesPerTurnActivatedAbility ability = new LimitedTimesPerTurnActivatedAbility(Zone.COMMAND, new MomirEffect(), new VariableManaCost()); + ability.addCost(new DiscardCardCost()); + ability.setTiming(TimingRule.SORCERY); + this.getAbilities().add(ability); + + } +} + +class MomirEffect extends OneShotEffect { + + private static final Random rnd = new Random(); + + public MomirEffect() { + super(Outcome.PutCreatureInPlay); + } + + public MomirEffect(MomirEffect effect) { + super(effect); + staticText = "Put a token into play as a copy of a random creature card with converted mana cost X"; + } + + @Override + public MomirEffect copy() { + return new MomirEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int value = source.getManaCostsToPay().getX(); + // should this be random across card names, or card printings? + CardCriteria criteria = new CardCriteria().types(CardType.CREATURE).convertedManaCost(value); + List options = CardRepository.instance.findCards(criteria); + if (options != null && !options.isEmpty()) { + Card card = options.get(rnd.nextInt(options.size())).getCard(); + EmptyToken token = new EmptyToken(); + CardUtil.copyTo(token).from(card); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), false, false); + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Server.Plugins/Mage.Game.MomirDuel/src/mage/game/MomirDuelMatch.java b/Mage.Server.Plugins/Mage.Game.MomirDuel/src/mage/game/MomirDuelMatch.java new file mode 100644 index 00000000000..9f91e749f05 --- /dev/null +++ b/Mage.Server.Plugins/Mage.Game.MomirDuel/src/mage/game/MomirDuelMatch.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.game; + +import mage.game.match.MatchImpl; +import mage.game.match.MatchOptions; + +/** + * + * @author nigelzor + */ +public class MomirDuelMatch extends MatchImpl { + + public MomirDuelMatch(MatchOptions options) { + super(options); + } + + @Override + public void startGame() throws GameException { + // Momir Vig, Simic Visionary gives +4 starting life + int startLife = 24; + + MomirDuel game = new MomirDuel(options.getAttackOption(), options.getRange(), options.getFreeMulligans(), startLife); + game.setStartMessage(this.createGameStartMessage()); + + this.initGame(game); + games.add(game); + } + +} diff --git a/Mage.Server.Plugins/Mage.Game.MomirDuel/src/mage/game/MomirDuelType.java b/Mage.Server.Plugins/Mage.Game.MomirDuel/src/mage/game/MomirDuelType.java new file mode 100644 index 00000000000..4ec7925477f --- /dev/null +++ b/Mage.Server.Plugins/Mage.Game.MomirDuel/src/mage/game/MomirDuelType.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.game; + +import mage.game.match.MatchType; + +/** + * + * @author nigelzor + */ +public class MomirDuelType extends MatchType { + + public MomirDuelType() { + this.name = "Momir Basic Two Player Duel"; + this.maxPlayers = 2; + this.minPlayers = 2; + this.numTeams = 0; + this.useAttackOption = false; + this.useRange = false; + this.sideboardingAllowed = true; + } + + protected MomirDuelType(final MomirDuelType matchType){ + super(matchType); + } + + @Override + public MomirDuelType copy() { + return new MomirDuelType(this); + } + +} diff --git a/Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml b/Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml index 7f1ff12438f..bbeeed59005 100644 --- a/Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml +++ b/Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-game-tinyleadersduel diff --git a/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml b/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml index 7c6e74649f0..a3d7867c387 100644 --- a/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml +++ b/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-game-twoplayerduel diff --git a/Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml b/Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml index bf21ad2d2fe..7ee253d4b6b 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml +++ b/Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-player-ai-draftbot diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml b/Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml index 4495a41f8a6..9d55f31bbde 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-player-ai-ma diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java index 66fc062f4d7..37cce686334 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer6.java @@ -104,6 +104,7 @@ import mage.players.Player; import mage.target.Target; import mage.target.TargetCard; import mage.target.Targets; +import org.apache.log4j.Logger; /** * @@ -111,7 +112,7 @@ import mage.target.Targets; */ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { - private static final transient org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(ComputerPlayer6.class); + private static final Logger logger = Logger.getLogger(ComputerPlayer6.class); private static final ExecutorService pool = Executors.newFixedThreadPool(1); protected int maxDepth; protected int maxNodes; @@ -436,29 +437,32 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { } protected void resolve(SimulationNode2 node, int depth, Game game) { - StackObject ability = game.getStack().pop(); - if (ability instanceof StackAbility) { - SearchEffect effect = getSearchEffect((StackAbility) ability); - if (effect != null && ability.getControllerId().equals(playerId)) { + StackObject stackObject = game.getStack().getFirst(); + if (stackObject instanceof StackAbility) { + SearchEffect effect = getSearchEffect((StackAbility) stackObject); + if (effect != null && stackObject.getControllerId().equals(playerId)) { Target target = effect.getTarget(); if (!target.doneChosing()) { - for (UUID targetId : target.possibleTargets(ability.getSourceId(), ability.getControllerId(), game)) { + for (UUID targetId : target.possibleTargets(stackObject.getSourceId(), stackObject.getControllerId(), game)) { Game sim = game.copy(); - StackAbility newAbility = (StackAbility) ability.copy(); + StackAbility newAbility = (StackAbility) stackObject.copy(); SearchEffect newEffect = getSearchEffect(newAbility); newEffect.getTarget().addTarget(targetId, newAbility, sim); sim.getStack().push(newAbility); - SimulationNode2 newNode = new SimulationNode2(node, sim, depth, ability.getControllerId()); + SimulationNode2 newNode = new SimulationNode2(node, sim, depth, stackObject.getControllerId()); node.children.add(newNode); newNode.getTargets().add(targetId); - logger.trace("Sim search -- node#: " + SimulationNode2.getCount() + " for player: " + sim.getPlayer(ability.getControllerId()).getName()); + logger.trace("Sim search -- node#: " + SimulationNode2.getCount() + " for player: " + sim.getPlayer(stackObject.getControllerId()).getName()); } return; } } } //logger.info("simulating resolve "); - ability.resolve(game); + stackObject.resolve(game); + if (stackObject instanceof StackAbility) { + game.getStack().remove(stackObject); + } game.applyEffects(); game.getPlayers().resetPassed(); game.getPlayerList().setCurrent(game.getActivePlayerId()); @@ -1190,7 +1194,8 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ { safeToAttack = false; } if (safeToAttack) { - attackingPlayer.declareAttacker(attacker.getId(), defenderId, game, false); + // undo has to be possible e.g. if not able to pay a attack fee (e.g. Ghostly Prison) + attackingPlayer.declareAttacker(attacker.getId(), defenderId, game, true); } } } diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java index 22037b2ad53..3822c054646 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/ComputerPlayer7.java @@ -74,7 +74,7 @@ import org.apache.log4j.Logger; */ public class ComputerPlayer7 extends ComputerPlayer6 { - private static final transient Logger logger = Logger.getLogger(ComputerPlayer7.class); + private static final Logger logger = Logger.getLogger(ComputerPlayer7.class); private boolean allowBadMoves; diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/Config2.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/Config2.java index 6123868991c..55d87f6914e 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/Config2.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/Config2.java @@ -28,14 +28,13 @@ package mage.player.ai; +import org.apache.log4j.Logger; + import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.URISyntaxException; import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; -import mage.util.Logging; /** * @@ -43,7 +42,7 @@ import mage.util.Logging; */ public class Config2 { - private static final Logger logger = Logging.getLogger(Config2.class.getName()); + private static final Logger logger = Logger.getLogger(Config2.class); // public static final int maxDepth; public static final int maxNodes; @@ -70,9 +69,9 @@ public class Config2 { // p.setProperty("maxThinkSeconds", "30"); } } catch (IOException ex) { - logger.log(Level.SEVERE, null, ex); + logger.error(null, ex); } catch (URISyntaxException ex) { - Logger.getLogger(Config2.class.getName()).log(Level.SEVERE, null, ex); + logger.error(null, ex); } // maxDepth = Integer.parseInt(p.getProperty("maxDepth")); maxNodes = Integer.parseInt(p.getProperty("maxNodes")); diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/GameStateEvaluator2.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/GameStateEvaluator2.java index 0e2c9f409c1..68661f92b86 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/GameStateEvaluator2.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/GameStateEvaluator2.java @@ -9,6 +9,7 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.player.ai.ma.ArtificialScoringSystem; import mage.players.Player; +import org.apache.log4j.Logger; /** * @@ -19,7 +20,7 @@ import mage.players.Player; */ public class GameStateEvaluator2 { - private static final transient org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(GameStateEvaluator2.class); + private static final Logger logger = Logger.getLogger(GameStateEvaluator2.class); public static final int WIN_GAME_SCORE = 100000000; public static final int LOSE_GAME_SCORE = -WIN_GAME_SCORE; diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulatedPlayer2.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulatedPlayer2.java index 419a33a0b53..058d42b6e6d 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulatedPlayer2.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulatedPlayer2.java @@ -53,6 +53,7 @@ import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.game.stack.StackAbility; import mage.players.Player; +import mage.players.net.UserData; import mage.target.Target; import org.apache.log4j.Logger; @@ -62,7 +63,7 @@ import org.apache.log4j.Logger; */ public class SimulatedPlayer2 extends ComputerPlayer { - private static final transient Logger logger = Logger.getLogger(SimulatedPlayer2.class); + private static final Logger logger = Logger.getLogger(SimulatedPlayer2.class); private final boolean isSimulatedPlayer; private transient ConcurrentLinkedQueue allActions; private boolean forced; @@ -75,6 +76,7 @@ public class SimulatedPlayer2 extends ComputerPlayer { pass.setControllerId(playerId); this.isSimulatedPlayer = isSimulatedPlayer; this.suggested = suggested; + this.userData = UserData.getDefaultUserDataView(); } public SimulatedPlayer2(final SimulatedPlayer2 player) { diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulationWorker2.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulationWorker2.java index 991947bcb87..971cd3698e5 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulationWorker2.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/SimulationWorker2.java @@ -29,11 +29,9 @@ package mage.player.ai; import java.util.concurrent.Callable; -import java.util.logging.Level; -import java.util.logging.Logger; import mage.abilities.Ability; import mage.game.Game; -import mage.util.Logging; +import org.apache.log4j.Logger; /** * @@ -41,7 +39,7 @@ import mage.util.Logging; */ public class SimulationWorker2 implements Callable { - private static final Logger logger = Logging.getLogger(SimulationWorker2.class.getName()); + private static final Logger logger = Logger.getLogger(SimulationWorker2.class); private Game game; private SimulatedAction2 previousActions; @@ -60,7 +58,7 @@ public class SimulationWorker2 implements Callable { try { // player.simulateAction(game, previousActions, action); } catch (Exception ex) { - logger.log(Level.SEVERE, null, ex); + logger.error(null, ex); } return null; } diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/util/CombatUtil.java b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/util/CombatUtil.java index 262523582ef..a5118936766 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/util/CombatUtil.java +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai/util/CombatUtil.java @@ -12,6 +12,7 @@ import mage.game.turn.EndOfCombatStep; import mage.game.turn.FirstCombatDamageStep; import mage.game.turn.Step; import mage.players.Player; +import org.apache.log4j.Logger; import java.util.*; @@ -24,7 +25,7 @@ public class CombatUtil { private static final List emptyList = new ArrayList(); - private static final transient org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(CombatUtil.class); + private static final Logger log = Logger.getLogger(CombatUtil.class); private CombatUtil() { } diff --git a/Mage.Server.Plugins/Mage.Player.AI/pom.xml b/Mage.Server.Plugins/Mage.Player.AI/pom.xml index 51788aff21a..8ed2a850251 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/pom.xml +++ b/Mage.Server.Plugins/Mage.Player.AI/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-player-ai diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index 89d7ab37637..6e2acbb8fa9 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -74,12 +74,11 @@ import mage.abilities.mana.ManaAbility; import mage.abilities.mana.ManaOptions; import mage.cards.Card; import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.cards.decks.Deck; import mage.cards.repository.CardCriteria; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; -import mage.cards.repository.ExpansionInfo; -import mage.cards.repository.ExpansionRepository; import mage.choices.Choice; import mage.choices.ChoiceColor; import mage.constants.AsThoughEffectType; @@ -144,9 +143,12 @@ import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreatureOrPlayerAmount; import mage.target.common.TargetDefender; import mage.target.common.TargetDiscard; +import mage.target.common.TargetOpponent; import mage.target.common.TargetPermanentOrPlayer; import mage.target.common.TargetSpellOrPermanent; import mage.util.Copier; +import mage.util.MessageToClient; +import mage.util.TournamentUtil; import mage.util.TreeNode; import org.apache.log4j.Logger; @@ -158,10 +160,10 @@ import org.apache.log4j.Logger; */ public class ComputerPlayer extends PlayerImpl implements Player { - private transient final static Logger log = Logger.getLogger(ComputerPlayer.class); + private static final Logger log = Logger.getLogger(ComputerPlayer.class); protected int PASSIVITY_PENALTY = 5; // Penalty value for doing nothing if some actions are availble - protected boolean ALLOW_INTERRUPT = true; // change this for test / debugging purposes to false to switch off interrupts while debugging + protected boolean ALLOW_INTERRUPT = true; // change this for test / debugging purposes to false to switch off interrupts while debugging private transient Map unplayable = new TreeMap<>(); private transient List playableNonInstant = new ArrayList<>(); @@ -171,6 +173,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { private transient List chosenColors; private transient ManaCost currentUnpaidMana; + private final Random random = new Random(); public ComputerPlayer(String name, RangeOfInfluence range) { super(name, range); @@ -194,7 +197,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { @Override public boolean chooseMulligan(Game game) { log.debug("chooseMulligan"); - if (hand.size() < 6 || isTestMode()) { + if (hand.size() < 6 || isTestMode() || game.getClass().getName().contains("Momir")) { return false; } Set lands = hand.getCards(new FilterLandCard(), game); @@ -216,33 +219,11 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (target.getTargetController() != null && target.getAbilityController() != null) { abilityControllerId = target.getAbilityController(); } - UUID opponentId = game.getOpponents(abilityControllerId).iterator().next(); + UUID randomOpponentId = getRandomOpponent(abilityControllerId, game); if (target instanceof TargetPlayer) { - if (outcome.isGood()) { - if (target.canTarget(abilityControllerId, game)) { - target.add(abilityControllerId, game); - return true; - } - if (target.isRequired(sourceId, game)) { - if (target.canTarget(opponentId, game)) { - target.add(opponentId, game); - return true; - } - } - } else { - if (target.canTarget(opponentId, game)) { - target.add(opponentId, game); - return true; - } - if (target.isRequired(sourceId, game)) { - if (target.canTarget(abilityControllerId, game)) { - target.add(abilityControllerId, game); - return true; - } - } - } - return false; + return setTargetPlayer(outcome, target, null, sourceId, abilityControllerId, randomOpponentId, game); } + if (target instanceof TargetDiscard) { findPlayables(game); if (unplayable.size() > 0) { @@ -289,13 +270,13 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (outcome.isGood()) { targets = threats(abilityControllerId, sourceId, ((TargetPermanent) target).getFilter(), game, target.getTargets()); } else { - targets = threats(opponentId, sourceId, ((TargetPermanent) target).getFilter(), game, target.getTargets()); + targets = threats(randomOpponentId, sourceId, ((TargetPermanent) target).getFilter(), game, target.getTargets()); } if (targets.isEmpty() && target.isRequired()) { if (!outcome.isGood()) { targets = threats(abilityControllerId, sourceId, ((TargetPermanent) target).getFilter(), game, target.getTargets()); } else { - targets = threats(opponentId, sourceId, ((TargetPermanent) target).getFilter(), game, target.getTargets()); + targets = threats(randomOpponentId, sourceId, ((TargetPermanent) target).getFilter(), game, target.getTargets()); } } } @@ -320,9 +301,10 @@ public class ComputerPlayer extends PlayerImpl implements Player { return target.isChosen(); } - if (target instanceof TargetCardInHand) { + if (target instanceof TargetCardInHand + || (target.getZone().equals(Zone.HAND) && (target instanceof TargetCard))) { List cards = new ArrayList<>(); - for (UUID cardId : ((TargetCardInHand) target).possibleTargets(sourceId, this.getId(), game)) { + for (UUID cardId : target.possibleTargets(sourceId, this.getId(), game)) { Card card = game.getCard(cardId); if (card != null) { cards.add(card); @@ -344,7 +326,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (outcome.isGood()) { targets = threats(abilityControllerId, sourceId, ((FilterCreatureOrPlayer) t.getFilter()).getCreatureFilter(), game, target.getTargets()); } else { - targets = threats(opponentId, sourceId, ((FilterCreatureOrPlayer) t.getFilter()).getCreatureFilter(), game, target.getTargets()); + targets = threats(randomOpponentId, sourceId, ((FilterCreatureOrPlayer) t.getFilter()).getCreatureFilter(), game, target.getTargets()); } for (Permanent permanent : targets) { List alreadyTargetted = target.getTargets(); @@ -361,8 +343,8 @@ public class ComputerPlayer extends PlayerImpl implements Player { return true; } } else { - if (target.canTarget(opponentId, null, game)) { - target.add(opponentId, game); + if (target.canTarget(randomOpponentId, null, game)) { + target.add(randomOpponentId, game); return true; } } @@ -374,8 +356,8 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (target instanceof TargetPermanentOrPlayer) { List targets; TargetPermanentOrPlayer t = ((TargetPermanentOrPlayer) target); - List ownedTargets = threats(abilityControllerId, sourceId, ((FilterPermanentOrPlayer) t.getFilter()).getPermanentFilter(), game, target.getTargets());; - List opponentTargets = threats(opponentId, sourceId, ((FilterPermanentOrPlayer) t.getFilter()).getPermanentFilter(), game, target.getTargets()); + List ownedTargets = threats(abilityControllerId, sourceId, ((FilterPermanentOrPlayer) t.getFilter()).getPermanentFilter(), game, target.getTargets()); + List opponentTargets = threats(randomOpponentId, sourceId, ((FilterPermanentOrPlayer) t.getFilter()).getPermanentFilter(), game, target.getTargets()); if (outcome.isGood()) { targets = ownedTargets; } else { @@ -396,16 +378,16 @@ public class ComputerPlayer extends PlayerImpl implements Player { return true; } } else { - if (target.canTarget(opponentId, null, game)) { - target.add(opponentId, game); + if (target.canTarget(randomOpponentId, null, game)) { + target.add(randomOpponentId, game); return true; } } if (!target.isRequired(sourceId, game) || target.getNumberOfTargets() == 0) { return false; } - if (target.canTarget(opponentId, null, game)) { - target.add(opponentId, game); + if (target.canTarget(randomOpponentId, null, game)) { + target.add(randomOpponentId, game); return true; } if (target.canTarget(abilityControllerId, null, game)) { @@ -493,37 +475,18 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (target.getAbilityController() != null) { abilityControllerId = target.getAbilityController(); } - UUID opponentId = game.getOpponents(abilityControllerId).iterator().next(); + UUID randomOpponentId = getRandomOpponent(abilityControllerId, game); if (target instanceof TargetPlayer) { - if (outcome.isGood()) { - if (target.canTarget(abilityControllerId, abilityControllerId, source, game)) { - target.addTarget(playerId, source, game); - return true; - } - if (target.isRequired(source)) { - if (target.canTarget(abilityControllerId, opponentId, source, game)) { - target.addTarget(opponentId, source, game); - return true; - } - } - } else { - if (target.canTarget(abilityControllerId, opponentId, source, game)) { - target.addTarget(opponentId, source, game); - return true; - } - if (target.isRequired(source)) { - if (target.canTarget(abilityControllerId, abilityControllerId, source, game)) { - target.addTarget(abilityControllerId, source, game); - return true; - } - } - } - return false; + return setTargetPlayer(outcome, target, source, source.getSourceId(), abilityControllerId, randomOpponentId, game); } + if (target instanceof TargetDiscard || target instanceof TargetCardInHand) { if (outcome.isGood()) { - ArrayList cardsInHand = new ArrayList<>(hand.getCards(game)); - while (!target.isChosen() && !cardsInHand.isEmpty() && target.getMaxNumberOfTargets() > target.getTargets().size()) { + Cards cards = new CardsImpl(target.possibleTargets(source.getSourceId(), getId(), game)); + ArrayList cardsInHand = new ArrayList<>(cards.getCards(game)); + while (!target.isChosen() + && target.possibleTargets(source.getSourceId(), getId(), game).size() > 0 + && target.getMaxNumberOfTargets() > target.getTargets().size()) { Card card = pickBestCard(cardsInHand, null, target, source, game); if (card != null) { if (target.canTarget(getId(), card.getId(), source, game)) { @@ -583,7 +546,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (outcome.isGood()) { targets = threats(abilityControllerId, source == null ? null : source.getSourceId(), ((TargetPermanent) target).getFilter(), game, target.getTargets()); } else { - targets = threats(opponentId, source == null ? null : source.getSourceId(), ((TargetPermanent) target).getFilter(), game, target.getTargets()); + targets = threats(randomOpponentId, source == null ? null : source.getSourceId(), ((TargetPermanent) target).getFilter(), game, target.getTargets()); } if (targets.isEmpty() && target.isRequired(source)) { targets = threats(null, source == null ? null : source.getSourceId(), ((TargetPermanent) target).getFilter(), game, target.getTargets()); @@ -607,7 +570,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (outcome.isGood()) { targets = threats(abilityControllerId, source.getSourceId(), ((FilterCreatureOrPlayer) t.getFilter()).getCreatureFilter(), game, target.getTargets()); } else { - targets = threats(opponentId, source.getSourceId(), ((FilterCreatureOrPlayer) t.getFilter()).getCreatureFilter(), game, target.getTargets()); + targets = threats(randomOpponentId, source.getSourceId(), ((FilterCreatureOrPlayer) t.getFilter()).getCreatureFilter(), game, target.getTargets()); } if (targets.isEmpty()) { @@ -617,8 +580,8 @@ public class ComputerPlayer extends PlayerImpl implements Player { return true; } } else { - if (target.canTarget(getId(), opponentId, source, game)) { - target.addTarget(opponentId, source, game); + if (target.canTarget(getId(), randomOpponentId, source, game)) { + target.addTarget(randomOpponentId, source, game); return true; } } @@ -643,8 +606,8 @@ public class ComputerPlayer extends PlayerImpl implements Player { return true; } } else { - if (target.canTarget(getId(), opponentId, source, game)) { - target.addTarget(opponentId, source, game); + if (target.canTarget(getId(), randomOpponentId, source, game)) { + target.addTarget(randomOpponentId, source, game); return true; } } @@ -684,17 +647,6 @@ public class ComputerPlayer extends PlayerImpl implements Player { } return target.isChosen(); } - if (target instanceof TargetCardInHand) { - List cards = new ArrayList<>(); - cards.addAll(this.hand.getCards(game)); - while (!target.isChosen() && !cards.isEmpty()) { - Card pick = pickTarget(cards, outcome, target, source, game); - if (pick != null) { - target.addTarget(pick.getId(), source, game); - } - } - return target.isChosen(); - } if (target instanceof TargetSpell) { if (game.getStack().size() > 0) { Iterator it = game.getStack().iterator(); @@ -709,21 +661,21 @@ public class ComputerPlayer extends PlayerImpl implements Player { return false; } if (target instanceof TargetSpellOrPermanent) { + // TODO: Also check if a spell should be selected List targets; boolean outcomeTargets = true; if (outcome.isGood()) { targets = threats(abilityControllerId, source == null ? null : source.getSourceId(), ((TargetSpellOrPermanent) target).getPermanentFilter(), game, target.getTargets()); } else { - targets = threats(opponentId, source == null ? null : source.getSourceId(), ((TargetSpellOrPermanent) target).getPermanentFilter(), game, target.getTargets()); + targets = threats(randomOpponentId, source == null ? null : source.getSourceId(), ((TargetSpellOrPermanent) target).getPermanentFilter(), game, target.getTargets()); } if (targets.isEmpty() && target.isRequired(source)) { targets = threats(null, source == null ? null : source.getSourceId(), ((TargetSpellOrPermanent) target).getPermanentFilter(), game, target.getTargets()); Collections.reverse(targets); outcomeTargets = false; - //targets = game.getBattlefield().getActivePermanents(((TargetPermanent)target).getFilter(), playerId, game); } for (Permanent permanent : targets) { - if (((TargetPermanent) target).canTarget(abilityControllerId, permanent.getId(), source, game)) { + if (((TargetSpellOrPermanent) target).canTarget(abilityControllerId, permanent.getId(), source, game)) { target.addTarget(permanent.getId(), source, game); if (!outcomeTargets || target.getMaxNumberOfTargets() <= target.getTargets().size()) { return true; @@ -763,7 +715,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (target instanceof TargetDefender) { // TODO: Improve, now planeswalker is always chosen if it exits List targets; - targets = game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), opponentId, game); + targets = game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), randomOpponentId, game); if (targets != null && !targets.isEmpty()) { for (Permanent planeswalker : targets) { if (target.canTarget(getId(), planeswalker.getId(), source, game)) { @@ -775,8 +727,8 @@ public class ComputerPlayer extends PlayerImpl implements Player { } } if (!target.isChosen()) { - if (target.canTarget(getId(), opponentId, source, game)) { - target.addTarget(opponentId, source, game); + if (target.canTarget(getId(), randomOpponentId, source, game)) { + target.addTarget(randomOpponentId, source, game); } } return target.isChosen(); @@ -999,7 +951,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { } while (lands.size() > 0 && this.canPlayLand()) { if (lands.size() == 1) { - this.playLand(lands.iterator().next(), game); + this.playLand(lands.iterator().next(), game, false); } else { playALand(lands, game); } @@ -1014,7 +966,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { for (ManaAbility ability : card.getAbilities().getManaAbilities(Zone.BATTLEFIELD)) { for (Mana netMana : ability.getNetMana(game)) { if (netMana.enough(mana)) { - this.playLand(card, game); + this.playLand(card, game, false); lands.remove(card); return; } @@ -1028,7 +980,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { for (ManaAbility ability : card.getAbilities().getManaAbilities(Zone.BATTLEFIELD)) { for (Mana netMana : ability.getNetMana(game)) { if (mana.contains(netMana)) { - this.playLand(card, game); + this.playLand(card, game, false); lands.remove(card); return; } @@ -1037,7 +989,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { } } //play first available land - this.playLand(lands.iterator().next(), game); + this.playLand(lands.iterator().next(), game, false); lands.remove(lands.iterator().next()); } @@ -1141,7 +1093,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { protected boolean playManaHandling(Ability ability, ManaCost unpaid, Game game) { // log.info("paying for " + unpaid.getText()); - boolean spendAnyMana = game.getContinuousEffects().asThough(ability.getSourceId(), AsThoughEffectType.SPEND_ANY_MANA, ability, ability.getControllerId(), game); + boolean spendAnyMana = game.getContinuousEffects().asThough(ability.getSourceId(), AsThoughEffectType.SPEND_OTHER_MANA, ability, ability.getControllerId(), game); ManaCost cost; List producers; if (unpaid instanceof ManaCosts) { @@ -1330,6 +1282,11 @@ public class ComputerPlayer extends PlayerImpl implements Player { @Override public boolean chooseUse(Outcome outcome, String message, Ability source, Game game) { + return this.chooseUse(outcome, new MessageToClient(message), source, game); + } + + @Override + public boolean chooseUse(Outcome outcome, MessageToClient message, Ability source, Game game) { log.debug("chooseUse: " + outcome.isGood()); // Be proactive! Always use abilities, the evaluation function will decide if it's good or not // Otherwise some abilities won't be used by AI like LoseTargetEffect that has "bad" outcome @@ -1568,9 +1525,14 @@ public class ComputerPlayer extends PlayerImpl implements Player { return modes.getMode(); } //TODO: improve this; + AvailableMode: for (Mode mode : modes.getAvailableModes(source, game)) { - if (!modes.getSelectedModes().contains(mode.getId()) // select only modes not already selected - && mode.getTargets().canChoose(source.getSourceId(), source.getControllerId(), game)) { // and where targets are available + for (Mode selectedMode : modes.getSelectedModes()) { + if (selectedMode.getId().equals(mode.getId())) { + continue AvailableMode; + } + } + if (mode.getTargets().canChoose(source.getSourceId(), source.getControllerId(), game)) { // and where targets are available return mode; } } @@ -1632,42 +1594,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { private static void addBasicLands(Deck deck, String landName, int number) { Random random = new Random(); - Set landSets = new HashSet<>(); - - // decide from which sets basic lands are taken from - for (String setCode : deck.getExpansionSetCodes()) { - ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode); - if (expansionInfo.hasBasicLands()) { - landSets.add(expansionInfo.getCode()); - } - } - - // if sets have no basic land, take land from block - if (landSets.isEmpty()) { - for (String setCode : deck.getExpansionSetCodes()) { - ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode); - List blockSets = ExpansionRepository.instance.getSetsFromBlock(expansionInfo.getBlockName()); - for (ExpansionInfo blockSet : blockSets) { - if (blockSet.hasBasicLands()) { - landSets.add(blockSet.getCode()); - } - } - } - } - // if still no set with lands found, take one by random - if (landSets.isEmpty()) { - // if sets have no basic lands and also it has no parent or parent has no lands get last set with lands - // select a set with basic lands by random - Random generator = new Random(); - List basicLandSets = ExpansionRepository.instance.getSetsWithBasicLandsByReleaseDate(); - if (basicLandSets.size() > 0) { - landSets.add(basicLandSets.get(generator.nextInt(basicLandSets.size())).getCode()); - } - } - - if (landSets.isEmpty()) { - throw new IllegalArgumentException("No set with basic land was found"); - } + Set landSets = TournamentUtil.getLandSetCodeForDeckSets(deck.getExpansionSetCodes()); CardCriteria criteria = new CardCriteria(); if (!landSets.isEmpty()) { @@ -2223,4 +2150,116 @@ public class ComputerPlayer extends PlayerImpl implements Player { return new ComputerPlayer(this); } + /** + * Sets a possible target player + * + */ + private boolean setTargetPlayer(Outcome outcome, Target target, Ability source, UUID sourceId, UUID abilityControllerId, UUID randomOpponentId, Game game) { + if (target instanceof TargetOpponent) { + if (source == null) { + if (((TargetOpponent) target).canTarget(randomOpponentId, game)) { + target.add(randomOpponentId, game); + return true; + } + } else { + if (((TargetOpponent) target).canTarget(randomOpponentId, source, game)) { + target.add(randomOpponentId, game); + return true; + } + } + for (UUID currentId : game.getOpponents(abilityControllerId)) { + if (source == null) { + if (((TargetOpponent) target).canTarget(currentId, game)) { + target.add(currentId, game); + return true; + } + } else { + if (((TargetOpponent) target).canTarget(currentId, source, game)) { + target.add(currentId, game); + return true; + } + } + } + return false; + } + + if (target instanceof TargetPlayer) { + if (outcome.isGood()) { + if (source == null) { + if (target.canTarget(abilityControllerId, game)) { + target.add(abilityControllerId, game); + return true; + } + if (target.isRequired(sourceId, game)) { + if (target.canTarget(randomOpponentId, game)) { + target.add(randomOpponentId, game); + return true; + } + } + } else { + if (target.canTarget(abilityControllerId, abilityControllerId, source, game)) { + target.addTarget(playerId, source, game); + return true; + } + if (target.isRequired(sourceId, game)) { + if (target.canTarget(randomOpponentId, game)) { + target.add(randomOpponentId, game); + return true; + } + } + } + + } else { + if (source == null) { + if (target.canTarget(randomOpponentId, game)) { + target.add(randomOpponentId, game); + return true; + } + if (target.isRequired(sourceId, game)) { + if (target.canTarget(abilityControllerId, game)) { + target.add(abilityControllerId, game); + return true; + } + } + } else { + if (target.canTarget(randomOpponentId, game)) { + target.add(randomOpponentId, game); + return true; + } + if (target.isRequired(sourceId, game)) { + if (target.canTarget(abilityControllerId, game)) { + target.add(abilityControllerId, game); + return true; + } + } + } + } + return false; + } + + return false; + } + + /** + * Returns an opponent by random + * + * @param abilityControllerId + * @param game + * @return + */ + private UUID getRandomOpponent(UUID abilityControllerId, Game game) { + UUID randomOpponentId = game.getOpponents(abilityControllerId).iterator().next(); + Set opponents = game.getOpponents(abilityControllerId); + if (opponents.size() > 1) { + int rand = random.nextInt(opponents.size()); + int count = 0; + for (UUID currentId : opponents) { + if (count == rand) { + randomOpponentId = currentId; + break; + } + } + } + return randomOpponentId; + } } diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml b/Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml index 62c8e069013..baeab50796e 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-player-ai-mcts diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/ComputerPlayerMCTS.java b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/ComputerPlayerMCTS.java index c620bb68407..e36bde422eb 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/ComputerPlayerMCTS.java +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/ComputerPlayerMCTS.java @@ -62,7 +62,7 @@ public class ComputerPlayerMCTS extends ComputerPlayer implements Player { protected transient MCTSNode root; protected int maxThinkTime; - private static final transient Logger logger = Logger.getLogger(ComputerPlayerMCTS.class); + private static final Logger logger = Logger.getLogger(ComputerPlayerMCTS.class); private int poolSize; public ComputerPlayerMCTS(String name, RangeOfInfluence range, int skill) { diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSExecutor.java b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSExecutor.java index 1e12abdcc7b..e46c0ed9a91 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSExecutor.java +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSExecutor.java @@ -43,7 +43,7 @@ public class MCTSExecutor implements Callable { protected UUID playerId; protected int simCount; - private static final transient Logger logger = Logger.getLogger(ComputerPlayerMCTS.class); + private static final Logger logger = Logger.getLogger(ComputerPlayerMCTS.class); public MCTSExecutor(Game sim, UUID playerId, int thinkTime) { this.playerId = playerId; diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSNode.java b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSNode.java index eacf86be8b5..f28f8683921 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSNode.java +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSNode.java @@ -57,7 +57,7 @@ public class MCTSNode { public static final boolean USE_ACTION_CACHE = false; private static final double selectionCoefficient = Math.sqrt(2.0); private static final double passRatioTolerance = 0.0; - private static final transient Logger logger = Logger.getLogger(MCTSNode.class); + private static final Logger logger = Logger.getLogger(MCTSNode.class); private int visits = 0; private int wins = 0; diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSPlayer.java b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSPlayer.java index e653bc80db8..9c2769eb1dc 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/MCTSPlayer.java @@ -45,7 +45,7 @@ import java.util.UUID; */ public class MCTSPlayer extends ComputerPlayer { - private static final transient Logger logger = Logger.getLogger(MCTSPlayer.class); + private static final Logger logger = Logger.getLogger(MCTSPlayer.class); protected PassAbility pass = new PassAbility(); diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/SimulatedPlayerMCTS.java b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/SimulatedPlayerMCTS.java index 94633b9f034..6e0ffde4447 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/SimulatedPlayerMCTS.java +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/src/mage/player/ai/SimulatedPlayerMCTS.java @@ -66,7 +66,7 @@ public class SimulatedPlayerMCTS extends MCTSPlayer { private boolean isSimulatedPlayer; private static Random rnd = new Random(); private int actionCount = 0; - private static final transient Logger logger = Logger.getLogger(SimulatedPlayerMCTS.class); + private static final Logger logger = Logger.getLogger(SimulatedPlayerMCTS.class); public SimulatedPlayerMCTS(UUID id, boolean isSimulatedPlayer) { super(id); diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml b/Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml index 696f0b3043f..31d417e4151 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-player-aiminimax diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java index 496bf0a47af..bc43063666e 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer2.java @@ -60,8 +60,8 @@ import java.util.concurrent.*; */ public class ComputerPlayer2 extends ComputerPlayer implements Player { - private static final transient Logger logger = Logger.getLogger(ComputerPlayer2.class); - private static final transient ExecutorService pool = Executors.newFixedThreadPool(1); + private static final Logger logger = Logger.getLogger(ComputerPlayer2.class); + private static final ExecutorService pool = Executors.newFixedThreadPool(1); protected int maxDepth; protected int maxNodes; diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer3.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer3.java index 8b2d9cfaf17..c01bed8a68e 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer3.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/ComputerPlayer3.java @@ -49,7 +49,7 @@ import java.util.UUID; */ public class ComputerPlayer3 extends ComputerPlayer2 implements Player { - private static final transient Logger logger = Logger.getLogger(ComputerPlayer3.class); + private static final Logger logger = Logger.getLogger(ComputerPlayer3.class); public ComputerPlayer3(String name, RangeOfInfluence range, int skill) { super(name, range, skill); diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java index 920b00d2520..16e131031eb 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/GameStateEvaluator.java @@ -53,7 +53,7 @@ import org.apache.log4j.Logger; */ public class GameStateEvaluator { - private static final transient Logger logger = Logger.getLogger(GameStateEvaluator.class); + private static final Logger logger = Logger.getLogger(GameStateEvaluator.class); private static final int LIFE_FACTOR = Config.evaluatorLifeFactor; private static final int PERMANENT_FACTOR = Config.evaluatorPermanentFactor; diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulateBlockWorker.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulateBlockWorker.java index 10f315c56d7..97dc7bf9da4 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulateBlockWorker.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulateBlockWorker.java @@ -28,10 +28,9 @@ package mage.player.ai; +import org.apache.log4j.Logger; + import java.util.concurrent.Callable; -import java.util.logging.Level; -import java.util.logging.Logger; -import mage.util.Logging; /** * @@ -39,7 +38,7 @@ import mage.util.Logging; */ public class SimulateBlockWorker implements Callable { - private static final Logger logger = Logging.getLogger(SimulationWorker.class.getName()); + private static final Logger logger = Logger.getLogger(SimulationWorker.class); private SimulationNode node; private ComputerPlayer3 player; @@ -54,7 +53,7 @@ public class SimulateBlockWorker implements Callable { try { // player.simulateBlock(node); } catch (Exception ex) { - logger.log(Level.SEVERE, null, ex); + logger.error(null, ex); } return null; } diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulatedPlayer.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulatedPlayer.java index a43eddaa763..a7547ce9649 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulatedPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulatedPlayer.java @@ -51,7 +51,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; */ public class SimulatedPlayer extends ComputerPlayer { - private static final transient Logger logger = Logger.getLogger(SimulatedPlayer.class); + private static final Logger logger = Logger.getLogger(SimulatedPlayer.class); private boolean isSimulatedPlayer; private transient ConcurrentLinkedQueue allActions; private static PassAbility pass = new PassAbility(); diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulationWorker.java b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulationWorker.java index 2d185c8096b..41ef901f423 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulationWorker.java +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/src/mage/player/ai/SimulationWorker.java @@ -29,11 +29,9 @@ package mage.player.ai; import java.util.concurrent.Callable; -import java.util.logging.Level; -import java.util.logging.Logger; import mage.abilities.Ability; import mage.game.Game; -import mage.util.Logging; +import org.apache.log4j.Logger; /** * @@ -41,7 +39,7 @@ import mage.util.Logging; */ public class SimulationWorker implements Callable { - private static final Logger logger = Logging.getLogger(SimulationWorker.class.getName()); + private static final Logger logger = Logger.getLogger(SimulationWorker.class); private Game game; private SimulatedAction previousActions; @@ -60,7 +58,7 @@ public class SimulationWorker implements Callable { try { // player.simulateAction(game, previousActions, action); } catch (Exception ex) { - logger.log(Level.SEVERE, null, ex); + logger.error(null, ex); } return null; } diff --git a/Mage.Server.Plugins/Mage.Player.Human/pom.xml b/Mage.Server.Plugins/Mage.Player.Human/pom.xml index 28493362e66..a8440a72de3 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/pom.xml +++ b/Mage.Server.Plugins/Mage.Player.Human/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-player-human diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index 2ed5be13a9f..ee62a58f33d 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -47,6 +47,7 @@ import mage.abilities.SpellAbility; import mage.abilities.TriggeredAbility; import mage.abilities.costs.VariableCost; import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.PhyrexianManaCost; @@ -63,6 +64,17 @@ import mage.constants.ManaType; import mage.constants.Outcome; import mage.constants.PhaseStep; import mage.constants.PlayerAction; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_ID_NO; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_ID_YES; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_RESET_ALL; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_TEXT_NO; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_TEXT_YES; +import static mage.constants.PlayerAction.RESET_AUTO_SELECT_REPLACEMENT_EFFECTS; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_ABILITY_FIRST; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_ABILITY_LAST; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_NAME_FIRST; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_NAME_LAST; +import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_RESET_ALL; import mage.constants.RangeOfInfluence; import mage.constants.Zone; import mage.filter.common.FilterAttackingCreature; @@ -88,6 +100,7 @@ import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetDefender; import mage.util.GameLog; import mage.util.ManaUtil; +import mage.util.MessageToClient; import org.apache.log4j.Logger; /** @@ -104,11 +117,19 @@ public class HumanPlayer extends PlayerImpl { protected static FilterBlockingCreature filterBlock = new FilterBlockingCreature(); protected final Choice replacementEffectChoice; - private static final Logger log = Logger.getLogger(HumanPlayer.class); + private static final Logger logger = Logger.getLogger(HumanPlayer.class); protected HashSet autoSelectReplacementEffects = new HashSet<>(); protected ManaCost currentlyUnpaidMana; + protected Set triggerAutoOrderAbilityFirst = new HashSet<>(); + protected Set triggerAutoOrderAbilityLast = new HashSet<>(); + protected Set triggerAutoOrderNameFirst = new HashSet<>(); + protected Set triggerAutoOrderNameLast = new HashSet<>(); + + protected Map requestAutoAnswerId = new HashMap<>(); + protected Map requestAutoAnswerText = new HashMap<>(); + public HumanPlayer(String name, RangeOfInfluence range, int skill) { super(name, range); replacementEffectChoice = new ChoiceImpl(true); @@ -125,53 +146,30 @@ public class HumanPlayer extends PlayerImpl { protected void waitForResponse(Game game) { response.clear(); - log.debug("Waiting response from player: " + getId()); + logger.debug("Waiting response from player: " + getId()); game.resumeTimer(getTurnControlledBy()); synchronized (response) { try { response.wait(); - log.debug("Got response from player: " + getId()); + logger.debug("Got response from player: " + getId()); } catch (InterruptedException ex) { - ex.printStackTrace(); + logger.error("Response error for player " + getName() + " gameId: " + game.getId(), ex); } finally { game.pauseTimer(getTurnControlledBy()); } } } - protected void waitForBooleanResponse(Game game) { - do { - waitForResponse(game); - } while (response.getBoolean() == null && !abort); - } - - protected void waitForUUIDResponse(Game game) { - do { - waitForResponse(game); - } while (response.getUUID() == null && !abort); - } - - protected void waitForStringResponse(Game game) { - do { - waitForResponse(game); - } while (response.getString() == null && !abort); - } - - protected void waitForIntegerResponse(Game game) { - do { - waitForResponse(game); - } while (response.getInteger() == null && !abort); - } - @Override public boolean chooseMulligan(Game game) { updateGameStatePriority("chooseMulligan", game); int nextHandSize = game.mulliganDownTo(playerId); - game.fireAskPlayerEvent(playerId, new StringBuilder("Mulligan ") - .append(getHand().size() > nextHandSize ? "down to " : "for free, draw ") - .append(nextHandSize) - .append(nextHandSize == 1 ? " card?" : " cards?").toString()); - waitForBooleanResponse(game); + do { + game.fireAskPlayerEvent(playerId, new MessageToClient("Mulligan " + + (getHand().size() > nextHandSize ? "down to " : "for free, draw ") + + nextHandSize + (nextHandSize == 1 ? " card?" : " cards?")), null); + waitForResponse(game); + } while (response.getBoolean() == null && !abort); if (!abort) { return response.getBoolean(); } @@ -180,15 +178,51 @@ public class HumanPlayer extends PlayerImpl { @Override public boolean chooseUse(Outcome outcome, String message, Ability source, Game game) { + return this.chooseUse(outcome, new MessageToClient(message), source, game); + } + + @Override + public boolean chooseUse(Outcome outcome, MessageToClient message, Ability source, Game game) { + if (source != null) { + Boolean answer = requestAutoAnswerId.get(source.getOriginalId() + "#" + message.getMessage()); + if (answer != null) { + return answer; + } else { + answer = requestAutoAnswerText.get(message.getMessage()); + if (answer != null) { + return answer; + } + } + } updateGameStatePriority("chooseUse", game); - game.fireAskPlayerEvent(playerId, addSecondLineWithObjectName(message, source == null ? null : source.getSourceId(), game)); - waitForBooleanResponse(game); + do { + if (message.getSecondMessage() == null) { + message.setSecondMessage(getRelatedObjectName(source, game)); + } + game.fireAskPlayerEvent(playerId, message, source); + waitForResponse(game); + } while (response.getBoolean() == null && !abort); if (!abort) { return response.getBoolean(); } return false; } + private String getRelatedObjectName(Ability source, Game game) { + if (source != null) { + return getRelatedObjectName(source.getSourceId(), game); + } + return null; + } + + private String getRelatedObjectName(UUID sourceId, Game game) { + MageObject mageObject = game.getObject(sourceId); + if (mageObject != null) { + return mageObject.getLogName(); + } + return null; + } + private String addSecondLineWithObjectName(String message, UUID sourceId, Game game) { if (sourceId != null) { MageObject mageObject = game.getPermanent(sourceId); @@ -226,7 +260,7 @@ public class HumanPlayer extends PlayerImpl { while (!abort) { game.fireChooseChoiceEvent(playerId, replacementEffectChoice); waitForResponse(game); - log.debug("Choose effect: " + response.getString()); + logger.debug("Choose effect: " + response.getString()); if (response.getString() != null) { if (response.getString().startsWith("#")) { autoSelectReplacementEffects.add(response.getString().substring(1)); @@ -298,7 +332,7 @@ public class HumanPlayer extends PlayerImpl { List chosen = target.getTargets(); options.put("chosen", (Serializable) chosen); - game.fireSelectTargetEvent(getId(), addSecondLineWithObjectName(target.getMessage(), sourceId, game), targetIds, required, getOptions(target, options)); + game.fireSelectTargetEvent(getId(), new MessageToClient(target.getMessage(), getRelatedObjectName(sourceId, game)), targetIds, required, getOptions(target, options)); waitForResponse(game); if (response.getUUID() != null) { if (!targetIds.contains(response.getUUID())) { @@ -359,12 +393,12 @@ public class HumanPlayer extends PlayerImpl { } while (!abort) { Set possibleTargets = target.possibleTargets(source == null ? null : source.getSourceId(), abilityControllerId, game); - boolean required = target.isRequired(source); + boolean required = target.isRequired(source != null ? source.getSourceId() : null, game); if (possibleTargets.isEmpty() || target.getTargets().size() >= target.getNumberOfTargets()) { required = false; } - game.fireSelectTargetEvent(getId(), addSecondLineWithObjectName(target.getMessage(), source == null ? null : source.getSourceId(), game), possibleTargets, required, getOptions(target, null)); + game.fireSelectTargetEvent(getId(), new MessageToClient(target.getMessage(), getRelatedObjectName(source, game)), possibleTargets, required, getOptions(target, null)); waitForResponse(game); if (response.getUUID() != null) { if (target.getTargets().contains(response.getUUID())) { @@ -432,7 +466,7 @@ public class HumanPlayer extends PlayerImpl { options.put("choosable", (Serializable) choosable); } - game.fireSelectTargetEvent(playerId, target.getMessage(), cards, required, options); + game.fireSelectTargetEvent(playerId, new MessageToClient(target.getMessage()), cards, required, options); waitForResponse(game); if (response.getUUID() != null) { if (target.canTarget(response.getUUID(), cards, game)) { @@ -461,7 +495,12 @@ public class HumanPlayer extends PlayerImpl { public boolean chooseTarget(Outcome outcome, Cards cards, TargetCard target, Ability source, Game game) { updateGameStatePriority("chooseTarget(5)", game); while (!abort) { - boolean required = target.isRequired(source); + boolean required; + if (target.isRequiredExplicitlySet()) { + required = target.isRequired(); + } else { + required = target.isRequired(source); + } // if there is no cards to select from, then add possibility to cancel choosing action if (cards == null) { required = false; @@ -486,7 +525,7 @@ public class HumanPlayer extends PlayerImpl { if (!choosable.isEmpty()) { options.put("choosable", (Serializable) choosable); } - game.fireSelectTargetEvent(playerId, addSecondLineWithObjectName(target.getMessage(), source == null ? null : source.getSourceId(), game), cards, required, options); + game.fireSelectTargetEvent(playerId, new MessageToClient(target.getMessage(), getRelatedObjectName(source, game)), cards, required, options); waitForResponse(game); if (response.getUUID() != null) { if (target.getTargets().contains(response.getUUID())) { // if already included remove it @@ -515,7 +554,7 @@ public class HumanPlayer extends PlayerImpl { public boolean chooseTargetAmount(Outcome outcome, TargetAmount target, Ability source, Game game) { updateGameStatePriority("chooseTargetAmount", game); while (!abort) { - game.fireSelectTargetEvent(playerId, addSecondLineWithObjectName(target.getMessage() + "\n Amount remaining:" + target.getAmountRemaining(), source == null ? null : source.getSourceId(), game), + game.fireSelectTargetEvent(playerId, new MessageToClient(target.getMessage() + "\n Amount remaining:" + target.getAmountRemaining(), getRelatedObjectName(source, game)), target.possibleTargets(source == null ? null : source.getSourceId(), playerId, game), target.isRequired(source), getOptions(target, null)); @@ -538,6 +577,18 @@ public class HumanPlayer extends PlayerImpl { public boolean priority(Game game) { passed = false; if (!abort) { + if (getJustActivatedType() != null) { + if (userData.isPassPriorityCast() && getJustActivatedType().equals(AbilityType.SPELL)) { + setJustActivatedType(null); + pass(game); + return false; + } + if (userData.isPassPriorityActivation() && getJustActivatedType().equals(AbilityType.ACTIVATED)) { + setJustActivatedType(null); + pass(game); + return false; + } + } if (passedAllTurns) { if (passWithManaPoolCheck(game)) { return false; @@ -629,21 +680,23 @@ public class HumanPlayer extends PlayerImpl { if (object != null) { Zone zone = game.getState().getZone(object.getId()); if (zone != null) { - if (object instanceof Card && ((Card) object).isFaceDown(game)) { - revealFaceDownCard((Card) object, game); + if (object instanceof Card + && ((Card) object).isFaceDown(game) + && lookAtFaceDownCard((Card) object, game)) { result = true; - } - Player actingPlayer = null; - if (game.getPriorityPlayerId().equals(playerId)) { - actingPlayer = this; - } else if (getPlayersUnderYourControl().contains(game.getPriorityPlayerId())) { - actingPlayer = game.getPlayer(game.getPriorityPlayerId()); - } - if (actingPlayer != null) { - LinkedHashMap useableAbilities = actingPlayer.getUseableActivatedAbilities(object, zone, game); - if (useableAbilities != null && useableAbilities.size() > 0) { - activateAbility(useableAbilities, object, game); - result = true; + } else { + Player actingPlayer = null; + if (game.getPriorityPlayerId().equals(playerId)) { + actingPlayer = this; + } else if (getPlayersUnderYourControl().contains(game.getPriorityPlayerId())) { + actingPlayer = game.getPlayer(game.getPriorityPlayerId()); + } + if (actingPlayer != null) { + LinkedHashMap useableAbilities = actingPlayer.getUseableActivatedAbilities(object, zone, game); + if (useableAbilities != null && useableAbilities.size() > 0) { + activateAbility(useableAbilities, object, game); + result = true; + } } } } @@ -667,12 +720,49 @@ public class HumanPlayer extends PlayerImpl { @Override public TriggeredAbility chooseTriggeredAbility(List abilities, Game game) { - updateGameStatePriority("chooseTriggeredAbility", game); + String autoOrderRuleText = null; + boolean autoOrderUse = getUserData().isAutoOrderTrigger(); while (!abort) { - game.fireSelectTargetEvent(playerId, "Pick triggered ability (goes to the stack first)", abilities); + // try to set trigger auto order + List abilitiesWithNoOrderSet = new ArrayList<>(); + TriggeredAbility abilityOrderLast = null; + for (TriggeredAbility ability : abilities) { + if (triggerAutoOrderAbilityFirst.contains(ability.getOriginalId())) { + return ability; + } + MageObject object = game.getObject(ability.getSourceId()); + String rule = ability.getRule(object != null ? object.getName() : null); + if (triggerAutoOrderNameFirst.contains(rule)) { + return ability; + } + if (triggerAutoOrderAbilityLast.contains(ability.getOriginalId())) { + abilityOrderLast = ability; + continue; + } + if (triggerAutoOrderNameLast.contains(rule)) { + abilityOrderLast = ability; + continue; + } + if (autoOrderUse) { + if (autoOrderRuleText == null) { + autoOrderRuleText = rule; + } else if (!rule.equals(autoOrderRuleText)) { + autoOrderUse = false; + } + } + abilitiesWithNoOrderSet.add(ability); + } + if (abilitiesWithNoOrderSet.isEmpty()) { + return abilityOrderLast; + } + if (abilitiesWithNoOrderSet.size() == 1 || autoOrderUse) { + return abilitiesWithNoOrderSet.iterator().next(); + } + updateGameStatePriority("chooseTriggeredAbility", game); + game.fireSelectTargetTriggeredAbilityEvent(playerId, "Pick triggered ability (goes to the stack first)", abilitiesWithNoOrderSet); waitForResponse(game); if (response.getUUID() != null) { - for (TriggeredAbility ability : abilities) { + for (TriggeredAbility ability : abilitiesWithNoOrderSet) { if (ability.getId().equals(response.getUUID())) { return ability; } @@ -709,6 +799,7 @@ public class HumanPlayer extends PlayerImpl { if (unpaid instanceof ManaCostsImpl) { specialManaAction(unpaid, game); // TODO: delve or convoke cards with PhyrexianManaCost won't work together (this combinaton does not exist yet) + @SuppressWarnings("unchecked") ManaCostsImpl costs = (ManaCostsImpl) unpaid; for (ManaCost cost : costs.getUnpaid()) { if (cost instanceof PhyrexianManaCost) { @@ -744,8 +835,10 @@ public class HumanPlayer extends PlayerImpl { public int announceXMana(int min, int max, String message, Game game, Ability ability) { int xValue = 0; updateGameStatePriority("announceXMana", game); - game.fireGetAmountEvent(playerId, message, min, max); - waitForIntegerResponse(game); + do { + game.fireGetAmountEvent(playerId, message, min, max); + waitForResponse(game); + } while (response.getInteger() == null && !abort); if (response != null && response.getInteger() != null) { xValue = response.getInteger(); } @@ -756,8 +849,10 @@ public class HumanPlayer extends PlayerImpl { public int announceXCost(int min, int max, String message, Game game, Ability ability, VariableCost variableCost) { int xValue = 0; updateGameStatePriority("announceXCost", game); - game.fireGetAmountEvent(playerId, message, min, max); - waitForIntegerResponse(game); + do { + game.fireGetAmountEvent(playerId, message, min, max); + waitForResponse(game); + } while (response.getInteger() == null && !abort); if (response != null && response.getInteger() != null) { xValue = response.getInteger(); } @@ -821,6 +916,15 @@ public class HumanPlayer extends PlayerImpl { attackedDefender, attacker.getId(), attacker.getControllerId()), game)) { continue; } + // if attacker needs a specific defender to attack so select that one instead + if (game.getCombat().getCreaturesForcedToAttack().containsKey(attacker.getId())) { + Set possibleDefenders = game.getCombat().getCreaturesForcedToAttack().get(attacker.getId()); + if (!possibleDefenders.isEmpty() && !possibleDefenders.contains(attackedDefender)) { + declareAttacker(attacker.getId(), possibleDefenders.iterator().next(), game, false); + continue; + } + } + // attack selected default defender declareAttacker(attacker.getId(), attackedDefender, game, false); } } else if (response.getBoolean() != null) { @@ -842,14 +946,18 @@ public class HumanPlayer extends PlayerImpl { } else { Permanent creature = game.getPermanent(creatureId); if (creature != null) { - sb.append(creature.getName()).append(" "); + sb.append(creature.getIdName()).append(" "); } } } if (game.getCombat().getMaxAttackers() > forcedAttackers) { - game.informPlayer(this, sb.insert(0, " more attacker(s) that are forced to attack.\nCreatures forced to attack: ") - .insert(0, Math.min(game.getCombat().getMaxAttackers() - forcedAttackers, game.getCombat().getCreaturesForcedToAttack().size() - forcedAttackers)) + int requireToAttack = Math.min(game.getCombat().getMaxAttackers() - forcedAttackers, game.getCombat().getCreaturesForcedToAttack().size() - forcedAttackers); + String message = (requireToAttack == 1 ? " more attacker that is " : " more attackers that are ") + + "forced to attack.\nCreature" + + (requireToAttack == 1 ? "" : "s") + " forced to attack: "; + game.informPlayer(this, sb.insert(0, message) + .insert(0, requireToAttack) .insert(0, "You have to attack with ").toString()); continue; } @@ -905,7 +1013,7 @@ public class HumanPlayer extends PlayerImpl { possibleDefender = defenders; } if (possibleDefender.size() == 1) { - declareAttacker(attackerId, defenders.iterator().next(), game, true); + declareAttacker(attackerId, possibleDefender.iterator().next(), game, true); return true; } else { TargetDefender target = new TargetDefender(possibleDefender, attackerId); @@ -1008,7 +1116,8 @@ public class HumanPlayer extends PlayerImpl { protected void selectCombatGroup(UUID defenderId, UUID blockerId, Game game) { updateGameStatePriority("selectCombatGroup", game); TargetAttackingCreature target = new TargetAttackingCreature(); - game.fireSelectTargetEvent(playerId, addSecondLineWithObjectName("Select attacker to block", blockerId, game), target.possibleTargets(null, playerId, game), false, getOptions(target, null)); + game.fireSelectTargetEvent(playerId, new MessageToClient("Select attacker to block", getRelatedObjectName(blockerId, game)), + target.possibleTargets(null, playerId, game), false, getOptions(target, null)); waitForResponse(game); if (response.getBoolean() != null) { // do nothing @@ -1031,6 +1140,7 @@ public class HumanPlayer extends PlayerImpl { int remainingDamage = damage; while (remainingDamage > 0 && canRespond()) { Target target = new TargetCreatureOrPlayer(); + target.setNotTarget(true); if (singleTargetName != null) { target.setTargetName(singleTargetName); } @@ -1055,8 +1165,10 @@ public class HumanPlayer extends PlayerImpl { @Override public int getAmount(int min, int max, String message, Game game) { updateGameStatePriority("getAmount", game); - game.fireGetAmountEvent(playerId, message, min, max); - waitForIntegerResponse(game); + do { + game.fireGetAmountEvent(playerId, message, min, max); + waitForResponse(game); + } while (response.getInteger() == null && !abort); if (response != null && response.getInteger() != null) { return response.getInteger(); } else { @@ -1121,7 +1233,9 @@ public class HumanPlayer extends PlayerImpl { updateGameStatePriority("activateAbility", game); if (abilities.size() == 1 && suppressAbilityPicker(abilities.values().iterator().next())) { ActivatedAbility ability = abilities.values().iterator().next(); - if (ability.getTargets().size() != 0 || !(ability.getCosts().size() == 1 && ability.getCosts().get(0) instanceof SacrificeSourceCost)) { + if (ability.getTargets().size() != 0 + || !(ability.getCosts().size() == 1 && ability.getCosts().get(0) instanceof SacrificeSourceCost) + || !(ability.getCosts().size() == 2 && ability.getCosts().get(0) instanceof TapSourceCost && ability.getCosts().get(0) instanceof SacrificeSourceCost)) { activateAbility(ability, game); return; } @@ -1143,11 +1257,7 @@ public class HumanPlayer extends PlayerImpl { if (!ability.getSourceId().equals(getCastSourceIdWithAlternateMana()) && ability.getManaCostsToPay().convertedManaCost() > 0) { return true; } - if (ability instanceof ManaAbility) { - return true; - } - // if ability has no mana costs you have to pick it from ability picker - return false; + return ability instanceof ManaAbility; } return true; } @@ -1184,12 +1294,27 @@ public class HumanPlayer extends PlayerImpl { if (modes.size() > 1) { MageObject obj = game.getObject(source.getSourceId()); Map modeMap = new LinkedHashMap<>(); + AvailableModes: for (Mode mode : modes.getAvailableModes(source, game)) { - if (!modes.getSelectedModes().contains(mode.getId()) // show only modes not already selected - && mode.getTargets().canChoose(source.getSourceId(), source.getControllerId(), game)) { // and where targets are available + int timesSelected = 0; + for (Mode selectedMode : modes.getSelectedModes()) { + if (mode.getId().equals(selectedMode.getId())) { + if (modes.isEachModeMoreThanOnce()) { + timesSelected++; + } else { + continue AvailableModes; + } + } + } + if (mode.getTargets().canChoose(source.getSourceId(), source.getControllerId(), game)) { // and needed targets have to be available String modeText = mode.getEffects().getText(mode); if (obj != null) { - modeText = modeText.replace("{source}", obj.getName()); + modeText = modeText.replace("{source}", obj.getName()).replace("{this}", obj.getName()); + } + if (modes.isEachModeMoreThanOnce()) { + if (timesSelected > 0) { + modeText = "(selected " + timesSelected + "x) " + modeText; + } } modeMap.put(mode.getId(), modeText); } @@ -1216,14 +1341,17 @@ public class HumanPlayer extends PlayerImpl { } return null; } + return modes.getMode(); } @Override public boolean choosePile(Outcome outcome, String message, List pile1, List pile2, Game game) { updateGameStatePriority("choosePile", game); - game.fireChoosePileEvent(playerId, message, pile1, pile2); - waitForBooleanResponse(game); + do { + game.fireChoosePileEvent(playerId, message, pile1, pile2); + waitForResponse(game); + } while (response.getBoolean() == null && !abort); if (!abort) { return response.getBoolean(); } @@ -1235,7 +1363,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setString(responseString); response.notify(); - log.debug("Got response string from player: " + getId()); + logger.debug("Got response string from player: " + getId()); } } @@ -1245,7 +1373,7 @@ public class HumanPlayer extends PlayerImpl { response.setManaType(manaType); response.setResponseManaTypePlayerId(manaTypePlayerId); response.notify(); - log.debug("Got response mana type from player: " + getId()); + logger.debug("Got response mana type from player: " + getId()); } } @@ -1254,7 +1382,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setUUID(responseUUID); response.notify(); - log.debug("Got response UUID from player: " + getId()); + logger.debug("Got response UUID from player: " + getId()); } } @@ -1263,7 +1391,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setBoolean(responseBoolean); response.notify(); - log.debug("Got response boolean from player: " + getId()); + logger.debug("Got response boolean from player: " + getId()); } } @@ -1272,7 +1400,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setInteger(responseInteger); response.notify(); - log.debug("Got response integer from player: " + getId()); + logger.debug("Got response integer from player: " + getId()); } } @@ -1281,7 +1409,7 @@ public class HumanPlayer extends PlayerImpl { abort = true; synchronized (response) { response.notify(); - log.debug("Got cancel action from player: " + getId()); + logger.debug("Got cancel action from player: " + getId()); } } @@ -1290,7 +1418,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setInteger(0); response.notify(); - log.debug("Got skip action from player: " + getId()); + logger.debug("Got skip action from player: " + getId()); } } @@ -1301,17 +1429,98 @@ public class HumanPlayer extends PlayerImpl { protected void updateGameStatePriority(String methodName, Game game) { if (game.getState().getPriorityPlayerId() != null) { // don't do it if priority was set to null before (e.g. discard in cleanaup) - log.debug("Setting game priority to " + getId() + " [" + methodName + "]"); + logger.debug("Setting game priority to " + getId() + " [" + methodName + "]"); game.getState().setPriorityPlayerId(getId()); } } @Override - public void sendPlayerAction(PlayerAction playerAction, Game game) { - if (PlayerAction.RESET_AUTO_SELECT_REPLACEMENT_EFFECTS.equals(playerAction)) { - autoSelectReplacementEffects.clear(); - } else { - super.sendPlayerAction(playerAction, game); + public void sendPlayerAction(PlayerAction playerAction, Game game, Object data) { + switch (playerAction) { + case RESET_AUTO_SELECT_REPLACEMENT_EFFECTS: + autoSelectReplacementEffects.clear(); + break; + case TRIGGER_AUTO_ORDER_ABILITY_FIRST: + case TRIGGER_AUTO_ORDER_ABILITY_LAST: + case TRIGGER_AUTO_ORDER_NAME_FIRST: + case TRIGGER_AUTO_ORDER_NAME_LAST: + case TRIGGER_AUTO_ORDER_RESET_ALL: + setTriggerAutoOrder(playerAction, game, data); + break; + case REQUEST_AUTO_ANSWER_ID_NO: + case REQUEST_AUTO_ANSWER_ID_YES: + case REQUEST_AUTO_ANSWER_TEXT_NO: + case REQUEST_AUTO_ANSWER_TEXT_YES: + case REQUEST_AUTO_ANSWER_RESET_ALL: + setRequestAutoAnswer(playerAction, game, data); + break; + default: + super.sendPlayerAction(playerAction, game, data); + } + } + + private void setRequestAutoAnswer(PlayerAction playerAction, Game game, Object data) { + if (playerAction.equals(REQUEST_AUTO_ANSWER_RESET_ALL)) { + requestAutoAnswerId.clear(); + requestAutoAnswerText.clear(); + return; + } + if (data instanceof String) { + String key = (String) data; + switch (playerAction) { + case REQUEST_AUTO_ANSWER_ID_NO: + requestAutoAnswerId.put(key, false); + break; + case REQUEST_AUTO_ANSWER_TEXT_NO: + requestAutoAnswerText.put(key, false); + break; + case REQUEST_AUTO_ANSWER_ID_YES: + requestAutoAnswerId.put(key, true); + break; + case REQUEST_AUTO_ANSWER_TEXT_YES: + requestAutoAnswerText.put(key, true); + break; + } + } + } + + private void setTriggerAutoOrder(PlayerAction playerAction, Game game, Object data) { + if (playerAction.equals(TRIGGER_AUTO_ORDER_RESET_ALL)) { + triggerAutoOrderAbilityFirst.clear(); + triggerAutoOrderAbilityLast.clear(); + triggerAutoOrderNameFirst.clear(); + triggerAutoOrderNameLast.clear(); + return; + } + if (data instanceof UUID) { + UUID abilityId = (UUID) data; + UUID originalId = null; + for (TriggeredAbility ability : game.getState().getTriggered(getId())) { + if (ability.getId().equals(abilityId)) { + originalId = ability.getOriginalId(); + break; + } + } + if (originalId != null) { + switch (playerAction) { + case TRIGGER_AUTO_ORDER_ABILITY_FIRST: + triggerAutoOrderAbilityFirst.add(originalId); + break; + case TRIGGER_AUTO_ORDER_ABILITY_LAST: + triggerAutoOrderAbilityFirst.add(originalId); + break; + } + } + } else if (data instanceof String) { + String abilityName = (String) data; + switch (playerAction) { + case TRIGGER_AUTO_ORDER_NAME_FIRST: + triggerAutoOrderNameFirst.add(abilityName); + break; + case TRIGGER_AUTO_ORDER_NAME_LAST: + triggerAutoOrderNameLast.add(abilityName); + break; + } } } @@ -1330,7 +1539,7 @@ public class HumanPlayer extends PlayerImpl { } if (!chooseUse(Outcome.Detriment, GameLog.getPlayerConfirmColoredText("You have still mana in your mana pool. Pass regardless?") + GameLog.getSmallSecondLineText(activePlayerText + " / " + game.getStep().getType().toString() + priorityPlayerText), null, game)) { - sendPlayerAction(PlayerAction.PASS_PRIORITY_CANCEL_ALL_ACTIONS, game); + sendPlayerAction(PlayerAction.PASS_PRIORITY_CANCEL_ALL_ACTIONS, game, null); return false; } } diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/pom.xml b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/pom.xml index 06efa02a054..ad866a17197 100644 --- a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/pom.xml +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-tournament-boosterdraft diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/AdamStyborskisPauperCube.java b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/AdamStyborskisPauperCube.java new file mode 100644 index 00000000000..66ab2c5a67f --- /dev/null +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/AdamStyborskisPauperCube.java @@ -0,0 +1,454 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.tournament.cubes; + +import mage.game.draft.DraftCube; +import mage.game.draft.DraftCube.CardIdentity; + +/** + * + * @author fireshoes + */ +public class AdamStyborskisPauperCube extends DraftCube { + +public AdamStyborskisPauperCube() { + super("Adam Styborkski's Cube (411 cards)"); // https://docs.google.com/spreadsheets/d/12iQhC4bHqFW7hEWxPBjyC8yBDehFZ0_4DkqzyA8EL3o/edit#gid=0 + + cubeCards.add(new CardIdentity("Act of Treason", "")); + cubeCards.add(new CardIdentity("Adventuring Gear", "")); + cubeCards.add(new CardIdentity("Aerie Ouphes", "")); + cubeCards.add(new CardIdentity("AEther Adept", "")); + cubeCards.add(new CardIdentity("AEthersnipe", "")); + cubeCards.add(new CardIdentity("Agony Warp", "")); + cubeCards.add(new CardIdentity("Ambush Viper", "")); + cubeCards.add(new CardIdentity("Apex Hawks", "")); + cubeCards.add(new CardIdentity("Arachnus Web", "")); + cubeCards.add(new CardIdentity("Arc Lightning", "")); + cubeCards.add(new CardIdentity("Armillary Sphere", "")); + cubeCards.add(new CardIdentity("Army of Allah", "")); + cubeCards.add(new CardIdentity("Arrest", "")); + cubeCards.add(new CardIdentity("Ashes to Ashes", "")); + cubeCards.add(new CardIdentity("Assault Zeppelid", "")); + cubeCards.add(new CardIdentity("Attended Knight", "")); + cubeCards.add(new CardIdentity("Auger Spree", "")); + cubeCards.add(new CardIdentity("Aven Riftwatcher", "")); + cubeCards.add(new CardIdentity("Aven Surveyor", "")); + cubeCards.add(new CardIdentity("Azorius Guildgate", "")); + cubeCards.add(new CardIdentity("Baleful Eidolon", "")); + cubeCards.add(new CardIdentity("Barbed Lightning", "")); + cubeCards.add(new CardIdentity("Barren Moor", "")); + cubeCards.add(new CardIdentity("Basking Rootwalla", "")); + cubeCards.add(new CardIdentity("Battle Screech", "")); + cubeCards.add(new CardIdentity("Beetleback Chief", "")); + cubeCards.add(new CardIdentity("Beetleform Mage", "")); + cubeCards.add(new CardIdentity("Blade of the Sixth Pride", "")); + cubeCards.add(new CardIdentity("Blastoderm", "")); + cubeCards.add(new CardIdentity("Blazing Torch", "")); + cubeCards.add(new CardIdentity("Blightning", "")); + cubeCards.add(new CardIdentity("Blinding Beam", "")); + cubeCards.add(new CardIdentity("Bloodfell Caves", "")); + cubeCards.add(new CardIdentity("Blossoming Sands", "")); + cubeCards.add(new CardIdentity("Bonded Construct", "")); + cubeCards.add(new CardIdentity("Bonds of Faith", "")); + cubeCards.add(new CardIdentity("Bonesplitter", "")); + cubeCards.add(new CardIdentity("Boomerang", "")); + cubeCards.add(new CardIdentity("Borderland Marauder", "")); + cubeCards.add(new CardIdentity("Boros Guildgate", "")); + cubeCards.add(new CardIdentity("Branching Bolt", "")); + cubeCards.add(new CardIdentity("Brute Force", "")); + cubeCards.add(new CardIdentity("Burst Lightning", "")); + cubeCards.add(new CardIdentity("Butcher Ghoul", "")); + cubeCards.add(new CardIdentity("Cadaver Imp", "")); + cubeCards.add(new CardIdentity("Cage of Hands", "")); + cubeCards.add(new CardIdentity("Calcite Snapper", "")); + cubeCards.add(new CardIdentity("Capsize", "")); + cubeCards.add(new CardIdentity("Carnivorous Death-Parrot", "")); + cubeCards.add(new CardIdentity("Carnophage", "")); + cubeCards.add(new CardIdentity("Cathodion", "")); + cubeCards.add(new CardIdentity("Cavern Harpy", "")); + cubeCards.add(new CardIdentity("Centaur Healer", "")); + cubeCards.add(new CardIdentity("Centaur's Herald", "")); + cubeCards.add(new CardIdentity("Center Soul", "")); + cubeCards.add(new CardIdentity("Chain Lightning", "")); + cubeCards.add(new CardIdentity("Chainer's Edict", "")); + cubeCards.add(new CardIdentity("Citanul Woodreaders", "")); + cubeCards.add(new CardIdentity("Claustrophobia", "")); + cubeCards.add(new CardIdentity("Clay Statue", "")); + cubeCards.add(new CardIdentity("Cloaked Siren", "")); + cubeCards.add(new CardIdentity("Cloud of Faeries", "")); + cubeCards.add(new CardIdentity("Cloudshift", "")); + cubeCards.add(new CardIdentity("Coalition Honor Guard", "")); + cubeCards.add(new CardIdentity("Cogwork Librarian", "")); + cubeCards.add(new CardIdentity("Colossal Might", "")); + cubeCards.add(new CardIdentity("Compulsive Research", "")); + cubeCards.add(new CardIdentity("Consume Strength", "")); + cubeCards.add(new CardIdentity("Corrupted Zendikon", "")); + cubeCards.add(new CardIdentity("Counterspell", "")); + cubeCards.add(new CardIdentity("Crippling Fatigue", "")); + cubeCards.add(new CardIdentity("Crocanura", "")); + cubeCards.add(new CardIdentity("Crypt Rats", "")); + cubeCards.add(new CardIdentity("Crystallization", "")); + cubeCards.add(new CardIdentity("Cultivate", "")); + cubeCards.add(new CardIdentity("Cunning Strike", "")); + cubeCards.add(new CardIdentity("Curse of Chains", "")); + cubeCards.add(new CardIdentity("Custodi Squire", "")); + cubeCards.add(new CardIdentity("Daring Skyjek", "")); + cubeCards.add(new CardIdentity("Daru Lancer", "")); + cubeCards.add(new CardIdentity("Dauthi Horror", "")); + cubeCards.add(new CardIdentity("Dauthi Marauder", "")); + cubeCards.add(new CardIdentity("Dauthi Mercenary", "")); + cubeCards.add(new CardIdentity("Dauthi Slayer", "")); + cubeCards.add(new CardIdentity("Dead Reveler", "")); + cubeCards.add(new CardIdentity("Dead Weight", "")); + cubeCards.add(new CardIdentity("Death Denied", "")); + cubeCards.add(new CardIdentity("Deep Analysis", "")); + cubeCards.add(new CardIdentity("Deprive", "")); + cubeCards.add(new CardIdentity("Deputy of Acquittals", "")); + cubeCards.add(new CardIdentity("Desert", "")); + cubeCards.add(new CardIdentity("Devour Flesh", "")); + cubeCards.add(new CardIdentity("Diabolic Edict", "")); + cubeCards.add(new CardIdentity("Dimir Guildgate", "")); + cubeCards.add(new CardIdentity("Disfigure", "")); + cubeCards.add(new CardIdentity("Dismal Backwater", "")); + cubeCards.add(new CardIdentity("Distortion Strike", "")); + cubeCards.add(new CardIdentity("Doom Blade", "")); + cubeCards.add(new CardIdentity("Doomed Traveler", "")); + cubeCards.add(new CardIdentity("Dragon Fodder", "")); + cubeCards.add(new CardIdentity("Driver of the Dead", "")); + cubeCards.add(new CardIdentity("Dynacharge", "")); + cubeCards.add(new CardIdentity("Elephant Ambush", "")); + cubeCards.add(new CardIdentity("Elephant Guide", "")); + cubeCards.add(new CardIdentity("Elusive Spellfist", "")); + cubeCards.add(new CardIdentity("Enhanced Awareness", "")); + cubeCards.add(new CardIdentity("Epic Confrontation", "")); + cubeCards.add(new CardIdentity("Errant Ephemeron", "")); + cubeCards.add(new CardIdentity("Esper Cormorants", "")); + cubeCards.add(new CardIdentity("Essence Scatter", "")); + cubeCards.add(new CardIdentity("Ethereal Armor", "")); + cubeCards.add(new CardIdentity("Evincar's Justice", "")); + cubeCards.add(new CardIdentity("Evolution Charm", "")); + cubeCards.add(new CardIdentity("Evolving Wilds", "")); + cubeCards.add(new CardIdentity("Exclude", "")); + cubeCards.add(new CardIdentity("Eye of Nowhere", "")); + cubeCards.add(new CardIdentity("Faceless Butcher", "")); + cubeCards.add(new CardIdentity("Faith's Fetters", "")); + cubeCards.add(new CardIdentity("Fall of the Hammer", "")); + cubeCards.add(new CardIdentity("Farseek", "")); + cubeCards.add(new CardIdentity("Feat of Resistance", "")); + cubeCards.add(new CardIdentity("Feeling of Dread", "")); + cubeCards.add(new CardIdentity("Fellwar Stone", "")); + cubeCards.add(new CardIdentity("Fervent Cathar", "")); + cubeCards.add(new CardIdentity("Fire Ambush", "")); + cubeCards.add(new CardIdentity("Fireblast", "")); + cubeCards.add(new CardIdentity("Firebolt", "")); + cubeCards.add(new CardIdentity("Firefiend Elemental", "")); + cubeCards.add(new CardIdentity("Fireslinger", "")); + cubeCards.add(new CardIdentity("Fists of Ironwood", "")); + cubeCards.add(new CardIdentity("Flayer Husk", "")); + cubeCards.add(new CardIdentity("Flurry of Horns", "")); + cubeCards.add(new CardIdentity("Font of Return", "")); + cubeCards.add(new CardIdentity("Fortify", "")); + cubeCards.add(new CardIdentity("Foul Spirit", "")); + cubeCards.add(new CardIdentity("Frilled Oculus", "")); + cubeCards.add(new CardIdentity("Frostburn Weird", "")); + cubeCards.add(new CardIdentity("Fyndhorn Elves", "")); + cubeCards.add(new CardIdentity("Garruk's Companion", "")); + cubeCards.add(new CardIdentity("Gathan Raiders", "")); + cubeCards.add(new CardIdentity("Gather the Townsfolk", "")); + cubeCards.add(new CardIdentity("Ghastly Demise", "")); + cubeCards.add(new CardIdentity("Ghirapur Gearcrafter", "")); + cubeCards.add(new CardIdentity("Ghitu Slinger", "")); + cubeCards.add(new CardIdentity("Giant Growth", "")); + cubeCards.add(new CardIdentity("Gideon's Lawkeeper", "")); + cubeCards.add(new CardIdentity("Goblin Heelcutter", "")); + cubeCards.add(new CardIdentity("Gods Willing", "")); + cubeCards.add(new CardIdentity("Goldmeadow Harrier", "")); + cubeCards.add(new CardIdentity("Golgari Guildgate", "")); + cubeCards.add(new CardIdentity("Gore-House Chainwalker", "")); + cubeCards.add(new CardIdentity("Gravedigger", "")); + cubeCards.add(new CardIdentity("Gray Merchant of Asphodel", "")); + cubeCards.add(new CardIdentity("Grim Contest", "")); + cubeCards.add(new CardIdentity("Grisly Salvage", "")); + cubeCards.add(new CardIdentity("Gruul Guildgate", "")); + cubeCards.add(new CardIdentity("Gryff Vanguard", "")); + cubeCards.add(new CardIdentity("Guardian Automaton", "")); + cubeCards.add(new CardIdentity("Guardian of the Guildpact", "")); + cubeCards.add(new CardIdentity("Gurmag Angler", "")); + cubeCards.add(new CardIdentity("Halimar Depths", "")); + cubeCards.add(new CardIdentity("Halimar Wavewatch", "")); + cubeCards.add(new CardIdentity("Harrow", "")); + cubeCards.add(new CardIdentity("Harsh Sustenance", "")); + cubeCards.add(new CardIdentity("Hissing Iguanar", "")); + cubeCards.add(new CardIdentity("Hooting Mandrills", "")); + cubeCards.add(new CardIdentity("Hyena Umbra", "")); + cubeCards.add(new CardIdentity("Hymn to Tourach", "")); + cubeCards.add(new CardIdentity("Imperiosaur", "")); + cubeCards.add(new CardIdentity("Incinerate", "")); + cubeCards.add(new CardIdentity("Inner-Flame Acolyte", "")); + cubeCards.add(new CardIdentity("Into the Roil", "")); + cubeCards.add(new CardIdentity("Izzet Chronarch", "")); + cubeCards.add(new CardIdentity("Izzet Guildgate", "")); + cubeCards.add(new CardIdentity("Jilt", "")); + cubeCards.add(new CardIdentity("Journey to Nowhere", "")); + cubeCards.add(new CardIdentity("Jungle Hollow", "")); + cubeCards.add(new CardIdentity("Kabuto Moth", "")); + cubeCards.add(new CardIdentity("Keldon Marauders", "")); + cubeCards.add(new CardIdentity("Khalni Garden", "")); + cubeCards.add(new CardIdentity("Kingpin's Pet", "")); + cubeCards.add(new CardIdentity("Kodama's Reach", "")); + cubeCards.add(new CardIdentity("Kor Skyfisher", "")); + cubeCards.add(new CardIdentity("Kozilek's Predator", "")); + cubeCards.add(new CardIdentity("Krenko's Command", "")); + cubeCards.add(new CardIdentity("Krosan Tusker", "")); + cubeCards.add(new CardIdentity("Kruin Striker", "")); + cubeCards.add(new CardIdentity("Lash Out", "")); + cubeCards.add(new CardIdentity("Last Gasp", "")); + cubeCards.add(new CardIdentity("Leonin Bola", "")); + cubeCards.add(new CardIdentity("Leonin Scimitar", "")); + cubeCards.add(new CardIdentity("Lightning Bolt", "")); + cubeCards.add(new CardIdentity("Lightning Strike", "")); + cubeCards.add(new CardIdentity("Liliana's Specter", "")); + cubeCards.add(new CardIdentity("Llanowar Elves", "")); + cubeCards.add(new CardIdentity("Lone Missionary", "")); + cubeCards.add(new CardIdentity("Looter il-Kor", "")); + cubeCards.add(new CardIdentity("Lotus Path Djinn", "")); + cubeCards.add(new CardIdentity("Loyal Cathar", "")); + cubeCards.add(new CardIdentity("Loyal Pegasus", "")); + cubeCards.add(new CardIdentity("Lurking Automaton", "")); + cubeCards.add(new CardIdentity("Makeshift Mauler", "")); + cubeCards.add(new CardIdentity("Mana Leak", "")); + cubeCards.add(new CardIdentity("Man-o'-War", "")); + cubeCards.add(new CardIdentity("Mardu Hordechief", "")); + cubeCards.add(new CardIdentity("Mardu Scout", "")); + cubeCards.add(new CardIdentity("Mardu Skullhunter", "")); + cubeCards.add(new CardIdentity("Martial Glory", "")); + cubeCards.add(new CardIdentity("Maul Splicer", "")); + cubeCards.add(new CardIdentity("Maze of Ith", "")); + cubeCards.add(new CardIdentity("Merfolk Looter", "")); + cubeCards.add(new CardIdentity("Mind Stone", "")); + cubeCards.add(new CardIdentity("Minotaur Skullcleaver", "")); + cubeCards.add(new CardIdentity("Mire Boa", "")); + cubeCards.add(new CardIdentity("Miscalculation", "")); + cubeCards.add(new CardIdentity("Mishra's Factory", "")); + cubeCards.add(new CardIdentity("Mist Raven", "")); + cubeCards.add(new CardIdentity("Mogg Fanatic", "")); + cubeCards.add(new CardIdentity("Mogg Flunkies", "")); + cubeCards.add(new CardIdentity("Mogg War Marshal", "")); + cubeCards.add(new CardIdentity("Moldervine Cloak", "")); + cubeCards.add(new CardIdentity("Momentary Blink", "")); + cubeCards.add(new CardIdentity("Morgue Theft", "")); + cubeCards.add(new CardIdentity("Mulldrifter", "")); + cubeCards.add(new CardIdentity("Nameless Inversion", "")); + cubeCards.add(new CardIdentity("Narcolepsy", "")); + cubeCards.add(new CardIdentity("Necromancer's Assistant", "")); + cubeCards.add(new CardIdentity("Nessian Asp", "")); + cubeCards.add(new CardIdentity("Nest Invader", "")); + cubeCards.add(new CardIdentity("Nezumi Cutthroat", "")); + cubeCards.add(new CardIdentity("Nightscape Familiar", "")); + cubeCards.add(new CardIdentity("Ninja of the Deep Hours", "")); + cubeCards.add(new CardIdentity("Oblivion Ring", "")); + cubeCards.add(new CardIdentity("Okiba-Gang Shinobi", "")); + cubeCards.add(new CardIdentity("Omenspeaker", "")); + cubeCards.add(new CardIdentity("Orzhov Guildgate", "")); + cubeCards.add(new CardIdentity("Otherworldly Journey", "")); + cubeCards.add(new CardIdentity("Pacifism", "")); + cubeCards.add(new CardIdentity("Path of Anger's Flame", "")); + cubeCards.add(new CardIdentity("Penumbra Spider", "")); + cubeCards.add(new CardIdentity("Perilous Myr", "")); + cubeCards.add(new CardIdentity("Pestermite", "")); + cubeCards.add(new CardIdentity("Pestilence", "")); + cubeCards.add(new CardIdentity("Phantom Nomad", "")); + cubeCards.add(new CardIdentity("Phantom Tiger", "")); + cubeCards.add(new CardIdentity("Pharika's Chosen", "")); + cubeCards.add(new CardIdentity("Phyrexian Rager", "")); + cubeCards.add(new CardIdentity("Pillory of the Sleepless", "")); + cubeCards.add(new CardIdentity("Pit Fight", "")); + cubeCards.add(new CardIdentity("Pit Keeper", "")); + cubeCards.add(new CardIdentity("Plated Geopede", "")); + cubeCards.add(new CardIdentity("Plover Knights", "")); + cubeCards.add(new CardIdentity("Porcelain Legionnaire", "")); + cubeCards.add(new CardIdentity("Pouncing Kavu", "")); + cubeCards.add(new CardIdentity("Predatory Nightstalker", "")); + cubeCards.add(new CardIdentity("Preordain", "")); + cubeCards.add(new CardIdentity("Prey Upon", "")); + cubeCards.add(new CardIdentity("Prismatic Lens", "")); + cubeCards.add(new CardIdentity("Prismatic Strands", "")); + cubeCards.add(new CardIdentity("Pristine Talisman", "")); + cubeCards.add(new CardIdentity("Probe", "")); + cubeCards.add(new CardIdentity("Prophetic Prism", "")); + cubeCards.add(new CardIdentity("Putrid Leech", "")); + cubeCards.add(new CardIdentity("Pyrotechnics", "")); + cubeCards.add(new CardIdentity("Qasali Pridemage", "")); + cubeCards.add(new CardIdentity("Raise the Alarm", "")); + cubeCards.add(new CardIdentity("Rakdos Guildgate", "")); + cubeCards.add(new CardIdentity("Rakdos Shred-Freak", "")); + cubeCards.add(new CardIdentity("Rampant Growth", "")); + cubeCards.add(new CardIdentity("Rancor", "")); + cubeCards.add(new CardIdentity("Ranger's Guile", "")); + cubeCards.add(new CardIdentity("Ray of Command", "")); + cubeCards.add(new CardIdentity("Razorfin Hunter", "")); + cubeCards.add(new CardIdentity("Reckless Charge", "")); + cubeCards.add(new CardIdentity("Reclaim", "")); + cubeCards.add(new CardIdentity("Recoil", "")); + cubeCards.add(new CardIdentity("Remove Soul", "")); + cubeCards.add(new CardIdentity("Rend Flesh", "")); + cubeCards.add(new CardIdentity("Rendclaw Trow", "")); + cubeCards.add(new CardIdentity("Rhox Maulers", "")); + cubeCards.add(new CardIdentity("Rishadan Airship", "")); + cubeCards.add(new CardIdentity("River Boa", "")); + cubeCards.add(new CardIdentity("Ronin Houndmaster", "")); + cubeCards.add(new CardIdentity("Rugged Highlands", "")); + cubeCards.add(new CardIdentity("Runed Servitor", "")); + cubeCards.add(new CardIdentity("Rushing River", "")); + cubeCards.add(new CardIdentity("Safehold Elite", "")); + cubeCards.add(new CardIdentity("Sakura-Tribe Elder", "")); + cubeCards.add(new CardIdentity("Sandsteppe Outcast", "")); + cubeCards.add(new CardIdentity("Sangrite Backlash", "")); + cubeCards.add(new CardIdentity("Sarkhan's Rage", "")); + cubeCards.add(new CardIdentity("Savage Punch", "")); + cubeCards.add(new CardIdentity("Savage Surge", "")); + cubeCards.add(new CardIdentity("Scatter the Seeds", "")); + cubeCards.add(new CardIdentity("Scion of the Wild", "")); + cubeCards.add(new CardIdentity("Scoured Barrens", "")); + cubeCards.add(new CardIdentity("Scuzzback Marauders", "")); + cubeCards.add(new CardIdentity("Searing Blaze", "")); + cubeCards.add(new CardIdentity("Searing Spear", "")); + cubeCards.add(new CardIdentity("Sejiri Steppe", "")); + cubeCards.add(new CardIdentity("Selesnya Guildgate", "")); + cubeCards.add(new CardIdentity("Sentinel Spider", "")); + cubeCards.add(new CardIdentity("Seraph of Dawn", "")); + cubeCards.add(new CardIdentity("Serrated Arrows", "")); + cubeCards.add(new CardIdentity("Shaper Parasite", "")); + cubeCards.add(new CardIdentity("Shelter", "")); + cubeCards.add(new CardIdentity("Shimmering Glasskite", "")); + cubeCards.add(new CardIdentity("Shimmering Grotto", "")); + cubeCards.add(new CardIdentity("Sigil Blessing", "")); + cubeCards.add(new CardIdentity("Silent Departure", "")); + cubeCards.add(new CardIdentity("Simic Guildgate", "")); + cubeCards.add(new CardIdentity("Skinthinner", "")); + cubeCards.add(new CardIdentity("Skirk Marauder", "")); + cubeCards.add(new CardIdentity("Skyknight Legionnaire", "")); + cubeCards.add(new CardIdentity("Skywinder Drake", "")); + cubeCards.add(new CardIdentity("Slash Panther", "")); + cubeCards.add(new CardIdentity("Slippery Bogle", "")); + cubeCards.add(new CardIdentity("Snakeform", "")); + cubeCards.add(new CardIdentity("Snap", "")); + cubeCards.add(new CardIdentity("Snuff Out", "")); + cubeCards.add(new CardIdentity("Soltari Emissary", "")); + cubeCards.add(new CardIdentity("Soltari Lancer", "")); + cubeCards.add(new CardIdentity("Soltari Trooper", "")); + cubeCards.add(new CardIdentity("Soul Manipulation", "")); + cubeCards.add(new CardIdentity("Sparksmith", "")); + cubeCards.add(new CardIdentity("Sphere of the Suns", "")); + cubeCards.add(new CardIdentity("Spined Thopter", "")); + cubeCards.add(new CardIdentity("Splatter Thug", "")); + cubeCards.add(new CardIdentity("Staggershock", "")); + cubeCards.add(new CardIdentity("Stampeding Elk Herd", "")); + cubeCards.add(new CardIdentity("Stave Off", "")); + cubeCards.add(new CardIdentity("Stealer of Secrets", "")); + cubeCards.add(new CardIdentity("Stitched Drake", "")); + cubeCards.add(new CardIdentity("Stormfront Pegasus", "")); + cubeCards.add(new CardIdentity("Stormscape Apprentice", "")); + cubeCards.add(new CardIdentity("Strider Harness", "")); + cubeCards.add(new CardIdentity("Strip Mine", "")); + cubeCards.add(new CardIdentity("Sultai Scavenger", "")); + cubeCards.add(new CardIdentity("Suppression Bonds", "")); + cubeCards.add(new CardIdentity("Suq'Ata Lancer", "")); + cubeCards.add(new CardIdentity("Swiftwater Cliffs", "")); + cubeCards.add(new CardIdentity("Sylvok Lifestaff", "")); + cubeCards.add(new CardIdentity("Tail Slash", "")); + cubeCards.add(new CardIdentity("Teetering Peaks", "")); + cubeCards.add(new CardIdentity("Temporal Isolation", "")); + cubeCards.add(new CardIdentity("Tenement Crasher", "")); + cubeCards.add(new CardIdentity("Terminate", "")); + cubeCards.add(new CardIdentity("Terramorphic Expanse", "")); + cubeCards.add(new CardIdentity("Test of Faith", "")); + cubeCards.add(new CardIdentity("Thornweald Archer", "")); + cubeCards.add(new CardIdentity("Thornwood Falls", "")); + cubeCards.add(new CardIdentity("Thought Courier", "")); + cubeCards.add(new CardIdentity("Thundering Giant", "")); + cubeCards.add(new CardIdentity("Thundering Tanadon", "")); + cubeCards.add(new CardIdentity("Time to Feed", "")); + cubeCards.add(new CardIdentity("Tithe Drinker", "")); + cubeCards.add(new CardIdentity("Totem-Guide Hartebeest", "")); + cubeCards.add(new CardIdentity("Tragic Slip", "")); + cubeCards.add(new CardIdentity("Tranquil Cove", "")); + cubeCards.add(new CardIdentity("Travel Preparations", "")); + cubeCards.add(new CardIdentity("Treasure Cruise", "")); + cubeCards.add(new CardIdentity("Triplicate Spirits", "")); + cubeCards.add(new CardIdentity("Trumpet Blast", "")); + cubeCards.add(new CardIdentity("Tumble Magnet", "")); + cubeCards.add(new CardIdentity("Twin Bolt", "")); + cubeCards.add(new CardIdentity("Typhoid Rats", "")); + cubeCards.add(new CardIdentity("Ulamog's Crusher", "")); + cubeCards.add(new CardIdentity("Undying Evil", "")); + cubeCards.add(new CardIdentity("Unearth", "")); + cubeCards.add(new CardIdentity("Unknown Shores", "")); + cubeCards.add(new CardIdentity("Unmake", "")); + cubeCards.add(new CardIdentity("Vampire Interloper", "")); + cubeCards.add(new CardIdentity("Vampire Lacerator", "")); + cubeCards.add(new CardIdentity("Vault Skirge", "")); + cubeCards.add(new CardIdentity("Vendetta", "")); + cubeCards.add(new CardIdentity("Veteran's Sidearm", "")); + cubeCards.add(new CardIdentity("Viashino Firstblade", "")); + cubeCards.add(new CardIdentity("Vines of Vastwood", "")); + cubeCards.add(new CardIdentity("Voidwielder", "")); + cubeCards.add(new CardIdentity("Volcanic Hammer", "")); + cubeCards.add(new CardIdentity("Vulshok Morningstar", "")); + cubeCards.add(new CardIdentity("Vulshok Sorcerer", "")); + cubeCards.add(new CardIdentity("Vulturous Aven", "")); + cubeCards.add(new CardIdentity("Wakedancer", "")); + cubeCards.add(new CardIdentity("Walker of the Grove", "")); + cubeCards.add(new CardIdentity("Wall of Roots", "")); + cubeCards.add(new CardIdentity("War Flare", "")); + cubeCards.add(new CardIdentity("Warren Pilferers", "")); + cubeCards.add(new CardIdentity("Waterfront Bouncer", "")); + cubeCards.add(new CardIdentity("Wayfarer's Bauble", "")); + cubeCards.add(new CardIdentity("Whirlpool Whelm", "")); + cubeCards.add(new CardIdentity("Whispers of the Muse", "")); + cubeCards.add(new CardIdentity("Whispersilk Cloak", "")); + cubeCards.add(new CardIdentity("Whitemane Lion", "")); + cubeCards.add(new CardIdentity("Wickerbough Elder", "")); + cubeCards.add(new CardIdentity("Wild Instincts", "")); + cubeCards.add(new CardIdentity("Wild Mongrel", "")); + cubeCards.add(new CardIdentity("Wild Nacatl", "")); + cubeCards.add(new CardIdentity("Wildsize", "")); + cubeCards.add(new CardIdentity("Will-Forged Golem", "")); + cubeCards.add(new CardIdentity("Wind-Scarred Crag", "")); + cubeCards.add(new CardIdentity("Wingcrafter", "")); + cubeCards.add(new CardIdentity("Wingsteed Rider", "")); + cubeCards.add(new CardIdentity("Withdraw", "")); + cubeCards.add(new CardIdentity("Wojek Halberdiers", "")); + cubeCards.add(new CardIdentity("Wrecking Ball", "")); + cubeCards.add(new CardIdentity("Yavimaya Elder", "")); + cubeCards.add(new CardIdentity("Yotian Soldier", "")); + cubeCards.add(new CardIdentity("Young Wolf", "")); + cubeCards.add(new CardIdentity("Youthful Knight", "")); + cubeCards.add(new CardIdentity("Zhur-Taa Swine", "")); + } +} diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/JimDavisCube.java b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/JimDavisCube.java new file mode 100644 index 00000000000..8674c4e2251 --- /dev/null +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/JimDavisCube.java @@ -0,0 +1,511 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.tournament.cubes; + +import mage.game.draft.DraftCube; +import mage.game.draft.DraftCube.CardIdentity; + +/** + * + * @author fireshoes + */ +public class JimDavisCube extends DraftCube { + + public JimDavisCube() { + super("Jim Davis's Cube (469 cards)"); // https://docs.google.com/spreadsheets/d/1pZ3aQR-Kb5MmMDNh1sOtMt4vSrJEWNixyZDZrQSBJb4/edit#gid=0 + + cubeCards.add(new CardIdentity("Abbot of Keral Keep", "")); + cubeCards.add(new CardIdentity("Abrupt Decay", "")); + cubeCards.add(new CardIdentity("Absorb", "")); + cubeCards.add(new CardIdentity("Academy Ruins", "")); + cubeCards.add(new CardIdentity("Accorder Paladin", "")); + cubeCards.add(new CardIdentity("Advantageous Proclamation", "")); + cubeCards.add(new CardIdentity("AEther Vial", "")); + cubeCards.add(new CardIdentity("Agent of Acquisitions", "")); + cubeCards.add(new CardIdentity("Ajani Vengeant", "")); + cubeCards.add(new CardIdentity("Ancient Den", "")); + cubeCards.add(new CardIdentity("Ancient Tomb", "")); + cubeCards.add(new CardIdentity("Angel of Serenity", "")); + cubeCards.add(new CardIdentity("Animate Dead", "")); + cubeCards.add(new CardIdentity("Ankh of Mishra", "")); + cubeCards.add(new CardIdentity("Arcbound Ravager", "")); + cubeCards.add(new CardIdentity("Arid Mesa", "")); + cubeCards.add(new CardIdentity("Armageddon", "")); + cubeCards.add(new CardIdentity("Ashen Rider", "")); + cubeCards.add(new CardIdentity("Avacyn's Pilgrim", "")); + cubeCards.add(new CardIdentity("Avenger of Zendikar", "")); + cubeCards.add(new CardIdentity("Azorius Signet", "")); + cubeCards.add(new CardIdentity("Backup Plan", "")); + cubeCards.add(new CardIdentity("Badlands", "")); + cubeCards.add(new CardIdentity("Balance", "")); + cubeCards.add(new CardIdentity("Baleful Strix", "")); + cubeCards.add(new CardIdentity("Baneslayer Angel", "")); + cubeCards.add(new CardIdentity("Batterskull", "")); + cubeCards.add(new CardIdentity("Battle Screech", "")); + cubeCards.add(new CardIdentity("Battlefield Forge", "")); + cubeCards.add(new CardIdentity("Bayou", "")); + cubeCards.add(new CardIdentity("Bazaar of Baghdad", "")); + cubeCards.add(new CardIdentity("Birds of Paradise", "")); + cubeCards.add(new CardIdentity("Birthing Pod", "")); + cubeCards.add(new CardIdentity("Bitterblossom", "")); + cubeCards.add(new CardIdentity("Blackcleave Cliffs", "")); + cubeCards.add(new CardIdentity("Blade Splicer", "")); + cubeCards.add(new CardIdentity("Blightning", "")); + cubeCards.add(new CardIdentity("Blinkmoth Nexus", "")); + cubeCards.add(new CardIdentity("Blood Artist", "")); + cubeCards.add(new CardIdentity("Blood Crypt", "")); + cubeCards.add(new CardIdentity("Bloodbraid Elf", "")); + cubeCards.add(new CardIdentity("Bloodghast", "")); + cubeCards.add(new CardIdentity("Bloodsoaked Champion", "")); + cubeCards.add(new CardIdentity("Bloodstained Mire", "")); + cubeCards.add(new CardIdentity("Bonesplitter", "")); + cubeCards.add(new CardIdentity("Boros Charm", "")); + cubeCards.add(new CardIdentity("Boros Reckoner", "")); + cubeCards.add(new CardIdentity("Braids, Cabal Minion", "")); + cubeCards.add(new CardIdentity("Brain Freeze", "")); + cubeCards.add(new CardIdentity("Brainstorm", "")); + cubeCards.add(new CardIdentity("Breeding Pool", "")); + cubeCards.add(new CardIdentity("Brimaz, King of Oreskos", "")); + cubeCards.add(new CardIdentity("Bring to Light", "")); + cubeCards.add(new CardIdentity("Broodmate Dragon", "")); + cubeCards.add(new CardIdentity("Cabal Ritual", "")); + cubeCards.add(new CardIdentity("Careful Study", "")); + cubeCards.add(new CardIdentity("Carrion Feeder", "")); + cubeCards.add(new CardIdentity("Catacomb Sifter", "")); + cubeCards.add(new CardIdentity("Celestial Colonnade", "")); + cubeCards.add(new CardIdentity("Chained to the Rocks", "")); + cubeCards.add(new CardIdentity("Chain Lightning", "")); + cubeCards.add(new CardIdentity("Champion of the Parish", "")); + cubeCards.add(new CardIdentity("Chandra's Phoenix", "")); + cubeCards.add(new CardIdentity("Chromatic Sphere", "")); + cubeCards.add(new CardIdentity("Chromatic Star", "")); + cubeCards.add(new CardIdentity("Chrome Mox", "")); + cubeCards.add(new CardIdentity("City of Brass", "")); + cubeCards.add(new CardIdentity("City of Traitors", "")); + cubeCards.add(new CardIdentity("Clifftop Retreat", "")); + cubeCards.add(new CardIdentity("Coalition Relic", "")); + cubeCards.add(new CardIdentity("Coercive Portal", "")); + cubeCards.add(new CardIdentity("Cogwork Librarian", "")); + cubeCards.add(new CardIdentity("Collected Company", "")); + cubeCards.add(new CardIdentity("Condescend", "")); + cubeCards.add(new CardIdentity("Copperline Gorge", "")); + cubeCards.add(new CardIdentity("Council's Judgment", "")); + cubeCards.add(new CardIdentity("Counterspell", "")); + cubeCards.add(new CardIdentity("Court Hussar", "")); + cubeCards.add(new CardIdentity("Cranial Plating", "")); + cubeCards.add(new CardIdentity("Creeping Tar Pit", "")); + cubeCards.add(new CardIdentity("Crop Rotation", "")); + cubeCards.add(new CardIdentity("Crucible of Worlds", "")); + cubeCards.add(new CardIdentity("Cruel Ultimatum", "")); + cubeCards.add(new CardIdentity("Cryptic Command", "")); + cubeCards.add(new CardIdentity("Curse of Shallow Graves", "")); + cubeCards.add(new CardIdentity("Cursed Scroll", "")); + cubeCards.add(new CardIdentity("Damnation", "")); + cubeCards.add(new CardIdentity("Dark Confidant", "")); + cubeCards.add(new CardIdentity("Dark Ritual", "")); + cubeCards.add(new CardIdentity("Darkslick Shores", "")); + cubeCards.add(new CardIdentity("Darksteel Citadel", "")); + cubeCards.add(new CardIdentity("Daze", "")); + cubeCards.add(new CardIdentity("Deal Broker", "")); + cubeCards.add(new CardIdentity("Deathrite Shaman", "")); + cubeCards.add(new CardIdentity("Delver of Secrets", "")); + cubeCards.add(new CardIdentity("Demonic Tutor", "")); + cubeCards.add(new CardIdentity("Deranged Hermit", "")); + cubeCards.add(new CardIdentity("Detention Sphere", "")); + cubeCards.add(new CardIdentity("Dig Through Time", "")); + cubeCards.add(new CardIdentity("Dimir Signet", "")); + cubeCards.add(new CardIdentity("Diregraf Ghoul", "")); + cubeCards.add(new CardIdentity("Dismember", "")); + cubeCards.add(new CardIdentity("Dragon Hunter", "")); + cubeCards.add(new CardIdentity("Dragonlord Atarka", "")); + cubeCards.add(new CardIdentity("Drana, Liberator of Malakir", "")); + cubeCards.add(new CardIdentity("Dream Halls", "")); + cubeCards.add(new CardIdentity("Dryad Militant", "")); + cubeCards.add(new CardIdentity("Dust Bowl", "")); + cubeCards.add(new CardIdentity("Dwarven Blastminer", "")); + cubeCards.add(new CardIdentity("Edric, Spymaster of Trest", "")); + cubeCards.add(new CardIdentity("Eidolon of the Great Revel", "")); + cubeCards.add(new CardIdentity("Electrolyze", "")); + cubeCards.add(new CardIdentity("Emrakul, the Aeons Torn", "")); + cubeCards.add(new CardIdentity("Engineered Explosives", "")); + cubeCards.add(new CardIdentity("Enlightened Tutor", "")); + cubeCards.add(new CardIdentity("Entomb", "")); + cubeCards.add(new CardIdentity("Etched Champion", "")); + cubeCards.add(new CardIdentity("Eternal Witness", "")); + cubeCards.add(new CardIdentity("Etherium Sculptor", "")); + cubeCards.add(new CardIdentity("Ethersworn Canonist", "")); + cubeCards.add(new CardIdentity("Eureka", "")); + cubeCards.add(new CardIdentity("Everflowing Chalice", "")); + cubeCards.add(new CardIdentity("Expedition Map", "")); + cubeCards.add(new CardIdentity("Experiment One", "")); + cubeCards.add(new CardIdentity("Explore", "")); + cubeCards.add(new CardIdentity("Fact or Fiction", "")); + cubeCards.add(new CardIdentity("Faithless Looting", "")); + cubeCards.add(new CardIdentity("Falkenrath Aristocrat", "")); + cubeCards.add(new CardIdentity("Far // Away", "")); + cubeCards.add(new CardIdentity("Fastbond", "")); + cubeCards.add(new CardIdentity("Fauna Shaman", "")); + cubeCards.add(new CardIdentity("Figure of Destiny", "")); + cubeCards.add(new CardIdentity("Fire // Ice", "")); + cubeCards.add(new CardIdentity("Fireblast", "")); + cubeCards.add(new CardIdentity("Firebolt", "")); + cubeCards.add(new CardIdentity("Firedrinker Satyr", "")); + cubeCards.add(new CardIdentity("Firestorm", "")); + cubeCards.add(new CardIdentity("Flagstones of Trokair", "")); + cubeCards.add(new CardIdentity("Flametongue Kavu", "")); + cubeCards.add(new CardIdentity("Flesh Carver", "")); + cubeCards.add(new CardIdentity("Flickerwisp", "")); + cubeCards.add(new CardIdentity("Flinthoof Boar", "")); + cubeCards.add(new CardIdentity("Flooded Strand", "")); + cubeCards.add(new CardIdentity("Force of Will", "")); + cubeCards.add(new CardIdentity("Forgotten Cave", "")); + cubeCards.add(new CardIdentity("Frantic Search", "")); + cubeCards.add(new CardIdentity("Frogmite", "")); + cubeCards.add(new CardIdentity("Fulminator Mage", "")); + cubeCards.add(new CardIdentity("Gaea's Cradle", "")); + cubeCards.add(new CardIdentity("Galvanic Blast", "")); + cubeCards.add(new CardIdentity("Gamble", "")); + cubeCards.add(new CardIdentity("Garruk Wildspeaker", "")); + cubeCards.add(new CardIdentity("Geist of Saint Traft", "")); + cubeCards.add(new CardIdentity("Gemstone Mine", "")); + cubeCards.add(new CardIdentity("Genesis Hydra", "")); + cubeCards.add(new CardIdentity("Ghitu Encampment", "")); + cubeCards.add(new CardIdentity("Ghor-Clan Rampager", "")); + cubeCards.add(new CardIdentity("Gideon, Ally of Zendikar", "")); + cubeCards.add(new CardIdentity("Gifts Ungiven", "")); + cubeCards.add(new CardIdentity("Gilded Lotus", "")); + cubeCards.add(new CardIdentity("Gitaxian Probe", "")); + cubeCards.add(new CardIdentity("Glint Hawk Idol", "")); + cubeCards.add(new CardIdentity("Gnarled Scarhide", "")); + cubeCards.add(new CardIdentity("Go for the Throat", "")); + cubeCards.add(new CardIdentity("Goblin Electromancer", "")); + cubeCards.add(new CardIdentity("Goblin Guide", "")); + cubeCards.add(new CardIdentity("Goblin Rabblemaster", "")); + cubeCards.add(new CardIdentity("Goblin Welder", "")); + cubeCards.add(new CardIdentity("Godless Shrine", "")); + cubeCards.add(new CardIdentity("Golgari Rot Farm", "")); + cubeCards.add(new CardIdentity("Grave Titan", "")); + cubeCards.add(new CardIdentity("Gravecrawler", "")); + cubeCards.add(new CardIdentity("Great Furnace", "")); + cubeCards.add(new CardIdentity("Greater Gargadon", "")); + cubeCards.add(new CardIdentity("Green Sun's Zenith", "")); + cubeCards.add(new CardIdentity("Grim Lavamancer", "")); + cubeCards.add(new CardIdentity("Grim Monolith", "")); + cubeCards.add(new CardIdentity("Griselbrand", "")); + cubeCards.add(new CardIdentity("Gush", "")); + cubeCards.add(new CardIdentity("Hallowed Fountain", "")); + cubeCards.add(new CardIdentity("Hallowed Spiritkeeper", "")); + cubeCards.add(new CardIdentity("Hangarback Walker", "")); + cubeCards.add(new CardIdentity("Harmonize", "")); + cubeCards.add(new CardIdentity("Heartbeat of Spring", "")); + cubeCards.add(new CardIdentity("Hellrider", "")); + cubeCards.add(new CardIdentity("Hellspark Elemental", "")); + cubeCards.add(new CardIdentity("Helm of Awakening", "")); + cubeCards.add(new CardIdentity("Hero of Bladehold", "")); + cubeCards.add(new CardIdentity("Hex Parasite", "")); + cubeCards.add(new CardIdentity("Hinterland Harbor", "")); + cubeCards.add(new CardIdentity("Hokori, Dust Drinker", "")); + cubeCards.add(new CardIdentity("Hooting Mandrills", "")); + cubeCards.add(new CardIdentity("Horizon Canopy", "")); + cubeCards.add(new CardIdentity("Hymn to Tourach", "")); + cubeCards.add(new CardIdentity("Imperial Recruiter", "")); + cubeCards.add(new CardIdentity("Imperial Seal", "")); + cubeCards.add(new CardIdentity("Inferno Titan", "")); + cubeCards.add(new CardIdentity("Inquisition of Kozilek", "")); + cubeCards.add(new CardIdentity("Isamaru, Hound of Konda", "")); + cubeCards.add(new CardIdentity("Isochron Scepter", "")); + cubeCards.add(new CardIdentity("Isolated Chapel", "")); + cubeCards.add(new CardIdentity("Izzet Signet", "")); + cubeCards.add(new CardIdentity("Jace, the Mind Sculptor", "")); + cubeCards.add(new CardIdentity("Jace, Vryn's Prodigy", "")); + cubeCards.add(new CardIdentity("Jeskai Ascendancy", "")); + cubeCards.add(new CardIdentity("Joraga Treespeaker", "")); + cubeCards.add(new CardIdentity("Kami of Ancient Law", "")); + cubeCards.add(new CardIdentity("Karakas", "")); + cubeCards.add(new CardIdentity("Karn Liberated", "")); + cubeCards.add(new CardIdentity("Keranos, God of Storms", "")); + cubeCards.add(new CardIdentity("Kessig Wolf Run", "")); + cubeCards.add(new CardIdentity("Kiki-Jiki, Mirror Breaker", "")); + cubeCards.add(new CardIdentity("Kira, Great Glass-Spinner", "")); + cubeCards.add(new CardIdentity("Kird Ape", "")); + cubeCards.add(new CardIdentity("Kitchen Finks", "")); + cubeCards.add(new CardIdentity("Knight of the Reliquary", "")); + cubeCards.add(new CardIdentity("Kolaghan's Command", "")); + cubeCards.add(new CardIdentity("Kytheon, Hero of Akros", "")); + cubeCards.add(new CardIdentity("Land Tax", "")); + cubeCards.add(new CardIdentity("Life from the Loam", "")); + cubeCards.add(new CardIdentity("Lightning Bolt", "")); + cubeCards.add(new CardIdentity("Lightning Helix", "")); + cubeCards.add(new CardIdentity("Lightning Mauler", "")); + cubeCards.add(new CardIdentity("Liliana of the Veil", "")); + cubeCards.add(new CardIdentity("Lim-Dul's Vault", "")); + cubeCards.add(new CardIdentity("Lingering Souls", "")); + cubeCards.add(new CardIdentity("Lion's Eye Diamond", "")); + cubeCards.add(new CardIdentity("Llanowar Elves", "")); + cubeCards.add(new CardIdentity("Loam Lion", "")); + cubeCards.add(new CardIdentity("Lodestone Golem", "")); + cubeCards.add(new CardIdentity("Lore Seeker", "")); + cubeCards.add(new CardIdentity("Lotus Cobra", "")); + cubeCards.add(new CardIdentity("Lotus Petal", "")); + cubeCards.add(new CardIdentity("Maelstrom Pulse", "")); + cubeCards.add(new CardIdentity("Magma Jet", "")); + cubeCards.add(new CardIdentity("Makindi Sliderunner", "")); + cubeCards.add(new CardIdentity("Mana Confluence", "")); + cubeCards.add(new CardIdentity("Mana Leak", "")); + cubeCards.add(new CardIdentity("Mardu Woe-Reaper", "")); + cubeCards.add(new CardIdentity("Marsh Flats", "")); + cubeCards.add(new CardIdentity("Martial Coup", "")); + cubeCards.add(new CardIdentity("Master of Etherium", "")); + cubeCards.add(new CardIdentity("Maze of Ith", "")); + cubeCards.add(new CardIdentity("Meloku the Clouded Mirror", "")); + cubeCards.add(new CardIdentity("Memnite", "")); + cubeCards.add(new CardIdentity("Memory Jar", "")); + cubeCards.add(new CardIdentity("Memory Lapse", "")); + cubeCards.add(new CardIdentity("Mentor of the Meek", "")); + cubeCards.add(new CardIdentity("Metalworker", "")); + cubeCards.add(new CardIdentity("Mind Stone", "")); + cubeCards.add(new CardIdentity("Mindslaver", "")); + cubeCards.add(new CardIdentity("Mirari's Wake", "")); + cubeCards.add(new CardIdentity("Mishra's Factory", "")); + cubeCards.add(new CardIdentity("Misty Rainforest", "")); + cubeCards.add(new CardIdentity("Molten Rain", "")); + cubeCards.add(new CardIdentity("Moment's Peace", "")); + cubeCards.add(new CardIdentity("Monastery Mentor", "")); + cubeCards.add(new CardIdentity("Monastery Swiftspear", "")); + cubeCards.add(new CardIdentity("Mother of Runes", "")); + cubeCards.add(new CardIdentity("Mox Diamond", "")); + cubeCards.add(new CardIdentity("Mox Opal", "")); + cubeCards.add(new CardIdentity("Mulldrifter", "")); + cubeCards.add(new CardIdentity("Murderous Cut", "")); + cubeCards.add(new CardIdentity("Mutavault", "")); + cubeCards.add(new CardIdentity("Myr Battlesphere", "")); + cubeCards.add(new CardIdentity("Myrsmith", "")); + cubeCards.add(new CardIdentity("Mystical Tutor", "")); + cubeCards.add(new CardIdentity("Necropotence", "")); + cubeCards.add(new CardIdentity("Nether Void", "")); + cubeCards.add(new CardIdentity("Noble Hierarch", "")); + cubeCards.add(new CardIdentity("Oath of Druids", "")); + cubeCards.add(new CardIdentity("Oblivion Ring", "")); + cubeCards.add(new CardIdentity("Ohran Viper", "")); + cubeCards.add(new CardIdentity("Oona's Prowler", "")); + cubeCards.add(new CardIdentity("Ophiomancer", "")); + cubeCards.add(new CardIdentity("Opposition", "")); + cubeCards.add(new CardIdentity("Oracle of Mul Daya", "")); + cubeCards.add(new CardIdentity("Orzhov Signet", "")); + cubeCards.add(new CardIdentity("Outpost Siege", "")); + cubeCards.add(new CardIdentity("Overgrown Tomb", "")); + cubeCards.add(new CardIdentity("Pack Rat", "")); + cubeCards.add(new CardIdentity("Painful Truths", "")); + cubeCards.add(new CardIdentity("Path to Exile", "")); + cubeCards.add(new CardIdentity("Pernicious Deed", "")); + cubeCards.add(new CardIdentity("Phantasmal Image", "")); + cubeCards.add(new CardIdentity("Phyrexian Arena", "")); + cubeCards.add(new CardIdentity("Phyrexian Metamorph", "")); + cubeCards.add(new CardIdentity("Phyrexian Revoker", "")); + cubeCards.add(new CardIdentity("Phyrexian Tower", "")); + cubeCards.add(new CardIdentity("Pia and Kiran Nalaar", "")); + cubeCards.add(new CardIdentity("Plateau", "")); + cubeCards.add(new CardIdentity("Plow Under", "")); + cubeCards.add(new CardIdentity("Polluted Delta", "")); + cubeCards.add(new CardIdentity("Ponder", "")); + cubeCards.add(new CardIdentity("Porcelain Legionnaire", "")); + cubeCards.add(new CardIdentity("Power Play", "")); + cubeCards.add(new CardIdentity("Precinct Captain", "")); + cubeCards.add(new CardIdentity("Precursor Golem", "")); + cubeCards.add(new CardIdentity("Preordain", "")); + cubeCards.add(new CardIdentity("Primeval Titan", "")); + cubeCards.add(new CardIdentity("Prismatic Lens", "")); + cubeCards.add(new CardIdentity("Prophetic Bolt", "")); + cubeCards.add(new CardIdentity("Putrid Imp", "")); + cubeCards.add(new CardIdentity("Qasali Pridemage", "")); + cubeCards.add(new CardIdentity("Rakdos Cackler", "")); + cubeCards.add(new CardIdentity("Rancor", "")); + cubeCards.add(new CardIdentity("Ranger of Eos", "")); + cubeCards.add(new CardIdentity("Ratchet Bomb", "")); + cubeCards.add(new CardIdentity("Ravenous Baboons", "")); + cubeCards.add(new CardIdentity("Razorverge Thicket", "")); + cubeCards.add(new CardIdentity("Reanimate", "")); + cubeCards.add(new CardIdentity("Reckless Charge", "")); + cubeCards.add(new CardIdentity("Reckless Waif", "")); + cubeCards.add(new CardIdentity("Reclamation Sage", "")); + cubeCards.add(new CardIdentity("Recurring Nightmare", "")); + cubeCards.add(new CardIdentity("Regrowth", "")); + cubeCards.add(new CardIdentity("Relic Seeker", "")); + cubeCards.add(new CardIdentity("Remand", "")); + cubeCards.add(new CardIdentity("Restoration Angel", "")); + cubeCards.add(new CardIdentity("Reveillark", "")); + cubeCards.add(new CardIdentity("Rishadan Port", "")); + cubeCards.add(new CardIdentity("Rofellos, Llanowar Emissary", "")); + cubeCards.add(new CardIdentity("Rude Awakening", "")); + cubeCards.add(new CardIdentity("Sacred Foundry", "")); + cubeCards.add(new CardIdentity("Sakura-Tribe Elder", "")); + cubeCards.add(new CardIdentity("Sarkhan, the Dragonspeaker", "")); + cubeCards.add(new CardIdentity("Savannah", "")); + cubeCards.add(new CardIdentity("Scalding Tarn", "")); + cubeCards.add(new CardIdentity("Scavenging Ooze", "")); + cubeCards.add(new CardIdentity("Scroll Rack", "")); + cubeCards.add(new CardIdentity("Scrubland", "")); + cubeCards.add(new CardIdentity("Scythe Leopard", "")); + cubeCards.add(new CardIdentity("Seachrome Coast", "")); + cubeCards.add(new CardIdentity("Searing Blaze", "")); + cubeCards.add(new CardIdentity("Seat of the Synod", "")); + cubeCards.add(new CardIdentity("Seeker of the Way", "")); + cubeCards.add(new CardIdentity("Seething Song", "")); + cubeCards.add(new CardIdentity("Sensei's Divining Top", "")); + cubeCards.add(new CardIdentity("Shadowmage Infiltrator", "")); + cubeCards.add(new CardIdentity("Shambling Vent", "")); + cubeCards.add(new CardIdentity("Shardless Agent", "")); + cubeCards.add(new CardIdentity("Shelldock Isle", "")); + cubeCards.add(new CardIdentity("Show and Tell", "")); + cubeCards.add(new CardIdentity("Shrapnel Blast", "")); + cubeCards.add(new CardIdentity("Siege Rhino", "")); + cubeCards.add(new CardIdentity("Signal Pest", "")); + cubeCards.add(new CardIdentity("Simic Growth Chamber", "")); + cubeCards.add(new CardIdentity("Simic Signet", "")); + cubeCards.add(new CardIdentity("Simic Sky Swallower", "")); + cubeCards.add(new CardIdentity("Sinkhole", "")); + cubeCards.add(new CardIdentity("Skullclamp", "")); + cubeCards.add(new CardIdentity("Skyshroud Elite", "")); + cubeCards.add(new CardIdentity("Smallpox", "")); + cubeCards.add(new CardIdentity("Smokestack", "")); + cubeCards.add(new CardIdentity("Snapcaster Mage", "")); + cubeCards.add(new CardIdentity("Sneak Attack", "")); + cubeCards.add(new CardIdentity("Soldier of the Pantheon", "")); + cubeCards.add(new CardIdentity("Solemn Simulacrum", "")); + cubeCards.add(new CardIdentity("Sorin, Lord of Innistrad", "")); + cubeCards.add(new CardIdentity("Spear of Heliod", "")); + cubeCards.add(new CardIdentity("Spectral Procession", "")); + cubeCards.add(new CardIdentity("Spellskite", "")); + cubeCards.add(new CardIdentity("Sphere of Resistance", "")); + cubeCards.add(new CardIdentity("Sphinx's Revelation", "")); + cubeCards.add(new CardIdentity("Squee, Goblin Nabob", "")); + cubeCards.add(new CardIdentity("Standstill", "")); + cubeCards.add(new CardIdentity("Steam Vents", "")); + cubeCards.add(new CardIdentity("Steel Overseer", "")); + cubeCards.add(new CardIdentity("Steppe Lynx", "")); + cubeCards.add(new CardIdentity("Stoke the Flames", "")); + cubeCards.add(new CardIdentity("Stomping Ground", "")); + cubeCards.add(new CardIdentity("Stoneforge Mystic", "")); + cubeCards.add(new CardIdentity("Strangleroot Geist", "")); + cubeCards.add(new CardIdentity("Stratus Dancer", "")); + cubeCards.add(new CardIdentity("Strip Mine", "")); + cubeCards.add(new CardIdentity("Stromkirk Noble", "")); + cubeCards.add(new CardIdentity("Student of Warfare", "")); + cubeCards.add(new CardIdentity("Sudden Demise", "")); + cubeCards.add(new CardIdentity("Sudden Shock", "")); + cubeCards.add(new CardIdentity("Sulfur Falls", "")); + cubeCards.add(new CardIdentity("Sulfuric Vortex", "")); + cubeCards.add(new CardIdentity("Sun Titan", "")); + cubeCards.add(new CardIdentity("Sundering Titan", "")); + cubeCards.add(new CardIdentity("Survival of the Fittest", "")); + cubeCards.add(new CardIdentity("Sword of Feast and Famine", "")); + cubeCards.add(new CardIdentity("Sword of Fire and Ice", "")); + cubeCards.add(new CardIdentity("Swords to Plowshares", "")); + cubeCards.add(new CardIdentity("Sylvan Library", "")); + cubeCards.add(new CardIdentity("Taiga", "")); + cubeCards.add(new CardIdentity("Tangle Wire", "")); + cubeCards.add(new CardIdentity("Tarmogoyf", "")); + cubeCards.add(new CardIdentity("Tasigur, the Golden Fang", "")); + cubeCards.add(new CardIdentity("Teetering Peaks", "")); + cubeCards.add(new CardIdentity("Temple Garden", "")); + cubeCards.add(new CardIdentity("Temple of Epiphany", "")); + cubeCards.add(new CardIdentity("Temple of Malice", "")); + cubeCards.add(new CardIdentity("Tendrils of Agony", "")); + cubeCards.add(new CardIdentity("Terastodon", "")); + cubeCards.add(new CardIdentity("Terminate", "")); + cubeCards.add(new CardIdentity("Tezzeret, Agent of Bolas", "")); + cubeCards.add(new CardIdentity("Thalia, Guardian of Thraben", "")); + cubeCards.add(new CardIdentity("The Abyss", "")); + cubeCards.add(new CardIdentity("The Tabernacle at Pendrell Vale", "")); + cubeCards.add(new CardIdentity("Thirst for Knowledge", "")); + cubeCards.add(new CardIdentity("Thopter Engineer", "")); + cubeCards.add(new CardIdentity("Thopter Spy Network", "")); + cubeCards.add(new CardIdentity("Thoughtseize", "")); + cubeCards.add(new CardIdentity("Thragtusk", "")); + cubeCards.add(new CardIdentity("Thran Dynamo", "")); + cubeCards.add(new CardIdentity("Tidehollow Sculler", "")); + cubeCards.add(new CardIdentity("Time Spiral", "")); + cubeCards.add(new CardIdentity("Timetwister", "")); + cubeCards.add(new CardIdentity("Tin Street Hooligan", "")); + cubeCards.add(new CardIdentity("Tinker", "")); + cubeCards.add(new CardIdentity("Tolarian Academy", "")); + cubeCards.add(new CardIdentity("Tooth and Nail", "")); + cubeCards.add(new CardIdentity("Tormented Hero", "")); + cubeCards.add(new CardIdentity("Tranquil Thicket", "")); + cubeCards.add(new CardIdentity("Treachery", "")); + cubeCards.add(new CardIdentity("Treasure Cruise", "")); + cubeCards.add(new CardIdentity("Tree of Tales", "")); + cubeCards.add(new CardIdentity("Treetop Village", "")); + cubeCards.add(new CardIdentity("Trinket Mage", "")); + cubeCards.add(new CardIdentity("Tropical Island", "")); + cubeCards.add(new CardIdentity("Trygon Predator", "")); + cubeCards.add(new CardIdentity("Tundra", "")); + cubeCards.add(new CardIdentity("Turnabout", "")); + cubeCards.add(new CardIdentity("Ugin, the Spirit Dragon", "")); + cubeCards.add(new CardIdentity("Umezawa's Jitte", "")); + cubeCards.add(new CardIdentity("Underground Sea", "")); + cubeCards.add(new CardIdentity("Unexpectedly Absent", "")); + cubeCards.add(new CardIdentity("Upheaval", "")); + cubeCards.add(new CardIdentity("Urborg, Tomb of Yawgmoth", "")); + cubeCards.add(new CardIdentity("Vampire Lacerator", "")); + cubeCards.add(new CardIdentity("Vampiric Tutor", "")); + cubeCards.add(new CardIdentity("Vault of Whispers", "")); + cubeCards.add(new CardIdentity("Vault Skirge", "")); + cubeCards.add(new CardIdentity("Vedalken Shackles", "")); + cubeCards.add(new CardIdentity("Vendilion Clique", "")); + cubeCards.add(new CardIdentity("Vengevine", "")); + cubeCards.add(new CardIdentity("Venser, Shaper Savant", "")); + cubeCards.add(new CardIdentity("Verdant Catacombs", "")); + cubeCards.add(new CardIdentity("Vindicate", "")); + cubeCards.add(new CardIdentity("Volcanic Island", "")); + cubeCards.add(new CardIdentity("Volrath's Stronghold", "")); + cubeCards.add(new CardIdentity("Voltaic Key", "")); + cubeCards.add(new CardIdentity("Wall of Blossoms", "")); + cubeCards.add(new CardIdentity("Wall of Omens", "")); + cubeCards.add(new CardIdentity("Wall of Roots", "")); + cubeCards.add(new CardIdentity("Wasteland", "")); + cubeCards.add(new CardIdentity("Waterfront Bouncer", "")); + cubeCards.add(new CardIdentity("Watery Grave", "")); + cubeCards.add(new CardIdentity("Wheel of Fortune", "")); + cubeCards.add(new CardIdentity("Whisperwood Elemental", "")); + cubeCards.add(new CardIdentity("Wild Nacatl", "")); + cubeCards.add(new CardIdentity("Wildfire", "")); + cubeCards.add(new CardIdentity("Windbrisk Heights", "")); + cubeCards.add(new CardIdentity("Windswept Heath", "")); + cubeCards.add(new CardIdentity("Winter Orb", "")); + cubeCards.add(new CardIdentity("Wooded Foothills", "")); + cubeCards.add(new CardIdentity("Woodland Cemetery", "")); + cubeCards.add(new CardIdentity("Worm Harvest", "")); + cubeCards.add(new CardIdentity("Wrath of God", "")); + cubeCards.add(new CardIdentity("Wurmcoil Engine", "")); + cubeCards.add(new CardIdentity("Xathrid Necromancer", "")); + cubeCards.add(new CardIdentity("Yawgmoth's Will", "")); + cubeCards.add(new CardIdentity("Young Pyromancer", "")); + cubeCards.add(new CardIdentity("Zurgo Bellstriker", "")); + } +} diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/LegendaryCube.java b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/LegendaryCube.java new file mode 100644 index 00000000000..9e5c8a3573f --- /dev/null +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/LegendaryCube.java @@ -0,0 +1,641 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.tournament.cubes; + +import mage.game.draft.DraftCube; + +/** + * + * @author fireshoes + */ + +public class LegendaryCube extends DraftCube { + +public LegendaryCube() { + super("Legendary Cube (598 cards)"); // http://magic.wizards.com/en/MTGO/articles/archive/legendary-cube-cardlist-2015-11-09 + + cubeCards.add(new CardIdentity("Aboshan, Cephalid Emperor", "")); + cubeCards.add(new CardIdentity("Absorb Vis", "")); + cubeCards.add(new CardIdentity("Akroma's Memorial", "")); + cubeCards.add(new CardIdentity("Akroma's Vengeance", "")); + cubeCards.add(new CardIdentity("Akroma, Angel of Wrath", "")); + cubeCards.add(new CardIdentity("Akuta, Born of Ash", "")); + cubeCards.add(new CardIdentity("Alesha, Who Smiles at Death", "")); + cubeCards.add(new CardIdentity("Alhammarret's Archive", "")); + cubeCards.add(new CardIdentity("All Suns' Dawn", "")); + cubeCards.add(new CardIdentity("Anafenza, Kin-Tree Spirit", "")); + cubeCards.add(new CardIdentity("Anger of the Gods", "")); + cubeCards.add(new CardIdentity("Anticipate", "")); + cubeCards.add(new CardIdentity("Arashi, the Sky Asunder", "")); + cubeCards.add(new CardIdentity("Arcane Denial", "")); + cubeCards.add(new CardIdentity("Arcane Sanctum", "")); + cubeCards.add(new CardIdentity("Arcanis the Omnipotent", "")); + cubeCards.add(new CardIdentity("Arid Mesa", "")); + cubeCards.add(new CardIdentity("Armillary Sphere", "")); + cubeCards.add(new CardIdentity("Ascendant Evincar", "")); + cubeCards.add(new CardIdentity("Ashling the Pilgrim", "")); + cubeCards.add(new CardIdentity("Ashling, the Extinguisher", "")); + cubeCards.add(new CardIdentity("Atarka, World Render", "")); + cubeCards.add(new CardIdentity("Austere Command", "")); + cubeCards.add(new CardIdentity("Avacyn, Angel of Hope", "")); + cubeCards.add(new CardIdentity("Ayumi, the Last Visitor", "")); + cubeCards.add(new CardIdentity("Azami, Lady of Scrolls", "")); + cubeCards.add(new CardIdentity("Azorius Chancery", "")); + cubeCards.add(new CardIdentity("Azorius Signet", "")); + cubeCards.add(new CardIdentity("Azusa, Lost but Seeking", "")); + cubeCards.add(new CardIdentity("Bad River", "")); + cubeCards.add(new CardIdentity("Badlands", "")); + cubeCards.add(new CardIdentity("Banishing Light", "")); + cubeCards.add(new CardIdentity("Basalt Monolith", "")); + cubeCards.add(new CardIdentity("Basilisk Collar", "")); + cubeCards.add(new CardIdentity("Bayou", "")); + cubeCards.add(new CardIdentity("Beacon of Destruction", "")); + cubeCards.add(new CardIdentity("Beacon of Tomorrows", "")); + cubeCards.add(new CardIdentity("Beast Within", "")); + cubeCards.add(new CardIdentity("Berserkers' Onslaught", "")); + cubeCards.add(new CardIdentity("Black Market", "")); + cubeCards.add(new CardIdentity("Black Sun's Zenith", "")); + cubeCards.add(new CardIdentity("Blasphemous Act", "")); + cubeCards.add(new CardIdentity("Blood Crypt", "")); + cubeCards.add(new CardIdentity("Bloodstained Mire", "")); + cubeCards.add(new CardIdentity("Bonfire of the Damned", "")); + cubeCards.add(new CardIdentity("Boros Garrison", "")); + cubeCards.add(new CardIdentity("Boros Signet", "")); + cubeCards.add(new CardIdentity("Brago, King Eternal", "")); + cubeCards.add(new CardIdentity("Brainbite", "")); + cubeCards.add(new CardIdentity("Brainstorm", "")); + cubeCards.add(new CardIdentity("Breeding Pool", "")); + cubeCards.add(new CardIdentity("Brimaz, King of Oreskos", "")); + cubeCards.add(new CardIdentity("Brion Stoutarm", "")); + cubeCards.add(new CardIdentity("Brothers Yamazaki", "")); + cubeCards.add(new CardIdentity("Brothers Yamazaki", "")); + cubeCards.add(new CardIdentity("Caged Sun", "")); + cubeCards.add(new CardIdentity("Calciform Pools", "")); + cubeCards.add(new CardIdentity("Canopy Vista", "")); + cubeCards.add(new CardIdentity("Captain Sisay", "")); + cubeCards.add(new CardIdentity("Careful Consideration", "")); + cubeCards.add(new CardIdentity("Cascade Bluffs", "")); + cubeCards.add(new CardIdentity("Catch // Release", "")); + cubeCards.add(new CardIdentity("Cauldron of Souls", "")); + cubeCards.add(new CardIdentity("Chain Reaction", "")); + cubeCards.add(new CardIdentity("Chainer's Edict", "")); + cubeCards.add(new CardIdentity("Champion's Helm", "")); + cubeCards.add(new CardIdentity("Chandra, Fire of Kaladesh", "")); + cubeCards.add(new CardIdentity("Charcoal Diamond", "")); + cubeCards.add(new CardIdentity("Cho-Manno, Revolutionary", "")); + cubeCards.add(new CardIdentity("Chromatic Lantern", "")); + cubeCards.add(new CardIdentity("Chromatic Sphere", "")); + cubeCards.add(new CardIdentity("Chromatic Star", "")); + cubeCards.add(new CardIdentity("Cinder Glade", "")); + cubeCards.add(new CardIdentity("Clifftop Retreat", "")); + cubeCards.add(new CardIdentity("Coalition Relic", "")); + cubeCards.add(new CardIdentity("Coalition Victory", "")); + cubeCards.add(new CardIdentity("Coldsteel Heart", "")); + cubeCards.add(new CardIdentity("Commander Eesha", "")); + cubeCards.add(new CardIdentity("Compulsive Research", "")); + cubeCards.add(new CardIdentity("Condemn", "")); + cubeCards.add(new CardIdentity("Conflux", "")); + cubeCards.add(new CardIdentity("Contagion Clasp", "")); + cubeCards.add(new CardIdentity("Council's Judgment", "")); + cubeCards.add(new CardIdentity("Crackling Doom", "")); + cubeCards.add(new CardIdentity("Crib Swap", "")); + cubeCards.add(new CardIdentity("Cromat", "")); + cubeCards.add(new CardIdentity("Crovax, Ascendant Hero", "")); + cubeCards.add(new CardIdentity("Cruel Ultimatum", "")); + cubeCards.add(new CardIdentity("Crumbling Necropolis", "")); + cubeCards.add(new CardIdentity("Crux of Fate", "")); + cubeCards.add(new CardIdentity("Crystal Ball", "")); + cubeCards.add(new CardIdentity("Cultivate", "")); + cubeCards.add(new CardIdentity("Cyclonic Rift", "")); + cubeCards.add(new CardIdentity("Daretti, Scrap Savant", "")); + cubeCards.add(new CardIdentity("Dark Depths", "")); + cubeCards.add(new CardIdentity("Daxos of Meletis", "")); + cubeCards.add(new CardIdentity("Day of Destiny", "")); + cubeCards.add(new CardIdentity("Death Denied", "")); + cubeCards.add(new CardIdentity("Detention Sphere", "")); + cubeCards.add(new CardIdentity("Devour Flesh", "")); + cubeCards.add(new CardIdentity("Devour in Shadow", "")); + cubeCards.add(new CardIdentity("Diabolic Tutor", "")); + cubeCards.add(new CardIdentity("Diaochan, Artful Beauty", "")); + cubeCards.add(new CardIdentity("Dimir Aqueduct", "")); + cubeCards.add(new CardIdentity("Dimir Signet", "")); + cubeCards.add(new CardIdentity("Disenchant", "")); + cubeCards.add(new CardIdentity("Dismantling Blow", "")); + cubeCards.add(new CardIdentity("Divine Reckoning", "")); + cubeCards.add(new CardIdentity("Door to Nothingness", "")); + cubeCards.add(new CardIdentity("Doran, the Siege Tower", "")); + cubeCards.add(new CardIdentity("Doubling Season", "")); + cubeCards.add(new CardIdentity("Dragon Breath", "")); + cubeCards.add(new CardIdentity("Dragonlord Atarka", "")); + cubeCards.add(new CardIdentity("Dragonlord Dromoka", "")); + cubeCards.add(new CardIdentity("Dragonlord Ojutai", "")); + cubeCards.add(new CardIdentity("Dragonlord Silumgar", "")); + cubeCards.add(new CardIdentity("Dragonskull Summit", "")); + cubeCards.add(new CardIdentity("Drana, Kalastria Bloodchief", "")); + cubeCards.add(new CardIdentity("Drana, Liberator of Malakir", "")); + cubeCards.add(new CardIdentity("Dreadship Reef", "")); + cubeCards.add(new CardIdentity("Dromoka's Command", "")); + cubeCards.add(new CardIdentity("Drowned Catacomb", "")); + cubeCards.add(new CardIdentity("Duress", "")); + cubeCards.add(new CardIdentity("Dwynen, Gilt-Leaf Daen", "")); + cubeCards.add(new CardIdentity("Edric, Spymaster of Trest", "")); + cubeCards.add(new CardIdentity("Eiganjo Castle", "")); + cubeCards.add(new CardIdentity("Eight-and-a-Half-Tails", "")); + cubeCards.add(new CardIdentity("Eladamri's Call", "")); + cubeCards.add(new CardIdentity("Eladamri, Lord of Leaves", "")); + cubeCards.add(new CardIdentity("Elbrus, the Binding Blade", "")); + cubeCards.add(new CardIdentity("Elesh Norn, Grand Cenobite", "")); + cubeCards.add(new CardIdentity("Emrakul, the Aeons Torn", "")); + cubeCards.add(new CardIdentity("Endrek Sahr, Master Breeder", "")); + cubeCards.add(new CardIdentity("Engineered Explosives", "")); + cubeCards.add(new CardIdentity("Enlightened Tutor", "")); + cubeCards.add(new CardIdentity("Esper Charm", "")); + cubeCards.add(new CardIdentity("Everflowing Chalice", "")); + cubeCards.add(new CardIdentity("Evolving Wilds", "")); + cubeCards.add(new CardIdentity("Exava, Rakdos Blood Witch", "")); + cubeCards.add(new CardIdentity("Experiment Kraj", "")); + cubeCards.add(new CardIdentity("Explore", "")); + cubeCards.add(new CardIdentity("Explosive Vegetation", "")); + cubeCards.add(new CardIdentity("Expunge", "")); + cubeCards.add(new CardIdentity("Ezuri, Claw of Progress", "")); + cubeCards.add(new CardIdentity("Fact or Fiction", "")); + cubeCards.add(new CardIdentity("Faith's Fetters", "")); + cubeCards.add(new CardIdentity("Faithless Looting", "")); + cubeCards.add(new CardIdentity("Far // Away", "")); + cubeCards.add(new CardIdentity("Farseek", "")); + cubeCards.add(new CardIdentity("Fellwar Stone", "")); + cubeCards.add(new CardIdentity("Fetid Heath", "")); + cubeCards.add(new CardIdentity("Fiery Confluence", "")); + cubeCards.add(new CardIdentity("Fiery Fall", "")); + cubeCards.add(new CardIdentity("Finest Hour", "")); + cubeCards.add(new CardIdentity("Fire Diamond", "")); + cubeCards.add(new CardIdentity("Fire-Lit Thicket", "")); + cubeCards.add(new CardIdentity("Firebolt", "")); + cubeCards.add(new CardIdentity("Fires of Yavimaya", "")); + cubeCards.add(new CardIdentity("Flood Plain", "")); + cubeCards.add(new CardIdentity("Flooded Grove", "")); + cubeCards.add(new CardIdentity("Flooded Strand", "")); + cubeCards.add(new CardIdentity("Forbidden Alchemy", "")); + cubeCards.add(new CardIdentity("Foresee", "")); + cubeCards.add(new CardIdentity("Frontier Bivouac", "")); + cubeCards.add(new CardIdentity("Fungal Reaches", "")); + cubeCards.add(new CardIdentity("Genesis Wave", "")); + cubeCards.add(new CardIdentity("Genju of the Realm", "")); + cubeCards.add(new CardIdentity("Ghave, Guru of Spores", "")); + cubeCards.add(new CardIdentity("Ghoulcaller Gisa", "")); + cubeCards.add(new CardIdentity("Gift of the Gargantuan", "")); + cubeCards.add(new CardIdentity("Gilded Light", "")); + cubeCards.add(new CardIdentity("Gilded Lotus", "")); + cubeCards.add(new CardIdentity("Gisela, Blade of Goldnight", "")); + cubeCards.add(new CardIdentity("Glacial Fortress", "")); + cubeCards.add(new CardIdentity("Gleam of Resistance", "")); + cubeCards.add(new CardIdentity("Glissa Sunseeker", "")); + cubeCards.add(new CardIdentity("Glissa, the Traitor", "")); + cubeCards.add(new CardIdentity("Godless Shrine", "")); + cubeCards.add(new CardIdentity("Godo, Bandit Warlord", "")); + cubeCards.add(new CardIdentity("Gods Willing", "")); + cubeCards.add(new CardIdentity("Golgari Rot Farm", "")); + cubeCards.add(new CardIdentity("Golgari Signet", "")); + cubeCards.add(new CardIdentity("Grasslands", "")); + cubeCards.add(new CardIdentity("Graven Cairns", "")); + cubeCards.add(new CardIdentity("Grenzo, Dungeon Warden", "")); + cubeCards.add(new CardIdentity("Griselbrand", "")); + cubeCards.add(new CardIdentity("Gruul Signet", "")); + cubeCards.add(new CardIdentity("Gruul Turf", "")); + cubeCards.add(new CardIdentity("Hallowed Fountain", "")); + cubeCards.add(new CardIdentity("Hanna, Ship's Navigator", "")); + cubeCards.add(new CardIdentity("Harmonize", "")); + cubeCards.add(new CardIdentity("Heartless Hidetsugu", "")); + cubeCards.add(new CardIdentity("Hedron Archive", "")); + cubeCards.add(new CardIdentity("Helvault", "")); + cubeCards.add(new CardIdentity("Hero's Blade", "")); + cubeCards.add(new CardIdentity("Hero's Demise", "")); + cubeCards.add(new CardIdentity("Hero's Downfall", "")); + cubeCards.add(new CardIdentity("Heroes' Podium", "")); + cubeCards.add(new CardIdentity("Hide // Seek", "")); + cubeCards.add(new CardIdentity("Hidetsugu's Second Rite", "")); + cubeCards.add(new CardIdentity("Hinterland Harbor", "")); + cubeCards.add(new CardIdentity("Homicidal Seclusion", "")); + cubeCards.add(new CardIdentity("Honden of Cleansing Fire", "")); + cubeCards.add(new CardIdentity("Honden of Infinite Rage", "")); + cubeCards.add(new CardIdentity("Honden of Life's Web", "")); + cubeCards.add(new CardIdentity("Honden of Night's Reach", "")); + cubeCards.add(new CardIdentity("Honden of Seeing Winds", "")); + cubeCards.add(new CardIdentity("Honor-Worn Shaku", "")); + cubeCards.add(new CardIdentity("Horobi, Death's Wail", "")); + cubeCards.add(new CardIdentity("Hua Tuo, Honored Physician", "")); + cubeCards.add(new CardIdentity("Hull Breach", "")); + cubeCards.add(new CardIdentity("Hythonia the Cruel", "")); + cubeCards.add(new CardIdentity("Ichor Wellspring", "")); + cubeCards.add(new CardIdentity("Impulse", "")); + cubeCards.add(new CardIdentity("Into the Roil", "")); + cubeCards.add(new CardIdentity("Isamaru, Hound of Konda", "")); + cubeCards.add(new CardIdentity("Isao, Enlightened Bushi", "")); + cubeCards.add(new CardIdentity("Isolated Chapel", "")); + cubeCards.add(new CardIdentity("Ith, High Arcanist", "")); + cubeCards.add(new CardIdentity("Izzet Boilerworks", "")); + cubeCards.add(new CardIdentity("Izzet Signet", "")); + cubeCards.add(new CardIdentity("Jace, Vryn's Prodigy", "")); + cubeCards.add(new CardIdentity("Jareth, Leonine Titan", "")); + cubeCards.add(new CardIdentity("Jaya Ballard, Task Mage", "")); + cubeCards.add(new CardIdentity("Jazal Goldmane", "")); + cubeCards.add(new CardIdentity("Jenara, Asura of War", "")); + cubeCards.add(new CardIdentity("Jeska, Warrior Adept", "")); + cubeCards.add(new CardIdentity("Jeskai Ascendancy", "")); + cubeCards.add(new CardIdentity("Jin-Gitaxias, Core Augur", "")); + cubeCards.add(new CardIdentity("Jiwari, the Earth Aflame", "")); + cubeCards.add(new CardIdentity("Jor Kadeen, the Prevailer", "")); + cubeCards.add(new CardIdentity("Jungle Shrine", "")); + cubeCards.add(new CardIdentity("Kaervek the Merciless", "")); + cubeCards.add(new CardIdentity("Kagemaro, First to Suffer", "")); + cubeCards.add(new CardIdentity("Kaho, Minamo Historian", "")); + cubeCards.add(new CardIdentity("Kalemne, Disciple of Iroas", "")); + cubeCards.add(new CardIdentity("Kalitas, Bloodchief of Ghet", "")); + cubeCards.add(new CardIdentity("Kamahl, Fist of Krosa", "")); + cubeCards.add(new CardIdentity("Kamahl, Pit Fighter", "")); + cubeCards.add(new CardIdentity("Karador, Ghost Chieftain", "")); + cubeCards.add(new CardIdentity("Karlov of the Ghost Council", "")); + cubeCards.add(new CardIdentity("Karn, Silver Golem", "")); + cubeCards.add(new CardIdentity("Kataki, War's Wage", "")); + cubeCards.add(new CardIdentity("Kazuul, Tyrant of the Cliffs", "")); + cubeCards.add(new CardIdentity("Keiga, the Tide Star", "")); + cubeCards.add(new CardIdentity("Kemba, Kha Regent", "")); + cubeCards.add(new CardIdentity("Keranos, God of Storms", "")); + cubeCards.add(new CardIdentity("Kira, Great Glass-Spinner", "")); + cubeCards.add(new CardIdentity("Kodama of the North Tree", "")); + cubeCards.add(new CardIdentity("Kodama's Reach", "")); + cubeCards.add(new CardIdentity("Kokusho, the Evening Star", "")); + cubeCards.add(new CardIdentity("Kolaghan's Command", "")); + cubeCards.add(new CardIdentity("Kolaghan, the Storm's Fury", "")); + cubeCards.add(new CardIdentity("Konda's Banner", "")); + cubeCards.add(new CardIdentity("Kongming, 'Sleeping Dragon'", "")); + cubeCards.add(new CardIdentity("Kozilek, Butcher of Truth", "")); + cubeCards.add(new CardIdentity("Krenko, Mob Boss", "")); + cubeCards.add(new CardIdentity("Kresh the Bloodbraided", "")); + cubeCards.add(new CardIdentity("Krosan Grip", "")); + cubeCards.add(new CardIdentity("Krosan Verge", "")); + cubeCards.add(new CardIdentity("Kumano, Master Yamabushi", "")); + cubeCards.add(new CardIdentity("Kurkesh, Onakke Ancient", "")); + cubeCards.add(new CardIdentity("Kytheon, Hero of Akros", "")); + cubeCards.add(new CardIdentity("Last Stand", "")); + cubeCards.add(new CardIdentity("Lavalanche", "")); + cubeCards.add(new CardIdentity("Legacy Weapon", "")); + cubeCards.add(new CardIdentity("Life's Legacy", "")); + cubeCards.add(new CardIdentity("Lightning Bolt", "")); + cubeCards.add(new CardIdentity("Lightning Greaves", "")); + cubeCards.add(new CardIdentity("Liliana, Heretical Healer", "")); + cubeCards.add(new CardIdentity("Linvala, Keeper of Silence", "")); + cubeCards.add(new CardIdentity("Llawan, Cephalid Empress", "")); + cubeCards.add(new CardIdentity("Lorthos, the Tidemaker", "")); + cubeCards.add(new CardIdentity("Lu Xun, Scholar General", "")); + cubeCards.add(new CardIdentity("Lyzolda, the Blood Witch", "")); + cubeCards.add(new CardIdentity("Maelstrom Nexus", "")); + cubeCards.add(new CardIdentity("Maelstrom Wanderer", "")); + cubeCards.add(new CardIdentity("Maga, Traitor to Mortals", "")); + cubeCards.add(new CardIdentity("Mage's Guile", "")); + cubeCards.add(new CardIdentity("Mageta the Lion", "")); + cubeCards.add(new CardIdentity("Mana Reflection", "")); + cubeCards.add(new CardIdentity("Marath, Will of the Wild", "")); + cubeCards.add(new CardIdentity("Marble Diamond", "")); + cubeCards.add(new CardIdentity("March of the Machines", "")); + cubeCards.add(new CardIdentity("Marchesa, the Black Rose", "")); + cubeCards.add(new CardIdentity("Marsh Flats", "")); + cubeCards.add(new CardIdentity("Mayael's Aria", "")); + cubeCards.add(new CardIdentity("Melek, Izzet Paragon", "")); + cubeCards.add(new CardIdentity("Memnarch", "")); + cubeCards.add(new CardIdentity("Meng Huo, Barbarian King", "")); + cubeCards.add(new CardIdentity("Meren of Clan Nel Toth", "")); + cubeCards.add(new CardIdentity("Mikaeus, the Lunarch", "")); + cubeCards.add(new CardIdentity("Mikaeus, the Unhallowed", "")); + cubeCards.add(new CardIdentity("Mikokoro, Center of the Sea", "")); + cubeCards.add(new CardIdentity("Minamo, School at Water's Edge", "")); + cubeCards.add(new CardIdentity("Mind Stone", "")); + cubeCards.add(new CardIdentity("Mind's Eye", "")); + cubeCards.add(new CardIdentity("Mindslaver", "")); + cubeCards.add(new CardIdentity("Mirari", "")); + cubeCards.add(new CardIdentity("Mirari's Wake", "")); + cubeCards.add(new CardIdentity("Miren, the Moaning Well", "")); + cubeCards.add(new CardIdentity("Mirri the Cursed", "")); + cubeCards.add(new CardIdentity("Mirri, Cat Warrior", "")); + cubeCards.add(new CardIdentity("Misdirection", "")); + cubeCards.add(new CardIdentity("Misty Rainforest", "")); + cubeCards.add(new CardIdentity("Mizzium Mortars", "")); + cubeCards.add(new CardIdentity("Mizzix of the Izmagnus", "")); + cubeCards.add(new CardIdentity("Mizzix's Mastery", "")); + cubeCards.add(new CardIdentity("Molten Slagheap", "")); + cubeCards.add(new CardIdentity("Momentous Fall", "")); + cubeCards.add(new CardIdentity("Mortify", "")); + cubeCards.add(new CardIdentity("Moss Diamond", "")); + cubeCards.add(new CardIdentity("Mountain Valley", "")); + cubeCards.add(new CardIdentity("Muddle the Mixture", "")); + cubeCards.add(new CardIdentity("Multani, Maro-Sorcerer", "")); + cubeCards.add(new CardIdentity("Muzzio, Visionary Architect", "")); + cubeCards.add(new CardIdentity("Mycosynth Wellspring", "")); + cubeCards.add(new CardIdentity("Myojin of Cleansing Fire", "")); + cubeCards.add(new CardIdentity("Myojin of Life's Web", "")); + cubeCards.add(new CardIdentity("Myriad Landscape", "")); + cubeCards.add(new CardIdentity("Mystic Confluence", "")); + cubeCards.add(new CardIdentity("Mystic Gate", "")); + cubeCards.add(new CardIdentity("Mystic Monastery", "")); + cubeCards.add(new CardIdentity("Nagao, Bound by Honor", "")); + cubeCards.add(new CardIdentity("Nath of the Gilt-Leaf", "")); + cubeCards.add(new CardIdentity("Naturalize", "")); + cubeCards.add(new CardIdentity("Negate", "")); + cubeCards.add(new CardIdentity("Night's Whisper", "")); + cubeCards.add(new CardIdentity("Nissa's Revelation", "")); + cubeCards.add(new CardIdentity("Nissa, Vastwood Seer", "")); + cubeCards.add(new CardIdentity("Niv-Mizzet, Dracogenius", "")); + cubeCards.add(new CardIdentity("Niv-Mizzet, the Firemind", "")); + cubeCards.add(new CardIdentity("Nomad Outpost", "")); + cubeCards.add(new CardIdentity("Noyan Dar, Roil Shaper", "")); + cubeCards.add(new CardIdentity("Ob Nixilis, the Fallen", "")); + cubeCards.add(new CardIdentity("Obelisk of Alara", "")); + cubeCards.add(new CardIdentity("Oblation", "")); + cubeCards.add(new CardIdentity("Oblivion Ring", "")); + cubeCards.add(new CardIdentity("Oblivion Stone", "")); + cubeCards.add(new CardIdentity("Obzedat, Ghost Council", "")); + cubeCards.add(new CardIdentity("Odric, Master Tactician", "")); + cubeCards.add(new CardIdentity("Okina, Temple to the Grandfathers", "")); + cubeCards.add(new CardIdentity("Omnath, Locus of Mana", "")); + cubeCards.add(new CardIdentity("Omnath, Locus of Rage", "")); + cubeCards.add(new CardIdentity("Opal-Eye, Konda's Yojimbo", "")); + cubeCards.add(new CardIdentity("Opulent Palace", "")); + cubeCards.add(new CardIdentity("Oran-Rief, the Vastwood", "")); + cubeCards.add(new CardIdentity("Orim, Samite Healer", "")); + cubeCards.add(new CardIdentity("Orzhov Basilica", "")); + cubeCards.add(new CardIdentity("Orzhov Signet", "")); + cubeCards.add(new CardIdentity("Outpost Siege", "")); + cubeCards.add(new CardIdentity("Overgrown Tomb", "")); + cubeCards.add(new CardIdentity("Panoptic Mirror", "")); + cubeCards.add(new CardIdentity("Pariah", "")); + cubeCards.add(new CardIdentity("Path to Exile", "")); + cubeCards.add(new CardIdentity("Pernicious Deed", "")); + cubeCards.add(new CardIdentity("Phage the Untouchable", "")); + cubeCards.add(new CardIdentity("Phyrexian Arena", "")); + cubeCards.add(new CardIdentity("Pia and Kiran Nalaar", "")); + cubeCards.add(new CardIdentity("Pianna, Nomad Captain", "")); + cubeCards.add(new CardIdentity("Pithing Needle", "")); + cubeCards.add(new CardIdentity("Plateau", "")); + cubeCards.add(new CardIdentity("Polluted Delta", "")); + cubeCards.add(new CardIdentity("Polukranos, World Eater", "")); + cubeCards.add(new CardIdentity("Praetor's Counsel", "")); + cubeCards.add(new CardIdentity("Prairie Stream", "")); + cubeCards.add(new CardIdentity("Prime Speaker Zegana", "")); + cubeCards.add(new CardIdentity("Primeval Bounty", "")); + cubeCards.add(new CardIdentity("Prismatic Lens", "")); + cubeCards.add(new CardIdentity("Progenitus", "")); + cubeCards.add(new CardIdentity("Prophetic Prism", "")); + cubeCards.add(new CardIdentity("Psychotic Fury", "")); + cubeCards.add(new CardIdentity("Pure // Simple", "")); + cubeCards.add(new CardIdentity("Putrefy", "")); + cubeCards.add(new CardIdentity("Pyromancer's Goggles", "")); + cubeCards.add(new CardIdentity("Radha, Heir to Keld", "")); + cubeCards.add(new CardIdentity("Radiant Purge", "")); + cubeCards.add(new CardIdentity("Radiant's Judgment", "")); + cubeCards.add(new CardIdentity("Rafiq of the Many", "")); + cubeCards.add(new CardIdentity("Rakdos Carnarium", "")); + cubeCards.add(new CardIdentity("Rakdos Signet", "")); + cubeCards.add(new CardIdentity("Rakka Mar", "")); + cubeCards.add(new CardIdentity("Rampant Growth", "")); + cubeCards.add(new CardIdentity("Ray of Command", "")); + cubeCards.add(new CardIdentity("Read the Bones", "")); + cubeCards.add(new CardIdentity("Recoup", "")); + cubeCards.add(new CardIdentity("Reflecting Pool", "")); + cubeCards.add(new CardIdentity("Regrowth", "")); + cubeCards.add(new CardIdentity("Reiterate", "")); + cubeCards.add(new CardIdentity("Reki, the History of Kamigawa", "")); + cubeCards.add(new CardIdentity("Repeal", "")); + cubeCards.add(new CardIdentity("Repulse", "")); + cubeCards.add(new CardIdentity("Rescind", "")); + cubeCards.add(new CardIdentity("Reya Dawnbringer", "")); + cubeCards.add(new CardIdentity("Rhys the Redeemed", "")); + cubeCards.add(new CardIdentity("Righteous Confluence", "")); + cubeCards.add(new CardIdentity("Rings of Brighthearth", "")); + cubeCards.add(new CardIdentity("Rocky Tar Pit", "")); + cubeCards.add(new CardIdentity("Rofellos, Llanowar Emissary", "")); + cubeCards.add(new CardIdentity("Rootbound Crag", "")); + cubeCards.add(new CardIdentity("Rorix Bladewing", "")); + cubeCards.add(new CardIdentity("Rugged Prairie", "")); + cubeCards.add(new CardIdentity("Rupture Spire", "")); + cubeCards.add(new CardIdentity("Ruric Thar, the Unbowed", "")); + cubeCards.add(new CardIdentity("Rush of Knowledge", "")); + cubeCards.add(new CardIdentity("Ryusei, the Falling Star", "")); + cubeCards.add(new CardIdentity("Sachi, Daughter of Seshiro", "")); + cubeCards.add(new CardIdentity("Sacred Foundry", "")); + cubeCards.add(new CardIdentity("Saffi Eriksdotter", "")); + cubeCards.add(new CardIdentity("Sakashima the Impostor", "")); + cubeCards.add(new CardIdentity("Saltcrusted Steppe", "")); + cubeCards.add(new CardIdentity("Sandsteppe Citadel", "")); + cubeCards.add(new CardIdentity("Savage Lands", "")); + cubeCards.add(new CardIdentity("Savannah", "")); + cubeCards.add(new CardIdentity("Scalding Tarn", "")); + cubeCards.add(new CardIdentity("Scion of the Ur-Dragon", "")); + cubeCards.add(new CardIdentity("Scrap", "")); + cubeCards.add(new CardIdentity("Scrubland", "")); + cubeCards.add(new CardIdentity("Sculpting Steel", "")); + cubeCards.add(new CardIdentity("Search for Tomorrow", "")); + cubeCards.add(new CardIdentity("Seaside Citadel", "")); + cubeCards.add(new CardIdentity("Seizan, Perverter of Truth", "")); + cubeCards.add(new CardIdentity("Selesnya Sanctuary", "")); + cubeCards.add(new CardIdentity("Selesnya Signet", "")); + cubeCards.add(new CardIdentity("Sensei Golden-Tail", "")); + cubeCards.add(new CardIdentity("Sharuum the Hegemon", "")); + cubeCards.add(new CardIdentity("Shattergang Brothers", "")); + cubeCards.add(new CardIdentity("Sheoldred, Whispering One", "")); + cubeCards.add(new CardIdentity("Shinka, the Bloodsoaked Keep", "")); + cubeCards.add(new CardIdentity("Shizo, Death's Storehouse", "")); + cubeCards.add(new CardIdentity("Shu Yun, the Silent Tempest", "")); + cubeCards.add(new CardIdentity("Sidar Jabari", "")); + cubeCards.add(new CardIdentity("Sidisi, Brood Tyrant", "")); + cubeCards.add(new CardIdentity("Sidisi, Undead Vizier", "")); + cubeCards.add(new CardIdentity("Sigarda, Host of Herons", "")); + cubeCards.add(new CardIdentity("Sign in Blood", "")); + cubeCards.add(new CardIdentity("Silence the Believers", "")); + cubeCards.add(new CardIdentity("Silumgar's Command", "")); + cubeCards.add(new CardIdentity("Silumgar, the Drifting Death", "")); + cubeCards.add(new CardIdentity("Silvos, Rogue Elemental", "")); + cubeCards.add(new CardIdentity("Simic Growth Chamber", "")); + cubeCards.add(new CardIdentity("Simic Signet", "")); + cubeCards.add(new CardIdentity("Skullbriar, the Walking Grave", "")); + cubeCards.add(new CardIdentity("Sky Diamond", "")); + cubeCards.add(new CardIdentity("Skyship Weatherlight", "")); + cubeCards.add(new CardIdentity("Smoldering Marsh", "")); + cubeCards.add(new CardIdentity("Song of the Dryads", "")); + cubeCards.add(new CardIdentity("Sorin's Vengeance", "")); + cubeCards.add(new CardIdentity("Soul's Fire", "")); + cubeCards.add(new CardIdentity("Sphere of the Suns", "")); + cubeCards.add(new CardIdentity("Sphinx-Bone Wand", "")); + cubeCards.add(new CardIdentity("Spine of Ish Sah", "")); + cubeCards.add(new CardIdentity("Spirit of the Night", "")); + cubeCards.add(new CardIdentity("Spite // Malice", "")); + cubeCards.add(new CardIdentity("Squee, Goblin Nabob", "")); + cubeCards.add(new CardIdentity("Staff of Nin", "")); + cubeCards.add(new CardIdentity("Steam Vents", "")); + cubeCards.add(new CardIdentity("Stitcher Geralf", "")); + cubeCards.add(new CardIdentity("Stomping Ground", "")); + cubeCards.add(new CardIdentity("Stubborn Denial", "")); + cubeCards.add(new CardIdentity("Sulfur Falls", "")); + cubeCards.add(new CardIdentity("Sultai Charm", "")); + cubeCards.add(new CardIdentity("Sun Ce, Young Conquerer", "")); + cubeCards.add(new CardIdentity("Sun Quan, Lord of Wu", "")); + cubeCards.add(new CardIdentity("Sunken Hollow", "")); + cubeCards.add(new CardIdentity("Sunken Ruins", "")); + cubeCards.add(new CardIdentity("Sunpetal Grove", "")); + cubeCards.add(new CardIdentity("Surrak Dragonclaw", "")); + cubeCards.add(new CardIdentity("Surrak, the Hunt Caller", "")); + cubeCards.add(new CardIdentity("Swiftfoot Boots", "")); + cubeCards.add(new CardIdentity("Sword of the Animist", "")); + cubeCards.add(new CardIdentity("Sword of the Chosen", "")); + cubeCards.add(new CardIdentity("Sydri, Galvanic Genius", "")); + cubeCards.add(new CardIdentity("Sygg, River Cutthroat", "")); + cubeCards.add(new CardIdentity("Sygg, River Guide", "")); + cubeCards.add(new CardIdentity("Sylvan Bounty", "")); + cubeCards.add(new CardIdentity("Tahngarth, Talruum Hero", "")); + cubeCards.add(new CardIdentity("Taiga", "")); + cubeCards.add(new CardIdentity("Tainted Pact", "")); + cubeCards.add(new CardIdentity("Tajic, Blade of the Legion", "")); + cubeCards.add(new CardIdentity("Talisman of Dominance", "")); + cubeCards.add(new CardIdentity("Talisman of Impulse", "")); + cubeCards.add(new CardIdentity("Talisman of Indulgence", "")); + cubeCards.add(new CardIdentity("Talisman of Progress", "")); + cubeCards.add(new CardIdentity("Talisman of Unity", "")); + cubeCards.add(new CardIdentity("Talrand, Sky Summoner", "")); + cubeCards.add(new CardIdentity("Tasigur, the Golden Fang", "")); + cubeCards.add(new CardIdentity("Tatsumasa, the Dragon's Fang", "")); + cubeCards.add(new CardIdentity("Teferi, Mage of Zhalfir", "")); + cubeCards.add(new CardIdentity("Temple Garden", "")); + cubeCards.add(new CardIdentity("Temple of Abandon", "")); + cubeCards.add(new CardIdentity("Temple of Deceit", "")); + cubeCards.add(new CardIdentity("Temple of Enlightenment", "")); + cubeCards.add(new CardIdentity("Temple of Epiphany", "")); + cubeCards.add(new CardIdentity("Temple of Malady", "")); + cubeCards.add(new CardIdentity("Temple of Malice", "")); + cubeCards.add(new CardIdentity("Temple of Mystery", "")); + cubeCards.add(new CardIdentity("Temple of Plenty", "")); + cubeCards.add(new CardIdentity("Temple of Silence", "")); + cubeCards.add(new CardIdentity("Temple of the False God", "")); + cubeCards.add(new CardIdentity("Temple of Triumph", "")); + cubeCards.add(new CardIdentity("Temur Ascendancy", "")); + cubeCards.add(new CardIdentity("Temur Battle Rage", "")); + cubeCards.add(new CardIdentity("Tenza, Godo's Maul", "")); + cubeCards.add(new CardIdentity("Terminate", "")); + cubeCards.add(new CardIdentity("Terramorphic Expanse", "")); + cubeCards.add(new CardIdentity("Terrarion", "")); + cubeCards.add(new CardIdentity("Teysa, Envoy of Ghosts", "")); + cubeCards.add(new CardIdentity("Tezzeret the Seeker", "")); + cubeCards.add(new CardIdentity("Thada Adel, Acquisitor", "")); + cubeCards.add(new CardIdentity("That Which Was Taken", "")); + cubeCards.add(new CardIdentity("The Mimeoplasm", "")); + cubeCards.add(new CardIdentity("Thirst for Knowledge", "")); + cubeCards.add(new CardIdentity("Thran Dynamo", "")); + cubeCards.add(new CardIdentity("Thraximundar", "")); + cubeCards.add(new CardIdentity("Thrun, the Last Troll", "")); + cubeCards.add(new CardIdentity("Time of Need", "")); + cubeCards.add(new CardIdentity("Time Stop", "")); + cubeCards.add(new CardIdentity("Time Warp", "")); + cubeCards.add(new CardIdentity("Titania, Protector of Argoth", "")); + cubeCards.add(new CardIdentity("Tithe", "")); + cubeCards.add(new CardIdentity("Tolsimir Wolfblood", "")); + cubeCards.add(new CardIdentity("Tomorrow, Azami's Familiar", "")); + cubeCards.add(new CardIdentity("Tormenting Voice", "")); + cubeCards.add(new CardIdentity("Toshiro Umezawa", "")); + cubeCards.add(new CardIdentity("Toxic Deluge", "")); + cubeCards.add(new CardIdentity("Trading Post", "")); + cubeCards.add(new CardIdentity("Tragic Slip", "")); + cubeCards.add(new CardIdentity("Transguild Promenade", "")); + cubeCards.add(new CardIdentity("Traumatic Visions", "")); + cubeCards.add(new CardIdentity("Tribute to Hunger", "")); + cubeCards.add(new CardIdentity("Tromokratis", "")); + cubeCards.add(new CardIdentity("Tropical Island", "")); + cubeCards.add(new CardIdentity("Tsabo Tavoc", "")); + cubeCards.add(new CardIdentity("Tuktuk the Explorer", "")); + cubeCards.add(new CardIdentity("Tumble Magnet", "")); + cubeCards.add(new CardIdentity("Tundra", "")); + cubeCards.add(new CardIdentity("Turn // Burn", "")); + cubeCards.add(new CardIdentity("Twilight Mire", "")); + cubeCards.add(new CardIdentity("Tymaret, the Murder King", "")); + cubeCards.add(new CardIdentity("Ugin's Insight", "")); + cubeCards.add(new CardIdentity("Ulamog, the Infinite Gyre", "")); + cubeCards.add(new CardIdentity("Ultimate Price", "")); + cubeCards.add(new CardIdentity("Underground Sea", "")); + cubeCards.add(new CardIdentity("Unexpectedly Absent", "")); + cubeCards.add(new CardIdentity("Unstable Obelisk", "")); + cubeCards.add(new CardIdentity("Untaidake, the Cloud Keeper", "")); + cubeCards.add(new CardIdentity("Urabrask the Hidden", "")); + cubeCards.add(new CardIdentity("Urban Evolution", "")); + cubeCards.add(new CardIdentity("Urza's Rage", "")); + cubeCards.add(new CardIdentity("Utter End", "")); + cubeCards.add(new CardIdentity("Uyo, Silent Prophet", "")); + cubeCards.add(new CardIdentity("Valorous Stance", "")); + cubeCards.add(new CardIdentity("Vampiric Tutor", "")); + cubeCards.add(new CardIdentity("Vanish into Memory", "")); + cubeCards.add(new CardIdentity("Vedalken Orrery", "")); + cubeCards.add(new CardIdentity("Vendetta", "")); + cubeCards.add(new CardIdentity("Vendilion Clique", "")); + cubeCards.add(new CardIdentity("Venser, Shaper Savant", "")); + cubeCards.add(new CardIdentity("Verdant Catacombs", "")); + cubeCards.add(new CardIdentity("Verdant Confluence", "")); + cubeCards.add(new CardIdentity("Verdeloth the Ancient", "")); + cubeCards.add(new CardIdentity("Vicious Shadows", "")); + cubeCards.add(new CardIdentity("Visara the Dreadful", "")); + cubeCards.add(new CardIdentity("Vish Kal, Blood Arbiter", "")); + cubeCards.add(new CardIdentity("Volcanic Island", "")); + cubeCards.add(new CardIdentity("Vorel of the Hull Clade", "")); + cubeCards.add(new CardIdentity("Vorinclex, Voice of Hunger", "")); + cubeCards.add(new CardIdentity("Warstorm Surge", "")); + cubeCards.add(new CardIdentity("Watery Grave", "")); + cubeCards.add(new CardIdentity("Wayfarer's Bauble", "")); + cubeCards.add(new CardIdentity("Wear // Tear", "")); + cubeCards.add(new CardIdentity("Whispers of the Muse", "")); + cubeCards.add(new CardIdentity("Wild Ricochet", "")); + cubeCards.add(new CardIdentity("Windswept Heath", "")); + cubeCards.add(new CardIdentity("Wooded Bastion", "")); + cubeCards.add(new CardIdentity("Wooded Foothills", "")); + cubeCards.add(new CardIdentity("Woodland Cemetery", "")); + cubeCards.add(new CardIdentity("Word of Seizing", "")); + cubeCards.add(new CardIdentity("Worldly Tutor", "")); + cubeCards.add(new CardIdentity("Worn Powerstone", "")); + cubeCards.add(new CardIdentity("Wort, the Raidmother", "")); + cubeCards.add(new CardIdentity("Wrath of God", "")); + cubeCards.add(new CardIdentity("Wretched Confluence", "")); + cubeCards.add(new CardIdentity("Wrexial, the Risen Deep", "")); + cubeCards.add(new CardIdentity("Wydwen, the Biting Gale", "")); + cubeCards.add(new CardIdentity("Xenagos, God of Revels", "")); + cubeCards.add(new CardIdentity("Xiahou Dun, the One-Eyed", "")); + cubeCards.add(new CardIdentity("Yasova Dragonclaw", "")); + cubeCards.add(new CardIdentity("Yawgmoth's Agenda", "")); + cubeCards.add(new CardIdentity("Yeva, Nature's Herald", "")); + cubeCards.add(new CardIdentity("Yisan, the Wanderer Bard", "")); + cubeCards.add(new CardIdentity("Yomiji, Who Bars the Way", "")); + cubeCards.add(new CardIdentity("Yosei, the Morning Star", "")); + cubeCards.add(new CardIdentity("Zedruu the Greathearted", "")); + cubeCards.add(new CardIdentity("Zirilan of the Claw", "")); + cubeCards.add(new CardIdentity("Zurgo Bellstriker", "")); + cubeCards.add(new CardIdentity("Zurgo Helmsmasher", "")); + } +} diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCube.java b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCube.java index 468be41dc97..5221f4668ca 100644 --- a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCube.java +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCube.java @@ -1,643 +1,642 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.tournament.cubes; - -import mage.game.draft.DraftCube; - -/** - * - * @author LevelX2 - */ - -public class MTGOLegacyCube extends DraftCube { - - public MTGOLegacyCube() { - super("MTGO Legacy Cube (600 cards)"); - cubeCards.add(new CardIdentity("Accorder Paladin","")); - cubeCards.add(new CardIdentity("Abrupt Decay","")); - cubeCards.add(new CardIdentity("Acidic Slime","")); - cubeCards.add(new CardIdentity("Act of Aggression","")); - cubeCards.add(new CardIdentity("Adarkar Wastes","")); - cubeCards.add(new CardIdentity("AEther Vial","")); - cubeCards.add(new CardIdentity("Ajani Goldmane","")); - cubeCards.add(new CardIdentity("Ajani Steadfast","")); - cubeCards.add(new CardIdentity("Ajani Vengeant","")); - cubeCards.add(new CardIdentity("Ajani, Caller of the Pride","")); - cubeCards.add(new CardIdentity("Ajani, Mentor of Heroes","")); - cubeCards.add(new CardIdentity("Ancestral Vision","")); - cubeCards.add(new CardIdentity("Ancient Grudge","")); - cubeCards.add(new CardIdentity("Ancient Tomb","")); - cubeCards.add(new CardIdentity("Angel of Serenity","")); - cubeCards.add(new CardIdentity("Angelic Destiny","")); - cubeCards.add(new CardIdentity("Anger of the Gods","")); - cubeCards.add(new CardIdentity("Animate Dead","")); - cubeCards.add(new CardIdentity("Arbor Elf","")); - cubeCards.add(new CardIdentity("Arc Trail","")); - cubeCards.add(new CardIdentity("Archangel of Thune","")); - cubeCards.add(new CardIdentity("Arid Mesa","")); - cubeCards.add(new CardIdentity("Armageddon","")); - cubeCards.add(new CardIdentity("Ashcloud Phoenix","")); - cubeCards.add(new CardIdentity("Ashiok, Nightmare Weaver","")); - cubeCards.add(new CardIdentity("Augur of Bolas","")); - cubeCards.add(new CardIdentity("Avacyn's Pilgrim","")); - cubeCards.add(new CardIdentity("Avalanche Riders","")); - cubeCards.add(new CardIdentity("Avenger of Zendikar","")); - cubeCards.add(new CardIdentity("Awakening Zone","")); - cubeCards.add(new CardIdentity("Bad Moon","")); - cubeCards.add(new CardIdentity("Badlands","")); - cubeCards.add(new CardIdentity("Baleful Strix","")); - cubeCards.add(new CardIdentity("Baneslayer Angel","")); - cubeCards.add(new CardIdentity("Banisher Priest","")); - cubeCards.add(new CardIdentity("Banishing Light","")); - cubeCards.add(new CardIdentity("Basalt Monolith","")); - cubeCards.add(new CardIdentity("Basilisk Collar","")); - cubeCards.add(new CardIdentity("Batterskull","")); - cubeCards.add(new CardIdentity("Battlefield Forge","")); - cubeCards.add(new CardIdentity("Bayou","")); - cubeCards.add(new CardIdentity("Beast Within","")); - cubeCards.add(new CardIdentity("Beetleback Chief","")); - cubeCards.add(new CardIdentity("Bident of Thassa","")); - cubeCards.add(new CardIdentity("Birds of Paradise","")); - cubeCards.add(new CardIdentity("Birthing Pod","")); - cubeCards.add(new CardIdentity("Bitterblossom","")); - cubeCards.add(new CardIdentity("Black Sun's Zenith","")); - cubeCards.add(new CardIdentity("Blade Splicer","")); - cubeCards.add(new CardIdentity("Blood Crypt","")); - cubeCards.add(new CardIdentity("Bloodbraid Elf","")); - cubeCards.add(new CardIdentity("Bloodghast","")); - cubeCards.add(new CardIdentity("Bloodline Keeper","")); - cubeCards.add(new CardIdentity("Bloodsoaked Champion","")); - cubeCards.add(new CardIdentity("Bloodstained Mire","")); - cubeCards.add(new CardIdentity("Bone Shredder","")); - cubeCards.add(new CardIdentity("Bonesplitter","")); - cubeCards.add(new CardIdentity("Bonfire of the Damned","")); - cubeCards.add(new CardIdentity("Boon Satyr","")); - cubeCards.add(new CardIdentity("Borderland Marauder","")); - cubeCards.add(new CardIdentity("Boros Charm","")); - cubeCards.add(new CardIdentity("Boros Elite","")); - cubeCards.add(new CardIdentity("Boros Reckoner","")); - cubeCards.add(new CardIdentity("Brago, King Eternal","")); - cubeCards.add(new CardIdentity("Brain Maggot","")); - cubeCards.add(new CardIdentity("Brainstorm","")); - cubeCards.add(new CardIdentity("Breeding Pool","")); - cubeCards.add(new CardIdentity("Brimaz, King of Oreskos","")); - cubeCards.add(new CardIdentity("Brimstone Volley","")); - cubeCards.add(new CardIdentity("Brushland","")); - cubeCards.add(new CardIdentity("Burning-Tree Emissary","")); - cubeCards.add(new CardIdentity("Burst Lightning","")); - cubeCards.add(new CardIdentity("Call of the Herd","")); - cubeCards.add(new CardIdentity("Carnophage","")); - cubeCards.add(new CardIdentity("Caves of Koilos","")); - cubeCards.add(new CardIdentity("Chain Lightning","")); - cubeCards.add(new CardIdentity("Chainer's Edict","")); - cubeCards.add(new CardIdentity("Chameleon Colossus","")); - cubeCards.add(new CardIdentity("Champion of the Parish","")); - cubeCards.add(new CardIdentity("Chandra, Pyromaster","")); - cubeCards.add(new CardIdentity("Chandra's Phoenix","")); - cubeCards.add(new CardIdentity("Char","")); - cubeCards.add(new CardIdentity("Chasm Skulker","")); - cubeCards.add(new CardIdentity("Chord of Calling","")); - cubeCards.add(new CardIdentity("Chrome Mox","")); - cubeCards.add(new CardIdentity("City of Brass","")); - cubeCards.add(new CardIdentity("Clifftop Retreat","")); - cubeCards.add(new CardIdentity("Cloudfin Raptor","")); - cubeCards.add(new CardIdentity("Cloudgoat Ranger","")); - cubeCards.add(new CardIdentity("Coalition Relic","")); - cubeCards.add(new CardIdentity("Commune with the Gods","")); - cubeCards.add(new CardIdentity("Compulsive Research","")); - cubeCards.add(new CardIdentity("Condemn","")); - cubeCards.add(new CardIdentity("Condescend","")); - cubeCards.add(new CardIdentity("Consecrated Sphinx","")); - cubeCards.add(new CardIdentity("Consuming Vapors","")); - cubeCards.add(new CardIdentity("Control Magic","")); - cubeCards.add(new CardIdentity("Coralhelm Commander","")); - cubeCards.add(new CardIdentity("Corrupt","")); - cubeCards.add(new CardIdentity("Council's Judgment","")); - cubeCards.add(new CardIdentity("Counterspell","")); - cubeCards.add(new CardIdentity("Courser of Kruphix","")); - cubeCards.add(new CardIdentity("Crater's Claws","")); - cubeCards.add(new CardIdentity("Craterhoof Behemoth","")); - cubeCards.add(new CardIdentity("Crusade","")); - cubeCards.add(new CardIdentity("Cryptic Command","")); - cubeCards.add(new CardIdentity("Cultivate","")); - cubeCards.add(new CardIdentity("Cunning Sparkmage","")); - cubeCards.add(new CardIdentity("Curse of Predation","")); - cubeCards.add(new CardIdentity("Cursed Scroll","")); - cubeCards.add(new CardIdentity("Cyclonic Rift","")); - cubeCards.add(new CardIdentity("Damnation","")); - cubeCards.add(new CardIdentity("Dark Confidant","")); - cubeCards.add(new CardIdentity("Dark Ritual","")); - cubeCards.add(new CardIdentity("Darkblast","")); - cubeCards.add(new CardIdentity("Day of Judgment","")); - cubeCards.add(new CardIdentity("Daze","")); - cubeCards.add(new CardIdentity("Deceiver Exarch","")); - cubeCards.add(new CardIdentity("Deep Analysis","")); - cubeCards.add(new CardIdentity("Delver of Secrets","")); - cubeCards.add(new CardIdentity("Deranged Hermit","")); - cubeCards.add(new CardIdentity("Desecration Demon","")); - cubeCards.add(new CardIdentity("Detention Sphere","")); - cubeCards.add(new CardIdentity("Devil's Play","")); - cubeCards.add(new CardIdentity("Diabolic Servitude","")); - cubeCards.add(new CardIdentity("Dictate of Heliod","")); - cubeCards.add(new CardIdentity("Dig Through Time","")); - cubeCards.add(new CardIdentity("Diregraf Ghoul","")); - cubeCards.add(new CardIdentity("Disciple of Bolas","")); - cubeCards.add(new CardIdentity("Disenchant","")); - cubeCards.add(new CardIdentity("Disfigure","")); - cubeCards.add(new CardIdentity("Dismember","")); - cubeCards.add(new CardIdentity("Dismiss","")); - cubeCards.add(new CardIdentity("Dissolve","")); - cubeCards.add(new CardIdentity("Domri Rade","")); - cubeCards.add(new CardIdentity("Doom Blade","")); - cubeCards.add(new CardIdentity("Doomed Traveler","")); - cubeCards.add(new CardIdentity("Dragon Fodder","")); - cubeCards.add(new CardIdentity("Dragonskull Summit","")); - cubeCards.add(new CardIdentity("Dread Return","")); - cubeCards.add(new CardIdentity("Dreadbore","")); - cubeCards.add(new CardIdentity("Drowned Catacomb","")); - cubeCards.add(new CardIdentity("Dualcaster Mage","")); - cubeCards.add(new CardIdentity("Dungeon Geists","")); - cubeCards.add(new CardIdentity("Duplicant","")); - cubeCards.add(new CardIdentity("Duress","")); - cubeCards.add(new CardIdentity("Edric, Spymaster of Trest","")); - cubeCards.add(new CardIdentity("Eight-and-a-Half-Tails","")); - cubeCards.add(new CardIdentity("Electrolyze","")); - cubeCards.add(new CardIdentity("Elesh Norn, Grand Cenobite","")); - cubeCards.add(new CardIdentity("Elite Vanguard","")); - cubeCards.add(new CardIdentity("Elspeth Tirel","")); - cubeCards.add(new CardIdentity("Elspeth, Knight-Errant","")); - cubeCards.add(new CardIdentity("Elspeth, Sun's Champion","")); - cubeCards.add(new CardIdentity("Elves of Deep Shadow","")); - cubeCards.add(new CardIdentity("Elvish Mystic","")); - cubeCards.add(new CardIdentity("Emeria Angel","")); - cubeCards.add(new CardIdentity("Emrakul, the Aeons Torn","")); - cubeCards.add(new CardIdentity("Entomb","")); - cubeCards.add(new CardIdentity("Entreat the Angels","")); - cubeCards.add(new CardIdentity("Essence Scatter","")); - cubeCards.add(new CardIdentity("Eternal Dragon","")); - cubeCards.add(new CardIdentity("Eternal Witness","")); - cubeCards.add(new CardIdentity("Eureka","")); - cubeCards.add(new CardIdentity("Everflowing Chalice","")); - cubeCards.add(new CardIdentity("Exalted Angel","")); - cubeCards.add(new CardIdentity("Exhume","")); - cubeCards.add(new CardIdentity("Explore","")); - cubeCards.add(new CardIdentity("Fact or Fiction","")); - cubeCards.add(new CardIdentity("Faith's Fetters","")); - cubeCards.add(new CardIdentity("Falkenrath Aristocrat","")); - cubeCards.add(new CardIdentity("Far // Away","")); - cubeCards.add(new CardIdentity("Farseek","")); - cubeCards.add(new CardIdentity("Fauna Shaman","")); - cubeCards.add(new CardIdentity("Figure of Destiny","")); - cubeCards.add(new CardIdentity("Fire // Ice","")); - cubeCards.add(new CardIdentity("Fireblast","")); - cubeCards.add(new CardIdentity("Firebolt","")); - cubeCards.add(new CardIdentity("Firedrinker Satyr","")); - cubeCards.add(new CardIdentity("Firefist Striker","")); - cubeCards.add(new CardIdentity("Flame Slash","")); - cubeCards.add(new CardIdentity("Flametongue Kavu","")); - cubeCards.add(new CardIdentity("Fleecemane Lion","")); - cubeCards.add(new CardIdentity("Flickerwisp","")); - cubeCards.add(new CardIdentity("Flooded Strand","")); - cubeCards.add(new CardIdentity("Forbid","")); - cubeCards.add(new CardIdentity("Forbidden Alchemy","")); - cubeCards.add(new CardIdentity("Force of Will","")); - cubeCards.add(new CardIdentity("Force Spike","")); - cubeCards.add(new CardIdentity("Frenzied Goblin","")); - cubeCards.add(new CardIdentity("Freyalise, Llanowar's Fury","")); - cubeCards.add(new CardIdentity("Frontline Medic","")); - cubeCards.add(new CardIdentity("Frost Titan","")); - cubeCards.add(new CardIdentity("Future Sight","")); - cubeCards.add(new CardIdentity("Fyndhorn Elves","")); - cubeCards.add(new CardIdentity("Gaea's Cradle","")); - cubeCards.add(new CardIdentity("Garruk Relentless","")); - cubeCards.add(new CardIdentity("Garruk Wildspeaker","")); - cubeCards.add(new CardIdentity("Garruk, Apex Predator","")); - cubeCards.add(new CardIdentity("Garruk, Caller of Beasts","")); - cubeCards.add(new CardIdentity("Garruk, Primal Hunter","")); - cubeCards.add(new CardIdentity("Gatekeeper of Malakir","")); - cubeCards.add(new CardIdentity("Gather the Townsfolk","")); - cubeCards.add(new CardIdentity("Geist of Saint Traft","")); - cubeCards.add(new CardIdentity("Genesis Wave","")); - cubeCards.add(new CardIdentity("Geralf's Messenger","")); - cubeCards.add(new CardIdentity("Gerrard's Verdict","")); - cubeCards.add(new CardIdentity("Ghor-Clan Rampager","")); - cubeCards.add(new CardIdentity("Gideon Jura","")); - cubeCards.add(new CardIdentity("Gifts Ungiven","")); - cubeCards.add(new CardIdentity("Gilded Lotus","")); - cubeCards.add(new CardIdentity("Glacial Fortress","")); - cubeCards.add(new CardIdentity("Glen Elendra Archmage","")); - cubeCards.add(new CardIdentity("Glorious Anthem","")); - cubeCards.add(new CardIdentity("Gnarled Scarhide","")); - cubeCards.add(new CardIdentity("Go for the Throat","")); - cubeCards.add(new CardIdentity("Goblin Bombardment","")); - cubeCards.add(new CardIdentity("Goblin Bushwhacker","")); - cubeCards.add(new CardIdentity("Goblin Electromancer","")); - cubeCards.add(new CardIdentity("Goblin Guide","")); - cubeCards.add(new CardIdentity("Goblin Rabblemaster","")); - cubeCards.add(new CardIdentity("Goblin Wardriver","")); - cubeCards.add(new CardIdentity("Godless Shrine","")); - cubeCards.add(new CardIdentity("Gore-House Chainwalker","")); - cubeCards.add(new CardIdentity("Grafted Wargear","")); - cubeCards.add(new CardIdentity("Grave Titan","")); - cubeCards.add(new CardIdentity("Graveborn Muse","")); - cubeCards.add(new CardIdentity("Gravecrawler","")); - cubeCards.add(new CardIdentity("Gray Merchant of Asphodel","")); - cubeCards.add(new CardIdentity("Greater Gargadon","")); - cubeCards.add(new CardIdentity("Green Sun's Zenith","")); - cubeCards.add(new CardIdentity("Grim Lavamancer","")); - cubeCards.add(new CardIdentity("Grim Monolith","")); - cubeCards.add(new CardIdentity("Griselbrand","")); - cubeCards.add(new CardIdentity("Grisly Salvage","")); - cubeCards.add(new CardIdentity("Guttersnipe","")); - cubeCards.add(new CardIdentity("Hall of Triumph","")); - cubeCards.add(new CardIdentity("Hallowed Fountain","")); - cubeCards.add(new CardIdentity("Hallowed Spiritkeeper","")); - cubeCards.add(new CardIdentity("Hammer of Purphoros","")); - cubeCards.add(new CardIdentity("Harmonize","")); - cubeCards.add(new CardIdentity("Hellrider","")); - cubeCards.add(new CardIdentity("Herald of Torment","")); - cubeCards.add(new CardIdentity("Hero of Bladehold","")); - cubeCards.add(new CardIdentity("Hero of Oxid Ridge","")); - cubeCards.add(new CardIdentity("Hero's Downfall","")); - cubeCards.add(new CardIdentity("Hinterland Harbor","")); - cubeCards.add(new CardIdentity("Honor of the Pure","")); - cubeCards.add(new CardIdentity("Hordeling Outburst","")); - cubeCards.add(new CardIdentity("Hornet Queen","")); - cubeCards.add(new CardIdentity("Huntmaster of the Fells","")); - cubeCards.add(new CardIdentity("Hymn to Tourach","")); - cubeCards.add(new CardIdentity("Hypnotic Specter","")); - cubeCards.add(new CardIdentity("Imperial Recruiter","")); - cubeCards.add(new CardIdentity("Imposing Sovereign","")); - cubeCards.add(new CardIdentity("Impulse","")); - cubeCards.add(new CardIdentity("Incinerate","")); - cubeCards.add(new CardIdentity("Indrik Stomphowler","")); - cubeCards.add(new CardIdentity("Inferno Titan","")); - cubeCards.add(new CardIdentity("Inquisition of Kozilek","")); - cubeCards.add(new CardIdentity("Into the Roil","")); - cubeCards.add(new CardIdentity("Intuition","")); - cubeCards.add(new CardIdentity("Isamaru, Hound of Konda","")); - cubeCards.add(new CardIdentity("Isochron Scepter","")); - cubeCards.add(new CardIdentity("Isolated Chapel","")); - cubeCards.add(new CardIdentity("Jace Beleren","")); - cubeCards.add(new CardIdentity("Jace, Architect of Thought","")); - cubeCards.add(new CardIdentity("Jace, the Mind Sculptor","")); - cubeCards.add(new CardIdentity("Jackal Pup","")); - cubeCards.add(new CardIdentity("Joraga Treespeaker","")); - cubeCards.add(new CardIdentity("Journey to Nowhere","")); - cubeCards.add(new CardIdentity("Kami of Ancient Law","")); - cubeCards.add(new CardIdentity("Karmic Guide","")); - cubeCards.add(new CardIdentity("Karn Liberated","")); - cubeCards.add(new CardIdentity("Karplusan Forest","")); - cubeCards.add(new CardIdentity("Keiga, the Tide Star","")); - cubeCards.add(new CardIdentity("Keranos, God of Storms","")); - cubeCards.add(new CardIdentity("Kiki-Jiki, Mirror Breaker","")); - cubeCards.add(new CardIdentity("Kiln Fiend","")); - cubeCards.add(new CardIdentity("Kiora, the Crashing Wave","")); - cubeCards.add(new CardIdentity("Kira, Great Glass-Spinner","")); - cubeCards.add(new CardIdentity("Kitchen Finks","")); - cubeCards.add(new CardIdentity("Knight of Infamy","")); - cubeCards.add(new CardIdentity("Kodama's Reach","")); - cubeCards.add(new CardIdentity("Kokusho, the Evening Star","")); - cubeCards.add(new CardIdentity("Kor Skyfisher","")); - cubeCards.add(new CardIdentity("Koth of the Hammer","")); - cubeCards.add(new CardIdentity("Kozilek, Butcher of Truth","")); - cubeCards.add(new CardIdentity("Krenko's Command","")); - cubeCards.add(new CardIdentity("Krosan Grip","")); - cubeCards.add(new CardIdentity("Land Tax","")); - cubeCards.add(new CardIdentity("Legacy's Allure","")); - cubeCards.add(new CardIdentity("Lifebane Zombie","")); - cubeCards.add(new CardIdentity("Lightning Bolt","")); - cubeCards.add(new CardIdentity("Lightning Greaves","")); - cubeCards.add(new CardIdentity("Lightning Helix","")); - cubeCards.add(new CardIdentity("Lightning Mauler","")); - cubeCards.add(new CardIdentity("Lightning Strike","")); - cubeCards.add(new CardIdentity("Liliana of the Veil","")); - cubeCards.add(new CardIdentity("Liliana Vess","")); - cubeCards.add(new CardIdentity("Lingering Souls","")); - cubeCards.add(new CardIdentity("Linvala, Keeper of Silence","")); - cubeCards.add(new CardIdentity("Living Death","")); - cubeCards.add(new CardIdentity("Llanowar Elves","")); - cubeCards.add(new CardIdentity("Llanowar Wastes","")); - cubeCards.add(new CardIdentity("Looter il-Kor","")); - cubeCards.add(new CardIdentity("Lotleth Troll","")); - cubeCards.add(new CardIdentity("Lotus Cobra","")); - cubeCards.add(new CardIdentity("Loxodon Warhammer","")); - cubeCards.add(new CardIdentity("Madcap Skills","")); - cubeCards.add(new CardIdentity("Maelstrom Pulse","")); - cubeCards.add(new CardIdentity("Magma Jet","")); - cubeCards.add(new CardIdentity("Man-o'-War","")); - cubeCards.add(new CardIdentity("Mana Confluence","")); - cubeCards.add(new CardIdentity("Mana Leak","")); - cubeCards.add(new CardIdentity("Mana Tithe","")); - cubeCards.add(new CardIdentity("Marsh Flats","")); - cubeCards.add(new CardIdentity("Martial Coup","")); - cubeCards.add(new CardIdentity("Massacre Wurm","")); - cubeCards.add(new CardIdentity("Master of the Feast","")); - cubeCards.add(new CardIdentity("Master of the Wild Hunt","")); - cubeCards.add(new CardIdentity("Master of Waves","")); - cubeCards.add(new CardIdentity("Meloku the Clouded Mirror","")); - cubeCards.add(new CardIdentity("Mentor of the Meek","")); - cubeCards.add(new CardIdentity("Merfolk Looter","")); - cubeCards.add(new CardIdentity("Mesmeric Fiend","")); - cubeCards.add(new CardIdentity("Mind Stone","")); - cubeCards.add(new CardIdentity("Mirari's Wake","")); - cubeCards.add(new CardIdentity("Mirran Crusader","")); - cubeCards.add(new CardIdentity("Miscalculation","")); - cubeCards.add(new CardIdentity("Mishra's Factory","")); - cubeCards.add(new CardIdentity("Misty Rainforest","")); - cubeCards.add(new CardIdentity("Mizzium Mortars","")); - cubeCards.add(new CardIdentity("Mogg Fanatic","")); - cubeCards.add(new CardIdentity("Mogg War Marshal","")); - cubeCards.add(new CardIdentity("Molten Rain","")); - cubeCards.add(new CardIdentity("Molten-Tail Masticore","")); - cubeCards.add(new CardIdentity("Momentary Blink","")); - cubeCards.add(new CardIdentity("Mother of Runes","")); - cubeCards.add(new CardIdentity("Mox Diamond","")); - cubeCards.add(new CardIdentity("Mulch","")); - cubeCards.add(new CardIdentity("Mulldrifter","")); - cubeCards.add(new CardIdentity("Murderous Cut","")); - cubeCards.add(new CardIdentity("Murderous Redcap","")); - cubeCards.add(new CardIdentity("Mutagenic Growth","")); - cubeCards.add(new CardIdentity("Mutavault","")); - cubeCards.add(new CardIdentity("Myr Battlesphere","")); - cubeCards.add(new CardIdentity("Mystic Snake","")); - cubeCards.add(new CardIdentity("Mystical Teachings","")); - cubeCards.add(new CardIdentity("Nantuko Shade","")); - cubeCards.add(new CardIdentity("Natural Order","")); - cubeCards.add(new CardIdentity("Naturalize","")); - cubeCards.add(new CardIdentity("Negate","")); - cubeCards.add(new CardIdentity("Nekrataal","")); - cubeCards.add(new CardIdentity("Nicol Bolas, Planeswalker","")); - cubeCards.add(new CardIdentity("Night's Whisper","")); - cubeCards.add(new CardIdentity("Nighthowler","")); - cubeCards.add(new CardIdentity("Nightveil Specter","")); - cubeCards.add(new CardIdentity("Nissa, Worldwaker","")); - cubeCards.add(new CardIdentity("Noble Hierarch","")); - cubeCards.add(new CardIdentity("Nykthos, Shrine to Nyx","")); - cubeCards.add(new CardIdentity("Oblivion Ring","")); - cubeCards.add(new CardIdentity("Obstinate Baloth","")); - cubeCards.add(new CardIdentity("Old Man of the Sea","")); - cubeCards.add(new CardIdentity("Olivia Voldaren","")); - cubeCards.add(new CardIdentity("Ophiomancer","")); - cubeCards.add(new CardIdentity("Opposition","")); - cubeCards.add(new CardIdentity("Oracle of Mul Daya","")); - cubeCards.add(new CardIdentity("Oust","")); - cubeCards.add(new CardIdentity("Overgrown Battlement","")); - cubeCards.add(new CardIdentity("Overgrown Tomb","")); - cubeCards.add(new CardIdentity("Pact of Negation","")); - cubeCards.add(new CardIdentity("Pain Seer","")); - cubeCards.add(new CardIdentity("Parallax Wave","")); - cubeCards.add(new CardIdentity("Path to Exile","")); - cubeCards.add(new CardIdentity("Pestermite","")); - cubeCards.add(new CardIdentity("Phantasmal Image","")); - cubeCards.add(new CardIdentity("Phantom Centaur","")); - cubeCards.add(new CardIdentity("Phyrexian Arena","")); - cubeCards.add(new CardIdentity("Phyrexian Metamorph","")); - cubeCards.add(new CardIdentity("Phyrexian Obliterator","")); - cubeCards.add(new CardIdentity("Phyrexian Revoker","")); - cubeCards.add(new CardIdentity("Pillar of Flame","")); - cubeCards.add(new CardIdentity("Plateau","")); - cubeCards.add(new CardIdentity("Plow Under","")); - cubeCards.add(new CardIdentity("Polluted Delta","")); - cubeCards.add(new CardIdentity("Polukranos, World Eater","")); - cubeCards.add(new CardIdentity("Ponder","")); - cubeCards.add(new CardIdentity("Porcelain Legionnaire","")); - cubeCards.add(new CardIdentity("Precinct Captain","")); - cubeCards.add(new CardIdentity("Precursor Golem","")); - cubeCards.add(new CardIdentity("Preordain","")); - cubeCards.add(new CardIdentity("Primal Command","")); - cubeCards.add(new CardIdentity("Prime Speaker Zegana","")); - cubeCards.add(new CardIdentity("Primeval Titan","")); - cubeCards.add(new CardIdentity("Profane Command","")); - cubeCards.add(new CardIdentity("Progenitus","")); - cubeCards.add(new CardIdentity("Prophetic Bolt","")); - cubeCards.add(new CardIdentity("Prophetic Flamespeaker","")); - cubeCards.add(new CardIdentity("Psychatog","")); - cubeCards.add(new CardIdentity("Purphoros, God of the Forge","")); - cubeCards.add(new CardIdentity("Qasali Pridemage","")); - cubeCards.add(new CardIdentity("Raise the Alarm","")); - cubeCards.add(new CardIdentity("Rakdos Cackler","")); - cubeCards.add(new CardIdentity("Ral Zarek","")); - cubeCards.add(new CardIdentity("Rampant Growth","")); - cubeCards.add(new CardIdentity("Rancor","")); - cubeCards.add(new CardIdentity("Ranger of Eos","")); - cubeCards.add(new CardIdentity("Ravages of War","")); - cubeCards.add(new CardIdentity("Reanimate","")); - cubeCards.add(new CardIdentity("Reclamation Sage","")); - cubeCards.add(new CardIdentity("Recurring Nightmare","")); - cubeCards.add(new CardIdentity("Reflecting Pool","")); - cubeCards.add(new CardIdentity("Regrowth","")); - cubeCards.add(new CardIdentity("Remand","")); - cubeCards.add(new CardIdentity("Remove Soul","")); - cubeCards.add(new CardIdentity("Repeal","")); - cubeCards.add(new CardIdentity("Restoration Angel","")); - cubeCards.add(new CardIdentity("Reveillark","")); - cubeCards.add(new CardIdentity("Rift Bolt","")); - cubeCards.add(new CardIdentity("Riftwing Cloudskate","")); - cubeCards.add(new CardIdentity("Riptide Laboratory","")); - cubeCards.add(new CardIdentity("Rishadan Port","")); - cubeCards.add(new CardIdentity("Rofellos, Llanowar Emissary","")); - cubeCards.add(new CardIdentity("Rootbound Crag","")); - cubeCards.add(new CardIdentity("Sacred Foundry","")); - cubeCards.add(new CardIdentity("Sakashima's Student","")); - cubeCards.add(new CardIdentity("Sakura-Tribe Elder","")); - cubeCards.add(new CardIdentity("Sarcomancy","")); - cubeCards.add(new CardIdentity("Sarkhan, the Dragonspeaker","")); - cubeCards.add(new CardIdentity("Satyr Wayfinder","")); - cubeCards.add(new CardIdentity("Savannah","")); - cubeCards.add(new CardIdentity("Savannah Lions","")); - cubeCards.add(new CardIdentity("Scalding Tarn","")); - cubeCards.add(new CardIdentity("Scavenging Ooze","")); - cubeCards.add(new CardIdentity("Scorched Rusalka","")); - cubeCards.add(new CardIdentity("Scrubland","")); - cubeCards.add(new CardIdentity("Sea Gate Oracle","")); - cubeCards.add(new CardIdentity("Seal of Cleansing","")); - cubeCards.add(new CardIdentity("Seal of Fire","")); - cubeCards.add(new CardIdentity("Search for Tomorrow","")); - cubeCards.add(new CardIdentity("Searing Blaze","")); - cubeCards.add(new CardIdentity("Searing Blood","")); - cubeCards.add(new CardIdentity("Searing Spear","")); - cubeCards.add(new CardIdentity("Seeker of the Way","")); - cubeCards.add(new CardIdentity("Sensei's Divining Top","")); - cubeCards.add(new CardIdentity("Serendib Efreet","")); - cubeCards.add(new CardIdentity("Serum Visions","")); - cubeCards.add(new CardIdentity("Setessan Tactics","")); - cubeCards.add(new CardIdentity("Shadowmage Infiltrator","")); - cubeCards.add(new CardIdentity("Shardless Agent","")); - cubeCards.add(new CardIdentity("Sheoldred, Whispering One","")); - cubeCards.add(new CardIdentity("Shivan Reef","")); - cubeCards.add(new CardIdentity("Show and Tell","")); - cubeCards.add(new CardIdentity("Shriekmaw","")); - cubeCards.add(new CardIdentity("Shrine of Burning Rage","")); - cubeCards.add(new CardIdentity("Siege-Gang Commander","")); - cubeCards.add(new CardIdentity("Silverblade Paladin","")); - cubeCards.add(new CardIdentity("Sin Collector","")); - cubeCards.add(new CardIdentity("Sinkhole","")); - cubeCards.add(new CardIdentity("Skinrender","")); - cubeCards.add(new CardIdentity("Skullcrack","")); - cubeCards.add(new CardIdentity("Slagstorm","")); - cubeCards.add(new CardIdentity("Slaughter Pact","")); - cubeCards.add(new CardIdentity("Smash to Smithereens","")); - cubeCards.add(new CardIdentity("Snapcaster Mage","")); - cubeCards.add(new CardIdentity("Sneak Attack","")); - cubeCards.add(new CardIdentity("Soldier of the Pantheon","")); - cubeCards.add(new CardIdentity("Solemn Simulacrum","")); - cubeCards.add(new CardIdentity("Song of the Dryads","")); - cubeCards.add(new CardIdentity("Sorin Markov","")); - cubeCards.add(new CardIdentity("Sorin, Lord of Innistrad","")); - cubeCards.add(new CardIdentity("Sorin, Solemn Visitor","")); - cubeCards.add(new CardIdentity("Soul of Innistrad","")); - cubeCards.add(new CardIdentity("Sower of Temptation","")); - cubeCards.add(new CardIdentity("Spear of Heliod","")); - cubeCards.add(new CardIdentity("Spectral Procession","")); - cubeCards.add(new CardIdentity("Spellskite","")); - cubeCards.add(new CardIdentity("Sphere of the Suns","")); - cubeCards.add(new CardIdentity("Sphinx's Revelation","")); - cubeCards.add(new CardIdentity("Spikeshot Elder","")); - cubeCards.add(new CardIdentity("Spiteful Returned","")); - cubeCards.add(new CardIdentity("Splinter Twin","")); - cubeCards.add(new CardIdentity("Staggershock","")); - cubeCards.add(new CardIdentity("Steam Vents","")); - cubeCards.add(new CardIdentity("Stinkweed Imp","")); - cubeCards.add(new CardIdentity("Stoke the Flames","")); - cubeCards.add(new CardIdentity("Stomping Ground","")); - cubeCards.add(new CardIdentity("Stormbreath Dragon","")); - cubeCards.add(new CardIdentity("Stroke of Genius","")); - cubeCards.add(new CardIdentity("Stromkirk Noble","")); - cubeCards.add(new CardIdentity("Student of Warfare","")); - cubeCards.add(new CardIdentity("Sublime Archangel","")); - cubeCards.add(new CardIdentity("Sulfur Falls","")); - cubeCards.add(new CardIdentity("Sulfuric Vortex","")); - cubeCards.add(new CardIdentity("Sulfurous Springs","")); - cubeCards.add(new CardIdentity("Summoning Trap","")); - cubeCards.add(new CardIdentity("Sun Titan","")); - cubeCards.add(new CardIdentity("Sundering Titan","")); - cubeCards.add(new CardIdentity("Sunpetal Grove","")); - cubeCards.add(new CardIdentity("Supreme Verdict","")); - cubeCards.add(new CardIdentity("Swords to Plowshares","")); - cubeCards.add(new CardIdentity("Sylvan Caryatid","")); - cubeCards.add(new CardIdentity("Sylvan Library","")); - cubeCards.add(new CardIdentity("Taiga","")); - cubeCards.add(new CardIdentity("Talrand, Sky Summoner","")); - cubeCards.add(new CardIdentity("Tamiyo, the Moon Sage","")); - cubeCards.add(new CardIdentity("Tangle Wire","")); - cubeCards.add(new CardIdentity("Tarmogoyf","")); - cubeCards.add(new CardIdentity("Tectonic Edge","")); - cubeCards.add(new CardIdentity("Teetering Peaks","")); - cubeCards.add(new CardIdentity("Teferi, Mage of Zhalfir","")); - cubeCards.add(new CardIdentity("Temple Garden","")); - cubeCards.add(new CardIdentity("Temple of Abandon","")); - cubeCards.add(new CardIdentity("Temple of Deceit","")); - cubeCards.add(new CardIdentity("Temple of Enlightenment","")); - cubeCards.add(new CardIdentity("Temple of Epiphany","")); - cubeCards.add(new CardIdentity("Temple of Malady","")); - cubeCards.add(new CardIdentity("Temple of Malice","")); - cubeCards.add(new CardIdentity("Temple of Mystery","")); - cubeCards.add(new CardIdentity("Temple of Plenty","")); - cubeCards.add(new CardIdentity("Temple of Silence","")); - cubeCards.add(new CardIdentity("Temple of Triumph","")); - cubeCards.add(new CardIdentity("Tempt with Vengeance","")); - cubeCards.add(new CardIdentity("Tendrils of Corruption","")); - cubeCards.add(new CardIdentity("Terastodon","")); - cubeCards.add(new CardIdentity("Terminate","")); - cubeCards.add(new CardIdentity("Terminus","")); - cubeCards.add(new CardIdentity("Thalia, Guardian of Thraben","")); - cubeCards.add(new CardIdentity("Thassa, God of the Sea","")); - cubeCards.add(new CardIdentity("Think Twice","")); - cubeCards.add(new CardIdentity("Thoughtseize","")); - cubeCards.add(new CardIdentity("Thragtusk","")); - cubeCards.add(new CardIdentity("Thran Dynamo","")); - cubeCards.add(new CardIdentity("Through the Breach","")); - cubeCards.add(new CardIdentity("Thrun, the Last Troll","")); - cubeCards.add(new CardIdentity("Thundermaw Hellkite","")); - cubeCards.add(new CardIdentity("Tidehollow Sculler","")); - cubeCards.add(new CardIdentity("Time Warp","")); - cubeCards.add(new CardIdentity("Tooth and Nail","")); - cubeCards.add(new CardIdentity("Toxic Deluge","")); - cubeCards.add(new CardIdentity("Tracker's Instincts","")); - cubeCards.add(new CardIdentity("Tradewind Rider","")); - cubeCards.add(new CardIdentity("Treachery","")); - cubeCards.add(new CardIdentity("Troll Ascetic","")); - cubeCards.add(new CardIdentity("Tropical Island","")); - cubeCards.add(new CardIdentity("Trygon Predator","")); - cubeCards.add(new CardIdentity("Tundra","")); - cubeCards.add(new CardIdentity("Ulamog, the Infinite Gyre","")); - cubeCards.add(new CardIdentity("Ultimate Price","")); - cubeCards.add(new CardIdentity("Umezawa's Jitte","")); - cubeCards.add(new CardIdentity("Unburial Rites","")); - cubeCards.add(new CardIdentity("Underground River","")); - cubeCards.add(new CardIdentity("Underground Sea","")); - cubeCards.add(new CardIdentity("Underworld Connections","")); - cubeCards.add(new CardIdentity("Unexpectedly Absent","")); - cubeCards.add(new CardIdentity("Upheaval","")); - cubeCards.add(new CardIdentity("Vampire Hexmage","")); - cubeCards.add(new CardIdentity("Vampire Lacerator","")); - cubeCards.add(new CardIdentity("Vampire Nighthawk","")); - cubeCards.add(new CardIdentity("Vedalken Shackles","")); - cubeCards.add(new CardIdentity("Vendilion Clique","")); - cubeCards.add(new CardIdentity("Vengevine","")); - cubeCards.add(new CardIdentity("Venser, Shaper Savant","")); - cubeCards.add(new CardIdentity("Venser, the Sojourner","")); - cubeCards.add(new CardIdentity("Verdant Catacombs","")); - cubeCards.add(new CardIdentity("Vindicate","")); - cubeCards.add(new CardIdentity("Visara the Dreadful","")); - cubeCards.add(new CardIdentity("Voice of Resurgence","")); - cubeCards.add(new CardIdentity("Volcanic Island","")); - cubeCards.add(new CardIdentity("Volrath's Stronghold","")); - cubeCards.add(new CardIdentity("Vraska the Unseen","")); - cubeCards.add(new CardIdentity("Wake Thrasher","")); - cubeCards.add(new CardIdentity("Wall of Blossoms","")); - cubeCards.add(new CardIdentity("Wall of Omens","")); - cubeCards.add(new CardIdentity("Wall of Roots","")); - cubeCards.add(new CardIdentity("Warleader's Helix","")); - cubeCards.add(new CardIdentity("Wasteland","")); - cubeCards.add(new CardIdentity("Waterfront Bouncer","")); - cubeCards.add(new CardIdentity("Watery Grave","")); - cubeCards.add(new CardIdentity("Whip of Erebos","")); - cubeCards.add(new CardIdentity("Wild Mongrel","")); - cubeCards.add(new CardIdentity("Windbrisk Heights","")); - cubeCards.add(new CardIdentity("Windswept Heath","")); - cubeCards.add(new CardIdentity("Winter Orb","")); - cubeCards.add(new CardIdentity("Wolfir Silverheart","")); - cubeCards.add(new CardIdentity("Wood Elves","")); - cubeCards.add(new CardIdentity("Wooded Foothills","")); - cubeCards.add(new CardIdentity("Woodfall Primus","")); - cubeCards.add(new CardIdentity("Woodland Cemetery","")); - cubeCards.add(new CardIdentity("Worn Powerstone","")); - cubeCards.add(new CardIdentity("Wrath of God","")); - cubeCards.add(new CardIdentity("Wurmcoil Engine","")); - cubeCards.add(new CardIdentity("Xathrid Necromancer","")); - cubeCards.add(new CardIdentity("Xenagos, the Reveler","")); - cubeCards.add(new CardIdentity("Yavimaya Coast","")); - cubeCards.add(new CardIdentity("Yavimaya Elder","")); - cubeCards.add(new CardIdentity("Yosei, the Morning Star","")); - cubeCards.add(new CardIdentity("Young Pyromancer","")); - cubeCards.add(new CardIdentity("Zealous Conscripts","")); - - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.tournament.cubes; + +import mage.game.draft.DraftCube; + +/** + * + * @author LevelX2 + */ + +public class MTGOLegacyCube extends DraftCube { + + public MTGOLegacyCube() { + super("MTGO Legacy Cube (600 cards)"); + cubeCards.add(new CardIdentity("Accorder Paladin","")); + cubeCards.add(new CardIdentity("Abrupt Decay","")); + cubeCards.add(new CardIdentity("Acidic Slime","")); + cubeCards.add(new CardIdentity("Act of Aggression","")); + cubeCards.add(new CardIdentity("Adarkar Wastes","")); + cubeCards.add(new CardIdentity("AEther Vial","")); + cubeCards.add(new CardIdentity("Ajani Goldmane","")); + cubeCards.add(new CardIdentity("Ajani Steadfast","")); + cubeCards.add(new CardIdentity("Ajani Vengeant","")); + cubeCards.add(new CardIdentity("Ajani, Caller of the Pride","")); + cubeCards.add(new CardIdentity("Ajani, Mentor of Heroes","")); + cubeCards.add(new CardIdentity("Ancestral Vision","")); + cubeCards.add(new CardIdentity("Ancient Grudge","")); + cubeCards.add(new CardIdentity("Ancient Tomb","")); + cubeCards.add(new CardIdentity("Angel of Serenity","")); + cubeCards.add(new CardIdentity("Angelic Destiny","")); + cubeCards.add(new CardIdentity("Anger of the Gods","")); + cubeCards.add(new CardIdentity("Animate Dead","")); + cubeCards.add(new CardIdentity("Arbor Elf","")); + cubeCards.add(new CardIdentity("Arc Trail","")); + cubeCards.add(new CardIdentity("Archangel of Thune","")); + cubeCards.add(new CardIdentity("Arid Mesa","")); + cubeCards.add(new CardIdentity("Armageddon","")); + cubeCards.add(new CardIdentity("Ashcloud Phoenix","")); + cubeCards.add(new CardIdentity("Ashiok, Nightmare Weaver","")); + cubeCards.add(new CardIdentity("Augur of Bolas","")); + cubeCards.add(new CardIdentity("Avacyn's Pilgrim","")); + cubeCards.add(new CardIdentity("Avalanche Riders","")); + cubeCards.add(new CardIdentity("Avenger of Zendikar","")); + cubeCards.add(new CardIdentity("Awakening Zone","")); + cubeCards.add(new CardIdentity("Bad Moon","")); + cubeCards.add(new CardIdentity("Badlands","")); + cubeCards.add(new CardIdentity("Baleful Strix","")); + cubeCards.add(new CardIdentity("Baneslayer Angel","")); + cubeCards.add(new CardIdentity("Banisher Priest","")); + cubeCards.add(new CardIdentity("Banishing Light","")); + cubeCards.add(new CardIdentity("Basalt Monolith","")); + cubeCards.add(new CardIdentity("Basilisk Collar","")); + cubeCards.add(new CardIdentity("Batterskull","")); + cubeCards.add(new CardIdentity("Battlefield Forge","")); + cubeCards.add(new CardIdentity("Bayou","")); + cubeCards.add(new CardIdentity("Beast Within","")); + cubeCards.add(new CardIdentity("Beetleback Chief","")); + cubeCards.add(new CardIdentity("Bident of Thassa","")); + cubeCards.add(new CardIdentity("Birds of Paradise","")); + cubeCards.add(new CardIdentity("Birthing Pod","")); + cubeCards.add(new CardIdentity("Bitterblossom","")); + cubeCards.add(new CardIdentity("Black Sun's Zenith","")); + cubeCards.add(new CardIdentity("Blade Splicer","")); + cubeCards.add(new CardIdentity("Blood Crypt","")); + cubeCards.add(new CardIdentity("Bloodbraid Elf","")); + cubeCards.add(new CardIdentity("Bloodghast","")); + cubeCards.add(new CardIdentity("Bloodline Keeper","")); + cubeCards.add(new CardIdentity("Bloodsoaked Champion","")); + cubeCards.add(new CardIdentity("Bloodstained Mire","")); + cubeCards.add(new CardIdentity("Bone Shredder","")); + cubeCards.add(new CardIdentity("Bonesplitter","")); + cubeCards.add(new CardIdentity("Bonfire of the Damned","")); + cubeCards.add(new CardIdentity("Boon Satyr","")); + cubeCards.add(new CardIdentity("Borderland Marauder","")); + cubeCards.add(new CardIdentity("Boros Charm","")); + cubeCards.add(new CardIdentity("Boros Elite","")); + cubeCards.add(new CardIdentity("Boros Reckoner","")); + cubeCards.add(new CardIdentity("Brago, King Eternal","")); + cubeCards.add(new CardIdentity("Brain Maggot","")); + cubeCards.add(new CardIdentity("Brainstorm","")); + cubeCards.add(new CardIdentity("Breeding Pool","")); + cubeCards.add(new CardIdentity("Brimaz, King of Oreskos","")); + cubeCards.add(new CardIdentity("Brimstone Volley","")); + cubeCards.add(new CardIdentity("Brushland","")); + cubeCards.add(new CardIdentity("Burning-Tree Emissary","")); + cubeCards.add(new CardIdentity("Burst Lightning","")); + cubeCards.add(new CardIdentity("Call of the Herd","")); + cubeCards.add(new CardIdentity("Carnophage","")); + cubeCards.add(new CardIdentity("Caves of Koilos","")); + cubeCards.add(new CardIdentity("Chain Lightning","")); + cubeCards.add(new CardIdentity("Chainer's Edict","")); + cubeCards.add(new CardIdentity("Chameleon Colossus","")); + cubeCards.add(new CardIdentity("Champion of the Parish","")); + cubeCards.add(new CardIdentity("Chandra, Pyromaster","")); + cubeCards.add(new CardIdentity("Chandra's Phoenix","")); + cubeCards.add(new CardIdentity("Char","")); + cubeCards.add(new CardIdentity("Chasm Skulker","")); + cubeCards.add(new CardIdentity("Chord of Calling","")); + cubeCards.add(new CardIdentity("Chrome Mox","")); + cubeCards.add(new CardIdentity("City of Brass","")); + cubeCards.add(new CardIdentity("Clifftop Retreat","")); + cubeCards.add(new CardIdentity("Cloudfin Raptor","")); + cubeCards.add(new CardIdentity("Cloudgoat Ranger","")); + cubeCards.add(new CardIdentity("Coalition Relic","")); + cubeCards.add(new CardIdentity("Commune with the Gods","")); + cubeCards.add(new CardIdentity("Compulsive Research","")); + cubeCards.add(new CardIdentity("Condemn","")); + cubeCards.add(new CardIdentity("Condescend","")); + cubeCards.add(new CardIdentity("Consecrated Sphinx","")); + cubeCards.add(new CardIdentity("Consuming Vapors","")); + cubeCards.add(new CardIdentity("Control Magic","")); + cubeCards.add(new CardIdentity("Coralhelm Commander","")); + cubeCards.add(new CardIdentity("Corrupt","")); + cubeCards.add(new CardIdentity("Council's Judgment","")); + cubeCards.add(new CardIdentity("Counterspell","")); + cubeCards.add(new CardIdentity("Courser of Kruphix","")); + cubeCards.add(new CardIdentity("Crater's Claws","")); + cubeCards.add(new CardIdentity("Craterhoof Behemoth","")); + cubeCards.add(new CardIdentity("Crusade","")); + cubeCards.add(new CardIdentity("Cryptic Command","")); + cubeCards.add(new CardIdentity("Cultivate","")); + cubeCards.add(new CardIdentity("Cunning Sparkmage","")); + cubeCards.add(new CardIdentity("Curse of Predation","")); + cubeCards.add(new CardIdentity("Cursed Scroll","")); + cubeCards.add(new CardIdentity("Cyclonic Rift","")); + cubeCards.add(new CardIdentity("Damnation","")); + cubeCards.add(new CardIdentity("Dark Confidant","")); + cubeCards.add(new CardIdentity("Dark Ritual","")); + cubeCards.add(new CardIdentity("Darkblast","")); + cubeCards.add(new CardIdentity("Day of Judgment","")); + cubeCards.add(new CardIdentity("Daze","")); + cubeCards.add(new CardIdentity("Deceiver Exarch","")); + cubeCards.add(new CardIdentity("Deep Analysis","")); + cubeCards.add(new CardIdentity("Delver of Secrets","")); + cubeCards.add(new CardIdentity("Deranged Hermit","")); + cubeCards.add(new CardIdentity("Desecration Demon","")); + cubeCards.add(new CardIdentity("Detention Sphere","")); + cubeCards.add(new CardIdentity("Devil's Play","")); + cubeCards.add(new CardIdentity("Diabolic Servitude","")); + cubeCards.add(new CardIdentity("Dictate of Heliod","")); + cubeCards.add(new CardIdentity("Dig Through Time","")); + cubeCards.add(new CardIdentity("Diregraf Ghoul","")); + cubeCards.add(new CardIdentity("Disciple of Bolas","")); + cubeCards.add(new CardIdentity("Disenchant","")); + cubeCards.add(new CardIdentity("Disfigure","")); + cubeCards.add(new CardIdentity("Dismember","")); + cubeCards.add(new CardIdentity("Dismiss","")); + cubeCards.add(new CardIdentity("Dissolve","")); + cubeCards.add(new CardIdentity("Domri Rade","")); + cubeCards.add(new CardIdentity("Doom Blade","")); + cubeCards.add(new CardIdentity("Doomed Traveler","")); + cubeCards.add(new CardIdentity("Dragon Fodder","")); + cubeCards.add(new CardIdentity("Dragonskull Summit","")); + cubeCards.add(new CardIdentity("Dread Return","")); + cubeCards.add(new CardIdentity("Dreadbore","")); + cubeCards.add(new CardIdentity("Drowned Catacomb","")); + cubeCards.add(new CardIdentity("Dualcaster Mage","")); + cubeCards.add(new CardIdentity("Dungeon Geists","")); + cubeCards.add(new CardIdentity("Duplicant","")); + cubeCards.add(new CardIdentity("Duress","")); + cubeCards.add(new CardIdentity("Edric, Spymaster of Trest","")); + cubeCards.add(new CardIdentity("Eight-and-a-Half-Tails","")); + cubeCards.add(new CardIdentity("Electrolyze","")); + cubeCards.add(new CardIdentity("Elesh Norn, Grand Cenobite","")); + cubeCards.add(new CardIdentity("Elite Vanguard","")); + cubeCards.add(new CardIdentity("Elspeth Tirel","")); + cubeCards.add(new CardIdentity("Elspeth, Knight-Errant","")); + cubeCards.add(new CardIdentity("Elspeth, Sun's Champion","")); + cubeCards.add(new CardIdentity("Elves of Deep Shadow","")); + cubeCards.add(new CardIdentity("Elvish Mystic","")); + cubeCards.add(new CardIdentity("Emeria Angel","")); + cubeCards.add(new CardIdentity("Emrakul, the Aeons Torn","")); + cubeCards.add(new CardIdentity("Entomb","")); + cubeCards.add(new CardIdentity("Entreat the Angels","")); + cubeCards.add(new CardIdentity("Essence Scatter","")); + cubeCards.add(new CardIdentity("Eternal Dragon","")); + cubeCards.add(new CardIdentity("Eternal Witness","")); + cubeCards.add(new CardIdentity("Eureka","")); + cubeCards.add(new CardIdentity("Everflowing Chalice","")); + cubeCards.add(new CardIdentity("Exalted Angel","")); + cubeCards.add(new CardIdentity("Exhume","")); + cubeCards.add(new CardIdentity("Explore","")); + cubeCards.add(new CardIdentity("Fact or Fiction","")); + cubeCards.add(new CardIdentity("Faith's Fetters","")); + cubeCards.add(new CardIdentity("Falkenrath Aristocrat","")); + cubeCards.add(new CardIdentity("Far // Away","")); + cubeCards.add(new CardIdentity("Farseek","")); + cubeCards.add(new CardIdentity("Fauna Shaman","")); + cubeCards.add(new CardIdentity("Figure of Destiny","")); + cubeCards.add(new CardIdentity("Fire // Ice","")); + cubeCards.add(new CardIdentity("Fireblast","")); + cubeCards.add(new CardIdentity("Firebolt","")); + cubeCards.add(new CardIdentity("Firedrinker Satyr","")); + cubeCards.add(new CardIdentity("Firefist Striker","")); + cubeCards.add(new CardIdentity("Flame Slash","")); + cubeCards.add(new CardIdentity("Flametongue Kavu","")); + cubeCards.add(new CardIdentity("Fleecemane Lion","")); + cubeCards.add(new CardIdentity("Flickerwisp","")); + cubeCards.add(new CardIdentity("Flooded Strand","")); + cubeCards.add(new CardIdentity("Forbid","")); + cubeCards.add(new CardIdentity("Forbidden Alchemy","")); + cubeCards.add(new CardIdentity("Force of Will","")); + cubeCards.add(new CardIdentity("Force Spike","")); + cubeCards.add(new CardIdentity("Frenzied Goblin","")); + cubeCards.add(new CardIdentity("Freyalise, Llanowar's Fury","")); + cubeCards.add(new CardIdentity("Frontline Medic","")); + cubeCards.add(new CardIdentity("Frost Titan","")); + cubeCards.add(new CardIdentity("Future Sight","")); + cubeCards.add(new CardIdentity("Fyndhorn Elves","")); + cubeCards.add(new CardIdentity("Gaea's Cradle","")); + cubeCards.add(new CardIdentity("Garruk Relentless","")); + cubeCards.add(new CardIdentity("Garruk Wildspeaker","")); + cubeCards.add(new CardIdentity("Garruk, Apex Predator","")); + cubeCards.add(new CardIdentity("Garruk, Caller of Beasts","")); + cubeCards.add(new CardIdentity("Garruk, Primal Hunter","")); + cubeCards.add(new CardIdentity("Gatekeeper of Malakir","")); + cubeCards.add(new CardIdentity("Gather the Townsfolk","")); + cubeCards.add(new CardIdentity("Geist of Saint Traft","")); + cubeCards.add(new CardIdentity("Genesis Wave","")); + cubeCards.add(new CardIdentity("Geralf's Messenger","")); + cubeCards.add(new CardIdentity("Gerrard's Verdict","")); + cubeCards.add(new CardIdentity("Ghor-Clan Rampager","")); + cubeCards.add(new CardIdentity("Gideon Jura","")); + cubeCards.add(new CardIdentity("Gifts Ungiven","")); + cubeCards.add(new CardIdentity("Gilded Lotus","")); + cubeCards.add(new CardIdentity("Glacial Fortress","")); + cubeCards.add(new CardIdentity("Glen Elendra Archmage","")); + cubeCards.add(new CardIdentity("Glorious Anthem","")); + cubeCards.add(new CardIdentity("Gnarled Scarhide","")); + cubeCards.add(new CardIdentity("Go for the Throat","")); + cubeCards.add(new CardIdentity("Goblin Bombardment","")); + cubeCards.add(new CardIdentity("Goblin Bushwhacker","")); + cubeCards.add(new CardIdentity("Goblin Electromancer","")); + cubeCards.add(new CardIdentity("Goblin Guide","")); + cubeCards.add(new CardIdentity("Goblin Rabblemaster","")); + cubeCards.add(new CardIdentity("Goblin Wardriver","")); + cubeCards.add(new CardIdentity("Godless Shrine","")); + cubeCards.add(new CardIdentity("Gore-House Chainwalker","")); + cubeCards.add(new CardIdentity("Grafted Wargear","")); + cubeCards.add(new CardIdentity("Grave Titan","")); + cubeCards.add(new CardIdentity("Graveborn Muse","")); + cubeCards.add(new CardIdentity("Gravecrawler","")); + cubeCards.add(new CardIdentity("Gray Merchant of Asphodel","")); + cubeCards.add(new CardIdentity("Greater Gargadon","")); + cubeCards.add(new CardIdentity("Green Sun's Zenith","")); + cubeCards.add(new CardIdentity("Grim Lavamancer","")); + cubeCards.add(new CardIdentity("Grim Monolith","")); + cubeCards.add(new CardIdentity("Griselbrand","")); + cubeCards.add(new CardIdentity("Grisly Salvage","")); + cubeCards.add(new CardIdentity("Guttersnipe","")); + cubeCards.add(new CardIdentity("Hall of Triumph","")); + cubeCards.add(new CardIdentity("Hallowed Fountain","")); + cubeCards.add(new CardIdentity("Hallowed Spiritkeeper","")); + cubeCards.add(new CardIdentity("Hammer of Purphoros","")); + cubeCards.add(new CardIdentity("Harmonize","")); + cubeCards.add(new CardIdentity("Hellrider","")); + cubeCards.add(new CardIdentity("Herald of Torment","")); + cubeCards.add(new CardIdentity("Hero of Bladehold","")); + cubeCards.add(new CardIdentity("Hero of Oxid Ridge","")); + cubeCards.add(new CardIdentity("Hero's Downfall","")); + cubeCards.add(new CardIdentity("Hinterland Harbor","")); + cubeCards.add(new CardIdentity("Honor of the Pure","")); + cubeCards.add(new CardIdentity("Hordeling Outburst","")); + cubeCards.add(new CardIdentity("Hornet Queen","")); + cubeCards.add(new CardIdentity("Huntmaster of the Fells","")); + cubeCards.add(new CardIdentity("Hymn to Tourach","")); + cubeCards.add(new CardIdentity("Hypnotic Specter","")); + cubeCards.add(new CardIdentity("Imperial Recruiter","")); + cubeCards.add(new CardIdentity("Imposing Sovereign","")); + cubeCards.add(new CardIdentity("Impulse","")); + cubeCards.add(new CardIdentity("Incinerate","")); + cubeCards.add(new CardIdentity("Indrik Stomphowler","")); + cubeCards.add(new CardIdentity("Inferno Titan","")); + cubeCards.add(new CardIdentity("Inquisition of Kozilek","")); + cubeCards.add(new CardIdentity("Into the Roil","")); + cubeCards.add(new CardIdentity("Intuition","")); + cubeCards.add(new CardIdentity("Isamaru, Hound of Konda","")); + cubeCards.add(new CardIdentity("Isochron Scepter","")); + cubeCards.add(new CardIdentity("Isolated Chapel","")); + cubeCards.add(new CardIdentity("Jace Beleren","")); + cubeCards.add(new CardIdentity("Jace, Architect of Thought","")); + cubeCards.add(new CardIdentity("Jace, the Mind Sculptor","")); + cubeCards.add(new CardIdentity("Jackal Pup","")); + cubeCards.add(new CardIdentity("Joraga Treespeaker","")); + cubeCards.add(new CardIdentity("Journey to Nowhere","")); + cubeCards.add(new CardIdentity("Kami of Ancient Law","")); + cubeCards.add(new CardIdentity("Karmic Guide","")); + cubeCards.add(new CardIdentity("Karn Liberated","")); + cubeCards.add(new CardIdentity("Karplusan Forest","")); + cubeCards.add(new CardIdentity("Keiga, the Tide Star","")); + cubeCards.add(new CardIdentity("Keranos, God of Storms","")); + cubeCards.add(new CardIdentity("Kiki-Jiki, Mirror Breaker","")); + cubeCards.add(new CardIdentity("Kiln Fiend","")); + cubeCards.add(new CardIdentity("Kiora, the Crashing Wave","")); + cubeCards.add(new CardIdentity("Kira, Great Glass-Spinner","")); + cubeCards.add(new CardIdentity("Kitchen Finks","")); + cubeCards.add(new CardIdentity("Knight of Infamy","")); + cubeCards.add(new CardIdentity("Kodama's Reach","")); + cubeCards.add(new CardIdentity("Kokusho, the Evening Star","")); + cubeCards.add(new CardIdentity("Kor Skyfisher","")); + cubeCards.add(new CardIdentity("Koth of the Hammer","")); + cubeCards.add(new CardIdentity("Kozilek, Butcher of Truth","")); + cubeCards.add(new CardIdentity("Krenko's Command","")); + cubeCards.add(new CardIdentity("Krosan Grip","")); + cubeCards.add(new CardIdentity("Land Tax","")); + cubeCards.add(new CardIdentity("Legacy's Allure","")); + cubeCards.add(new CardIdentity("Lifebane Zombie","")); + cubeCards.add(new CardIdentity("Lightning Bolt","")); + cubeCards.add(new CardIdentity("Lightning Greaves","")); + cubeCards.add(new CardIdentity("Lightning Helix","")); + cubeCards.add(new CardIdentity("Lightning Mauler","")); + cubeCards.add(new CardIdentity("Lightning Strike","")); + cubeCards.add(new CardIdentity("Liliana of the Veil","")); + cubeCards.add(new CardIdentity("Liliana Vess","")); + cubeCards.add(new CardIdentity("Lingering Souls","")); + cubeCards.add(new CardIdentity("Linvala, Keeper of Silence","")); + cubeCards.add(new CardIdentity("Living Death","")); + cubeCards.add(new CardIdentity("Llanowar Elves","")); + cubeCards.add(new CardIdentity("Llanowar Wastes","")); + cubeCards.add(new CardIdentity("Looter il-Kor","")); + cubeCards.add(new CardIdentity("Lotleth Troll","")); + cubeCards.add(new CardIdentity("Lotus Cobra","")); + cubeCards.add(new CardIdentity("Loxodon Warhammer","")); + cubeCards.add(new CardIdentity("Madcap Skills","")); + cubeCards.add(new CardIdentity("Maelstrom Pulse","")); + cubeCards.add(new CardIdentity("Magma Jet","")); + cubeCards.add(new CardIdentity("Man-o'-War","")); + cubeCards.add(new CardIdentity("Mana Confluence","")); + cubeCards.add(new CardIdentity("Mana Leak","")); + cubeCards.add(new CardIdentity("Mana Tithe","")); + cubeCards.add(new CardIdentity("Marsh Flats","")); + cubeCards.add(new CardIdentity("Martial Coup","")); + cubeCards.add(new CardIdentity("Massacre Wurm","")); + cubeCards.add(new CardIdentity("Master of the Feast","")); + cubeCards.add(new CardIdentity("Master of the Wild Hunt","")); + cubeCards.add(new CardIdentity("Master of Waves","")); + cubeCards.add(new CardIdentity("Meloku the Clouded Mirror","")); + cubeCards.add(new CardIdentity("Mentor of the Meek","")); + cubeCards.add(new CardIdentity("Merfolk Looter","")); + cubeCards.add(new CardIdentity("Mesmeric Fiend","")); + cubeCards.add(new CardIdentity("Mind Stone","")); + cubeCards.add(new CardIdentity("Mirari's Wake","")); + cubeCards.add(new CardIdentity("Mirran Crusader","")); + cubeCards.add(new CardIdentity("Miscalculation","")); + cubeCards.add(new CardIdentity("Mishra's Factory","")); + cubeCards.add(new CardIdentity("Misty Rainforest","")); + cubeCards.add(new CardIdentity("Mizzium Mortars","")); + cubeCards.add(new CardIdentity("Mogg Fanatic","")); + cubeCards.add(new CardIdentity("Mogg War Marshal","")); + cubeCards.add(new CardIdentity("Molten Rain","")); + cubeCards.add(new CardIdentity("Molten-Tail Masticore","")); + cubeCards.add(new CardIdentity("Momentary Blink","")); + cubeCards.add(new CardIdentity("Mother of Runes","")); + cubeCards.add(new CardIdentity("Mox Diamond","")); + cubeCards.add(new CardIdentity("Mulch","")); + cubeCards.add(new CardIdentity("Mulldrifter","")); + cubeCards.add(new CardIdentity("Murderous Cut","")); + cubeCards.add(new CardIdentity("Murderous Redcap","")); + cubeCards.add(new CardIdentity("Mutagenic Growth","")); + cubeCards.add(new CardIdentity("Mutavault","")); + cubeCards.add(new CardIdentity("Myr Battlesphere","")); + cubeCards.add(new CardIdentity("Mystic Snake","")); + cubeCards.add(new CardIdentity("Mystical Teachings","")); + cubeCards.add(new CardIdentity("Nantuko Shade","")); + cubeCards.add(new CardIdentity("Natural Order","")); + cubeCards.add(new CardIdentity("Naturalize","")); + cubeCards.add(new CardIdentity("Negate","")); + cubeCards.add(new CardIdentity("Nekrataal","")); + cubeCards.add(new CardIdentity("Nicol Bolas, Planeswalker","")); + cubeCards.add(new CardIdentity("Night's Whisper","")); + cubeCards.add(new CardIdentity("Nighthowler","")); + cubeCards.add(new CardIdentity("Nightveil Specter","")); + cubeCards.add(new CardIdentity("Nissa, Worldwaker","")); + cubeCards.add(new CardIdentity("Noble Hierarch","")); + cubeCards.add(new CardIdentity("Nykthos, Shrine to Nyx","")); + cubeCards.add(new CardIdentity("Oblivion Ring","")); + cubeCards.add(new CardIdentity("Obstinate Baloth","")); + cubeCards.add(new CardIdentity("Old Man of the Sea","")); + cubeCards.add(new CardIdentity("Olivia Voldaren","")); + cubeCards.add(new CardIdentity("Ophiomancer","")); + cubeCards.add(new CardIdentity("Opposition","")); + cubeCards.add(new CardIdentity("Oracle of Mul Daya","")); + cubeCards.add(new CardIdentity("Oust","")); + cubeCards.add(new CardIdentity("Overgrown Battlement","")); + cubeCards.add(new CardIdentity("Overgrown Tomb","")); + cubeCards.add(new CardIdentity("Pact of Negation","")); + cubeCards.add(new CardIdentity("Pain Seer","")); + cubeCards.add(new CardIdentity("Parallax Wave","")); + cubeCards.add(new CardIdentity("Path to Exile","")); + cubeCards.add(new CardIdentity("Pestermite","")); + cubeCards.add(new CardIdentity("Phantasmal Image","")); + cubeCards.add(new CardIdentity("Phantom Centaur","")); + cubeCards.add(new CardIdentity("Phyrexian Arena","")); + cubeCards.add(new CardIdentity("Phyrexian Metamorph","")); + cubeCards.add(new CardIdentity("Phyrexian Obliterator","")); + cubeCards.add(new CardIdentity("Phyrexian Revoker","")); + cubeCards.add(new CardIdentity("Pillar of Flame","")); + cubeCards.add(new CardIdentity("Plateau","")); + cubeCards.add(new CardIdentity("Plow Under","")); + cubeCards.add(new CardIdentity("Polluted Delta","")); + cubeCards.add(new CardIdentity("Polukranos, World Eater","")); + cubeCards.add(new CardIdentity("Ponder","")); + cubeCards.add(new CardIdentity("Porcelain Legionnaire","")); + cubeCards.add(new CardIdentity("Precinct Captain","")); + cubeCards.add(new CardIdentity("Precursor Golem","")); + cubeCards.add(new CardIdentity("Preordain","")); + cubeCards.add(new CardIdentity("Primal Command","")); + cubeCards.add(new CardIdentity("Prime Speaker Zegana","")); + cubeCards.add(new CardIdentity("Primeval Titan","")); + cubeCards.add(new CardIdentity("Profane Command","")); + cubeCards.add(new CardIdentity("Progenitus","")); + cubeCards.add(new CardIdentity("Prophetic Bolt","")); + cubeCards.add(new CardIdentity("Prophetic Flamespeaker","")); + cubeCards.add(new CardIdentity("Psychatog","")); + cubeCards.add(new CardIdentity("Purphoros, God of the Forge","")); + cubeCards.add(new CardIdentity("Qasali Pridemage","")); + cubeCards.add(new CardIdentity("Raise the Alarm","")); + cubeCards.add(new CardIdentity("Rakdos Cackler","")); + cubeCards.add(new CardIdentity("Ral Zarek","")); + cubeCards.add(new CardIdentity("Rampant Growth","")); + cubeCards.add(new CardIdentity("Rancor","")); + cubeCards.add(new CardIdentity("Ranger of Eos","")); + cubeCards.add(new CardIdentity("Ravages of War","")); + cubeCards.add(new CardIdentity("Reanimate","")); + cubeCards.add(new CardIdentity("Reclamation Sage","")); + cubeCards.add(new CardIdentity("Recurring Nightmare","")); + cubeCards.add(new CardIdentity("Reflecting Pool","")); + cubeCards.add(new CardIdentity("Regrowth","")); + cubeCards.add(new CardIdentity("Remand","")); + cubeCards.add(new CardIdentity("Remove Soul","")); + cubeCards.add(new CardIdentity("Repeal","")); + cubeCards.add(new CardIdentity("Restoration Angel","")); + cubeCards.add(new CardIdentity("Reveillark","")); + cubeCards.add(new CardIdentity("Rift Bolt","")); + cubeCards.add(new CardIdentity("Riftwing Cloudskate","")); + cubeCards.add(new CardIdentity("Riptide Laboratory","")); + cubeCards.add(new CardIdentity("Rishadan Port","")); + cubeCards.add(new CardIdentity("Rofellos, Llanowar Emissary","")); + cubeCards.add(new CardIdentity("Rootbound Crag","")); + cubeCards.add(new CardIdentity("Sacred Foundry","")); + cubeCards.add(new CardIdentity("Sakashima's Student","")); + cubeCards.add(new CardIdentity("Sakura-Tribe Elder","")); + cubeCards.add(new CardIdentity("Sarcomancy","")); + cubeCards.add(new CardIdentity("Sarkhan, the Dragonspeaker","")); + cubeCards.add(new CardIdentity("Satyr Wayfinder","")); + cubeCards.add(new CardIdentity("Savannah","")); + cubeCards.add(new CardIdentity("Savannah Lions","")); + cubeCards.add(new CardIdentity("Scalding Tarn","")); + cubeCards.add(new CardIdentity("Scavenging Ooze","")); + cubeCards.add(new CardIdentity("Scorched Rusalka","")); + cubeCards.add(new CardIdentity("Scrubland","")); + cubeCards.add(new CardIdentity("Sea Gate Oracle","")); + cubeCards.add(new CardIdentity("Seal of Cleansing","")); + cubeCards.add(new CardIdentity("Seal of Fire","")); + cubeCards.add(new CardIdentity("Search for Tomorrow","")); + cubeCards.add(new CardIdentity("Searing Blaze","")); + cubeCards.add(new CardIdentity("Searing Blood","")); + cubeCards.add(new CardIdentity("Searing Spear","")); + cubeCards.add(new CardIdentity("Seeker of the Way","")); + cubeCards.add(new CardIdentity("Sensei's Divining Top","")); + cubeCards.add(new CardIdentity("Serendib Efreet","")); + cubeCards.add(new CardIdentity("Serum Visions","")); + cubeCards.add(new CardIdentity("Setessan Tactics","")); + cubeCards.add(new CardIdentity("Shadowmage Infiltrator","")); + cubeCards.add(new CardIdentity("Shardless Agent","")); + cubeCards.add(new CardIdentity("Sheoldred, Whispering One","")); + cubeCards.add(new CardIdentity("Shivan Reef","")); + cubeCards.add(new CardIdentity("Show and Tell","")); + cubeCards.add(new CardIdentity("Shriekmaw","")); + cubeCards.add(new CardIdentity("Shrine of Burning Rage","")); + cubeCards.add(new CardIdentity("Siege-Gang Commander","")); + cubeCards.add(new CardIdentity("Silverblade Paladin","")); + cubeCards.add(new CardIdentity("Sin Collector","")); + cubeCards.add(new CardIdentity("Sinkhole","")); + cubeCards.add(new CardIdentity("Skinrender","")); + cubeCards.add(new CardIdentity("Skullcrack","")); + cubeCards.add(new CardIdentity("Slagstorm","")); + cubeCards.add(new CardIdentity("Slaughter Pact","")); + cubeCards.add(new CardIdentity("Smash to Smithereens","")); + cubeCards.add(new CardIdentity("Snapcaster Mage","")); + cubeCards.add(new CardIdentity("Sneak Attack","")); + cubeCards.add(new CardIdentity("Soldier of the Pantheon","")); + cubeCards.add(new CardIdentity("Solemn Simulacrum","")); + cubeCards.add(new CardIdentity("Song of the Dryads","")); + cubeCards.add(new CardIdentity("Sorin Markov","")); + cubeCards.add(new CardIdentity("Sorin, Lord of Innistrad","")); + cubeCards.add(new CardIdentity("Sorin, Solemn Visitor","")); + cubeCards.add(new CardIdentity("Soul of Innistrad","")); + cubeCards.add(new CardIdentity("Sower of Temptation","")); + cubeCards.add(new CardIdentity("Spear of Heliod","")); + cubeCards.add(new CardIdentity("Spectral Procession","")); + cubeCards.add(new CardIdentity("Spellskite","")); + cubeCards.add(new CardIdentity("Sphere of the Suns","")); + cubeCards.add(new CardIdentity("Sphinx's Revelation","")); + cubeCards.add(new CardIdentity("Spikeshot Elder","")); + cubeCards.add(new CardIdentity("Spiteful Returned","")); + cubeCards.add(new CardIdentity("Splinter Twin","")); + cubeCards.add(new CardIdentity("Staggershock","")); + cubeCards.add(new CardIdentity("Steam Vents","")); + cubeCards.add(new CardIdentity("Stinkweed Imp","")); + cubeCards.add(new CardIdentity("Stoke the Flames","")); + cubeCards.add(new CardIdentity("Stomping Ground","")); + cubeCards.add(new CardIdentity("Stormbreath Dragon","")); + cubeCards.add(new CardIdentity("Stroke of Genius","")); + cubeCards.add(new CardIdentity("Stromkirk Noble","")); + cubeCards.add(new CardIdentity("Student of Warfare","")); + cubeCards.add(new CardIdentity("Sublime Archangel","")); + cubeCards.add(new CardIdentity("Sulfur Falls","")); + cubeCards.add(new CardIdentity("Sulfuric Vortex","")); + cubeCards.add(new CardIdentity("Sulfurous Springs","")); + cubeCards.add(new CardIdentity("Summoning Trap","")); + cubeCards.add(new CardIdentity("Sun Titan","")); + cubeCards.add(new CardIdentity("Sundering Titan","")); + cubeCards.add(new CardIdentity("Sunpetal Grove","")); + cubeCards.add(new CardIdentity("Supreme Verdict","")); + cubeCards.add(new CardIdentity("Swords to Plowshares","")); + cubeCards.add(new CardIdentity("Sylvan Caryatid","")); + cubeCards.add(new CardIdentity("Sylvan Library","")); + cubeCards.add(new CardIdentity("Taiga","")); + cubeCards.add(new CardIdentity("Talrand, Sky Summoner","")); + cubeCards.add(new CardIdentity("Tamiyo, the Moon Sage","")); + cubeCards.add(new CardIdentity("Tangle Wire","")); + cubeCards.add(new CardIdentity("Tarmogoyf","")); + cubeCards.add(new CardIdentity("Tectonic Edge","")); + cubeCards.add(new CardIdentity("Teetering Peaks","")); + cubeCards.add(new CardIdentity("Teferi, Mage of Zhalfir","")); + cubeCards.add(new CardIdentity("Temple Garden","")); + cubeCards.add(new CardIdentity("Temple of Abandon","")); + cubeCards.add(new CardIdentity("Temple of Deceit","")); + cubeCards.add(new CardIdentity("Temple of Enlightenment","")); + cubeCards.add(new CardIdentity("Temple of Epiphany","")); + cubeCards.add(new CardIdentity("Temple of Malady","")); + cubeCards.add(new CardIdentity("Temple of Malice","")); + cubeCards.add(new CardIdentity("Temple of Mystery","")); + cubeCards.add(new CardIdentity("Temple of Plenty","")); + cubeCards.add(new CardIdentity("Temple of Silence","")); + cubeCards.add(new CardIdentity("Temple of Triumph","")); + cubeCards.add(new CardIdentity("Tempt with Vengeance","")); + cubeCards.add(new CardIdentity("Tendrils of Corruption","")); + cubeCards.add(new CardIdentity("Terastodon","")); + cubeCards.add(new CardIdentity("Terminate","")); + cubeCards.add(new CardIdentity("Terminus","")); + cubeCards.add(new CardIdentity("Thalia, Guardian of Thraben","")); + cubeCards.add(new CardIdentity("Thassa, God of the Sea","")); + cubeCards.add(new CardIdentity("Think Twice","")); + cubeCards.add(new CardIdentity("Thoughtseize","")); + cubeCards.add(new CardIdentity("Thragtusk","")); + cubeCards.add(new CardIdentity("Thran Dynamo","")); + cubeCards.add(new CardIdentity("Through the Breach","")); + cubeCards.add(new CardIdentity("Thrun, the Last Troll","")); + cubeCards.add(new CardIdentity("Thundermaw Hellkite","")); + cubeCards.add(new CardIdentity("Tidehollow Sculler","")); + cubeCards.add(new CardIdentity("Time Warp","")); + cubeCards.add(new CardIdentity("Tooth and Nail","")); + cubeCards.add(new CardIdentity("Toxic Deluge","")); + cubeCards.add(new CardIdentity("Tracker's Instincts","")); + cubeCards.add(new CardIdentity("Tradewind Rider","")); + cubeCards.add(new CardIdentity("Treachery","")); + cubeCards.add(new CardIdentity("Troll Ascetic","")); + cubeCards.add(new CardIdentity("Tropical Island","")); + cubeCards.add(new CardIdentity("Trygon Predator","")); + cubeCards.add(new CardIdentity("Tundra","")); + cubeCards.add(new CardIdentity("Ulamog, the Infinite Gyre","")); + cubeCards.add(new CardIdentity("Ultimate Price","")); + cubeCards.add(new CardIdentity("Umezawa's Jitte","")); + cubeCards.add(new CardIdentity("Unburial Rites","")); + cubeCards.add(new CardIdentity("Underground River","")); + cubeCards.add(new CardIdentity("Underground Sea","")); + cubeCards.add(new CardIdentity("Underworld Connections","")); + cubeCards.add(new CardIdentity("Unexpectedly Absent","")); + cubeCards.add(new CardIdentity("Upheaval","")); + cubeCards.add(new CardIdentity("Vampire Hexmage","")); + cubeCards.add(new CardIdentity("Vampire Lacerator","")); + cubeCards.add(new CardIdentity("Vampire Nighthawk","")); + cubeCards.add(new CardIdentity("Vedalken Shackles","")); + cubeCards.add(new CardIdentity("Vendilion Clique","")); + cubeCards.add(new CardIdentity("Vengevine","")); + cubeCards.add(new CardIdentity("Venser, Shaper Savant","")); + cubeCards.add(new CardIdentity("Venser, the Sojourner","")); + cubeCards.add(new CardIdentity("Verdant Catacombs","")); + cubeCards.add(new CardIdentity("Vindicate","")); + cubeCards.add(new CardIdentity("Visara the Dreadful","")); + cubeCards.add(new CardIdentity("Voice of Resurgence","")); + cubeCards.add(new CardIdentity("Volcanic Island","")); + cubeCards.add(new CardIdentity("Volrath's Stronghold","")); + cubeCards.add(new CardIdentity("Vraska the Unseen","")); + cubeCards.add(new CardIdentity("Wake Thrasher","")); + cubeCards.add(new CardIdentity("Wall of Blossoms","")); + cubeCards.add(new CardIdentity("Wall of Omens","")); + cubeCards.add(new CardIdentity("Wall of Roots","")); + cubeCards.add(new CardIdentity("Warleader's Helix","")); + cubeCards.add(new CardIdentity("Wasteland","")); + cubeCards.add(new CardIdentity("Waterfront Bouncer","")); + cubeCards.add(new CardIdentity("Watery Grave","")); + cubeCards.add(new CardIdentity("Whip of Erebos","")); + cubeCards.add(new CardIdentity("Wild Mongrel","")); + cubeCards.add(new CardIdentity("Windbrisk Heights","")); + cubeCards.add(new CardIdentity("Windswept Heath","")); + cubeCards.add(new CardIdentity("Winter Orb","")); + cubeCards.add(new CardIdentity("Wolfir Silverheart","")); + cubeCards.add(new CardIdentity("Wood Elves","")); + cubeCards.add(new CardIdentity("Wooded Foothills","")); + cubeCards.add(new CardIdentity("Woodfall Primus","")); + cubeCards.add(new CardIdentity("Woodland Cemetery","")); + cubeCards.add(new CardIdentity("Worn Powerstone","")); + cubeCards.add(new CardIdentity("Wrath of God","")); + cubeCards.add(new CardIdentity("Wurmcoil Engine","")); + cubeCards.add(new CardIdentity("Xathrid Necromancer","")); + cubeCards.add(new CardIdentity("Xenagos, the Reveler","")); + cubeCards.add(new CardIdentity("Yavimaya Coast","")); + cubeCards.add(new CardIdentity("Yavimaya Elder","")); + cubeCards.add(new CardIdentity("Yosei, the Morning Star","")); + cubeCards.add(new CardIdentity("Young Pyromancer","")); + cubeCards.add(new CardIdentity("Zealous Conscripts","")); + } +} diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCube2015.java b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCubeMarch2015.java similarity index 99% rename from Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCube2015.java rename to Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCubeMarch2015.java index ff78a85711d..6bfd5c837cc 100644 --- a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCube2015.java +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCubeMarch2015.java @@ -34,10 +34,10 @@ import mage.game.draft.DraftCube; * @author fireshoes */ -public class MTGOLegacyCube2015 extends DraftCube { +public class MTGOLegacyCubeMarch2015 extends DraftCube { - public MTGOLegacyCube2015() { - super("MTGO Legacy Cube 2015 (600 cards)"); + public MTGOLegacyCubeMarch2015() { + super("MTGO Legacy Cube March 2015 (600 cards)"); cubeCards.add(new DraftCube.CardIdentity("Accorder Paladin","")); cubeCards.add(new DraftCube.CardIdentity("Abrupt Decay","")); cubeCards.add(new DraftCube.CardIdentity("Acidic Slime","")); @@ -88,6 +88,7 @@ public class MTGOLegacyCube2015 extends DraftCube { cubeCards.add(new DraftCube.CardIdentity("Bitterblossom","")); cubeCards.add(new DraftCube.CardIdentity("Blade of the Bloodchief","")); cubeCards.add(new DraftCube.CardIdentity("Blade Splicer","")); + cubeCards.add(new DraftCube.CardIdentity("Blood Artist","")); cubeCards.add(new DraftCube.CardIdentity("Blood Crypt","")); cubeCards.add(new DraftCube.CardIdentity("Bloodbraid Elf","")); cubeCards.add(new DraftCube.CardIdentity("Bloodcrazed Neonate","")); @@ -95,13 +96,13 @@ public class MTGOLegacyCube2015 extends DraftCube { cubeCards.add(new DraftCube.CardIdentity("Bloodline Keeper","")); cubeCards.add(new DraftCube.CardIdentity("Bloodlord of Vaasgoth","")); cubeCards.add(new DraftCube.CardIdentity("Bloodstained Mire","")); + cubeCards.add(new DraftCube.CardIdentity("Bloodthrone Vampire","")); cubeCards.add(new DraftCube.CardIdentity("Bogardan Hellkite","")); cubeCards.add(new DraftCube.CardIdentity("Bone Shredder","")); cubeCards.add(new DraftCube.CardIdentity("Bonesplitter","")); cubeCards.add(new DraftCube.CardIdentity("Bonfire of the Damned","")); cubeCards.add(new DraftCube.CardIdentity("Boon Satyr","")); cubeCards.add(new DraftCube.CardIdentity("Boros Charm","")); - cubeCards.add(new DraftCube.CardIdentity("Boros Elite","")); cubeCards.add(new DraftCube.CardIdentity("Boros Reckoner","")); cubeCards.add(new DraftCube.CardIdentity("Brago, King Eternal","")); cubeCards.add(new DraftCube.CardIdentity("Brainstorm","")); @@ -113,7 +114,6 @@ public class MTGOLegacyCube2015 extends DraftCube { cubeCards.add(new DraftCube.CardIdentity("Burst Lightning","")); cubeCards.add(new DraftCube.CardIdentity("Call of the Herd","")); cubeCards.add(new DraftCube.CardIdentity("Captivating Vampire","")); - cubeCards.add(new DraftCube.CardIdentity("Carnophage","")); cubeCards.add(new DraftCube.CardIdentity("Caves of Koilos","")); cubeCards.add(new DraftCube.CardIdentity("Chain Lightning","")); cubeCards.add(new DraftCube.CardIdentity("Chainer's Edict","")); @@ -257,7 +257,6 @@ public class MTGOLegacyCube2015 extends DraftCube { cubeCards.add(new DraftCube.CardIdentity("Glacial Fortress","")); cubeCards.add(new DraftCube.CardIdentity("Glen Elendra Archmage","")); cubeCards.add(new DraftCube.CardIdentity("Glorious Anthem","")); - cubeCards.add(new DraftCube.CardIdentity("Gnarled Scarhide","")); cubeCards.add(new DraftCube.CardIdentity("Go for the Throat","")); cubeCards.add(new DraftCube.CardIdentity("Goblin Bombardment","")); cubeCards.add(new DraftCube.CardIdentity("Goblin Bushwhacker","")); @@ -281,6 +280,7 @@ public class MTGOLegacyCube2015 extends DraftCube { cubeCards.add(new DraftCube.CardIdentity("Hallowed Spiritkeeper","")); cubeCards.add(new DraftCube.CardIdentity("Hammer of Purphoros","")); cubeCards.add(new DraftCube.CardIdentity("Harmonize","")); + cubeCards.add(new DraftCube.CardIdentity("Harrow","")); cubeCards.add(new DraftCube.CardIdentity("Hellrider","")); cubeCards.add(new DraftCube.CardIdentity("Herald of Torment","")); cubeCards.add(new DraftCube.CardIdentity("Hero of Bladehold","")); @@ -359,6 +359,7 @@ public class MTGOLegacyCube2015 extends DraftCube { cubeCards.add(new DraftCube.CardIdentity("Mana Leak","")); cubeCards.add(new DraftCube.CardIdentity("Mana Tithe","")); cubeCards.add(new DraftCube.CardIdentity("Manic Vandal","")); + cubeCards.add(new DraftCube.CardIdentity("Mardu Woe Reaper","")); cubeCards.add(new DraftCube.CardIdentity("Marsh Flats","")); cubeCards.add(new DraftCube.CardIdentity("Martial Coup","")); cubeCards.add(new DraftCube.CardIdentity("Massacre Wurm","")); @@ -382,7 +383,6 @@ public class MTGOLegacyCube2015 extends DraftCube { cubeCards.add(new DraftCube.CardIdentity("Monastery Swiftspear","")); cubeCards.add(new DraftCube.CardIdentity("Mother of Runes","")); cubeCards.add(new DraftCube.CardIdentity("Mox Diamond","")); - cubeCards.add(new DraftCube.CardIdentity("Mulch","")); cubeCards.add(new DraftCube.CardIdentity("Mulldrifter","")); cubeCards.add(new DraftCube.CardIdentity("Murderous Cut","")); cubeCards.add(new DraftCube.CardIdentity("Mutavault","")); @@ -638,6 +638,5 @@ public class MTGOLegacyCube2015 extends DraftCube { cubeCards.add(new DraftCube.CardIdentity("Yosei, the Morning Star","")); cubeCards.add(new DraftCube.CardIdentity("Young Pyromancer","")); cubeCards.add(new DraftCube.CardIdentity("Zealous Conscripts","")); - } } diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCubeSeptember2015.java b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCubeSeptember2015.java new file mode 100644 index 00000000000..14f4a608c0a --- /dev/null +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/cubes/MTGOLegacyCubeSeptember2015.java @@ -0,0 +1,642 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.tournament.cubes; + +import mage.game.draft.DraftCube; + +/** + * + * @author fireshoes + */ + +public class MTGOLegacyCubeSeptember2015 extends DraftCube { + + public MTGOLegacyCubeSeptember2015() { + super("MTGO Legacy Cube September 2015 (600 cards)"); + cubeCards.add(new DraftCube.CardIdentity("Abbot of Keral Keep","")); + cubeCards.add(new DraftCube.CardIdentity("Abhorrent Overlord","")); + cubeCards.add(new DraftCube.CardIdentity("Abrupt Decay","")); + cubeCards.add(new DraftCube.CardIdentity("Abyssal Persecutor","")); + cubeCards.add(new DraftCube.CardIdentity("Accorder Paladin","")); + cubeCards.add(new DraftCube.CardIdentity("Acidic Slime","")); + cubeCards.add(new DraftCube.CardIdentity("Act of Aggression","")); + cubeCards.add(new DraftCube.CardIdentity("Adarkar Wastes","")); + cubeCards.add(new DraftCube.CardIdentity("AEther Vial","")); + cubeCards.add(new DraftCube.CardIdentity("Ainok Survivalist","")); + cubeCards.add(new DraftCube.CardIdentity("Ajani Goldmane","")); + cubeCards.add(new DraftCube.CardIdentity("Ajani Vengeant","")); + cubeCards.add(new DraftCube.CardIdentity("Ajani, Caller of the Pride","")); + cubeCards.add(new DraftCube.CardIdentity("Akroma's Vengeance","")); + cubeCards.add(new DraftCube.CardIdentity("Ancestral Vision","")); + cubeCards.add(new DraftCube.CardIdentity("Ancient Tomb","")); + cubeCards.add(new DraftCube.CardIdentity("Angel of Serenity","")); + cubeCards.add(new DraftCube.CardIdentity("Angelic Destiny","")); + cubeCards.add(new DraftCube.CardIdentity("Anger of the Gods","")); + cubeCards.add(new DraftCube.CardIdentity("Animate Dead","")); + cubeCards.add(new DraftCube.CardIdentity("Arbor Elf","")); + cubeCards.add(new DraftCube.CardIdentity("Arc Trail","")); + cubeCards.add(new DraftCube.CardIdentity("Archangel of Thune","")); + cubeCards.add(new DraftCube.CardIdentity("Arid Mesa","")); + cubeCards.add(new DraftCube.CardIdentity("Armageddon","")); + cubeCards.add(new DraftCube.CardIdentity("Ashcloud Phoenix","")); + cubeCards.add(new DraftCube.CardIdentity("Ashen Rider","")); + cubeCards.add(new DraftCube.CardIdentity("Ashenmoor Gouger","")); + cubeCards.add(new DraftCube.CardIdentity("Ashiok, Nightmare Weaver","")); + cubeCards.add(new DraftCube.CardIdentity("Assemble the Legion","")); + cubeCards.add(new DraftCube.CardIdentity("Attrition","")); + cubeCards.add(new DraftCube.CardIdentity("Augur of Bolas","")); + cubeCards.add(new DraftCube.CardIdentity("Avacyn's Pilgrim","")); + cubeCards.add(new DraftCube.CardIdentity("Avalanche Riders","")); + cubeCards.add(new DraftCube.CardIdentity("Avenger of Zendikar","")); + cubeCards.add(new DraftCube.CardIdentity("Badlands","")); + cubeCards.add(new DraftCube.CardIdentity("Baleful Strix","")); + cubeCards.add(new DraftCube.CardIdentity("Banefire","")); + cubeCards.add(new DraftCube.CardIdentity("Baneslayer Angel","")); + cubeCards.add(new DraftCube.CardIdentity("Banisher Priest","")); + cubeCards.add(new DraftCube.CardIdentity("Banishing Light","")); + cubeCards.add(new DraftCube.CardIdentity("Basalt Monolith","")); + cubeCards.add(new DraftCube.CardIdentity("Basilisk Collar","")); + cubeCards.add(new DraftCube.CardIdentity("Batterskull","")); + cubeCards.add(new DraftCube.CardIdentity("Battlefield Forge","")); + cubeCards.add(new DraftCube.CardIdentity("Bayou","")); + cubeCards.add(new DraftCube.CardIdentity("Beast Within","")); + cubeCards.add(new DraftCube.CardIdentity("Beetleback Chief","")); + cubeCards.add(new DraftCube.CardIdentity("Birds of Paradise","")); + cubeCards.add(new DraftCube.CardIdentity("Birthing Pod","")); + cubeCards.add(new DraftCube.CardIdentity("Bitterblossom","")); + cubeCards.add(new DraftCube.CardIdentity("Blade Splicer","")); + cubeCards.add(new DraftCube.CardIdentity("Blood Crypt","")); + cubeCards.add(new DraftCube.CardIdentity("Bloodbraid Elf","")); + cubeCards.add(new DraftCube.CardIdentity("Bloodghast","")); + cubeCards.add(new DraftCube.CardIdentity("Bloodsoaked Champion","")); + cubeCards.add(new DraftCube.CardIdentity("Bloodstained Mire","")); + cubeCards.add(new DraftCube.CardIdentity("Bogardan Hellkite","")); + cubeCards.add(new DraftCube.CardIdentity("Bone Shredder","")); + cubeCards.add(new DraftCube.CardIdentity("Bonesplitter","")); + cubeCards.add(new DraftCube.CardIdentity("Bonfire of the Damned","")); + cubeCards.add(new DraftCube.CardIdentity("Boros Charm","")); + cubeCards.add(new DraftCube.CardIdentity("Boros Reckoner","")); + cubeCards.add(new DraftCube.CardIdentity("Brago, King Eternal","")); + cubeCards.add(new DraftCube.CardIdentity("Brainstorm","")); + cubeCards.add(new DraftCube.CardIdentity("Breeding Pool","")); + cubeCards.add(new DraftCube.CardIdentity("Brimaz, King of Oreskos","")); + cubeCards.add(new DraftCube.CardIdentity("Brimstone Volley","")); + cubeCards.add(new DraftCube.CardIdentity("Brushland","")); + cubeCards.add(new DraftCube.CardIdentity("Buried Alive","")); + cubeCards.add(new DraftCube.CardIdentity("Burst Lightning","")); + cubeCards.add(new DraftCube.CardIdentity("Careful Study","")); + cubeCards.add(new DraftCube.CardIdentity("Carrion Feeder","")); + cubeCards.add(new DraftCube.CardIdentity("Caves of Koilos","")); + cubeCards.add(new DraftCube.CardIdentity("Chain Lightning","")); + cubeCards.add(new DraftCube.CardIdentity("Chainer's Edict","")); + cubeCards.add(new DraftCube.CardIdentity("Chameleon Colossus","")); + cubeCards.add(new DraftCube.CardIdentity("Champion of the Parish","")); + cubeCards.add(new DraftCube.CardIdentity("Chandra Nalaar","")); + cubeCards.add(new DraftCube.CardIdentity("Chandra, Fire of Kaladesh","")); + cubeCards.add(new DraftCube.CardIdentity("Chandra, Pyromaster","")); + cubeCards.add(new DraftCube.CardIdentity("Chandra's Phoenix","")); + cubeCards.add(new DraftCube.CardIdentity("Char","")); + cubeCards.add(new DraftCube.CardIdentity("Chasm Skulker","")); + cubeCards.add(new DraftCube.CardIdentity("Chord of Calling","")); + cubeCards.add(new DraftCube.CardIdentity("Chromatic Lantern","")); + cubeCards.add(new DraftCube.CardIdentity("Chrome Mox","")); + cubeCards.add(new DraftCube.CardIdentity("City of Brass","")); + cubeCards.add(new DraftCube.CardIdentity("Clifftop Retreat","")); + cubeCards.add(new DraftCube.CardIdentity("Cloudgoat Ranger","")); + cubeCards.add(new DraftCube.CardIdentity("Coalition Relic","")); + cubeCards.add(new DraftCube.CardIdentity("Collected Company","")); + cubeCards.add(new DraftCube.CardIdentity("Compulsive Research","")); + cubeCards.add(new DraftCube.CardIdentity("Condemn","")); + cubeCards.add(new DraftCube.CardIdentity("Condescend","")); + cubeCards.add(new DraftCube.CardIdentity("Consecrated Sphinx","")); + cubeCards.add(new DraftCube.CardIdentity("Control Magic","")); + cubeCards.add(new DraftCube.CardIdentity("Corpse Dance","")); + cubeCards.add(new DraftCube.CardIdentity("Council's Judgment","")); + cubeCards.add(new DraftCube.CardIdentity("Counterspell","")); + cubeCards.add(new DraftCube.CardIdentity("Courser of Kruphix","")); + cubeCards.add(new DraftCube.CardIdentity("Crater's Claws","")); + cubeCards.add(new DraftCube.CardIdentity("Craterhoof Behemoth","")); + cubeCards.add(new DraftCube.CardIdentity("Crusade","")); + cubeCards.add(new DraftCube.CardIdentity("Crux of Fate","")); + cubeCards.add(new DraftCube.CardIdentity("Cryptic Command","")); + cubeCards.add(new DraftCube.CardIdentity("Cultivate","")); + cubeCards.add(new DraftCube.CardIdentity("Cunning Sparkmage","")); + cubeCards.add(new DraftCube.CardIdentity("Cursed Scroll","")); + cubeCards.add(new DraftCube.CardIdentity("Cyclonic Rift","")); + cubeCards.add(new DraftCube.CardIdentity("Damnation","")); + cubeCards.add(new DraftCube.CardIdentity("Dance of the Dead","")); + cubeCards.add(new DraftCube.CardIdentity("Dark Confidant","")); + cubeCards.add(new DraftCube.CardIdentity("Dark Depths","")); + cubeCards.add(new DraftCube.CardIdentity("Dark Petition","")); + cubeCards.add(new DraftCube.CardIdentity("Dark Ritual","")); + cubeCards.add(new DraftCube.CardIdentity("Day of Judgment","")); + cubeCards.add(new DraftCube.CardIdentity("Daze","")); + cubeCards.add(new DraftCube.CardIdentity("Deathrite Shaman","")); + cubeCards.add(new DraftCube.CardIdentity("Deceiver Exarch","")); + cubeCards.add(new DraftCube.CardIdentity("Deep Analysis","")); + cubeCards.add(new DraftCube.CardIdentity("Delver of Secrets","")); + cubeCards.add(new DraftCube.CardIdentity("Demonic Pact","")); + cubeCards.add(new DraftCube.CardIdentity("Den Protector","")); + cubeCards.add(new DraftCube.CardIdentity("Deranged Hermit","")); + cubeCards.add(new DraftCube.CardIdentity("Desecration Demon","")); + cubeCards.add(new DraftCube.CardIdentity("Devil's Play","")); + cubeCards.add(new DraftCube.CardIdentity("Diabolic Servitude","")); + cubeCards.add(new DraftCube.CardIdentity("Dictate of Heliod","")); + cubeCards.add(new DraftCube.CardIdentity("Dig Through Time","")); + cubeCards.add(new DraftCube.CardIdentity("Disciple of Bolas","")); + cubeCards.add(new DraftCube.CardIdentity("Disfigure","")); + cubeCards.add(new DraftCube.CardIdentity("Dismember","")); + cubeCards.add(new DraftCube.CardIdentity("Dismiss","")); + cubeCards.add(new DraftCube.CardIdentity("Dissipate","")); + cubeCards.add(new DraftCube.CardIdentity("Dissolve","")); + cubeCards.add(new DraftCube.CardIdentity("Divinity of Pride","")); + cubeCards.add(new DraftCube.CardIdentity("Domri Rade","")); + cubeCards.add(new DraftCube.CardIdentity("Doom Blade","")); + cubeCards.add(new DraftCube.CardIdentity("Doomed Necromancer","")); + cubeCards.add(new DraftCube.CardIdentity("Dragon Fodder","")); + cubeCards.add(new DraftCube.CardIdentity("Dragonlord Atarka","")); + cubeCards.add(new DraftCube.CardIdentity("Dragonlord Dromoka","")); + cubeCards.add(new DraftCube.CardIdentity("Dragonlord Ojutai","")); + cubeCards.add(new DraftCube.CardIdentity("Dragonlord Silumgar","")); + cubeCards.add(new DraftCube.CardIdentity("Dragonskull Summit","")); + cubeCards.add(new DraftCube.CardIdentity("Dread Return","")); + cubeCards.add(new DraftCube.CardIdentity("Dreadbore","")); + cubeCards.add(new DraftCube.CardIdentity("Dromoka's Command","")); + cubeCards.add(new DraftCube.CardIdentity("Drowned Catacomb","")); + cubeCards.add(new DraftCube.CardIdentity("Dualcaster Mage","")); + cubeCards.add(new DraftCube.CardIdentity("Dungeon Geists","")); + cubeCards.add(new DraftCube.CardIdentity("Duplicant","")); + cubeCards.add(new DraftCube.CardIdentity("Duress","")); + cubeCards.add(new DraftCube.CardIdentity("Edric, Spymaster of Trest","")); + cubeCards.add(new DraftCube.CardIdentity("Eight-and-a-Half-Tails","")); + cubeCards.add(new DraftCube.CardIdentity("Electrolyze","")); + cubeCards.add(new DraftCube.CardIdentity("Elesh Norn, Grand Cenobite","")); + cubeCards.add(new DraftCube.CardIdentity("Elite Vanguard","")); + cubeCards.add(new DraftCube.CardIdentity("Elixir of Immortality","")); + cubeCards.add(new DraftCube.CardIdentity("Elspeth Tirel","")); + cubeCards.add(new DraftCube.CardIdentity("Elspeth, Knight-Errant","")); + cubeCards.add(new DraftCube.CardIdentity("Elspeth, Sun's Champion","")); + cubeCards.add(new DraftCube.CardIdentity("Elves of Deep Shadow","")); + cubeCards.add(new DraftCube.CardIdentity("Elvish Mystic","")); + cubeCards.add(new DraftCube.CardIdentity("Emeria Angel","")); + cubeCards.add(new DraftCube.CardIdentity("Emrakul, the Aeons Torn","")); + cubeCards.add(new DraftCube.CardIdentity("Entomb","")); + cubeCards.add(new DraftCube.CardIdentity("Entreat the Angels","")); + cubeCards.add(new DraftCube.CardIdentity("Erebos, God of the Dead","")); + cubeCards.add(new DraftCube.CardIdentity("Erebos's Titan","")); + cubeCards.add(new DraftCube.CardIdentity("Essence Scatter","")); + cubeCards.add(new DraftCube.CardIdentity("Eternal Dragon","")); + cubeCards.add(new DraftCube.CardIdentity("Eternal Witness","")); + cubeCards.add(new DraftCube.CardIdentity("Eureka","")); + cubeCards.add(new DraftCube.CardIdentity("Everflowing Chalice","")); + cubeCards.add(new DraftCube.CardIdentity("Exalted Angel","")); + cubeCards.add(new DraftCube.CardIdentity("Exhume","")); + cubeCards.add(new DraftCube.CardIdentity("Explore","")); + cubeCards.add(new DraftCube.CardIdentity("Exquisite Firecraft","")); + cubeCards.add(new DraftCube.CardIdentity("Fact or Fiction","")); + cubeCards.add(new DraftCube.CardIdentity("Faith's Fetters","")); + cubeCards.add(new DraftCube.CardIdentity("Falkenrath Aristocrat","")); + cubeCards.add(new DraftCube.CardIdentity("Farseek","")); + cubeCards.add(new DraftCube.CardIdentity("Fauna Shaman","")); + cubeCards.add(new DraftCube.CardIdentity("Fertile Ground","")); + cubeCards.add(new DraftCube.CardIdentity("Fiend Hunter","")); + cubeCards.add(new DraftCube.CardIdentity("Fire // Ice","")); + cubeCards.add(new DraftCube.CardIdentity("Firebolt","")); + cubeCards.add(new DraftCube.CardIdentity("Firefist Striker","")); + cubeCards.add(new DraftCube.CardIdentity("Flame Slash","")); + cubeCards.add(new DraftCube.CardIdentity("Flametongue Kavu","")); + cubeCards.add(new DraftCube.CardIdentity("Flamewake Phoenix","")); + cubeCards.add(new DraftCube.CardIdentity("Fleecemane Lion","")); + cubeCards.add(new DraftCube.CardIdentity("Flickerwisp","")); + cubeCards.add(new DraftCube.CardIdentity("Flooded Strand","")); + cubeCards.add(new DraftCube.CardIdentity("Forbid","")); + cubeCards.add(new DraftCube.CardIdentity("Forbidden Alchemy","")); + cubeCards.add(new DraftCube.CardIdentity("Force of Will","")); + cubeCards.add(new DraftCube.CardIdentity("Force Spike","")); + cubeCards.add(new DraftCube.CardIdentity("Forked Bolt","")); + cubeCards.add(new DraftCube.CardIdentity("Frenzied Goblin","")); + cubeCards.add(new DraftCube.CardIdentity("Freyalise, Llanowar's Fury","")); + cubeCards.add(new DraftCube.CardIdentity("Frontline Medic","")); + cubeCards.add(new DraftCube.CardIdentity("Frost Titan","")); + cubeCards.add(new DraftCube.CardIdentity("Future Sight","")); + cubeCards.add(new DraftCube.CardIdentity("Fyndhorn Elves","")); + cubeCards.add(new DraftCube.CardIdentity("Gaea's Cradle","")); + cubeCards.add(new DraftCube.CardIdentity("Garruk Relentless","")); + cubeCards.add(new DraftCube.CardIdentity("Garruk Wildspeaker","")); + cubeCards.add(new DraftCube.CardIdentity("Garruk, Apex Predator","")); + cubeCards.add(new DraftCube.CardIdentity("Garruk, Caller of Beasts","")); + cubeCards.add(new DraftCube.CardIdentity("Garruk, Primal Hunter","")); + cubeCards.add(new DraftCube.CardIdentity("Gatekeeper of Malakir","")); + cubeCards.add(new DraftCube.CardIdentity("Gather the Townsfolk","")); + cubeCards.add(new DraftCube.CardIdentity("Geist of Saint Traft","")); + cubeCards.add(new DraftCube.CardIdentity("Genesis Wave","")); + cubeCards.add(new DraftCube.CardIdentity("Geralf's Messenger","")); + cubeCards.add(new DraftCube.CardIdentity("Ghor-Clan Rampager","")); + cubeCards.add(new DraftCube.CardIdentity("Gideon Jura","")); + cubeCards.add(new DraftCube.CardIdentity("Gifts Ungiven","")); + cubeCards.add(new DraftCube.CardIdentity("Gilded Lotus","")); + cubeCards.add(new DraftCube.CardIdentity("Gilt-Leaf Winnower","")); + cubeCards.add(new DraftCube.CardIdentity("Gitaxian Probe","")); + cubeCards.add(new DraftCube.CardIdentity("Glacial Fortress","")); + cubeCards.add(new DraftCube.CardIdentity("Glen Elendra Archmage","")); + cubeCards.add(new DraftCube.CardIdentity("Glorious Anthem","")); + cubeCards.add(new DraftCube.CardIdentity("Go for the Throat","")); + cubeCards.add(new DraftCube.CardIdentity("Goblin Bushwhacker","")); + cubeCards.add(new DraftCube.CardIdentity("Goblin Glory Chaser","")); + cubeCards.add(new DraftCube.CardIdentity("Goblin Guide","")); + cubeCards.add(new DraftCube.CardIdentity("Goblin Rabblemaster","")); + cubeCards.add(new DraftCube.CardIdentity("Godless Shrine","")); + cubeCards.add(new DraftCube.CardIdentity("Gore-House Chainwalker","")); + cubeCards.add(new DraftCube.CardIdentity("Grafted Wargear","")); + cubeCards.add(new DraftCube.CardIdentity("Grave Titan","")); + cubeCards.add(new DraftCube.CardIdentity("Gravecrawler","")); + cubeCards.add(new DraftCube.CardIdentity("Gray Merchant of Asphodel","")); + cubeCards.add(new DraftCube.CardIdentity("Greater Gargadon","")); + cubeCards.add(new DraftCube.CardIdentity("Green Sun's Zenith","")); + cubeCards.add(new DraftCube.CardIdentity("Grim Lavamancer","")); + cubeCards.add(new DraftCube.CardIdentity("Griselbrand","")); + cubeCards.add(new DraftCube.CardIdentity("Hall of Triumph","")); + cubeCards.add(new DraftCube.CardIdentity("Hallowed Fountain","")); + cubeCards.add(new DraftCube.CardIdentity("Hallowed Spiritkeeper","")); + cubeCards.add(new DraftCube.CardIdentity("Hammer of Purphoros","")); + cubeCards.add(new DraftCube.CardIdentity("Hangarback Walker","")); + cubeCards.add(new DraftCube.CardIdentity("Harbinger of the Tides","")); + cubeCards.add(new DraftCube.CardIdentity("Harmonize","")); + cubeCards.add(new DraftCube.CardIdentity("Hellrider","")); + cubeCards.add(new DraftCube.CardIdentity("Herald of Torment","")); + cubeCards.add(new DraftCube.CardIdentity("Hero of Bladehold","")); + cubeCards.add(new DraftCube.CardIdentity("Hero's Downfall","")); + cubeCards.add(new DraftCube.CardIdentity("Hidden Dragonslayer","")); + cubeCards.add(new DraftCube.CardIdentity("Hinterland Harbor","")); + cubeCards.add(new DraftCube.CardIdentity("Honor of the Pure","")); + cubeCards.add(new DraftCube.CardIdentity("Hordeling Outburst","")); + cubeCards.add(new DraftCube.CardIdentity("Hornet Queen","")); + cubeCards.add(new DraftCube.CardIdentity("Huntmaster of the Fells","")); + cubeCards.add(new DraftCube.CardIdentity("Hymn to Tourach","")); + cubeCards.add(new DraftCube.CardIdentity("Hypnotic Specter","")); + cubeCards.add(new DraftCube.CardIdentity("Imperial Recruiter","")); + cubeCards.add(new DraftCube.CardIdentity("Impulse","")); + cubeCards.add(new DraftCube.CardIdentity("Incinerate","")); + cubeCards.add(new DraftCube.CardIdentity("Indrik Stomphowler","")); + cubeCards.add(new DraftCube.CardIdentity("Inferno Titan","")); + cubeCards.add(new DraftCube.CardIdentity("Inquisition of Kozilek","")); + cubeCards.add(new DraftCube.CardIdentity("Into the Roil","")); + cubeCards.add(new DraftCube.CardIdentity("Ire Shaman","")); + cubeCards.add(new DraftCube.CardIdentity("Isamaru, Hound of Konda","")); + cubeCards.add(new DraftCube.CardIdentity("Isochron Scepter","")); + cubeCards.add(new DraftCube.CardIdentity("Isolated Chapel","")); + cubeCards.add(new DraftCube.CardIdentity("Izzet Charm","")); + cubeCards.add(new DraftCube.CardIdentity("Jace Beleren","")); + cubeCards.add(new DraftCube.CardIdentity("Jace, Architect of Thought","")); + cubeCards.add(new DraftCube.CardIdentity("Jace, the Mind Sculptor","")); + cubeCards.add(new DraftCube.CardIdentity("Jace, Vryn's Prodigy","")); + cubeCards.add(new DraftCube.CardIdentity("Jackal Pup","")); + cubeCards.add(new DraftCube.CardIdentity("Joraga Treespeaker","")); + cubeCards.add(new DraftCube.CardIdentity("Journey to Nowhere","")); + cubeCards.add(new DraftCube.CardIdentity("Kami of Ancient Law","")); + cubeCards.add(new DraftCube.CardIdentity("Karmic Guide","")); + cubeCards.add(new DraftCube.CardIdentity("Karn Liberated","")); + cubeCards.add(new DraftCube.CardIdentity("Karplusan Forest","")); + cubeCards.add(new DraftCube.CardIdentity("Keiga, the Tide Star","")); + cubeCards.add(new DraftCube.CardIdentity("Keranos, God of Storms","")); + cubeCards.add(new DraftCube.CardIdentity("Kiki-Jiki, Mirror Breaker","")); + cubeCards.add(new DraftCube.CardIdentity("Kiln Fiend","")); + cubeCards.add(new DraftCube.CardIdentity("Kiora, the Crashing Wave","")); + cubeCards.add(new DraftCube.CardIdentity("Kiora's Follower","")); + cubeCards.add(new DraftCube.CardIdentity("Kira, Great Glass-Spinner","")); + cubeCards.add(new DraftCube.CardIdentity("Kitchen Finks","")); + cubeCards.add(new DraftCube.CardIdentity("Kodama's Reach","")); + cubeCards.add(new DraftCube.CardIdentity("Kokusho, the Evening Star","")); + cubeCards.add(new DraftCube.CardIdentity("Kor Skyfisher","")); + cubeCards.add(new DraftCube.CardIdentity("Koth of the Hammer","")); + cubeCards.add(new DraftCube.CardIdentity("Kozilek, Butcher of Truth","")); + cubeCards.add(new DraftCube.CardIdentity("Krenko's Command","")); + cubeCards.add(new DraftCube.CardIdentity("Kytheon, Hero of Akros","")); + cubeCards.add(new DraftCube.CardIdentity("Land Tax","")); + cubeCards.add(new DraftCube.CardIdentity("Legacy's Allure","")); + cubeCards.add(new DraftCube.CardIdentity("Leonin Relic-Warder","")); + cubeCards.add(new DraftCube.CardIdentity("Lightning Bolt","")); + cubeCards.add(new DraftCube.CardIdentity("Lightning Greaves","")); + cubeCards.add(new DraftCube.CardIdentity("Lightning Helix","")); + cubeCards.add(new DraftCube.CardIdentity("Lightning Mauler","")); + cubeCards.add(new DraftCube.CardIdentity("Lightning Strike","")); + cubeCards.add(new DraftCube.CardIdentity("Liliana of the Veil","")); + cubeCards.add(new DraftCube.CardIdentity("Liliana Vess","")); + cubeCards.add(new DraftCube.CardIdentity("Liliana, Heretical Healer","")); + cubeCards.add(new DraftCube.CardIdentity("Lingering Souls","")); + cubeCards.add(new DraftCube.CardIdentity("Linvala, Keeper of Silence","")); + cubeCards.add(new DraftCube.CardIdentity("Living Death","")); + cubeCards.add(new DraftCube.CardIdentity("Llanowar Elves","")); + cubeCards.add(new DraftCube.CardIdentity("Llanowar Mentor","")); + cubeCards.add(new DraftCube.CardIdentity("Llanowar Wastes","")); + cubeCards.add(new DraftCube.CardIdentity("Looter il-Kor","")); + cubeCards.add(new DraftCube.CardIdentity("Lotleth Troll","")); + cubeCards.add(new DraftCube.CardIdentity("Lotus Cobra","")); + cubeCards.add(new DraftCube.CardIdentity("Loxodon Warhammer","")); + cubeCards.add(new DraftCube.CardIdentity("Maelstrom Pulse","")); + cubeCards.add(new DraftCube.CardIdentity("Magma Jet","")); + cubeCards.add(new DraftCube.CardIdentity("Makeshift Mannequin","")); + cubeCards.add(new DraftCube.CardIdentity("Malicious Affliction","")); + cubeCards.add(new DraftCube.CardIdentity("Man-o'-War","")); + cubeCards.add(new DraftCube.CardIdentity("Mana Confluence","")); + cubeCards.add(new DraftCube.CardIdentity("Mana Leak","")); + cubeCards.add(new DraftCube.CardIdentity("Mana Tithe","")); + cubeCards.add(new DraftCube.CardIdentity("Managorger Hydra","")); + cubeCards.add(new DraftCube.CardIdentity("Manic Vandal","")); + cubeCards.add(new DraftCube.CardIdentity("Marsh Flats","")); + cubeCards.add(new DraftCube.CardIdentity("Martial Coup","")); + cubeCards.add(new DraftCube.CardIdentity("Massacre Wurm","")); + cubeCards.add(new DraftCube.CardIdentity("Master of the Wild Hunt","")); + cubeCards.add(new DraftCube.CardIdentity("Master of Waves","")); + cubeCards.add(new DraftCube.CardIdentity("Meloku the Clouded Mirror","")); + cubeCards.add(new DraftCube.CardIdentity("Mentor of the Meek","")); + cubeCards.add(new DraftCube.CardIdentity("Merfolk Looter","")); + cubeCards.add(new DraftCube.CardIdentity("Midnight Banshee","")); + cubeCards.add(new DraftCube.CardIdentity("Mind Stone","")); + cubeCards.add(new DraftCube.CardIdentity("Mirari's Wake","")); + cubeCards.add(new DraftCube.CardIdentity("Mirran Crusader","")); + cubeCards.add(new DraftCube.CardIdentity("Miscalculation","")); + cubeCards.add(new DraftCube.CardIdentity("Mishra's Factory","")); + cubeCards.add(new DraftCube.CardIdentity("Misty Rainforest","")); + cubeCards.add(new DraftCube.CardIdentity("Mizzium Mortars","")); + cubeCards.add(new DraftCube.CardIdentity("Mogg Fanatic","")); + cubeCards.add(new DraftCube.CardIdentity("Mogg War Marshal","")); + cubeCards.add(new DraftCube.CardIdentity("Mogis's Marauder","")); + cubeCards.add(new DraftCube.CardIdentity("Monastery Mentor","")); + cubeCards.add(new DraftCube.CardIdentity("Monastery Swiftspear","")); + cubeCards.add(new DraftCube.CardIdentity("Mother of Runes","")); + cubeCards.add(new DraftCube.CardIdentity("Mox Diamond","")); + cubeCards.add(new DraftCube.CardIdentity("Mulldrifter","")); + cubeCards.add(new DraftCube.CardIdentity("Murderous Cut","")); + cubeCards.add(new DraftCube.CardIdentity("Mutavault","")); + cubeCards.add(new DraftCube.CardIdentity("Myr Battlesphere","")); + cubeCards.add(new DraftCube.CardIdentity("Mystic Snake","")); + cubeCards.add(new DraftCube.CardIdentity("Natural Order","")); + cubeCards.add(new DraftCube.CardIdentity("Nature's Lore","")); + cubeCards.add(new DraftCube.CardIdentity("Necromancy","")); + cubeCards.add(new DraftCube.CardIdentity("Negate","")); + cubeCards.add(new DraftCube.CardIdentity("Nekrataal","")); + cubeCards.add(new DraftCube.CardIdentity("Nicol Bolas, Planeswalker","")); + cubeCards.add(new DraftCube.CardIdentity("Nightveil Specter","")); + cubeCards.add(new DraftCube.CardIdentity("Nissa, Vastwood Seer","")); + cubeCards.add(new DraftCube.CardIdentity("Nissa, Worldwaker","")); + cubeCards.add(new DraftCube.CardIdentity("Noble Hierarch","")); + cubeCards.add(new DraftCube.CardIdentity("Nykthos, Shrine to Nyx","")); + cubeCards.add(new DraftCube.CardIdentity("Oblivion Ring","")); + cubeCards.add(new DraftCube.CardIdentity("Obstinate Baloth","")); + cubeCards.add(new DraftCube.CardIdentity("Ohran Viper","")); + cubeCards.add(new DraftCube.CardIdentity("Old Man of the Sea","")); + cubeCards.add(new DraftCube.CardIdentity("Olivia Voldaren","")); + cubeCards.add(new DraftCube.CardIdentity("Oona's Prowler","")); + cubeCards.add(new DraftCube.CardIdentity("Ophiomancer","")); + cubeCards.add(new DraftCube.CardIdentity("Opposition","")); + cubeCards.add(new DraftCube.CardIdentity("Oracle of Mul Daya","")); + cubeCards.add(new DraftCube.CardIdentity("Oust","")); + cubeCards.add(new DraftCube.CardIdentity("Outpost Siege","")); + cubeCards.add(new DraftCube.CardIdentity("Overgrown Battlement","")); + cubeCards.add(new DraftCube.CardIdentity("Overgrown Tomb","")); + cubeCards.add(new DraftCube.CardIdentity("Overrun","")); + cubeCards.add(new DraftCube.CardIdentity("Pack Rat","")); + cubeCards.add(new DraftCube.CardIdentity("Pact of Negation","")); + cubeCards.add(new DraftCube.CardIdentity("Parallax Wave","")); + cubeCards.add(new DraftCube.CardIdentity("Path to Exile","")); + cubeCards.add(new DraftCube.CardIdentity("Pestermite","")); + cubeCards.add(new DraftCube.CardIdentity("Phantasmal Image","")); + cubeCards.add(new DraftCube.CardIdentity("Phyrexian Arena","")); + cubeCards.add(new DraftCube.CardIdentity("Phyrexian Metamorph","")); + cubeCards.add(new DraftCube.CardIdentity("Phyrexian Obliterator","")); + cubeCards.add(new DraftCube.CardIdentity("Phyrexian Revoker","")); + cubeCards.add(new DraftCube.CardIdentity("Pillar of Flame","")); + cubeCards.add(new DraftCube.CardIdentity("Plateau","")); + cubeCards.add(new DraftCube.CardIdentity("Polluted Delta","")); + cubeCards.add(new DraftCube.CardIdentity("Polukranos, World Eater","")); + cubeCards.add(new DraftCube.CardIdentity("Ponder","")); + cubeCards.add(new DraftCube.CardIdentity("Porcelain Legionnaire","")); + cubeCards.add(new DraftCube.CardIdentity("Precinct Captain","")); + cubeCards.add(new DraftCube.CardIdentity("Precursor Golem","")); + cubeCards.add(new DraftCube.CardIdentity("Preordain","")); + cubeCards.add(new DraftCube.CardIdentity("Primal Command","")); + cubeCards.add(new DraftCube.CardIdentity("Primeval Titan","")); + cubeCards.add(new DraftCube.CardIdentity("Profane Command","")); + cubeCards.add(new DraftCube.CardIdentity("Progenitus","")); + cubeCards.add(new DraftCube.CardIdentity("Prophetic Bolt","")); + cubeCards.add(new DraftCube.CardIdentity("Prophetic Flamespeaker","")); + cubeCards.add(new DraftCube.CardIdentity("Psychatog","")); + cubeCards.add(new DraftCube.CardIdentity("Purphoros, God of the Forge","")); + cubeCards.add(new DraftCube.CardIdentity("Qasali Pridemage","")); + cubeCards.add(new DraftCube.CardIdentity("Raise the Alarm","")); + cubeCards.add(new DraftCube.CardIdentity("Rakdos's Return","")); + cubeCards.add(new DraftCube.CardIdentity("Ral Zarek","")); + cubeCards.add(new DraftCube.CardIdentity("Rampaging Baloths","")); + cubeCards.add(new DraftCube.CardIdentity("Rampant Growth","")); + cubeCards.add(new DraftCube.CardIdentity("Ranger of Eos","")); + cubeCards.add(new DraftCube.CardIdentity("Ratchet Bomb","")); + cubeCards.add(new DraftCube.CardIdentity("Ravages of War","")); + cubeCards.add(new DraftCube.CardIdentity("Read the Bones","")); + cubeCards.add(new DraftCube.CardIdentity("Reanimate","")); + cubeCards.add(new DraftCube.CardIdentity("Reclamation Sage","")); + cubeCards.add(new DraftCube.CardIdentity("Recurring Nightmare","")); + cubeCards.add(new DraftCube.CardIdentity("Reflecting Pool","")); + cubeCards.add(new DraftCube.CardIdentity("Regrowth","")); + cubeCards.add(new DraftCube.CardIdentity("Remand","")); + cubeCards.add(new DraftCube.CardIdentity("Remove Soul","")); + cubeCards.add(new DraftCube.CardIdentity("Repeal","")); + cubeCards.add(new DraftCube.CardIdentity("Restoration Angel","")); + cubeCards.add(new DraftCube.CardIdentity("Reveillark","")); + cubeCards.add(new DraftCube.CardIdentity("Rift Bolt","")); + cubeCards.add(new DraftCube.CardIdentity("Riftwing Cloudskate","")); + cubeCards.add(new DraftCube.CardIdentity("Rishadan Port","")); + cubeCards.add(new DraftCube.CardIdentity("Roast","")); + cubeCards.add(new DraftCube.CardIdentity("Rofellos, Llanowar Emissary","")); + cubeCards.add(new DraftCube.CardIdentity("Rootbound Crag","")); + cubeCards.add(new DraftCube.CardIdentity("Rotting Rats","")); + cubeCards.add(new DraftCube.CardIdentity("Rune-Scarred Demon","")); + cubeCards.add(new DraftCube.CardIdentity("Sacred Foundry","")); + cubeCards.add(new DraftCube.CardIdentity("Sakura-Tribe Elder","")); + cubeCards.add(new DraftCube.CardIdentity("Sarkhan, the Dragonspeaker","")); + cubeCards.add(new DraftCube.CardIdentity("Savannah","")); + cubeCards.add(new DraftCube.CardIdentity("Scalding Tarn","")); + cubeCards.add(new DraftCube.CardIdentity("Scavenging Ooze","")); + cubeCards.add(new DraftCube.CardIdentity("Scrubland","")); + cubeCards.add(new DraftCube.CardIdentity("Sea Gate Oracle","")); + cubeCards.add(new DraftCube.CardIdentity("Seal of Fire","")); + cubeCards.add(new DraftCube.CardIdentity("Search for Tomorrow","")); + cubeCards.add(new DraftCube.CardIdentity("Searing Spear","")); + cubeCards.add(new DraftCube.CardIdentity("Secure the Wastes","")); + cubeCards.add(new DraftCube.CardIdentity("Seeker of the Way","")); + cubeCards.add(new DraftCube.CardIdentity("Sensei's Divining Top","")); + cubeCards.add(new DraftCube.CardIdentity("Serendib Efreet","")); + cubeCards.add(new DraftCube.CardIdentity("Serum Visions","")); + cubeCards.add(new DraftCube.CardIdentity("Shadowmage Infiltrator","")); + cubeCards.add(new DraftCube.CardIdentity("Shallow Grave","")); + cubeCards.add(new DraftCube.CardIdentity("Shardless Agent","")); + cubeCards.add(new DraftCube.CardIdentity("Sheoldred, Whispering One","")); + cubeCards.add(new DraftCube.CardIdentity("Shivan Reef","")); + cubeCards.add(new DraftCube.CardIdentity("Show and Tell","")); + cubeCards.add(new DraftCube.CardIdentity("Shriekmaw","")); + cubeCards.add(new DraftCube.CardIdentity("Sidisi, Undead Vizier","")); + cubeCards.add(new DraftCube.CardIdentity("Siege-Gang Commander","")); + cubeCards.add(new DraftCube.CardIdentity("Silverblade Paladin","")); + cubeCards.add(new DraftCube.CardIdentity("Sin Collector","")); + cubeCards.add(new DraftCube.CardIdentity("Skinrender","")); + cubeCards.add(new DraftCube.CardIdentity("Skullcrack","")); + cubeCards.add(new DraftCube.CardIdentity("Slagstorm","")); + cubeCards.add(new DraftCube.CardIdentity("Slaughter Pact","")); + cubeCards.add(new DraftCube.CardIdentity("Snapcaster Mage","")); + cubeCards.add(new DraftCube.CardIdentity("Sneak Attack","")); + cubeCards.add(new DraftCube.CardIdentity("Soldier of the Pantheon","")); + cubeCards.add(new DraftCube.CardIdentity("Solemn Simulacrum","")); + cubeCards.add(new DraftCube.CardIdentity("Song of the Dryads","")); + cubeCards.add(new DraftCube.CardIdentity("Sorin Markov","")); + cubeCards.add(new DraftCube.CardIdentity("Sorin, Solemn Visitor","")); + cubeCards.add(new DraftCube.CardIdentity("Soulfire Grand Master","")); + cubeCards.add(new DraftCube.CardIdentity("Sower of Temptation","")); + cubeCards.add(new DraftCube.CardIdentity("Spear of Heliod","")); + cubeCards.add(new DraftCube.CardIdentity("Spectral Procession","")); + cubeCards.add(new DraftCube.CardIdentity("Spellskite","")); + cubeCards.add(new DraftCube.CardIdentity("Spell Pierce","")); + cubeCards.add(new DraftCube.CardIdentity("Sphere of the Suns","")); + cubeCards.add(new DraftCube.CardIdentity("Sphinx's Revelation","")); + cubeCards.add(new DraftCube.CardIdentity("Spikeshot Elder","")); + cubeCards.add(new DraftCube.CardIdentity("Splinter Twin","")); + cubeCards.add(new DraftCube.CardIdentity("Staggershock","")); + cubeCards.add(new DraftCube.CardIdentity("Steam Vents","")); + cubeCards.add(new DraftCube.CardIdentity("Stoke the Flames","")); + cubeCards.add(new DraftCube.CardIdentity("Stomping Ground","")); + cubeCards.add(new DraftCube.CardIdentity("Stormbreath Dragon","")); + cubeCards.add(new DraftCube.CardIdentity("Stormtide Leviathan","")); + cubeCards.add(new DraftCube.CardIdentity("Stratus Dancer","")); + cubeCards.add(new DraftCube.CardIdentity("Stroke of Genius","")); + cubeCards.add(new DraftCube.CardIdentity("Stromkirk Noble","")); + cubeCards.add(new DraftCube.CardIdentity("Student of Warfare","")); + cubeCards.add(new DraftCube.CardIdentity("Sublime Archangel","")); + cubeCards.add(new DraftCube.CardIdentity("Sulfur Falls","")); + cubeCards.add(new DraftCube.CardIdentity("Sulfurous Springs","")); + cubeCards.add(new DraftCube.CardIdentity("Summoning Trap","")); + cubeCards.add(new DraftCube.CardIdentity("Sun Titan","")); + cubeCards.add(new DraftCube.CardIdentity("Sundering Titan","")); + cubeCards.add(new DraftCube.CardIdentity("Sunpetal Grove","")); + cubeCards.add(new DraftCube.CardIdentity("Supreme Verdict","")); + cubeCards.add(new DraftCube.CardIdentity("Surrak, the Hunt Caller","")); + cubeCards.add(new DraftCube.CardIdentity("Swords to Plowshares","")); + cubeCards.add(new DraftCube.CardIdentity("Sylvan Caryatid","")); + cubeCards.add(new DraftCube.CardIdentity("Sylvan Library","")); + cubeCards.add(new DraftCube.CardIdentity("Taiga","")); + cubeCards.add(new DraftCube.CardIdentity("Talrand, Sky Summoner","")); + cubeCards.add(new DraftCube.CardIdentity("Tamiyo, the Moon Sage","")); + cubeCards.add(new DraftCube.CardIdentity("Tangle Wire","")); + cubeCards.add(new DraftCube.CardIdentity("Tarmogoyf","")); + cubeCards.add(new DraftCube.CardIdentity("Tasigur, the Golden Fang","")); + cubeCards.add(new DraftCube.CardIdentity("Tectonic Edge","")); + cubeCards.add(new DraftCube.CardIdentity("Teferi, Mage of Zhalfir","")); + cubeCards.add(new DraftCube.CardIdentity("Temple Garden","")); + cubeCards.add(new DraftCube.CardIdentity("Temple of Abandon","")); + cubeCards.add(new DraftCube.CardIdentity("Temple of Deceit","")); + cubeCards.add(new DraftCube.CardIdentity("Temple of Enlightenment","")); + cubeCards.add(new DraftCube.CardIdentity("Temple of Epiphany","")); + cubeCards.add(new DraftCube.CardIdentity("Temple of Malady","")); + cubeCards.add(new DraftCube.CardIdentity("Temple of Malice","")); + cubeCards.add(new DraftCube.CardIdentity("Temple of Mystery","")); + cubeCards.add(new DraftCube.CardIdentity("Temple of Plenty","")); + cubeCards.add(new DraftCube.CardIdentity("Temple of Silence","")); + cubeCards.add(new DraftCube.CardIdentity("Temple of Triumph","")); + cubeCards.add(new DraftCube.CardIdentity("Tempt with Vengeance","")); + cubeCards.add(new DraftCube.CardIdentity("Terastodon","")); + cubeCards.add(new DraftCube.CardIdentity("Terminate","")); + cubeCards.add(new DraftCube.CardIdentity("Terminus","")); + cubeCards.add(new DraftCube.CardIdentity("Thalia, Guardian of Thraben","")); + cubeCards.add(new DraftCube.CardIdentity("Thassa, God of the Sea","")); + cubeCards.add(new DraftCube.CardIdentity("Thespian's Stage","")); + cubeCards.add(new DraftCube.CardIdentity("Thoughtseize","")); + cubeCards.add(new DraftCube.CardIdentity("Thragtusk","")); + cubeCards.add(new DraftCube.CardIdentity("Thran Dynamo","")); + cubeCards.add(new DraftCube.CardIdentity("Through the Breach","")); + cubeCards.add(new DraftCube.CardIdentity("Thrun, the Last Troll","")); + cubeCards.add(new DraftCube.CardIdentity("Thunderbreak Regent","")); + cubeCards.add(new DraftCube.CardIdentity("Thundermaw Hellkite","")); + cubeCards.add(new DraftCube.CardIdentity("Tidehollow Sculler","")); + cubeCards.add(new DraftCube.CardIdentity("Time Warp","")); + cubeCards.add(new DraftCube.CardIdentity("Tooth and Nail","")); + cubeCards.add(new DraftCube.CardIdentity("Toxic Deluge","")); + cubeCards.add(new DraftCube.CardIdentity("Treachery","")); + cubeCards.add(new DraftCube.CardIdentity("Tropical Island","")); + cubeCards.add(new DraftCube.CardIdentity("Trygon Predator","")); + cubeCards.add(new DraftCube.CardIdentity("Tundra","")); + cubeCards.add(new DraftCube.CardIdentity("Ugin, the Spirit Dragon","")); + cubeCards.add(new DraftCube.CardIdentity("Ulamog, the Infinite Gyre","")); + cubeCards.add(new DraftCube.CardIdentity("Ultimate Price","")); + cubeCards.add(new DraftCube.CardIdentity("Unburial Rites","")); + cubeCards.add(new DraftCube.CardIdentity("Underground River","")); + cubeCards.add(new DraftCube.CardIdentity("Underground Sea","")); + cubeCards.add(new DraftCube.CardIdentity("Underworld Connections","")); + cubeCards.add(new DraftCube.CardIdentity("Unexpectedly Absent","")); + cubeCards.add(new DraftCube.CardIdentity("Upheaval","")); + cubeCards.add(new DraftCube.CardIdentity("Utopia Sprawl","")); + cubeCards.add(new DraftCube.CardIdentity("Vampire Hexmage","")); + cubeCards.add(new DraftCube.CardIdentity("Vampire Nighthawk","")); + cubeCards.add(new DraftCube.CardIdentity("Vedalken Shackles","")); + cubeCards.add(new DraftCube.CardIdentity("Vendilion Clique","")); + cubeCards.add(new DraftCube.CardIdentity("Vengevine","")); + cubeCards.add(new DraftCube.CardIdentity("Venser, Shaper Savant","")); + cubeCards.add(new DraftCube.CardIdentity("Venser, the Sojourner","")); + cubeCards.add(new DraftCube.CardIdentity("Verdant Catacombs","")); + cubeCards.add(new DraftCube.CardIdentity("Vindicate","")); + cubeCards.add(new DraftCube.CardIdentity("Volcanic Island","")); + cubeCards.add(new DraftCube.CardIdentity("Volrath's Stronghold","")); + cubeCards.add(new DraftCube.CardIdentity("Voyaging Satyr","")); + cubeCards.add(new DraftCube.CardIdentity("Vraska the Unseen","")); + cubeCards.add(new DraftCube.CardIdentity("Wake Thrasher","")); + cubeCards.add(new DraftCube.CardIdentity("Wall of Blossoms","")); + cubeCards.add(new DraftCube.CardIdentity("Wall of Omens","")); + cubeCards.add(new DraftCube.CardIdentity("Wall of Roots","")); + cubeCards.add(new DraftCube.CardIdentity("Warleader's Helix","")); + cubeCards.add(new DraftCube.CardIdentity("Waterfront Bouncer","")); + cubeCards.add(new DraftCube.CardIdentity("Watery Grave","")); + cubeCards.add(new DraftCube.CardIdentity("Whip of Erebos","")); + cubeCards.add(new DraftCube.CardIdentity("Whisperwood Elemental","")); + cubeCards.add(new DraftCube.CardIdentity("Wild Mongrel","")); + cubeCards.add(new DraftCube.CardIdentity("Windbrisk Heights","")); + cubeCards.add(new DraftCube.CardIdentity("Windswept Heath","")); + cubeCards.add(new DraftCube.CardIdentity("Winter Orb","")); + cubeCards.add(new DraftCube.CardIdentity("Wolfir Silverheart","")); + cubeCards.add(new DraftCube.CardIdentity("Wood Elves","")); + cubeCards.add(new DraftCube.CardIdentity("Wooded Foothills","")); + cubeCards.add(new DraftCube.CardIdentity("Woodfall Primus","")); + cubeCards.add(new DraftCube.CardIdentity("Woodland Bellower","")); + cubeCards.add(new DraftCube.CardIdentity("Woodland Cemetery","")); + cubeCards.add(new DraftCube.CardIdentity("Worn Powerstone","")); + cubeCards.add(new DraftCube.CardIdentity("Wrath of God","")); + cubeCards.add(new DraftCube.CardIdentity("Wurmcoil Engine","")); + cubeCards.add(new DraftCube.CardIdentity("Xenagos, the Reveler","")); + cubeCards.add(new DraftCube.CardIdentity("Yavimaya Coast","")); + cubeCards.add(new DraftCube.CardIdentity("Yavimaya Elder","")); + cubeCards.add(new DraftCube.CardIdentity("Yosei, the Morning Star","")); + cubeCards.add(new DraftCube.CardIdentity("Young Pyromancer","")); + cubeCards.add(new DraftCube.CardIdentity("Zealous Conscripts","")); + } +} diff --git a/Mage.Server.Plugins/Mage.Tournament.Constructed/pom.xml b/Mage.Server.Plugins/Mage.Tournament.Constructed/pom.xml index 884159dba8a..df970bfe867 100644 --- a/Mage.Server.Plugins/Mage.Tournament.Constructed/pom.xml +++ b/Mage.Server.Plugins/Mage.Tournament.Constructed/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-tournament-constructed diff --git a/Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml b/Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml index 30abbd2009c..94f10534af6 100644 --- a/Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml +++ b/Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.3 + 1.4.5 mage-tournament-sealed diff --git a/Mage.Server.Plugins/pom.xml b/Mage.Server.Plugins/pom.xml index 49073190dca..2ba6c35a8ac 100644 --- a/Mage.Server.Plugins/pom.xml +++ b/Mage.Server.Plugins/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.3 + 1.4.5 mage-server-plugins @@ -17,9 +17,10 @@ Mage.Deck.Constructed Mage.Deck.Limited - Mage.Game.CommanderDuel + Mage.Game.CommanderDuel Mage.Game.CommanderFreeForAll Mage.Game.FreeForAll + Mage.Game.MomirDuel Mage.Game.TinyLeadersDuel Mage.Game.TwoPlayerDuel Mage.Player.AI diff --git a/Mage.Server/config/config.xml b/Mage.Server/config/config.xml index 41ae2e3bfff..f043debc6a5 100644 --- a/Mage.Server/config/config.xml +++ b/Mage.Server/config/config.xml @@ -49,6 +49,7 @@ + @@ -65,16 +66,20 @@ + + - + + + @@ -82,14 +87,16 @@ - + - - + + + + diff --git a/Mage.Server/pom.xml b/Mage.Server/pom.xml index a3b4db6ffdf..60418e808d1 100644 --- a/Mage.Server/pom.xml +++ b/Mage.Server/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.3 + 1.4.5 mage-server @@ -142,6 +142,12 @@ ${project.version} runtime + + ${project.groupId} + mage-game-momirduel + ${project.version} + runtime + diff --git a/Mage.Server/release/config/config.xml b/Mage.Server/release/config/config.xml index a7e5eaa0a4d..b4d0356c3fc 100644 --- a/Mage.Server/release/config/config.xml +++ b/Mage.Server/release/config/config.xml @@ -28,6 +28,7 @@ + @@ -44,16 +45,20 @@ + + - + + + @@ -61,14 +66,16 @@ - + - - + + + + diff --git a/Mage.Server/src/main/java/mage/server/Main.java b/Mage.Server/src/main/java/mage/server/Main.java index d9f8aec6c2b..7e83044274d 100644 --- a/Mage.Server/src/main/java/mage/server/Main.java +++ b/Mage.Server/src/main/java/mage/server/Main.java @@ -166,12 +166,9 @@ public class Main { else { logger.fatal("Unable to start MAGE server - another server is already started"); } - } catch (IOException ex) { - logger.fatal("Failed to start server - " + connection.toString(), ex); } catch (Exception ex) { logger.fatal("Failed to start server - " + connection.toString(), ex); } - } static void initStatistics() { diff --git a/Mage.Server/src/main/java/mage/server/Session.java b/Mage.Server/src/main/java/mage/server/Session.java index c705ffd740a..9a03b6e0e0f 100644 --- a/Mage.Server/src/main/java/mage/server/Session.java +++ b/Mage.Server/src/main/java/mage/server/Session.java @@ -36,6 +36,7 @@ import java.util.concurrent.locks.ReentrantLock; import java.util.regex.Matcher; import java.util.regex.Pattern; import mage.MageException; +import mage.constants.Constants; import mage.interfaces.callback.ClientCallback; import mage.players.net.UserData; import mage.players.net.UserGroup; @@ -91,15 +92,15 @@ public class Session { return "User name Admin already in use"; } if (userName.length() > ConfigSettings.getInstance().getMaxUserNameLength()) { - return new StringBuilder("User name may not be longer than ").append(ConfigSettings.getInstance().getMaxUserNameLength()).append(" characters").toString(); + return "User name may not be longer than " + ConfigSettings.getInstance().getMaxUserNameLength() + " characters"; } if (userName.length() < ConfigSettings.getInstance().getMinUserNameLength()) { - return new StringBuilder("User name may not be shorter than ").append(ConfigSettings.getInstance().getMinUserNameLength()).append(" characters").toString(); + return "User name may not be shorter than " + ConfigSettings.getInstance().getMinUserNameLength() + " characters"; } Pattern p = Pattern.compile(ConfigSettings.getInstance().getUserNamePattern(), Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(userName); if (m.find()) { - return new StringBuilder("User name '").append(userName).append("' includes not allowed characters: use a-z, A-Z and 0-9").toString(); + return "User name '" + userName + "' includes not allowed characters: use a-z, A-Z and 0-9"; } User user = UserManager.getInstance().createUser(userName, host); boolean reconnect = false; @@ -117,11 +118,11 @@ public class Session { SessionManager.getInstance().disconnect(user.getSessionId(), DisconnectReason.ConnectingOtherInstance); } } else { - return new StringBuilder("User name ").append(userName).append(" already in use (or your IP address changed)").toString(); + return "User name " + userName + " already in use (or your IP address changed)"; } } if (!UserManager.getInstance().connectToSession(sessionId, user.getId())) { - return new StringBuilder("Error connecting ").append(userName).toString(); + return "Error connecting " + userName; } this.userId = user.getId(); if (reconnect) { // must be connected to receive the message @@ -157,7 +158,11 @@ public class Session { } else { user.getUserData().update(userData); } - if (user.getUserData().getAvatarId() == 51) { + if (user.getUserData().getAvatarId() < Constants.MIN_AVATAR_ID + || user.getUserData().getAvatarId() > Constants.MAX_AVATAR_ID) { + user.getUserData().setAvatarId(Constants.DEFAULT_AVATAR_ID); + } + if (user.getUserData().getAvatarId() == 11) { user.getUserData().setAvatarId(updateAvatar(user.getName())); } return true; @@ -169,22 +174,16 @@ public class Session { //TODO: move to separate class //TODO: add for checking for private key switch (userName) { - case "nantuko": - return 1000; case "North": return 1006; case "BetaSteward": return 1008; - case "loki": - return 1012; - case "Ayrat": - return 1018; case "Bandit": return 1020; - case "Wehk": - return 66; + case "fireshoes": + return 1021; } - return 51; + return 11; } public String getId() { diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java index 30fbe4fcd17..07a5763a51a 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -228,7 +228,7 @@ public class GameController implements GameCallback { try { switch (event.getQueryType()) { case ASK: - ask(event.getPlayerId(), event.getMessage()); + ask(event.getPlayerId(), event.getMessage(), event.getOptions()); break; case PICK_TARGET: target(event.getPlayerId(), event.getMessage(), event.getCards(), event.getPerms(), event.getTargets(), event.isRequired(), event.getOptions()); @@ -582,7 +582,7 @@ public class GameController implements GameCallback { } break; default: - game.sendPlayerAction(playerAction, getPlayerId(userId)); + game.sendPlayerAction(playerAction, getPlayerId(userId), data); } } @@ -774,11 +774,11 @@ public class GameController implements GameCallback { // TODO: inform watchers about game end and who won } - private synchronized void ask(UUID playerId, final String question) throws MageException { + private synchronized void ask(UUID playerId, final String question, final Map options) throws MageException { perform(playerId, new Command() { @Override public void execute(UUID playerId) { - getGameSession(playerId).ask(question); + getGameSession(playerId).ask(question, options); } }); @@ -825,8 +825,11 @@ public class GameController implements GameCallback { @Override public void execute(UUID playerId) { if (cards != null) { - Zone targetZone = (Zone) options.get("targetZone"); - boolean showFaceDown = targetZone != null && targetZone.equals(Zone.PICK); + // Zone targetZone = (Zone) options.get("targetZone"); + // Are there really situations where a player selects from a list of face down cards? + // So always show face up for selection + // boolean showFaceDown = targetZone != null && targetZone.equals(Zone.PICK); + boolean showFaceDown = true; getGameSession(playerId).target(question, new CardsView(game, cards.getCards(game), showFaceDown), targets, required, options); } else if (perms != null) { CardsView permsView = new CardsView(); @@ -846,7 +849,8 @@ public class GameController implements GameCallback { perform(playerId, new Command() { @Override public void execute(UUID playerId) { - getGameSession(playerId).target(question, new CardsView(abilities, game), null, required, options); + CardsView cardsView = new CardsView(abilities, game); + getGameSession(playerId).target(question, cardsView, null, required, options); } }); } diff --git a/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java b/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java index 157211555e0..2f93e943768 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java +++ b/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java @@ -78,11 +78,11 @@ public class GameSessionPlayer extends GameSessionWatcher { super.CleanUp(); } - public void ask(final String question) { + public void ask(final String question, final Map options) { if (!killed) { User user = UserManager.getInstance().getUser(userId); if (user != null) { - user.fireCallback(new ClientCallback("gameAsk", game.getId(), new GameClientMessage(getGameView(), question))); + user.fireCallback(new ClientCallback("gameAsk", game.getId(), new GameClientMessage(getGameView(), question, options))); } } } diff --git a/Mage.Server/src/main/java/mage/server/game/GamesRoomImpl.java b/Mage.Server/src/main/java/mage/server/game/GamesRoomImpl.java index 63edac13488..9afcea78466 100644 --- a/Mage.Server/src/main/java/mage/server/game/GamesRoomImpl.java +++ b/Mage.Server/src/main/java/mage/server/game/GamesRoomImpl.java @@ -228,13 +228,15 @@ class TableListSorter implements Comparator { @Override public int compare(Table one, Table two) { - if (!one.getState().equals(TableState.SIDEBOARDING) && !one.getState().equals(TableState.DUELING)) { - if (one.getState().compareTo(two.getState()) != 0) { - return one.getState().compareTo(two.getState()); - } - } else if (!two.getState().equals(TableState.SIDEBOARDING) && !two.getState().equals(TableState.DUELING)) { - if (one.getState().compareTo(two.getState()) != 0) { - return one.getState().compareTo(two.getState()); + if (one.getState() != null && two.getState() != null) { + if (!TableState.SIDEBOARDING.equals(one.getState()) && !TableState.DUELING.equals(one.getState())) { + if (one.getState().compareTo(two.getState()) != 0) { + return one.getState().compareTo(two.getState()); + } + } else if (!TableState.SIDEBOARDING.equals(two.getState()) && !TableState.DUELING.equals(two.getState())) { + if (one.getState().compareTo(two.getState()) != 0) { + return one.getState().compareTo(two.getState()); + } } } if (two.getEndTime() != null) { diff --git a/Mage.Sets/pom.xml b/Mage.Sets/pom.xml index a206bff7596..ab84711c0db 100644 --- a/Mage.Sets/pom.xml +++ b/Mage.Sets/pom.xml @@ -7,7 +7,7 @@ org.mage mage-root - 1.4.3 + 1.4.5 org.mage diff --git a/Mage.Sets/src/mage/sets/BattleForZendikar.java b/Mage.Sets/src/mage/sets/BattleForZendikar.java index b6dc6ad2d77..f21179f9746 100644 --- a/Mage.Sets/src/mage/sets/BattleForZendikar.java +++ b/Mage.Sets/src/mage/sets/BattleForZendikar.java @@ -25,18 +25,21 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets; +import java.util.ArrayList; import java.util.GregorianCalendar; +import java.util.List; import mage.cards.ExpansionSet; +import mage.cards.repository.CardCriteria; +import mage.cards.repository.CardInfo; +import mage.cards.repository.CardRepository; import mage.constants.SetType; /** * * @author fireshoes */ - public class BattleForZendikar extends ExpansionSet { private static final BattleForZendikar fINSTANCE = new BattleForZendikar(); @@ -45,16 +48,33 @@ public class BattleForZendikar extends ExpansionSet { return fINSTANCE; } + List savedSpecialLand = new ArrayList<>(); + private BattleForZendikar() { super("Battle for Zendikar", "BFZ", "mage.sets.battleforzendikar", new GregorianCalendar(2015, 10, 2).getTime(), SetType.EXPANSION); this.blockName = "Battle for Zendikar"; this.hasBoosters = true; this.hasBasicLands = true; this.numBoosterLands = 1; + this.ratioBoosterSpecialLand = 20; // Approximately as rare as opening a foil mythic = 8 * 6 = ~every 48th booster includes one + // I set it to 20 to get it more often this.numBoosterCommon = 10; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 8; + this.numBoosterSpecial = 0; } + @Override + public List getSpecialLand() { + List specialLand = new ArrayList<>(); + if (savedSpecialLand.isEmpty()) { + CardCriteria criteria = new CardCriteria(); + criteria.setCodes("EXP"); + specialLand.addAll(CardRepository.instance.findCards(criteria)); + } + + specialLand.addAll(savedSpecialLand); + return specialLand; + } } diff --git a/Mage.Sets/src/mage/sets/Chronicles.java b/Mage.Sets/src/mage/sets/Chronicles.java new file mode 100644 index 00000000000..6f24be32909 --- /dev/null +++ b/Mage.Sets/src/mage/sets/Chronicles.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets; + +import java.util.GregorianCalendar; +import mage.cards.ExpansionSet; +import mage.constants.SetType; + +/** + * + * @author LevelX2 + */ +public class Chronicles extends ExpansionSet { + + private static final Chronicles fINSTANCE = new Chronicles(); + + public static Chronicles getInstance() { + return fINSTANCE; + } + + private Chronicles() { + super("Chronicles", "CHR", "mage.sets.chronicles", new GregorianCalendar(1995, 6, 1).getTime(), SetType.SUPPLEMENTAL); + this.blockName = "Reprint"; + this.hasBasicLands = false; + this.hasBoosters = true; + this.numBoosterLands = 0; + this.numBoosterCommon = 9; + this.numBoosterUncommon = 2; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 0; + } + +} diff --git a/Mage.Sets/src/mage/sets/Commander2015.java b/Mage.Sets/src/mage/sets/Commander2015.java new file mode 100644 index 00000000000..d1069bda220 --- /dev/null +++ b/Mage.Sets/src/mage/sets/Commander2015.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets; + +import java.util.GregorianCalendar; +import mage.cards.ExpansionSet; +import mage.constants.SetType; + +/** + * + * @author fireshoes + */ + +public class Commander2015 extends ExpansionSet { + + private static final Commander2015 fINSTANCE = new Commander2015(); + + public static Commander2015 getInstance() { + return fINSTANCE; + } + + private Commander2015() { + super("Commander 2015 Edition", "C15", "mage.sets.commander2015", new GregorianCalendar(2015, 11, 13).getTime(), SetType.SUPPLEMENTAL); + this.blockName = "Command Zone"; + } + +} diff --git a/Mage.Sets/src/mage/sets/FateReforged.java b/Mage.Sets/src/mage/sets/FateReforged.java index 76d31b292a2..d3359435df5 100644 --- a/Mage.Sets/src/mage/sets/FateReforged.java +++ b/Mage.Sets/src/mage/sets/FateReforged.java @@ -57,7 +57,7 @@ public class FateReforged extends ExpansionSet { super("Fate Reforged", "FRF", "mage.sets.fatereforged", new GregorianCalendar(2015, 1, 23).getTime(), SetType.EXPANSION); this.blockName = "Khans of Tarkir"; this.parentSet = KhansOfTarkir.getInstance(); - this.hasBasicLands = false; + this.hasBasicLands = true; this.hasBoosters = true; this.numBoosterSpecial = 1; this.numBoosterLands = 0; diff --git a/Mage.Sets/src/mage/sets/Gatecrash.java b/Mage.Sets/src/mage/sets/Gatecrash.java index 46679ecbbfc..9a89355f6ea 100644 --- a/Mage.Sets/src/mage/sets/Gatecrash.java +++ b/Mage.Sets/src/mage/sets/Gatecrash.java @@ -44,15 +44,15 @@ public class Gatecrash extends ExpansionSet { } private Gatecrash() { - super("Gatecrash", "GTC", "mage.sets.gatecrash", new GregorianCalendar(2013, 2, 01).getTime(), SetType.EXPANSION); + super("Gatecrash", "GTC", "mage.sets.gatecrash", new GregorianCalendar(2013, 2, 1).getTime(), SetType.EXPANSION); this.blockName = "Return to Ravnica"; + this.parentSet = ReturnToRavnica.getInstance(); + this.hasBasicLands = false; this.hasBoosters = true; this.numBoosterLands = 1; this.numBoosterCommon = 10; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 8; - this.parentSet = ReturnToRavnica.getInstance(); - this.hasBasicLands = false; } } diff --git a/Mage.Sets/src/mage/sets/JourneyIntoNyx.java b/Mage.Sets/src/mage/sets/JourneyIntoNyx.java index c5252356ea3..18365532892 100644 --- a/Mage.Sets/src/mage/sets/JourneyIntoNyx.java +++ b/Mage.Sets/src/mage/sets/JourneyIntoNyx.java @@ -50,8 +50,8 @@ public class JourneyIntoNyx extends ExpansionSet { this.parentSet = Theros.getInstance(); this.hasBasicLands = false; this.hasBoosters = true; - this.numBoosterLands = 0; - this.numBoosterCommon = 11; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 8; diff --git a/Mage.Sets/src/mage/sets/MastersEditionII.java b/Mage.Sets/src/mage/sets/MastersEditionII.java index 0637ada20b5..4ff6cebfa37 100644 --- a/Mage.Sets/src/mage/sets/MastersEditionII.java +++ b/Mage.Sets/src/mage/sets/MastersEditionII.java @@ -45,7 +45,7 @@ public class MastersEditionII extends ExpansionSet { private MastersEditionII() { super("Masters Edition II", "ME2", "mage.sets.masterseditionii", new GregorianCalendar(2008, 9, 22).getTime(), SetType.MAGIC_ONLINE); - this.hasBasicLands = true; + this.hasBasicLands = false; this.hasBoosters = true; this.numBoosterLands = 1; this.numBoosterCommon = 10; diff --git a/Mage.Sets/src/mage/sets/MastersEditionIV.java b/Mage.Sets/src/mage/sets/MastersEditionIV.java index 2c9f75e2a54..37b62cf137c 100644 --- a/Mage.Sets/src/mage/sets/MastersEditionIV.java +++ b/Mage.Sets/src/mage/sets/MastersEditionIV.java @@ -46,7 +46,7 @@ public class MastersEditionIV extends ExpansionSet { private MastersEditionIV() { super("Masters Edition IV", "ME4", "mage.sets.masterseditioniv", new GregorianCalendar(2011, 1, 10).getTime(), SetType.MAGIC_ONLINE); - this.hasBasicLands = true; + this.hasBasicLands = false; this.hasBoosters = true; this.numBoosterLands = 1; this.numBoosterCommon = 10; diff --git a/Mage.Sets/src/mage/sets/OathOfTheGatewatch.java b/Mage.Sets/src/mage/sets/OathOfTheGatewatch.java new file mode 100644 index 00000000000..8d1d9030923 --- /dev/null +++ b/Mage.Sets/src/mage/sets/OathOfTheGatewatch.java @@ -0,0 +1,35 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.sets; + +import java.util.GregorianCalendar; +import mage.cards.ExpansionSet; +import mage.constants.SetType; + +/** + * + * @author fireshoes + */ +public class OathOfTheGatewatch extends ExpansionSet { + + private static final OathOfTheGatewatch fINSTANCE = new OathOfTheGatewatch(); + + public static OathOfTheGatewatch getInstance() { + return fINSTANCE; + } + + private OathOfTheGatewatch() { + super("Oath of the Gatewatch", "OGW", "mage.sets.oathofthegatewatch", new GregorianCalendar(2016, 1, 22).getTime(), SetType.EXPANSION); + this.blockName = "Battle for Zendikar"; + this.hasBoosters = true; + this.hasBasicLands = false; + this.numBoosterLands = 1; + this.numBoosterCommon = 10; + this.numBoosterUncommon = 3; + this.numBoosterRare = 1; + this.ratioBoosterMythic = 8; + } +} diff --git a/Mage.Sets/src/mage/sets/PortalThreeKingdoms.java b/Mage.Sets/src/mage/sets/PortalThreeKingdoms.java index f64b8803066..91b2c7313cc 100644 --- a/Mage.Sets/src/mage/sets/PortalThreeKingdoms.java +++ b/Mage.Sets/src/mage/sets/PortalThreeKingdoms.java @@ -36,15 +36,10 @@ import mage.constants.SetType; * * @author LevelX2 */ - public class PortalThreeKingdoms extends ExpansionSet { private static final PortalThreeKingdoms fINSTANCE = new PortalThreeKingdoms(); - /** - * - * @return - */ public static PortalThreeKingdoms getInstance() { return fINSTANCE; } @@ -56,7 +51,7 @@ public class PortalThreeKingdoms extends ExpansionSet { this.hasBoosters = true; this.numBoosterLands = 2; this.numBoosterCommon = 5; - this.numBoosterUncommon = 5; + this.numBoosterUncommon = 2; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; } diff --git a/Mage.Sets/src/mage/sets/Starter1999.java b/Mage.Sets/src/mage/sets/Starter1999.java index 0e3ad40a75a..90a6197afd8 100644 --- a/Mage.Sets/src/mage/sets/Starter1999.java +++ b/Mage.Sets/src/mage/sets/Starter1999.java @@ -36,15 +36,10 @@ import mage.constants.SetType; * * @author LevelX2 */ - public class Starter1999 extends ExpansionSet { private static final Starter1999 fINSTANCE = new Starter1999(); - /** - * - * @return - */ public static Starter1999 getInstance() { return fINSTANCE; } @@ -54,8 +49,8 @@ public class Starter1999 extends ExpansionSet { this.blockName = "Beginner"; this.hasBasicLands = true; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 2; + this.numBoosterCommon = 9; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/UnlimitedEdition.java b/Mage.Sets/src/mage/sets/UnlimitedEdition.java index 2b3eaee6192..5e2e9c30212 100644 --- a/Mage.Sets/src/mage/sets/UnlimitedEdition.java +++ b/Mage.Sets/src/mage/sets/UnlimitedEdition.java @@ -20,8 +20,8 @@ public class UnlimitedEdition extends ExpansionSet { private UnlimitedEdition() { super("Unlimited Edition", "2ED", "mage.sets.unlimitededition", new GregorianCalendar(1993, 11, 1).getTime(), SetType.CORE); this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/ZendikarExpeditions.java b/Mage.Sets/src/mage/sets/ZendikarExpeditions.java new file mode 100644 index 00000000000..ed7759f4c8e --- /dev/null +++ b/Mage.Sets/src/mage/sets/ZendikarExpeditions.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets; + +import java.util.GregorianCalendar; +import mage.cards.ExpansionSet; +import mage.constants.SetType; + +/** + * + * @author fireshoes + */ +public class ZendikarExpeditions extends ExpansionSet { + + private static final ZendikarExpeditions fINSTANCE = new ZendikarExpeditions(); + + public static ZendikarExpeditions getInstance() { + return fINSTANCE; + } + + private ZendikarExpeditions() { + super("Zendikar Expeditions", "EXP", "mage.sets.zendikarexpeditions", new GregorianCalendar(2015, 10, 2).getTime(), SetType.PROMOTIONAL); + this.hasBoosters = false; + this.hasBasicLands = false; + } +} diff --git a/Mage.Sets/src/mage/sets/ZendikarVsEldrazi.java b/Mage.Sets/src/mage/sets/ZendikarVsEldrazi.java new file mode 100644 index 00000000000..4a0d7003f79 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ZendikarVsEldrazi.java @@ -0,0 +1,52 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.sets; + +import java.util.GregorianCalendar; +import mage.cards.ExpansionSet; +import mage.constants.SetType; + +/** + * + * @author fireshoes + */ + +public class ZendikarVsEldrazi extends ExpansionSet { + private static final ZendikarVsEldrazi fINSTANCE = new ZendikarVsEldrazi(); + + public static ZendikarVsEldrazi getInstance() { + return fINSTANCE; + } + + private ZendikarVsEldrazi() { + super("Duel Decks: Zendikar vs. Eldrazi", "DDP", "mage.sets.zendikarvseldrazi", new GregorianCalendar(2015, 8, 28).getTime(), SetType.SUPPLEMENTAL); + this.blockName = "Duel Decks"; + this.hasBasicLands = false; + } +} diff --git a/Mage.Sets/src/mage/sets/alarareborn/ArsenalThresher.java b/Mage.Sets/src/mage/sets/alarareborn/ArsenalThresher.java index 16bc181405a..af33a411bba 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/ArsenalThresher.java +++ b/Mage.Sets/src/mage/sets/alarareborn/ArsenalThresher.java @@ -41,7 +41,6 @@ import mage.constants.Rarity; import mage.counters.CounterType; import mage.filter.common.FilterArtifactCard; import mage.filter.predicate.mageobject.AnotherCardPredicate; -import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -62,7 +61,8 @@ public class ArsenalThresher extends CardImpl { this.toughness = new MageInt(2); // As Arsenal Thresher enters the battlefield, you may reveal any number of other artifact cards from your hand. Arsenal Thresher enters the battlefield with a +1/+1 counter on it for each card revealed this way. - this.addAbility(new AsEntersBattlefieldAbility(new ArsenalThresherEffect(), "you may reveal any number of other artifact cards from your hand. {this} enters the battlefield with a +1/+1 counter on it for each card revealed this way")); + this.addAbility(new AsEntersBattlefieldAbility(new ArsenalThresherEffect(), + "you may reveal any number of other artifact cards from your hand. {this} enters the battlefield with a +1/+1 counter on it for each card revealed this way")); } public ArsenalThresher(final ArsenalThresher card) { @@ -92,29 +92,29 @@ class ArsenalThresherEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player you = game.getPlayer(source.getControllerId()); - if (you == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } - Permanent arsenalThresher = game.getPermanent(source.getSourceId()); + Permanent arsenalThresher = game.getPermanentEntering(source.getSourceId()); FilterArtifactCard filter = new FilterArtifactCard(); filter.add(new AnotherCardPredicate()); - if (you.chooseUse(Outcome.Benefit, "Do you want to reveal other artifacts in your hand?", source, game)) { + if (controller.chooseUse(Outcome.Benefit, "Do you want to reveal other artifacts in your hand?", source, game)) { Cards cards = new CardsImpl(); - if (you.getHand().count(filter, source.getSourceId(), source.getControllerId(), game) > 0) { + if (controller.getHand().count(filter, source.getSourceId(), source.getControllerId(), game) > 0) { TargetCardInHand target = new TargetCardInHand(0, Integer.MAX_VALUE, filter); - if (you.choose(Outcome.Benefit, target, source.getSourceId(), game)) { + if (controller.choose(Outcome.Benefit, target, source.getSourceId(), game)) { for (UUID uuid : target.getTargets()) { - cards.add(you.getHand().get(uuid, game)); + cards.add(controller.getHand().get(uuid, game)); } - you.revealCards("Revealed cards", cards, game); if (arsenalThresher != null) { + controller.revealCards(arsenalThresher.getIdName(), cards, game); arsenalThresher.addCounters(CounterType.P1P1.createInstance(cards.size()), game); - return true; } } } + return true; } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java index fd91cace663..2db77ebb0ef 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java @@ -34,7 +34,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.costs.AlternativeCostSourceAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.WhiteManaAbility; @@ -64,7 +64,7 @@ public class FieldmistBorderpost extends CardImpl { // You may pay {1} and return a basic land you control to its owner's hand rather than pay Fieldmist Borderpost's mana cost. Ability ability = new AlternativeCostSourceAbility(new GenericManaCost(1)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); this.addAbility(ability); // Fieldmist Borderpost enters the battlefield tapped. diff --git a/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java index 586307655c0..e0464f950e2 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java @@ -32,7 +32,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.costs.AlternativeCostSourceAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; @@ -64,7 +64,7 @@ public class FirewildBorderpost extends CardImpl { // You may pay {1} and return a basic land you control to its owner's hand rather than pay Firewild Borderpost's mana cost. Ability ability = new AlternativeCostSourceAbility(new GenericManaCost(1)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); this.addAbility(ability); // Veinfire Firewild enters the battlefield tapped. diff --git a/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java b/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java index 7d87143fc83..cb81497e510 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java +++ b/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java @@ -30,17 +30,14 @@ package mage.sets.alarareborn; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; /** * @@ -48,17 +45,23 @@ import mage.game.stack.Spell; */ public class GloryscaleViashino extends CardImpl { + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + public GloryscaleViashino (UUID ownerId) { super(ownerId, 120, "Gloryscale Viashino", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{G}{W}"); this.expansionSetCode = "ARB"; this.subtype.add("Viashino"); this.subtype.add("Soldier"); - - this.power = new MageInt(3); this.toughness = new MageInt(3); - this.addAbility(new GloryscaleViashinoAbility()); + + // Whenever you cast a multicolored spell, Gloryscale Viashino gets +3/+3 until end of turn. + this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(3, 3, Duration.EndOfTurn), filter, false)); } public GloryscaleViashino (final GloryscaleViashino card) { @@ -69,36 +72,4 @@ public class GloryscaleViashino extends CardImpl { public GloryscaleViashino copy() { return new GloryscaleViashino(this); } - } - -class GloryscaleViashinoAbility extends TriggeredAbilityImpl { - public GloryscaleViashinoAbility() { - super(Zone.BATTLEFIELD, new BoostSourceEffect(3, 3, Duration.EndOfTurn)); - } - - public GloryscaleViashinoAbility(final GloryscaleViashinoAbility ability) { - super(ability); - } - - @Override - public GloryscaleViashinoAbility copy() { - return new GloryscaleViashinoAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId()); - } - - @Override - public String getRule() { - return "Whenever you cast a multicolored spell, {this} gets +3/+3 until end of turn."; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/alarareborn/LordOfExtinction.java b/Mage.Sets/src/mage/sets/alarareborn/LordOfExtinction.java index 7e2ab26e168..abcb06b0024 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/LordOfExtinction.java +++ b/Mage.Sets/src/mage/sets/alarareborn/LordOfExtinction.java @@ -53,13 +53,11 @@ public class LordOfExtinction extends CardImpl { this.expansionSetCode = "ARB"; this.subtype.add("Elemental"); - - this.power = new MageInt(0); this.toughness = new MageInt(0); // Lord of Extinction's power and toughness are each equal to the number of cards in all graveyards. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new LordOfExtinctionDynamicCount(), Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new LordOfExtinctionDynamicCount(), Duration.EndOfGame))); } public LordOfExtinction(final LordOfExtinction card) { diff --git a/Mage.Sets/src/mage/sets/alarareborn/MaelstromNexus.java b/Mage.Sets/src/mage/sets/alarareborn/MaelstromNexus.java index 6a4f024517a..655dea82e26 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/MaelstromNexus.java +++ b/Mage.Sets/src/mage/sets/alarareborn/MaelstromNexus.java @@ -27,21 +27,28 @@ */ package mage.sets.alarareborn; +import java.util.HashMap; +import java.util.Map; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.keyword.CascadeAbility; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.constants.WatcherScope; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; -import mage.target.targetpointer.FixedTarget; +import mage.game.stack.StackObject; +import mage.players.Player; import mage.watchers.Watcher; /** @@ -55,7 +62,7 @@ public class MaelstromNexus extends CardImpl { this.expansionSetCode = "ARB"; // The first spell you cast each turn has cascade. - this.addAbility(new MaelstromNexusTriggeredAbility(), new FirstSpellCastThisTurnWatcher()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MaelstromNexusGainCascadeFirstSpellEffect()), new FirstSpellCastThisTurnWatcher()); } @@ -69,52 +76,51 @@ public class MaelstromNexus extends CardImpl { } } -class MaelstromNexusTriggeredAbility extends TriggeredAbilityImpl { +class MaelstromNexusGainCascadeFirstSpellEffect extends ContinuousEffectImpl { - public MaelstromNexusTriggeredAbility() { - super(Zone.BATTLEFIELD, new CascadeEffect()); + private Ability cascadeAbility = new CascadeAbility(); + + public MaelstromNexusGainCascadeFirstSpellEffect() { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + staticText = "The first spell you cast each turn has cascade"; } - public MaelstromNexusTriggeredAbility(MaelstromNexusTriggeredAbility ability) { - super(ability); + public MaelstromNexusGainCascadeFirstSpellEffect(final MaelstromNexusGainCascadeFirstSpellEffect effect) { + super(effect); } @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.SPELL_CAST; + public MaelstromNexusGainCascadeFirstSpellEffect copy() { + return new MaelstromNexusGainCascadeFirstSpellEffect(this); } - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - FirstSpellCastThisTurnWatcher watcher = (FirstSpellCastThisTurnWatcher) game.getState().getWatchers().get("FirstSpellCastThisTurn", this.getSourceId()); - if (spell != null - && watcher != null - && watcher.conditionMet()) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(spell.getSourceId())); + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (StackObject stackObject : game.getStack()) { + // only spells cast, so no copies of spells + if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.getControllerId().equals(source.getControllerId())) { + Spell spell = (Spell) stackObject; + FirstSpellCastThisTurnWatcher watcher = (FirstSpellCastThisTurnWatcher) game.getState().getWatchers().get("FirstSpellCastThisTurn"); + if (watcher != null && spell.getId().equals(watcher.getIdOfFirstCastSpell(source.getControllerId()))) { + game.getState().addOtherAbility(spell.getCard(), cascadeAbility); + } + } + } return true; } return false; } - - @Override - public MaelstromNexusTriggeredAbility copy() { - return new MaelstromNexusTriggeredAbility(this); - } - - @Override - public String getRule() { - return "The first spell you cast each turn has cascade."; - } } class FirstSpellCastThisTurnWatcher extends Watcher { - int spellCount = 0; + Map playerFirstSpellCast = new HashMap<>(); + Map playerFirstCastSpell = new HashMap<>(); public FirstSpellCastThisTurnWatcher() { - super("FirstSpellCastThisTurn", WatcherScope.CARD); + super("FirstSpellCastThisTurn", WatcherScope.GAME); } public FirstSpellCastThisTurnWatcher(final FirstSpellCastThisTurnWatcher watcher) { @@ -123,16 +129,18 @@ class FirstSpellCastThisTurnWatcher extends Watcher { @Override public void watch(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId() == controllerId) { - Spell spell = (Spell) game.getObject(event.getTargetId()); - if (spell != null) { - spellCount++; - if (spellCount == 1) { - condition = true; - } else { - condition = false; + switch (event.getType()) { + case SPELL_CAST: + case CAST_SPELL: + Spell spell = (Spell) game.getObject(event.getTargetId()); + if (spell != null && !playerFirstSpellCast.containsKey(spell.getControllerId())) { + if (event.getType().equals(EventType.SPELL_CAST)) { + playerFirstSpellCast.put(spell.getControllerId(), spell.getId()); + } else if (event.getType().equals(EventType.CAST_SPELL)) { + playerFirstCastSpell.put(spell.getControllerId(), spell.getId()); + } + } - } } } @@ -144,28 +152,15 @@ class FirstSpellCastThisTurnWatcher extends Watcher { @Override public void reset() { super.reset(); - spellCount = 0; + playerFirstSpellCast.clear(); + playerFirstCastSpell.clear(); + } + + public UUID getIdOfFirstCastSpell(UUID playerId) { + if (playerFirstSpellCast.get(playerId) == null) { + return playerFirstCastSpell.get(playerId); + } else { + return playerFirstSpellCast.get(playerId); + } } } - -class CascadeEffect extends OneShotEffect { - - public CascadeEffect() { - super(Outcome.PutCardInPlay); - } - - public CascadeEffect(CascadeEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - return CascadeAbility.applyCascade(outcome, game, source); - } - - @Override - public CascadeEffect copy() { - return new CascadeEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/alarareborn/MayaelsAria.java b/Mage.Sets/src/mage/sets/alarareborn/MayaelsAria.java index 5787e85e87c..a23c65749a7 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/MayaelsAria.java +++ b/Mage.Sets/src/mage/sets/alarareborn/MayaelsAria.java @@ -38,7 +38,9 @@ import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; import mage.counters.CounterType; +import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -53,13 +55,10 @@ public class MayaelsAria extends CardImpl { super(ownerId, 121, "Mayael's Aria", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{R}{G}{W}"); this.expansionSetCode = "ARB"; - - - - - // At the beginning of your upkeep, put a +1/+1 counter on each creature you control if you control a creature with power 5 or greater. Then you gain 10 life if you control a creature with power 10 or greater. Then you win the game if you control a creature with power 20 or greater. + // At the beginning of your upkeep, put a +1/+1 counter on each creature you control if you control a creature with power 5 or greater. + // Then you gain 10 life if you control a creature with power 10 or greater. + // Then you win the game if you control a creature with power 20 or greater. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new MayaelsAriaEffect(), TargetController.YOU, false)); - } public MayaelsAria(final MayaelsAria card) { @@ -90,31 +89,32 @@ class MayaelsAriaEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - boolean condition1 = false; - boolean condition2 = false; - Player you = game.getPlayer(source.getControllerId()); - if (you == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } + // put a +1/+1 counter on each creature you control if you control a creature with power 5 or greater. FilterCreaturePermanent filter = new FilterCreaturePermanent(); - for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { - if (creature.getPower().getValue() > 4) { - condition1 = true; - } - if (creature.getPower().getValue() > 9) { - condition2 = true; - } - if (creature.getPower().getValue() > 19) { - you.won(game); - } - } - if (condition1) { + filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 4)); + if (game.getState().getBattlefield().countAll(filter, controller.getId(), game) > 0) { for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { creature.addCounters(CounterType.P1P1.createInstance(), game); } } - if (condition2) { - you.gainLife(10, game); + game.applyEffects(); // needed because otehrwise the +1/+1 counters wouldn't be taken into account + + // Then you gain 10 life if you control a creature with power 10 or greater. + filter = new FilterCreaturePermanent(); + filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 9)); + if (game.getState().getBattlefield().countAll(filter, controller.getId(), game) > 0) { + controller.gainLife(10, game); + } + + // Then you win the game if you control a creature with power 20 or greater. + filter = new FilterCreaturePermanent(); + filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 19)); + if (game.getState().getBattlefield().countAll(filter, controller.getId(), game) > 0) { + controller.won(game); } return true; } diff --git a/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java index dc01e983b54..050cda79a5d 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java @@ -34,7 +34,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.costs.AlternativeCostSourceAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlueManaAbility; @@ -64,7 +64,7 @@ public class MistveinBorderpost extends CardImpl { // You may pay {1} and return a basic land you control to its owner's hand rather than pay Mistvein Borderpost's mana cost. Ability ability = new AlternativeCostSourceAbility(new GenericManaCost(1)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); this.addAbility(ability); // Mistvein Borderpost enters the battlefield tapped. diff --git a/Mage.Sets/src/mage/sets/alarareborn/SlaveOfBolas.java b/Mage.Sets/src/mage/sets/alarareborn/SlaveOfBolas.java index 414e9e9cee0..da0c98d4ea7 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/SlaveOfBolas.java +++ b/Mage.Sets/src/mage/sets/alarareborn/SlaveOfBolas.java @@ -43,6 +43,7 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; @@ -56,10 +57,6 @@ public class SlaveOfBolas extends CardImpl { super(ownerId, 136, "Slave of Bolas", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{U/R}{B}"); this.expansionSetCode = "ARB"; - - - - // Gain control of target creature. Untap that creature. It gains haste until end of turn. Sacrifice it at the beginning of the next end step. this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); this.getSpellAbility().addEffect(new UntapTargetEffect()); @@ -96,13 +93,17 @@ class SlaveOfBolasEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this"); - sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - return true; + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId()); + sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + return false; } } diff --git a/Mage.Sets/src/mage/sets/alarareborn/Terminate.java b/Mage.Sets/src/mage/sets/alarareborn/Terminate.java index d69a6c1ee7a..bb1c6bf8971 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/Terminate.java +++ b/Mage.Sets/src/mage/sets/alarareborn/Terminate.java @@ -1,38 +1,37 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.sets.alarareborn; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.target.common.TargetCreaturePermanent; /** @@ -44,8 +43,6 @@ public class Terminate extends CardImpl { public Terminate(UUID ownerId) { super(ownerId, 46, "Terminate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}{R}"); this.expansionSetCode = "ARB"; - - // Destroy target creature. It can't be regenerated. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/alarareborn/Thraximundar.java b/Mage.Sets/src/mage/sets/alarareborn/Thraximundar.java index 9fe05560f06..08898a2dcce 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/Thraximundar.java +++ b/Mage.Sets/src/mage/sets/alarareborn/Thraximundar.java @@ -60,9 +60,6 @@ public class Thraximundar extends CardImpl { this.subtype.add("Zombie"); this.subtype.add("Assassin"); - - - this.power = new MageInt(6); this.toughness = new MageInt(6); @@ -116,7 +113,8 @@ class ThraximundarTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getSourceId() == this.getSourceId()) { + if (event.getSourceId() != null + && event.getSourceId().equals(this.getSourceId())) { UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game); this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); return true; @@ -160,4 +158,4 @@ class PlayerSacrificesCreatureTriggeredAbility extends TriggeredAbilityImpl { public PlayerSacrificesCreatureTriggeredAbility copy() { return new PlayerSacrificesCreatureTriggeredAbility(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java index 29ca354d0c0..82c2243a1cb 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java @@ -34,7 +34,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.costs.AlternativeCostSourceAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.RedManaAbility; @@ -64,7 +64,7 @@ public class VeinfireBorderpost extends CardImpl { // You may pay {1} and return a basic land you control to its owner's hand rather than pay Veinfire Borderpost's mana cost. Ability ability = new AlternativeCostSourceAbility(new GenericManaCost(1)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); this.addAbility(ability); // Veinfire Borderpost enters the battlefield tapped. diff --git a/Mage.Sets/src/mage/sets/alarareborn/Wargate.java b/Mage.Sets/src/mage/sets/alarareborn/Wargate.java index db3728446e6..38654b08777 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/Wargate.java +++ b/Mage.Sets/src/mage/sets/alarareborn/Wargate.java @@ -28,14 +28,13 @@ package mage.sets.alarareborn; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.Filter; import mage.filter.common.FilterPermanentCard; @@ -54,10 +53,6 @@ public class Wargate extends CardImpl { super(ownerId, 129, "Wargate", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{G}{W}{U}"); this.expansionSetCode = "ARB"; - - - - // Search your library for a permanent card with converted mana cost X or less, put it onto the battlefield, then shuffle your library. this.getSpellAbility().addEffect(new WargateEffect()); } @@ -72,8 +67,8 @@ public class Wargate extends CardImpl { } } - class WargateEffect extends OneShotEffect { + WargateEffect() { super(Outcome.PutCreatureInPlay); staticText = "Search your library for a permanent card with converted mana cost X or less, put it onto the battlefield, then shuffle your library"; @@ -97,7 +92,7 @@ class WargateEffect extends OneShotEffect { if (target.getTargets().size() > 0) { Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } } diff --git a/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java index 2015f45f10a..f167e516df3 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java @@ -34,7 +34,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.costs.AlternativeCostSourceAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.WhiteManaAbility; @@ -64,7 +64,7 @@ public class WildfieldBorderpost extends CardImpl { // You may pay {1} and return a basic land you control to its owner's hand rather than pay Wildfield Borderpost's mana cost. Ability ability = new AlternativeCostSourceAbility(new GenericManaCost(1)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); this.addAbility(ability); // Wildfield Borderpost enters the battlefield tapped. diff --git a/Mage.Sets/src/mage/sets/alliances/AgentOfStromgald1.java b/Mage.Sets/src/mage/sets/alliances/AgentOfStromgald1.java new file mode 100644 index 00000000000..5abea54055d --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/AgentOfStromgald1.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class AgentOfStromgald1 extends CardImpl { + + public AgentOfStromgald1(UUID ownerId) { + super(ownerId, 94, "Agent of Stromgald", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {R}: Add {B} to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.BlackMana, new ManaCostsImpl("{R}"))); + } + + public AgentOfStromgald1(final AgentOfStromgald1 card) { + super(card); + } + + @Override + public AgentOfStromgald1 copy() { + return new AgentOfStromgald1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/AgentOfStromgald2.java b/Mage.Sets/src/mage/sets/alliances/AgentOfStromgald2.java new file mode 100644 index 00000000000..2c2d51c3237 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/AgentOfStromgald2.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class AgentOfStromgald2 extends AgentOfStromgald1 { + + public AgentOfStromgald2(UUID ownerId) { + super(ownerId); + this.cardNumber = 95; + } + + public AgentOfStromgald2(final AgentOfStromgald2 card) { + super(card); + } + + @Override + public AgentOfStromgald2 copy() { + return new AgentOfStromgald2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/BalduvianWarMakers1.java b/Mage.Sets/src/mage/sets/alliances/BalduvianWarMakers1.java new file mode 100644 index 00000000000..3922ab3d508 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/BalduvianWarMakers1.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class BalduvianWarMakers1 extends CardImpl { + + public BalduvianWarMakers1(UUID ownerId) { + super(ownerId, 97, "Balduvian War-Makers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Human"); + this.subtype.add("Barbarian"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // Rampage 1 + this.addAbility(new RampageAbility(1)); + } + + public BalduvianWarMakers1(final BalduvianWarMakers1 card) { + super(card); + } + + @Override + public BalduvianWarMakers1 copy() { + return new BalduvianWarMakers1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/BalduvianWarMakers2.java b/Mage.Sets/src/mage/sets/alliances/BalduvianWarMakers2.java new file mode 100644 index 00000000000..175ba8a2141 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/BalduvianWarMakers2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class BalduvianWarMakers2 extends BalduvianWarMakers1 { + + public BalduvianWarMakers2(UUID ownerId) { + super(ownerId); + this.cardNumber = 98; + } + + public BalduvianWarMakers2(final BalduvianWarMakers2 card) { + super(card); + } + + @Override + public BalduvianWarMakers2 copy() { + return new BalduvianWarMakers2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/Burnout.java b/Mage.Sets/src/mage/sets/alliances/Burnout.java new file mode 100644 index 00000000000..e0c33b0a1c1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/Burnout.java @@ -0,0 +1,108 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.target.TargetSpell; + +/** + * + * @author fireshoes + */ +public class Burnout extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("instant spell"); + + static { + filter.add(new CardTypePredicate(CardType.INSTANT)); + } + + public Burnout(UUID ownerId) { + super(ownerId, 101, "Burnout", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "ALL"; + + // Counter target instant spell if it's blue. + Effect effect = new BurnoutCounterTargetEffect(); + effect.setText("Counter target instant spell if it's blue"); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addEffect(effect); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public Burnout(final Burnout card) { + super(card); + } + + @Override + public Burnout copy() { + return new Burnout(this); + } +} + +class BurnoutCounterTargetEffect extends OneShotEffect { + + public BurnoutCounterTargetEffect() { + super(Outcome.Detriment); + } + + public BurnoutCounterTargetEffect(final BurnoutCounterTargetEffect effect) { + super(effect); + } + + @Override + public BurnoutCounterTargetEffect copy() { + return new BurnoutCounterTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); + if(targetSpell != null && targetSpell.getColor(game).isBlue()){ + game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/alliances/CarrierPigeons1.java b/Mage.Sets/src/mage/sets/alliances/CarrierPigeons1.java new file mode 100644 index 00000000000..a4b0a0bc0ef --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/CarrierPigeons1.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class CarrierPigeons1 extends CardImpl { + + public CarrierPigeons1(UUID ownerId) { + super(ownerId, 125, "Carrier Pigeons", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Bird"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Carrier Pigeons enters the battlefield, draw a card at the beginning of the next turn's upkeep. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false))); + } + + public CarrierPigeons1(final CarrierPigeons1 card) { + super(card); + } + + @Override + public CarrierPigeons1 copy() { + return new CarrierPigeons1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/CarrierPigeons2.java b/Mage.Sets/src/mage/sets/alliances/CarrierPigeons2.java new file mode 100644 index 00000000000..974a74f0358 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/CarrierPigeons2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CarrierPigeons2 extends mage.sets.alliances.CarrierPigeons1 { + + public CarrierPigeons2(UUID ownerId) { + super(ownerId); + this.cardNumber = 126; + this.expansionSetCode = "ALL"; + } + + public CarrierPigeons2(final CarrierPigeons1 card) { + super(card); + } + + @Override + public CarrierPigeons1 copy() { + return new CarrierPigeons1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/EnslavedScout1.java b/Mage.Sets/src/mage/sets/alliances/EnslavedScout1.java new file mode 100644 index 00000000000..0c8467c1de9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/EnslavedScout1.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class EnslavedScout1 extends CardImpl { + + public EnslavedScout1(UUID ownerId) { + super(ownerId, 104, "Enslaved Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Goblin"); + this.subtype.add("Scout"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {2}: Enslaved Scout gains mountainwalk until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new MountainwalkAbility(false), Duration.EndOfTurn), + new GenericManaCost(2))); + } + + public EnslavedScout1(final EnslavedScout1 card) { + super(card); + } + + @Override + public EnslavedScout1 copy() { + return new EnslavedScout1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/EnslavedScout2.java b/Mage.Sets/src/mage/sets/alliances/EnslavedScout2.java new file mode 100644 index 00000000000..51a1f2cffa8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/EnslavedScout2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EnslavedScout2 extends mage.sets.alliances.EnslavedScout1 { + + public EnslavedScout2(UUID ownerId) { + super(ownerId); + this.cardNumber = 105; + this.expansionSetCode = "ALL"; + } + + public EnslavedScout2(final EnslavedScout1 card) { + super(card); + } + + @Override + public EnslavedScout1 copy() { + return new EnslavedScout1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/FeveredStrength1.java b/Mage.Sets/src/mage/sets/alliances/FeveredStrength1.java new file mode 100644 index 00000000000..8dbc22aa5dc --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/FeveredStrength1.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class FeveredStrength1 extends CardImpl { + + public FeveredStrength1(UUID ownerId) { + super(ownerId, 10, "Fevered Strength", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{B}"); + this.expansionSetCode = "ALL"; + + // Target creature gets +2/+0 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public FeveredStrength1(final FeveredStrength1 card) { + super(card); + } + + @Override + public FeveredStrength1 copy() { + return new FeveredStrength1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/FeveredStrength2.java b/Mage.Sets/src/mage/sets/alliances/FeveredStrength2.java new file mode 100644 index 00000000000..9f87d7e30de --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/FeveredStrength2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FeveredStrength2 extends mage.sets.alliances.FeveredStrength1 { + + public FeveredStrength2(UUID ownerId) { + super(ownerId); + this.cardNumber = 11; + this.expansionSetCode = "ALL"; + } + + public FeveredStrength2(final FeveredStrength1 card) { + super(card); + } + + @Override + public FeveredStrength1 copy() { + return new FeveredStrength1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/GorillaBerserkers1.java b/Mage.Sets/src/mage/sets/alliances/GorillaBerserkers1.java new file mode 100644 index 00000000000..9c5d4381512 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/GorillaBerserkers1.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByOneEffect; +import mage.abilities.keyword.RampageAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class GorillaBerserkers1 extends CardImpl { + + public GorillaBerserkers1(UUID ownerId) { + super(ownerId, 75, "Gorilla Berserkers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Ape"); + this.subtype.add("Berserker"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Rampage 2 + this.addAbility(new RampageAbility(2)); + // Gorilla Berserkers can't be blocked except by three or more creatures. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(3))); + } + + public GorillaBerserkers1(final GorillaBerserkers1 card) { + super(card); + } + + @Override + public GorillaBerserkers1 copy() { + return new GorillaBerserkers1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/GorillaBerserkers2.java b/Mage.Sets/src/mage/sets/alliances/GorillaBerserkers2.java new file mode 100644 index 00000000000..1991e685628 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/GorillaBerserkers2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class GorillaBerserkers2 extends GorillaBerserkers1 { + + public GorillaBerserkers2(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + } + + public GorillaBerserkers2(final GorillaBerserkers2 card) { + super(card); + } + + @Override + public GorillaBerserkers2 copy() { + return new GorillaBerserkers2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/GorillaShaman1.java b/Mage.Sets/src/mage/sets/alliances/GorillaShaman1.java index edb27282bc7..3fd9f9e798b 100644 --- a/Mage.Sets/src/mage/sets/alliances/GorillaShaman1.java +++ b/Mage.Sets/src/mage/sets/alliances/GorillaShaman1.java @@ -52,6 +52,8 @@ import mage.target.TargetPermanent; */ public class GorillaShaman1 extends CardImpl { + private final UUID originalId; + public GorillaShaman1(UUID ownerId) { super(ownerId, 106, "Gorilla Shaman", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); this.expansionSetCode = "ALL"; @@ -63,12 +65,13 @@ public class GorillaShaman1 extends CardImpl { // {X}{X}{1}: Destroy target noncreature artifact with converted mana cost X. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{1}")); ability.addTarget(new TargetPermanent(new FilterArtifactPermanent("noncreature artifact with converted mana cost X"))); + originalId = ability.getOriginalId(); this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SimpleActivatedAbility) { + if (ability.getOriginalId().equals(originalId)) { int xValue = ability.getManaCostsToPay().getX(); ability.getTargets().clear(); FilterArtifactPermanent filter = new FilterArtifactPermanent(new StringBuilder("noncreature artifact with converted mana cost ").append(xValue).toString()); @@ -81,6 +84,7 @@ public class GorillaShaman1 extends CardImpl { public GorillaShaman1(final GorillaShaman1 card) { super(card); + this.originalId = card.originalId; } @Override diff --git a/Mage.Sets/src/mage/sets/alliances/GorillaWarCry1.java b/Mage.Sets/src/mage/sets/alliances/GorillaWarCry1.java new file mode 100644 index 00000000000..8ee452418b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/GorillaWarCry1.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GorillaWarCry1 extends mage.sets.masterseditioniv.GorillaWarCry { + + public GorillaWarCry1(UUID ownerId) { + super(ownerId); + this.cardNumber = 108; + this.expansionSetCode = "ALL"; + } + + public GorillaWarCry1(final GorillaWarCry1 card) { + super(card); + } + + @Override + public GorillaWarCry1 copy() { + return new GorillaWarCry1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/GorillaWarCry2.java b/Mage.Sets/src/mage/sets/alliances/GorillaWarCry2.java new file mode 100644 index 00000000000..657c2278db0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/GorillaWarCry2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GorillaWarCry2 extends mage.sets.masterseditioniv.GorillaWarCry { + + public GorillaWarCry2(UUID ownerId) { + super(ownerId); + this.cardNumber = 109; + this.expansionSetCode = "ALL"; + } + + public GorillaWarCry2(final GorillaWarCry2 card) { + super(card); + } + + @Override + public GorillaWarCry2 copy() { + return new GorillaWarCry2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/InsidiousBookworms1.java b/Mage.Sets/src/mage/sets/alliances/InsidiousBookworms1.java new file mode 100644 index 00000000000..893647e1340 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/InsidiousBookworms1.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author LoneFox + */ +public class InsidiousBookworms1 extends CardImpl { + + public InsidiousBookworms1(UUID ownerId) { + super(ownerId, 12, "Insidious Bookworms", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Worm"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Insidious Bookworms dies, you may pay {1}{B}. If you do, target player discards a card at random. + Ability ability = new DiesTriggeredAbility(new DoIfCostPaid(new DiscardTargetEffect(1, true), new ManaCostsImpl("{1}{B}"))); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public InsidiousBookworms1(final InsidiousBookworms1 card) { + super(card); + } + + @Override + public InsidiousBookworms1 copy() { + return new InsidiousBookworms1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/InsidiousBookworms2.java b/Mage.Sets/src/mage/sets/alliances/InsidiousBookworms2.java new file mode 100644 index 00000000000..6b8167641ec --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/InsidiousBookworms2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class InsidiousBookworms2 extends InsidiousBookworms1 { + + public InsidiousBookworms2(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + } + + public InsidiousBookworms2(final InsidiousBookworms2 card) { + super(card); + } + + @Override + public InsidiousBookworms2 copy() { + return new InsidiousBookworms2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/JuniperOrderAdvocate.java b/Mage.Sets/src/mage/sets/alliances/JuniperOrderAdvocate.java new file mode 100644 index 00000000000..6faff763326 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/JuniperOrderAdvocate.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LoneFox + */ +public class JuniperOrderAdvocate extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green creatures you control"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public JuniperOrderAdvocate(UUID ownerId) { + super(ownerId, 132, "Juniper Order Advocate", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // As long as Juniper Order Advocate is untapped, green creatures you control get +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false), + new InvertCondition(new SourceTappedCondition()), + "As long as {this} is untapped, green creatures you control get +1/+1."))); + } + + public JuniperOrderAdvocate(final JuniperOrderAdvocate card) { + super(card); + } + + @Override + public JuniperOrderAdvocate copy() { + return new JuniperOrderAdvocate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/KeeperOfTresserhorn.java b/Mage.Sets/src/mage/sets/alliances/KeeperOfTresserhorn.java new file mode 100644 index 00000000000..0b4b039c706 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/KeeperOfTresserhorn.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.continuous.AssignNoCombatDamageSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class KeeperOfTresserhorn extends CardImpl { + + public KeeperOfTresserhorn(UUID ownerId) { + super(ownerId, 14, "Keeper of Tresserhorn", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Avatar"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Whenever Keeper of Tresserhorn attacks and isn't blocked, it assigns no combat damage this turn and defending player loses 2 life. + Effect effect = new AssignNoCombatDamageSourceEffect(Duration.EndOfTurn); + effect.setText("it assigns no combat damage this turn"); + Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(effect, false, true); + effect = new LoseLifeTargetEffect(2); + effect.setText("and defending player loses 2 life"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public KeeperOfTresserhorn(final KeeperOfTresserhorn card) { + super(card); + } + + @Override + public KeeperOfTresserhorn copy() { + return new KeeperOfTresserhorn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/LimDulsHighGuard1.java b/Mage.Sets/src/mage/sets/alliances/LimDulsHighGuard1.java new file mode 100644 index 00000000000..6c260c65c1b --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/LimDulsHighGuard1.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class LimDulsHighGuard1 extends CardImpl { + + public LimDulsHighGuard1(UUID ownerId) { + super(ownerId, 17, "Lim-Dul's High Guard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Skeleton"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // {1}{B}: Regenerate Lim-Dul's High Guard. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{B}"))); + } + + public LimDulsHighGuard1(final LimDulsHighGuard1 card) { + super(card); + } + + @Override + public LimDulsHighGuard1 copy() { + return new LimDulsHighGuard1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/LimDulsHighGuard2.java b/Mage.Sets/src/mage/sets/alliances/LimDulsHighGuard2.java new file mode 100644 index 00000000000..f3eeba47ccf --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/LimDulsHighGuard2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class LimDulsHighGuard2 extends LimDulsHighGuard1 { + + public LimDulsHighGuard2(UUID ownerId) { + super(ownerId); + this.cardNumber = 18; + } + + public LimDulsHighGuard2(final LimDulsHighGuard2 card) { + super(card); + } + + @Override + public LimDulsHighGuard2 copy() { + return new LimDulsHighGuard2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/LimDulsPaladin.java b/Mage.Sets/src/mage/sets/alliances/LimDulsPaladin.java new file mode 100644 index 00000000000..a534ba9793f --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/LimDulsPaladin.java @@ -0,0 +1,123 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.effects.common.continuous.AssignNoCombatDamageSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCardInHand; + +/** + * + * @author LoneFox + */ +public class LimDulsPaladin extends CardImpl { + + public LimDulsPaladin(UUID ownerId) { + super(ownerId, 191, "Lim-Dul's Paladin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{R}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // At the beginning of your upkeep, you may discard a card. If you don't, sacrifice Lim-Dul's Paladin and draw a card. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new LimDulsPaladinEffect(), TargetController.YOU, false)); + // Whenever Lim-Dul's Paladin becomes blocked, it gets +6/+3 until end of turn. + this.addAbility(new BecomesBlockedTriggeredAbility(new BoostSourceEffect(6, 3, Duration.EndOfTurn), false)); + // Whenever Lim-Dul's Paladin attacks and isn't blocked, it assigns no combat damage to defending player this turn and that player loses 4 life. + Effect effect = new AssignNoCombatDamageSourceEffect(Duration.EndOfTurn); + effect.setText("it assigns no combat damage this turn"); + Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(effect, false, true); + effect = new LoseLifeTargetEffect(4); + effect.setText("and defending player loses 4 life"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public LimDulsPaladin(final LimDulsPaladin card) { + super(card); + } + + @Override + public LimDulsPaladin copy() { + return new LimDulsPaladin(this); + } +} + +class LimDulsPaladinEffect extends SacrificeSourceUnlessPaysEffect { + + public LimDulsPaladinEffect() { + super(new DiscardTargetCost(new TargetCardInHand())); + staticText = "you may discard a card. If you don't, sacrifice {this} and draw a card."; + } + + public LimDulsPaladinEffect(final LimDulsPaladinEffect effect) { + super(effect); + } + + @Override + public LimDulsPaladinEffect copy() { + return new LimDulsPaladinEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if(permanent != null) { + super.apply(game, source); + // Not in play anymore -> was sacrificed, draw a card + if(game.getPermanent(source.getSourceId()) == null) { + return new DrawCardSourceControllerEffect(1).apply(game, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/LordOfTresserhorn.java b/Mage.Sets/src/mage/sets/alliances/LordOfTresserhorn.java index 615bff39518..12dc40a8961 100644 --- a/Mage.Sets/src/mage/sets/alliances/LordOfTresserhorn.java +++ b/Mage.Sets/src/mage/sets/alliances/LordOfTresserhorn.java @@ -37,16 +37,13 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.LoseLifeSourceControllerEffect; import mage.abilities.effects.common.RegenerateSourceEffect; -import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; -import mage.target.Target; -import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetOpponent; -import mage.target.targetpointer.SecondTargetPointer; /** * @@ -65,15 +62,13 @@ public class LordOfTresserhorn extends CardImpl { // When Lord of Tresserhorn enters the battlefield, you lose 2 life, you sacrifice two creatures, and target opponent draws two cards. Ability ability = new EntersBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(2), false); - ability.addEffect(new SacrificeTargetEffect(", you sacrifice two creatures")); - Target target = new TargetControlledCreaturePermanent(2,2, new FilterControlledCreaturePermanent(), true); - ability.addTarget(target); + ability.addEffect(new SacrificeControllerEffect(new FilterControlledCreaturePermanent("creatures"), 2, "you")); Effect effect = new DrawCardTargetEffect(2); effect.setText(", and target opponent draws two cards"); - effect.setTargetPointer(new SecondTargetPointer()); ability.addEffect(effect); ability.addTarget(new TargetOpponent()); this.addAbility(ability); + // {B}: Regenerate Lord of Tresserhorn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); } diff --git a/Mage.Sets/src/mage/sets/alliances/PhyrexianDevourer.java b/Mage.Sets/src/mage/sets/alliances/PhyrexianDevourer.java index a7ba4876f7b..36a4e5d6da8 100644 --- a/Mage.Sets/src/mage/sets/alliances/PhyrexianDevourer.java +++ b/Mage.Sets/src/mage/sets/alliances/PhyrexianDevourer.java @@ -27,8 +27,6 @@ */ package mage.sets.alliances; -import java.util.ArrayList; -import java.util.List; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; @@ -100,10 +98,7 @@ class PhyrexianDevourerStateTriggeredAbility extends StateTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(getSourceId()); - if(permanent != null && permanent.getPower().getValue() >= 7){ - return true; - } - return false; + return permanent != null && permanent.getPower().getValue() >= 7; } @Override @@ -134,9 +129,9 @@ class PhyrexianDevourerEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = null; - for (Cost cost: source.getCosts()) { + for (Cost cost : source.getCosts()) { if (cost instanceof ExileTopCardLibraryCost) { - card = ((ExileTopCardLibraryCost)cost).getCard(); + card = ((ExileTopCardLibraryCost) cost).getCard(); } } if (card != null) { @@ -170,7 +165,7 @@ class ExileTopCardLibraryCost extends CostImpl { if (controller != null) { card = controller.getLibrary().getFromTop(game); if (card != null) { - paid = controller.moveCardToExileWithInfo(card, null, "", sourceId, game, Zone.LIBRARY, true); + paid = controller.moveCards(card, null, Zone.EXILED, ability, game); } } return paid; diff --git a/Mage.Sets/src/mage/sets/alliances/PhyrexianWarBeast1.java b/Mage.Sets/src/mage/sets/alliances/PhyrexianWarBeast1.java index 5dad7465e1b..e91607c20c2 100644 --- a/Mage.Sets/src/mage/sets/alliances/PhyrexianWarBeast1.java +++ b/Mage.Sets/src/mage/sets/alliances/PhyrexianWarBeast1.java @@ -33,7 +33,7 @@ import mage.abilities.Ability; import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageControllerEffect; -import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; @@ -54,10 +54,8 @@ public class PhyrexianWarBeast1 extends CardImpl { this.toughness = new MageInt(4); // When Phyrexian War Beast leaves the battlefield, sacrifice a land and Phyrexian War Beast deals 1 damage to you. - Effect effect = new SacrificeTargetEffect(); - effect.setText("sacrifice a land"); - Ability ability = new LeavesBattlefieldTriggeredAbility(effect, false); - effect = new DamageControllerEffect(1); + Ability ability = new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterControlledLandPermanent(), 1, ""), false); + Effect effect = new DamageControllerEffect(1); effect.setText("and {this} deals 1 damage to you"); ability.addEffect(effect); ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent())); diff --git a/Mage.Sets/src/mage/sets/alliances/Reinforcements1.java b/Mage.Sets/src/mage/sets/alliances/Reinforcements1.java new file mode 100644 index 00000000000..7863eca7cb7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/Reinforcements1.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Reinforcements1 extends mage.sets.masterseditionii.Reinforcements { + + public Reinforcements1(UUID ownerId) { + super(ownerId); + this.cardNumber = 142; + this.expansionSetCode = "ALL"; + } + + public Reinforcements1(final Reinforcements1 card) { + super(card); + } + + @Override + public Reinforcements1 copy() { + return new Reinforcements1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/Reinforcements2.java b/Mage.Sets/src/mage/sets/alliances/Reinforcements2.java new file mode 100644 index 00000000000..e9010af8794 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/Reinforcements2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Reinforcements2 extends mage.sets.masterseditionii.Reinforcements { + + public Reinforcements2(UUID ownerId) { + super(ownerId); + this.cardNumber = 143; + this.expansionSetCode = "ALL"; + } + + public Reinforcements2(final Reinforcements2 card) { + super(card); + } + + @Override + public Reinforcements2 copy() { + return new Reinforcements2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/RitualOfTheMachine.java b/Mage.Sets/src/mage/sets/alliances/RitualOfTheMachine.java new file mode 100644 index 00000000000..c9fc32a7e9f --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/RitualOfTheMachine.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class RitualOfTheMachine extends mage.sets.masterseditionii.RitualOfTheMachine { + + public RitualOfTheMachine(UUID ownerId) { + super(ownerId); + this.cardNumber = 24; + this.expansionSetCode = "ALL"; + } + + public RitualOfTheMachine(final RitualOfTheMachine card) { + super(card); + } + + @Override + public RitualOfTheMachine copy() { + return new RitualOfTheMachine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate1.java b/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate1.java new file mode 100644 index 00000000000..6dc868b548c --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate1.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.mana.DynamicManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class SoldeviAdnate1 extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("black or artifact creature"); + + static { + filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK), new CardTypePredicate(CardType.ARTIFACT))); + } + + public SoldeviAdnate1(UUID ownerId) { + super(ownerId, 25, "Soldevi Adnate", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {T}, Sacrifice a black or artifact creature: Add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost. + Ability ability = new DynamicManaAbility(Mana.BlackMana, new SacrificeCostConvertedMana("creature"), + new TapSourceCost(), "add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost"); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + this.addAbility(ability); + } + + public SoldeviAdnate1(final SoldeviAdnate1 card) { + super(card); + } + + @Override + public SoldeviAdnate1 copy() { + return new SoldeviAdnate1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate2.java b/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate2.java new file mode 100644 index 00000000000..644ac231489 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate2.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SoldeviAdnate2 extends SoldeviAdnate1 { + + public SoldeviAdnate2(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + } + + public SoldeviAdnate2(final SoldeviAdnate2 card) { + super(card); + } + + @Override + public SoldeviAdnate2 copy() { + return new SoldeviAdnate2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/SwampMosquito1.java b/Mage.Sets/src/mage/sets/alliances/SwampMosquito1.java new file mode 100644 index 00000000000..de42480ab1a --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/SwampMosquito1.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.counter.AddPoisonCounterTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SwampMosquito1 extends CardImpl { + + public SwampMosquito1(UUID ownerId) { + super(ownerId, 30, "Swamp Mosquito", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Insect"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Whenever Swamp Mosquito attacks and isn't blocked, defending player gets a poison counter. + Effect effect = new AddPoisonCounterTargetEffect(1); + effect.setText("defending player gets a poison counter"); + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(effect, false, true)); + } + + public SwampMosquito1(final SwampMosquito1 card) { + super(card); + } + + @Override + public SwampMosquito1 copy() { + return new SwampMosquito1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/SwampMosquito2.java b/Mage.Sets/src/mage/sets/alliances/SwampMosquito2.java new file mode 100644 index 00000000000..9b44a183cb3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/SwampMosquito2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class SwampMosquito2 extends SwampMosquito1 { + + public SwampMosquito2(UUID ownerId) { + super(ownerId); + this.cardNumber = 31; + } + + public SwampMosquito2(final SwampMosquito2 card) { + super(card); + } + + @Override + public SwampMosquito2 copy() { + return new SwampMosquito2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/ThoughtLash.java b/Mage.Sets/src/mage/sets/alliances/ThoughtLash.java new file mode 100644 index 00000000000..6f9c9f2720c --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/ThoughtLash.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class ThoughtLash extends mage.sets.masterseditionii.ThoughtLash { + + public ThoughtLash(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "ALL"; + } + + public ThoughtLash(final ThoughtLash card) { + super(card); + } + + @Override + public ThoughtLash copy() { + return new ThoughtLash(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/VisceridArmor1.java b/Mage.Sets/src/mage/sets/alliances/VisceridArmor1.java new file mode 100644 index 00000000000..dbb63d09e49 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/VisceridArmor1.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class VisceridArmor1 extends mage.sets.masterseditionii.VisceridArmor { + + public VisceridArmor1(UUID ownerId) { + super(ownerId); + this.cardNumber = 60; + this.expansionSetCode = "ALL"; + } + + public VisceridArmor1(final VisceridArmor1 card) { + super(card); + } + + @Override + public VisceridArmor1 copy() { + return new VisceridArmor1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/VisceridArmor2.java b/Mage.Sets/src/mage/sets/alliances/VisceridArmor2.java new file mode 100644 index 00000000000..18ce8c47e5d --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/VisceridArmor2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class VisceridArmor2 extends mage.sets.masterseditionii.VisceridArmor { + + public VisceridArmor2(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "ALL"; + } + + public VisceridArmor2(final VisceridArmor2 card) { + super(card); + } + + @Override + public VisceridArmor2 copy() { + return new VisceridArmor2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/WanderingMage.java b/Mage.Sets/src/mage/sets/alliances/WanderingMage.java new file mode 100644 index 00000000000..20d38dca7c9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/WanderingMage.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WanderingMage extends mage.sets.masterseditioniii.WanderingMage { + + public WanderingMage(UUID ownerId) { + super(ownerId); + this.cardNumber = 198; + this.expansionSetCode = "ALL"; + } + + public WanderingMage(final WanderingMage card) { + super(card); + } + + @Override + public WanderingMage copy() { + return new WanderingMage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/WhipVine1.java b/Mage.Sets/src/mage/sets/alliances/WhipVine1.java new file mode 100644 index 00000000000..f10a6da77b1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/WhipVine1.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DontUntapAsLongAsSourceTappedEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.BlockedByIdPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class WhipVine1 extends CardImpl { + + public WhipVine1(UUID ownerId) { + super(ownerId, 89, "Whip Vine", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Plant"); + this.subtype.add("Wall"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Reach + this.addAbility(ReachAbility.getInstance()); + // You may choose not to untap Whip Vine during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {tap}: Tap target creature with flying blocked by Whip Vine. That creature doesn't untap during its controller's untap step for as long as Whip Vine remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying blocked by {this}"); + filter.add(new AbilityPredicate(FlyingAbility.class)); + filter.add(new BlockedByIdPredicate(this.getId())); + ability.addTarget(new TargetCreaturePermanent(filter)); + ability.addEffect(new DontUntapAsLongAsSourceTappedEffect()); + this.addAbility(ability); + } + + public WhipVine1(final WhipVine1 card) { + super(card); + } + + @Override + public WhipVine1 copy() { + return new WhipVine1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/WhipVine2.java b/Mage.Sets/src/mage/sets/alliances/WhipVine2.java new file mode 100644 index 00000000000..33fab718470 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/WhipVine2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WhipVine2 extends WhipVine1 { + + public WhipVine2(UUID ownerId) { + super(ownerId); + this.cardNumber = 90; + } + + public WhipVine2(final WhipVine2 card) { + super(card); + } + + @Override + public WhipVine2 copy() { + return new WhipVine2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/WildAesthir1.java b/Mage.Sets/src/mage/sets/alliances/WildAesthir1.java new file mode 100644 index 00000000000..7f7c7851621 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/WildAesthir1.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class WildAesthir1 extends mage.sets.masterseditioniv.WildAesthir { + + public WildAesthir1(UUID ownerId) { + super(ownerId); + this.cardNumber = 154; + this.expansionSetCode = "ALL"; + } + + public WildAesthir1(final WildAesthir1 card) { + super(card); + } + + @Override + public WildAesthir1 copy() { + return new WildAesthir1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/WildAesthir2.java b/Mage.Sets/src/mage/sets/alliances/WildAesthir2.java new file mode 100644 index 00000000000..59c160f0ccd --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/WildAesthir2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class WildAesthir2 extends mage.sets.masterseditioniv.WildAesthir { + + public WildAesthir2(UUID ownerId) { + super(ownerId); + this.cardNumber = 155; + this.expansionSetCode = "ALL"; + } + + public WildAesthir2(final WildAesthir2 card) { + super(card); + } + + @Override + public WildAesthir2 copy() { + return new WildAesthir2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/YavimayaAncients1.java b/Mage.Sets/src/mage/sets/alliances/YavimayaAncients1.java new file mode 100644 index 00000000000..c215b3b8332 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/YavimayaAncients1.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class YavimayaAncients1 extends mage.sets.masterseditionii.YavimayaAncients { + + public YavimayaAncients1(UUID ownerId) { + super(ownerId); + this.cardNumber = 91; + this.expansionSetCode = "ALL"; + this.rarity = Rarity.COMMON; + } + + public YavimayaAncients1(final YavimayaAncients1 card) { + super(card); + } + + @Override + public YavimayaAncients1 copy() { + return new YavimayaAncients1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/YavimayaAncients2.java b/Mage.Sets/src/mage/sets/alliances/YavimayaAncients2.java new file mode 100644 index 00000000000..a3df8b2b283 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/YavimayaAncients2.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.alliances; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class YavimayaAncients2 extends mage.sets.masterseditionii.YavimayaAncients { + + public YavimayaAncients2(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "ALL"; + this.rarity = Rarity.COMMON; + } + + public YavimayaAncients2(final YavimayaAncients2 card) { + super(card); + } + + @Override + public YavimayaAncients2 copy() { + return new YavimayaAncients2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/anthologyjacevschandra/Hostility.java b/Mage.Sets/src/mage/sets/anthologyjacevschandra/Hostility.java new file mode 100644 index 00000000000..4769a6c8b3b --- /dev/null +++ b/Mage.Sets/src/mage/sets/anthologyjacevschandra/Hostility.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.anthologyjacevschandra; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Hostility extends mage.sets.jacevschandra.Hostility { + + public Hostility(UUID ownerId) { + super(ownerId); + this.cardNumber = 48; + this.expansionSetCode = "DD3D"; + } + + public Hostility(final Hostility card) { + super(card); + } + + @Override + public Hostility copy() { + return new Hostility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/anthologyjacevschandra/Ophidian.java b/Mage.Sets/src/mage/sets/anthologyjacevschandra/Ophidian.java new file mode 100644 index 00000000000..bf513964994 --- /dev/null +++ b/Mage.Sets/src/mage/sets/anthologyjacevschandra/Ophidian.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.anthologyjacevschandra; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Ophidian extends mage.sets.vintagemasters.Ophidian { + + public Ophidian(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "DD3D"; + } + + public Ophidian(final Ophidian card) { + super(card); + } + + @Override + public Ophidian copy() { + return new Ophidian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/ArgivianBlacksmith.java b/Mage.Sets/src/mage/sets/antiquities/ArgivianBlacksmith.java new file mode 100644 index 00000000000..c789f94e247 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/ArgivianBlacksmith.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class ArgivianBlacksmith extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("target artifact creature"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + filter.add(new CardTypePredicate(CardType.CREATURE)); + } + + public ArgivianBlacksmith(UUID ownerId) { + super(ownerId, 95, "Argivian Blacksmith", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "ATQ"; + this.subtype.add("Human"); + this.subtype.add("Artificer"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {tap}: Prevent the next 2 damage that would be dealt to target artifact creature this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new PreventDamageToTargetEffect(Duration.EndOfTurn, 2), new TapSourceCost()); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public ArgivianBlacksmith(final ArgivianBlacksmith card) { + super(card); + } + + @Override + public ArgivianBlacksmith copy() { + return new ArgivianBlacksmith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/AshnodsBattleGear.java b/Mage.Sets/src/mage/sets/antiquities/AshnodsBattleGear.java new file mode 100644 index 00000000000..faef4ae4a09 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/AshnodsBattleGear.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class AshnodsBattleGear extends CardImpl { + + public AshnodsBattleGear(UUID ownerId) { + super(ownerId, 4, "Ashnod's Battle Gear", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "ATQ"; + + // You may choose not to untap Ashnod's Battle Gear during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {2}, {tap}: Target creature you control gets +2/-2 for as long as Ashnod's Battle Gear remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostTargetEffect(2, -2, Duration.Custom), SourceTappedCondition.getInstance(), + "target creature you control gets +2/-2 for as long as {this} remains tapped"), new ManaCostsImpl("{2}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + public AshnodsBattleGear(final AshnodsBattleGear card) { + super(card); + } + + @Override + public AshnodsBattleGear copy() { + return new AshnodsBattleGear(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/CoralHelm.java b/Mage.Sets/src/mage/sets/antiquities/CoralHelm.java new file mode 100644 index 00000000000..033986635c5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/CoralHelm.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author nigelzor + */ +public class CoralHelm extends mage.sets.masterseditioniv.CoralHelm { + + public CoralHelm(UUID ownerId) { + super(ownerId); + this.cardNumber = 12; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.RARE; + } + + public CoralHelm(final CoralHelm card) { + super(card); + } + + @Override + public CoralHelm copy() { + return new CoralHelm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/Crumble.java b/Mage.Sets/src/mage/sets/antiquities/Crumble.java new file mode 100644 index 00000000000..e9ca8886e69 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/Crumble.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Crumble extends mage.sets.masterseditioniv.Crumble { + + public Crumble(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "ATQ"; + } + + public Crumble(final Crumble card) { + super(card); + } + + @Override + public Crumble copy() { + return new Crumble(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/Detonate.java b/Mage.Sets/src/mage/sets/antiquities/Detonate.java new file mode 100644 index 00000000000..532834aed00 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/Detonate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Detonate extends mage.sets.fifthedition.Detonate { + + public Detonate(UUID ownerId) { + super(ownerId); + this.cardNumber = 89; + this.expansionSetCode = "ATQ"; + } + + public Detonate(final Detonate card) { + super(card); + } + + @Override + public Detonate copy() { + return new Detonate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/DrafnasRestoration.java b/Mage.Sets/src/mage/sets/antiquities/DrafnasRestoration.java new file mode 100644 index 00000000000..fc24c4ffcbb --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/DrafnasRestoration.java @@ -0,0 +1,142 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterArtifactCard; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.common.TargetCardInGraveyard; + +/** + * + * @author emerald000 + */ +public class DrafnasRestoration extends CardImpl { + + public DrafnasRestoration(UUID ownerId) { + super(ownerId, 52, "Drafna's Restoration", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); + this.expansionSetCode = "ATQ"; + + // Return any number of target artifact cards from target player's graveyard to the top of his or her library in any order. + this.getSpellAbility().addEffect(new DrafnasRestorationEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addTarget(new DrafnasRestorationTarget()); + } + + public DrafnasRestoration(final DrafnasRestoration card) { + super(card); + } + + @Override + public DrafnasRestoration copy() { + return new DrafnasRestoration(this); + } +} + +class DrafnasRestorationTarget extends TargetCardInGraveyard { + + DrafnasRestorationTarget() { + super(0, Integer.MAX_VALUE, new FilterArtifactCard("any number of artifact cards from that player's graveyard")); + } + + DrafnasRestorationTarget(final DrafnasRestorationTarget target) { + super(target); + } + + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Player targetPlayer = game.getPlayer(source.getFirstTarget()); + return targetPlayer != null && targetPlayer.getGraveyard().contains(id) && super.canTarget(id, source, game); + } + + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet<>(); + MageObject object = game.getObject(sourceId); + if (object != null && object instanceof StackObject) { + Player targetPlayer = game.getPlayer(((StackObject) object).getStackAbility().getFirstTarget()); + if (targetPlayer != null) { + for (Card card : targetPlayer.getGraveyard().getCards(filter, sourceId, sourceControllerId, game)) { + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.TARGET, card.getId(), sourceId, sourceControllerId))) { + possibleTargets.add(card.getId()); + } + } + } + } + return possibleTargets; + } + + @Override + public DrafnasRestorationTarget copy() { + return new DrafnasRestorationTarget(this); + } +} + +class DrafnasRestorationEffect extends OneShotEffect { + + DrafnasRestorationEffect() { + super(Outcome.Benefit); + this.staticText = "Return any number of target artifact cards from target player's graveyard to the top of his or her library in any order"; + } + + DrafnasRestorationEffect(final DrafnasRestorationEffect effect) { + super(effect); + } + + @Override + public DrafnasRestorationEffect copy() { + return new DrafnasRestorationEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Cards cards = new CardsImpl(source.getTargets().get(1).getTargets()); + controller.putCardsOnTopOfLibrary(cards, game, source, true); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/DwarvenWeaponsmith.java b/Mage.Sets/src/mage/sets/antiquities/DwarvenWeaponsmith.java new file mode 100644 index 00000000000..e6ae84b22ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/DwarvenWeaponsmith.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DwarvenWeaponsmith extends mage.sets.revisededition.DwarvenWeaponsmith { + + public DwarvenWeaponsmith(UUID ownerId) { + super(ownerId); + this.cardNumber = 90; + this.expansionSetCode = "ATQ"; + } + + public DwarvenWeaponsmith(final DwarvenWeaponsmith card) { + super(card); + } + + @Override + public DwarvenWeaponsmith copy() { + return new DwarvenWeaponsmith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java b/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java new file mode 100644 index 00000000000..4d902ed4b3b --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java @@ -0,0 +1,99 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.target.common.TargetArtifactPermanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class GateToPhyrexia extends CardImpl { + + public GateToPhyrexia(UUID ownerId) { + super(ownerId, 46, "Gate to Phyrexia", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}"); + this.expansionSetCode = "ATQ"; + + // Sacrifice a creature: Destroy target artifact. Activate this ability only during your upkeep and only once each turn. + Ability ability = new GateToPhyrexiaAbility(new DestroyTargetEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addTarget(new TargetArtifactPermanent()); + this.addAbility(ability); + } + + public GateToPhyrexia(final GateToPhyrexia card) { + super(card); + } + + @Override + public GateToPhyrexia copy() { + return new GateToPhyrexia(this); + } +} + +class GateToPhyrexiaAbility extends LimitedTimesPerTurnActivatedAbility { + + public GateToPhyrexiaAbility(Effect effect, Cost cost) { + super(Zone.BATTLEFIELD, effect, cost); + } + + public GateToPhyrexiaAbility(final GateToPhyrexiaAbility ability) { + super(ability); + } + + @Override + public GateToPhyrexiaAbility copy() { + return new GateToPhyrexiaAbility(this); + } + + @Override + public boolean canActivate(UUID playerId, Game game) { + if (!game.getActivePlayerId().equals(controllerId) || !PhaseStep.UPKEEP.equals(game.getStep().getType())) { + return false; + } + return super.canActivate(playerId, game); + } + + @Override + public String getRule() { + return "Sacrifice a creature: Destroy target artifact. Activate this ability only during your upkeep and only once each turn."; + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/MishrasFactory.java b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory1.java similarity index 86% rename from Mage.Sets/src/mage/sets/antiquities/MishrasFactory.java rename to Mage.Sets/src/mage/sets/antiquities/MishrasFactory1.java index 6d6b78a838e..22b9008494e 100644 --- a/Mage.Sets/src/mage/sets/antiquities/MishrasFactory.java +++ b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory1.java @@ -1,52 +1,52 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.antiquities; - -import java.util.UUID; - -/** - * - * @author North - */ -public class MishrasFactory extends mage.sets.elspethvstezzeret.MishrasFactory { - - public MishrasFactory(UUID ownerId) { - super(ownerId); - this.cardNumber = 66; - this.expansionSetCode = "ATQ"; - } - - public MishrasFactory(final MishrasFactory card) { - super(card); - } - - @Override - public MishrasFactory copy() { - return new MishrasFactory(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; + +/** + * + * @author North + */ +public class MishrasFactory1 extends mage.sets.elspethvstezzeret.MishrasFactory { + + public MishrasFactory1(UUID ownerId) { + super(ownerId); + this.cardNumber = 66; + this.expansionSetCode = "ATQ"; + } + + public MishrasFactory1(final MishrasFactory1 card) { + super(card); + } + + @Override + public MishrasFactory1 copy() { + return new MishrasFactory1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/MishrasFactory2.java b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory2.java new file mode 100644 index 00000000000..9458ff624d1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; + +/** + * + * @author North + */ +public class MishrasFactory2 extends mage.sets.elspethvstezzeret.MishrasFactory { + + public MishrasFactory2(UUID ownerId) { + super(ownerId); + this.cardNumber = 67; + this.expansionSetCode = "ATQ"; + } + + public MishrasFactory2(final MishrasFactory2 card) { + super(card); + } + + @Override + public MishrasFactory2 copy() { + return new MishrasFactory2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/MishrasFactory3.java b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory3.java new file mode 100644 index 00000000000..b16a376ccc6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory3.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; + +/** + * + * @author North + */ +public class MishrasFactory3 extends mage.sets.elspethvstezzeret.MishrasFactory { + + public MishrasFactory3(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "ATQ"; + } + + public MishrasFactory3(final MishrasFactory3 card) { + super(card); + } + + @Override + public MishrasFactory3 copy() { + return new MishrasFactory3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/MishrasFactory4.java b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory4.java new file mode 100644 index 00000000000..231cc38ca58 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/MishrasFactory4.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; + +/** + * + * @author North + */ +public class MishrasFactory4 extends mage.sets.elspethvstezzeret.MishrasFactory { + + public MishrasFactory4(UUID ownerId) { + super(ownerId); + this.cardNumber = 69; + this.expansionSetCode = "ATQ"; + } + + public MishrasFactory4(final MishrasFactory4 card) { + super(card); + } + + @Override + public MishrasFactory4 copy() { + return new MishrasFactory4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/OrcishMechanics.java b/Mage.Sets/src/mage/sets/antiquities/OrcishMechanics.java new file mode 100644 index 00000000000..652a31eb97a --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/OrcishMechanics.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledArtifactPermanent; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class OrcishMechanics extends CardImpl { + + public OrcishMechanics(UUID ownerId) { + super(ownerId, 92, "Orcish Mechanics", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ATQ"; + this.subtype.add("Orc"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}, Sacrifice an artifact: Orcish Mechanics deals 2 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact")))); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public OrcishMechanics(final OrcishMechanics card) { + super(card); + } + + @Override + public OrcishMechanics copy() { + return new OrcishMechanics(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/PhyrexianGremlins.java b/Mage.Sets/src/mage/sets/antiquities/PhyrexianGremlins.java new file mode 100644 index 00000000000..884198052d5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/PhyrexianGremlins.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DontUntapAsLongAsSourceTappedEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author LoneFox + */ +public class PhyrexianGremlins extends CardImpl { + + public PhyrexianGremlins(UUID ownerId) { + super(ownerId, 48, "Phyrexian Gremlins", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "ATQ"; + this.subtype.add("Gremlin"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // You may choose not to untap Phyrexian Gremlins during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {tap}: Tap target artifact. It doesn't untap during its controller's untap step for as long as Phyrexian Gremlins remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetArtifactPermanent()); + ability.addEffect(new DontUntapAsLongAsSourceTappedEffect()); + this.addAbility(ability); + } + + public PhyrexianGremlins(final PhyrexianGremlins card) { + super(card); + } + + @Override + public PhyrexianGremlins copy() { + return new PhyrexianGremlins(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/PowerArtifact.java b/Mage.Sets/src/mage/sets/antiquities/PowerArtifact.java index 64ac7fd00bf..b36596b5cbe 100644 --- a/Mage.Sets/src/mage/sets/antiquities/PowerArtifact.java +++ b/Mage.Sets/src/mage/sets/antiquities/PowerArtifact.java @@ -8,6 +8,7 @@ package mage.sets.antiquities; import java.util.UUID; import mage.Mana; import mage.abilities.Ability; +import mage.abilities.ActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.cost.CostModificationEffectImpl; @@ -32,48 +33,46 @@ import mage.util.CardUtil; * @author nick.myers */ public class PowerArtifact extends CardImpl { - + public PowerArtifact(UUID ownerId) { super(ownerId, 55, "Power Artifact", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}"); this.expansionSetCode = "ATQ"; this.subtype.add("Aura"); - + // Enchant artifact TargetPermanent auraTarget = new TargetArtifactPermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - - // The activation cost of target artifact is reduced by {2}. If this would reduce target - // artifact's activation cost below {1}, target artifact's activation cost becomes {1}. - // Power Artifact has no effect on artifacts that have no activation cost or whose activation - // cost is {0}. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PowerArtifactCostModificationEffect())); + + // Enchanted artifact's activated abilities cost less to activate. + // This effect can't reduce the amount of mana an ability costs to activate to less than one mana. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PowerArtifactCostModificationEffect())); } - + public PowerArtifact(final PowerArtifact card) { super(card); } - + @Override public PowerArtifact copy() { return new PowerArtifact(this); - } + } } class PowerArtifactCostModificationEffect extends CostModificationEffectImpl { - + PowerArtifactCostModificationEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); staticText = "The activation cost of target artifact is reduced by {2}. If this would reduce target artifact's activation cost below {1}, target artifact's activation cost becomes {1}. Power artifact has no effect on artifacts that have no activation cost or whose activation cost is {0}."; - + } - + PowerArtifactCostModificationEffect(PowerArtifactCostModificationEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source, Ability abilityToModify) { Player controller = game.getPlayer(abilityToModify.getControllerId()); @@ -90,21 +89,22 @@ class PowerArtifactCostModificationEffect extends CostModificationEffectImpl { } return true; } - + @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { Permanent artifact = game.getPermanent(abilityToModify.getSourceId()); if (artifact != null && artifact.getAttachments().contains(source.getSourceId())) { - if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED)) { + if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED) + || (abilityToModify.getAbilityType().equals(AbilityType.MANA) && (abilityToModify instanceof ActivatedAbility))) { return true; } } return false; } - - @Override + + @Override public PowerArtifactCostModificationEffect copy() { return new PowerArtifactCostModificationEffect(this); } - + } diff --git a/Mage.Sets/src/mage/sets/antiquities/PriestOfYawgmoth.java b/Mage.Sets/src/mage/sets/antiquities/PriestOfYawgmoth.java new file mode 100644 index 00000000000..e648e0db971 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/PriestOfYawgmoth.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.mana.DynamicManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledArtifactPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class PriestOfYawgmoth extends CardImpl { + + public PriestOfYawgmoth(UUID ownerId) { + super(ownerId, 49, "Priest of Yawgmoth", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ATQ"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {T}, Sacrifice an artifact: Add to your mana pool an amount of {B} equal to the sacrificed artifact's converted mana cost. + Ability ability = new DynamicManaAbility(Mana.BlackMana, new SacrificeCostConvertedMana("artifact"), + new TapSourceCost(), "add to your mana pool an amount of {B} equal to the sacrificed artifact's converted mana cost"); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent()))); + this.addAbility(ability); + } + + public PriestOfYawgmoth(final PriestOfYawgmoth card) { + super(card); + } + + @Override + public PriestOfYawgmoth copy() { + return new PriestOfYawgmoth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/StripMine.java b/Mage.Sets/src/mage/sets/antiquities/StripMine1.java similarity index 87% rename from Mage.Sets/src/mage/sets/antiquities/StripMine.java rename to Mage.Sets/src/mage/sets/antiquities/StripMine1.java index 3c782223293..c79ee940f21 100644 --- a/Mage.Sets/src/mage/sets/antiquities/StripMine.java +++ b/Mage.Sets/src/mage/sets/antiquities/StripMine1.java @@ -1,52 +1,52 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.antiquities; - -import java.util.UUID; - -/** - * - * @author jeffwadsworth - */ -public class StripMine extends mage.sets.fourthedition.StripMine { - - public StripMine(UUID ownerId) { - super(ownerId); - this.cardNumber = 71; - this.expansionSetCode = "ATQ"; - } - - public StripMine(final StripMine card) { - super(card); - } - - @Override - public StripMine copy() { - return new StripMine(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class StripMine1 extends mage.sets.fourthedition.StripMine { + + public StripMine1(UUID ownerId) { + super(ownerId); + this.cardNumber = 71; + this.expansionSetCode = "ATQ"; + } + + public StripMine1(final StripMine1 card) { + super(card); + } + + @Override + public StripMine1 copy() { + return new StripMine1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/StripMine2.java b/Mage.Sets/src/mage/sets/antiquities/StripMine2.java new file mode 100644 index 00000000000..5c21b154770 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/StripMine2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class StripMine2 extends mage.sets.fourthedition.StripMine { + + public StripMine2(UUID ownerId) { + super(ownerId); + this.cardNumber = 72; + this.expansionSetCode = "ATQ"; + } + + public StripMine2(final StripMine2 card) { + super(card); + } + + @Override + public StripMine2 copy() { + return new StripMine2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/StripMine3.java b/Mage.Sets/src/mage/sets/antiquities/StripMine3.java new file mode 100644 index 00000000000..f88759c681b --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/StripMine3.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class StripMine3 extends mage.sets.fourthedition.StripMine { + + public StripMine3(UUID ownerId) { + super(ownerId); + this.cardNumber = 73; + this.expansionSetCode = "ATQ"; + } + + public StripMine3(final StripMine3 card) { + super(card); + } + + @Override + public StripMine3 copy() { + return new StripMine3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/StripMine4.java b/Mage.Sets/src/mage/sets/antiquities/StripMine4.java new file mode 100644 index 00000000000..86e04cbcc99 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/StripMine4.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class StripMine4 extends mage.sets.fourthedition.StripMine { + + public StripMine4(UUID ownerId) { + super(ownerId); + this.cardNumber = 74; + this.expansionSetCode = "ATQ"; + } + + public StripMine4(final StripMine4 card) { + super(card); + } + + @Override + public StripMine4 copy() { + return new StripMine4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/TawnossWeaponry.java b/Mage.Sets/src/mage/sets/antiquities/TawnossWeaponry.java new file mode 100644 index 00000000000..153f22154a2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/TawnossWeaponry.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class TawnossWeaponry extends mage.sets.fifthedition.TawnossWeaponry { + + public TawnossWeaponry(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "ATQ"; + } + + public TawnossWeaponry(final TawnossWeaponry card) { + super(card); + } + + @Override + public TawnossWeaponry copy() { + return new TawnossWeaponry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/TransmuteArtifact.java b/Mage.Sets/src/mage/sets/antiquities/TransmuteArtifact.java index d0b6d85fde4..7a12056f9a8 100644 --- a/Mage.Sets/src/mage/sets/antiquities/TransmuteArtifact.java +++ b/Mage.Sets/src/mage/sets/antiquities/TransmuteArtifact.java @@ -27,7 +27,6 @@ */ package mage.sets.antiquities; -import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.costs.mana.GenericManaCost; @@ -43,7 +42,6 @@ import mage.filter.common.FilterControlledArtifactPermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; -import mage.target.common.TargetArtifactPermanent; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledPermanent; @@ -57,7 +55,6 @@ public class TransmuteArtifact extends CardImpl { super(ownerId, 58, "Transmute Artifact", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{U}{U}"); this.expansionSetCode = "ATQ"; - // Sacrifice an artifact. If you do, search your library for an artifact card. If that card's converted mana cost is less than or equal to the sacrificed artifact's converted mana cost, put it onto the battlefield. If it's greater, you may pay {X}, where X is the difference. If you do, put it onto the battlefield. If you don't, put it into its owner's graveyard. Then shuffle your library. this.getSpellAbility().addEffect(new TransmuteArtifactEffect()); } @@ -74,7 +71,6 @@ public class TransmuteArtifact extends CardImpl { class TransmuteArtifactEffect extends SearchEffect { - public TransmuteArtifactEffect() { super(new TargetCardInLibrary(new FilterArtifactCard()), Outcome.PutCardInPlay); staticText = "Sacrifice an artifact. If you do, search your library for an artifact card. If that card's converted mana cost is less than or equal to the sacrificed artifact's converted mana cost, put it onto the battlefield. If it's greater, you may pay {X}, where X is the difference. If you do, put it onto the battlefield. If you don't, put it into its owner's graveyard. Then shuffle your library"; @@ -95,41 +91,36 @@ class TransmuteArtifactEffect extends SearchEffect { if (controller == null) { return false; } - //Sacrifice an artifact. + //Sacrifice an artifact. int convertedManaCost = 0; boolean sacrifice = false; TargetControlledPermanent targetArtifact = new TargetControlledPermanent(new FilterControlledArtifactPermanent()); - if(controller.chooseTarget(Outcome.Sacrifice, targetArtifact, source, game)){ + if (controller.chooseTarget(Outcome.Sacrifice, targetArtifact, source, game)) { Permanent permanent = game.getPermanent(targetArtifact.getFirstTarget()); - if(permanent != null){ + if (permanent != null) { convertedManaCost = permanent.getManaCost().convertedManaCost(); sacrifice = permanent.sacrifice(source.getSourceId(), game); } - } - else - { + } else { return true; } - //If you do, search your library for an artifact card. + //If you do, search your library for an artifact card. if (sacrifice && controller.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { - for (UUID cardId: target.getTargets()) { + for (UUID cardId : target.getTargets()) { Card card = controller.getLibrary().getCard(cardId, game); if (card != null) { - //If that card's converted mana cost is less than or equal to the sacrificed artifact's converted mana cost, put it onto the battlefield. - if(card.getManaCost().convertedManaCost() <= convertedManaCost){ - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); - } - else - { - //If it's greater, you may pay {X}, where X is the difference. If you do, put it onto the battlefield. + //If that card's converted mana cost is less than or equal to the sacrificed artifact's converted mana cost, put it onto the battlefield. + if (card.getManaCost().convertedManaCost() <= convertedManaCost) { + controller.moveCards(card, Zone.BATTLEFIELD, source, game); + } else { + //If it's greater, you may pay {X}, where X is the difference. If you do, put it onto the battlefield. GenericManaCost cost = new GenericManaCost(card.getManaCost().convertedManaCost() - convertedManaCost); - if(cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)){ - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); - } - else{ + if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { + controller.moveCards(card, Zone.BATTLEFIELD, source, game); + } else { //If you don't, put it into its owner's graveyard. Then shuffle your library - controller.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); + controller.moveCards(card, Zone.GRAVEYARD, source, game); } } } @@ -142,5 +133,4 @@ class TransmuteArtifactEffect extends SearchEffect { return false; } - } diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasMine1.java b/Mage.Sets/src/mage/sets/antiquities/UrzasMine1.java new file mode 100644 index 00000000000..fc87a23f361 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasMine1.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasMine1 extends mage.sets.fifthedition.UrzasMine { + + public UrzasMine1(UUID ownerId) { + super(ownerId); + this.cardNumber = 75; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasMine1(final UrzasMine1 card) { + super(card); + } + + @Override + public UrzasMine1 copy() { + return new UrzasMine1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasMine2.java b/Mage.Sets/src/mage/sets/antiquities/UrzasMine2.java new file mode 100644 index 00000000000..d57c1ea7d7e --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasMine2.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasMine2 extends mage.sets.fifthedition.UrzasMine { + + public UrzasMine2(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasMine2(final UrzasMine2 card) { + super(card); + } + + @Override + public UrzasMine2 copy() { + return new UrzasMine2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasMine3.java b/Mage.Sets/src/mage/sets/antiquities/UrzasMine3.java new file mode 100644 index 00000000000..73e045a5ae7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasMine3.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasMine3 extends mage.sets.fifthedition.UrzasMine { + + public UrzasMine3(UUID ownerId) { + super(ownerId); + this.cardNumber = 77; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasMine3(final UrzasMine3 card) { + super(card); + } + + @Override + public UrzasMine3 copy() { + return new UrzasMine3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasMine4.java b/Mage.Sets/src/mage/sets/antiquities/UrzasMine4.java new file mode 100644 index 00000000000..024ab021ba6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasMine4.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasMine4 extends mage.sets.fifthedition.UrzasMine { + + public UrzasMine4(UUID ownerId) { + super(ownerId); + this.cardNumber = 78; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasMine4(final UrzasMine4 card) { + super(card); + } + + @Override + public UrzasMine4 copy() { + return new UrzasMine4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant1.java b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant1.java new file mode 100644 index 00000000000..d829ecee1fb --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant1.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasPowerPlant1 extends mage.sets.fifthedition.UrzasPowerPlant { + + public UrzasPowerPlant1(UUID ownerId) { + super(ownerId); + this.cardNumber = 79; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasPowerPlant1(final UrzasPowerPlant1 card) { + super(card); + } + + @Override + public UrzasPowerPlant1 copy() { + return new UrzasPowerPlant1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant2.java b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant2.java new file mode 100644 index 00000000000..db3047ee783 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant2.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasPowerPlant2 extends mage.sets.fifthedition.UrzasPowerPlant { + + public UrzasPowerPlant2(UUID ownerId) { + super(ownerId); + this.cardNumber = 80; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasPowerPlant2(final UrzasPowerPlant2 card) { + super(card); + } + + @Override + public UrzasPowerPlant2 copy() { + return new UrzasPowerPlant2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant3.java b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant3.java new file mode 100644 index 00000000000..03a017e941b --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant3.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasPowerPlant3 extends mage.sets.fifthedition.UrzasPowerPlant { + + public UrzasPowerPlant3(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasPowerPlant3(final UrzasPowerPlant3 card) { + super(card); + } + + @Override + public UrzasPowerPlant3 copy() { + return new UrzasPowerPlant3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant4.java b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant4.java new file mode 100644 index 00000000000..35ab56cf636 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant4.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasPowerPlant4 extends mage.sets.fifthedition.UrzasPowerPlant { + + public UrzasPowerPlant4(UUID ownerId) { + super(ownerId); + this.cardNumber = 82; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasPowerPlant4(final UrzasPowerPlant4 card) { + super(card); + } + + @Override + public UrzasPowerPlant4 copy() { + return new UrzasPowerPlant4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasTower1.java b/Mage.Sets/src/mage/sets/antiquities/UrzasTower1.java new file mode 100644 index 00000000000..9164d8a9ebc --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasTower1.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasTower1 extends mage.sets.fifthedition.UrzasTower { + + public UrzasTower1(UUID ownerId) { + super(ownerId); + this.cardNumber = 83; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasTower1(final UrzasTower1 card) { + super(card); + } + + @Override + public UrzasTower1 copy() { + return new UrzasTower1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasTower2.java b/Mage.Sets/src/mage/sets/antiquities/UrzasTower2.java new file mode 100644 index 00000000000..78554254747 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasTower2.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasTower2 extends mage.sets.fifthedition.UrzasTower { + + public UrzasTower2(UUID ownerId) { + super(ownerId); + this.cardNumber = 84; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasTower2(final UrzasTower2 card) { + super(card); + } + + @Override + public UrzasTower2 copy() { + return new UrzasTower2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasTower3.java b/Mage.Sets/src/mage/sets/antiquities/UrzasTower3.java new file mode 100644 index 00000000000..6df76eb4e6c --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasTower3.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasTower3 extends mage.sets.fifthedition.UrzasTower { + + public UrzasTower3(UUID ownerId) { + super(ownerId); + this.cardNumber = 85; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasTower3(final UrzasTower3 card) { + super(card); + } + + @Override + public UrzasTower3 copy() { + return new UrzasTower3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasTower4.java b/Mage.Sets/src/mage/sets/antiquities/UrzasTower4.java new file mode 100644 index 00000000000..9c7633bcc0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/UrzasTower4.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class UrzasTower4 extends mage.sets.fifthedition.UrzasTower { + + public UrzasTower4(UUID ownerId) { + super(ownerId); + this.cardNumber = 86; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public UrzasTower4(final UrzasTower4 card) { + super(card); + } + + @Override + public UrzasTower4 copy() { + return new UrzasTower4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/apocalypse/Anavolver.java b/Mage.Sets/src/mage/sets/apocalypse/Anavolver.java index 0452fbb018e..a746e9877c9 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/Anavolver.java +++ b/Mage.Sets/src/mage/sets/apocalypse/Anavolver.java @@ -68,14 +68,14 @@ public class Anavolver extends CardImpl { // If Anavolver was kicked with its {1}{U} kicker, it enters the battlefield with two +1/+1 counters on it and with flying. EntersBattlefieldAbility ability1 = new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(2),false), - new KickedCostCondition("{1}{U}"), true, "If {this} was kicked with its {1}{U} kicker, it enters the battlefield with two +1/+1 counters on it and with flying.", + new KickedCostCondition("{1}{U}"), "If {this} was kicked with its {1}{U} kicker, it enters the battlefield with two +1/+1 counters on it and with flying.", "{this} enters the battlefield with two +1/+1 counters on it and with flying"); ((EntersBattlefieldEffect)ability1.getEffects().get(0)).addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability1); // If Anavolver was kicked with its {B} kicker, it enters the battlefield with a +1/+1 counter on it and with "Pay 3 life: Regenerate Anavolver." EntersBattlefieldAbility ability2 = new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance(1),false), new KickedCostCondition("{B}"), true, + new AddCountersSourceEffect(CounterType.P1P1.createInstance(1),false), new KickedCostCondition("{B}"), "If {this} was kicked with its {B} kicker, it enters the battlefield with a +1/+1 counter on it and with \"Pay 3 life: Regenerate Anavolver.\"", "{this} enters the battlefield with a +1/+1 counter on it and with \"Pay 3 life: Regenerate Anavolver.\""); ((EntersBattlefieldEffect)ability2.getEffects().get(0)).addEffect(new GainAbilitySourceEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new PayLifeCost(3)), Duration.WhileOnBattlefield)); diff --git a/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java b/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java index efc75cfd615..560c89d024e 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java +++ b/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java @@ -31,25 +31,26 @@ package mage.sets.apocalypse; import java.util.UUID; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SpellCastAllTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.FilterCard; +import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; /** * @author Loki */ public class BogGnarr extends CardImpl { + private static final FilterSpell filter = new FilterSpell("a black spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + public BogGnarr(UUID ownerId) { super(ownerId, 76, "Bog Gnarr", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); this.expansionSetCode = "APC"; @@ -57,7 +58,9 @@ public class BogGnarr extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new BogGnarrTriggeredAbility()); + + // Whenever a player casts a black spell, Bog Gnarr gets +2/+2 until end of turn. + this.addAbility(new SpellCastAllTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), filter, false)); } public BogGnarr(final BogGnarr card) { @@ -68,43 +71,4 @@ public class BogGnarr extends CardImpl { public BogGnarr copy() { return new BogGnarr(this); } - } - -class BogGnarrTriggeredAbility extends TriggeredAbilityImpl { - - private static final FilterCard filter = new FilterCard("a black spell"); - - static { - filter.add(new ColorPredicate(ObjectColor.BLACK)); - } - - public BogGnarrTriggeredAbility() { - super(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), false); - } - - public BogGnarrTriggeredAbility(final BogGnarrTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && filter.match(spell, game); - } - - @Override - public String getRule() { - return "Whenever a player casts " + filter.getMessage() + ", " + super.getRule(); - } - - @Override - public BogGnarrTriggeredAbility copy() { - return new BogGnarrTriggeredAbility(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/apocalypse/Cetavolver.java b/Mage.Sets/src/mage/sets/apocalypse/Cetavolver.java index 8a040de3b0d..16029793e73 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/Cetavolver.java +++ b/Mage.Sets/src/mage/sets/apocalypse/Cetavolver.java @@ -65,14 +65,14 @@ public class Cetavolver extends CardImpl { // If Cetavolver was kicked with its {1}{R} kicker, it enters the battlefield with two +1/+1 counters on it and with first strike. EntersBattlefieldAbility ability1 = new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(2),false), - new KickedCostCondition("{1}{R}"), true, "If Cetavolver was kicked with its {1}{R} kicker, it enters the battlefield with two +1/+1 counters on it and with first strike.", + new KickedCostCondition("{1}{R}"), "If Cetavolver was kicked with its {1}{R} kicker, it enters the battlefield with two +1/+1 counters on it and with first strike.", "{this} enters the battlefield with two +1/+1 counters on it and with first strike"); ((EntersBattlefieldEffect)ability1.getEffects().get(0)).addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability1); // If Cetavolver was kicked with its {G} kicker, it enters the battlefield with a +1/+1 counter on it and with trample. EntersBattlefieldAbility ability2 = new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance(1),false), new KickedCostCondition("{G}"), true, + new AddCountersSourceEffect(CounterType.P1P1.createInstance(1),false), new KickedCostCondition("{G}"), "If Cetavolver was kicked with its {G} kicker, it enters the battlefield with a +1/+1 counter on it and with trample.", "{this} enters the battlefield with a +1/+1 counter on it and with trample"); ((EntersBattlefieldEffect)ability2.getEffects().get(0)).addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield)); diff --git a/Mage.Sets/src/mage/sets/apocalypse/Degavolver.java b/Mage.Sets/src/mage/sets/apocalypse/Degavolver.java index 87577042db5..c0b557454ac 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/Degavolver.java +++ b/Mage.Sets/src/mage/sets/apocalypse/Degavolver.java @@ -69,14 +69,14 @@ public class Degavolver extends CardImpl { // If Degavolver was kicked with its {1}{B} kicker, it enters the battlefield with two +1/+1 counters on it and with "Pay 3 life: Regenerate Degavolver." EntersBattlefieldAbility ability1 = new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(2),false), - new KickedCostCondition("{1}{B}"), true, "If Degavolver was kicked with its {1}{B} kicker, it enters the battlefield with two +1/+1 counters on it and with \"Pay 3 life: Regenerate Degavolver.\"", + new KickedCostCondition("{1}{B}"), "If Degavolver was kicked with its {1}{B} kicker, it enters the battlefield with two +1/+1 counters on it and with \"Pay 3 life: Regenerate Degavolver.\"", "{this} enters the battlefield with two +1/+1 counters on it and with \"Pay 3 life: Regenerate Degavolver.\""); ((EntersBattlefieldEffect)ability1.getEffects().get(0)).addEffect(new GainAbilitySourceEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new PayLifeCost(3)), Duration.WhileOnBattlefield)); this.addAbility(ability1); // If Degavolver was kicked with its {R} kicker, it enters the battlefield with a +1/+1 counter on it and with first strike. EntersBattlefieldAbility ability2 = new EntersBattlefieldAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance(1),false), new KickedCostCondition("{R}"), true, + new AddCountersSourceEffect(CounterType.P1P1.createInstance(1),false), new KickedCostCondition("{R}"), "If Degavolver was kicked with its {R} kicker, it enters the battlefield with a +1/+1 counter on it and with first strike.", "{this} enters the battlefield with a +1/+1 counter on it and with first strike"); ((EntersBattlefieldEffect)ability2.getEffects().get(0)).addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield)); diff --git a/Mage.Sets/src/mage/sets/apocalypse/DesolationAngel.java b/Mage.Sets/src/mage/sets/apocalypse/DesolationAngel.java index 4c32f5136e9..be3613ad5a8 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/DesolationAngel.java +++ b/Mage.Sets/src/mage/sets/apocalypse/DesolationAngel.java @@ -25,31 +25,35 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.apocalypse; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.KickedCondition; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.KickerAbility; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; import mage.filter.common.FilterLandPermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @author Loki */ public class DesolationAngel extends CardImpl { + private static final FilterLandPermanent filter = new FilterLandPermanent("lands"); + private static final FilterLandPermanent filter2 = new FilterLandPermanent("lands you control"); + + static { + filter2.add(new ControllerPredicate(TargetController.YOU)); + } + public DesolationAngel(UUID ownerId) { super(ownerId, 38, "Desolation Angel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.expansionSetCode = "APC"; @@ -65,7 +69,8 @@ public class DesolationAngel extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // When Desolation Angel enters the battlefield, destroy all lands you control. If it was kicked, destroy all lands instead. - this.addAbility(new EntersBattlefieldTriggeredAbility(new DesolationAngelEntersBattlefieldEffect())); + this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DestroyAllEffect(filter), + new DestroyAllEffect(filter2), KickedCondition.getInstance(), "destroy all lands you control. If it was kicked, destroy all lands instead."))); } public DesolationAngel(final DesolationAngel card) { @@ -77,33 +82,3 @@ public class DesolationAngel extends CardImpl { return new DesolationAngel(this); } } - -class DesolationAngelEntersBattlefieldEffect extends OneShotEffect { - DesolationAngelEntersBattlefieldEffect() { - super(Outcome.DestroyPermanent); - staticText = "destroy all lands you control. If it was kicked, destroy all lands instead"; - } - - DesolationAngelEntersBattlefieldEffect(final DesolationAngelEntersBattlefieldEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Card p = game.getCard(source.getSourceId()); - boolean kicked = KickedCondition.getInstance().apply(game, source); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), source.getSourceId(), game)) { - if ((!kicked && permanent.getControllerId() == source.getControllerId()) - || kicked) { - permanent.destroy(source.getSourceId(), game, false); - } - } - return true; - } - - @Override - public DesolationAngelEntersBattlefieldEffect copy() { - return new DesolationAngelEntersBattlefieldEffect(this); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/apocalypse/DwarvenLandslide.java b/Mage.Sets/src/mage/sets/apocalypse/DwarvenLandslide.java index 4edae4f5649..65b47b76d27 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/DwarvenLandslide.java +++ b/Mage.Sets/src/mage/sets/apocalypse/DwarvenLandslide.java @@ -29,6 +29,7 @@ package mage.sets.apocalypse; import java.util.UUID; import mage.abilities.Ability; +import mage.abilities.SpellAbility; import mage.abilities.condition.common.KickedCondition; import mage.abilities.costs.Cost; import mage.abilities.costs.Costs; @@ -41,6 +42,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetLandPermanent; @@ -62,6 +64,7 @@ public class DwarvenLandslide extends CardImpl { this.addAbility(new KickerAbility(kickerCosts)); // Destroy target land. If Dwarven Landslide was kicked, destroy another target land. getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target land. If {this} was kicked, destroy another target land")); + getSpellAbility().addTarget(new TargetLandPermanent()); } public DwarvenLandslide(final DwarvenLandslide card) { @@ -70,7 +73,11 @@ public class DwarvenLandslide extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { - ability.addTarget(new TargetLandPermanent(KickedCondition.getInstance().apply(game, ability) ? 2 : 1)); + if (ability instanceof SpellAbility) { + if (KickedCondition.getInstance().apply(game, ability)) { + getSpellAbility().addTarget(new TargetLandPermanent(new FilterLandPermanent("land (Kicker)"))); + } + } } @Override diff --git a/Mage.Sets/src/mage/sets/apocalypse/FungalShambler.java b/Mage.Sets/src/mage/sets/apocalypse/FungalShambler.java index 385de243c2c..b9f0b5e9ec4 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/FungalShambler.java +++ b/Mage.Sets/src/mage/sets/apocalypse/FungalShambler.java @@ -58,7 +58,7 @@ public class FungalShambler extends CardImpl { // Whenever Fungal Shambler deals damage to an opponent, you draw a card and that opponent discards a card. Effect effect = new DrawCardSourceControllerEffect(1); effect.setText("you draw a card"); - Ability ability = new DealsDamageToOpponentTriggeredAbility(effect, false); + Ability ability = new DealsDamageToOpponentTriggeredAbility(effect, false, false, true); effect = new DiscardTargetEffect(1); effect.setText("and that opponent discards a card"); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/sets/apocalypse/GladeGnarr.java b/Mage.Sets/src/mage/sets/apocalypse/GladeGnarr.java index 4ff643a49d7..d09a25aafdc 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/GladeGnarr.java +++ b/Mage.Sets/src/mage/sets/apocalypse/GladeGnarr.java @@ -30,25 +30,26 @@ package mage.sets.apocalypse; import java.util.UUID; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SpellCastAllTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.FilterCard; +import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; /** * @author Loki */ public class GladeGnarr extends CardImpl { + private static final FilterSpell filter = new FilterSpell("a blue spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + public GladeGnarr(UUID ownerId) { super(ownerId, 78, "Glade Gnarr", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}"); this.expansionSetCode = "APC"; @@ -56,7 +57,9 @@ public class GladeGnarr extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(4); - this.addAbility(new GladeGnarrTriggeredAbility()); + + // Whenever a player casts a blue spell, Glade Gnarr gets +2/+2 until end of turn. + this.addAbility(new SpellCastAllTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), filter, false)); } public GladeGnarr(final GladeGnarr card) { @@ -68,41 +71,3 @@ public class GladeGnarr extends CardImpl { return new GladeGnarr(this); } } - -class GladeGnarrTriggeredAbility extends TriggeredAbilityImpl { - - private static final FilterCard filter = new FilterCard("a black spell"); - - static { - filter.add(new ColorPredicate(ObjectColor.BLACK)); - } - - public GladeGnarrTriggeredAbility() { - super(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), false); - } - - public GladeGnarrTriggeredAbility(final GladeGnarrTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && filter.match(spell, game); - } - - @Override - public String getRule() { - return "Whenever a player casts " + filter.getMessage() + ", " + super.getRule(); - } - - @Override - public GladeGnarrTriggeredAbility copy() { - return new GladeGnarrTriggeredAbility(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/apocalypse/LifeDeath.java b/Mage.Sets/src/mage/sets/apocalypse/LifeDeath.java index 1db52a16d06..0cdede7a804 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/LifeDeath.java +++ b/Mage.Sets/src/mage/sets/apocalypse/LifeDeath.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.apocalypse; import java.util.UUID; @@ -34,11 +33,11 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect; import mage.cards.Card; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.cards.SplitCard; +import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterCreatureCard; @@ -52,7 +51,6 @@ import mage.target.common.TargetCardInYourGraveyard; * * @author LevelX2 */ - public class LifeDeath extends SplitCard { public LifeDeath(UUID ownerId) { @@ -61,8 +59,8 @@ public class LifeDeath extends SplitCard { // Life // All lands you control become 1/1 creatures until end of turn. They're still lands. - getLeftHalfCard().getSpellAbility().addEffect(new BecomesCreatureAllEffect(new LifeLandToken(), "lands", - new FilterControlledLandPermanent("lands you control"), Duration.EndOfTurn)); + getLeftHalfCard().getSpellAbility().addEffect(new BecomesCreatureAllEffect(new LifeLandToken(), "lands", + new FilterControlledLandPermanent("lands you control"), Duration.EndOfTurn)); // Death // Return target creature card from your graveyard to the battlefield. You lose life equal to its converted mana cost. @@ -83,6 +81,7 @@ public class LifeDeath extends SplitCard { } class LifeLandToken extends Token { + public LifeLandToken() { super("", "1/1 creatures"); cardType.add(CardType.CREATURE); @@ -115,10 +114,10 @@ class DeathEffect extends OneShotEffect { if (creatureCard != null && controller != null) { boolean result = false; if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) { - result = controller.putOntoBattlefieldWithInfo(creatureCard, game, Zone.GRAVEYARD, source.getSourceId()); - } + controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game); + } controller.loseLife(creatureCard.getManaCost().convertedManaCost(), game); - return result; + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/apocalypse/Necravolver.java b/Mage.Sets/src/mage/sets/apocalypse/Necravolver.java index 03427cbaf88..1a37ec37553 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/Necravolver.java +++ b/Mage.Sets/src/mage/sets/apocalypse/Necravolver.java @@ -64,12 +64,12 @@ public class Necravolver extends CardImpl { this.addAbility(kickerAbility); // If Necravolver was kicked with its {1}{G} kicker, it enters the battlefield with two +1/+1 counters on it and with trample. Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), - new KickedCostCondition("{1}{G}"), true, "If {this} was kicked with its {1}{G} kicker, it enters the battlefield with two +1/+1 counters on it and with trample.", ""); + new KickedCostCondition("{1}{G}"), "If {this} was kicked with its {1}{G} kicker, it enters the battlefield with two +1/+1 counters on it and with trample.", ""); ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); // If Necravolver was kicked with its {W} kicker, it enters the battlefield with a +1/+1 counter on it and with "Whenever Necravolver deals damage, you gain that much life." ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), - new KickedCostCondition("{W}"), true, "If {this} was kicked with its {W} kicker, it enters the battlefield with a +1/+1 counter on it and with \"Whenever {this} deals damage, you gain that much life.\"", ""); + new KickedCostCondition("{W}"), "If {this} was kicked with its {W} kicker, it enters the battlefield with a +1/+1 counter on it and with \"Whenever {this} deals damage, you gain that much life.\"", ""); ability.addEffect(new GainAbilitySourceEffect(new DealsDamageGainLifeSourceTriggeredAbility(), Duration.WhileOnBattlefield)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/apocalypse/Rakavolver.java b/Mage.Sets/src/mage/sets/apocalypse/Rakavolver.java index 62444bed93b..e020d9fd2ff 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/Rakavolver.java +++ b/Mage.Sets/src/mage/sets/apocalypse/Rakavolver.java @@ -64,12 +64,12 @@ public class Rakavolver extends CardImpl { this.addAbility(kickerAbility); // If Rakavolver was kicked with its {1}{W} kicker, it enters the battlefield with two +1/+1 counters on it and with "Whenever Rakavolver deals damage, you gain that much life." Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), - new KickedCostCondition("{1}{W}"), true, "If {this} was kicked with its {1}{W} kicker, it enters the battlefield with two +1/+1 counters on it and with \"Whenever {this} deals damage, you gain that much life.\"", ""); + new KickedCostCondition("{1}{W}"), "If {this} was kicked with its {1}{W} kicker, it enters the battlefield with two +1/+1 counters on it and with \"Whenever {this} deals damage, you gain that much life.\"", ""); ability.addEffect(new GainAbilitySourceEffect(new DealsDamageGainLifeSourceTriggeredAbility(), Duration.WhileOnBattlefield)); this.addAbility(ability); // If Rakavolver was kicked with its {U} kicker, it enters the battlefield with a +1/+1 counter on it and with flying. ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), - new KickedCostCondition("{U}"), true, "If {this} was kicked with its {U} kicker, it enters the battlefield with a +1/+1 counter on it and with flying.", ""); + new KickedCostCondition("{U}"), "If {this} was kicked with its {U} kicker, it enters the battlefield with a +1/+1 counter on it and with flying.", ""); ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/apocalypse/Smash.java b/Mage.Sets/src/mage/sets/apocalypse/Smash.java index d744e0f308a..7cffc876212 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/Smash.java +++ b/Mage.Sets/src/mage/sets/apocalypse/Smash.java @@ -46,7 +46,7 @@ public class Smash extends CardImpl { this.expansionSetCode = "APC"; // Destroy target artifact. - this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(new FilterArtifactPermanent())); // Draw a card. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); diff --git a/Mage.Sets/src/mage/sets/apocalypse/UnnaturalSelection.java b/Mage.Sets/src/mage/sets/apocalypse/UnnaturalSelection.java index 57e913f07b4..0106d3ca2fc 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/UnnaturalSelection.java +++ b/Mage.Sets/src/mage/sets/apocalypse/UnnaturalSelection.java @@ -33,25 +33,13 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.ContinuousEffect; -import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.BecomesChosenNonWallCreatureTypeTargetEffect; -import mage.abilities.effects.common.continuous.BecomesSubtypeTargetEffect; +import mage.abilities.effects.common.continuous.BecomesChosenCreatureTypeTargetEffect; import mage.cards.CardImpl; -import mage.cards.repository.CardRepository; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetCreaturePermanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -64,7 +52,7 @@ public class UnnaturalSelection extends CardImpl { this.expansionSetCode = "APC"; // {1}: Choose a creature type other than Wall. Target creature becomes that type until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesChosenNonWallCreatureTypeTargetEffect(), new GenericManaCost(1)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesChosenCreatureTypeTargetEffect(true), new GenericManaCost(1)); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } @@ -77,4 +65,4 @@ public class UnnaturalSelection extends CardImpl { public UnnaturalSelection copy() { return new UnnaturalSelection(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/Aladdin.java b/Mage.Sets/src/mage/sets/arabiannights/Aladdin.java new file mode 100644 index 00000000000..51906a0d334 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/Aladdin.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class Aladdin extends mage.sets.masterseditioniv.Aladdin { + + public Aladdin(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "ARN"; + } + + public Aladdin(final Aladdin card) { + super(card); + } + + @Override + public Aladdin copy() { + return new Aladdin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/ArmyOfAllah.java b/Mage.Sets/src/mage/sets/arabiannights/ArmyOfAllah.java new file mode 100644 index 00000000000..77bc94ac9a7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/ArmyOfAllah.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; + +/** + * + * @author fireshoes + */ +public class ArmyOfAllah extends CardImpl { + + private static final FilterAttackingCreature filter = new FilterAttackingCreature("Attacking creatures"); + + public ArmyOfAllah(UUID ownerId) { + super(ownerId, 56, "Army of Allah", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}{W}"); + this.expansionSetCode = "ARN"; + + // Attacking creatures get +2/+0 until end of turn. + this.getSpellAbility().addEffect(new BoostAllEffect(2, 0, Duration.EndOfTurn, filter, false)); + } + + public ArmyOfAllah(final ArmyOfAllah card) { + super(card); + } + + @Override + public ArmyOfAllah copy() { + return new ArmyOfAllah(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden.java b/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden1.java similarity index 87% rename from Mage.Sets/src/mage/sets/arabiannights/BirdMaiden.java rename to Mage.Sets/src/mage/sets/arabiannights/BirdMaiden1.java index 42d94fcf21f..af3bc6ebc12 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden.java +++ b/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden1.java @@ -1,52 +1,52 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.arabiannights; - -import java.util.UUID; - -/** - * - * @author North - */ -public class BirdMaiden extends mage.sets.fifthedition.BirdMaiden { - - public BirdMaiden(UUID ownerId) { - super(ownerId); - this.cardNumber = 45; - this.expansionSetCode = "ARN"; - } - - public BirdMaiden(final BirdMaiden card) { - super(card); - } - - @Override - public BirdMaiden copy() { - return new BirdMaiden(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author North + */ +public class BirdMaiden1 extends mage.sets.fifthedition.BirdMaiden { + + public BirdMaiden1(UUID ownerId) { + super(ownerId); + this.cardNumber = 45; + this.expansionSetCode = "ARN"; + } + + public BirdMaiden1(final BirdMaiden1 card) { + super(card); + } + + @Override + public BirdMaiden1 copy() { + return new BirdMaiden1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden2.java b/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden2.java new file mode 100644 index 00000000000..fe4077e9c4e --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/BirdMaiden2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author North + */ +public class BirdMaiden2 extends mage.sets.fifthedition.BirdMaiden { + + public BirdMaiden2(UUID ownerId) { + super(ownerId); + this.cardNumber = 46; + this.expansionSetCode = "ARN"; + } + + public BirdMaiden2(final BirdMaiden2 card) { + super(card); + } + + @Override + public BirdMaiden2 copy() { + return new BirdMaiden2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java b/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders1.java similarity index 87% rename from Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java rename to Mage.Sets/src/mage/sets/arabiannights/ErgRaiders1.java index 840710323ef..30162adc48e 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java +++ b/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders1.java @@ -1,53 +1,53 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.arabiannights; - -import java.util.UUID; - -/** - * +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * * @author LoneFox - - */ -public class ErgRaiders extends mage.sets.fourthedition.ErgRaiders { - - public ErgRaiders(UUID ownerId) { - super(ownerId); - this.cardNumber = 3; - this.expansionSetCode = "ARN"; - } - - public ErgRaiders(final ErgRaiders card) { - super(card); - } - - @Override - public ErgRaiders copy() { - return new ErgRaiders(this); - } -} + + */ +public class ErgRaiders1 extends mage.sets.fourthedition.ErgRaiders { + + public ErgRaiders1(UUID ownerId) { + super(ownerId); + this.cardNumber = 3; + this.expansionSetCode = "ARN"; + } + + public ErgRaiders1(final ErgRaiders1 card) { + super(card); + } + + @Override + public ErgRaiders1 copy() { + return new ErgRaiders1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders2.java b/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders2.java new file mode 100644 index 00000000000..542000552a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders2.java @@ -0,0 +1,53 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class ErgRaiders2 extends mage.sets.fourthedition.ErgRaiders { + + public ErgRaiders2(UUID ownerId) { + super(ownerId); + this.cardNumber = 4; + this.expansionSetCode = "ARN"; + } + + public ErgRaiders2(final ErgRaiders2 card) { + super(card); + } + + @Override + public ErgRaiders2 copy() { + return new ErgRaiders2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/FishliverOil.java b/Mage.Sets/src/mage/sets/arabiannights/FishliverOil1.java similarity index 93% rename from Mage.Sets/src/mage/sets/arabiannights/FishliverOil.java rename to Mage.Sets/src/mage/sets/arabiannights/FishliverOil1.java index 26176b08226..623b9ca2a32 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/FishliverOil.java +++ b/Mage.Sets/src/mage/sets/arabiannights/FishliverOil1.java @@ -47,9 +47,9 @@ import mage.target.common.TargetCreaturePermanent; /** * @author Laxika */ -public class FishliverOil extends CardImpl { +public class FishliverOil1 extends CardImpl { - public FishliverOil(UUID ownerId) { + public FishliverOil1(UUID ownerId) { super(ownerId, 17, "Fishliver Oil", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); this.expansionSetCode = "ARN"; this.subtype.add("Aura"); @@ -66,12 +66,12 @@ public class FishliverOil extends CardImpl { new GainAbilityAttachedEffect(new IslandwalkAbility(), AttachmentType.AURA, Duration.WhileOnBattlefield))); } - public FishliverOil(final FishliverOil card) { + public FishliverOil1(final FishliverOil1 card) { super(card); } @Override - public FishliverOil copy() { - return new FishliverOil(this); + public FishliverOil1 copy() { + return new FishliverOil1(this); } } diff --git a/Mage.Sets/src/mage/sets/arabiannights/FishliverOil2.java b/Mage.Sets/src/mage/sets/arabiannights/FishliverOil2.java new file mode 100644 index 00000000000..7540256d518 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/FishliverOil2.java @@ -0,0 +1,31 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FishliverOil2 extends mage.sets.arabiannights.FishliverOil1 { + + public FishliverOil2(UUID ownerId) { + super(ownerId); + this.cardNumber = 18; + this.expansionSetCode = "ARN"; + } + + public FishliverOil2(final FishliverOil2 card) { + super(card); + } + + @Override + public FishliverOil2 copy() { + return new FishliverOil2(this); + } +} + diff --git a/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise.java b/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise1.java similarity index 86% rename from Mage.Sets/src/mage/sets/arabiannights/GiantTortoise.java rename to Mage.Sets/src/mage/sets/arabiannights/GiantTortoise1.java index 2f8af150c36..c91458b42a6 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise.java +++ b/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise1.java @@ -1,52 +1,52 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.arabiannights; - -import java.util.UUID; - -/** - * - * @author LevelX2 - */ -public class GiantTortoise extends mage.sets.fourthedition.GiantTortoise { - - public GiantTortoise(UUID ownerId) { - super(ownerId); - this.cardNumber = 20; - this.expansionSetCode = "ARN"; - } - - public GiantTortoise(final GiantTortoise card) { - super(card); - } - - @Override - public GiantTortoise copy() { - return new GiantTortoise(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class GiantTortoise1 extends mage.sets.fourthedition.GiantTortoise { + + public GiantTortoise1(UUID ownerId) { + super(ownerId); + this.cardNumber = 20; + this.expansionSetCode = "ARN"; + } + + public GiantTortoise1(final GiantTortoise1 card) { + super(card); + } + + @Override + public GiantTortoise1 copy() { + return new GiantTortoise1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise2.java b/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise2.java new file mode 100644 index 00000000000..2e9ca156d75 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/GiantTortoise2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class GiantTortoise2 extends mage.sets.fourthedition.GiantTortoise { + + public GiantTortoise2(UUID ownerId) { + super(ownerId); + this.cardNumber = 21; + this.expansionSetCode = "ARN"; + } + + public GiantTortoise2(final GiantTortoise2 card) { + super(card); + } + + @Override + public GiantTortoise2 copy() { + return new GiantTortoise2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/HasranOgress1.java b/Mage.Sets/src/mage/sets/arabiannights/HasranOgress1.java new file mode 100644 index 00000000000..dc6dea357e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/HasranOgress1.java @@ -0,0 +1,53 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class HasranOgress1 extends mage.sets.masterseditioniv.HasranOgress { + + public HasranOgress1(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "ARN"; + } + + public HasranOgress1(final HasranOgress1 card) { + super(card); + } + + @Override + public HasranOgress1 copy() { + return new HasranOgress1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/HasranOgress2.java b/Mage.Sets/src/mage/sets/arabiannights/HasranOgress2.java new file mode 100644 index 00000000000..9b64f3a8e8e --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/HasranOgress2.java @@ -0,0 +1,53 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class HasranOgress2 extends mage.sets.masterseditioniv.HasranOgress { + + public HasranOgress2(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "ARN"; + } + + public HasranOgress2(final HasranOgress2 card) { + super(card); + } + + @Override + public HasranOgress2 copy() { + return new HasranOgress2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/IslandFishJasconius.java b/Mage.Sets/src/mage/sets/arabiannights/IslandFishJasconius.java new file mode 100644 index 00000000000..165b82a7109 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/IslandFishJasconius.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class IslandFishJasconius extends mage.sets.fourthedition.IslandFishJasconius { + + public IslandFishJasconius(UUID ownerId) { + super(ownerId); + this.cardNumber = 22; + this.expansionSetCode = "ARN"; + } + + public IslandFishJasconius(final IslandFishJasconius card) { + super(card); + } + + @Override + public IslandFishJasconius copy() { + return new IslandFishJasconius(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/JununEfreet.java b/Mage.Sets/src/mage/sets/arabiannights/JununEfreet.java new file mode 100644 index 00000000000..58ca657c481 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/JununEfreet.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class JununEfreet extends mage.sets.fourthedition.JununEfreet { + + public JununEfreet(UUID ownerId) { + super(ownerId); + this.cardNumber = 8; + this.expansionSetCode = "ARN"; + this.rarity = Rarity.RARE; + } + + public JununEfreet(final JununEfreet card) { + super(card); + } + + @Override + public JununEfreet copy() { + return new JununEfreet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/KhabalGhoul.java b/Mage.Sets/src/mage/sets/arabiannights/KhabalGhoul.java new file mode 100644 index 00000000000..6ba202dbc5f --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/KhabalGhoul.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class KhabalGhoul extends mage.sets.mastersedition.KhabalGhoul { + + public KhabalGhoul(UUID ownerId) { + super(ownerId); + this.cardNumber = 10; + this.expansionSetCode = "ARN"; + this.rarity = Rarity.UNCOMMON; + } + + public KhabalGhoul(final KhabalGhoul card) { + super(card); + } + + @Override + public KhabalGhoul copy() { + return new KhabalGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/MerchantShip.java b/Mage.Sets/src/mage/sets/arabiannights/MerchantShip.java new file mode 100644 index 00000000000..6f4fa5ff9b7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/MerchantShip.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.effects.common.combat.CantAttackUnlessDefenderControllsPermanent; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterLandPermanent; + +/** + * + * @author LoneFox + */ +public class MerchantShip extends CardImpl { + + public MerchantShip(UUID ownerId) { + super(ownerId, 23, "Merchant Ship", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "ARN"; + this.subtype.add("Human"); + this.power = new MageInt(0); + this.toughness = new MageInt(2); + + // Merchant Ship can't attack unless defending player controls an Island. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackUnlessDefenderControllsPermanent(new FilterLandPermanent("Island", "an Island")))); + // Whenever Merchant Ship attacks and isn't blocked, you gain 2 life. + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(new GainLifeEffect(2))); + // When you control no Islands, sacrifice Merchant Ship. + this.addAbility(new ControlsPermanentsControllerTriggeredAbility( + new FilterLandPermanent("Island", "no Islands"), Filter.ComparisonType.Equal, 0, + new SacrificeSourceEffect())); + } + + public MerchantShip(final MerchantShip card) { + super(card); + } + + @Override + public MerchantShip copy() { + return new MerchantShip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry.java b/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry1.java similarity index 86% rename from Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry.java rename to Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry1.java index b23fcaf7717..98a8c4369e8 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry.java +++ b/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry1.java @@ -1,54 +1,54 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.arabiannights; - -import java.util.UUID; -import mage.constants.Rarity; - -/** - * - * @author North - */ -public class MoorishCavalry extends mage.sets.timeshifted.MoorishCavalry { - - public MoorishCavalry(UUID ownerId) { - super(ownerId); - this.cardNumber = 62; - this.expansionSetCode = "ARN"; - this.rarity = Rarity.COMMON; - } - - public MoorishCavalry(final MoorishCavalry card) { - super(card); - } - - @Override - public MoorishCavalry copy() { - return new MoorishCavalry(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class MoorishCavalry1 extends mage.sets.timeshifted.MoorishCavalry { + + public MoorishCavalry1(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "ARN"; + this.rarity = Rarity.COMMON; + } + + public MoorishCavalry1(final MoorishCavalry1 card) { + super(card); + } + + @Override + public MoorishCavalry1 copy() { + return new MoorishCavalry1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry2.java b/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry2.java new file mode 100644 index 00000000000..f394fa38940 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/MoorishCavalry2.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class MoorishCavalry2 extends mage.sets.timeshifted.MoorishCavalry { + + public MoorishCavalry2(UUID ownerId) { + super(ownerId); + this.cardNumber = 63; + this.expansionSetCode = "ARN"; + this.rarity = Rarity.COMMON; + } + + public MoorishCavalry2(final MoorishCavalry2 card) { + super(card); + } + + @Override + public MoorishCavalry2 copy() { + return new MoorishCavalry2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/Mountain1.java b/Mage.Sets/src/mage/sets/arabiannights/Mountain1.java index 2a8a566afa3..6e8f256143d 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/Mountain1.java +++ b/Mage.Sets/src/mage/sets/arabiannights/Mountain1.java @@ -27,19 +27,20 @@ */ package mage.sets.arabiannights; +import mage.constants.Rarity; + import java.util.UUID; /** * * @author LevelX2 */ - - public class Mountain1 extends mage.cards.basiclands.Mountain { public Mountain1(UUID ownerId) { super(ownerId, 91); this.expansionSetCode = "ARN"; + this.rarity = Rarity.COMMON; } public Mountain1(final Mountain1 card) { diff --git a/Mage.Sets/src/mage/sets/arabiannights/RukhEgg.java b/Mage.Sets/src/mage/sets/arabiannights/RukhEgg1.java similarity index 95% rename from Mage.Sets/src/mage/sets/arabiannights/RukhEgg.java rename to Mage.Sets/src/mage/sets/arabiannights/RukhEgg1.java index 393148c71c3..41dc334a37c 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/RukhEgg.java +++ b/Mage.Sets/src/mage/sets/arabiannights/RukhEgg1.java @@ -45,9 +45,9 @@ import mage.game.permanent.token.Token; * * @author anonymous */ -public class RukhEgg extends CardImpl { +public class RukhEgg1 extends CardImpl { - public RukhEgg(UUID ownerId) { + public RukhEgg1(UUID ownerId) { super(ownerId, 52, "Rukh Egg", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.expansionSetCode = "ARN"; this.subtype.add("Bird"); @@ -61,13 +61,13 @@ public class RukhEgg extends CardImpl { this.addAbility(ability); } - public RukhEgg(final RukhEgg card) { + public RukhEgg1(final RukhEgg1 card) { super(card); } @Override - public RukhEgg copy() { - return new RukhEgg(this); + public RukhEgg1 copy() { + return new RukhEgg1(this); } } diff --git a/Mage.Sets/src/mage/sets/arabiannights/RukhEgg2.java b/Mage.Sets/src/mage/sets/arabiannights/RukhEgg2.java new file mode 100644 index 00000000000..1b5866538c2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/RukhEgg2.java @@ -0,0 +1,53 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class RukhEgg2 extends mage.sets.arabiannights.RukhEgg1 { + + public RukhEgg2(UUID ownerId) { + super(ownerId); + this.cardNumber = 53; + this.expansionSetCode = "ARN"; + } + + public RukhEgg2(final RukhEgg2 card) { + super(card); + } + + @Override + public RukhEgg2 copy() { + return new RukhEgg2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/SorceressQueen.java b/Mage.Sets/src/mage/sets/arabiannights/SorceressQueen.java new file mode 100644 index 00000000000..879a3dc6386 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/SorceressQueen.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author jeffwadsworth + */ +public class SorceressQueen extends mage.sets.revisededition.SorceressQueen { + + public SorceressQueen(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "ARN"; + this.rarity = Rarity.UNCOMMON; + } + + public SorceressQueen(final SorceressQueen card) { + super(card); + } + + @Override + public SorceressQueen copy() { + return new SorceressQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils.java b/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils1.java similarity index 88% rename from Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils.java rename to Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils1.java index 49f849fd727..8414e847aad 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils.java +++ b/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils1.java @@ -1,63 +1,63 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.arabiannights; - -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; -import mage.abilities.keyword.FirstStrikeAbility; -import mage.cards.CardImpl; - -/** - * - * @author North - */ -public class StoneThrowingDevils extends CardImpl { - - public StoneThrowingDevils(UUID ownerId) { - super(ownerId, 14, "Stone-Throwing Devils", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); - this.expansionSetCode = "ARN"; - this.subtype.add("Devil"); - - this.power = new MageInt(1); - this.toughness = new MageInt(1); - - // First strike - this.addAbility(FirstStrikeAbility.getInstance()); - } - - public StoneThrowingDevils(final StoneThrowingDevils card) { - super(card); - } - - @Override - public StoneThrowingDevils copy() { - return new StoneThrowingDevils(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.MageInt; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; + +/** + * + * @author North + */ +public class StoneThrowingDevils1 extends CardImpl { + + public StoneThrowingDevils1(UUID ownerId) { + super(ownerId, 14, "Stone-Throwing Devils", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "ARN"; + this.subtype.add("Devil"); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + } + + public StoneThrowingDevils1(final StoneThrowingDevils1 card) { + super(card); + } + + @Override + public StoneThrowingDevils1 copy() { + return new StoneThrowingDevils1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils2.java b/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils2.java new file mode 100644 index 00000000000..90262547593 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/StoneThrowingDevils2.java @@ -0,0 +1,31 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.sets.arabiannights; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class StoneThrowingDevils2 extends mage.sets.arabiannights.StoneThrowingDevils1 { + + public StoneThrowingDevils2(UUID ownerId) { + super(ownerId); + this.cardNumber = 15; + this.expansionSetCode = "ARN"; + } + + public StoneThrowingDevils2(final StoneThrowingDevils2 card) { + super(card); + } + + @Override + public StoneThrowingDevils2 copy() { + return new StoneThrowingDevils2(this); + } +} + diff --git a/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf.java b/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf1.java similarity index 89% rename from Mage.Sets/src/mage/sets/arabiannights/WyluliWolf.java rename to Mage.Sets/src/mage/sets/arabiannights/WyluliWolf1.java index 4cddf18a716..1b15f355179 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf.java +++ b/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf1.java @@ -34,21 +34,21 @@ import mage.constants.Rarity; * * @author Quercitron */ -public class WyluliWolf extends mage.sets.fifthedition.WyluliWolf { +public class WyluliWolf1 extends mage.sets.fifthedition.WyluliWolf { - public WyluliWolf(UUID ownerId) { + public WyluliWolf1(UUID ownerId) { super(ownerId); this.cardNumber = 40; this.expansionSetCode = "ARN"; this.rarity = Rarity.COMMON; } - public WyluliWolf(final WyluliWolf card) { + public WyluliWolf1(final WyluliWolf1 card) { super(card); } @Override - public WyluliWolf copy() { - return new WyluliWolf(this); + public WyluliWolf1 copy() { + return new WyluliWolf1(this); } } diff --git a/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf2.java b/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf2.java new file mode 100644 index 00000000000..9f2e093f71d --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/WyluliWolf2.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.arabiannights; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author Quercitron + */ +public class WyluliWolf2 extends mage.sets.fifthedition.WyluliWolf { + + public WyluliWolf2(UUID ownerId) { + super(ownerId); + this.cardNumber = 41; + this.expansionSetCode = "ARN"; + this.rarity = Rarity.COMMON; + } + + public WyluliWolf2(final WyluliWolf2 card) { + super(card); + } + + @Override + public WyluliWolf2 copy() { + return new WyluliWolf2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/archenemy/BatteringCraghorn.java b/Mage.Sets/src/mage/sets/archenemy/BatteringCraghorn.java new file mode 100644 index 00000000000..af9b1c23038 --- /dev/null +++ b/Mage.Sets/src/mage/sets/archenemy/BatteringCraghorn.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.archenemy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class BatteringCraghorn extends CardImpl { + + public BatteringCraghorn(UUID ownerId) { + super(ownerId, 30, "Battering Craghorn", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "ARC"; + this.subtype.add("Goat"); + this.subtype.add("Beast"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // Morph {1}{R}{R} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{1}{R}{R}"))); + } + + public BatteringCraghorn(final BatteringCraghorn card) { + super(card); + } + + @Override + public BatteringCraghorn copy() { + return new BatteringCraghorn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/archenemy/BogWitch.java b/Mage.Sets/src/mage/sets/archenemy/BogWitch.java new file mode 100644 index 00000000000..616a6836a57 --- /dev/null +++ b/Mage.Sets/src/mage/sets/archenemy/BogWitch.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.archenemy; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class BogWitch extends mage.sets.mercadianmasques.BogWitch { + + public BogWitch(UUID ownerId) { + super(ownerId); + this.cardNumber = 11; + this.expansionSetCode = "ARC"; + } + + public BogWitch(final BogWitch card) { + super(card); + } + + @Override + public BogWitch copy() { + return new BogWitch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/archenemy/DragonBreath.java b/Mage.Sets/src/mage/sets/archenemy/DragonBreath.java new file mode 100644 index 00000000000..82eab473946 --- /dev/null +++ b/Mage.Sets/src/mage/sets/archenemy/DragonBreath.java @@ -0,0 +1,134 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.archenemy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; +import mage.filter.Filter.ComparisonType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author emerald000 + */ +public class DragonBreath extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature with converted mana cost 6 or greater"); + static { + filter.add(new ConvertedManaCostPredicate(ComparisonType.GreaterThan, 5)); + } + + public DragonBreath(UUID ownerId) { + super(ownerId, 33, "Dragon Breath", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "ARC"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature has haste. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.AURA))); + + // {R}: Enchanted creature gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.R))); + + // When a creature with converted mana cost 6 or greater enters the battlefield, you may return Dragon Breath from your graveyard to the battlefield attached to that creature. + this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.GRAVEYARD, new DragonBreathEffect(), filter, true, SetTargetPointer.PERMANENT, null)); + } + + public DragonBreath(final DragonBreath card) { + super(card); + } + + @Override + public DragonBreath copy() { + return new DragonBreath(this); + } +} + +class DragonBreathEffect extends OneShotEffect { + + DragonBreathEffect() { + super(Outcome.Benefit); + this.staticText = "return {this} from your graveyard to the battlefield attached to that creature"; + } + + DragonBreathEffect(final DragonBreathEffect effect) { + super(effect); + } + + @Override + public DragonBreathEffect copy() { + return new DragonBreathEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Card sourceCard = (Card) source.getSourceObjectIfItStillExists(game); + Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + if (sourceCard != null && permanent != null && controller != null) { + game.getState().setValue("attachTo:" + sourceCard.getId(), permanent); + if (controller.moveCards(sourceCard, Zone.BATTLEFIELD, source, game)) { + permanent.addAttachment(sourceCard.getId(), game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/archenemy/ForgottenAncient.java b/Mage.Sets/src/mage/sets/archenemy/ForgottenAncient.java new file mode 100644 index 00000000000..0ac189d66b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/archenemy/ForgottenAncient.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.archenemy; + +import java.util.UUID; + +/** + * + * @author Blinke + */ +public class ForgottenAncient extends mage.sets.scourge.ForgottenAncient { + + public ForgottenAncient(UUID ownerId) { + super(ownerId); + this.cardNumber = 57; + this.expansionSetCode = "ARC"; + } + + public ForgottenAncient(final ForgottenAncient card) { + super(card); + } + + @Override + public ForgottenAncient copy() { + return new ForgottenAncient(this); + } +} diff --git a/Mage.Sets/src/mage/sets/archenemy/MakeshiftMannequin.java b/Mage.Sets/src/mage/sets/archenemy/MakeshiftMannequin.java index e6f6c9a72df..cf248de7b5d 100644 --- a/Mage.Sets/src/mage/sets/archenemy/MakeshiftMannequin.java +++ b/Mage.Sets/src/mage/sets/archenemy/MakeshiftMannequin.java @@ -44,6 +44,7 @@ import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; import mage.counters.CounterType; +import mage.counters.Counters; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.permanent.Permanent; @@ -77,21 +78,21 @@ public class MakeshiftMannequin extends CardImpl { } class MakeshiftMannequinEffect extends OneShotEffect { - + MakeshiftMannequinEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "Return target creature card from your graveyard to the battlefield with a mannequin counter on it. For as long as that creature has a mannequin counter on it, it has \"When this creature becomes the target of a spell or ability, sacrifice it.\""; } - + MakeshiftMannequinEffect(final MakeshiftMannequinEffect effect) { super(effect); } - + @Override public MakeshiftMannequinEffect copy() { return new MakeshiftMannequinEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); @@ -99,12 +100,14 @@ class MakeshiftMannequinEffect extends OneShotEffect { UUID cardId = this.getTargetPointer().getFirst(game, source); Card card = controller.getGraveyard().get(cardId, game); if (card != null) { - if (controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) { + Counters counters = new Counters(); + counters.addCounter(CounterType.MANNEQUIN.createInstance()); + game.setEnterWithCounters(cardId, counters); + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent permanent = game.getPermanent(cardId); if (permanent != null) { - permanent.addCounters(CounterType.MANNEQUIN.createInstance(), game); ContinuousEffect gainedEffect = new MakeshiftMannequinGainAbilityEffect(); - gainedEffect.setTargetPointer(new FixedTarget(cardId)); + gainedEffect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(gainedEffect, source); } } diff --git a/Mage.Sets/src/mage/sets/archenemy/SkirkCommando.java b/Mage.Sets/src/mage/sets/archenemy/SkirkCommando.java new file mode 100644 index 00000000000..c364916e666 --- /dev/null +++ b/Mage.Sets/src/mage/sets/archenemy/SkirkCommando.java @@ -0,0 +1,106 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.archenemy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author BursegSardaukar + */ +public class SkirkCommando extends CardImpl { + + public SkirkCommando(UUID ownerId) { + super(ownerId, 47, "Skirk Commando", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "ARC"; + this.subtype.add("Goblin"); + + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + //Whenever Skirk Commando deals combat damage to a player, you may have it deal 2 damage to target creature that player controls. + this.addAbility(new SkirkCommandoTriggeredAbility()); + + //Morph {2}{R} (You may cast this card face down as a 2/2 creature for 3. Turn it face up any time for its morph cost.) + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{R}"))); + + } + + public SkirkCommando(final SkirkCommando card) { + super(card); + } + + @Override + public SkirkCommando copy() { + return new SkirkCommando(this); + } +} + +class SkirkCommandoTriggeredAbility extends DealsCombatDamageToAPlayerTriggeredAbility { + + public SkirkCommandoTriggeredAbility() { + super(new DamageTargetEffect(2), true, false); + } + + public SkirkCommandoTriggeredAbility(SkirkCommandoTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (super.checkTrigger(event, game)) { + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that player controls"); + filter.add(new ControllerIdPredicate(event.getPlayerId())); + addTarget(new TargetCreaturePermanent(filter)); + } + return false; + } + + @Override + public SkirkCommandoTriggeredAbility copy() { + return new SkirkCommandoTriggeredAbility(this); + } + + @Override + public String getRule() { + return "Whenever {this} deals combat damage to a player, you may have it deal 2 damage to target creature that player controls."; + } +} diff --git a/Mage.Sets/src/mage/sets/archenemy/SpinIntoMyth.java b/Mage.Sets/src/mage/sets/archenemy/SpinIntoMyth.java index a06b14131b3..2d0e7b1cc47 100644 --- a/Mage.Sets/src/mage/sets/archenemy/SpinIntoMyth.java +++ b/Mage.Sets/src/mage/sets/archenemy/SpinIntoMyth.java @@ -50,7 +50,7 @@ public class SpinIntoMyth extends CardImpl { this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); Effect effect = new FatesealEffect(2); - effect.setText("then fateseal 2. (To fateseal 2, look at the top two cards of an opponent's library, then put any number of them on the bottom of that player's library and the rest on top in any order.)"); + effect.setText(", then fateseal 2. (To fateseal 2, look at the top two cards of an opponent's library, then put any number of them on the bottom of that player's library and the rest on top in any order.)"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/sets/archenemy/YavimayaDryad.java b/Mage.Sets/src/mage/sets/archenemy/YavimayaDryad.java new file mode 100644 index 00000000000..c83ae5e7b38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/archenemy/YavimayaDryad.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.archenemy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LoneFox + */ +public class YavimayaDryad extends CardImpl { + + private static final FilterLandCard filter = new FilterLandCard("a Forest card"); + + static { + filter.add(new SubtypePredicate("Forest")); + } + + public YavimayaDryad(UUID ownerId) { + super(ownerId, 75, "Yavimaya Dryad", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "ARC"; + this.subtype.add("Dryad"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Forestwalk + this.addAbility(new ForestwalkAbility()); + // When Yavimaya Dryad enters the battlefield, you may search your library for a Forest card and put it onto the battlefield tapped under target player's control. If you do, shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true), true)); + } + + public YavimayaDryad(final YavimayaDryad card) { + super(card); + } + + @Override + public YavimayaDryad copy() { + return new YavimayaDryad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/AbundantGrowth.java b/Mage.Sets/src/mage/sets/avacynrestored/AbundantGrowth.java index af12b061514..9ed4bfca997 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/AbundantGrowth.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/AbundantGrowth.java @@ -27,22 +27,26 @@ */ package mage.sets.avacynrestored; -import mage.constants.*; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.mana.AnyColorManaAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; -import java.util.UUID; - /** * @author noxx */ @@ -53,7 +57,6 @@ public class AbundantGrowth extends CardImpl { this.expansionSetCode = "AVR"; this.subtype.add("Aura"); - // Enchant land TargetPermanent auraTarget = new TargetLandPermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -64,9 +67,11 @@ public class AbundantGrowth extends CardImpl { // When Abundant Growth enters the battlefield, draw a card. this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); - // Enchanted land has "{tap}: Add one mana of any color to your mana pool." + // Enchanted land has "{T}: Add one mana of any color to your mana pool." Ability gainedAbility = new AnyColorManaAbility(new TapSourceCost()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA))); + Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA); + effect.setText("Enchanted land has \"{T}: Add one mana of any color to your mana pool.\""); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } public AbundantGrowth(final AbundantGrowth card) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/AvacynAngelOfHope.java b/Mage.Sets/src/mage/sets/avacynrestored/AvacynAngelOfHope.java index c826ac7ef58..8ad91046a02 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/AvacynAngelOfHope.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/AvacynAngelOfHope.java @@ -28,10 +28,6 @@ package mage.sets.avacynrestored; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.Effect; @@ -40,6 +36,10 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.IndestructibleAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; @@ -57,13 +57,15 @@ public class AvacynAngelOfHope extends CardImpl { this.power = new MageInt(8); this.toughness = new MageInt(8); + // Flying, vigilance, indestructible this.addAbility(FlyingAbility.getInstance()); this.addAbility(VigilanceAbility.getInstance()); + this.addAbility(IndestructibleAbility.getInstance()); - // Avacyn, Angel of Hope and other permanents you control are indestructible. - FilterControlledPermanent filter = new FilterControlledPermanent("Avacyn, Angel of Hope and other permanents you control"); - Effect effect = new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter, false); - effect.setText("{this} and other permanents you control are indestructible"); + // Other permanents you control are indestructible. + FilterControlledPermanent filter = new FilterControlledPermanent("Other permanents you control"); + Effect effect = new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter, true); + effect.setText("Other permanents you control are indestructible"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/CallToServe.java b/Mage.Sets/src/mage/sets/avacynrestored/CallToServe.java index a0453080103..72e5a85d72f 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/CallToServe.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/CallToServe.java @@ -28,11 +28,10 @@ package mage.sets.avacynrestored; import java.util.UUID; - -import mage.constants.*; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.AddCardSubtypeAttachedEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; @@ -40,6 +39,12 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; @@ -51,6 +56,7 @@ import mage.target.common.TargetCreaturePermanent; * @author Loki */ public class CallToServe extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { @@ -62,18 +68,22 @@ public class CallToServe extends CardImpl { this.expansionSetCode = "AVR"; this.subtype.add("Aura"); - // Enchant nonblack creature - TargetPermanent auraTarget = new TargetCreaturePermanent(); + TargetPermanent auraTarget = new TargetCreaturePermanent(filter); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Enchanted creature gets +1/+2, has flying, and is an Angel in addition to its other types. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 2, Duration.WhileOnBattlefield))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AddCardSubtypeAttachedEffect("Angel", Duration.WhileOnBattlefield, AttachmentType.AURA))); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 2, Duration.WhileOnBattlefield)); + Effect effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA); + effect.setText(", has flying"); + ability.addEffect(effect); + effect = new AddCardSubtypeAttachedEffect("Angel", Duration.WhileOnBattlefield, AttachmentType.AURA); + effect.setText(", and is an Angel in addition to its other types"); + ability.addEffect(effect); + this.addAbility(ability); } public CallToServe(final CallToServe card) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/CavernOfSouls.java b/Mage.Sets/src/mage/sets/avacynrestored/CavernOfSouls.java index 00e88453cb5..5ff7b12ef69 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/CavernOfSouls.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/CavernOfSouls.java @@ -38,15 +38,12 @@ import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseCreatureTypeEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.abilities.mana.ConditionalAnyColorManaAbility; import mage.abilities.mana.builder.ConditionalManaBuilder; import mage.abilities.mana.conditional.CreatureCastManaCondition; import mage.cards.CardImpl; -import mage.cards.repository.CardRepository; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -55,10 +52,8 @@ import mage.constants.WatcherScope; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; -import mage.util.CardUtil; import mage.watchers.Watcher; /** @@ -67,14 +62,12 @@ import mage.watchers.Watcher; */ public class CavernOfSouls extends CardImpl { - private static final String ruleText = "choose a creature type"; - public CavernOfSouls(UUID ownerId) { super(ownerId, 226, "Cavern of Souls", Rarity.RARE, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "AVR"; // As Cavern of Souls enters the battlefield, choose a creature type. - this.addAbility(new AsEntersBattlefieldAbility(new CavernOfSoulsEffect(), ruleText)); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.BoostCreature))); // {T}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); @@ -82,7 +75,7 @@ public class CavernOfSouls extends CardImpl { // {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a creature spell of the chosen type, and that spell can't be countered. Ability ability = new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new CavernOfSoulsManaBuilder(), true); this.addAbility(ability, new CavernOfSoulsWatcher(ability.getOriginalId())); - this.addAbility(new SimpleStaticAbility(Zone.ALL, new CavernOfSoulsCantCounterEffect())); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CavernOfSoulsCantCounterEffect())); } public CavernOfSouls(final CavernOfSouls card) { @@ -95,60 +88,23 @@ public class CavernOfSouls extends CardImpl { } } -class CavernOfSoulsEffect extends OneShotEffect { - - public CavernOfSoulsEffect() { - super(Outcome.Benefit); - staticText = "As {this} enters the battlefield, choose a creature type"; - } - - public CavernOfSoulsEffect(final CavernOfSoulsEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose creature type"); - typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); - while (!player.choose(Outcome.Benefit, typeChoice, game)) { - if (!player.canRespond()) { - return false; - } - } - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice()); - game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice()); - permanent.addInfo("chosen type", CardUtil.addToolTipMarkTags("Chosen type: " + typeChoice.getChoice()), game); - } - return false; - } - - @Override - public CavernOfSoulsEffect copy() { - return new CavernOfSoulsEffect(this); - } -} - class CavernOfSoulsManaBuilder extends ConditionalManaBuilder { String creatureType; - + @Override public ConditionalManaBuilder setMana(Mana mana, Ability source, Game game) { Object value = game.getState().getValue(source.getSourceId() + "_type"); if (value != null && value instanceof String) { creatureType = (String) value; - } + } Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { - game.informPlayers(controller.getLogName() + " produces " + mana.toString() + " with " + sourceObject.getLogName() + - " (can only be spend to cast for creatures of type " + creatureType + " and that spell can't be countered)"); - } - return super.setMana(mana, source, game); + game.informPlayers(controller.getLogName() + " produces " + mana.toString() + " with " + sourceObject.getLogName() + + " (can only be spend to cast for creatures of type " + creatureType + " and that spell can't be countered)"); + } + return super.setMana(mana, source, game); } @Override @@ -174,11 +130,11 @@ class CavernOfSoulsConditionalMana extends ConditionalMana { class CavernOfSoulsManaCondition extends CreatureCastManaCondition { String creatureType; - + CavernOfSoulsManaCondition(String creatureType) { this.creatureType = creatureType; } - + @Override public boolean apply(Game game, Ability source, UUID manaProducer) { // check: ... to cast a creature spell @@ -197,7 +153,7 @@ class CavernOfSoulsWatcher extends Watcher { private List spells = new ArrayList<>(); private final String originalId; - + public CavernOfSoulsWatcher(UUID originalId) { super("ManaPaidFromCavernOfSoulsWatcher", WatcherScope.CARD); this.originalId = originalId.toString(); @@ -222,7 +178,7 @@ class CavernOfSoulsWatcher extends Watcher { } } } - + public boolean spellCantBeCountered(UUID spellId) { return spells.contains(spellId); } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/Cloudshift.java b/Mage.Sets/src/mage/sets/avacynrestored/Cloudshift.java index 49d08482134..42c785000e2 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/Cloudshift.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/Cloudshift.java @@ -27,15 +27,15 @@ */ package mage.sets.avacynrestored; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.ExileTargetForSourceEffect; import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.target.common.TargetControlledCreaturePermanent; -import java.util.UUID; - /** * * @author noxx @@ -46,10 +46,11 @@ public class Cloudshift extends CardImpl { super(ownerId, 12, "Cloudshift", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); this.expansionSetCode = "AVR"; - // Exile target creature you control, then return that card to the battlefield under your control. this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); - this.getSpellAbility().addEffect(new ExileTargetForSourceEffect()); + Effect effect = new ExileTargetForSourceEffect(); + effect.setApplyEffectsAfter(); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(true)); } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/CommandersAuthority.java b/Mage.Sets/src/mage/sets/avacynrestored/CommandersAuthority.java index 7ec41d11dad..a408d0b7fe4 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/CommandersAuthority.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/CommandersAuthority.java @@ -28,8 +28,6 @@ package mage.sets.avacynrestored; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -38,6 +36,13 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.permanent.token.HumanToken; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DemonicRising.java b/Mage.Sets/src/mage/sets/avacynrestored/DemonicRising.java index b3f1f6ee608..c320fa32841 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DemonicRising.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DemonicRising.java @@ -29,7 +29,6 @@ package mage.sets.avacynrestored; import mage.constants.CardType; import mage.constants.Rarity; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.TriggeredAbility; import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; @@ -38,7 +37,7 @@ import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.DemonToken; import java.util.UUID; @@ -53,7 +52,6 @@ public class DemonicRising extends CardImpl { super(ownerId, 94, "Demonic Rising", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}"); this.expansionSetCode = "AVR"; - // At the beginning of your end step, if you control exactly one creature, put a 5/5 black Demon creature token with flying onto the battlefield. TriggeredAbility ability = new BeginningOfYourEndStepTriggeredAbility(new CreateTokenEffect(new DemonToken()), false); this.addAbility(new ConditionalTriggeredAbility(ability, OneControlledCreatureCondition.getInstance(), ruleText)); @@ -68,15 +66,3 @@ public class DemonicRising extends CardImpl { return new DemonicRising(this); } } - -class DemonToken extends Token { - public DemonToken() { - super("Demon", "a 5/5 black Demon creature token with flying"); - cardType.add(CardType.CREATURE); - color.setBlack(true); - subtype.add("Demon"); - power = new MageInt(5); - toughness = new MageInt(5); - addAbility(FlyingAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DevastationTide.java b/Mage.Sets/src/mage/sets/avacynrestored/DevastationTide.java index 2a13b1ecf80..126fc303e65 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DevastationTide.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DevastationTide.java @@ -27,20 +27,23 @@ */ package mage.sets.avacynrestored; +import java.util.LinkedHashSet; +import java.util.Set; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.MiracleAbility; +import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterNonlandPermanent; import mage.game.Game; import mage.game.permanent.Permanent; - +import mage.players.Player; /** * @@ -52,7 +55,6 @@ public class DevastationTide extends CardImpl { super(ownerId, 48, "Devastation Tide", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); this.expansionSetCode = "AVR"; - // Return all nonland permanents to their owners' hands. this.getSpellAbility().addEffect(new DevastationTideEffect()); @@ -83,10 +85,17 @@ class DevastationTideEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - for (Permanent creature : game.getBattlefield().getActivePermanents(new FilterNonlandPermanent(), source.getControllerId(), source.getSourceId(), game)) { - creature.moveToZone(Zone.HAND, source.getSourceId(), game, true); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Set cardsToHand = new LinkedHashSet<>(); + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterNonlandPermanent(), source.getControllerId(), source.getSourceId(), game)) { + cardsToHand.add((Card) permanent); + } + controller.moveCards(cardsToHand, null, Zone.HAND, source, game); + return true; + } - return true; + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/avacynrestored/GallowsAtWillowHill.java b/Mage.Sets/src/mage/sets/avacynrestored/GallowsAtWillowHill.java index 0d5cdcee9d5..7a5f29fbcd0 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/GallowsAtWillowHill.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/GallowsAtWillowHill.java @@ -34,6 +34,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapTargetCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -46,7 +47,6 @@ import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.SpiritWhiteToken; -import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -111,8 +111,7 @@ class GallowsAtWillowHillEffect extends OneShotEffect { Player controller = game.getPlayer(permanent.getControllerId()); permanent.destroy(source.getSourceId(), game, false); if (controller != null) { - Token spirit = new SpiritWhiteToken("AVR", 1); - spirit.putOntoBattlefield(1, game, source.getSourceId(), controller.getId()); + new CreateTokenEffect(new SpiritWhiteToken()).apply(game, source); } affectedTargets++; } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/GloomSurgeon.java b/Mage.Sets/src/mage/sets/avacynrestored/GloomSurgeon.java index 1e1c67ad312..b1881c58e86 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/GloomSurgeon.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/GloomSurgeon.java @@ -27,20 +27,22 @@ */ package mage.sets.avacynrestored; -import mage.constants.*; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamageCreatureEvent; import mage.game.events.GameEvent; import mage.players.Player; -import java.util.UUID; - /** * @author noxx */ @@ -86,19 +88,19 @@ class GloomSurgeonEffect extends ReplacementEffectImpl { int preventedDamage = event.getAmount(); game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), preventedDamage)); Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.moveCards(player.getLibrary().getTopCards(game, preventedDamage), Zone.LIBRARY, Zone.EXILED, source, game); + if (player != null) { + player.moveCards(player.getLibrary().getTopCards(game, preventedDamage), Zone.EXILED, source, game); } return true; } return false; } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.DAMAGE_CREATURE; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getSourceId())) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/InfiniteReflection.java b/Mage.Sets/src/mage/sets/avacynrestored/InfiniteReflection.java index 3f79caf503d..e2b81f4ec57 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/InfiniteReflection.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/InfiniteReflection.java @@ -27,7 +27,8 @@ */ package mage.sets.avacynrestored; -import mage.constants.*; +import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -37,9 +38,15 @@ import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.AttachEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; @@ -47,8 +54,6 @@ import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; import mage.util.functions.EmptyApplyToPermanent; -import java.util.UUID; - /** * * @author noxx @@ -60,7 +65,6 @@ public class InfiniteReflection extends CardImpl { this.expansionSetCode = "AVR"; this.subtype.add("Aura"); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -109,9 +113,9 @@ class InfiniteReflectionTriggeredEffect extends OneShotEffect { if (sourcePermanent != null && sourcePermanent.getAttachedTo() != null) { Permanent toCopyFromPermanent = game.getPermanent(sourcePermanent.getAttachedTo()); if (toCopyFromPermanent != null) { - for (Permanent toCopyToPermanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + for (Permanent toCopyToPermanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { if (!toCopyToPermanent.equals(toCopyFromPermanent) && !(toCopyToPermanent instanceof PermanentToken)) { - game.copyPermanent(toCopyFromPermanent, toCopyToPermanent, source, new EmptyApplyToPermanent()); + game.copyPermanent(toCopyFromPermanent, toCopyToPermanent.getId(), source, new EmptyApplyToPermanent()); } } return true; @@ -135,24 +139,23 @@ class InfiniteReflectionEntersBattlefieldEffect extends ReplacementEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(event.getTargetId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); return permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE) && !(permanent instanceof PermanentToken); } - @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent toCopyToPermanent = game.getPermanent(event.getTargetId()); + MageObject toCopyToObject = ((EntersTheBattlefieldEvent) event).getTarget(); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (sourcePermanent != null && toCopyToPermanent != null && sourcePermanent.getAttachedTo() != null) { + if (sourcePermanent != null && toCopyToObject != null && sourcePermanent.getAttachedTo() != null) { Permanent toCopyFromPermanent = game.getPermanent(sourcePermanent.getAttachedTo()); if (toCopyFromPermanent != null) { - game.copyPermanent(toCopyFromPermanent, toCopyToPermanent, source, new EmptyApplyToPermanent()); + game.copyPermanent(toCopyFromPermanent, toCopyToObject.getId(), source, new EmptyApplyToPermanent()); } } return false; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/MoonsilverSpear.java b/Mage.Sets/src/mage/sets/avacynrestored/MoonsilverSpear.java index 83d3afff427..66ed9f70c7f 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/MoonsilverSpear.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/MoonsilverSpear.java @@ -54,7 +54,7 @@ public class MoonsilverSpear extends CardImpl { // Equipped creature has first strike. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT))); // Whenever equipped creature attacks, put a 4/4 white Angel creature token with flying onto the battlefield. - this.addAbility(new AttacksAttachedTriggeredAbility(new CreateTokenEffect(new AngelToken(expansionSetCode)))); + this.addAbility(new AttacksAttachedTriggeredAbility(new CreateTokenEffect(new AngelToken()))); // Equip {4} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(4))); } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/NephaliaSmuggler.java b/Mage.Sets/src/mage/sets/avacynrestored/NephaliaSmuggler.java index e5cdcfb0e65..d939c4a073e 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/NephaliaSmuggler.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/NephaliaSmuggler.java @@ -38,6 +38,8 @@ import mage.abilities.effects.common.ExileTargetForSourceEffect; import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect; import mage.cards.CardImpl; import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; import mage.target.common.TargetControlledCreaturePermanent; import java.util.UUID; @@ -47,6 +49,11 @@ import java.util.UUID; */ public class NephaliaSmuggler extends CardImpl { + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another target creature you control"); + static { + filter.add(new AnotherPredicate()); + } + public NephaliaSmuggler(UUID ownerId) { super(ownerId, 69, "Nephalia Smuggler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{U}"); this.expansionSetCode = "AVR"; @@ -60,7 +67,7 @@ public class NephaliaSmuggler extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect(), new ManaCostsImpl("{3}{U}")); ability.addCost(new TapSourceCost()); ability.addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(true)); - ability.addTarget(new TargetControlledCreaturePermanent()); + ability.addTarget(new TargetControlledCreaturePermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/PillarOfFlame.java b/Mage.Sets/src/mage/sets/avacynrestored/PillarOfFlame.java index 014284bd8e5..ed8b8b3b02c 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/PillarOfFlame.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/PillarOfFlame.java @@ -74,51 +74,3 @@ public class PillarOfFlame extends CardImpl { return new PillarOfFlame(this); } } - -class PillarOfFlameEffect extends ReplacementEffectImpl { - - public PillarOfFlameEffect() { - super(Duration.EndOfTurn, Outcome.Exile); - staticText = "If a creature dealt damage this way would die this turn, exile it instead"; - } - - public PillarOfFlameEffect(final PillarOfFlameEffect effect) { - super(effect); - } - - @Override - public PillarOfFlameEffect copy() { - return new PillarOfFlameEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Player controller = game.getPlayer(source.getControllerId()); - Permanent permanent = ((ZoneChangeEvent) event).getTarget(); - if (controller != null && permanent != null) { - return controller.moveCards(permanent, Zone.BATTLEFIELD, Zone.EXILED, source, game); - } - return false; - } - - @Override - public boolean checksEventType(GameEvent event, Game game) { - return event.getType() == EventType.ZONE_CHANGE; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (((ZoneChangeEvent) event).isDiesEvent()) { - DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); - if (watcher != null) { - return watcher.wasDamaged(event.getTargetId(), game); - } - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/ReforgeTheSoul.java b/Mage.Sets/src/mage/sets/avacynrestored/ReforgeTheSoul.java index 7047040a5fc..90ac73de417 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/ReforgeTheSoul.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/ReforgeTheSoul.java @@ -28,17 +28,14 @@ package mage.sets.avacynrestored; import java.util.UUID; -import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.abilities.effects.common.discard.DiscardHandAllEffect; import mage.abilities.keyword.MiracleAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.game.Game; -import mage.players.Player; /** * @@ -50,9 +47,11 @@ public class ReforgeTheSoul extends CardImpl { super(ownerId, 151, "Reforge the Soul", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); this.expansionSetCode = "AVR"; - // Each player discards his or her hand, then draws seven cards. - this.getSpellAbility().addEffect(new ReforgeTheSoulEffect()); + this.getSpellAbility().addEffect(new DiscardHandAllEffect()); + Effect effect = new DrawCardAllEffect(7); + effect.setText(", then draws seven cards"); + this.getSpellAbility().addEffect(effect); // Miracle {1}{R} this.addAbility(new MiracleAbility(this, new ManaCostsImpl("{1}{R}"))); @@ -67,39 +66,3 @@ public class ReforgeTheSoul extends CardImpl { return new ReforgeTheSoul(this); } } - -class ReforgeTheSoulEffect extends OneShotEffect { - - public ReforgeTheSoulEffect() { - super(Outcome.DrawCard); - this.staticText = "Each player discards his or her hand, then draws seven cards"; - } - - public ReforgeTheSoulEffect(final ReforgeTheSoulEffect effect) { - super(effect); - } - - @Override - public ReforgeTheSoulEffect copy() { - return new ReforgeTheSoulEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - for (UUID playerId : controller.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { - for (Card card : player.getHand().getCards(game)) { - player.discard(card, source, game); - } - - player.drawCards(7, game); - } - } - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/RestorationAngel.java b/Mage.Sets/src/mage/sets/avacynrestored/RestorationAngel.java index bd3043c6e72..65582db1bf7 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/RestorationAngel.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/RestorationAngel.java @@ -51,7 +51,7 @@ import mage.target.common.TargetControlledCreaturePermanent; /** * * @author noxx - + * */ public class RestorationAngel extends CardImpl { @@ -71,7 +71,7 @@ public class RestorationAngel extends CardImpl { this.addAbility(FlashAbility.getInstance()); this.addAbility(FlyingAbility.getInstance()); - + // When Restoration Angel enters the battlefield, you may exile target non-Angel creature you control, then return that card to the battlefield under your control Ability ability = new EntersBattlefieldTriggeredAbility(new RestorationAngelEffect(), true); ability.addTarget(new TargetControlledCreaturePermanent(1, 1, filter, false)); @@ -111,11 +111,13 @@ class RestorationAngelEffect extends OneShotEffect { Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null && sourcePermanent != null) { - controller.moveCardToExileWithInfo(permanent, source.getSourceId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true); - Card card = game.getCard(targetPointer.getFirst(game, source)); - if (card != null) { - Zone currentZone = game.getState().getZone(card.getId()); - return controller.putOntoBattlefieldWithInfo(card, game, currentZone, source.getSourceId()); + int zcc = permanent.getZoneChangeCounter(game); + controller.moveCards(permanent, Zone.EXILED, source, game); + Card card = game.getCard(permanent.getId()); + if (card != null + && card.getZoneChangeCounter(game) == zcc + 1 + && game.getState().getZone(card.getId()).equals(Zone.EXILED)) { + return controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/RidersOfGavony.java b/Mage.Sets/src/mage/sets/avacynrestored/RidersOfGavony.java index 8a0ead3bfc9..2f687150aa7 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/RidersOfGavony.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/RidersOfGavony.java @@ -27,27 +27,28 @@ */ package mage.sets.avacynrestored; -import mage.constants.*; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseCreatureTypeEffect; import mage.abilities.keyword.ProtectionAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; -import mage.cards.repository.CardRepository; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.players.Player; - -import java.util.UUID; /** * @author noxx @@ -66,7 +67,7 @@ public class RidersOfGavony extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // As Riders of Gavony enters the battlefield, choose a creature type. - this.addAbility(new AsEntersBattlefieldAbility(new RidersOfGavonyEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.Protect))); // Human creatures you control have protection from creatures of the chosen type. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new RidersOfGavonyGainAbilityControlledEffect())); @@ -82,46 +83,6 @@ public class RidersOfGavony extends CardImpl { } } -class RidersOfGavonyEffect extends OneShotEffect { - - public RidersOfGavonyEffect() { - super(Outcome.BoostCreature); - staticText = "choose a creature type"; - } - - public RidersOfGavonyEffect(final RidersOfGavonyEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose creature type"); - typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); - while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { - if (!player.canRespond()) { - return false; - } - } - if (typeChoice.getChoice() != null) { - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice()); - game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice()); - permanent.addInfo("chosen type", "Chosen type: " + typeChoice.getChoice() + "", game); - } - } - return false; - } - - @Override - public RidersOfGavonyEffect copy() { - return new RidersOfGavonyEffect(this); - } - -} - class RidersOfGavonyGainAbilityControlledEffect extends ContinuousEffectImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Human creatures you control"); @@ -154,13 +115,13 @@ class RidersOfGavonyGainAbilityControlledEffect extends ContinuousEffectImpl { if (permanent != null) { String subtype = (String) game.getState().getValue(permanent.getId() + "_type"); if (subtype != null) { - protectionFilter = new FilterPermanent(subtype+"s"); + protectionFilter = new FilterPermanent(subtype + "s"); protectionFilter.add(new SubtypePredicate(subtype)); } } } if (protectionFilter != null) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { perm.addAbility(new ProtectionAbility(protectionFilter), source.getSourceId(), game); } return true; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/SternMentor.java b/Mage.Sets/src/mage/sets/avacynrestored/SternMentor.java index 23757600e70..feb58ede09a 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/SternMentor.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/SternMentor.java @@ -47,7 +47,7 @@ import mage.target.TargetPlayer; */ public class SternMentor extends CardImpl { - private static final String ruleText = "As long as {this} is paired with another creature, each of those creatures has \"{tap}: Target player puts the top two cards of his or her library into his or her graveyard.\""; + private static final String ruleText = "As long as {this} is paired with another creature, each of those creatures has \"{T}: Target player puts the top two cards of his or her library into his or her graveyard.\""; public SternMentor(UUID ownerId) { super(ownerId, 77, "Stern Mentor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); @@ -61,7 +61,7 @@ public class SternMentor extends CardImpl { // Soulbond this.addAbility(SoulbondAbility.getInstance()); - // As long as Stern Mentor is paired with another creature, each of those creatures has "{t}: Target player puts the top two cards of his or her library into his or her graveyard." + // As long as Stern Mentor is paired with another creature, each of those creatures has "{T}: Target player puts the top two cards of his or her library into his or her graveyard." Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(2), new TapSourceCost()); ability.addTarget(new TargetPlayer()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(ability, ruleText))); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/StolenGoods.java b/Mage.Sets/src/mage/sets/avacynrestored/StolenGoods.java index 7709f8614fb..591adb8e6a1 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/StolenGoods.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/StolenGoods.java @@ -27,21 +27,24 @@ */ package mage.sets.avacynrestored; -import mage.constants.*; +import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.cards.CardsImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.players.Library; import mage.players.Player; import mage.target.common.TargetOpponent; - -import java.util.UUID; -import mage.MageObject; -import mage.abilities.effects.ContinuousEffect; import mage.target.targetpointer.FixedTarget; /** @@ -54,7 +57,6 @@ public class StolenGoods extends CardImpl { super(ownerId, 78, "Stolen Goods", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}"); this.expansionSetCode = "AVR"; - // Target opponent exiles cards from the top of his or her library until he or she exiles a nonland card. Until end of turn, you may cast that card without paying its mana cost. this.getSpellAbility().addEffect(new StolenGoodsEffect()); this.getSpellAbility().addTarget(new TargetOpponent()); @@ -96,14 +98,13 @@ class StolenGoodsEffect extends OneShotEffect { do { card = library.removeFromTop(game); if (card != null) { - opponent.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true); + opponent.moveCardsToExile(card, source, game, true, source.getSourceId(), sourceObject.getIdName()); } } while (library.size() > 0 && card != null && card.getCardType().contains(CardType.LAND)); if (card != null) { - opponent.revealCards("Card to cast", new CardsImpl(card), game); ContinuousEffect effect = new StolenGoodsCastFromExileEffect(); - effect.setTargetPointer(new FixedTarget(card.getId())); + effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); game.addEffect(effect, source); } return true; @@ -135,11 +136,12 @@ class StolenGoodsCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (getTargetPointer().getFirst(game, source).equals(sourceId) && affectedControllerId.equals(source.getControllerId())) { + if (sourceId != null && sourceId.equals(getTargetPointer().getFirst(game, source)) + && affectedControllerId.equals(source.getControllerId())) { Card card = game.getCard(sourceId); if (card != null && game.getState().getZone(sourceId) == Zone.EXILED) { Player player = game.getPlayer(affectedControllerId); - player.setCastSourceIdWithAlternateMana(sourceId, null); + player.setCastSourceIdWithAlternateMana(sourceId, null, null); return true; } } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/TamiyoTheMoonSage.java b/Mage.Sets/src/mage/sets/avacynrestored/TamiyoTheMoonSage.java index 9e716508d32..19905589e8d 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/TamiyoTheMoonSage.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/TamiyoTheMoonSage.java @@ -30,19 +30,18 @@ package mage.sets.avacynrestored; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.PutCardIntoGraveFromAnywhereAllTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; -import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect; import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect.HandSizeModification; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -50,7 +49,6 @@ import mage.constants.Rarity; import mage.constants.SetTargetPointer; import mage.constants.TargetController; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.TappedPredicate; @@ -71,8 +69,7 @@ public class TamiyoTheMoonSage extends CardImpl { this.expansionSetCode = "AVR"; this.subtype.add("Tamiyo"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Tap target permanent. It doesn't untap during its controller's next untap step. LoyaltyAbility ability = new LoyaltyAbility(new TapTargetEffect(), 1); @@ -130,7 +127,8 @@ class TappedCreaturesControlledByTargetCount implements DynamicValue { } /** - * 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." + * 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." */ class TamiyoTheMoonSageEmblem extends Emblem { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/ThatcherRevolt.java b/Mage.Sets/src/mage/sets/avacynrestored/ThatcherRevolt.java index 141d60e8284..3e3518eebde 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/ThatcherRevolt.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/ThatcherRevolt.java @@ -28,19 +28,19 @@ package mage.sets.avacynrestored; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.target.targetpointer.FixedTarget; @@ -54,7 +54,6 @@ public class ThatcherRevolt extends CardImpl { super(ownerId, 158, "Thatcher Revolt", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{R}"); this.expansionSetCode = "AVR"; - // Put three 1/1 red Human creature tokens with haste onto the battlefield. Sacrifice those tokens at the beginning of the next end step. this.getSpellAbility().addEffect(new ThatcherRevoltEffect()); } @@ -87,17 +86,15 @@ class ThatcherRevoltEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - for (int i = 0; i < 3; i++) { - RedHumanToken token = new RedHumanToken(); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - - SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this token"); - sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + RedHumanToken token = new RedHumanToken(); + token.putOntoBattlefield(3, game, source.getSourceId(), source.getControllerId()); + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect(); + sacrificeEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect), source); + } } return true; } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/TibaltTheFiendBlooded.java b/Mage.Sets/src/mage/sets/avacynrestored/TibaltTheFiendBlooded.java index b899d7e651a..b17f824dd78 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/TibaltTheFiendBlooded.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/TibaltTheFiendBlooded.java @@ -29,29 +29,27 @@ package mage.sets.avacynrestored; import java.util.List; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.discard.DiscardControllerEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.discard.DiscardControllerEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.counters.CounterType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -70,8 +68,7 @@ public class TibaltTheFiendBlooded extends CardImpl { this.expansionSetCode = "AVR"; this.subtype.add("Tibalt"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(2)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(2)); // +1: Draw a card, then discard a card at random. LoyaltyAbility ability = new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/TormentorsTrident.java b/Mage.Sets/src/mage/sets/avacynrestored/TormentorsTrident.java index 6978d7118c5..ce92e18fccf 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/TormentorsTrident.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/TormentorsTrident.java @@ -27,16 +27,21 @@ */ package mage.sets.avacynrestored; -import mage.constants.*; -import mage.abilities.common.AttacksEachTurnStaticAbility; +import java.util.UUID; +import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.AttacksIfAbleAttachedEffect; import mage.abilities.effects.common.continuous.BoostEquippedEffect; -import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; - -import java.util.UUID; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; /** * @@ -51,8 +56,11 @@ public class TormentorsTrident extends CardImpl { this.subtype.add("Equipment"); // Equipped creature gets +3/+0 and attacks each turn if able. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 0))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new AttacksEachTurnStaticAbility(), AttachmentType.EQUIPMENT))); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 0)); + Effect effect = new AttacksIfAbleAttachedEffect(Duration.WhileOnBattlefield, AttachmentType.EQUIPMENT); + effect.setText("and attacks each turn if able"); + ability.addEffect(effect); + this.addAbility(ability); // Equip {3} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/VoiceOfTheProvinces.java b/Mage.Sets/src/mage/sets/avacynrestored/VoiceOfTheProvinces.java index 552e5d59c41..4cb50e37fe1 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/VoiceOfTheProvinces.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/VoiceOfTheProvinces.java @@ -36,7 +36,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.HumanToken; /** * @@ -66,15 +66,3 @@ public class VoiceOfTheProvinces extends CardImpl { return new VoiceOfTheProvinces(this); } } - -class HumanToken extends Token { - public HumanToken() { - super("Human", "1/1 white Human creature token"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Human"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/AdverseConditions.java b/Mage.Sets/src/mage/sets/battleforzendikar/AdverseConditions.java new file mode 100644 index 00000000000..fef0c55058b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/AdverseConditions.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.EldraziScionToken; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class AdverseConditions extends CardImpl { + + public AdverseConditions(UUID ownerId) { + super(ownerId, 54, "Adverse Conditions", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{U}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + + // Tap up to two target creatures. Those creatures don't untap during their controller's next untap step. + this.getSpellAbility().addEffect(new TapTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); + this.getSpellAbility().addEffect(new DontUntapInControllersNextUntapStepTargetEffect()); + // Put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + Effect effect = new CreateTokenEffect(new EldraziScionToken()); + effect.setText("put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has \"Sacrifice this creature: Add {1} to your mana pool.\""); + this.getSpellAbility().addEffect(effect); + + } + + public AdverseConditions(final AdverseConditions card) { + super(card); + } + + @Override + public AdverseConditions copy() { + return new AdverseConditions(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/AkoumFirebird.java b/Mage.Sets/src/mage/sets/battleforzendikar/AkoumFirebird.java new file mode 100644 index 00000000000..d7333dbecc9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/AkoumFirebird.java @@ -0,0 +1,120 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.AttacksEachTurnStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +/** + * + * @author fireshoes + */ +public class AkoumFirebird extends CardImpl { + + public AkoumFirebird(UUID ownerId) { + super(ownerId, 138, "Akoum Firebird", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Phoenix"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Akoum Firebird attacks each turn if able. + this.addAbility(new AttacksEachTurnStaticAbility()); + + // Landfall-Whenever a land enters the battlefield under your control, you may pay {4}{R}{R}. + // If you do, return Akoum Firebird from your graveyard to the battlefield. + this.addAbility(new AkoumFirebirdLandfallAbility(new DoIfCostPaid( + new ReturnSourceFromGraveyardToBattlefieldEffect(), new ManaCostsImpl("{4}{R}{R}")), false)); + } + + public AkoumFirebird(final AkoumFirebird card) { + super(card); + } + + @Override + public AkoumFirebird copy() { + return new AkoumFirebird(this); + } +} + +class AkoumFirebirdLandfallAbility extends TriggeredAbilityImpl { + + public AkoumFirebirdLandfallAbility(Effect effect, boolean optional) { + this(Zone.GRAVEYARD, effect, optional); + } + + public AkoumFirebirdLandfallAbility (Zone zone, Effect effect, Boolean optional ) { + super(zone, effect, optional); + } + + public AkoumFirebirdLandfallAbility(final AkoumFirebirdLandfallAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + return permanent != null && permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId); + } + + @Override + public String getRule() { + return "Landfall — Whenever a land enters the battlefield under your control, " + super.getRule(); + } + + @Override + public AkoumFirebirdLandfallAbility copy() { + return new AkoumFirebirdLandfallAbility(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/AkoumHellkite.java b/Mage.Sets/src/mage/sets/battleforzendikar/AkoumHellkite.java new file mode 100644 index 00000000000..b1987a95f8f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/AkoumHellkite.java @@ -0,0 +1,167 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreatureOrPlayer; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class AkoumHellkite extends CardImpl { + + public AkoumHellkite(UUID ownerId) { + super(ownerId, 139, "Akoum Hellkite", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Dragon"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Landfall-Whenever a land enters the battlefield under you control, Akoum Hellkite deals 1 damage to target creature or player. + // If that land is a Mountain, Akoum Hellkite deals 2 damage to that creature or player instead. + Ability ability = new AkoumHellkiteTriggeredAbility(); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public AkoumHellkite(final AkoumHellkite card) { + super(card); + } + + @Override + public AkoumHellkite copy() { + return new AkoumHellkite(this); + } +} + +class AkoumHellkiteTriggeredAbility extends TriggeredAbilityImpl { + + private static final String text = "Landfall - Whenever a land enters the battlefield under your control, {this} deals 1 damage to target creature or player. " + + "If that land is a Mountain, Akoum Hellkite deals 2 damage to that creature or player instead."; + + public AkoumHellkiteTriggeredAbility() { + super(Zone.BATTLEFIELD, new AkoumHellkiteDamageEffect()); + } + + public AkoumHellkiteTriggeredAbility(final AkoumHellkiteTriggeredAbility ability) { + super(ability); + } + + @Override + public AkoumHellkiteTriggeredAbility copy() { + return new AkoumHellkiteTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null + && permanent.getCardType().contains(CardType.LAND) + && permanent.getControllerId().equals(getControllerId())) { + Permanent sourcePermanent = game.getPermanent(getSourceId()); + if (sourcePermanent != null) + for (Effect effect : getEffects()) { + if (effect instanceof AkoumHellkiteDamageEffect) { + effect.setTargetPointer(new FixedTarget(permanent, game)); + } + return true; + } + } + return false; + } + + @Override + public String getRule() { + return text; + } +} + +class AkoumHellkiteDamageEffect extends OneShotEffect { + + public AkoumHellkiteDamageEffect() { + super(Outcome.Damage); + } + + public AkoumHellkiteDamageEffect(final AkoumHellkiteDamageEffect effect) { + super(effect); + } + + @Override + public AkoumHellkiteDamageEffect copy() { + return new AkoumHellkiteDamageEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + Player player = game.getPlayer(source.getFirstTarget()); + if (land != null && player != null) { + if (land.hasSubtype("Mountain")) { + player.damage(2, source.getSourceId(), game, false, true); + } else { + player.damage(1, source.getSourceId(), game, false, true); + } + return true; + } + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (land != null && permanent != null) { + if (land.hasSubtype("Mountain")) { + permanent.damage(2, source.getSourceId(), game, false, true); + } else { + permanent.damage(1, source.getSourceId(), game, false, true); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/AkoumStonewaker.java b/Mage.Sets/src/mage/sets/battleforzendikar/AkoumStonewaker.java new file mode 100644 index 00000000000..66d3ca61ff6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/AkoumStonewaker.java @@ -0,0 +1,128 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.LandfallAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.Token; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class AkoumStonewaker extends CardImpl { + + public AkoumStonewaker(UUID ownerId) { + super(ownerId, 140, "Akoum Stonewaker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Landfall — Whenever a land enters the battlefield under your control, you may pay {2}{R}. If you do, put a 3/1 red Elemental creature token with trample and haste onto the battlefield. + // Exile that token at the beginning of the next end step. + this.addAbility(new LandfallAbility(new DoIfCostPaid(new AkoumStonewakerEffect(), new ManaCostsImpl("{2}{R}")), false)); + + } + + public AkoumStonewaker(final AkoumStonewaker card) { + super(card); + } + + @Override + public AkoumStonewaker copy() { + return new AkoumStonewaker(this); + } +} + +class AkoumStonewakerEffect extends OneShotEffect { + + public AkoumStonewakerEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "put a 3/1 red Elemental creature token with trample and haste onto the battlefield. Exile that token at the beginning of the next end step"; + } + + public AkoumStonewakerEffect(final AkoumStonewakerEffect effect) { + super(effect); + } + + @Override + public AkoumStonewakerEffect copy() { + return new AkoumStonewakerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Token token = new AkoumStonewakerElementalToken(); + if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source); + } + } + return true; + } + return false; + } +} + +class AkoumStonewakerElementalToken extends Token { + + public AkoumStonewakerElementalToken() { + super("Elemental", "3/1 red Elemental creature token with trample and haste"); + cardType.add(CardType.CREATURE); + color.setRed(true); + subtype.add("Elemental"); + power = new MageInt(3); + toughness = new MageInt(1); + this.addAbility(TrampleAbility.getInstance()); + this.addAbility(HasteAbility.getInstance()); + this.setOriginalExpansionSetCode("BFZ"); + this.setTokenType(1); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/AlignedHedronNetwork.java b/Mage.Sets/src/mage/sets/battleforzendikar/AlignedHedronNetwork.java new file mode 100644 index 00000000000..297ea626a5d --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/AlignedHedronNetwork.java @@ -0,0 +1,116 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class AlignedHedronNetwork extends CardImpl { + + public AlignedHedronNetwork(UUID ownerId) { + super(ownerId, 222, "Aligned Hedron Network", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "BFZ"; + + // When Aligned Hedron Network enters the battlefield, exile all creatures with power 5 or greater until Aligned Hedron Network leaves the battlefield. + this.addAbility(new EntersBattlefieldTriggeredAbility(new AlignedHedronNetworkExileEffect(), false)); + } + + public AlignedHedronNetwork(final AlignedHedronNetwork card) { + super(card); + } + + @Override + public AlignedHedronNetwork copy() { + return new AlignedHedronNetwork(this); + } +} + +class AlignedHedronNetworkExileEffect extends OneShotEffect { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with power 5 or greater"); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 4)); + } + + public AlignedHedronNetworkExileEffect() { + super(Outcome.Benefit); + this.staticText = "exile all creatures with power 5 or greater until {this} leaves the battlefield"; + } + + public AlignedHedronNetworkExileEffect(final AlignedHedronNetworkExileEffect effect) { + super(effect); + } + + @Override + public AlignedHedronNetworkExileEffect copy() { + return new AlignedHedronNetworkExileEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(source.getSourceId()); + // If Whale leaves the battlefield before its triggered ability resolves, + // the target creature won't be exiled. + if (controller != null && permanent != null) { + Set toExile = new LinkedHashSet<>(); + for (Permanent creature : game.getBattlefield().getActivePermanents(filter, controller.getId(), source.getSourceId(), game)) { + toExile.add(creature); + } + if (!toExile.isEmpty()) { + controller.moveCardsToExile(toExile, source, game, true, CardUtil.getCardExileZoneId(game, source), permanent.getIdName()); + new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()).apply(game, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/AllyEncampment.java b/Mage.Sets/src/mage/sets/battleforzendikar/AllyEncampment.java new file mode 100644 index 00000000000..8f2e4c81fb0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/AllyEncampment.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.abilities.mana.ConditionalAnyColorManaAbility; +import mage.abilities.mana.conditional.ConditionalSpellManaBuilder; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class AllyEncampment extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("an Ally spell"); + + static { + filter.add(new SubtypePredicate("Ally")); + } + + public AllyEncampment(UUID ownerId) { + super(ownerId, 228, "Ally Encampment", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // {T} Add one mana of any color to your mana pool. Spend this mana only to cast an Ally spell. + this.addAbility(new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new ConditionalSpellManaBuilder(filter), true)); + + // {1}, {T}, Sacrifice Ally Encampment: Return target Ally you control to its owner's hand. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new GenericManaCost(1)); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("Ally", "Ally you control"))); + this.addAbility(ability); + } + + public AllyEncampment(final AllyEncampment card) { + super(card); + } + + @Override + public AllyEncampment copy() { + return new AllyEncampment(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/AltarsReap.java b/Mage.Sets/src/mage/sets/battleforzendikar/AltarsReap.java new file mode 100644 index 00000000000..6af209c70a5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/AltarsReap.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class AltarsReap extends mage.sets.innistrad.AltarsReap { + + public AltarsReap(UUID ownerId) { + super(ownerId); + this.cardNumber = 103; + this.expansionSetCode = "BFZ"; + } + + public AltarsReap(final AltarsReap card) { + super(card); + } + + @Override + public AltarsReap copy() { + return new AltarsReap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/AngelOfRenewal.java b/Mage.Sets/src/mage/sets/battleforzendikar/AngelOfRenewal.java new file mode 100644 index 00000000000..67671cfd94a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/AngelOfRenewal.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class AngelOfRenewal extends CardImpl { + + public AngelOfRenewal(UUID ownerId) { + super(ownerId, 18, "Angel of Renewal", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Angel"); + this.subtype.add("Ally"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Angel of Renewal enters the battlefield, you gain 1 life for each creature you control. + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect( + new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent())))); + + } + + public AngelOfRenewal(final AngelOfRenewal card) { + super(card); + } + + @Override + public AngelOfRenewal copy() { + return new AngelOfRenewal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/AngelicCaptain.java b/Mage.Sets/src/mage/sets/battleforzendikar/AngelicCaptain.java new file mode 100644 index 00000000000..f984cb8a502 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/AngelicCaptain.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author fireshoes + */ +public class AngelicCaptain extends CardImpl { + + private static final FilterAttackingCreature filter = new FilterAttackingCreature("other attacking Ally"); + + static { + filter.add(new SubtypePredicate("Ally")); + filter.add(new AnotherPredicate()); + } + + public AngelicCaptain(UUID ownerId) { + super(ownerId, 208, "Angelic Captain", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Angel"); + this.subtype.add("Ally"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever Angelic Captain attacks, it gets +1/+1 until end of turn for each other attacking Ally. + PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter); + this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(value, value, Duration.EndOfTurn, true), false)); + } + + public AngelicCaptain(final AngelicCaptain card) { + super(card); + } + + @Override + public AngelicCaptain copy() { + return new AngelicCaptain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/AngelicGift.java b/Mage.Sets/src/mage/sets/battleforzendikar/AngelicGift.java new file mode 100644 index 00000000000..66d622f82e5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/AngelicGift.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class AngelicGift extends CardImpl { + + public AngelicGift(UUID ownerId) { + super(ownerId, 19, "Angelic Gift", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // When Angelic Gift enters the battlefield, draw a card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); + + // Enchanted creature has flying. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA))); + } + + public AngelicGift(final AngelicGift card) { + super(card); + } + + @Override + public AngelicGift copy() { + return new AngelicGift(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Anticipate.java b/Mage.Sets/src/mage/sets/battleforzendikar/Anticipate.java new file mode 100644 index 00000000000..820a17c2723 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Anticipate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Anticipate extends mage.sets.dragonsoftarkir.Anticipate { + + public Anticipate(UUID ownerId) { + super(ownerId); + this.cardNumber = 69; + this.expansionSetCode = "BFZ"; + } + + public Anticipate(final Anticipate card) { + super(card); + } + + @Override + public Anticipate copy() { + return new Anticipate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BaneOfBalaGed.java b/Mage.Sets/src/mage/sets/battleforzendikar/BaneOfBalaGed.java new file mode 100644 index 00000000000..38e38e9c644 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BaneOfBalaGed.java @@ -0,0 +1,101 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LevelX2 + */ +public class BaneOfBalaGed extends CardImpl { + + public BaneOfBalaGed(UUID ownerId) { + super(ownerId, 1, "Bane of Bala Ged", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{7}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(7); + this.toughness = new MageInt(5); + + // Whenever Bane of Bala Ged attacks, defending player exiles two permanents he or she controls. + this.addAbility(new AttacksTriggeredAbility(new BaneOfBalaGedEffect(), false, "", SetTargetPointer.PLAYER)); + } + + public BaneOfBalaGed(final BaneOfBalaGed card) { + super(card); + } + + @Override + public BaneOfBalaGed copy() { + return new BaneOfBalaGed(this); + } +} + +class BaneOfBalaGedEffect extends OneShotEffect { + + public BaneOfBalaGedEffect() { + super(Outcome.Benefit); + this.staticText = "defending player exiles two permanents he or she controls"; + } + + public BaneOfBalaGedEffect(final BaneOfBalaGedEffect effect) { + super(effect); + } + + @Override + public BaneOfBalaGedEffect copy() { + return new BaneOfBalaGedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player defendingPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (defendingPlayer != null) { + Target target = new TargetControlledPermanent(2); + defendingPlayer.chooseTarget(outcome, target, source, game); + defendingPlayer.moveCards(new CardsImpl(target.getTargets()), null, Zone.EXILED, source, game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java b/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java new file mode 100644 index 00000000000..d2c7973283f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class BarrageTyrant extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another colorless creature"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ColorlessPredicate()); + } + + public BarrageTyrant(UUID ownerId) { + super(ownerId, 127, "Barrage Tyrant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // {2}{R}, Sacrifice another colorless creature: Barrage Tyrant deals damage equal to the sacrificed creature's power to target creature or player. + Effect effect = new DamageTargetEffect(new SacrificeCostCreaturesPower()); + effect.setText("{this} deals damage equal to the sacrificed creature's power to target creature or player"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{R}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public BarrageTyrant(final BarrageTyrant card) { + super(card); + } + + @Override + public BarrageTyrant copy() { + return new BarrageTyrant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BeastcallerSavant.java b/Mage.Sets/src/mage/sets/battleforzendikar/BeastcallerSavant.java new file mode 100644 index 00000000000..70fca955764 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BeastcallerSavant.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.mana.ConditionalAnyColorManaAbility; +import mage.abilities.mana.conditional.ConditionalSpellManaBuilder; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureSpell; + +/** + * + * @author fireshoes + */ +public class BeastcallerSavant extends CardImpl { + + public BeastcallerSavant(UUID ownerId) { + super(ownerId, 170, "Beastcaller Savant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elf"); + this.subtype.add("Shaman"); + this.subtype.add("Ally"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // {T}: Add one mana of any color to your mana pool. Spend this mana only to cast creature spells. + this.addAbility(new ConditionalAnyColorManaAbility(1, new ConditionalSpellManaBuilder(new FilterCreatureSpell("creature spells")))); + } + + public BeastcallerSavant(final BeastcallerSavant card) { + super(card); + } + + @Override + public BeastcallerSavant copy() { + return new BeastcallerSavant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BelligerentWhiptail.java b/Mage.Sets/src/mage/sets/battleforzendikar/BelligerentWhiptail.java new file mode 100644 index 00000000000..587fa780eed --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BelligerentWhiptail.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class BelligerentWhiptail extends CardImpl { + + public BelligerentWhiptail(UUID ownerId) { + super(ownerId, 141, "Belligerent Whiptail", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Wurm"); + this.power = new MageInt(4); + this.toughness = new MageInt(2); + + // Landfall — Whenever a land enters the battlefield under your control, Belligerent Whiptail gains first strike until end of turn. + this.addAbility(new LandfallAbility(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), false)); + + } + + public BelligerentWhiptail(final BelligerentWhiptail card) { + super(card); + } + + @Override + public BelligerentWhiptail copy() { + return new BelligerentWhiptail(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BenthicInfiltrator.java b/Mage.Sets/src/mage/sets/battleforzendikar/BenthicInfiltrator.java new file mode 100644 index 00000000000..dd07f088f12 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BenthicInfiltrator.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.CantBeBlockedSourceAbility; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class BenthicInfiltrator extends CardImpl { + + public BenthicInfiltrator(UUID ownerId) { + super(ownerId, 55, "Benthic Infiltrator", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Ingest + this.addAbility(new IngestAbility()); + + // Benthic Infiltrator can't be blocked. + this.addAbility(new CantBeBlockedSourceAbility()); + } + + public BenthicInfiltrator(final BenthicInfiltrator card) { + super(card); + } + + @Override + public BenthicInfiltrator copy() { + return new BenthicInfiltrator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BlightHerder.java b/Mage.Sets/src/mage/sets/battleforzendikar/BlightHerder.java new file mode 100644 index 00000000000..d6317ebf1bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BlightHerder.java @@ -0,0 +1,118 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.other.OwnerPredicate; +import mage.game.Game; +import mage.game.permanent.token.EldraziScionToken; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInExile; + +/** + * + * @author LevelX2 + */ +public class BlightHerder extends CardImpl { + + public BlightHerder(UUID ownerId) { + super(ownerId, 2, "Blight Herder", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Processor"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // When you cast Blight Herder, you may put two cards your opponents own from exile into their owners' graveyards. If you do, put three 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool." + this.addAbility(new CastSourceTriggeredAbility(new BlightHerderEffect(), true)); + } + + public BlightHerder(final BlightHerder card) { + super(card); + } + + @Override + public BlightHerder copy() { + return new BlightHerder(this); + } +} + +class BlightHerderEffect extends OneShotEffect { + + private final static FilterCard filter = new FilterCard("cards your opponents own from exile"); + + static { + filter.add(new OwnerPredicate(TargetController.OPPONENT)); + } + + public BlightHerderEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "you may put two cards your opponents own from exile into their owners' graveyards. If you do, put three 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have \"Sacrifice this creature: Add {1} to your mana pool."; + } + + public BlightHerderEffect(final BlightHerderEffect effect) { + super(effect); + } + + @Override + public BlightHerderEffect copy() { + return new BlightHerderEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Target target = new TargetCardInExile(2, 2, filter, null); + if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { + if (controller.chooseTarget(outcome, target, source, game)) { + Cards cardsToGraveyard = new CardsImpl(target.getTargets()); + controller.moveCards(cardsToGraveyard, null, Zone.GRAVEYARD, source, game); + return new CreateTokenEffect(new EldraziScionToken(), 3).apply(game, source); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BlightedCataract.java b/Mage.Sets/src/mage/sets/battleforzendikar/BlightedCataract.java new file mode 100644 index 00000000000..a94c79afa25 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BlightedCataract.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class BlightedCataract extends CardImpl { + + public BlightedCataract(UUID ownerId) { + super(ownerId, 229, "Blighted Cataract", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // {5}{U}, {T}, Sacrifice Blighted Cataract: Draw two cards. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(2), new ManaCostsImpl("{5}{U}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public BlightedCataract(final BlightedCataract card) { + super(card); + } + + @Override + public BlightedCataract copy() { + return new BlightedCataract(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BlightedFen.java b/Mage.Sets/src/mage/sets/battleforzendikar/BlightedFen.java new file mode 100644 index 00000000000..253e3d337c9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BlightedFen.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetOpponent; + +/** + * + * @author LevelX2 + */ +public class BlightedFen extends CardImpl { + + public BlightedFen(UUID ownerId) { + super(ownerId, 230, "Blighted Fen", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // {4}{B}, {T}, Sacrifice Blighted Fen: Target opponent sacrifices a creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target opponent"), + new ManaCostsImpl<>("{4}{B}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public BlightedFen(final BlightedFen card) { + super(card); + } + + @Override + public BlightedFen copy() { + return new BlightedFen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BlightedGorge.java b/Mage.Sets/src/mage/sets/battleforzendikar/BlightedGorge.java new file mode 100644 index 00000000000..b67954fd390 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BlightedGorge.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LevelX2 + */ +public class BlightedGorge extends CardImpl { + + public BlightedGorge(UUID ownerId) { + super(ownerId, 231, "Blighted Gorge", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // {4}{R}, {T}, Sacrifice Blighted Gorge: Blighted Gorge deals 2 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new DamageTargetEffect(2), + new ManaCostsImpl<>("{4}{R}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public BlightedGorge(final BlightedGorge card) { + super(card); + } + + @Override + public BlightedGorge copy() { + return new BlightedGorge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BlightedSteppe.java b/Mage.Sets/src/mage/sets/battleforzendikar/BlightedSteppe.java new file mode 100644 index 00000000000..c0c4d00ff6f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BlightedSteppe.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class BlightedSteppe extends CardImpl { + + public BlightedSteppe(UUID ownerId) { + super(ownerId, 232, "Blighted Steppe", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // {3}{W}, {T}, Sacrifice Blighted Steppe: You gain 2 life for each creature you control. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainLifeEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent("creature you control"), 2)), + new ManaCostsImpl<>("{3}{W}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public BlightedSteppe(final BlightedSteppe card) { + super(card); + } + + @Override + public BlightedSteppe copy() { + return new BlightedSteppe(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BlightedWoodland.java b/Mage.Sets/src/mage/sets/battleforzendikar/BlightedWoodland.java new file mode 100644 index 00000000000..694a2e74187 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BlightedWoodland.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterBasicLandCard; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LevelX2 + */ +public class BlightedWoodland extends CardImpl { + + public BlightedWoodland(UUID ownerId) { + super(ownerId, 233, "Blighted Woodland", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // {3}{G}, {T}, Sacrifice Blighted Woodland: Search your library for up to two basic land cards and put them onto the battlefield tapped. Then shuffle your library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, new FilterBasicLandCard()), true, true), + new ManaCostsImpl<>("{3}{G}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public BlightedWoodland(final BlightedWoodland card) { + super(card); + } + + @Override + public BlightedWoodland copy() { + return new BlightedWoodland(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Blisterpod.java b/Mage.Sets/src/mage/sets/battleforzendikar/Blisterpod.java new file mode 100644 index 00000000000..41398c4c2d7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Blisterpod.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.EldraziScionToken; + +/** + * + * @author LevelX2 + */ +public class Blisterpod extends CardImpl { + + public Blisterpod(UUID ownerId) { + super(ownerId, 163, "Blisterpod", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // When Blisterpod dies, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + Effect effect = new CreateTokenEffect(new EldraziScionToken()); + effect.setText("put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has \"Sacrifice this creature: Add {1} to your mana pool.\""); + this.addAbility(new DiesTriggeredAbility(effect, false)); + } + + public Blisterpod(final Blisterpod card) { + super(card); + } + + @Override + public Blisterpod copy() { + return new Blisterpod(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BloodbondVampire.java b/Mage.Sets/src/mage/sets/battleforzendikar/BloodbondVampire.java new file mode 100644 index 00000000000..c2e4713537b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BloodbondVampire.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.GainLifeControllerTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LevelX2 + */ +public class BloodbondVampire extends CardImpl { + + public BloodbondVampire(UUID ownerId) { + super(ownerId, 104, "Bloodbond Vampire", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Vampire"); + this.subtype.add("Shaman"); + this.subtype.add("Ally"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever you gain life, put a +1/+1 counter on Bloodbond Vampire. + this.addAbility(new GainLifeControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); + } + + public BloodbondVampire(final BloodbondVampire card) { + super(card); + } + + @Override + public BloodbondVampire copy() { + return new BloodbondVampire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BoilingEarth.java b/Mage.Sets/src/mage/sets/battleforzendikar/BoilingEarth.java new file mode 100644 index 00000000000..45dbf95132a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BoilingEarth.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LevelX2 + */ +public class BoilingEarth extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature your opponents control"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public BoilingEarth(UUID ownerId) { + super(ownerId, 142, "Boiling Earth", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); + this.expansionSetCode = "BFZ"; + + // Boiling Earth deals 1 damage to each creature your opponents control. + this.getSpellAbility().addEffect(new DamageAllEffect(1, filter)); + + // Awaken 4—{6}{R} + this.addAbility(new AwakenAbility(this, 4, "{6}{R}")); + } + + public BoilingEarth(final BoilingEarth card) { + super(card); + } + + @Override + public BoilingEarth copy() { + return new BoilingEarth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BoneSplinters.java b/Mage.Sets/src/mage/sets/battleforzendikar/BoneSplinters.java new file mode 100644 index 00000000000..275ba4d99d0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BoneSplinters.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class BoneSplinters extends mage.sets.shardsofalara.BoneSplinters { + + public BoneSplinters(UUID ownerId) { + super(ownerId); + this.cardNumber = 105; + this.expansionSetCode = "BFZ"; + } + + public BoneSplinters(final BoneSplinters card) { + super(card); + } + + @Override + public BoneSplinters copy() { + return new BoneSplinters(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BreakerOfArmies.java b/Mage.Sets/src/mage/sets/battleforzendikar/BreakerOfArmies.java new file mode 100644 index 00000000000..2ab9d9d7361 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BreakerOfArmies.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.MustBeBlockedByAllSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class BreakerOfArmies extends CardImpl { + + public BreakerOfArmies(UUID ownerId) { + super(ownerId, 3, "Breaker of Armies", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{8}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(10); + this.toughness = new MageInt(8); + + // All creatures able to block Breaker of Armies do so. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBeBlockedByAllSourceEffect(Duration.WhileOnBattlefield))); + } + + public BreakerOfArmies(final BreakerOfArmies card) { + super(card); + } + + @Override + public BreakerOfArmies copy() { + return new BreakerOfArmies(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BrilliantSpectrum.java b/Mage.Sets/src/mage/sets/battleforzendikar/BrilliantSpectrum.java new file mode 100644 index 00000000000..b1874062817 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BrilliantSpectrum.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.discard.DiscardControllerEffect; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class BrilliantSpectrum extends CardImpl { + + public BrilliantSpectrum(UUID ownerId) { + super(ownerId, 70, "Brilliant Spectrum", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{U}"); + this.expansionSetCode = "BFZ"; + + // Converge — Draw X cards, where X is the number of colors of mana spent to cast Brilliant Spectrum. Then discard two cards. + this.getSpellAbility().setAbilityWord(AbilityWord.CONVERGE); + Effect effect = new DrawCardSourceControllerEffect(ColorsOfManaSpentToCastCount.getInstance()); + effect.setText("Draw X cards, where X is the number of colors of mana spent to cast {this}"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addEffect(new DiscardControllerEffect(2)); + } + + public BrilliantSpectrum(final BrilliantSpectrum card) { + super(card); + } + + @Override + public BrilliantSpectrum copy() { + return new BrilliantSpectrum(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BringToLight.java b/Mage.Sets/src/mage/sets/battleforzendikar/BringToLight.java new file mode 100644 index 00000000000..5419dc82641 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BringToLight.java @@ -0,0 +1,122 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; +import org.apache.log4j.Logger; + +/** + * + * @author LevelX2 + */ +public class BringToLight extends CardImpl { + + public BringToLight(UUID ownerId) { + super(ownerId, 209, "Bring to Light", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{G}{U}"); + this.expansionSetCode = "BFZ"; + + // Converge-Search your library for a creature, instant, or sorcery card with converted mana + // cost less than or equal to the number of colors of mana spent to cast Bring to Light, exile that card, + // then shuffle your library. You may cast that card without paying its mana cost. + this.getSpellAbility().addEffect(new BringToLightEffect()); + } + + public BringToLight(final BringToLight card) { + super(card); + } + + @Override + public BringToLight copy() { + return new BringToLight(this); + } +} + +class BringToLightEffect extends OneShotEffect { + + public BringToLightEffect() { + super(Outcome.PlayForFree); + this.staticText = "Converge — Search your library for a creature, instant, or sorcery card with converted mana " + + "cost less than or equal to the number of colors of mana spent to cast {this}, exile that card, " + + "then shuffle your library. You may cast that card without paying its mana cost"; + } + + public BringToLightEffect(final BringToLightEffect effect) { + super(effect); + } + + @Override + public BringToLightEffect copy() { + return new BringToLightEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int numberColors = ColorsOfManaSpentToCastCount.getInstance().calculate(game, source, this); + FilterCard filter = new FilterCard(); + filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY))); + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, numberColors + 1)); + TargetCardInLibrary target = new TargetCardInLibrary(filter); + controller.searchLibrary(target, game); + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); + if (card != null) { + controller.moveCards(card, Zone.EXILED, source, game); + } + controller.shuffleLibrary(game); + if (card != null) { + if (controller.chooseUse(outcome, "Cast " + card.getName() + " without paying its mana cost?", source, game)) { + if (card.getSpellAbility() != null) { + controller.cast(card.getSpellAbility(), game, true); + } else { + Logger.getLogger(BringToLightEffect.class).error("Bring to Light: spellAbility == null " + card.getName()); + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BroodButcher.java b/Mage.Sets/src/mage/sets/battleforzendikar/BroodButcher.java new file mode 100644 index 00000000000..15f532eb8db --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BroodButcher.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.permanent.token.EldraziScionToken; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class BroodButcher extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature"); + + public BroodButcher(UUID ownerId) { + super(ownerId, 199, "Brood Butcher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // When Brood Butcher enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziScionToken()), false)); + + // {B}{G}, Sacrifice a creature: Target creature gets -2/-2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{B}{G}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public BroodButcher(final BroodButcher card) { + super(card); + } + + @Override + public BroodButcher copy() { + return new BroodButcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BroodMonitor.java b/Mage.Sets/src/mage/sets/battleforzendikar/BroodMonitor.java new file mode 100644 index 00000000000..ecf6c1431d5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BroodMonitor.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.EldraziScionToken; + +/** + * + * @author LevelX2 + */ +public class BroodMonitor extends CardImpl { + + public BroodMonitor(UUID ownerId) { + super(ownerId, 164, "Brood Monitor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // When Brood Monitor enters the battlefield, put three 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool." + Effect effect = new CreateTokenEffect(new EldraziScionToken(), 3); + effect.setText("put three 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have \"Sacrifice this creature: Add {1} to your mana pool.\""); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false)); + + } + + public BroodMonitor(final BroodMonitor card) { + super(card); + } + + @Override + public BroodMonitor copy() { + return new BroodMonitor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BroodhunterWurm.java b/Mage.Sets/src/mage/sets/battleforzendikar/BroodhunterWurm.java new file mode 100644 index 00000000000..59dcb212687 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BroodhunterWurm.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class BroodhunterWurm extends CardImpl { + + public BroodhunterWurm(UUID ownerId) { + super(ownerId, 171, "Broodhunter Wurm", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Wurm"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + } + + public BroodhunterWurm(final BroodhunterWurm card) { + super(card); + } + + @Override + public BroodhunterWurm copy() { + return new BroodhunterWurm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BrutalExpulsion.java b/Mage.Sets/src/mage/sets/battleforzendikar/BrutalExpulsion.java new file mode 100644 index 00000000000..fcddf947e1b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BrutalExpulsion.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.common.replacement.DealtDamageToCreatureBySourceDies; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterSpellOrPermanent; +import mage.target.common.TargetCreatureOrPlaneswalker; +import mage.target.common.TargetSpellOrPermanent; +import mage.watchers.common.DamagedByWatcher; + +/** + * + * @author LevelX2 + */ +public class BrutalExpulsion extends CardImpl { + + private static final FilterSpellOrPermanent filter = new FilterSpellOrPermanent("spell or creature"); + + static { + filter.setPermanentFilter(new FilterCreaturePermanent()); + } + + public BrutalExpulsion(UUID ownerId) { + super(ownerId, 200, "Brutal Expulsion", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{U}{R}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Choose one or both + this.getSpellAbility().getModes().setMinModes(1); + this.getSpellAbility().getModes().setMaxModes(2); + // - Return target spell or creature to its owner's hand; + this.getSpellAbility().addTarget(new TargetSpellOrPermanent(1, 1, filter, false)); + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + // or Brutal Expulsion deals 2 damage to target creature or planeswalker. If that permanent would be put into a graveyard this turn, exile it instead. + Mode mode = new Mode(); + mode.getEffects().add(new DamageTargetEffect(2)); + mode.getTargets().add(new TargetCreatureOrPlaneswalker()); + Effect effect = new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn); + effect.setText("If that permanent would be put into a graveyard this turn, exile it instead"); + mode.getEffects().add(effect); + this.getSpellAbility().addMode(mode); + this.getSpellAbility().addWatcher(new DamagedByWatcher()); + } + + public BrutalExpulsion(final BrutalExpulsion card) { + super(card); + } + + @Override + public BrutalExpulsion copy() { + return new BrutalExpulsion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CallTheScions.java b/Mage.Sets/src/mage/sets/battleforzendikar/CallTheScions.java new file mode 100644 index 00000000000..439dbe84a3a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CallTheScions.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.EldraziScionToken; + +/** + * + * @author LevelX2 + */ +public class CallTheScions extends CardImpl { + + public CallTheScions(UUID ownerId) { + super(ownerId, 165, "Call the Scions", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: add {1} to your mana pool." + Effect effect = new CreateTokenEffect(new EldraziScionToken(), 2); + effect.setText("put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have \"Sacrifice this creature: Add {1} to your mana pool.\""); + this.getSpellAbility().addEffect(effect); + + } + + public CallTheScions(final CallTheScions card) { + super(card); + } + + @Override + public CallTheScions copy() { + return new CallTheScions(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CanopyVista.java b/Mage.Sets/src/mage/sets/battleforzendikar/CanopyVista.java new file mode 100644 index 00000000000..97dcdb7afae --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CanopyVista.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class CanopyVista extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public CanopyVista(UUID ownerId) { + super(ownerId, 234, "Canopy Vista", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Forest"); + this.subtype.add("Plains"); + + // Canopy Vista enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new GreenManaAbility()); + this.addAbility(new WhiteManaAbility()); + } + + public CanopyVista(final CanopyVista card) { + super(card); + } + + @Override + public CanopyVista copy() { + return new CanopyVista(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CarrierThrall.java b/Mage.Sets/src/mage/sets/battleforzendikar/CarrierThrall.java new file mode 100644 index 00000000000..a3097ea8114 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CarrierThrall.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.EldraziScionToken; + +/** + * + * @author LevelX2 + */ +public class CarrierThrall extends CardImpl { + + public CarrierThrall(UUID ownerId) { + super(ownerId, 106, "Carrier Thrall", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Vampire"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // When Carrier Thrall dies, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature. Add {1} to your mana pool." + Effect effect = new CreateTokenEffect(new EldraziScionToken()); + effect.setText("put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has \"Sacrifice this creature: Add {1} to your mana pool.\""); + this.addAbility(new DiesTriggeredAbility(effect, false)); + + } + + public CarrierThrall(final CarrierThrall card) { + super(card); + } + + @Override + public CarrierThrall copy() { + return new CarrierThrall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CatacombSifter.java b/Mage.Sets/src/mage/sets/battleforzendikar/CatacombSifter.java new file mode 100644 index 00000000000..7faeaddd544 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CatacombSifter.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.keyword.ScryEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.permanent.token.EldraziScionToken; + +/** + * + * @author fireshoes + */ +public class CatacombSifter extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature you control"); + static { + filter.add(new AnotherPredicate()); + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public CatacombSifter(UUID ownerId) { + super(ownerId, 201, "Catacomb Sifter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // When Catacomb Sifter enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziScionToken()))); + + // Whenever another creature you control dies, scry 1 + this.addAbility(new DiesCreatureTriggeredAbility(new ScryEffect(1), false, filter)); + } + + public CatacombSifter(final CatacombSifter card) { + super(card); + } + + @Override + public CatacombSifter copy() { + return new CatacombSifter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ChasmGuide.java b/Mage.Sets/src/mage/sets/battleforzendikar/ChasmGuide.java new file mode 100644 index 00000000000..ecade73ae51 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ChasmGuide.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ChasmGuide extends CardImpl { + + public ChasmGuide(UUID ownerId) { + super(ownerId, 143, "Chasm Guide", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Goblin"); + this.subtype.add("Scout"); + this.subtype.add("Ally"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Rally — Whenever Chasm Guide or another Ally enters the battlefield under your control, creatures you control gain haste until end of turn. + this.addAbility(new AllyEntersBattlefieldTriggeredAbility( + new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures you control")), false)); + } + + public ChasmGuide(final ChasmGuide card) { + super(card); + } + + @Override + public ChasmGuide copy() { + return new ChasmGuide(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CinderGlade.java b/Mage.Sets/src/mage/sets/battleforzendikar/CinderGlade.java new file mode 100644 index 00000000000..69cad63bd57 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CinderGlade.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class CinderGlade extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public CinderGlade(UUID ownerId) { + super(ownerId, 235, "Cinder Glade", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Mountain"); + this.subtype.add("Forest"); + + // Cinder Glade enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new RedManaAbility()); + this.addAbility(new GreenManaAbility()); + } + + public CinderGlade(final CinderGlade card) { + super(card); + } + + @Override + public CinderGlade copy() { + return new CinderGlade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CliffsideLookout.java b/Mage.Sets/src/mage/sets/battleforzendikar/CliffsideLookout.java new file mode 100644 index 00000000000..a362b9e360f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CliffsideLookout.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class CliffsideLookout extends CardImpl { + + public CliffsideLookout(UUID ownerId) { + super(ownerId, 20, "Cliffside Lookout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Kor"); + this.subtype.add("Scout"); + this.subtype.add("Ally"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {4}{W}: Creatures you control get +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl<>("{4}{W}"))); + } + + public CliffsideLookout(final CliffsideLookout card) { + super(card); + } + + @Override + public CliffsideLookout copy() { + return new CliffsideLookout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CloudManta.java b/Mage.Sets/src/mage/sets/battleforzendikar/CloudManta.java new file mode 100644 index 00000000000..6771fb73cdb --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CloudManta.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class CloudManta extends CardImpl { + + public CloudManta(UUID ownerId) { + super(ownerId, 71, "Cloud Manta", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Fish"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + } + + public CloudManta(final CloudManta card) { + super(card); + } + + @Override + public CloudManta copy() { + return new CloudManta(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ClutchOfCurrents.java b/Mage.Sets/src/mage/sets/battleforzendikar/ClutchOfCurrents.java new file mode 100644 index 00000000000..2619589cb6a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ClutchOfCurrents.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ClutchOfCurrents extends CardImpl { + + public ClutchOfCurrents(UUID ownerId) { + super(ownerId, 72, "Clutch of Currents", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); + this.expansionSetCode = "BFZ"; + + // Return target creature to its owner's hand. + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Awaken 3—{4}{U} + this.addAbility(new AwakenAbility(this, 3, "{4}{U}")); + } + + public ClutchOfCurrents(final ClutchOfCurrents card) { + super(card); + } + + @Override + public ClutchOfCurrents copy() { + return new ClutchOfCurrents(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CoastalDiscovery.java b/Mage.Sets/src/mage/sets/battleforzendikar/CoastalDiscovery.java new file mode 100644 index 00000000000..36c7f87a4f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CoastalDiscovery.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class CoastalDiscovery extends CardImpl { + + public CoastalDiscovery(UUID ownerId) { + super(ownerId, 73, "Coastal Discovery", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{U}"); + this.expansionSetCode = "BFZ"; + + // Draw two cards. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2)); + + // Awaken 4 - {5}U} + this.addAbility(new AwakenAbility(this, 4, "{5}{U}")); + } + + public CoastalDiscovery(final CoastalDiscovery card) { + super(card); + } + + @Override + public CoastalDiscovery copy() { + return new CoastalDiscovery(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CompleteDisregard.java b/Mage.Sets/src/mage/sets/battleforzendikar/CompleteDisregard.java new file mode 100644 index 00000000000..9a923541d9c --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CompleteDisregard.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class CompleteDisregard extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 3 or less"); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, 4)); + } + + public CompleteDisregard(UUID ownerId) { + super(ownerId, 90, "Complete Disregard", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + + // Exile target creature with power 3 or less. + this.getSpellAbility().addEffect(new ExileTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + } + + public CompleteDisregard(final CompleteDisregard card) { + super(card); + } + + @Override + public CompleteDisregard copy() { + return new CompleteDisregard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ConduitOfRuin.java b/Mage.Sets/src/mage/sets/battleforzendikar/ConduitOfRuin.java new file mode 100644 index 00000000000..772c7872c79 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ConduitOfRuin.java @@ -0,0 +1,164 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect; +import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.WatcherScope; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.ObjectPlayer; +import mage.filter.predicate.ObjectPlayerPredicate; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Controllable; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; +import mage.target.common.TargetCardInLibrary; +import mage.watchers.Watcher; + +/** + * + * @author LevelX2 + */ +public class ConduitOfRuin extends CardImpl { + + private static final FilterCreatureCard filter = new FilterCreatureCard("a colorless creature card with converted mana cost 7 or greater"); + private static final FilterCreatureCard filterCost = new FilterCreatureCard("The first creature spell"); + + static { + filter.add(new ColorlessPredicate()); + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.GreaterThan, 6)); + filterCost.add(new FirstCastCreatureSpellPredicate()); + } + + public ConduitOfRuin(UUID ownerId) { + super(ownerId, 4, "Conduit of Ruin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // When you cast Conduit of Ruin, you may search your library for a colorless creature card with converted mana cost 7 or greater, then shuffle your library and put that card on top of it. + TargetCardInLibrary target = new TargetCardInLibrary(filter); + this.addAbility(new CastSourceTriggeredAbility(new SearchLibraryPutOnLibraryEffect(target, true, true), true)); + + // The first creature spell you cast each turn costs {2} less to cast. + Effect effect = new SpellsCostReductionControllerEffect(filterCost, 2); + effect.setText("The first creature spell you cast each turn costs {2} less to cast"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect), new ConduitOfRuinWatcher()); + } + + public ConduitOfRuin(final ConduitOfRuin card) { + super(card); + } + + @Override + public ConduitOfRuin copy() { + return new ConduitOfRuin(this); + } +} + +class ConduitOfRuinWatcher extends Watcher { + + Map playerCreatureSpells; + int spellCount = 0; + + public ConduitOfRuinWatcher() { + super("FirstCreatureSpellCastThisTurn", WatcherScope.GAME); + playerCreatureSpells = new HashMap<>(); + } + + public ConduitOfRuinWatcher(final ConduitOfRuinWatcher watcher) { + super(watcher); + this.playerCreatureSpells = new HashMap<>(); + playerCreatureSpells.putAll(watcher.playerCreatureSpells); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SPELL_CAST) { + Spell spell = (Spell) game.getObject(event.getTargetId()); + if (spell != null && spell.getCardType().contains(CardType.CREATURE)) { + if (playerCreatureSpells.containsKey(event.getPlayerId())) { + playerCreatureSpells.put(event.getPlayerId(), playerCreatureSpells.get(event.getPlayerId()) + 1); + } else { + playerCreatureSpells.put(event.getPlayerId(), 1); + } + } + } + } + + public int creatureSpellsCastThisTurn(UUID playerId) { + if (playerCreatureSpells.containsKey(playerId)) { + return playerCreatureSpells.get(playerId); + } + return 0; + } + + @Override + public ConduitOfRuinWatcher copy() { + return new ConduitOfRuinWatcher(this); + } + + @Override + public void reset() { + super.reset(); + playerCreatureSpells.clear(); + } +} + +class FirstCastCreatureSpellPredicate implements ObjectPlayerPredicate> { + + @Override + public boolean apply(ObjectPlayer input, Game game) { + if (input.getObject() instanceof Spell + && ((Spell) input.getObject()).getCardType().contains(CardType.CREATURE)) { + ConduitOfRuinWatcher watcher = (ConduitOfRuinWatcher) game.getState().getWatchers().get("FirstCreatureSpellCastThisTurn"); + return watcher != null && watcher.creatureSpellsCastThisTurn(input.getPlayerId()) == 0; + } + return false; + } + + @Override + public String toString() { + return "The first creature spell you cast each turn"; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CoralhelmGuide.java b/Mage.Sets/src/mage/sets/battleforzendikar/CoralhelmGuide.java new file mode 100644 index 00000000000..30105514328 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CoralhelmGuide.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class CoralhelmGuide extends CardImpl { + + public CoralhelmGuide(UUID ownerId) { + super(ownerId, 74, "Coralhelm Guide", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Merfolk"); + this.subtype.add("Scout"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // {4}{U}: Target creature can't be blocked this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(Duration.EndOfTurn), new ManaCostsImpl<>("{4}{U}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public CoralhelmGuide(final CoralhelmGuide card) { + super(card); + } + + @Override + public CoralhelmGuide copy() { + return new CoralhelmGuide(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CourierGriffin.java b/Mage.Sets/src/mage/sets/battleforzendikar/CourierGriffin.java new file mode 100644 index 00000000000..88a03fe4f6f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CourierGriffin.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class CourierGriffin extends CardImpl { + + public CourierGriffin(UUID ownerId) { + super(ownerId, 21, "Courier Griffin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Griffin"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Courier Griffin enters the battlefield, you gain 2 life. + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(2), false)); + } + + public CourierGriffin(final CourierGriffin card) { + super(card); + } + + @Override + public CourierGriffin copy() { + return new CourierGriffin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CrumbleToDust.java b/Mage.Sets/src/mage/sets/battleforzendikar/CrumbleToDust.java new file mode 100644 index 00000000000..fcbcf0a1c03 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CrumbleToDust.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.common.ExileTargetAndSearchGraveyardHandLibraryEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetNonBasicLandPermanent; + +/** + * + * @author fireshoes + */ +public class CrumbleToDust extends CardImpl { + + public CrumbleToDust(UUID ownerId) { + super(ownerId, 128, "Crumble to Dust", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + + // Exile target nonbasic land. Search its controller's graveyard, hand, and library for any number of cards with the same name as that land and exile them. Then that player shuffles his or her library. + this.getSpellAbility().addTarget(new TargetNonBasicLandPermanent()); + this.getSpellAbility().addEffect(new ExileTargetAndSearchGraveyardHandLibraryEffect(false, "its controller's", "any number of cards with the same name as that land")); + } + + public CrumbleToDust(final CrumbleToDust card) { + super(card); + } + + @Override + public CrumbleToDust copy() { + return new CrumbleToDust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CrypticCruiser.java b/Mage.Sets/src/mage/sets/battleforzendikar/CrypticCruiser.java new file mode 100644 index 00000000000..e54defd0ce1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CrypticCruiser.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileOpponentsCardFromExileToGraveyardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class CrypticCruiser extends CardImpl { + + public CrypticCruiser(UUID ownerId) { + super(ownerId, 56, "Cryptic Cruiser", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Processor"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // {2}{U}, Put a card an opponent owns from exile into that player's graveyard: Tap target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl<>("{2}{U}")); + ability.addCost(new ExileOpponentsCardFromExileToGraveyardCost(true)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + } + + public CrypticCruiser(final CrypticCruiser card) { + super(card); + } + + @Override + public CrypticCruiser copy() { + return new CrypticCruiser(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CullingDrone.java b/Mage.Sets/src/mage/sets/battleforzendikar/CullingDrone.java new file mode 100644 index 00000000000..a3aa372f585 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CullingDrone.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class CullingDrone extends CardImpl { + + public CullingDrone(UUID ownerId) { + super(ownerId, 91, "Culling Drone", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Ingest + this.addAbility(new IngestAbility()); + } + + public CullingDrone(final CullingDrone card) { + super(card); + } + + @Override + public CullingDrone copy() { + return new CullingDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DampeningPulse.java b/Mage.Sets/src/mage/sets/battleforzendikar/DampeningPulse.java new file mode 100644 index 00000000000..e03a58c6f97 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DampeningPulse.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LevelX2 + */ +public class DampeningPulse extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public DampeningPulse(UUID ownerId) { + super(ownerId, 75, "Dampening Pulse", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}"); + this.expansionSetCode = "BFZ"; + + // Creatures your opponents control get -1/-0. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -0, Duration.WhileOnBattlefield, filter, false))); + + } + + public DampeningPulse(final DampeningPulse card) { + super(card); + } + + @Override + public DampeningPulse copy() { + return new DampeningPulse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DeathlessBehemoth.java b/Mage.Sets/src/mage/sets/battleforzendikar/DeathlessBehemoth.java new file mode 100644 index 00000000000..36085ecf6d1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DeathlessBehemoth.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author fireshoes + */ +public class DeathlessBehemoth extends CardImpl { + + private final static FilterControlledPermanent filter = new FilterControlledPermanent("two Eldrazi Scions"); + + static { + filter.add(Predicates.and( + new SubtypePredicate("Eldrazi"), + new SubtypePredicate("Scion"))); + } + + public DeathlessBehemoth(UUID ownerId) { + super(ownerId, 5, "Deathless Behemoth", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{6}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Sacrifice two Eldrazi Scions: Return Deathless Behemoth from your graveyard to your hand. Activate this ability only any time you could cast a sorcery. + this.addAbility(new ActivateAsSorceryActivatedAbility(Zone.GRAVEYARD, + new ReturnToHandSourceEffect(), new SacrificeTargetCost(new TargetControlledPermanent(2, 2, filter, true)))); + } + + public DeathlessBehemoth(final DeathlessBehemoth card) { + super(card); + } + + @Override + public DeathlessBehemoth copy() { + return new DeathlessBehemoth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DefiantBloodlord.java b/Mage.Sets/src/mage/sets/battleforzendikar/DefiantBloodlord.java new file mode 100644 index 00000000000..e1bb3d98f1a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DefiantBloodlord.java @@ -0,0 +1,110 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class DefiantBloodlord extends CardImpl { + + public DefiantBloodlord(UUID ownerId) { + super(ownerId, 107, "Defiant Bloodlord", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Vampire"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever you gain life, target opponent loses that much life. + DefiantBloodlordTriggeredAbility ability = new DefiantBloodlordTriggeredAbility(); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public DefiantBloodlord(final DefiantBloodlord card) { + super(card); + } + + @Override + public DefiantBloodlord copy() { + return new DefiantBloodlord(this); + } +} + +class DefiantBloodlordTriggeredAbility extends TriggeredAbilityImpl { + + public DefiantBloodlordTriggeredAbility() { + super(Zone.BATTLEFIELD, null); + } + + public DefiantBloodlordTriggeredAbility(final DefiantBloodlordTriggeredAbility ability) { + super(ability); + } + + @Override + public DefiantBloodlordTriggeredAbility copy() { + return new DefiantBloodlordTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.GAINED_LIFE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getPlayerId().equals(this.controllerId)) { + this.getEffects().clear(); + this.addEffect(new LoseLifeTargetEffect(event.getAmount())); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you gain life, target opponent loses that much life."; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DemonsGrasp.java b/Mage.Sets/src/mage/sets/battleforzendikar/DemonsGrasp.java new file mode 100644 index 00000000000..33b905ad211 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DemonsGrasp.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class DemonsGrasp extends CardImpl { + + public DemonsGrasp(UUID ownerId) { + super(ownerId, 108, "Demon's Grasp", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{B}"); + this.expansionSetCode = "BFZ"; + + // Target creature gets -5/-5 until end of turn. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new BoostTargetEffect(-5, -5, Duration.EndOfTurn)); + } + + public DemonsGrasp(final DemonsGrasp card) { + super(card); + } + + @Override + public DemonsGrasp copy() { + return new DemonsGrasp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DesolationTwin.java b/Mage.Sets/src/mage/sets/battleforzendikar/DesolationTwin.java new file mode 100644 index 00000000000..83c7cb97d34 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DesolationTwin.java @@ -0,0 +1,112 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.token.Token; +import mage.game.stack.Spell; + +/** + * + * @author fireshoes + */ +public class DesolationTwin extends CardImpl { + + public DesolationTwin(UUID ownerId) { + super(ownerId, 6, "Desolation Twin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{10}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(10); + this.toughness = new MageInt(10); + + // When you cast Desolation Twin, put a 10/10 colorless Eldrazi creature token onto the battlefield. + this.addAbility(new DesolationTwinOnCastAbility()); + } + + public DesolationTwin(final DesolationTwin card) { + super(card); + } + + @Override + public DesolationTwin copy() { + return new DesolationTwin(this); + } +} + +class DesolationTwinOnCastAbility extends TriggeredAbilityImpl { + + DesolationTwinOnCastAbility() { + super(Zone.STACK, new CreateTokenEffect(new EldraziToken())); + } + + DesolationTwinOnCastAbility(DesolationTwinOnCastAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Spell spell = (Spell) game.getObject(event.getTargetId()); + return this.getSourceId().equals(spell.getSourceId()); + } + + @Override + public DesolationTwinOnCastAbility copy() { + return new DesolationTwinOnCastAbility(this); + } + + @Override + public String getRule() { + return "When you cast {this}, " + super.getRule(); + } +} + +class EldraziToken extends Token { + + public EldraziToken() { + super("Eldrazi", "10/10 colorless Eldrazi creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Eldrazi"); + power = new MageInt(10); + toughness = new MageInt(10); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Dispel.java b/Mage.Sets/src/mage/sets/battleforzendikar/Dispel.java new file mode 100644 index 00000000000..7a408452173 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Dispel.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Dispel extends mage.sets.worldwake.Dispel { + + public Dispel(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + this.expansionSetCode = "BFZ"; + } + + public Dispel(final Dispel card) { + super(card); + } + + @Override + public Dispel copy() { + return new Dispel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java b/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java new file mode 100644 index 00000000000..0d52800b415 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LevelX2 + */ +public class DominatorDrone extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another colorless creature"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ColorlessPredicate()); + } + + public DominatorDrone(UUID ownerId) { + super(ownerId, 92, "Dominator Drone", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.) + this.addAbility(new IngestAbility()); + + // When Dominator Drone enters the battlefield, if you control another colorless creature, each opponent loses 2 life. + TriggeredAbility triggeredAbility = new EntersBattlefieldTriggeredAbility(new DamagePlayersEffect(2, TargetController.OPPONENT)); + this.addAbility(new ConditionalTriggeredAbility( + triggeredAbility, + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0), + "When {this} enters the battlefield, if you control another colorless creature, each opponent loses 2 life.")); + + } + + public DominatorDrone(final DominatorDrone card) { + super(card); + } + + @Override + public DominatorDrone copy() { + return new DominatorDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DragonmasterOutcast.java b/Mage.Sets/src/mage/sets/battleforzendikar/DragonmasterOutcast.java new file mode 100644 index 00000000000..8689e99c970 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DragonmasterOutcast.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DragonmasterOutcast extends mage.sets.worldwake.DragonmasterOutcast { + + public DragonmasterOutcast(UUID ownerId) { + super(ownerId); + this.cardNumber = 144; + this.expansionSetCode = "BFZ"; + } + + public DragonmasterOutcast(final DragonmasterOutcast card) { + super(card); + } + + @Override + public DragonmasterOutcast copy() { + return new DragonmasterOutcast(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DranaLiberatorOfMalakir.java b/Mage.Sets/src/mage/sets/battleforzendikar/DranaLiberatorOfMalakir.java new file mode 100644 index 00000000000..e6076d394af --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DranaLiberatorOfMalakir.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author fireshoes + */ +public class DranaLiberatorOfMalakir extends CardImpl { + + private static final FilterAttackingCreature filter = new FilterAttackingCreature("each attacking creature you control"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public DranaLiberatorOfMalakir(UUID ownerId) { + super(ownerId, 109, "Drana, Liberator of Malakir", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "BFZ"; + this.supertype.add("Legendary"); + this.subtype.add("Vampire"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // Whenever Drana, Liberator of Malakir deals combat damage to player, put a +1/+1 counter on each attacking creature you control. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter), false)); + } + + public DranaLiberatorOfMalakir(final DranaLiberatorOfMalakir card) { + super(card); + } + + @Override + public DranaLiberatorOfMalakir copy() { + return new DranaLiberatorOfMalakir(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DranasEmissary.java b/Mage.Sets/src/mage/sets/battleforzendikar/DranasEmissary.java new file mode 100644 index 00000000000..2b3b6c56394 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DranasEmissary.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author fireshoes + */ +public class DranasEmissary extends CardImpl { + + public DranasEmissary(UUID ownerId) { + super(ownerId, 210, "Drana's Emissary", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Vampire"); + this.subtype.add("Cleric"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // At the beginning of your upkeep, each opponent loses 1 life and you gain 1 life. + Effect effect = new GainLifeEffect(1); + effect.setText("and you gain 1 life"); + Ability ability = new BeginningOfUpkeepTriggeredAbility(new LoseLifeOpponentsEffect(1), TargetController.YOU, false); + ability.addEffect(effect); + this.addAbility(ability); + } + + public DranasEmissary(final DranasEmissary card) { + super(card); + } + + @Override + public DranasEmissary copy() { + return new DranasEmissary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DrownerOfHope.java b/Mage.Sets/src/mage/sets/battleforzendikar/DrownerOfHope.java new file mode 100644 index 00000000000..c71ed280b54 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DrownerOfHope.java @@ -0,0 +1,94 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.EldraziScionToken; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class DrownerOfHope extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an Eldrazi Scion"); + + static { + filter.add(Predicates.and( + new SubtypePredicate("Eldrazi"), + new SubtypePredicate("Scion"))); + } + + public DrownerOfHope(UUID ownerId) { + super(ownerId, 57, "Drowner of Hope", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // When Drowner of Hope enters the battlefield, put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool." + Effect effect = new CreateTokenEffect(new EldraziScionToken(), 2); + effect.setText("put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have \"Sacrifice this creature: Add {1} to your mana pool"); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false)); + + // Sacrifice an Eldrazi Scion: Tap target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new SacrificeTargetCost(new TargetControlledPermanent(filter))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public DrownerOfHope(final DrownerOfHope card) { + super(card); + } + + @Override + public DrownerOfHope copy() { + return new DrownerOfHope(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DustStalker.java b/Mage.Sets/src/mage/sets/battleforzendikar/DustStalker.java new file mode 100644 index 00000000000..15b94094f9c --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DustStalker.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LevelX2 + */ +public class DustStalker extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("if you control no other colorless creatures"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ColorlessPredicate()); + } + + public DustStalker(UUID ownerId) { + super(ownerId, 202, "Dust Stalker", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // Haste + this.addAbility(HasteAbility.getInstance()); + // At the beginning of each end step, if you control no other colorless creatures, return Dust Stalker to its owner's hand. + this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(), TargetController.ANY, + new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.EQUAL_TO, 0), false)); + } + + public DustStalker(final DustStalker card) { + super(card); + } + + @Override + public DustStalker copy() { + return new DustStalker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DutifulReturn.java b/Mage.Sets/src/mage/sets/battleforzendikar/DutifulReturn.java new file mode 100644 index 00000000000..16f15a891a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DutifulReturn.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class DutifulReturn extends mage.sets.khansoftarkir.DutifulReturn { + + public DutifulReturn(UUID ownerId) { + super(ownerId); + this.cardNumber = 110; + this.expansionSetCode = "BFZ"; + } + + public DutifulReturn(final DutifulReturn card) { + super(card); + } + + @Override + public DutifulReturn copy() { + return new DutifulReturn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/EarthenArms.java b/Mage.Sets/src/mage/sets/battleforzendikar/EarthenArms.java new file mode 100644 index 00000000000..b59920c5383 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/EarthenArms.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.target.TargetPermanent; + +/** + * + * @author LevelX2 + */ +public class EarthenArms extends CardImpl { + + public EarthenArms(UUID ownerId) { + super(ownerId, 172, "Earthen Arms", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); + this.expansionSetCode = "BFZ"; + + // Put two +1/+1 counters on target permanent. + this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2))); + this.getSpellAbility().addTarget(new TargetPermanent()); + + // Awaken 4 - {6}{G} + this.addAbility(new AwakenAbility(this, 4, "{6}{G}")); + } + + public EarthenArms(final EarthenArms card) { + super(card); + } + + @Override + public EarthenArms copy() { + return new EarthenArms(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/EldraziDevastator.java b/Mage.Sets/src/mage/sets/battleforzendikar/EldraziDevastator.java new file mode 100644 index 00000000000..75c5c88beaa --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/EldraziDevastator.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class EldraziDevastator extends CardImpl { + + public EldraziDevastator(UUID ownerId) { + super(ownerId, 7, "Eldrazi Devastator", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{8}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(8); + this.toughness = new MageInt(9); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + } + + public EldraziDevastator(final EldraziDevastator card) { + super(card); + } + + @Override + public EldraziDevastator copy() { + return new EldraziDevastator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/EldraziSkyspawner.java b/Mage.Sets/src/mage/sets/battleforzendikar/EldraziSkyspawner.java new file mode 100644 index 00000000000..f741b022af0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/EldraziSkyspawner.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.EldraziScionToken; + +/** + * + * @author LevelX2 + */ +public class EldraziSkyspawner extends CardImpl { + + public EldraziSkyspawner(UUID ownerId) { + super(ownerId, 58, "Eldrazi Skyspawner", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Eldrazi Skyspawner enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + Effect effect = new CreateTokenEffect(new EldraziScionToken()); + effect.setText("put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has \"Sacrifice this creature: Add {1} to your mana pool.\""); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false)); + } + + public EldraziSkyspawner(final EldraziSkyspawner card) { + super(card); + } + + @Override + public EldraziSkyspawner copy() { + return new EldraziSkyspawner(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/EmeriaShepherd.java b/Mage.Sets/src/mage/sets/battleforzendikar/EmeriaShepherd.java new file mode 100644 index 00000000000..df914e83869 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/EmeriaShepherd.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LevelX2 + */ +public class EmeriaShepherd extends CardImpl { + + private static final FilterPermanentCard filter = new FilterPermanentCard("nonland permanent card from your graveyard"); + + static { + filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); + } + + public EmeriaShepherd(UUID ownerId) { + super(ownerId, 22, "Emeria Shepherd", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{W}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Angel"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Landfall — Whenever a land enters the battlefield under your control, you may return target nonland permanent card from your graveyard to your hand. + // If that land is a Plains, you may return that nonland permanent card to the battlefield instead. + Ability ability = new LandfallAbility(Zone.BATTLEFIELD, new EmeriaShepherdReturnToHandTargetEffect(), true); + ability.addTarget(new TargetCardInYourGraveyard(new FilterPermanentCard(filter))); + this.addAbility(ability); + } + + public EmeriaShepherd(final EmeriaShepherd card) { + super(card); + } + + @Override + public EmeriaShepherd copy() { + return new EmeriaShepherd(this); + } +} + +class EmeriaShepherdReturnToHandTargetEffect extends OneShotEffect { + + public EmeriaShepherdReturnToHandTargetEffect() { + super(Outcome.ReturnToHand); + staticText = "you may return target nonland permanent card from your graveyard to your hand. If that land is a Plains, you may return that nonland permanent card to the battlefield instead"; + } + + public EmeriaShepherdReturnToHandTargetEffect(final EmeriaShepherdReturnToHandTargetEffect effect) { + super(effect); + } + + @Override + public EmeriaShepherdReturnToHandTargetEffect copy() { + return new EmeriaShepherdReturnToHandTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent triggeringLand = ((LandfallAbility) source).getTriggeringPermanent(); + if (controller == null || triggeringLand == null) { + return false; + } + Zone toZone = Zone.HAND; + if (triggeringLand.getSubtype().contains("Plains") + && controller.chooseUse(Outcome.PutCardInPlay, "Put the card to battlefield instead?", source, game)) { + toZone = Zone.BATTLEFIELD; + } + return controller.moveCards(new CardsImpl(targetPointer.getTargets(game, source)), toZone, source, game); + } + +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/EncirclingFissure.java b/Mage.Sets/src/mage/sets/battleforzendikar/EncirclingFissure.java new file mode 100644 index 00000000000..3722f671901 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/EncirclingFissure.java @@ -0,0 +1,103 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.events.DamageEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.common.TargetOpponent; + +/** + * + * @author LevelX2 + */ +public class EncirclingFissure extends CardImpl { + + public EncirclingFissure(UUID ownerId) { + super(ownerId, 23, "Encircling Fissure", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); + this.expansionSetCode = "BFZ"; + + // Prevent all combat damage that would be dealt this turn by creatures target opponent controls. + this.getSpellAbility().addEffect(new EncirclingFissurePreventEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + + // Awaken 2 —{4}{W} + this.addAbility(new AwakenAbility(this, 2, "{4}{W}")); + } + + public EncirclingFissure(final EncirclingFissure card) { + super(card); + } + + @Override + public EncirclingFissure copy() { + return new EncirclingFissure(this); + } +} + +class EncirclingFissurePreventEffect extends PreventionEffectImpl { + + public EncirclingFissurePreventEffect() { + super(Duration.EndOfTurn, Integer.MAX_VALUE, true, false); + staticText = "Prevent all combat damage that would be dealt this turn by creatures target opponent controls"; + } + + public EncirclingFissurePreventEffect(final EncirclingFissurePreventEffect effect) { + super(effect); + } + + @Override + public EncirclingFissurePreventEffect copy() { + return new EncirclingFissurePreventEffect(this); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (super.applies(event, source, game) && event instanceof DamageEvent && event.getAmount() > 0) { + DamageEvent damageEvent = (DamageEvent) event; + if (damageEvent.isCombatDamage()) { + Permanent permanent = game.getPermanent(damageEvent.getSourceId()); + if (permanent != null + && permanent.getCardType().contains(CardType.CREATURE) + && permanent.getControllerId().equals(getTargetPointer().getFirst(game, source))) { + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/EndlessOne.java b/Mage.Sets/src/mage/sets/battleforzendikar/EndlessOne.java new file mode 100644 index 00000000000..54a615e10a1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/EndlessOne.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author fireshoes + */ +public class EndlessOne extends CardImpl { + + public EndlessOne(UUID ownerId) { + super(ownerId, 8, "Endless One", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{X}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Endless One enters the battlefield with X +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); + } + + public EndlessOne(final EndlessOne card) { + super(card); + } + + @Override + public EndlessOne copy() { + return new EndlessOne(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ExertInfluence.java b/Mage.Sets/src/mage/sets/battleforzendikar/ExertInfluence.java new file mode 100644 index 00000000000..479fdb7709e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ExertInfluence.java @@ -0,0 +1,104 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ExertInfluence extends CardImpl { + + public ExertInfluence(UUID ownerId) { + super(ownerId, 77, "Exert Influence", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{U}"); + this.expansionSetCode = "BFZ"; + + // Converge-Gain control of target creature if its power is less than or equal to the number of colors spent to cast Exert Influence. + getSpellAbility().setAbilityWord(AbilityWord.CONVERGE); + getSpellAbility().addEffect(new ExertInfluenceEffect()); + getSpellAbility().addTarget(new TargetCreaturePermanent()); + + } + + public ExertInfluence(final ExertInfluence card) { + super(card); + } + + @Override + public ExertInfluence copy() { + return new ExertInfluence(this); + } +} + +class ExertInfluenceEffect extends OneShotEffect { + + public ExertInfluenceEffect() { + super(Outcome.GainControl); + this.staticText = "Gain control of target creature if its power is less than or equal to the number of colors spent to cast {this}"; + } + + public ExertInfluenceEffect(final ExertInfluenceEffect effect) { + super(effect); + } + + @Override + public ExertInfluenceEffect copy() { + return new ExertInfluenceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = game.getObject(source.getSourceId()); + Player controller = game.getPlayer(source.getControllerId()); + Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (controller != null && sourceObject != null) { + int colors = new ColorsOfManaSpentToCastCount().calculate(game, source, this); + if (targetCreature.getPower().getValue() <= colors) { + game.addEffect(new GainControlTargetEffect(Duration.Custom, true), source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ExpeditionEnvoy.java b/Mage.Sets/src/mage/sets/battleforzendikar/ExpeditionEnvoy.java new file mode 100644 index 00000000000..2238af4b527 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ExpeditionEnvoy.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class ExpeditionEnvoy extends CardImpl { + + public ExpeditionEnvoy(UUID ownerId) { + super(ownerId, 24, "Expedition Envoy", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Scout"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + } + + public ExpeditionEnvoy(final ExpeditionEnvoy card) { + super(card); + } + + @Override + public ExpeditionEnvoy copy() { + return new ExpeditionEnvoy(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/EyelessWatcher.java b/Mage.Sets/src/mage/sets/battleforzendikar/EyelessWatcher.java new file mode 100644 index 00000000000..f21d030f168 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/EyelessWatcher.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.EldraziScionToken; + +/** + * + * @author LevelX2 + */ +public class EyelessWatcher extends CardImpl { + + public EyelessWatcher(UUID ownerId) { + super(ownerId, 166, "Eyeless Watcher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // When Eyeless Watcher enters the battlefield, put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool." + Effect effect = new CreateTokenEffect(new EldraziScionToken(), 2); + effect.setText("put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have \"Sacrifice this creature: Add {1} to your mana pool.\""); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false)); + + } + + public EyelessWatcher(final EyelessWatcher card) { + super(card); + } + + @Override + public EyelessWatcher copy() { + return new EyelessWatcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/FathomFeeder.java b/Mage.Sets/src/mage/sets/battleforzendikar/FathomFeeder.java new file mode 100644 index 00000000000..7b2034d276a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/FathomFeeder.java @@ -0,0 +1,118 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class FathomFeeder extends CardImpl { + + public FathomFeeder(UUID ownerId) { + super(ownerId, 203, "Fathom Feeder", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{U}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Ingest + this.addAbility(new IngestAbility()); + + // {3}{U}{B}: Draw a card. Each opponent exiles the top card of his or her library. + Effect effect = new FathomFeederEffect(); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{3}{U}{B}")); + ability.addEffect(effect); + this.addAbility(ability); + } + + public FathomFeeder(final FathomFeeder card) { + super(card); + } + + @Override + public FathomFeeder copy() { + return new FathomFeeder(this); + } +} + +class FathomFeederEffect extends OneShotEffect { + public FathomFeederEffect() { + super(Outcome.Exile); + this.staticText = "Each opponent exiles the top card of his or her library"; + } + + public FathomFeederEffect(final FathomFeederEffect effect) { + super(effect); + } + + @Override + public FathomFeederEffect copy() { + return new FathomFeederEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (UUID opponentId: game.getOpponents(source.getControllerId())) { + Player player = game.getPlayer(opponentId); + if (player != null) { + Card card = player.getLibrary().getFromTop(game); + if (card != null) { + player.moveCards(card, Zone.LIBRARY, Zone.EXILED, source, game); + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/FelidarCub.java b/Mage.Sets/src/mage/sets/battleforzendikar/FelidarCub.java new file mode 100644 index 00000000000..c6afaf9d4c5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/FelidarCub.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author fireshoes + */ +public class FelidarCub extends CardImpl { + + public FelidarCub(UUID ownerId) { + super(ownerId, 25, "Felidar Cub", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Cat"); + this.subtype.add("Beast"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Sacrifice Felidar Cub: Destroy target enchantment. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new SacrificeSourceCost()); + ability.addTarget(new TargetEnchantmentPermanent()); + this.addAbility(ability); + } + + public FelidarCub(final FelidarCub card) { + super(card); + } + + @Override + public FelidarCub copy() { + return new FelidarCub(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/FelidarSovereign.java b/Mage.Sets/src/mage/sets/battleforzendikar/FelidarSovereign.java new file mode 100644 index 00000000000..4b5683b1f39 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/FelidarSovereign.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class FelidarSovereign extends mage.sets.zendikar.FelidarSovereign { + + public FelidarSovereign(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + this.expansionSetCode = "BFZ"; + this.rarity = Rarity.RARE; + } + + public FelidarSovereign(final FelidarSovereign card) { + super(card); + } + + @Override + public FelidarSovereign copy() { + return new FelidarSovereign(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/FertileThicket.java b/Mage.Sets/src/mage/sets/battleforzendikar/FertileThicket.java new file mode 100644 index 00000000000..fde59a38378 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/FertileThicket.java @@ -0,0 +1,116 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterBasicLandCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; + +/** + * + * @author LevelX2 + */ +public class FertileThicket extends CardImpl { + + public FertileThicket(UUID ownerId) { + super(ownerId, 237, "Fertile Thicket", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // Fertile Thicket enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // When Fertile Thicket enters the battlefield, you may look at the top five cards of your library. If you do, reveal up to one basic land card from among them, then put that card on top of your library and the rest on the bottom in any order. + this.addAbility(new EntersBattlefieldTriggeredAbility(new FertileThicketEffect(), true)); + + // {T}: Add {G} to your mana pool. + this.addAbility(new GreenManaAbility()); + } + + public FertileThicket(final FertileThicket card) { + super(card); + } + + @Override + public FertileThicket copy() { + return new FertileThicket(this); + } +} + +class FertileThicketEffect extends OneShotEffect { + + public FertileThicketEffect() { + super(Outcome.Benefit); + this.staticText = "you may look at the top five cards of your library. If you do, reveal up to one basic land card from among them, then put that card on top of your library and the rest on the bottom in any order"; + } + + public FertileThicketEffect(final FertileThicketEffect effect) { + super(effect); + } + + @Override + public FertileThicketEffect copy() { + return new FertileThicketEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + Cards cards = new CardsImpl(); + cards.addAll(controller.getLibrary().getTopCards(game, 5)); + controller.lookAtCards(sourceObject.getIdName(), cards, game); + TargetCard target = new TargetCard(0, 1, Zone.LIBRARY, new FilterBasicLandCard()); + controller.chooseTarget(outcome, cards, target, source, game); + Cards cardsRevealed = new CardsImpl(target.getTargets()); + if (!cardsRevealed.isEmpty()) { + controller.revealCards(sourceObject.getIdName(), cardsRevealed, game); + cards.removeAll(cardsRevealed); + controller.putCardsOnTopOfLibrary(cardsRevealed, game, source, true); + } + controller.putCardsOnBottomOfLibrary(cards, game, source, true); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/FiremantleMage.java b/Mage.Sets/src/mage/sets/battleforzendikar/FiremantleMage.java new file mode 100644 index 00000000000..4dfae72574a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/FiremantleMage.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class FiremantleMage extends CardImpl { + + public FiremantleMage(UUID ownerId) { + super(ownerId, 145, "Firemantle Mage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Shaman"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Rally — Whenver Firemantle Mage or another Ally enters the battlefield under your control, creatures you control gain menace until end of turn. + this.addAbility(new AllyEntersBattlefieldTriggeredAbility( + new GainAbilityControlledEffect(new MenaceAbility(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures you control")), false)); + } + + public FiremantleMage(final FiremantleMage card) { + super(card); + } + + @Override + public FiremantleMage copy() { + return new FiremantleMage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java b/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java new file mode 100644 index 00000000000..45bdcdabc95 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ForerunnerOfSlaughter extends mage.sets.zendikarvseldrazi.ForerunnerOfSlaughter { + + public ForerunnerOfSlaughter(UUID ownerId) { + super(ownerId); + this.cardNumber = 204; + this.expansionSetCode = "BFZ"; + } + + public ForerunnerOfSlaughter(final ForerunnerOfSlaughter card) { + super(card); + } + + @Override + public ForerunnerOfSlaughter copy() { + return new ForerunnerOfSlaughter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest1.java new file mode 100644 index 00000000000..d62397e6e1d --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest1 extends mage.cards.basiclands.Forest { + + public Forest1(UUID ownerId) { + super(ownerId, 270); + this.expansionSetCode = "BFZ"; + } + + public Forest1(final Forest1 card) { + super(card); + } + + @Override + public Forest1 copy() { + return new Forest1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest2.java new file mode 100644 index 00000000000..ec7f4c906a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest2 extends mage.cards.basiclands.Forest { + + public Forest2(UUID ownerId) { + super(ownerId, 271); + this.expansionSetCode = "BFZ"; + } + + public Forest2(final Forest2 card) { + super(card); + } + + @Override + public Forest2 copy() { + return new Forest2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest3.java new file mode 100644 index 00000000000..951dce0ba38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest3 extends mage.cards.basiclands.Forest { + + public Forest3(UUID ownerId) { + super(ownerId, 272); + this.expansionSetCode = "BFZ"; + } + + public Forest3(final Forest3 card) { + super(card); + } + + @Override + public Forest3 copy() { + return new Forest3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest4.java new file mode 100644 index 00000000000..647fe973505 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest4 extends mage.cards.basiclands.Forest { + + public Forest4(UUID ownerId) { + super(ownerId, 273); + this.expansionSetCode = "BFZ"; + } + + public Forest4(final Forest4 card) { + super(card); + } + + @Override + public Forest4 copy() { + return new Forest4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest5.java new file mode 100644 index 00000000000..22ed1741346 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest5 extends mage.cards.basiclands.Forest { + + public Forest5(UUID ownerId) { + super(ownerId, 274); + this.expansionSetCode = "BFZ"; + } + + public Forest5(final Forest5 card) { + super(card); + } + + @Override + public Forest5 copy() { + return new Forest5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/FortifiedRampart.java b/Mage.Sets/src/mage/sets/battleforzendikar/FortifiedRampart.java new file mode 100644 index 00000000000..73543737e94 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/FortifiedRampart.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class FortifiedRampart extends CardImpl { + + public FortifiedRampart(UUID ownerId) { + super(ownerId, 27, "Fortified Rampart", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Wall"); + this.power = new MageInt(0); + this.toughness = new MageInt(6); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + } + + public FortifiedRampart(final FortifiedRampart card) { + super(card); + } + + @Override + public FortifiedRampart copy() { + return new FortifiedRampart(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/FromBeyond.java b/Mage.Sets/src/mage/sets/battleforzendikar/FromBeyond.java new file mode 100644 index 00000000000..048f5b9264b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/FromBeyond.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.EldraziScionToken; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author fireshoes + */ +public class FromBeyond extends CardImpl { + + private static final FilterCard filter = new FilterCard("Eldrazi card"); + + static { + filter.add(new SubtypePredicate("Eldrazi")); + } + + public FromBeyond(UUID ownerId) { + super(ownerId, 167, "From Beyond", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}"); + this.expansionSetCode = "BFZ"; + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // At the beginning of your upkeep, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new EldraziScionToken()), TargetController.YOU, false)); + + // {1}{G}, Sacrifice From Beyond: Search your library for an Eldrazi card, reveal it, put it into your hand, then shuffle your library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true), + new ManaCostsImpl("{1}{G}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public FromBeyond(final FromBeyond card) { + super(card); + } + + @Override + public FromBeyond copy() { + return new FromBeyond(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GeyserfieldStalker.java b/Mage.Sets/src/mage/sets/battleforzendikar/GeyserfieldStalker.java new file mode 100644 index 00000000000..4dac3868387 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GeyserfieldStalker.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class GeyserfieldStalker extends CardImpl { + + public GeyserfieldStalker(UUID ownerId) { + super(ownerId, 111, "Geyserfield Stalker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elemental"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Menace + this.addAbility(new MenaceAbility()); + // Landfall - Whenever a land enters the battlefield under your control, Geyserfield Stalker gets +2/+2 until end of turn. + this.addAbility(new LandfallAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false)); + } + + public GeyserfieldStalker(final GeyserfieldStalker card) { + super(card); + } + + @Override + public GeyserfieldStalker copy() { + return new GeyserfieldStalker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GhostlySentinel.java b/Mage.Sets/src/mage/sets/battleforzendikar/GhostlySentinel.java new file mode 100644 index 00000000000..c9397deeb45 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GhostlySentinel.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class GhostlySentinel extends CardImpl { + + public GhostlySentinel(UUID ownerId) { + super(ownerId, 28, "Ghostly Sentinel", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Kor"); + this.subtype.add("Spirit"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + } + + public GhostlySentinel(final GhostlySentinel card) { + super(card); + } + + @Override + public GhostlySentinel copy() { + return new GhostlySentinel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GiantMantis.java b/Mage.Sets/src/mage/sets/battleforzendikar/GiantMantis.java new file mode 100644 index 00000000000..02586302d79 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GiantMantis.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class GiantMantis extends mage.sets.mirage.GiantMantis { + + public GiantMantis(UUID ownerId) { + super(ownerId); + this.cardNumber = 173; + this.expansionSetCode = "BFZ"; + } + + public GiantMantis(final GiantMantis card) { + super(card); + } + + @Override + public GiantMantis copy() { + return new GiantMantis(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java b/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java new file mode 100644 index 00000000000..07c4d334a5e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java @@ -0,0 +1,125 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.GetEmblemEffect; +import mage.abilities.effects.common.PreventAllDamageToSourceEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.command.Emblem; +import mage.game.permanent.token.Token; + +/** + * + * @author fireshoes + */ +public class GideonAllyOfZendikar extends CardImpl { + + public GideonAllyOfZendikar(UUID ownerId) { + super(ownerId, 29, "Gideon, Ally of Zendikar", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Gideon"); + + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + + // +1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn. + LoyaltyAbility ability = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonAllyOfZendikarToken(), "planeswalker", Duration.EndOfTurn), 1); + Effect effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn); + effect.setText("Prevent all damage that would be dealt to him this turn"); + ability.addEffect(effect); + this.addAbility(ability); + + // 0: Put a 2/2 white Knight Ally creature token onto the battlefield. + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new KnightAllyToken()), 0)); + + // -4: You get an emblem with "Creatures you control get +1/+1." + this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new GideonAllyOfZendikarEmblem()), -4)); + } + + public GideonAllyOfZendikar(final GideonAllyOfZendikar card) { + super(card); + } + + @Override + public GideonAllyOfZendikar copy() { + return new GideonAllyOfZendikar(this); + } +} + +class GideonAllyOfZendikarEmblem extends Emblem { + + public GideonAllyOfZendikarEmblem() { + this.setName("EMBLEM: Gideon, Ally of Zendikar"); + BoostControlledEffect effect = new BoostControlledEffect(1, 1, Duration.EndOfGame); + Ability ability = new SimpleStaticAbility(Zone.COMMAND, effect); + this.getAbilities().add(ability); + this.setExpansionSetCodeForImage("BFZ"); + } +} + +class GideonAllyOfZendikarToken extends Token { + + public GideonAllyOfZendikarToken() { + super("", "5/5 Human Soldier Ally creature with indestructible"); + cardType.add(CardType.CREATURE); + subtype.add("Human"); + subtype.add("Soldier"); + subtype.add("Ally"); + power = new MageInt(5); + toughness = new MageInt(5); + + addAbility(IndestructibleAbility.getInstance()); + } +} + +class KnightAllyToken extends Token { + + public KnightAllyToken() { + super("Knight Ally", "2/2 white Knight Ally creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Knight"); + subtype.add("Ally"); + color.setWhite(true); + power = new MageInt(2); + toughness = new MageInt(2); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GideonsReproach.java b/Mage.Sets/src/mage/sets/battleforzendikar/GideonsReproach.java new file mode 100644 index 00000000000..c12411f150e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GideonsReproach.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetAttackingOrBlockingCreature; + +/** + * + * @author fireshoes + */ +public class GideonsReproach extends CardImpl { + + public GideonsReproach(UUID ownerId) { + super(ownerId, 30, "Gideon's Reproach", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + + // Gideon's Reproach deals 4 damage to target attacking or blocking creature. + getSpellAbility().addEffect(new DamageTargetEffect(4)); + getSpellAbility().addTarget(new TargetAttackingOrBlockingCreature()); + } + + public GideonsReproach(final GideonsReproach card) { + super(card); + } + + @Override + public GideonsReproach copy() { + return new GideonsReproach(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GoblinWarPaint.java b/Mage.Sets/src/mage/sets/battleforzendikar/GoblinWarPaint.java new file mode 100644 index 00000000000..454e583840b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GoblinWarPaint.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class GoblinWarPaint extends mage.sets.zendikar.GoblinWarPaint { + + public GoblinWarPaint(UUID ownerId) { + super(ownerId); + this.cardNumber = 146; + this.expansionSetCode = "BFZ"; + } + + public GoblinWarPaint(final GoblinWarPaint card) { + super(card); + } + + @Override + public GoblinWarPaint copy() { + return new GoblinWarPaint(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GraveBirthing.java b/Mage.Sets/src/mage/sets/battleforzendikar/GraveBirthing.java new file mode 100644 index 00000000000..a33a559e1bd --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GraveBirthing.java @@ -0,0 +1,112 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.token.EldraziScionToken; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetOpponent; + +/** + * + * @author LevelX2 + */ +public class GraveBirthing extends CardImpl { + + public GraveBirthing(UUID ownerId) { + super(ownerId, 93, "Grave Birthing", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Target opponent exiles a card from his or her graveyard. You put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + this.getSpellAbility().addEffect(new GraveBirthingEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + Effect effect = new CreateTokenEffect(new EldraziScionToken()); + effect.setText("You put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has \"Sacrifice this creature: Add {1} to your mana pool.\"
"); + this.getSpellAbility().addEffect(effect); // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public GraveBirthing(final GraveBirthing card) { + super(card); + } + + @Override + public GraveBirthing copy() { + return new GraveBirthing(this); + } +} + +class GraveBirthingEffect extends OneShotEffect { + + public GraveBirthingEffect() { + super(Outcome.Benefit); + this.staticText = "Target opponent exiles a card from his or her graveyard"; + } + + public GraveBirthingEffect(final GraveBirthingEffect effect) { + super(effect); + } + + @Override + public GraveBirthingEffect copy() { + return new GraveBirthingEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (opponent != null) { + Target target = new TargetCardInYourGraveyard(); + target.setNotTarget(true); + opponent.chooseTarget(outcome, target, source, game); + Card card = game.getCard(target.getFirstTarget()); + opponent.moveCards(card, null, Zone.EXILED, source, game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GreenwardenOfMurasa.java b/Mage.Sets/src/mage/sets/battleforzendikar/GreenwardenOfMurasa.java new file mode 100644 index 00000000000..be82aa3643e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GreenwardenOfMurasa.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileSourceEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class GreenwardenOfMurasa extends CardImpl { + + public GreenwardenOfMurasa(UUID ownerId) { + super(ownerId, 174, "Greenwarden of Murasa", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elemental"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // When Greenwarden of Murasa enters the battlefield, you may return target card from your graveyard to your hand. + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), true); + ability.addTarget(new TargetCardInYourGraveyard()); + this.addAbility(ability); + + // When Greenwarden of Murasa dies, you may exile it. If you do, return target card from your graveyard to your hand. + ability = new DiesTriggeredAbility(new GreenwardenOfMurasaEffect(), false); + ability.addTarget(new TargetCardInYourGraveyard()); + this.addAbility(ability); + } + + public GreenwardenOfMurasa(final GreenwardenOfMurasa card) { + super(card); + } + + @Override + public GreenwardenOfMurasa copy() { + return new GreenwardenOfMurasa(this); + } +} + +class GreenwardenOfMurasaEffect extends OneShotEffect { + + public GreenwardenOfMurasaEffect() { + super(Outcome.Benefit); + this.staticText = "you may exile it. If you do, return target card from your graveyard to your hand"; + } + + public GreenwardenOfMurasaEffect(final GreenwardenOfMurasaEffect effect) { + super(effect); + } + + @Override + public GreenwardenOfMurasaEffect copy() { + return new GreenwardenOfMurasaEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + Card targetCard = game.getCard(getTargetPointer().getFirst(game, source)); + if (controller != null && sourceObject != null && targetCard != null) { + if (controller.chooseUse(outcome, "Exile " + sourceObject.getLogName() + " to return card from your graveyard to your hand?", source, game)) { + // Setting the fixed target prevents to return Greenwarden of Murasa itself (becuase it's exiled meanwhile), + // but of course you can target it as the ability triggers I guess + Effect effect = new ReturnToHandTargetEffect(); + effect.setTargetPointer(new FixedTarget(targetCard.getId(), targetCard.getZoneChangeCounter(game))); + new ExileSourceEffect().apply(game, source); + return effect.apply(game, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GripOfDesolation.java b/Mage.Sets/src/mage/sets/battleforzendikar/GripOfDesolation.java new file mode 100644 index 00000000000..ab18f020a02 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GripOfDesolation.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetLandPermanent; +import mage.target.targetpointer.SecondTargetPointer; + +/** + * + * @author LevelX2 + */ +public class GripOfDesolation extends CardImpl { + + public GripOfDesolation(UUID ownerId) { + super(ownerId, 94, "Grip of Desolation", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{B}{B}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Exile target creature and target land. + this.getSpellAbility().addEffect(new ExileTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + Effect effect = new ExileTargetEffect(); + effect.setTargetPointer(new SecondTargetPointer()); + effect.setText("and target land"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + + } + + public GripOfDesolation(final GripOfDesolation card) { + super(card); + } + + @Override + public GripOfDesolation copy() { + return new GripOfDesolation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GroveRumbler.java b/Mage.Sets/src/mage/sets/battleforzendikar/GroveRumbler.java new file mode 100644 index 00000000000..830d1fddf12 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GroveRumbler.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class GroveRumbler extends CardImpl { + + public GroveRumbler(UUID ownerId) { + super(ownerId, 211, "Grove Rumbler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elemental"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Landfall-Whenever a land enters the battlefield under your control, Grove Rumbler gets +2/+2 until end of turn. + this.addAbility(new LandfallAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false)); + } + + public GroveRumbler(final GroveRumbler card) { + super(card); + } + + @Override + public GroveRumbler copy() { + return new GroveRumbler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GrovetenderDruids.java b/Mage.Sets/src/mage/sets/battleforzendikar/GrovetenderDruids.java new file mode 100644 index 00000000000..fa502b0d489 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GrovetenderDruids.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class GrovetenderDruids extends CardImpl { + + public GrovetenderDruids(UUID ownerId) { + super(ownerId, 212, "Grovetender Druids", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elf"); + this.subtype.add("Druid"); + this.subtype.add("Ally"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Rally-Whenever Grovetender Druids or another Ally enters the battlefield under your control, you may pay {1}. + // If you do, put a 1/1 green Plant creature token onto the battlefield. + this.addAbility(new AllyEntersBattlefieldTriggeredAbility(new GrovetenderDruidsEffect(), false)); + } + + public GrovetenderDruids(final GrovetenderDruids card) { + super(card); + } + + @Override + public GrovetenderDruids copy() { + return new GrovetenderDruids(this); + } +} + +class GrovetenderDruidsEffect extends OneShotEffect { + + GrovetenderDruidsEffect() { + super(Outcome.Benefit); + this.staticText = "you may pay {1}. If you do, put a 1/1 green Plant creature token onto the battlefield"; + } + + GrovetenderDruidsEffect(final GrovetenderDruidsEffect effect) { + super(effect); + } + + @Override + public GrovetenderDruidsEffect copy() { + return new GrovetenderDruidsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if(player != null) { + if(player.chooseUse(Outcome.BoostCreature, "Do you want to to pay {1}?", source, game)) { + Cost cost = new ManaCostsImpl("{1}"); + if(cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { + new CreateTokenEffect(new GrovetenderDruidsPlantToken()).apply(game, source); + } + return true; + } + } + return false; + } +} + +class GrovetenderDruidsPlantToken extends Token { + + public GrovetenderDruidsPlantToken() { + super("Plant", "1/1 green Plant creature"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Plant"); + power = new MageInt(1); + toughness = new MageInt(1); + this.setOriginalExpansionSetCode("BFZ"); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GruesomeSlaughter.java b/Mage.Sets/src/mage/sets/battleforzendikar/GruesomeSlaughter.java new file mode 100644 index 00000000000..189f4108e21 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GruesomeSlaughter.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class GruesomeSlaughter extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("colorless creatures you control"); + + static { + filter.add(new ColorlessPredicate()); + } + + public GruesomeSlaughter(UUID ownerId) { + super(ownerId, 9, "Gruesome Slaughter", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{6}"); + this.expansionSetCode = "BFZ"; + + // Until end of turn, colorless creatures you control gain "{T}: This creature deals damage equal to its power to target creature." + Effect effect = new DamageTargetEffect(new SourcePermanentPowerCount()); + effect.setText("{this} deals damage equal to its power to target creature."); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new GainAbilityControlledEffect(ability, Duration.EndOfTurn, filter)); + } + + public GruesomeSlaughter(final GruesomeSlaughter card) { + super(card); + } + + @Override + public GruesomeSlaughter copy() { + return new GruesomeSlaughter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GuardianOfTazeem.java b/Mage.Sets/src/mage/sets/battleforzendikar/GuardianOfTazeem.java new file mode 100644 index 00000000000..d82f72d6ad5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GuardianOfTazeem.java @@ -0,0 +1,164 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class GuardianOfTazeem extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public GuardianOfTazeem(UUID ownerId) { + super(ownerId, 78, "Guardian of Tazeem", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Sphinx"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Landfall - Whenever a land enters the battlefield under you control, tap target creature an opponent controls. If that land is an Island, that creature doesn't untap during its controller's next untap step. + Ability ability = new GuardianOfTazeemTriggeredAbility(); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public GuardianOfTazeem(final GuardianOfTazeem card) { + super(card); + } + + @Override + public GuardianOfTazeem copy() { + return new GuardianOfTazeem(this); + } +} + +class GuardianOfTazeemTriggeredAbility extends TriggeredAbilityImpl { + + public GuardianOfTazeemTriggeredAbility() { + super(Zone.BATTLEFIELD, new TapTargetEffect(), false); + addEffect(new GuardianOfTazeemEffect()); + } + + public GuardianOfTazeemTriggeredAbility(final GuardianOfTazeemTriggeredAbility ability) { + super(ability); + } + + @Override + public GuardianOfTazeemTriggeredAbility copy() { + return new GuardianOfTazeemTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null + && permanent.getCardType().contains(CardType.LAND) + && permanent.getControllerId().equals(getControllerId())) { + for (Effect effect : getEffects()) { + if (effect instanceof GuardianOfTazeemEffect) { + effect.setTargetPointer(new FixedTarget(permanent, game)); + } + } + return true; + } + return false; + } + + @Override + public String getRule() { + return "Landfall - Whenever a land enters the battlefield under your control, " + super.getRule(); + } +} + +class GuardianOfTazeemEffect extends OneShotEffect { + + public GuardianOfTazeemEffect() { + super(Outcome.Benefit); + this.staticText = "If that land is an Island, that creature doesn't untap during its controller's next untap step"; + } + + public GuardianOfTazeemEffect(final GuardianOfTazeemEffect effect) { + super(effect); + } + + @Override + public GuardianOfTazeemEffect copy() { + return new GuardianOfTazeemEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + Permanent targetCreature = game.getPermanent(source.getFirstTarget()); + if (land != null && targetCreature != null) { + if (land.hasSubtype("Island")) { + ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("that creature"); + effect.setTargetPointer(new FixedTarget(targetCreature, game)); + game.addEffect(effect, source); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GuulDrazOverseer.java b/Mage.Sets/src/mage/sets/battleforzendikar/GuulDrazOverseer.java new file mode 100644 index 00000000000..745e55c2a94 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GuulDrazOverseer.java @@ -0,0 +1,107 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class GuulDrazOverseer extends CardImpl { + + public GuulDrazOverseer(UUID ownerId) { + super(ownerId, 112, "Guul Draz Overseer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Vampire"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Landfall- Whenever a land enters the battlefield under your control, other creatures you control get +1/+0 until end of turn. If that land is a Swamp, those creatures get +2/+0 until end of turn instead. + this.addAbility(new LandfallAbility(Zone.BATTLEFIELD, new GuulDrazOverseerEffect(), false, SetTargetPointer.PERMANENT)); + } + + public GuulDrazOverseer(final GuulDrazOverseer card) { + super(card); + } + + @Override + public GuulDrazOverseer copy() { + return new GuulDrazOverseer(this); + } +} + +class GuulDrazOverseerEffect extends OneShotEffect { + + public GuulDrazOverseerEffect() { + super(Outcome.BoostCreature); + this.staticText = "other creatures you control get +1/+0 until end of turn. If that land is a Swamp, those creatures get +2/+0 until end of turn instead"; + } + + public GuulDrazOverseerEffect(final GuulDrazOverseerEffect effect) { + super(effect); + } + + @Override + public GuulDrazOverseerEffect copy() { + return new GuulDrazOverseerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + if (controller != null && land != null) { + int boost = 1; + if (land.getSubtype().contains("Swamp")) { + boost = 2; + } + game.addEffect(new BoostControlledEffect(boost, 0, Duration.EndOfTurn, true), source); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/HagraSharpshooter.java b/Mage.Sets/src/mage/sets/battleforzendikar/HagraSharpshooter.java new file mode 100644 index 00000000000..848b4e1aab4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/HagraSharpshooter.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class HagraSharpshooter extends CardImpl { + + public HagraSharpshooter(UUID ownerId) { + super(ownerId, 113, "Hagra Sharpshooter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Assassin"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {4}{B}: Target creature gets -1/-1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-1, -1, Duration.EndOfTurn), new ManaCostsImpl("{4}{B}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public HagraSharpshooter(final HagraSharpshooter card) { + super(card); + } + + @Override + public HagraSharpshooter copy() { + return new HagraSharpshooter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/HalimarTidecaller.java b/Mage.Sets/src/mage/sets/battleforzendikar/HalimarTidecaller.java new file mode 100644 index 00000000000..7afb519a95f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/HalimarTidecaller.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LevelX2 + */ +public class HalimarTidecaller extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Land creatures"); + private static final FilterCard filterCard = new FilterCard("card with awaken from your graveyard"); + + static { + filter.add(new CardTypePredicate(CardType.LAND)); + filter.add(new CardTypePredicate(CardType.CREATURE)); + filterCard.add(new AbilityPredicate(AwakenAbility.class)); + } + + public HalimarTidecaller(UUID ownerId) { + super(ownerId, 79, "Halimar Tidecaller", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // When Halimar Tidecaller enters the battlefield, you may return target card with awaken from your graveyard to your hand. + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true); + ability.addTarget(new TargetCardInYourGraveyard(filterCard)); + + this.addAbility(ability); + + // Land creatures you control have flying. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, filter))); + + } + + public HalimarTidecaller(final HalimarTidecaller card) { + super(card); + } + + @Override + public HalimarTidecaller copy() { + return new HalimarTidecaller(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/HedronArchive.java b/Mage.Sets/src/mage/sets/battleforzendikar/HedronArchive.java new file mode 100644 index 00000000000..460abc0d4e7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/HedronArchive.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class HedronArchive extends CardImpl { + + public HedronArchive(UUID ownerId) { + super(ownerId, 223, "Hedron Archive", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "BFZ"; + + // {T}: Add {2} to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), new TapSourceCost())); + + // {2}, {T}, Sacrifice Hedron Archive: Draw two cards. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(2), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public HedronArchive(final HedronArchive card) { + super(card); + } + + @Override + public HedronArchive copy() { + return new HedronArchive(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/HedronBlade.java b/Mage.Sets/src/mage/sets/battleforzendikar/HedronBlade.java new file mode 100644 index 00000000000..a91a6049a96 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/HedronBlade.java @@ -0,0 +1,131 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.combat.CombatGroup; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class HedronBlade extends CardImpl { + + public HedronBlade(UUID ownerId) { + super(ownerId, 224, "Hedron Blade", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Equipment"); + + // Equipped creature gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1))); + + // Whenever equipped creature becomes blocked by one or more colorless creatures, it gains deathtouch until end of turn. + this.addAbility(new HedronBladeTriggeredAbility( + new GainAbilityAttachedEffect(DeathtouchAbility.getInstance(), AttachmentType.EQUIPMENT, Duration.EndOfTurn))); + + // Equip {2} + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); + } + + public HedronBlade(final HedronBlade card) { + super(card); + } + + @Override + public HedronBlade copy() { + return new HedronBlade(this); + } +} + +class HedronBladeTriggeredAbility extends TriggeredAbilityImpl { + + HedronBladeTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect, false); + } + + HedronBladeTriggeredAbility(final HedronBladeTriggeredAbility ability) { + super(ability); + } + + @Override + public HedronBladeTriggeredAbility copy() { + return new HedronBladeTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_BLOCKERS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent equipment = game.getPermanentOrLKIBattlefield((this.getSourceId())); + if (equipment != null && equipment.getAttachedTo() != null) { + Permanent equippedPermanent = game.getPermanentOrLKIBattlefield((equipment.getAttachedTo())); + if (equippedPermanent != null) { + if (equippedPermanent.isAttacking()) { + for (CombatGroup group : game.getCombat().getGroups()) { + if (group.getAttackers().contains(equippedPermanent.getId())) { + for (UUID blockerId : group.getBlockers()) { + Permanent blocker = game.getPermanent(blockerId); + if (blocker != null && blocker.getColor(game).isColorless()) { + return true; + } + } + } + } + } + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever equipped creature becomes blocked by one or more colorless creatures, " + super.getRule(); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/HeraldOfKozilek.java b/Mage.Sets/src/mage/sets/battleforzendikar/HeraldOfKozilek.java new file mode 100644 index 00000000000..a5c74c30a41 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/HeraldOfKozilek.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorlessPredicate; + +/** + * + * @author fireshoes + */ +public class HeraldOfKozilek extends CardImpl { + + private static final FilterCard filter = new FilterCard("Colorless spells"); + + static { + filter.add(new ColorlessPredicate()); + } + + public HeraldOfKozilek(UUID ownerId) { + super(ownerId, 205, "Herald of Kozilek", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Colorless spells you cast cost {1} less to cast. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionControllerEffect(filter, 1))); + } + + public HeraldOfKozilek(final HeraldOfKozilek card) { + super(card); + } + + @Override + public HeraldOfKozilek copy() { + return new HeraldOfKozilek(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/HeroOfGomaFada.java b/Mage.Sets/src/mage/sets/battleforzendikar/HeroOfGomaFada.java new file mode 100644 index 00000000000..1ea0b04ce62 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/HeroOfGomaFada.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class HeroOfGomaFada extends CardImpl { + + public HeroOfGomaFada(UUID ownerId) { + super(ownerId, 31, "Hero of Goma Fada", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.subtype.add("Ally"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Rally - Whenever Hero of Goma Fada or another Ally enters the battlefield under your control, creatures you control gain indestructible until end of turn. + Ability ability = new AllyEntersBattlefieldTriggeredAbility( + new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn, + new FilterControlledCreaturePermanent("creatures you control")), false); + this.addAbility(ability); + } + + public HeroOfGomaFada(final HeroOfGomaFada card) { + super(card); + } + + @Override + public HeroOfGomaFada copy() { + return new HeroOfGomaFada(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/HorriblyAwry.java b/Mage.Sets/src/mage/sets/battleforzendikar/HorriblyAwry.java new file mode 100644 index 00000000000..40d9e1f3104 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/HorriblyAwry.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.common.CounterTargetWithReplacementEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterCreatureSpell; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.target.TargetSpell; + +/** + * + * @author LevelX2 + */ +public class HorriblyAwry extends CardImpl { + + private static final FilterCreatureSpell filter = new FilterCreatureSpell("creature spell with converted mana cost 4 or less"); + + static { + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 5)); + } + + public HorriblyAwry(UUID ownerId) { + super(ownerId, 59, "Horribly Awry", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Counter target creature spell with converted mana cost 4 or less. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. + this.getSpellAbility().addEffect(new CounterTargetWithReplacementEffect(Zone.EXILED)); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + } + + public HorriblyAwry(final HorriblyAwry card) { + super(card); + } + + @Override + public HorriblyAwry copy() { + return new HorriblyAwry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/IncubatorDrone.java b/Mage.Sets/src/mage/sets/battleforzendikar/IncubatorDrone.java new file mode 100644 index 00000000000..aeba4330a7e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/IncubatorDrone.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.EldraziScionToken; + +/** + * + * @author fireshoes + */ +public class IncubatorDrone extends CardImpl { + + public IncubatorDrone(UUID ownerId) { + super(ownerId, 60, "Incubator Drone", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Whenever Incubator Drone enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + Effect effect = new CreateTokenEffect(new EldraziScionToken()); + effect.setText("put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has \"Sacrifice this creature: Add {1} to your mana pool.\""); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false)); + } + + public IncubatorDrone(final IncubatorDrone card) { + super(card); + } + + @Override + public IncubatorDrone copy() { + return new IncubatorDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/InfuseWithTheElements.java b/Mage.Sets/src/mage/sets/battleforzendikar/InfuseWithTheElements.java new file mode 100644 index 00000000000..5f30903dbf6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/InfuseWithTheElements.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class InfuseWithTheElements extends CardImpl { + + public InfuseWithTheElements(UUID ownerId) { + super(ownerId, 175, "Infuse with the Elements", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{G}"); + this.expansionSetCode = "BFZ"; + + // Converge - Put X +1/+1 counters on target creature, where X is the number of colors of mana spent to cast Infuse with the Elements. + this.getSpellAbility().setAbilityWord(AbilityWord.CONVERGE); + Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(0), ColorsOfManaSpentToCastCount.getInstance()); + effect.setText("Put X +1/+1 counters on target creature, where X is the number of colors of mana spent to cast {this}"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // That creature gains trample until end of turn. + effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); + effect.setText("That creature gains trample until end of turn"); + this.getSpellAbility().addEffect(effect); + } + + public InfuseWithTheElements(final InfuseWithTheElements card) { + super(card); + } + + @Override + public InfuseWithTheElements copy() { + return new InfuseWithTheElements(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/InspiredCharge.java b/Mage.Sets/src/mage/sets/battleforzendikar/InspiredCharge.java new file mode 100644 index 00000000000..3b5d54435b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/InspiredCharge.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class InspiredCharge extends mage.sets.magic2011.InspiredCharge { + + public InspiredCharge(UUID ownerId) { + super(ownerId); + this.cardNumber = 32; + this.expansionSetCode = "BFZ"; + } + + public InspiredCharge(final InspiredCharge card) { + super(card); + } + + @Override + public InspiredCharge copy() { + return new InspiredCharge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island1.java new file mode 100644 index 00000000000..d7c7643785a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island1 extends mage.cards.basiclands.Island { + + public Island1(UUID ownerId) { + super(ownerId, 255); + this.expansionSetCode = "BFZ"; + } + + public Island1(final Island1 card) { + super(card); + } + + @Override + public Island1 copy() { + return new Island1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island2.java new file mode 100644 index 00000000000..191e7a9c944 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island2 extends mage.cards.basiclands.Island { + + public Island2(UUID ownerId) { + super(ownerId, 256); + this.expansionSetCode = "BFZ"; + } + + public Island2(final Island2 card) { + super(card); + } + + @Override + public Island2 copy() { + return new Island2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island3.java new file mode 100644 index 00000000000..d097e0fe234 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island3 extends mage.cards.basiclands.Island { + + public Island3(UUID ownerId) { + super(ownerId, 257); + this.expansionSetCode = "BFZ"; + } + + public Island3(final Island3 card) { + super(card); + } + + @Override + public Island3 copy() { + return new Island3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island4.java new file mode 100644 index 00000000000..7346a47f65e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island4 extends mage.cards.basiclands.Island { + + public Island4(UUID ownerId) { + super(ownerId, 258); + this.expansionSetCode = "BFZ"; + } + + public Island4(final Island4 card) { + super(card); + } + + @Override + public Island4 copy() { + return new Island4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island5.java new file mode 100644 index 00000000000..508d1081cc6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island5 extends mage.cards.basiclands.Island { + + public Island5(UUID ownerId) { + super(ownerId, 259); + this.expansionSetCode = "BFZ"; + } + + public Island5(final Island5 card) { + super(card); + } + + @Override + public Island5 copy() { + return new Island5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/JaddiOffshoot.java b/Mage.Sets/src/mage/sets/battleforzendikar/JaddiOffshoot.java new file mode 100644 index 00000000000..20a35fa49f3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/JaddiOffshoot.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class JaddiOffshoot extends CardImpl { + + public JaddiOffshoot(UUID ownerId) { + super(ownerId, 176, "Jaddi Offshoot", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Plant"); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Landfall - Whenever a land enters the battlefield under your control, you gain 1 life. + this.addAbility(new LandfallAbility(new GainLifeEffect(1), false)); + } + + public JaddiOffshoot(final JaddiOffshoot card) { + super(card); + } + + @Override + public JaddiOffshoot copy() { + return new JaddiOffshoot(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/KalastriaHealer.java b/Mage.Sets/src/mage/sets/battleforzendikar/KalastriaHealer.java new file mode 100644 index 00000000000..961116a0201 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/KalastriaHealer.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class KalastriaHealer extends CardImpl { + + public KalastriaHealer(UUID ownerId) { + super(ownerId, 114, "Kalastria Healer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Vampire"); + this.subtype.add("Cleric"); + this.subtype.add("Ally"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Rally - Whenever Kalastria Healer or another Ally enters the battlefield under your control, each opponent loses 1 life and you gain 1 life. + Ability ability = new AllyEntersBattlefieldTriggeredAbility(new LoseLifeOpponentsEffect(1), false); + Effect effect = new GainLifeEffect(1); + effect.setText("and you gain 1 life"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public KalastriaHealer(final KalastriaHealer card) { + super(card); + } + + @Override + public KalastriaHealer copy() { + return new KalastriaHealer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/KalastriaNightwatch.java b/Mage.Sets/src/mage/sets/battleforzendikar/KalastriaNightwatch.java new file mode 100644 index 00000000000..46641e624ae --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/KalastriaNightwatch.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.GainLifeControllerTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class KalastriaNightwatch extends CardImpl { + + public KalastriaNightwatch(UUID ownerId) { + super(ownerId, 115, "Kalastria Nightwatch", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Vampire"); + this.subtype.add("Warrior"); + this.subtype.add("Ally"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Whenever you gain life, Kalastria Nightwatch gains flying until end of turn. + this.addAbility(new GainLifeControllerTriggeredAbility(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), false)); + } + + public KalastriaNightwatch(final KalastriaNightwatch card) { + super(card); + } + + @Override + public KalastriaNightwatch copy() { + return new KalastriaNightwatch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/KioraMasterOfTheDepths.java b/Mage.Sets/src/mage/sets/battleforzendikar/KioraMasterOfTheDepths.java new file mode 100644 index 00000000000..ead4e657e67 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/KioraMasterOfTheDepths.java @@ -0,0 +1,259 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.GetEmblemEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterLandCard; +import mage.filter.common.FilterLandPermanent; +import mage.game.Game; +import mage.game.command.Emblem; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.Token; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author fireshoes + */ +public class KioraMasterOfTheDepths extends CardImpl { + + public KioraMasterOfTheDepths(UUID ownerId) { + super(ownerId, 213, "Kiora, Master of the Depths", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{G}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Kiora"); + + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + + // +1: Untap up to one target creature and up to one target land. + LoyaltyAbility ability1 = new LoyaltyAbility(new KioraUntapEffect(), 1); + ability1.addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent(), false)); + ability1.addTarget(new TargetLandPermanent(0, 1, new FilterLandPermanent(), false)); + this.addAbility(ability1); + + // -2: Reveal the top four cards of your library. You may put a creature card and/or a land card from among them into your hand. Put the rest into your graveyard. + this.addAbility(new LoyaltyAbility(new KioraRevealEffect(), -2)); + + // -8: You get an emblem with "Whenever a creature enters the battlefield under your control, you may have it fight target creature." Then put three 8/8 blue Octopus creature tokens onto the battlefield. + Effect effect = new CreateTokenEffect(new OctopusToken(), 3); + effect.setText("Then put three 8/8 blue Octopus creature tokens onto the battlefield"); + LoyaltyAbility ability3 = new LoyaltyAbility(new GetEmblemEffect(new KioraMasterOfTheDepthsEmblem()), -8); + ability3.addEffect(effect); + this.addAbility(ability3); + } + + public KioraMasterOfTheDepths(final KioraMasterOfTheDepths card) { + super(card); + } + + @Override + public KioraMasterOfTheDepths copy() { + return new KioraMasterOfTheDepths(this); + } +} + +class KioraUntapEffect extends OneShotEffect { + + public KioraUntapEffect() { + super(Outcome.Untap); + this.staticText = "Untap up to one target creature and up to one target land"; + } + + public KioraUntapEffect(final KioraUntapEffect effect) { + super(effect); + } + + @Override + public KioraUntapEffect copy() { + return new KioraUntapEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent firstTarget = game.getPermanent(source.getTargets().get(0).getFirstTarget()); + Permanent secondTarget = game.getPermanent(source.getTargets().get(1).getFirstTarget()); + if (firstTarget != null) { + firstTarget.untap(game); + } + if (secondTarget != null) { + return secondTarget.untap(game); + } + return true; + } +} + +class KioraRevealEffect extends OneShotEffect { + + public KioraRevealEffect() { + super(Outcome.DrawCard); + this.staticText = "Reveal the top four cards of your library. You may put a creature card and/or a land card from among them into your hand. Put the rest into your graveyard"; + } + + public KioraRevealEffect(final KioraRevealEffect effect) { + super(effect); + } + + @Override + public KioraRevealEffect copy() { + return new KioraRevealEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (sourceObject != null && controller != null) { + Cards cards = new CardsImpl(Zone.LIBRARY); + cards.addAll(controller.getLibrary().getTopCards(game, 4)); + boolean creatureCardFound = false; + boolean landCardFound = false; + for (UUID cardId : cards) { + Card card = game.getCard(cardId); + if (card != null) { + cards.add(card); + if (card.getCardType().contains(CardType.CREATURE)) { + creatureCardFound = true; + } + if (card.getCardType().contains(CardType.LAND)) { + landCardFound = true; + } + } + } + + if (!cards.isEmpty()) { + controller.revealCards(sourceObject.getName(), cards, game); + if ((creatureCardFound || landCardFound) + && controller.chooseUse(Outcome.DrawCard, + "Put a creature card and/or a land card into your hand?", source, game)) { + TargetCard target = new TargetCard(Zone.PICK, new FilterCreatureCard("creature card to put into your hand")); + if (creatureCardFound && controller.chooseTarget(Outcome.DrawCard, cards, target, source, game)) { + Card card = cards.get(target.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + controller.moveCards(card, null, Zone.HAND, source, game); + } + } + + target = new TargetCard(Zone.LIBRARY, new FilterLandCard("land card to put into your hand")); + if (landCardFound && controller.chooseTarget(Outcome.DrawCard, cards, target, source, game)) { + Card card = cards.get(target.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + controller.moveCards(card, null, Zone.HAND, source, game); + } + } + } + } + controller.moveCards(cards, null, Zone.GRAVEYARD, source, game); + return true; + } + return false; + } +} + +class KioraMasterOfTheDepthsEmblem extends Emblem { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures"); + + public KioraMasterOfTheDepthsEmblem() { + this.setName("EMBLEM: Kiora, Master of the Depths"); + + Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.COMMAND, + new KioraFightEffect(), filter, true, SetTargetPointer.PERMANENT, + "Whenever a creature enters the battlefield under your control, you may have it fight target creature."); + ability.addTarget(new TargetCreaturePermanent()); + this.getAbilities().add(ability); + this.setExpansionSetCodeForImage("BFZ"); + } +} + +class KioraFightEffect extends OneShotEffect { + + KioraFightEffect() { + super(Outcome.Damage); + } + + KioraFightEffect(final KioraFightEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent triggeredCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); + Permanent target = game.getPermanent(source.getFirstTarget()); + if (triggeredCreature != null + && target != null + && triggeredCreature.getCardType().contains(CardType.CREATURE) + && target.getCardType().contains(CardType.CREATURE)) { + triggeredCreature.fight(target, source, game); + return true; + } + return false; + } + + @Override + public KioraFightEffect copy() { + return new KioraFightEffect(this); + } +} + +class OctopusToken extends Token { + + public OctopusToken() { + super("Octopus", "8/8 blue Octopus creature token"); + cardType.add(CardType.CREATURE); + color.setBlue(true); + subtype.add("Octopus"); + power = new MageInt(8); + toughness = new MageInt(8); + this.setOriginalExpansionSetCode("BFZ"); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/KitesailScout.java b/Mage.Sets/src/mage/sets/battleforzendikar/KitesailScout.java new file mode 100644 index 00000000000..4bc5547dbd3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/KitesailScout.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class KitesailScout extends CardImpl { + + public KitesailScout(UUID ownerId) { + super(ownerId, 33, "Kitesail Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Kor"); + this.subtype.add("Scout"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + } + + public KitesailScout(final KitesailScout card) { + super(card); + } + + @Override + public KitesailScout copy() { + return new KitesailScout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/KorBladewhirl.java b/Mage.Sets/src/mage/sets/battleforzendikar/KorBladewhirl.java new file mode 100644 index 00000000000..283723fab14 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/KorBladewhirl.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class KorBladewhirl extends CardImpl { + + public KorBladewhirl(UUID ownerId) { + super(ownerId, 34, "Kor Bladewhirl", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Kor"); + this.subtype.add("Soldier"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Rally — Whenever Kor Bladewhirl or another Ally enters the battlefield under your control, creatures you control gain first strike until end of turn. + this.addAbility(new AllyEntersBattlefieldTriggeredAbility( + new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures you control")), false)); + } + + public KorBladewhirl(final KorBladewhirl card) { + super(card); + } + + @Override + public KorBladewhirl copy() { + return new KorBladewhirl(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/KorCastigator.java b/Mage.Sets/src/mage/sets/battleforzendikar/KorCastigator.java new file mode 100644 index 00000000000..2595f18b8b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/KorCastigator.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LevelX2 + */ +public class KorCastigator extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Eldrazi Scions"); + + static { + filter.add(new SubtypePredicate("Eldrazi")); + filter.add(new SubtypePredicate("Scion")); + } + + public KorCastigator(UUID ownerId) { + super(ownerId, 35, "Kor Castigator", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Kor"); + this.subtype.add("Wizard"); + this.subtype.add("Ally"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Kor Castigator can't be blocked by Eldrazi Scions. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + } + + public KorCastigator(final KorCastigator card) { + super(card); + } + + @Override + public KorCastigator copy() { + return new KorCastigator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/KorEntanglers.java b/Mage.Sets/src/mage/sets/battleforzendikar/KorEntanglers.java new file mode 100644 index 00000000000..7e4e28338d5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/KorEntanglers.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class KorEntanglers extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public KorEntanglers(UUID ownerId) { + super(ownerId, 36, "Kor Entanglers", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Kor"); + this.subtype.add("Soldier"); + this.subtype.add("Ally"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Rally — Whenever Kor Entanglers or another Ally enters the battlefield under your control, tap target creature an opponent controls. + Ability ability = new AllyEntersBattlefieldTriggeredAbility(new TapTargetEffect(), false); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + + } + + public KorEntanglers(final KorEntanglers card) { + super(card); + } + + @Override + public KorEntanglers copy() { + return new KorEntanglers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/KozileksChanneler.java b/Mage.Sets/src/mage/sets/battleforzendikar/KozileksChanneler.java new file mode 100644 index 00000000000..f2542a772a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/KozileksChanneler.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class KozileksChanneler extends CardImpl { + + public KozileksChanneler(UUID ownerId) { + super(ownerId, 10, "Kozilek's Channeler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {T}: Add {2} to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), new TapSourceCost())); + } + + public KozileksChanneler(final KozileksChanneler card) { + super(card); + } + + @Override + public KozileksChanneler copy() { + return new KozileksChanneler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/KozileksSentinel.java b/Mage.Sets/src/mage/sets/battleforzendikar/KozileksSentinel.java new file mode 100644 index 00000000000..2832635146f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/KozileksSentinel.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorlessPredicate; + +/** + * + * @author LevelX2 + */ +public class KozileksSentinel extends CardImpl { + + private static final FilterSpell filterSpell = new FilterSpell("a colorless spell"); + + static { + filterSpell.add(new ColorlessPredicate()); + } + + public KozileksSentinel(UUID ownerId) { + super(ownerId, 129, "Kozilek's Sentinel", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Whenever you cast a colorless spell, Kozilek's Sentinel gets +1/+0 until end of turn. + this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(1, 0, Duration.EndOfTurn), filterSpell, false)); + + } + + public KozileksSentinel(final KozileksSentinel card) { + super(card); + } + + @Override + public KozileksSentinel copy() { + return new KozileksSentinel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/LanternScout.java b/Mage.Sets/src/mage/sets/battleforzendikar/LanternScout.java new file mode 100644 index 00000000000..c06ef6c5116 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/LanternScout.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardIdPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author fireshoes + */ +public class LanternScout extends CardImpl { + + public LanternScout(UUID ownerId) { + super(ownerId, 37, "Lantern Scout", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Scout"); + this.subtype.add("Ally"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + FilterPermanent filter = new FilterPermanent("{this} or another Ally"); + filter.add(Predicates.or( + new CardIdPredicate(this.getId()), + new SubtypePredicate("Ally"))); + + // Rally - Whenever Lantern Scout or another Ally enters the battlefield under your control, creatures you control gain lifelink until end of turn. + Effect effect = new GainAbilityAllEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent()); + effect.setText("creatures you control gain lifelink until end of turn"); + Ability ability = new AllyEntersBattlefieldTriggeredAbility( + effect, false); + this.addAbility(ability); + } + + public LanternScout(final LanternScout card) { + super(card); + } + + @Override + public LanternScout copy() { + return new LanternScout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/LavastepRaider.java b/Mage.Sets/src/mage/sets/battleforzendikar/LavastepRaider.java new file mode 100644 index 00000000000..e418f4d8807 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/LavastepRaider.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class LavastepRaider extends CardImpl { + + public LavastepRaider(UUID ownerId) { + super(ownerId, 147, "Lavastep Raider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {2}{R}: Lavastep Raider gets +2/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Duration.EndOfTurn), new ManaCostsImpl<>("{2}{R}"))); + } + + public LavastepRaider(final LavastepRaider card) { + super(card); + } + + @Override + public LavastepRaider copy() { + return new LavastepRaider(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/LifespringDruid.java b/Mage.Sets/src/mage/sets/battleforzendikar/LifespringDruid.java new file mode 100644 index 00000000000..72cfe4c7392 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/LifespringDruid.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.mana.AnyColorManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class LifespringDruid extends CardImpl { + + public LifespringDruid(UUID ownerId) { + super(ownerId, 177, "Lifespring Druid", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elf"); + this.subtype.add("Druid"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // {T}: Add one mana of any color to your mana pool. + this.addAbility(new AnyColorManaAbility()); + } + + public LifespringDruid(final LifespringDruid card) { + super(card); + } + + @Override + public LifespringDruid copy() { + return new LifespringDruid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/LithomancersFocus.java b/Mage.Sets/src/mage/sets/battleforzendikar/LithomancersFocus.java new file mode 100644 index 00000000000..93abab3bb34 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/LithomancersFocus.java @@ -0,0 +1,96 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class LithomancersFocus extends CardImpl { + + public LithomancersFocus(UUID ownerId) { + super(ownerId, 38, "Lithomancer's Focus", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "BFZ"; + + // Target creature gets +2/+2 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Prevent all damage that would be dealt to that creature this turn by colorless sources. + this.getSpellAbility().addEffect(new LithomancersFocusPreventDamageToTargetEffect()); + } + + public LithomancersFocus(final LithomancersFocus card) { + super(card); + } + + @Override + public LithomancersFocus copy() { + return new LithomancersFocus(this); + } +} + +class LithomancersFocusPreventDamageToTargetEffect extends PreventionEffectImpl { + + public LithomancersFocusPreventDamageToTargetEffect() { + super(Duration.EndOfTurn, Integer.MAX_VALUE, false); + staticText = "Prevent all damage that would be dealt to that creature this turn by colorless sources"; + } + + public LithomancersFocusPreventDamageToTargetEffect(final LithomancersFocusPreventDamageToTargetEffect effect) { + super(effect); + } + + @Override + public LithomancersFocusPreventDamageToTargetEffect copy() { + return new LithomancersFocusPreventDamageToTargetEffect(this); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (super.applies(event, source, game) && event.getTargetId().equals(targetPointer.getFirst(game, source))) { + MageObject object = game.getObject(event.getSourceId()); + return object != null && object.getColor(game).isColorless(); + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/LoomingSpires.java b/Mage.Sets/src/mage/sets/battleforzendikar/LoomingSpires.java new file mode 100644 index 00000000000..910c974d2fa --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/LoomingSpires.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class LoomingSpires extends CardImpl { + + public LoomingSpires(UUID ownerId) { + super(ownerId, 238, "Looming Spires", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // Looming Spires enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // When Looming Spires enters the battlefield, target creature gets +1/+1 and gain first strike until end of turn. + Effect effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains first strike"); + Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(1, 1, Duration.EndOfTurn), false); + ability.addEffect(effect); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // {T}: Add {R} to your mana pool. + this.addAbility(new RedManaAbility()); + } + + public LoomingSpires(final LoomingSpires card) { + super(card); + } + + @Override + public LoomingSpires copy() { + return new LoomingSpires(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/LumberingFalls.java b/Mage.Sets/src/mage/sets/battleforzendikar/LumberingFalls.java new file mode 100644 index 00000000000..1ab770d2fc0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/LumberingFalls.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.keyword.HexproofAbility; +import mage.abilities.mana.BlueManaAbility; +import mage.abilities.mana.GreenManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.Token; + +/** + * + * @author fireshoes + */ +public class LumberingFalls extends CardImpl { + + public LumberingFalls(UUID ownerId) { + super(ownerId, 239, "Lumbering Falls", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // Lumbering Falls enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {T}: Add {G} or {U} to your mana pool. + this.addAbility(new BlueManaAbility()); + this.addAbility(new GreenManaAbility()); + + // {2}{G}{U}: Lumbering Falls becomes a 3/3 green and blue Elemental creature with hexproof until end of turn. It's still a land. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new LumberingFallsToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{2}{G}{U}"))); + } + + public LumberingFalls(final LumberingFalls card) { + super(card); + } + + @Override + public LumberingFalls copy() { + return new LumberingFalls(this); + } +} + +class LumberingFallsToken extends Token { + + public LumberingFallsToken() { + super("", "3/3 green and blue Elemental creature with hexproof"); + cardType.add(CardType.CREATURE); + subtype.add("Elemental"); + color.setBlue(true); + color.setGreen(true); + power = new MageInt(3); + toughness = new MageInt(3); + addAbility(HexproofAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MakindiPatrol.java b/Mage.Sets/src/mage/sets/battleforzendikar/MakindiPatrol.java new file mode 100644 index 00000000000..693d998a174 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MakindiPatrol.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class MakindiPatrol extends CardImpl { + + public MakindiPatrol(UUID ownerId) { + super(ownerId, 39, "Makindi Patrol", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Rally — Whenever Makindi Patrol or another Ally enters the battlefield under your control, creatures you control gain vigilance until end of turn. + this.addAbility(new AllyEntersBattlefieldTriggeredAbility( + new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures")), false)); + } + + public MakindiPatrol(final MakindiPatrol card) { + super(card); + } + + @Override + public MakindiPatrol copy() { + return new MakindiPatrol(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MakindiSliderunner.java b/Mage.Sets/src/mage/sets/battleforzendikar/MakindiSliderunner.java new file mode 100644 index 00000000000..4f596ad3576 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MakindiSliderunner.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class MakindiSliderunner extends CardImpl { + + public MakindiSliderunner(UUID ownerId) { + super(ownerId, 148, "Makindi Sliderunner", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Beast"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Landfall- Whenever a land enters the battlefield under your control, Makindi Sliderunner gets +1/+1 until end of turn. + this.addAbility(new LandfallAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false)); + } + + public MakindiSliderunner(final MakindiSliderunner card) { + super(card); + } + + @Override + public MakindiSliderunner copy() { + return new MakindiSliderunner(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MalakirFamiliar.java b/Mage.Sets/src/mage/sets/battleforzendikar/MalakirFamiliar.java new file mode 100644 index 00000000000..2fc7b1abe4b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MalakirFamiliar.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.GainLifeControllerTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class MalakirFamiliar extends CardImpl { + + public MalakirFamiliar(UUID ownerId) { + super(ownerId, 116, "Malakir Familiar", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Bat"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Deahtouch + this.addAbility(DeathtouchAbility.getInstance()); + // Whenever you gain life, Malakir Familiar gets +1/+1 until end of turn. + this.addAbility(new GainLifeControllerTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false)); + + } + + public MalakirFamiliar(final MalakirFamiliar card) { + super(card); + } + + @Override + public MalakirFamiliar copy() { + return new MalakirFamiliar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MarchFromTheTomb.java b/Mage.Sets/src/mage/sets/battleforzendikar/MarchFromTheTomb.java new file mode 100644 index 00000000000..0fcc73f4c8f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MarchFromTheTomb.java @@ -0,0 +1,127 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LevelX2 + */ +public class MarchFromTheTomb extends CardImpl { + + public MarchFromTheTomb(UUID ownerId) { + super(ownerId, 214, "March from the Tomb", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{W}{B}"); + this.expansionSetCode = "BFZ"; + + // Return any number of target Ally creature cards with total converted mana cost of 8 or less from your graveyard to the battlefield. + Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect(); + effect.setText("Return any number of target Ally creature cards with total converted mana cost of 8 or less from your graveyard to the battlefield"); + this.getSpellAbility().addEffect(effect); + FilterCard filter = new FilterCreatureCard(); + filter.add(new SubtypePredicate("Ally")); + this.getSpellAbility().addTarget(new MarchFromTheTombTarget(0, Integer.MAX_VALUE, filter)); + } + + public MarchFromTheTomb(final MarchFromTheTomb card) { + super(card); + } + + @Override + public MarchFromTheTomb copy() { + return new MarchFromTheTomb(this); + } +} + +class MarchFromTheTombTarget extends TargetCardInYourGraveyard { + + public MarchFromTheTombTarget(int minNumTargets, int maxNumTargets, FilterCard filter) { + super(minNumTargets, maxNumTargets, filter); + } + + public MarchFromTheTombTarget(MarchFromTheTombTarget target) { + super(target); + } + + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + int cmcLeft = 8; + for (UUID targetId : this.getTargets()) { + Card card = game.getCard(targetId); + if (card != null) { + cmcLeft -= card.getManaCost().convertedManaCost(); + } + } + Set possibleTargets = super.possibleTargets(sourceId, sourceControllerId, game); + Set leftPossibleTargets = new HashSet<>(); + for (UUID targetId : possibleTargets) { + Card card = game.getCard(targetId); + if (card != null && card.getManaCost().convertedManaCost() <= cmcLeft) { + leftPossibleTargets.add(targetId); + } + } + setTargetName("any number of target Ally creature cards with total converted mana cost of 8 or less (" + cmcLeft + " left) from your graveyard"); + return leftPossibleTargets; + } + + @Override + public boolean canTarget(UUID playerId, UUID objectId, Ability source, Game game) { + if (super.canTarget(playerId, objectId, source, game)) { + int cmcLeft = 8; + for (UUID targetId : this.getTargets()) { + Card card = game.getCard(targetId); + if (card != null) { + cmcLeft -= card.getManaCost().convertedManaCost(); + } + } + Card card = game.getCard(objectId); + return card != null && card.getManaCost().convertedManaCost() <= cmcLeft; + } + return false; + } + + @Override + public MarchFromTheTombTarget copy() { + return new MarchFromTheTombTarget(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MindRaker.java b/Mage.Sets/src/mage/sets/battleforzendikar/MindRaker.java new file mode 100644 index 00000000000..a03fa277ee2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MindRaker.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.ExileOpponentsCardFromExileToGraveyardCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author fireshoes + */ +public class MindRaker extends CardImpl { + + public MindRaker(UUID ownerId) { + super(ownerId, 95, "Mind Raker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Processor"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // When Mind Raker enters the battlefield, you may put a card an opponent owns from exile into that player's graveyard. If you do, each opponent discards a card. + this.addAbility(new EntersBattlefieldTriggeredAbility( + new DoIfCostPaid(new DiscardEachPlayerEffect(TargetController.OPPONENT), new ExileOpponentsCardFromExileToGraveyardCost(true)), false)); + } + + public MindRaker(final MindRaker card) { + super(card); + } + + @Override + public MindRaker copy() { + return new MindRaker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MiresMalice.java b/Mage.Sets/src/mage/sets/battleforzendikar/MiresMalice.java new file mode 100644 index 00000000000..be28d713154 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MiresMalice.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author LevelX2 + */ +public class MiresMalice extends CardImpl { + + public MiresMalice(UUID ownerId) { + super(ownerId, 117, "Mire's Malice", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{B}"); + this.expansionSetCode = "BFZ"; + + // Target opponent discards two cards. + this.getSpellAbility().addEffect(new DiscardTargetEffect(2)); + this.getSpellAbility().addTarget(new TargetOpponent()); + // Awaken 3 - {5}{B} + this.addAbility(new AwakenAbility(this, 3, "{5}{B}")); + } + + public MiresMalice(final MiresMalice card) { + super(card); + } + + @Override + public MiresMalice copy() { + return new MiresMalice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MistIntruder.java b/Mage.Sets/src/mage/sets/battleforzendikar/MistIntruder.java new file mode 100644 index 00000000000..87ee253668f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MistIntruder.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class MistIntruder extends CardImpl { + + public MistIntruder(UUID ownerId) { + super(ownerId, 61, "Mist Intruder", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Ingest + this.addAbility(new IngestAbility()); + } + + public MistIntruder(final MistIntruder card) { + super(card); + } + + @Override + public MistIntruder copy() { + return new MistIntruder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MoltenNursery.java b/Mage.Sets/src/mage/sets/battleforzendikar/MoltenNursery.java new file mode 100644 index 00000000000..71404a42606 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MoltenNursery.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class MoltenNursery extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("colorless spell"); + + static { + filter.add(new ColorlessPredicate()); + } + + public MoltenNursery(UUID ownerId) { + super(ownerId, 130, "Molten Nursery", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "BFZ"; + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Whenever you cast a colorless spell, Molten Nursery deals 1 damage to target creature or player. + Ability ability = new SpellCastControllerTriggeredAbility(new DamageTargetEffect(1), filter, false); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + + } + + public MoltenNursery(final MoltenNursery card) { + super(card); + } + + @Override + public MoltenNursery copy() { + return new MoltenNursery(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MortuaryMire.java b/Mage.Sets/src/mage/sets/battleforzendikar/MortuaryMire.java new file mode 100644 index 00000000000..b97e7232c24 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MortuaryMire.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author fireshoes + */ +public class MortuaryMire extends CardImpl { + + public MortuaryMire(UUID ownerId) { + super(ownerId, 240, "Mortuary Mire", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // Mortuary Mire enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // When Mortuary Mire enters the battlefield, you may put target creature card from your graveyard on top of your library. + Ability ability = new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(true), true); + ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + this.addAbility(ability); + + // {T}: Add {B} to your mana pool. + this.addAbility(new BlackManaAbility()); + } + + public MortuaryMire(final MortuaryMire card) { + super(card); + } + + @Override + public MortuaryMire copy() { + return new MortuaryMire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain1.java new file mode 100644 index 00000000000..049c251e4c5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain1 extends mage.cards.basiclands.Mountain { + + public Mountain1(UUID ownerId) { + super(ownerId, 265); + this.expansionSetCode = "BFZ"; + } + + public Mountain1(final Mountain1 card) { + super(card); + } + + @Override + public Mountain1 copy() { + return new Mountain1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain2.java new file mode 100644 index 00000000000..adb01c46713 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain2 extends mage.cards.basiclands.Mountain { + + public Mountain2(UUID ownerId) { + super(ownerId, 266); + this.expansionSetCode = "BFZ"; + } + + public Mountain2(final Mountain2 card) { + super(card); + } + + @Override + public Mountain2 copy() { + return new Mountain2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain3.java new file mode 100644 index 00000000000..38e5f5c4b61 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain3 extends mage.cards.basiclands.Mountain { + + public Mountain3(UUID ownerId) { + super(ownerId, 267); + this.expansionSetCode = "BFZ"; + } + + public Mountain3(final Mountain3 card) { + super(card); + } + + @Override + public Mountain3 copy() { + return new Mountain3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain4.java new file mode 100644 index 00000000000..3d72ef0dbc1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain4 extends mage.cards.basiclands.Mountain { + + public Mountain4(UUID ownerId) { + super(ownerId, 268); + this.expansionSetCode = "BFZ"; + } + + public Mountain4(final Mountain4 card) { + super(card); + } + + @Override + public Mountain4 copy() { + return new Mountain4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain5.java new file mode 100644 index 00000000000..913411db522 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain5 extends mage.cards.basiclands.Mountain { + + public Mountain5(UUID ownerId) { + super(ownerId, 269); + this.expansionSetCode = "BFZ"; + } + + public Mountain5(final Mountain5 card) { + super(card); + } + + @Override + public Mountain5 copy() { + return new Mountain5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MundaAmbushLeader.java b/Mage.Sets/src/mage/sets/battleforzendikar/MundaAmbushLeader.java new file mode 100644 index 00000000000..dd3b890bd03 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MundaAmbushLeader.java @@ -0,0 +1,130 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; + +/** + * + * @author LevelX2 + */ +public class MundaAmbushLeader extends CardImpl { + + public MundaAmbushLeader(UUID ownerId) { + super(ownerId, 215, "Munda, Ambush Leader", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{W}"); + this.expansionSetCode = "BFZ"; + this.supertype.add("Legendary"); + this.subtype.add("Kor"); + this.subtype.add("Ally"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // Rally-Whenever Munda, Ambush Leader or another Ally enters the battlefield under your control, you may look at the top four cards of your library. If you do, reveal any number of Ally cards from among them, then put those cards on top of your library in any order and the rest on the bottom in any order. + this.addAbility(new AllyEntersBattlefieldTriggeredAbility(new MundaAmbushLeaderEffect(), true)); + + } + + public MundaAmbushLeader(final MundaAmbushLeader card) { + super(card); + } + + @Override + public MundaAmbushLeader copy() { + return new MundaAmbushLeader(this); + } +} + +class MundaAmbushLeaderEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("Ally cards to reveal and put on top of your library"); + + static { + filter.add(new SubtypePredicate("Ally")); + } + + public MundaAmbushLeaderEffect() { + super(Outcome.Benefit); + this.staticText = "you may look at the top four cards of your library. If you do, reveal any number of Ally cards from among them, then put those cards on top of your library in any order and the rest on the bottom in any order"; + } + + public MundaAmbushLeaderEffect(final MundaAmbushLeaderEffect effect) { + super(effect); + } + + @Override + public MundaAmbushLeaderEffect copy() { + return new MundaAmbushLeaderEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + Cards allCards = new CardsImpl(); + allCards.addAll(controller.getLibrary().getTopCards(game, 4)); + controller.lookAtCards(sourceObject.getIdName(), allCards, game); + if (!allCards.isEmpty()) { + Cards cardsToReveal = new CardsImpl(); + TargetCard target = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter); + controller.chooseTarget(outcome, allCards, target, source, game); + cardsToReveal.addAll(target.getTargets()); + if (!cardsToReveal.isEmpty()) { + controller.revealCards(sourceObject.getIdName(), cardsToReveal, game, true); + allCards.removeAll(cardsToReveal); + } + controller.putCardsOnTopOfLibrary(cardsToReveal, game, source, true); + } + if (!allCards.isEmpty()) { + controller.putCardsOnBottomOfLibrary(allCards, game, source, true); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MurasaRanger.java b/Mage.Sets/src/mage/sets/battleforzendikar/MurasaRanger.java new file mode 100644 index 00000000000..39b26a74afb --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MurasaRanger.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LandfallAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LevelX2 + */ +public class MurasaRanger extends CardImpl { + + public MurasaRanger(UUID ownerId) { + super(ownerId, 178, "Murasa Ranger", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Landfall - Whenever a land enters the battlefield under your control, you may pay {3}{G}. IF you do, put two +1/+1 counters on Murasa Ranger. + this.addAbility(new LandfallAbility(new DoIfCostPaid(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), new ManaCostsImpl("{3}{G}")), false)); + } + + public MurasaRanger(final MurasaRanger card) { + super(card); + } + + @Override + public MurasaRanger copy() { + return new MurasaRanger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MurkStrider.java b/Mage.Sets/src/mage/sets/battleforzendikar/MurkStrider.java new file mode 100644 index 00000000000..0cc67d861b1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MurkStrider.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.ExileOpponentsCardFromExileToGraveyardCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class MurkStrider extends CardImpl { + + public MurkStrider(UUID ownerId) { + super(ownerId, 62, "Murk Strider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Processor"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // When Murk Strider enters the battlefield, you may put a card an opponent owns from exile into that player's graveyard. If you do, return target creature to its owner's hand. + Ability ability = new EntersBattlefieldTriggeredAbility( + new DoIfCostPaid(new ReturnToHandTargetEffect(), new ExileOpponentsCardFromExileToGraveyardCost(true)), true); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public MurkStrider(final MurkStrider card) { + super(card); + } + + @Override + public MurkStrider copy() { + return new MurkStrider(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/NaturalConnection.java b/Mage.Sets/src/mage/sets/battleforzendikar/NaturalConnection.java new file mode 100644 index 00000000000..acd8ac264e2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/NaturalConnection.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterBasicLandCard; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LevelX2 + */ +public class NaturalConnection extends CardImpl { + + public NaturalConnection(UUID ownerId) { + super(ownerId, 179, "Natural Connection", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); + this.expansionSetCode = "BFZ"; + + // Search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library. + TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(target, true)); + + } + + public NaturalConnection(final NaturalConnection card) { + super(card); + } + + @Override + public NaturalConnection copy() { + return new NaturalConnection(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/NettleDrone.java b/Mage.Sets/src/mage/sets/battleforzendikar/NettleDrone.java new file mode 100644 index 00000000000..8c3a075642b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/NettleDrone.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorlessPredicate; + +/** + * + * @author LevelX2 + */ +public class NettleDrone extends CardImpl { + + private static final FilterSpell filterSpell = new FilterSpell("a colorless spell"); + + static { + filterSpell.add(new ColorlessPredicate()); + } + + public NettleDrone(UUID ownerId) { + super(ownerId, 131, "Nettle Drone", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // {T}: Nettle Drone deals 1 damage to each opponent. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamagePlayersEffect(1, TargetController.OPPONENT), new TapSourceCost())); + + // Whenever you cast a colorless spell, untap Nettle Drone. + this.addAbility(new SpellCastControllerTriggeredAbility(new UntapSourceEffect(), filterSpell, false)); + } + + public NettleDrone(final NettleDrone card) { + super(card); + } + + @Override + public NettleDrone copy() { + return new NettleDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/NirkanaAssassin.java b/Mage.Sets/src/mage/sets/battleforzendikar/NirkanaAssassin.java new file mode 100644 index 00000000000..53442a1ddf5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/NirkanaAssassin.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.GainLifeControllerTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class NirkanaAssassin extends CardImpl { + + public NirkanaAssassin(UUID ownerId) { + super(ownerId, 118, "Nirkana Assassin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Vampire"); + this.subtype.add("Assassin"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Whenever you gain life, Nirkana Assassin gains deathtouch until end of turn. + this.addAbility(new GainLifeControllerTriggeredAbility(new GainAbilitySourceEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn), false)); + } + + public NirkanaAssassin(final NirkanaAssassin card) { + super(card); + } + + @Override + public NirkanaAssassin copy() { + return new NirkanaAssassin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/NissasRenewal.java b/Mage.Sets/src/mage/sets/battleforzendikar/NissasRenewal.java new file mode 100644 index 00000000000..c1fd2e8648b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/NissasRenewal.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterBasicLandCard; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author fireshoes + */ +public class NissasRenewal extends CardImpl { + + public NissasRenewal(UUID ownerId) { + super(ownerId, 180, "Nissa's Renewal", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{G}"); + this.expansionSetCode = "BFZ"; + + // Search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library. You gain 7 life. + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 3, new FilterBasicLandCard()), true)); + this.getSpellAbility().addEffect(new GainLifeEffect(7)); + } + + public NissasRenewal(final NissasRenewal card) { + super(card); + } + + @Override + public NissasRenewal copy() { + return new NissasRenewal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/NoyanDarRoilShaper.java b/Mage.Sets/src/mage/sets/battleforzendikar/NoyanDarRoilShaper.java new file mode 100644 index 00000000000..0c9c9b6a4b6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/NoyanDarRoilShaper.java @@ -0,0 +1,144 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.FilterSpell; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.target.Target; +import mage.target.common.TargetControlledPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class NoyanDarRoilShaper extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("instant or sorcery card"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); + } + + public NoyanDarRoilShaper(UUID ownerId) { + super(ownerId, 216, "Noyan Dar, Roil Shaper", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{U}"); + this.expansionSetCode = "BFZ"; + this.supertype.add("Legendary"); + this.subtype.add("Merfolk"); + this.subtype.add("Ally"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever you cast an instant or sorcery spell, you may put three +1/+1 counters on target land you control. + // If you do, that land becomes a 0/0 Elemental creature with haste that's still a land. + Ability ability = new SpellCastControllerTriggeredAbility(new NoyanDarEffect(), filter, false); + ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent())); + this.addAbility(ability); + } + + public NoyanDarRoilShaper(final NoyanDarRoilShaper card) { + super(card); + } + + @Override + public NoyanDarRoilShaper copy() { + return new NoyanDarRoilShaper(this); + } +} + +class NoyanDarEffect extends OneShotEffect { + + public NoyanDarEffect() { + super(Outcome.BoostCreature); + this.staticText = "put three +1/+1 counters on target land you control. If you do, that land becomes a 0/0 Elemental creature with haste that's still a land."; + } + + public NoyanDarEffect(final NoyanDarEffect effect) { + super(effect); + } + + @Override + public NoyanDarEffect copy() { + return new NoyanDarEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID targetId = null; + for (Target target : source.getTargets()) { + targetId = target.getFirstTarget(); + } + if (targetId != null) { + FixedTarget fixedTarget = new FixedTarget(targetId); + ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new AwakenElementalToken(), false, true, Duration.Custom); + continuousEffect.setTargetPointer(fixedTarget); + game.addEffect(continuousEffect, source); + Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(3)); + effect.setTargetPointer(fixedTarget); + return effect.apply(game, source); + } + return true; + } +} + + +class AwakenElementalToken extends Token { + + public AwakenElementalToken() { + super("", "0/0 Elemental creature with haste"); + this.cardType.add(CardType.CREATURE); + + this.subtype.add("Elemental"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + this.addAbility(HasteAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ObNixilisReignited.java b/Mage.Sets/src/mage/sets/battleforzendikar/ObNixilisReignited.java new file mode 100644 index 00000000000..242438d7fdd --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ObNixilisReignited.java @@ -0,0 +1,134 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.LoyaltyAbility; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GetEmblemTargetPlayerEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.command.Emblem; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class ObNixilisReignited extends CardImpl { + + public ObNixilisReignited(UUID ownerId) { + super(ownerId, 119, "Ob Nixilis Reignited", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Nixilis"); + + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); + + // +1: You draw a card and you lose 1 life. + Effect effect = new DrawCardSourceControllerEffect(1); + effect.setText("You draw a card"); + LoyaltyAbility ability1 = new LoyaltyAbility(effect, 1); + effect = new LoseLifeSourceControllerEffect(1); + effect.setText("and you lose 1 life"); + ability1.addEffect(effect); + this.addAbility(ability1); + + // -3: Destroy target creature. + LoyaltyAbility ability2 = new LoyaltyAbility(new DestroyTargetEffect(), -3); + ability2.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability2); + + // -8: Target opponent gets an emblem with "Whenever a player draws a card, you lose 2 life." + effect = new GetEmblemTargetPlayerEffect(new ObNixilisReignitedEmblem()); + effect.setText("Target opponent gets an emblem with \"Whenever a player draws a card, you lose 2 life.\""); + LoyaltyAbility ability3 = new LoyaltyAbility(effect, -8); + ability3.addTarget(new TargetOpponent()); + this.addAbility(ability3); + } + + public ObNixilisReignited(final ObNixilisReignited card) { + super(card); + } + + @Override + public ObNixilisReignited copy() { + return new ObNixilisReignited(this); + } +} + +class ObNixilisReignitedEmblem extends Emblem { + + public ObNixilisReignitedEmblem() { + setName("EMBLEM: Ob Nixilis Reignited"); + + this.getAbilities().add(new ObNixilisEmblemTriggeredAbility(new LoseLifeSourceControllerEffect(2), false)); + this.setExpansionSetCodeForImage("BFZ"); + } +} + +class ObNixilisEmblemTriggeredAbility extends TriggeredAbilityImpl { + + public ObNixilisEmblemTriggeredAbility(Effect effect, boolean optional) { + super(Zone.COMMAND, effect, optional); + } + + public ObNixilisEmblemTriggeredAbility(final ObNixilisEmblemTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DREW_CARD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId() != null; + } + + @Override + public String getRule() { + return "Whenever a player draws a card, you lose 2 life."; + } + + @Override + public ObNixilisEmblemTriggeredAbility copy() { + return new ObNixilisEmblemTriggeredAbility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/OblivionSower.java b/Mage.Sets/src/mage/sets/battleforzendikar/OblivionSower.java new file mode 100644 index 00000000000..533a88f299a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/OblivionSower.java @@ -0,0 +1,121 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.abilities.effects.common.ExileCardsFromTopOfLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterLandCard; +import mage.filter.predicate.other.OwnerIdPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetOpponent; + +/** + * + * @author LevelX2 + */ +public class OblivionSower extends CardImpl { + + public OblivionSower(UUID ownerId) { + super(ownerId, 11, "Oblivion Sower", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{6}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(5); + this.toughness = new MageInt(8); + + // When you cast Oblivion Sower, target opponent exiles the top four cards of his or her library, then you may put any number of land cards that player owns from exile onto the battlefield under your control. + Ability ability = new CastSourceTriggeredAbility(new ExileCardsFromTopOfLibraryTargetEffect(4, "target opponent"), false); + ability.addEffect(new OblivionSowerEffect()); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public OblivionSower(final OblivionSower card) { + super(card); + } + + @Override + public OblivionSower copy() { + return new OblivionSower(this); + } +} + +class OblivionSowerEffect extends OneShotEffect { + + public OblivionSowerEffect() { + super(Outcome.PutLandInPlay); + this.staticText = ", then you may put any number of land cards that player owns from exile onto the battlefield under your control"; + } + + public OblivionSowerEffect(final OblivionSowerEffect effect) { + super(effect); + } + + @Override + public OblivionSowerEffect copy() { + return new OblivionSowerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (controller != null && targetPlayer != null) { + FilterLandCard filter = new FilterLandCard(); + filter.add(new OwnerIdPredicate(targetPlayer.getId())); + Cards exiledCards = new CardsImpl(); + exiledCards.addAll(game.getExile().getAllCards(game)); + Cards exiledLands = new CardsImpl(); + exiledLands.addAll(exiledCards.getCards(filter, source.getSourceId(), controller.getId(), game)); + if (!exiledLands.isEmpty() && controller.chooseUse(outcome, "Put lands into play?", source, game)) { + FilterCard filterToPlay = new FilterCard("land" + + (exiledLands.size() > 1 ? "s" : "") + " from exile owned by " + + targetPlayer.getName() + " to put into play under your control"); + TargetCard targetCards = new TargetCard(0, exiledLands.size(), Zone.EXILED, filterToPlay); + if (controller.chooseTarget(outcome, exiledLands, targetCards, source, game)) { + controller.moveCards(new CardsImpl(targetCards.getTargets()), Zone.BATTLEFIELD, source, game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/OmnathLocusOfRage.java b/Mage.Sets/src/mage/sets/battleforzendikar/OmnathLocusOfRage.java new file mode 100644 index 00000000000..fff58c51cfa --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/OmnathLocusOfRage.java @@ -0,0 +1,101 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.permanent.token.Token; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class OmnathLocusOfRage extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elemental you control"); + + static { + filter.add(new SubtypePredicate("Elemental")); + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public OmnathLocusOfRage(UUID ownerId) { + super(ownerId, 217, "Omnath, Locus of Rage", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{R}{R}{G}{G}"); + this.expansionSetCode = "BFZ"; + this.supertype.add("Legendary"); + this.subtype.add("Elemental"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Landfall - Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield. + this.addAbility(new LandfallAbility(new CreateTokenEffect(new OmnathElementalToken()), false)); + + // Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player. + Ability ability = new DiesThisOrAnotherCreatureTriggeredAbility(new DamageTargetEffect(3), false, filter); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public OmnathLocusOfRage(final OmnathLocusOfRage card) { + super(card); + } + + @Override + public OmnathLocusOfRage copy() { + return new OmnathLocusOfRage(this); + } +} + +class OmnathElementalToken extends Token { + + OmnathElementalToken() { + super("Elemental", "5/5 red and green Elemental creature token"); + setTokenType(2); + setOriginalExpansionSetCode("BFZ"); + cardType.add(CardType.CREATURE); + subtype.add("Elemental"); + + color.setRed(true); + color.setGreen(true); + power = new MageInt(5); + toughness = new MageInt(5); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/OnduChampion.java b/Mage.Sets/src/mage/sets/battleforzendikar/OnduChampion.java new file mode 100644 index 00000000000..1db9a5e52e2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/OnduChampion.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class OnduChampion extends CardImpl { + + public OnduChampion(UUID ownerId) { + super(ownerId, 149, "Ondu Champion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Minotaur"); + this.subtype.add("Warrior"); + this.subtype.add("Ally"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Rally — Whenever Ondu Champion or another Ally enters the battlefield under your control, creatures you control gain trample until end of turn. + this.addAbility(new AllyEntersBattlefieldTriggeredAbility( + new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures you control")), false)); + } + + public OnduChampion(final OnduChampion card) { + super(card); + } + + @Override + public OnduChampion copy() { + return new OnduChampion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/OnduGreathorn.java b/Mage.Sets/src/mage/sets/battleforzendikar/OnduGreathorn.java new file mode 100644 index 00000000000..008e92ca918 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/OnduGreathorn.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class OnduGreathorn extends CardImpl { + + public OnduGreathorn(UUID ownerId) { + super(ownerId, 40, "Ondu Greathorn", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Beast"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // Landfall — Whenever a land enters the battlefield under your control, Ondu Greathorn gets +2/+2 until end of turn. + this.addAbility(new LandfallAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false)); + } + + public OnduGreathorn(final OnduGreathorn card) { + super(card); + } + + @Override + public OnduGreathorn copy() { + return new OnduGreathorn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/OnduRising.java b/Mage.Sets/src/mage/sets/battleforzendikar/OnduRising.java new file mode 100644 index 00000000000..5e8d6d4defa --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/OnduRising.java @@ -0,0 +1,110 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class OnduRising extends CardImpl { + + public OnduRising(UUID ownerId) { + super(ownerId, 41, "Ondu Rising", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + + // Whenever a creature attacks this turn, it gains lifelink until end of turn. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new OnduRisingTriggeredAbility())); + + // Awaken 4—{4}{W} + this.addAbility(new AwakenAbility(this, 4, "{4}{W}")); + } + + public OnduRising(final OnduRising card) { + super(card); + } + + @Override + public OnduRising copy() { + return new OnduRising(this); + } +} + +class OnduRisingTriggeredAbility extends DelayedTriggeredAbility { + + public OnduRisingTriggeredAbility() { + super(new GainAbilityTargetEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn), Duration.EndOfTurn, false); + } + + public OnduRisingTriggeredAbility(OnduRisingTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent != null) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(permanent, game)); + } + return true; + } + return false; + } + + @Override + public OnduRisingTriggeredAbility copy() { + return new OnduRisingTriggeredAbility(this); + } + + @Override + public String getRule() { + return "Whenever a creature attacks this turn, it gains lifelink until end of turn."; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/OracleOfDust.java b/Mage.Sets/src/mage/sets/battleforzendikar/OracleOfDust.java new file mode 100644 index 00000000000..26cfc75ed68 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/OracleOfDust.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileOpponentsCardFromExileToGraveyardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawDiscardControllerEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class OracleOfDust extends CardImpl { + + public OracleOfDust(UUID ownerId) { + super(ownerId, 63, "Oracle of Dust", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Processor"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // {2}, Put a card an opponent owns from exile into that player's graveyard: Draw a card, then discard a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawDiscardControllerEffect(1, 1), new ManaCostsImpl<>("{2}")); + ability.addCost(new ExileOpponentsCardFromExileToGraveyardCost(true)); + this.addAbility(ability); + } + + public OracleOfDust(final OracleOfDust card) { + super(card); + } + + @Override + public OracleOfDust copy() { + return new OracleOfDust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/OranRiefHydra.java b/Mage.Sets/src/mage/sets/battleforzendikar/OranRiefHydra.java new file mode 100644 index 00000000000..a997e01fd4b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/OranRiefHydra.java @@ -0,0 +1,156 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class OranRiefHydra extends CardImpl { + + public OranRiefHydra(UUID ownerId) { + super(ownerId, 181, "Oran-Rief Hydra", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Hydra"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Landfall - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra. + // If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead. + this.addAbility(new OranRiefHydraTriggeredAbility()); + } + + public OranRiefHydra(final OranRiefHydra card) { + super(card); + } + + @Override + public OranRiefHydra copy() { + return new OranRiefHydra(this); + } +} + +class OranRiefHydraTriggeredAbility extends TriggeredAbilityImpl { + + private static final String text = "Landfall - Whenever a land enters the battlefield under your control, put a +1/+1 counter on {this}. " + + "If that land is a Forest, put two +1/+1 counters on {this} instead."; + + public OranRiefHydraTriggeredAbility() { + super(Zone.BATTLEFIELD, new OranRiefHydraEffect()); + } + + public OranRiefHydraTriggeredAbility(final OranRiefHydraTriggeredAbility ability) { + super(ability); + } + + @Override + public OranRiefHydraTriggeredAbility copy() { + return new OranRiefHydraTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null + && permanent.getCardType().contains(CardType.LAND) + && permanent.getControllerId().equals(getControllerId())) { + Permanent sourcePermanent = game.getPermanent(getSourceId()); + if (sourcePermanent != null) { + for (Effect effect : getEffects()) { + if (effect instanceof OranRiefHydraEffect) { + effect.setTargetPointer(new FixedTarget(permanent, game)); + } + return true; + } + } + } + return false; + } + + @Override + public String getRule() { + return text; + } +} + +class OranRiefHydraEffect extends OneShotEffect { + + public OranRiefHydraEffect() { + super(Outcome.BoostCreature); + } + + public OranRiefHydraEffect(final OranRiefHydraEffect effect) { + super(effect); + } + + @Override + public OranRiefHydraEffect copy() { + return new OranRiefHydraEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (land != null && sourcePermanent != null) { + if (land.hasSubtype("Forest")) { + sourcePermanent.addCounters(CounterType.P1P1.createInstance(2), game); + } else { + sourcePermanent.addCounters(CounterType.P1P1.createInstance(), game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/OranRiefInvoker.java b/Mage.Sets/src/mage/sets/battleforzendikar/OranRiefInvoker.java new file mode 100644 index 00000000000..3328a451a09 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/OranRiefInvoker.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class OranRiefInvoker extends CardImpl { + + public OranRiefInvoker(UUID ownerId) { + super(ownerId, 182, "Oran-Rief Invoker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {8}: Oran-Rief Invoker gets +5/+5 and gains trample until end of turn. + Effect effect = new BoostSourceEffect(5, 5, Duration.EndOfTurn); + effect.setText("{source} gets +5/+5"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(8)); + effect = new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains trample until end of turn"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public OranRiefInvoker(final OranRiefInvoker card) { + super(card); + } + + @Override + public OranRiefInvoker copy() { + return new OranRiefInvoker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Outnumber.java b/Mage.Sets/src/mage/sets/battleforzendikar/Outnumber.java new file mode 100644 index 00000000000..1c11d5b6658 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Outnumber.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class Outnumber extends CardImpl { + + public Outnumber(UUID ownerId) { + super(ownerId, 150, "Outnumber", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "BFZ"; + + // Outnumber deals damage to target creature equal to the number of creatures you control. + Effect effect = new DamageTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent("the number of creatures you control"))); + effect.setText("{this} deals damage to target creature equal to the number of creatures you control"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + } + + public Outnumber(final Outnumber card) { + super(card); + } + + @Override + public Outnumber copy() { + return new Outnumber(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/PainfulTruths.java b/Mage.Sets/src/mage/sets/battleforzendikar/PainfulTruths.java new file mode 100644 index 00000000000..c8e1fd01582 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/PainfulTruths.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class PainfulTruths extends CardImpl { + + public PainfulTruths(UUID ownerId) { + super(ownerId, 120, "Painful Truths", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + + // Converge - You draw X cards and lose X life, where X is the number of colors of mana spent to cast Painful Truths. + getSpellAbility().setAbilityWord(AbilityWord.CONVERGE); + Effect effect = new DrawCardSourceControllerEffect(ColorsOfManaSpentToCastCount.getInstance()); + effect.setText("You draw X cards"); + getSpellAbility().addEffect(effect); + effect = new LoseLifeSourceControllerEffect(ColorsOfManaSpentToCastCount.getInstance()); + effect.setText("and lose X life, where X is the number of colors of mana spent to cast {this}"); + getSpellAbility().addEffect(effect); + } + + public PainfulTruths(final PainfulTruths card) { + super(card); + } + + @Override + public PainfulTruths copy() { + return new PainfulTruths(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/PartTheWaterveil.java b/Mage.Sets/src/mage/sets/battleforzendikar/PartTheWaterveil.java new file mode 100644 index 00000000000..b2f050b44e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/PartTheWaterveil.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class PartTheWaterveil extends CardImpl { + + public PartTheWaterveil(UUID ownerId) { + super(ownerId, 80, "Part the Waterveil", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{4}{U}{U}"); + this.expansionSetCode = "BFZ"; + + // Take an extra turn after this one. Exile Part the Waterveil. + this.getSpellAbility().addEffect(new AddExtraTurnControllerEffect()); + this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); + + // Awaken 6-{6}{U}{U}{U} + this.addAbility(new AwakenAbility(this, 6, "{6}{U}{U}{U}")); + } + + public PartTheWaterveil(final PartTheWaterveil card) { + super(card); + } + + @Override + public PartTheWaterveil copy() { + return new PartTheWaterveil(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/PathwayArrows.java b/Mage.Sets/src/mage/sets/battleforzendikar/PathwayArrows.java new file mode 100644 index 00000000000..ae0a741649f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/PathwayArrows.java @@ -0,0 +1,112 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class PathwayArrows extends CardImpl { + + public PathwayArrows(UUID ownerId) { + super(ownerId, 225, "Pathway Arrows", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Equipment"); + + // Equipped creature has "{2}, {T}: This creature deals 1 damage to target creature. If a colorless creature is dealt damage this way, tap it." + SimpleActivatedAbility ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PathwayArrowsEffect(), new GenericManaCost(2)); + ability2.addCost(new TapSourceCost()); + ability2.addTarget(new TargetCreaturePermanent()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability2, AttachmentType.EQUIPMENT))); + + // Equip {2} + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); + } + + public PathwayArrows(final PathwayArrows card) { + super(card); + } + + @Override + public PathwayArrows copy() { + return new PathwayArrows(this); + } +} + +class PathwayArrowsEffect extends OneShotEffect { + + public PathwayArrowsEffect() { + super(Outcome.Benefit); + this.staticText = "This creature deals 1 damage to target creature. If a colorless creature is dealt damage this way, tap it"; + } + + public PathwayArrowsEffect(final PathwayArrowsEffect effect) { + super(effect); + } + + @Override + public PathwayArrowsEffect copy() { + return new PathwayArrowsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (targetCreature != null) { + int damageDealt = targetCreature.damage(1, source.getSourceId(), game, false, true); + if (damageDealt > 0 && targetCreature.getColor(game).isColorless()) { + targetCreature.tap(game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/PilgrimsEye.java b/Mage.Sets/src/mage/sets/battleforzendikar/PilgrimsEye.java new file mode 100644 index 00000000000..67f74e4c74d --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/PilgrimsEye.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class PilgrimsEye extends mage.sets.worldwake.PilgrimsEye { + + public PilgrimsEye(UUID ownerId) { + super(ownerId); + this.cardNumber = 226; + this.expansionSetCode = "BFZ"; + this.rarity = Rarity.UNCOMMON; + } + + public PilgrimsEye(final PilgrimsEye card) { + super(card); + } + + @Override + public PilgrimsEye copy() { + return new PilgrimsEye(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains1.java new file mode 100644 index 00000000000..4b2a1798cf6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains1 extends mage.cards.basiclands.Plains { + + public Plains1(UUID ownerId) { + super(ownerId, 250); + this.expansionSetCode = "BFZ"; + } + + public Plains1(final Plains1 card) { + super(card); + } + + @Override + public Plains1 copy() { + return new Plains1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains2.java new file mode 100644 index 00000000000..d278d488fbd --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains2 extends mage.cards.basiclands.Plains { + + public Plains2(UUID ownerId) { + super(ownerId, 251); + this.expansionSetCode = "BFZ"; + } + + public Plains2(final Plains2 card) { + super(card); + } + + @Override + public Plains2 copy() { + return new Plains2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains3.java new file mode 100644 index 00000000000..93a2b32e206 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains3 extends mage.cards.basiclands.Plains { + + public Plains3(UUID ownerId) { + super(ownerId, 252); + this.expansionSetCode = "BFZ"; + } + + public Plains3(final Plains3 card) { + super(card); + } + + @Override + public Plains3 copy() { + return new Plains3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains4.java new file mode 100644 index 00000000000..7c95ef89458 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains4 extends mage.cards.basiclands.Plains { + + public Plains4(UUID ownerId) { + super(ownerId, 253); + this.expansionSetCode = "BFZ"; + } + + public Plains4(final Plains4 card) { + super(card); + } + + @Override + public Plains4 copy() { + return new Plains4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains5.java new file mode 100644 index 00000000000..df7ccc8563b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains5 extends mage.cards.basiclands.Plains { + + public Plains5(UUID ownerId) { + super(ownerId, 254); + this.expansionSetCode = "BFZ"; + } + + public Plains5(final Plains5 card) { + super(card); + } + + @Override + public Plains5 copy() { + return new Plains5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/PlanarOutburst.java b/Mage.Sets/src/mage/sets/battleforzendikar/PlanarOutburst.java new file mode 100644 index 00000000000..20819210fb9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/PlanarOutburst.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author fireshoes + */ +public class PlanarOutburst extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("nonland creatures"); + + static { + filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); + } + + public PlanarOutburst(UUID ownerId) { + super(ownerId, 42, "Planar Outburst", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{W}{W}"); + this.expansionSetCode = "BFZ"; + + // Destroy all nonland creatures. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter, false)); + + // Awaken 4-{5}{W}{W}{W} + this.addAbility(new AwakenAbility(this, 4, "{5}{W}{W}{W}")); + } + + public PlanarOutburst(final PlanarOutburst card) { + super(card); + } + + @Override + public PlanarOutburst copy() { + return new PlanarOutburst(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/PlatedCrusher.java b/Mage.Sets/src/mage/sets/battleforzendikar/PlatedCrusher.java new file mode 100644 index 00000000000..cb0d151b5ec --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/PlatedCrusher.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class PlatedCrusher extends CardImpl { + + public PlatedCrusher(UUID ownerId) { + super(ownerId, 183, "Plated Crusher", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{G}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Beast"); + this.power = new MageInt(7); + this.toughness = new MageInt(6); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Hexproof + this.addAbility(HexproofAbility.getInstance()); + } + + public PlatedCrusher(final PlatedCrusher card) { + super(card); + } + + @Override + public PlatedCrusher copy() { + return new PlatedCrusher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plummet.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plummet.java new file mode 100644 index 00000000000..a1aad2c25e9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plummet.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Plummet extends mage.sets.magic2011.Plummet { + + public Plummet(UUID ownerId) { + super(ownerId); + this.cardNumber = 184; + this.expansionSetCode = "BFZ"; + } + + public Plummet(final Plummet card) { + super(card); + } + + @Override + public Plummet copy() { + return new Plummet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/PrairieStream.java b/Mage.Sets/src/mage/sets/battleforzendikar/PrairieStream.java new file mode 100644 index 00000000000..872fca6ef52 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/PrairieStream.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.BlueManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class PrairieStream extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public PrairieStream(UUID ownerId) { + super(ownerId, 241, "Prairie Stream", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Plains"); + this.subtype.add("Island"); + + // Prairie Stream enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new WhiteManaAbility()); + this.addAbility(new BlueManaAbility()); + } + + public PrairieStream(final PrairieStream card) { + super(card); + } + + @Override + public PrairieStream copy() { + return new PrairieStream(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/PrismArray.java b/Mage.Sets/src/mage/sets/battleforzendikar/PrismArray.java new file mode 100644 index 00000000000..c86c1acfc31 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/PrismArray.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.keyword.ScryEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class PrismArray extends CardImpl { + + public PrismArray(UUID ownerId) { + super(ownerId, 81, "Prism Array", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{U}"); + this.expansionSetCode = "BFZ"; + + // Converge - Prism Array enters the battlefield with a crystal counter on it for each color of mana spent to cast it. + this.addAbility(new EntersBattlefieldAbility( + new AddCountersSourceEffect(CounterType.CRYSTAL.createInstance(), ColorsOfManaSpentToCastCount.getInstance(), true), + null, "Converge — {this} enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.", null)); + + // Remove a crystal counter from Prism Array: Tap target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new TapTargetEffect(), + new RemoveCountersSourceCost(CounterType.CRYSTAL.createInstance(1))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // {W}{U}{B}{R}{G}: Scry 3. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScryEffect(3), new ManaCostsImpl("{W}{U}{B}{R}{G}"))); + } + + public PrismArray(final PrismArray card) { + super(card); + } + + @Override + public PrismArray copy() { + return new PrismArray(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ProcessorAssault.java b/Mage.Sets/src/mage/sets/battleforzendikar/ProcessorAssault.java new file mode 100644 index 00000000000..dbcf4c0b8df --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ProcessorAssault.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.common.ExileOpponentsCardFromExileToGraveyardCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ProcessorAssault extends CardImpl { + + public ProcessorAssault(UUID ownerId) { + super(ownerId, 132, "Processor Assault", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + + // As an additional cost to cast Processor Assault, put a card an opponent owns from exile into its owner's graveyard. + this.getSpellAbility().addCost(new ExileOpponentsCardFromExileToGraveyardCost(false)); + + // Processor Assault deals 5 damage to target creature. + this.getSpellAbility().addEffect(new DamageTargetEffect(5)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public ProcessorAssault(final ProcessorAssault card) { + super(card); + } + + @Override + public ProcessorAssault copy() { + return new ProcessorAssault(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/QuarantineField.java b/Mage.Sets/src/mage/sets/battleforzendikar/QuarantineField.java new file mode 100644 index 00000000000..491b8a58b8a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/QuarantineField.java @@ -0,0 +1,122 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.counters.Counter; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class QuarantineField extends CardImpl { + + public QuarantineField(UUID ownerId) { + super(ownerId, 43, "Quarantine Field", Rarity.MYTHIC, new CardType[]{CardType.ENCHANTMENT}, "{X}{X}{W}{W}"); + this.expansionSetCode = "BFZ"; + + // Quarantine Field enters the battlefield with X isolation counters on it. + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(new Counter("isolation")))); + + // When Quarantine Field enters the battlefield, for each isolation counter on it, exile up to one target nonland permanent an opponenet controls until Quarantine Field leaves the battlefield. + Ability ability = new EntersBattlefieldTriggeredAbility(new QuarantineFieldEffect(), false); + ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility())); + this.addAbility(ability); + + } + + public QuarantineField(final QuarantineField card) { + super(card); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if (ability instanceof EntersBattlefieldTriggeredAbility) { + Permanent sourceObject = game.getPermanent(ability.getSourceId()); + if (sourceObject != null) { + int isolationCounters = sourceObject.getCounters(game).getCount("isolation"); + FilterNonlandPermanent filter = new FilterNonlandPermanent("up to " + isolationCounters + " nonland permanents controlled by any opponents"); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + ability.addTarget(new TargetPermanent(0, isolationCounters, filter, false)); + } + + } + } + + @Override + public QuarantineField copy() { + return new QuarantineField(this); + } +} + +class QuarantineFieldEffect extends OneShotEffect { + + public QuarantineFieldEffect() { + super(Outcome.Exile); + this.staticText = "for each isolation counter on it, exile up to one target nonland permanent an opponenet controls until {this} leaves the battlefield"; + } + + public QuarantineFieldEffect(final QuarantineFieldEffect effect) { + super(effect); + } + + @Override + public QuarantineFieldEffect copy() { + return new QuarantineFieldEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + // If the source permanent leaves the battlefield before its triggered ability resolves, + // the targets won't be exiled. + if (permanent != null) { + return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RadiantFlames.java b/Mage.Sets/src/mage/sets/battleforzendikar/RadiantFlames.java new file mode 100644 index 00000000000..da9829e3905 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RadiantFlames.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.effects.common.DamageAllEffect; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class RadiantFlames extends CardImpl { + + public RadiantFlames(UUID ownerId) { + super(ownerId, 151, "Radiant Flames", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{R}"); + this.expansionSetCode = "BFZ"; + + // Converge — Radiant Flames deals X damage to each creature, where X is the number of colors of mana spent to cast Radiant Flames. + getSpellAbility().setAbilityWord(AbilityWord.CONVERGE); + getSpellAbility().addEffect(new DamageAllEffect(ColorsOfManaSpentToCastCount.getInstance(), new FilterCreaturePermanent())); + } + + public RadiantFlames(final RadiantFlames card) { + super(card); + } + + @Override + public RadiantFlames copy() { + return new RadiantFlames(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RecklessCohort.java b/Mage.Sets/src/mage/sets/battleforzendikar/RecklessCohort.java new file mode 100644 index 00000000000..3bebab684a3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RecklessCohort.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalRequirementEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.AttacksIfAbleSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LevelX2 + */ +public class RecklessCohort extends CardImpl { + + private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another Ally"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new SubtypePredicate("Ally")); + } + + public RecklessCohort(UUID ownerId) { + super(ownerId, 152, "Reckless Cohort", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Reckless Cohort attacks each combat if able unless you control another Ally. + Effect effect = new ConditionalRequirementEffect( + new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield, true), + new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 1)); + effect.setText("{this} attacks each combat if able unless you control another Ally"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public RecklessCohort(final RecklessCohort card) { + super(card); + } + + @Override + public RecklessCohort copy() { + return new RecklessCohort(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ReclaimingVines.java b/Mage.Sets/src/mage/sets/battleforzendikar/ReclaimingVines.java new file mode 100644 index 00000000000..8481715ce96 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ReclaimingVines.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author LevelX2 + */ +public class ReclaimingVines extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact, enchantment, or land"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT), + new CardTypePredicate(CardType.LAND))); + } + + public ReclaimingVines(UUID ownerId) { + super(ownerId, 185, "Reclaiming Vines", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); + this.expansionSetCode = "BFZ"; + + // Destroy target artifact, enchantment, or land. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + public ReclaimingVines(final ReclaimingVines card) { + super(card); + } + + @Override + public ReclaimingVines copy() { + return new ReclaimingVines(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ResoluteBlademaster.java b/Mage.Sets/src/mage/sets/battleforzendikar/ResoluteBlademaster.java new file mode 100644 index 00000000000..44e98d3a31f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ResoluteBlademaster.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class ResoluteBlademaster extends CardImpl { + + public ResoluteBlademaster(UUID ownerId) { + super(ownerId, 218, "Resolute Blademaster", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Rally-Whenever Resolute Blademaster or another Ally enters the battlefield under your control, + // you control gain double strike until end of turn. + Ability ability = new AllyEntersBattlefieldTriggeredAbility( + new GainAbilityAllEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, + new FilterControlledCreaturePermanent("creatures you control")), false); + this.addAbility(ability); + } + + public ResoluteBlademaster(final ResoluteBlademaster card) { + super(card); + } + + @Override + public ResoluteBlademaster copy() { + return new ResoluteBlademaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToCoralhelm.java b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToCoralhelm.java new file mode 100644 index 00000000000..d331ef31a7a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToCoralhelm.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.abilities.effects.keyword.ScryEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class RetreatToCoralhelm extends CardImpl { + + public RetreatToCoralhelm(UUID ownerId) { + super(ownerId, 82, "Retreat to Coralhelm", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "BFZ"; + + // Landfall- Whenever a land enters the battlefield under your control, choose one - You may tap or untap target creature; or Scry 1. + LandfallAbility ability = new LandfallAbility(new MayTapOrUntapTargetEffect(), false); + ability.addTarget(new TargetCreaturePermanent()); + Mode mode = new Mode(); + mode.getEffects().add(new ScryEffect(1)); + ability.addMode(mode); + this.addAbility(ability); + } + + public RetreatToCoralhelm(final RetreatToCoralhelm card) { + super(card); + } + + @Override + public RetreatToCoralhelm copy() { + return new RetreatToCoralhelm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToEmeria.java b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToEmeria.java new file mode 100644 index 00000000000..6aa51bd4f38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToEmeria.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Mode; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.permanent.token.Token; + +/** + * + * @author fireshoes + */ +public class RetreatToEmeria extends CardImpl { + + public RetreatToEmeria(UUID ownerId) { + super(ownerId, 44, "Retreat to Emeria", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "BFZ"; + + // Landfall - Whenever a land enters the battlefield under you control, choose one - Put a 1/1 white Kor Ally creature token onto the battlefield; or Creatures you control get +1/+1 until end of turn. + LandfallAbility ability = new LandfallAbility(new CreateTokenEffect(new KorAllyToken()), false); + Mode mode = new Mode(); + mode.getEffects().add(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); + ability.addMode(mode); + this.addAbility(ability); + } + + public RetreatToEmeria(final RetreatToEmeria card) { + super(card); + } + + @Override + public RetreatToEmeria copy() { + return new RetreatToEmeria(this); + } +} + +class KorAllyToken extends Token { + + public KorAllyToken() { + super("Kor Ally", "1/1 white Kor Ally creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Kor"); + subtype.add("Ally"); + color.setWhite(true); + power = new MageInt(1); + toughness = new MageInt(1); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToHagra.java b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToHagra.java new file mode 100644 index 00000000000..49dd0bc33ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToHagra.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class RetreatToHagra extends CardImpl { + + public RetreatToHagra(UUID ownerId) { + super(ownerId, 121, "Retreat to Hagra", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + + // Landfall- Whenever a land enters the battlefield under your control, choose one - Target creature gets +1/+0 and gains deathtouch until end of turn; + LandfallAbility ability = new LandfallAbility(new BoostTargetEffect(1, 0, Duration.EndOfTurn), false); + ability.addEffect(new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn)); + ability.addTarget(new TargetCreaturePermanent()); + + // or Each opponent loses 1 life and you gain 1 life. + Mode mode = new Mode(); + mode.getEffects().add(new LoseLifeOpponentsEffect(1)); + Effect effect = new GainLifeEffect(1); + effect.setText("and you gain 1 life"); + mode.getEffects().add(effect); + ability.addMode(mode); + this.addAbility(ability); + } + + public RetreatToHagra(final RetreatToHagra card) { + super(card); + } + + @Override + public RetreatToHagra copy() { + return new RetreatToHagra(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToKazandu.java b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToKazandu.java new file mode 100644 index 00000000000..8d767821c63 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToKazandu.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RetreatToKazandu extends mage.sets.zendikarvseldrazi.RetreatToKazandu { + + public RetreatToKazandu(UUID ownerId) { + super(ownerId); + this.cardNumber = 186; + this.expansionSetCode = "BFZ"; + } + + public RetreatToKazandu(final RetreatToKazandu card) { + super(card); + } + + @Override + public RetreatToKazandu copy() { + return new RetreatToKazandu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToValakut.java b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToValakut.java new file mode 100644 index 00000000000..d078c696bc8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToValakut.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.combat.CantBlockTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class RetreatToValakut extends CardImpl { + + public RetreatToValakut(UUID ownerId) { + super(ownerId, 153, "Retreat to Valakut", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "BFZ"; + + // Landfall- Whenever a land enters the battlefield under your control, choose one - Target creature gets +2/+0 until end of turn; + LandfallAbility ability = new LandfallAbility(new BoostTargetEffect(2, 0, Duration.EndOfTurn), false); + ability.addTarget(new TargetCreaturePermanent()); + + // or Target creature can't block this turn. + Mode mode = new Mode(); + mode.getEffects().add(new CantBlockTargetEffect(Duration.EndOfTurn)); + mode.getTargets().add(new TargetCreaturePermanent()); + ability.addMode(mode); + this.addAbility(ability); + } + + public RetreatToValakut(final RetreatToValakut card) { + super(card); + } + + @Override + public RetreatToValakut copy() { + return new RetreatToValakut(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RisingMiasma.java b/Mage.Sets/src/mage/sets/battleforzendikar/RisingMiasma.java new file mode 100644 index 00000000000..0fd0a1fe951 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RisingMiasma.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class RisingMiasma extends CardImpl { + + public RisingMiasma(UUID ownerId) { + super(ownerId, 122, "Rising Miasma", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}"); + this.expansionSetCode = "BFZ"; + + // All creatures get -2/-2 until end of turn. + this.getSpellAbility().addEffect(new BoostAllEffect(-2, -2, Duration.EndOfTurn)); + + // Awaken 3 - {5}{B}{B} + this.addAbility(new AwakenAbility(this, 3, "{5}{B}{B}")); + } + + public RisingMiasma(final RisingMiasma card) { + super(card); + } + + @Override + public RisingMiasma copy() { + return new RisingMiasma(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RoilSpout.java b/Mage.Sets/src/mage/sets/battleforzendikar/RoilSpout.java new file mode 100644 index 00000000000..6dd137db445 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RoilSpout.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class RoilSpout extends CardImpl { + + public RoilSpout(UUID ownerId) { + super(ownerId, 219, "Roil Spout", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{W}{U}"); + this.expansionSetCode = "BFZ"; + + // Put target creature on top of its owner's library. + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Awaken 4-{4}{W}{U} + this.addAbility(new AwakenAbility(this, 4, "{4}{W}{U}")); + } + + public RoilSpout(final RoilSpout card) { + super(card); + } + + @Override + public RoilSpout copy() { + return new RoilSpout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RoilmagesTrick.java b/Mage.Sets/src/mage/sets/battleforzendikar/RoilmagesTrick.java new file mode 100644 index 00000000000..de6e77d02c8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RoilmagesTrick.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LevelX2 + */ +public class RoilmagesTrick extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public RoilmagesTrick(UUID ownerId) { + super(ownerId, 83, "Roilmage's Trick", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{U}"); + this.expansionSetCode = "BFZ"; + + // Converge — Creatures your opponents control get -X/-0 until end of turn, where X is the number of colors of mana spent to cast Roilmage's Trick. + this.getSpellAbility().setAbilityWord(AbilityWord.CONVERGE); + this.getSpellAbility().addEffect(new BoostAllEffect( + new SignInversionDynamicValue(ColorsOfManaSpentToCastCount.getInstance()), new StaticValue(-0), Duration.EndOfTurn, filter, false, + "Creatures your opponents control get -X/-0 until end of turn, where X is the number of colors of mana spent to cast {this}.
", true)); + + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public RoilmagesTrick(final RoilmagesTrick card) { + super(card); + } + + @Override + public RoilmagesTrick copy() { + return new RoilmagesTrick(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RoilsRetribution.java b/Mage.Sets/src/mage/sets/battleforzendikar/RoilsRetribution.java new file mode 100644 index 00000000000..b94090773f5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RoilsRetribution.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.DamageMultiEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingOrBlockingCreature; +import mage.target.common.TargetCreaturePermanentAmount; + +/** + * + * @author LevelX2 + */ +public class RoilsRetribution extends CardImpl { + + public RoilsRetribution(UUID ownerId) { + super(ownerId, 45, "Roil's Retribution", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{W}{W}"); + this.expansionSetCode = "BFZ"; + + // Roil's Retribution deals 5 damage divided as you choose among any number of target attacking or blocking creatures. + this.getSpellAbility().addEffect(new DamageMultiEffect(5)); + this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(5, new FilterAttackingOrBlockingCreature("attacking or blocking creatures"))); + } + + public RoilsRetribution(final RoilsRetribution card) { + super(card); + } + + @Override + public RoilsRetribution copy() { + return new RoilsRetribution(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RollingThunder.java b/Mage.Sets/src/mage/sets/battleforzendikar/RollingThunder.java new file mode 100644 index 00000000000..5201f9e3cea --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RollingThunder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RollingThunder extends mage.sets.tempestremastered.RollingThunder { + + public RollingThunder(UUID ownerId) { + super(ownerId); + this.cardNumber = 154; + this.expansionSetCode = "BFZ"; + } + + public RollingThunder(final RollingThunder card) { + super(card); + } + + @Override + public RollingThunder copy() { + return new RollingThunder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RotShambler.java b/Mage.Sets/src/mage/sets/battleforzendikar/RotShambler.java new file mode 100644 index 00000000000..b42c874827b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RotShambler.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LevelX2 + */ +public class RotShambler extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature you control"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public RotShambler(UUID ownerId) { + super(ownerId, 187, "Rot Shambler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Fungus"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever another creature you control dies, put a +1/+1 counter on Rot Shambler. + this.addAbility(new DiesCreatureTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, filter)); + + } + + public RotShambler(final RotShambler card) { + super(card); + } + + @Override + public RotShambler copy() { + return new RotShambler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RuinProcessor.java b/Mage.Sets/src/mage/sets/battleforzendikar/RuinProcessor.java new file mode 100644 index 00000000000..32c73d263fc --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RuinProcessor.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.common.ExileOpponentsCardFromExileToGraveyardCost; +import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class RuinProcessor extends CardImpl { + + public RuinProcessor(UUID ownerId) { + super(ownerId, 12, "Ruin Processor", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{7}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Processor"); + this.power = new MageInt(7); + this.toughness = new MageInt(8); + + // When you cast Ruin Processor, you may put a card an opponent owns from exile into that player's graveyard. If you do, you gain 5 life. + this.addAbility(new CastSourceTriggeredAbility( + new DoIfCostPaid(new GainLifeEffect(5), new ExileOpponentsCardFromExileToGraveyardCost(true)), true)); + + } + + public RuinProcessor(final RuinProcessor card) { + super(card); + } + + @Override + public RuinProcessor copy() { + return new RuinProcessor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RuinationGuide.java b/Mage.Sets/src/mage/sets/battleforzendikar/RuinationGuide.java new file mode 100644 index 00000000000..128a4ae5697 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RuinationGuide.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; + +/** + * + * @author LevelX2 + */ +public class RuinationGuide extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Other colorless creatures you control"); + + static { + filter.add(new ColorlessPredicate()); + } + + public RuinationGuide(UUID ownerId) { + super(ownerId, 64, "Ruination Guide", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // Ingest + this.addAbility(new IngestAbility()); + // Other colorless creatures you control get +1/+0. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 0, Duration.WhileOnBattlefield, filter, true))); + } + + public RuinationGuide(final RuinationGuide card) { + super(card); + } + + @Override + public RuinationGuide copy() { + return new RuinationGuide(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RuinousPath.java b/Mage.Sets/src/mage/sets/battleforzendikar/RuinousPath.java new file mode 100644 index 00000000000..61df7d66f0b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RuinousPath.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlaneswalker; + +/** + * + * @author LevelX2 + */ +public class RuinousPath extends CardImpl { + + public RuinousPath(UUID ownerId) { + super(ownerId, 123, "Ruinous Path", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); + this.expansionSetCode = "BFZ"; + + // Destroy target creature or planeswalker. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker()); + + // Awaken 4-{5}{B}{B} + this.addAbility(new AwakenAbility(this, 4, "{5}{B}{B}")); + } + + public RuinousPath(final RuinousPath card) { + super(card); + } + + @Override + public RuinousPath copy() { + return new RuinousPath(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RushOfIce.java b/Mage.Sets/src/mage/sets/battleforzendikar/RushOfIce.java new file mode 100644 index 00000000000..284b9088325 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RushOfIce.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class RushOfIce extends CardImpl { + + public RushOfIce(UUID ownerId) { + super(ownerId, 84, "Rush of Ice", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); + this.expansionSetCode = "BFZ"; + + // Tap target creature. It doesn't untap during its controller's next untap step. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new TapTargetEffect()); + this.getSpellAbility().addEffect(new DontUntapInControllersNextUntapStepTargetEffect("It")); + + // Awaken 3—{4}{U} + this.addAbility(new AwakenAbility(this, 3, "{4}{U}")); + } + + public RushOfIce(final RushOfIce card) { + super(card); + } + + @Override + public RushOfIce copy() { + return new RushOfIce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SalvageDrone.java b/Mage.Sets/src/mage/sets/battleforzendikar/SalvageDrone.java new file mode 100644 index 00000000000..ddc93565ded --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SalvageDrone.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.DrawDiscardControllerEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class SalvageDrone extends CardImpl { + + public SalvageDrone(UUID ownerId) { + super(ownerId, 65, "Salvage Drone", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.) + this.addAbility(new IngestAbility()); + // When Salvage Drone dies, you may draw a card. If you do, discard a card. + this.addAbility(new DiesTriggeredAbility(new DrawDiscardControllerEffect(1, 1, true), false)); + + } + + public SalvageDrone(final SalvageDrone card) { + super(card); + } + + @Override + public SalvageDrone copy() { + return new SalvageDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SanctumOfUgin.java b/Mage.Sets/src/mage/sets/battleforzendikar/SanctumOfUgin.java new file mode 100644 index 00000000000..43f2551ad26 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SanctumOfUgin.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter.ComparisonType; +import mage.filter.FilterSpell; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author fireshoes + */ +public class SanctumOfUgin extends CardImpl { + + private static final FilterCreatureCard filter = new FilterCreatureCard("colorless creature card"); + private static final FilterSpell filterSpells = new FilterSpell("colorless spell with converted mana cost 7 or greater"); + + static { + filter.add(new ColorlessPredicate()); + filterSpells.add(new ColorlessPredicate()); + filterSpells.add(new ConvertedManaCostPredicate(ComparisonType.GreaterThan, 6)); + } + + public SanctumOfUgin(UUID ownerId) { + super(ownerId, 242, "Sanctum of Ugin", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // Whenever you cast a colorless spell with converted mana cost 7 or greater, you may sacrifice Sanctum of Ugin. + // If you do, search your library for a colorless creature card, reveal it, put it into your hand, then shuffle your library. + Effect effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true); + effect.setText("search your library for a colorless creature card, reveal it, put it into your hand, then shuffle your library"); + this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid(effect, new SacrificeSourceCost()), filterSpells, false)); + } + + public SanctumOfUgin(final SanctumOfUgin card) { + super(card); + } + + @Override + public SanctumOfUgin copy() { + return new SanctumOfUgin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SandstoneBridge.java b/Mage.Sets/src/mage/sets/battleforzendikar/SandstoneBridge.java new file mode 100644 index 00000000000..59094744fdc --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SandstoneBridge.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class SandstoneBridge extends CardImpl { + + public SandstoneBridge(UUID ownerId) { + super(ownerId, 243, "Sandstone Bridge", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // Sandstone Bridge enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // When Sandstone Bridge enters the battlefield, target creature gets +1/+1 and gains vigilance until end of turn. + Effect effect = new GainAbilityTargetEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains vigilance"); + Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(1, 1, Duration.EndOfTurn), false); + ability.addEffect(effect); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // {T}: Add {W} to your mana pool. + this.addAbility(new WhiteManaAbility()); + } + + public SandstoneBridge(final SandstoneBridge card) { + super(card); + } + + @Override + public SandstoneBridge copy() { + return new SandstoneBridge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ScatterToTheWinds.java b/Mage.Sets/src/mage/sets/battleforzendikar/ScatterToTheWinds.java new file mode 100644 index 00000000000..d040bebf35e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ScatterToTheWinds.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetSpell; + +/** + * + * @author fireshoes + */ +public class ScatterToTheWinds extends CardImpl { + + public ScatterToTheWinds(UUID ownerId) { + super(ownerId, 85, "Scatter to the Winds", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); + this.expansionSetCode = "BFZ"; + + // Counter target spell. + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + + // Awaken 3-{4}{U}{U} + this.addAbility(new AwakenAbility(this, 3, "{4}{U}{U}")); + } + + public ScatterToTheWinds(final ScatterToTheWinds card) { + super(card); + } + + @Override + public ScatterToTheWinds copy() { + return new ScatterToTheWinds(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ScourFromExistence.java b/Mage.Sets/src/mage/sets/battleforzendikar/ScourFromExistence.java new file mode 100644 index 00000000000..4b0f6795c60 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ScourFromExistence.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class ScourFromExistence extends CardImpl { + + public ScourFromExistence(UUID ownerId) { + super(ownerId, 13, "Scour from Existence", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{7}"); + this.expansionSetCode = "BFZ"; + + // Exile target permanent. + this.getSpellAbility().addEffect(new ExileTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent()); + } + + public ScourFromExistence(final ScourFromExistence card) { + super(card); + } + + @Override + public ScourFromExistence copy() { + return new ScourFromExistence(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ScytheLeopard.java b/Mage.Sets/src/mage/sets/battleforzendikar/ScytheLeopard.java new file mode 100644 index 00000000000..7e1b5ded1bc --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ScytheLeopard.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ScytheLeopard extends CardImpl { + + public ScytheLeopard(UUID ownerId) { + super(ownerId, 188, "Scythe Leopard", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Cat"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Landfall-Whenever a land enters the battlefield under your control, Scythe Leopard gets +1/+1 until end of turn. + this.addAbility(new LandfallAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false)); + } + + public ScytheLeopard(final ScytheLeopard card) { + super(card); + } + + @Override + public ScytheLeopard copy() { + return new ScytheLeopard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SeekTheWilds.java b/Mage.Sets/src/mage/sets/battleforzendikar/SeekTheWilds.java new file mode 100644 index 00000000000..40a3d84db60 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SeekTheWilds.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author LevelX2 + */ +public class SeekTheWilds extends CardImpl { + + private static final FilterCard filter = new FilterCard("a creature or land card"); + + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND))); + } + + public SeekTheWilds(UUID ownerId) { + super(ownerId, 189, "Seek the Wilds", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); + this.expansionSetCode = "BFZ"; + + // Look at the top four cards of your library. You may reveal a creature or land card from among them and put it into your hand. Put the rest on the bottom of your library in any order. + this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(4), false, new StaticValue(1), filter, false)); + + } + + public SeekTheWilds(final SeekTheWilds card) { + super(card); + } + + @Override + public SeekTheWilds copy() { + return new SeekTheWilds(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SereneSteward.java b/Mage.Sets/src/mage/sets/battleforzendikar/SereneSteward.java new file mode 100644 index 00000000000..3b965ef9d60 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SereneSteward.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.GainLifeControllerTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class SereneSteward extends CardImpl { + + public SereneSteward(UUID ownerId) { + super(ownerId, 46, "Serene Steward", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever you gain life, you may pay {W}. If you do, put a +1/+1 counter on target creature. + Ability ability = new GainLifeControllerTriggeredAbility( + new DoIfCostPaid(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{W}")), + false); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public SereneSteward(final SereneSteward card) { + super(card); + } + + @Override + public SereneSteward copy() { + return new SereneSteward(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SerpentineSpike.java b/Mage.Sets/src/mage/sets/battleforzendikar/SerpentineSpike.java new file mode 100644 index 00000000000..292dc45afd9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SerpentineSpike.java @@ -0,0 +1,129 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.replacement.DealtDamageToCreatureBySourceDies; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AnotherTargetPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; +import mage.watchers.common.DamagedByWatcher; + +/** + * + * @author LevelX2 + */ +public class SerpentineSpike extends CardImpl { + + public SerpentineSpike(UUID ownerId) { + super(ownerId, 133, "Serpentine Spike", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{R}{R}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Serpentine Spike deals 2 damage to target creature, 3 damage to another target creature, and 4 damage to a third target creature. If a creature dealt damage this way would die this turn, exile it instead. + this.getSpellAbility().addEffect(new SerpentineSpikeEffect()); + + TargetCreaturePermanent target = new TargetCreaturePermanent(new FilterCreaturePermanent("creature (2 damage)")); + target.setTargetTag(1); + this.getSpellAbility().addTarget(target); + + FilterCreaturePermanent filter = new FilterCreaturePermanent("another target creature (3 damage)"); + filter.add(new AnotherTargetPredicate(2)); + target = new TargetCreaturePermanent(filter); + target.setTargetTag(2); + this.getSpellAbility().addTarget(target); + + filter = new FilterCreaturePermanent("another target creature (4 damage)"); + filter.add(new AnotherTargetPredicate(3)); + target = new TargetCreaturePermanent(filter); + target.setTargetTag(3); + this.getSpellAbility().addTarget(target); + + Effect effect = new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn); + effect.setText("If a creature dealt damage this way would die this turn, exile it instead"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addWatcher(new DamagedByWatcher()); + } + + public SerpentineSpike(final SerpentineSpike card) { + super(card); + } + + @Override + public SerpentineSpike copy() { + return new SerpentineSpike(this); + } +} + +class SerpentineSpikeEffect extends OneShotEffect { + + public SerpentineSpikeEffect() { + super(Outcome.Damage); + this.staticText = "{this} deals 2 damage to target creature, 3 damage to another target creature, and 4 damage to a third target creature"; + } + + public SerpentineSpikeEffect(final SerpentineSpikeEffect effect) { + super(effect); + } + + @Override + public SerpentineSpikeEffect copy() { + return new SerpentineSpikeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getTargets().get(0).getFirstTarget()); + if (permanent != null) { + permanent.damage(2, source.getSourceId(), game, false, true); + } + permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget()); + if (permanent != null) { + permanent.damage(3, source.getSourceId(), game, false, true); + } + permanent = game.getPermanent(source.getTargets().get(2).getFirstTarget()); + if (permanent != null) { + permanent.damage(4, source.getSourceId(), game, false, true); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ShadowGlider.java b/Mage.Sets/src/mage/sets/battleforzendikar/ShadowGlider.java new file mode 100644 index 00000000000..786eac4e37e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ShadowGlider.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class ShadowGlider extends CardImpl { + + public ShadowGlider(UUID ownerId) { + super(ownerId, 47, "Shadow Glider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Kor"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + } + + public ShadowGlider(final ShadowGlider card) { + super(card); + } + + @Override + public ShadowGlider copy() { + return new ShadowGlider(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ShamblingVent.java b/Mage.Sets/src/mage/sets/battleforzendikar/ShamblingVent.java new file mode 100644 index 00000000000..359b32ed5ee --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ShamblingVent.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.keyword.LifelinkAbility; +import mage.abilities.mana.BlackManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.Token; + +/** + * + * @author fireshoes + */ +public class ShamblingVent extends CardImpl { + + public ShamblingVent(UUID ownerId) { + super(ownerId, 244, "Shambling Vent", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // Shambling Vent enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {T}: Add {W} or {B} to your mana pool. + this.addAbility(new WhiteManaAbility()); + this.addAbility(new BlackManaAbility()); + + // {1}{W}{B}: Shambling Vent becomes a 2/3 white and black Elemental creature with lifelink until end of turn. It's still a land. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect( + new ShamblingVentToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{1}{W}{B}"))); + } + + public ShamblingVent(final ShamblingVent card) { + super(card); + } + + @Override + public ShamblingVent copy() { + return new ShamblingVent(this); + } +} + +class ShamblingVentToken extends Token { + + public ShamblingVentToken() { + super("", "2/3 white and black Elemental creature with lifelink"); + cardType.add(CardType.CREATURE); + subtype.add("Elemental"); + color.setWhite(true); + color.setBlack(true); + power = new MageInt(2); + toughness = new MageInt(3); + addAbility(LifelinkAbility.getInstance()); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ShatterskullRecruit.java b/Mage.Sets/src/mage/sets/battleforzendikar/ShatterskullRecruit.java new file mode 100644 index 00000000000..b60833dab6a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ShatterskullRecruit.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class ShatterskullRecruit extends CardImpl { + + public ShatterskullRecruit(UUID ownerId) { + super(ownerId, 155, "Shatterskull Recruit", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Giant"); + this.subtype.add("Warrior"); + this.subtype.add("Ally"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Menace + this.addAbility(new MenaceAbility()); + } + + public ShatterskullRecruit(final ShatterskullRecruit card) { + super(card); + } + + @Override + public ShatterskullRecruit copy() { + return new ShatterskullRecruit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SheerDrop.java b/Mage.Sets/src/mage/sets/battleforzendikar/SheerDrop.java new file mode 100644 index 00000000000..23eb73d84ae --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SheerDrop.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SheerDrop extends mage.sets.zendikarvseldrazi.SheerDrop { + + public SheerDrop(UUID ownerId) { + super(ownerId); + this.cardNumber = 48; + this.expansionSetCode = "BFZ"; + } + + public SheerDrop(final SheerDrop card) { + super(card); + } + + @Override + public SheerDrop copy() { + return new SheerDrop(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ShrineOfTheForsakenGods.java b/Mage.Sets/src/mage/sets/battleforzendikar/ShrineOfTheForsakenGods.java new file mode 100644 index 00000000000..70a54cc1a08 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ShrineOfTheForsakenGods.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.AddConditionalColorlessManaEffect; +import mage.abilities.mana.ActivateIfConditionManaAbility; +import mage.abilities.mana.ColorlessManaAbility; +import mage.abilities.mana.conditional.ConditionalSpellManaBuilder; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; + +/** + * + * @author LevelX2 + */ +public class ShrineOfTheForsakenGods extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("colorless spells"); + + static { + filter.add(new ColorlessPredicate()); + } + + public ShrineOfTheForsakenGods(UUID ownerId) { + super(ownerId, 245, "Shrine of the Forsaken Gods", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // {T}: Add {2} to your mana pool. Spend this mana only to cast colorless spells. Activate this ability only if you control seven or more lands. + this.addAbility(new ActivateIfConditionManaAbility( + Zone.BATTLEFIELD, + new AddConditionalColorlessManaEffect(2, new ConditionalSpellManaBuilder(filter)), + new TapSourceCost(), + new PermanentsOnTheBattlefieldCondition(new FilterControlledLandPermanent("you control seven or more lands"), PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 6))); + } + + public ShrineOfTheForsakenGods(final ShrineOfTheForsakenGods card) { + super(card); + } + + @Override + public ShrineOfTheForsakenGods copy() { + return new ShrineOfTheForsakenGods(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SilentSkimmer.java b/Mage.Sets/src/mage/sets/battleforzendikar/SilentSkimmer.java new file mode 100644 index 00000000000..bd3526bc99b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SilentSkimmer.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; + +/** + * + * @author LevelX2 + */ +public class SilentSkimmer extends CardImpl { + + public SilentSkimmer(UUID ownerId) { + super(ownerId, 96, "Silent Skimmer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Whenever Silent Skimmer attacks, defending player loses 2 life. + this.addAbility(new AttacksTriggeredAbility(new LoseLifeTargetEffect(2), false, + "Whenever {this} attacks, defending player loses 2 life", SetTargetPointer.PLAYER)); + + } + + public SilentSkimmer(final SilentSkimmer card) { + super(card); + } + + @Override + public SilentSkimmer copy() { + return new SilentSkimmer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SireOfStagnation.java b/Mage.Sets/src/mage/sets/battleforzendikar/SireOfStagnation.java new file mode 100644 index 00000000000..126dbb1d10c --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SireOfStagnation.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ExileCardsFromTopOfLibraryTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author fireshoes + */ +public class SireOfStagnation extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + private static final String rule = "Whenever a land enters the battlefield under an opponent's control, that player exiles the top two cards of his or her library and you draw two cards."; + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public SireOfStagnation(UUID ownerId) { + super(ownerId, 206, "Sire of Stagnation", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{U}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(5); + this.toughness = new MageInt(7); + + // Devoid (This card has no color.) + this.addAbility(new DevoidAbility(this.color)); + + // Whenever a land enters the battlefield under an opponent's control, that player exiles the top two cards of his or her library and you draw two cards. + Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, + new ExileCardsFromTopOfLibraryTargetEffect(2, "that player"), filter, false, SetTargetPointer.PLAYER, rule, false); + ability.addEffect(new DrawCardSourceControllerEffect(2)); + this.addAbility(ability); + } + + public SireOfStagnation(final SireOfStagnation card) { + super(card); + } + + @Override + public SireOfStagnation copy() { + return new SireOfStagnation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Skitterskin.java b/Mage.Sets/src/mage/sets/battleforzendikar/Skitterskin.java new file mode 100644 index 00000000000..02439832d6a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Skitterskin.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.CantBlockAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author fireshoes + */ +public class Skitterskin extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("you control another colorless creature"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ColorlessPredicate()); + } + + public Skitterskin(UUID ownerId) { + super(ownerId, 97, "Skitterskin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Skitterskin can't block. + this.addAbility(new CantBlockAbility()); + + // {1}{B}: Regenerate Skitterskin. Activate this ability only if you control another colorless creature. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new RegenerateSourceEffect(), + new ManaCostsImpl("{1}{B}"), + new PermanentsOnTheBattlefieldCondition(filter)); + this.addAbility(ability); + } + + public Skitterskin(final Skitterskin card) { + super(card); + } + + @Override + public Skitterskin copy() { + return new Skitterskin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SkylineCascade.java b/Mage.Sets/src/mage/sets/battleforzendikar/SkylineCascade.java new file mode 100644 index 00000000000..1f2078bb003 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SkylineCascade.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; +import mage.abilities.mana.BlueManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class SkylineCascade extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public SkylineCascade(UUID ownerId) { + super(ownerId, 246, "Skyline Cascade", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // Skyline Cascade enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // When Skyline Cascade enters the battlefield, target creature an opponent controls doesn't untap during its controller's next untap step. + Ability ability = new EntersBattlefieldTriggeredAbility(new DontUntapInControllersNextUntapStepTargetEffect(), false); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + + // {T}: Add {U} to your mana pool. + this.addAbility(new BlueManaAbility()); + } + + public SkylineCascade(final SkylineCascade card) { + super(card); + } + + @Override + public SkylineCascade copy() { + return new SkylineCascade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SkyriderElf.java b/Mage.Sets/src/mage/sets/battleforzendikar/SkyriderElf.java new file mode 100644 index 00000000000..d02eccfbc59 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SkyriderElf.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LevelX2 + */ +public class SkyriderElf extends CardImpl { + + public SkyriderElf(UUID ownerId) { + super(ownerId, 220, "Skyrider Elf", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{X}{G}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elf"); + this.subtype.add("Warrior"); + this.subtype.add("Ally"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Converge-Skyrider Elf enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it. + this.addAbility(new EntersBattlefieldAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance(), ColorsOfManaSpentToCastCount.getInstance(), true), + null, "Converge — {this} enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.", null)); + + } + + public SkyriderElf(final SkyriderElf card) { + super(card); + } + + @Override + public SkyriderElf copy() { + return new SkyriderElf(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SlabHammer.java b/Mage.Sets/src/mage/sets/battleforzendikar/SlabHammer.java new file mode 100644 index 00000000000..98e97a9e68e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SlabHammer.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAttachedTriggeredAbility; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledLandPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LevelX2 + */ +public class SlabHammer extends CardImpl { + + public SlabHammer(UUID ownerId) { + super(ownerId, 227, "Slab Hammer", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Equipment"); + + // Whenever equipped creature attacks, you may return a land you control to its owner's hand. If you do, the creature gets +2/+2 until end of turn. + Ability ability = new AttacksAttachedTriggeredAbility( + new DoIfCostPaid(new BoostEquippedEffect(2, 2, Duration.EndOfTurn), + new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(new FilterControlledLandPermanent())), + "Return a land you control to its owner's hand? (giving +2/+2 to the equipped creature)")); + this.addAbility(ability); + + // Equip {2} + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); + + } + + public SlabHammer(final SlabHammer card) { + super(card); + } + + @Override + public SlabHammer copy() { + return new SlabHammer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SludgeCrawler.java b/Mage.Sets/src/mage/sets/battleforzendikar/SludgeCrawler.java new file mode 100644 index 00000000000..e758d0d2264 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SludgeCrawler.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class SludgeCrawler extends CardImpl { + + public SludgeCrawler(UUID ownerId) { + super(ownerId, 98, "Sludge Crawler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Ingest + this.addAbility(new IngestAbility()); + // {2}: Sludge Crawler gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new GenericManaCost(2))); + } + + public SludgeCrawler(final SludgeCrawler card) { + super(card); + } + + @Override + public SludgeCrawler copy() { + return new SludgeCrawler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SmiteTheMonstrous.java b/Mage.Sets/src/mage/sets/battleforzendikar/SmiteTheMonstrous.java new file mode 100644 index 00000000000..3599031904a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SmiteTheMonstrous.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SmiteTheMonstrous extends mage.sets.innistrad.SmiteTheMonstrous { + + public SmiteTheMonstrous(UUID ownerId) { + super(ownerId); + this.cardNumber = 49; + this.expansionSetCode = "BFZ"; + } + + public SmiteTheMonstrous(final SmiteTheMonstrous card) { + super(card); + } + + @Override + public SmiteTheMonstrous copy() { + return new SmiteTheMonstrous(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SmolderingMarsh.java b/Mage.Sets/src/mage/sets/battleforzendikar/SmolderingMarsh.java new file mode 100644 index 00000000000..cf49a37bcaa --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SmolderingMarsh.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class SmolderingMarsh extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public SmolderingMarsh(UUID ownerId) { + super(ownerId, 247, "Smoldering Marsh", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Swamp"); + this.subtype.add("Mountain"); + + // Smoldering Marsh enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlackManaAbility()); + this.addAbility(new RedManaAbility()); + } + + public SmolderingMarsh(final SmolderingMarsh card) { + super(card); + } + + @Override + public SmolderingMarsh copy() { + return new SmolderingMarsh(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SmotheringAbomination.java b/Mage.Sets/src/mage/sets/battleforzendikar/SmotheringAbomination.java new file mode 100644 index 00000000000..e7d2ec93608 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SmotheringAbomination.java @@ -0,0 +1,115 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; + +/** + * + * @author fireshoes + */ +public class SmotheringAbomination extends CardImpl { + + public SmotheringAbomination(UUID ownerId) { + super(ownerId, 99, "Smothering Abomination", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // At the beginning of your upkeep, sacrifice a creature + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect( + new FilterCreaturePermanent(), 1, null), TargetController.YOU, false)); + + // Whenever you sacrifice a creature, draw a card. + this.addAbility(new SmotheringAbominationTriggeredAbility()); + } + + public SmotheringAbomination(final SmotheringAbomination card) { + super(card); + } + + @Override + public SmotheringAbomination copy() { + return new SmotheringAbomination(this); + } +} + +class SmotheringAbominationTriggeredAbility extends TriggeredAbilityImpl { + + public SmotheringAbominationTriggeredAbility() { + super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1)); + } + + public SmotheringAbominationTriggeredAbility(final SmotheringAbominationTriggeredAbility ability) { + super(ability); + } + + @Override + public SmotheringAbominationTriggeredAbility copy() { + return new SmotheringAbominationTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SACRIFICED_PERMANENT; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(this.getControllerId()) + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE); + } + + @Override + public String getRule() { + return "Whenever you sacrifice a creature, " + super.getRule(); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SnappingGnarlid.java b/Mage.Sets/src/mage/sets/battleforzendikar/SnappingGnarlid.java new file mode 100644 index 00000000000..299d4bee641 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SnappingGnarlid.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class SnappingGnarlid extends CardImpl { + + public SnappingGnarlid(UUID ownerId) { + super(ownerId, 190, "Snapping Gnarlid", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Beast"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Landfall- Whenever a land enters the battlefield under your control, Snapping Gnarlid gets +1/+1 until end of turn. + this.addAbility(new LandfallAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false)); + } + + public SnappingGnarlid(final SnappingGnarlid card) { + super(card); + } + + @Override + public SnappingGnarlid copy() { + return new SnappingGnarlid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SpawningBed.java b/Mage.Sets/src/mage/sets/battleforzendikar/SpawningBed.java new file mode 100644 index 00000000000..1dc801574ed --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SpawningBed.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.EldraziScionToken; + +/** + * + * @author fireshoes + */ +public class SpawningBed extends CardImpl { + + public SpawningBed(UUID ownerId) { + super(ownerId, 248, "Spawning Bed", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + + // {6}, {T}, Sacrifice Spawning Bed: Put three 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new EldraziScionToken(), 3), new ManaCostsImpl("{6}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public SpawningBed(final SpawningBed card) { + super(card); + } + + @Override + public SpawningBed copy() { + return new SpawningBed(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SpellShrivel.java b/Mage.Sets/src/mage/sets/battleforzendikar/SpellShrivel.java new file mode 100644 index 00000000000..0ad2aad05c5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SpellShrivel.java @@ -0,0 +1,125 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author LevelX2 + */ +public class SpellShrivel extends CardImpl { + + public SpellShrivel(UUID ownerId) { + super(ownerId, 66, "Spell Shrivel", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Counter target spell unless its controller pays {4}. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. + this.getSpellAbility().addEffect(new SpellShrivelCounterUnlessPaysEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + public SpellShrivel(final SpellShrivel card) { + super(card); + } + + @Override + public SpellShrivel copy() { + return new SpellShrivel(this); + } +} + +class SpellShrivelCounterUnlessPaysEffect extends OneShotEffect { + + public SpellShrivelCounterUnlessPaysEffect() { + super(Outcome.Detriment); + } + + public SpellShrivelCounterUnlessPaysEffect(final SpellShrivelCounterUnlessPaysEffect effect) { + super(effect); + } + + @Override + public SpellShrivelCounterUnlessPaysEffect copy() { + return new SpellShrivelCounterUnlessPaysEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source)); + MageObject sourceObject = source.getSourceObject(game); + if (spell != null && (spell instanceof Spell) && sourceObject != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int amount = 4; + if (amount > 0) { + GenericManaCost cost = new GenericManaCost(amount); + if (!cost.pay(source, game, spell.getControllerId(), spell.getControllerId(), false)) { + StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); + if (stackObject != null && !game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, source.getFirstTarget(), source.getSourceId(), stackObject.getControllerId()))) { + game.informPlayers(sourceObject.getIdName() + ": cost wasn't payed - countering " + stackObject.getName()); + game.rememberLKI(source.getFirstTarget(), Zone.STACK, (Spell) stackObject); + controller.moveCards((Spell) spell, null, Zone.EXILED, source, game); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, source.getFirstTarget(), source.getSourceId(), stackObject.getControllerId())); + return true; + } + return false; + } + } + } + } + return false; + } + + @Override + public String getText(Mode mode) { + return "Counter target spell unless its controller pays {4}. If that spell is countered this way, exile it instead of putting it into its owner's graveyard"; + } + +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/StasisSnare.java b/Mage.Sets/src/mage/sets/battleforzendikar/StasisSnare.java new file mode 100644 index 00000000000..ac6704bb5cd --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/StasisSnare.java @@ -0,0 +1,112 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; +import mage.util.CardUtil; + +/** + * + * @author fireshoes + */ +public class StasisSnare extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public StasisSnare(UUID ownerId) { + super(ownerId, 50, "Stasis Snare", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); + this.expansionSetCode = "BFZ"; + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // When Stasis Snare enters the battlefield, exile target creature an opponent controls until Stasis Snare leaves the battlefield. + Ability ability = new EntersBattlefieldTriggeredAbility(new StasisSnareExileEffect()); + ability.addTarget(new TargetCreaturePermanent(filter)); + ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility())); + this.addAbility(ability); + } + + public StasisSnare(final StasisSnare card) { + super(card); + } + + @Override + public StasisSnare copy() { + return new StasisSnare(this); + } +} + +class StasisSnareExileEffect extends OneShotEffect { + + public StasisSnareExileEffect() { + super(Outcome.Benefit); + this.staticText = "exile target creature an opponent controls until Stasis Snare leaves the battlefield"; + } + + public StasisSnareExileEffect(final StasisSnareExileEffect effect) { + super(effect); + } + + @Override + public StasisSnareExileEffect copy() { + return new StasisSnareExileEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + // If Stasis Snare leaves the battlefield before its triggered ability resolves, + // the target won't be exiled. + if (permanent != null) { + return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/StoneHavenMedic.java b/Mage.Sets/src/mage/sets/battleforzendikar/StoneHavenMedic.java new file mode 100644 index 00000000000..1395376edab --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/StoneHavenMedic.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class StoneHavenMedic extends CardImpl { + + public StoneHavenMedic(UUID ownerId) { + super(ownerId, 51, "Stone Haven Medic", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Kor"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // {W}, {T}: You gain 1 life. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new ManaCostsImpl("{W}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public StoneHavenMedic(final StoneHavenMedic card) { + super(card); + } + + @Override + public StoneHavenMedic copy() { + return new StoneHavenMedic(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Stonefury.java b/Mage.Sets/src/mage/sets/battleforzendikar/Stonefury.java new file mode 100644 index 00000000000..8c58f9e9520 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Stonefury.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledLandPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class Stonefury extends CardImpl { + + public Stonefury(UUID ownerId) { + super(ownerId, 156, "Stonefury", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{R}{R}"); + this.expansionSetCode = "BFZ"; + + // Stonefury deals damage to target creature equal to the number of lands you control. + Effect effect = new DamageTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledLandPermanent("the number of lands you control"))); + effect.setText("{this} deals damage to target creature equal to the number of lands you control"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public Stonefury(final Stonefury card) { + super(card); + } + + @Override + public Stonefury copy() { + return new Stonefury(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SunkenHollow.java b/Mage.Sets/src/mage/sets/battleforzendikar/SunkenHollow.java new file mode 100644 index 00000000000..0f9edc0a55a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SunkenHollow.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.abilities.mana.BlueManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class SunkenHollow extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public SunkenHollow(UUID ownerId) { + super(ownerId, 249, "Sunken Hollow", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Island"); + this.subtype.add("Swamp"); + + // Sunken Hollow enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlueManaAbility()); + this.addAbility(new BlackManaAbility()); + } + + public SunkenHollow(final SunkenHollow card) { + super(card); + } + + @Override + public SunkenHollow copy() { + return new SunkenHollow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SureStrike.java b/Mage.Sets/src/mage/sets/battleforzendikar/SureStrike.java new file mode 100644 index 00000000000..be9007a33d4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SureStrike.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class SureStrike extends CardImpl { + + public SureStrike(UUID ownerId) { + super(ownerId, 157, "Sure Strike", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "BFZ"; + + // Target creature gets +3/+0 and gains first strike until end of turn. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + Effect effect = new BoostTargetEffect(3, 0, Duration.EndOfTurn); + effect.setText("Target creature gets +3/+0"); + this.getSpellAbility().addEffect(effect); + effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains first strike until end of turn"); + this.getSpellAbility().addEffect(effect); + } + + public SureStrike(final SureStrike card) { + super(card); + } + + @Override + public SureStrike copy() { + return new SureStrike(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp1.java new file mode 100644 index 00000000000..bea737b3749 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp1 extends mage.cards.basiclands.Swamp { + + public Swamp1(UUID ownerId) { + super(ownerId, 260); + this.expansionSetCode = "BFZ"; + } + + public Swamp1(final Swamp1 card) { + super(card); + } + + @Override + public Swamp1 copy() { + return new Swamp1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp2.java new file mode 100644 index 00000000000..0436899d9cd --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp2 extends mage.cards.basiclands.Swamp { + + public Swamp2(UUID ownerId) { + super(ownerId, 261); + this.expansionSetCode = "BFZ"; + } + + public Swamp2(final Swamp2 card) { + super(card); + } + + @Override + public Swamp2 copy() { + return new Swamp2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp3.java new file mode 100644 index 00000000000..4bceb8a424f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp3 extends mage.cards.basiclands.Swamp { + + public Swamp3(UUID ownerId) { + super(ownerId, 262); + this.expansionSetCode = "BFZ"; + } + + public Swamp3(final Swamp3 card) { + super(card); + } + + @Override + public Swamp3 copy() { + return new Swamp3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp4.java new file mode 100644 index 00000000000..87bd2b49c77 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp4 extends mage.cards.basiclands.Swamp { + + public Swamp4(UUID ownerId) { + super(ownerId, 263); + this.expansionSetCode = "BFZ"; + } + + public Swamp4(final Swamp4 card) { + super(card); + } + + @Override + public Swamp4 copy() { + return new Swamp4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp5.java new file mode 100644 index 00000000000..b2ebc6e3935 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp5 extends mage.cards.basiclands.Swamp { + + public Swamp5(UUID ownerId) { + super(ownerId, 264); + this.expansionSetCode = "BFZ"; + } + + public Swamp5(final Swamp5 card) { + super(card); + } + + @Override + public Swamp5 copy() { + return new Swamp5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SwarmSurge.java b/Mage.Sets/src/mage/sets/battleforzendikar/SwarmSurge.java new file mode 100644 index 00000000000..4c86dffec66 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SwarmSurge.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; + +/** + * + * @author LevelX2 + */ +public class SwarmSurge extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Colorless creatures you control"); + + static { + filter.add(new ColorlessPredicate()); + } + + public SwarmSurge(UUID ownerId) { + super(ownerId, 100, "Swarm Surge", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + + // Creatures you control get +2/+0 until end of turn. + this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Duration.EndOfTurn)); + + // Colorless creatures you control also gain first strike until end of turn. + Effect effect = new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, filter); + effect.setText("Colorless creatures you control also gain first strike until end of turn"); + this.getSpellAbility().addEffect(effect); + } + + public SwarmSurge(final SwarmSurge card) { + super(card); + } + + @Override + public SwarmSurge copy() { + return new SwarmSurge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SwellOfGrowth.java b/Mage.Sets/src/mage/sets/battleforzendikar/SwellOfGrowth.java new file mode 100644 index 00000000000..21da131ea05 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SwellOfGrowth.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.PutLandFromHandOntoBattlefieldEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class SwellOfGrowth extends CardImpl { + + public SwellOfGrowth(UUID ownerId) { + super(ownerId, 191, "Swell of Growth", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "BFZ"; + + // Target creature gets +2/+2 until end of turn. You may put a land card from your hand onto the battlefield. + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new PutLandFromHandOntoBattlefieldEffect()); + } + + public SwellOfGrowth(final SwellOfGrowth card) { + super(card); + } + + @Override + public SwellOfGrowth copy() { + return new SwellOfGrowth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SylvanScrying.java b/Mage.Sets/src/mage/sets/battleforzendikar/SylvanScrying.java new file mode 100644 index 00000000000..c583cbf1f46 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SylvanScrying.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SylvanScrying extends mage.sets.tenthedition.SylvanScrying { + + public SylvanScrying(UUID ownerId) { + super(ownerId); + this.cardNumber = 192; + this.expansionSetCode = "BFZ"; + } + + public SylvanScrying(final SylvanScrying card) { + super(card); + } + + @Override + public SylvanScrying copy() { + return new SylvanScrying(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/TajuruBeastmaster.java b/Mage.Sets/src/mage/sets/battleforzendikar/TajuruBeastmaster.java new file mode 100644 index 00000000000..a73c8265b5e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/TajuruBeastmaster.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class TajuruBeastmaster extends CardImpl { + + public TajuruBeastmaster(UUID ownerId) { + super(ownerId, 193, "Tajuru Beastmaster", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elf"); + this.subtype.add("Warrior"); + this.subtype.add("Ally"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Rally - Whenever Tajuru Beastmaster or another Ally creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn. + this.addAbility(new AllyEntersBattlefieldTriggeredAbility(new BoostControlledEffect(1, 1, Duration.EndOfTurn), false)); + } + + public TajuruBeastmaster(final TajuruBeastmaster card) { + super(card); + } + + @Override + public TajuruBeastmaster copy() { + return new TajuruBeastmaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/TajuruStalwart.java b/Mage.Sets/src/mage/sets/battleforzendikar/TajuruStalwart.java new file mode 100644 index 00000000000..73947b4132e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/TajuruStalwart.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LevelX2 + */ +public class TajuruStalwart extends CardImpl { + + public TajuruStalwart(UUID ownerId) { + super(ownerId, 194, "Tajuru Stalwart", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elf"); + this.subtype.add("Scout"); + this.subtype.add("Ally"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // Converge - Tajuru Stalwart enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it. + this.addAbility(new EntersBattlefieldAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance(), ColorsOfManaSpentToCastCount.getInstance(), true), + null, "Converge - {this} enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.", null)); + + } + + public TajuruStalwart(final TajuruStalwart card) { + super(card); + } + + @Override + public TajuruStalwart copy() { + return new TajuruStalwart(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/TajuruWarcaller.java b/Mage.Sets/src/mage/sets/battleforzendikar/TajuruWarcaller.java new file mode 100644 index 00000000000..ea6a0665eed --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/TajuruWarcaller.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class TajuruWarcaller extends CardImpl { + + public TajuruWarcaller(UUID ownerId) { + super(ownerId, 195, "Tajuru Warcaller", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elf"); + this.subtype.add("Warrior"); + this.subtype.add("Ally"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Rally-Whenever Tajuru Warcaller or another Ally enters the battlefield under your control, creatures you control get +2/+2 until end of turn. + this.addAbility(new AllyEntersBattlefieldTriggeredAbility(new BoostControlledEffect(2, 2, Duration.EndOfTurn), false)); + } + + public TajuruWarcaller(final TajuruWarcaller card) { + super(card); + } + + @Override + public TajuruWarcaller copy() { + return new TajuruWarcaller(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/TandemTactics.java b/Mage.Sets/src/mage/sets/battleforzendikar/TandemTactics.java new file mode 100644 index 00000000000..d766749c509 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/TandemTactics.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class TandemTactics extends CardImpl { + + public TandemTactics(UUID ownerId) { + super(ownerId, 52, "Tandem Tactics", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + + // Up to two target creatures each get +1/+2 until end of turn. You gain 2 life. + Effect effect = new BoostTargetEffect(1, 2, Duration.EndOfTurn); + effect.setText("Up to two target creatures each get +1/+2 until end of turn"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); + this.getSpellAbility().addEffect(new GainLifeEffect(2)); + } + + public TandemTactics(final TandemTactics card) { + super(card); + } + + @Override + public TandemTactics copy() { + return new TandemTactics(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/TerritorialBaloth.java b/Mage.Sets/src/mage/sets/battleforzendikar/TerritorialBaloth.java new file mode 100644 index 00000000000..11c2e194b31 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/TerritorialBaloth.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class TerritorialBaloth extends mage.sets.zendikar.TerritorialBaloth { + + public TerritorialBaloth(UUID ownerId) { + super(ownerId); + this.cardNumber = 196; + this.expansionSetCode = "BFZ"; + } + + public TerritorialBaloth(final TerritorialBaloth card) { + super(card); + } + + @Override + public TerritorialBaloth copy() { + return new TerritorialBaloth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/TideDrifter.java b/Mage.Sets/src/mage/sets/battleforzendikar/TideDrifter.java new file mode 100644 index 00000000000..43dcbe4827d --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/TideDrifter.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; + +/** + * + * @author LevelX2 + */ +public class TideDrifter extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Other colorless creatures you control"); + + static { + filter.add(new ColorlessPredicate()); + } + + public TideDrifter(UUID ownerId) { + super(ownerId, 67, "Tide Drifter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(0); + this.toughness = new MageInt(5); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // Other colorless creatures you control get +0/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 1, Duration.WhileOnBattlefield, filter, true))); + + } + + public TideDrifter(final TideDrifter card) { + super(card); + } + + @Override + public TideDrifter copy() { + return new TideDrifter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/TighteningCoils.java b/Mage.Sets/src/mage/sets/battleforzendikar/TighteningCoils.java new file mode 100644 index 00000000000..229c632b796 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/TighteningCoils.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.LoseAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class TighteningCoils extends CardImpl { + + public TighteningCoils(UUID ownerId) { + super(ownerId, 86, "Tightening Coils", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets -6/-0 and loses flying. + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(-6, 0, Duration.WhileOnBattlefield)); + Effect effect = new LoseAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA); + effect.setText("and loses flying"); + ability.addEffect(effect); + this.addAbility(ability); + + } + + public TighteningCoils(final TighteningCoils card) { + super(card); + } + + @Override + public TighteningCoils copy() { + return new TighteningCoils(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/TitansPresence.java b/Mage.Sets/src/mage/sets/battleforzendikar/TitansPresence.java new file mode 100644 index 00000000000..e9910dbcd65 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/TitansPresence.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.common.RevealTargetFromHandCost; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class TitansPresence extends CardImpl { + + private static final FilterCreatureCard filter = new FilterCreatureCard("a colorless creature card from your hand"); + + static { + filter.add(new ColorlessPredicate()); + } + + public TitansPresence(UUID ownerId) { + super(ownerId, 14, "Titan's Presence", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}"); + this.expansionSetCode = "BFZ"; + + // As an additional cost to cast Titan's Presence, reveal a colorless creature card from your hand. + this.getSpellAbility().addCost(new RevealTargetFromHandCost(new TargetCardInHand(filter))); + + // Exile target creature if its power is less than or equal to the revealed card's power. + this.getSpellAbility().addEffect(new TitansPresenceEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public TitansPresence(final TitansPresence card) { + super(card); + } + + @Override + public TitansPresence copy() { + return new TitansPresence(this); + } +} + +class TitansPresenceEffect extends OneShotEffect { + + public TitansPresenceEffect() { + super(Outcome.Exile); + staticText = "Exile target creature if its power is less than or equal to the revealed card's power"; + } + + public TitansPresenceEffect(TitansPresenceEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + RevealTargetFromHandCost cost = (RevealTargetFromHandCost) source.getCosts().get(0); + Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + if (cost != null && creature != null && controller != null) { + List revealedCards = cost.getRevealedCards(); + if (!revealedCards.isEmpty()) { + Card card = revealedCards.iterator().next(); + if (card != null && card.getPower().getValue() >= creature.getPower().getValue()) { + controller.moveCards(creature, null, Zone.EXILED, source, game); + } + } + return true; + } + return false; + } + + @Override + public TitansPresenceEffect copy() { + return new TitansPresenceEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/TouchOfTheVoid.java b/Mage.Sets/src/mage/sets/battleforzendikar/TouchOfTheVoid.java new file mode 100644 index 00000000000..3ade709aaba --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/TouchOfTheVoid.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.replacement.DealtDamageToCreatureBySourceDies; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; +import mage.watchers.common.DamagedByWatcher; + +/** + * + * @author LevelX2 + */ +public class TouchOfTheVoid extends CardImpl { + + public TouchOfTheVoid(UUID ownerId) { + super(ownerId, 134, "Touch of the Void", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{R}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Touch of the Void deals 3 damage to target creature or player. If a creature dealt damage this way would die this turn, exile it instead. + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + Effect effect = new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn); + effect.setText("If a creature dealt damage this way would die this turn, exile it instead"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addWatcher(new DamagedByWatcher()); + } + + public TouchOfTheVoid(final TouchOfTheVoid card) { + super(card); + } + + @Override + public TouchOfTheVoid copy() { + return new TouchOfTheVoid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/TransgressTheMind.java b/Mage.Sets/src/mage/sets/battleforzendikar/TransgressTheMind.java new file mode 100644 index 00000000000..aaaef82e6cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/TransgressTheMind.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ExileCardYouChooseTargetOpponentEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class TransgressTheMind extends CardImpl { + + private static final FilterCard filter = new FilterCard("a card from it with converted mana cost 3 or greater"); + + static { + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.GreaterThan, 2)); + } + + public TransgressTheMind(UUID ownerId) { + super(ownerId, 101, "Transgress the Mind", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{B}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + + // Target player reveals his or her hand. You may choose a card from it with converted mana cost 3 or greater and exile that card. + Effect effect = new ExileCardYouChooseTargetOpponentEffect(filter); + effect.setText("Target player reveals his or her hand. You may choose a card from it with converted mana cost 3 or greater and exile that card"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + public TransgressTheMind(final TransgressTheMind card) { + super(card); + } + + @Override + public TransgressTheMind copy() { + return new TransgressTheMind(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/TunnelingGeopede.java b/Mage.Sets/src/mage/sets/battleforzendikar/TunnelingGeopede.java new file mode 100644 index 00000000000..c93253bcf38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/TunnelingGeopede.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LevelX2 + */ +public class TunnelingGeopede extends CardImpl { + + public TunnelingGeopede(UUID ownerId) { + super(ownerId, 158, "Tunneling Geopede", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Insect"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Landfall - Whenever a land enters the battlefield under your control, Tunneling Geopede deals 1 damage to each opponent. + this.addAbility(new LandfallAbility(new DamagePlayersEffect(1, TargetController.OPPONENT), false)); + } + + public TunnelingGeopede(final TunnelingGeopede card) { + super(card); + } + + @Override + public TunnelingGeopede copy() { + return new TunnelingGeopede(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/TurnAgainst.java b/Mage.Sets/src/mage/sets/battleforzendikar/TurnAgainst.java new file mode 100644 index 00000000000..50defaa5d03 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/TurnAgainst.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class TurnAgainst extends CardImpl { + + public TurnAgainst(UUID ownerId) { + super(ownerId, 135, "Turn Against", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{R}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new UntapTargetEffect()); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); + } + + public TurnAgainst(final TurnAgainst card) { + super(card); + } + + @Override + public TurnAgainst copy() { + return new TurnAgainst(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/UginsInsight.java b/Mage.Sets/src/mage/sets/battleforzendikar/UginsInsight.java new file mode 100644 index 00000000000..97e768c1c32 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/UginsInsight.java @@ -0,0 +1,94 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.HighestConvertedManaCostValue; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class UginsInsight extends CardImpl { + + public UginsInsight(UUID ownerId) { + super(ownerId, 87, "Ugin's Insight", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); + this.expansionSetCode = "BFZ"; + + // Scry X, where X is the highest converted mana cost among permanents you control, then draw three cards. + this.getSpellAbility().addEffect(new UginsInsightEffect()); + } + + public UginsInsight(final UginsInsight card) { + super(card); + } + + @Override + public UginsInsight copy() { + return new UginsInsight(this); + } +} + +class UginsInsightEffect extends OneShotEffect { + + public UginsInsightEffect() { + super(Outcome.DrawCard); + this.staticText = "Scry X, where X is the highest converted mana cost among permanents you control, then draw three cards"; + } + + public UginsInsightEffect(final UginsInsightEffect effect) { + super(effect); + } + + @Override + public UginsInsightEffect copy() { + return new UginsInsightEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int highCMC = new HighestConvertedManaCostValue().calculate(game, source, this); + if (highCMC > 0) { + controller.scry(highCMC, source, game); + } + controller.drawCards(3, game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/UlamogTheCeaselessHunger.java b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogTheCeaselessHunger.java new file mode 100644 index 00000000000..038df1a77e9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogTheCeaselessHunger.java @@ -0,0 +1,193 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class UlamogTheCeaselessHunger extends CardImpl { + + public UlamogTheCeaselessHunger(UUID ownerId) { + super(ownerId, 15, "Ulamog, the Ceaseless Hunger", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{10}"); + this.expansionSetCode = "BFZ"; + this.supertype.add("Legendary"); + this.subtype.add("Eldrazi"); + this.power = new MageInt(10); + this.toughness = new MageInt(10); + + // When you cast Ulamog, the Ceaseless Hunger, exile two target permanents. + this.addAbility(new UlamogExilePermanentsOnCastAbility()); + + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + + // Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library. + Effect effect = new UlamogExileLibraryEffect(); + effect.setText("defending player exiles the top twenty cards of his or her library"); + this.addAbility(new UlamogAttackTriggeredAbility(effect)); + } + + public UlamogTheCeaselessHunger(final UlamogTheCeaselessHunger card) { + super(card); + } + + @Override + public UlamogTheCeaselessHunger copy() { + return new UlamogTheCeaselessHunger(this); + } +} + +class UlamogExilePermanentsOnCastAbility extends TriggeredAbilityImpl { + + UlamogExilePermanentsOnCastAbility() { + super(Zone.STACK, new ExileTargetEffect("exile two target permanents")); + this.addTarget(new TargetPermanent(2, new FilterPermanent())); + } + + UlamogExilePermanentsOnCastAbility(UlamogExilePermanentsOnCastAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Spell spell = (Spell) game.getObject(event.getTargetId()); + return this.getSourceId().equals(spell.getSourceId()); + } + + @Override + public UlamogExilePermanentsOnCastAbility copy() { + return new UlamogExilePermanentsOnCastAbility(this); + } + + @Override + public String getRule() { + return "When you cast {this}, " + super.getRule(); + } +} + +class UlamogAttackTriggeredAbility extends TriggeredAbilityImpl { + + public UlamogAttackTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + } + + public UlamogAttackTriggeredAbility(final UlamogAttackTriggeredAbility ability) { + super(ability); + } + + @Override + public UlamogAttackTriggeredAbility copy() { + return new UlamogAttackTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent sourcePermanent = game.getPermanent(this.getSourceId()); + if (sourcePermanent != null + && event.getSourceId() != null + && event.getSourceId().equals(this.getSourceId())) { + UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game); + this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); + return true; + } + return false; + } + + @Override + public String getRule() { + return new StringBuilder("Whenever {this} attacks, ").append(super.getRule()).toString(); + } +} + +class UlamogExileLibraryEffect extends OneShotEffect { + + public UlamogExileLibraryEffect() { + super(Outcome.Exile); + this.staticText = "defending player exiles the top twenty cards of his or her library"; + } + + public UlamogExileLibraryEffect(final UlamogExileLibraryEffect effect) { + super(effect); + } + + @Override + public UlamogExileLibraryEffect copy() { + return new UlamogExileLibraryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player defender = game.getPlayer(targetPointer.getFirst(game, source)); + if (defender != null) { + int count = Math.min(defender.getLibrary().size(), 20); + for (int i = 0; i < count; i++) { + Card card = defender.getLibrary().removeFromTop(game); + if (card != null) { + card.moveToExile(null, null, source.getSourceId(), game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsDespoiler.java b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsDespoiler.java new file mode 100644 index 00000000000..bcf90209c59 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsDespoiler.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.FilterCard; +import mage.filter.predicate.other.OwnerPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInExile; + +/** + * + * @author LevelX2 + */ +public class UlamogsDespoiler extends CardImpl { + + public UlamogsDespoiler(UUID ownerId) { + super(ownerId, 16, "Ulamog's Despoiler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{6}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Processor"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // As Ulamog's Despoiler enters the battlefield, you may put two cards your opponents own from exile into their owners' graveyards. If you do, Ulamog's Despoiler enters the battlefield with four +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new UlamogsDespoilerEffect(), null, + "As {this} enters the battlefield, you may put two cards your opponents own from exile into their owners' graveyards. If you do, {this} enters the battlefield with four +1/+1 counters on it", null)); + } + + public UlamogsDespoiler(final UlamogsDespoiler card) { + super(card); + } + + @Override + public UlamogsDespoiler copy() { + return new UlamogsDespoiler(this); + } +} + +class UlamogsDespoilerEffect extends OneShotEffect { + + private final static FilterCard filter = new FilterCard("cards your opponents own from exile"); + + static { + filter.add(new OwnerPredicate(TargetController.OPPONENT)); + } + + public UlamogsDespoilerEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "you may put two cards your opponents own from exile into their owners' graveyards. If you do, {this} enters the battlefield with four +1/+1 counters on it"; + } + + public UlamogsDespoilerEffect(final UlamogsDespoilerEffect effect) { + super(effect); + } + + @Override + public UlamogsDespoilerEffect copy() { + return new UlamogsDespoilerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Target target = new TargetCardInExile(2, 2, filter, null); + if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { + if (controller.chooseTarget(outcome, target, source, game)) { + Cards cardsToGraveyard = new CardsImpl(target.getTargets()); + controller.moveCards(cardsToGraveyard, null, Zone.GRAVEYARD, source, game); + return new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)).apply(game, source); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsNullifier.java b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsNullifier.java new file mode 100644 index 00000000000..dcdff1c328f --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsNullifier.java @@ -0,0 +1,134 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.FlashAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.other.OwnerPredicate; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetSpell; +import mage.target.common.TargetCardInExile; + +/** + * + * @author fireshoes + */ +public class UlamogsNullifier extends CardImpl { + + public UlamogsNullifier(UUID ownerId) { + super(ownerId, 207, "Ulamog's Nullifier", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Processor"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Ulamog's Nullifier enters the battlefield, you may put two cards your opponents own + // from exile into their owners' graveyards. If you do, counter target spell. + Ability ability = new EntersBattlefieldTriggeredAbility(new UlamogsNullifierEffect(), true); + ability.addTarget(new TargetSpell()); + this.addAbility(ability); + } + + public UlamogsNullifier(final UlamogsNullifier card) { + super(card); + } + + @Override + public UlamogsNullifier copy() { + return new UlamogsNullifier(this); + } +} + +class UlamogsNullifierEffect extends OneShotEffect { + + private final static FilterCard filter = new FilterCard("cards your opponents own from exile"); + + static { + filter.add(new OwnerPredicate(TargetController.OPPONENT)); + } + + public UlamogsNullifierEffect() { + super(Outcome.Benefit); + this.staticText = "you may put two cards your opponents own from exile into their owners' graveyards. If you do, counter target spell."; + } + + public UlamogsNullifierEffect(final UlamogsNullifierEffect effect) { + super(effect); + } + + @Override + public UlamogsNullifierEffect copy() { + return new UlamogsNullifierEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Spell spell = game.getStack().getSpell(source.getFirstTarget()); + if (controller != null && spell != null) { + Target target = new TargetCardInExile(2, 2, filter, null); + if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { + if (controller.chooseTarget(outcome, target, source, game)) { + Cards cardsToGraveyard = new CardsImpl(target.getTargets()); + controller.moveCards(cardsToGraveyard, null, Zone.GRAVEYARD, source, game); + game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsReclaimer.java b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsReclaimer.java new file mode 100644 index 00000000000..5d9788b7724 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsReclaimer.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.ExileOpponentsCardFromExileToGraveyardCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterInstantOrSorceryCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LevelX2 + */ +public class UlamogsReclaimer extends CardImpl { + + public UlamogsReclaimer(UUID ownerId) { + super(ownerId, 68, "Ulamog's Reclaimer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Processor"); + this.power = new MageInt(2); + this.toughness = new MageInt(5); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // When Ulamog's Reclaimer enters the battlefield, you may put a card an opponent owns from exile into that player's graveyard. If you do, return target instant or sorcery card from your graveyard to your hand. + Ability ability = new EntersBattlefieldTriggeredAbility( + new DoIfCostPaid(new ReturnFromGraveyardToHandTargetEffect(), new ExileOpponentsCardFromExileToGraveyardCost(true)), true); + ability.addTarget(new TargetCardInYourGraveyard(new FilterInstantOrSorceryCard("instant or sorcery card from your graveyard"))); + this.addAbility(ability); + } + + public UlamogsReclaimer(final UlamogsReclaimer card) { + super(card); + } + + @Override + public UlamogsReclaimer copy() { + return new UlamogsReclaimer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/UndergrowthChampion.java b/Mage.Sets/src/mage/sets/battleforzendikar/UndergrowthChampion.java new file mode 100644 index 00000000000..504b6eec6a6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/UndergrowthChampion.java @@ -0,0 +1,144 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.LandfallAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.turn.Step; + +/** + * + * @author fireshoes + */ +public class UndergrowthChampion extends CardImpl { + + public UndergrowthChampion(UUID ownerId) { + super(ownerId, 197, "Undergrowth Champion", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elemental"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // If damage would be dealt to Undergrowth Champion while it has a +1/+1 counter on it, prevent that damage and remove a +1/+1 counter from Undergrowth Champion. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new UndergrowthChampionPreventionEffect())); + + // Landfall-Whenever a land enters the battlefield under your control, put a +1/+1 counter on Undergrowth Champion. + this.addAbility(new LandfallAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); + } + + public UndergrowthChampion(final UndergrowthChampion card) { + super(card); + } + + @Override + public UndergrowthChampion copy() { + return new UndergrowthChampion(this); + } +} + +class UndergrowthChampionPreventionEffect extends PreventionEffectImpl { + + // remember turn and phase step to check if counter in this step was already removed + private int turn = 0; + private Step combatPhaseStep = null; + + public UndergrowthChampionPreventionEffect() { + super(Duration.WhileOnBattlefield); + staticText = "If damage would be dealt to {this} while it has a +1/+1 counter on it, prevent that damage and remove a +1/+1 counter from {this}"; + } + + public UndergrowthChampionPreventionEffect(final UndergrowthChampionPreventionEffect effect) { + super(effect); + this.turn = effect.turn; + this.combatPhaseStep = effect.combatPhaseStep; + } + + @Override + public UndergrowthChampionPreventionEffect copy() { + return new UndergrowthChampionPreventionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + boolean removeCounter = true; + // check if in the same combat damage step already a counter was removed + if (game.getTurn().getPhase().getStep().getType().equals(PhaseStep.COMBAT_DAMAGE)) { + if (game.getTurnNum() == turn + && game.getTurn().getStep().equals(combatPhaseStep)) { + removeCounter = false; + } else { + turn = game.getTurnNum(); + combatPhaseStep = game.getTurn().getStep(); + } + } + + if(removeCounter && permanent.getCounters().containsKey(CounterType.P1P1)) { + preventDamageAction(event, source, game); + StringBuilder sb = new StringBuilder(permanent.getName()).append(": "); + permanent.removeCounters(CounterType.P1P1.createInstance(), game); + sb.append("Removed a +1/+1 counter "); + game.informPlayers(sb.toString()); + } + } + + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (super.applies(event, source, game)) { + if (event.getTargetId().equals(source.getSourceId())) { + return true; + } + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/UnifiedFront.java b/Mage.Sets/src/mage/sets/battleforzendikar/UnifiedFront.java new file mode 100644 index 00000000000..a80690b6504 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/UnifiedFront.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class UnifiedFront extends CardImpl { + + public UnifiedFront(UUID ownerId) { + super(ownerId, 53, "Unified Front", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{W}"); + this.expansionSetCode = "BFZ"; + + // Converge — Put a 1/1 white Kor Ally creature token onto the battlefield for each color of mana spent to cast Unified Front. + getSpellAbility().setAbilityWord(AbilityWord.CONVERGE); + Effect effect = new CreateTokenEffect(new KorAllyToken(), ColorsOfManaSpentToCastCount.getInstance()); + effect.setText("Put a 1/1 white Kor Ally creature token onto the battlefield for each color of mana spent to cast {this}"); + getSpellAbility().addEffect(effect); + } + + public UnifiedFront(final UnifiedFront card) { + super(card); + } + + @Override + public UnifiedFront copy() { + return new UnifiedFront(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/UnnaturalAggression.java b/Mage.Sets/src/mage/sets/battleforzendikar/UnnaturalAggression.java new file mode 100644 index 00000000000..2bc63e6feed --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/UnnaturalAggression.java @@ -0,0 +1,145 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.FightTargetsEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class UnnaturalAggression extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public UnnaturalAggression(UUID ownerId) { + super(ownerId, 168, "Unnatural Aggression", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); + this.expansionSetCode = "BFZ"; + + // Devoid + Ability ability = new DevoidAbility(this.color); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Target creature you control fights target creature an opponent controls. + this.getSpellAbility().addEffect(new FightTargetsEffect()); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + // If the creature an opponent controls would die this turn, exile it instead. + this.getSpellAbility().addEffect(new DealtDamageToOpponentsCreatureDiesEffect(Duration.EndOfTurn)); + } + + public UnnaturalAggression(final UnnaturalAggression card) { + super(card); + } + + @Override + public UnnaturalAggression copy() { + return new UnnaturalAggression(this); + } +} + +class DealtDamageToOpponentsCreatureDiesEffect extends ReplacementEffectImpl { + + public DealtDamageToOpponentsCreatureDiesEffect(Duration duration) { + super(Duration.EndOfTurn, Outcome.Exile); + staticText = "If the creature an opponent controls would die this turn, exile it instead"; + } + + public DealtDamageToOpponentsCreatureDiesEffect(final DealtDamageToOpponentsCreatureDiesEffect effect) { + super(effect); + } + + @Override + public DealtDamageToOpponentsCreatureDiesEffect copy() { + return new DealtDamageToOpponentsCreatureDiesEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public void init(Ability source, Game game) { + super.init(source, game); + Permanent opponentCreature = game.getPermanent(source.getTargets().get(1).getFirstTarget()); + if (opponentCreature != null) { + this.setTargetPointer(new FixedTarget(opponentCreature, game)); + } else { + discard(); + } + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent permanent = ((ZoneChangeEvent) event).getTarget(); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null && permanent != null) { + return controller.moveCards(permanent, null, Zone.EXILED, source, game); + } + return false; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + ZoneChangeEvent zce = (ZoneChangeEvent) event; + return zce.isDiesEvent() && zce.getTargetId().equals(getTargetPointer().getFirst(game, source)); + } + +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ValakutInvoker.java b/Mage.Sets/src/mage/sets/battleforzendikar/ValakutInvoker.java new file mode 100644 index 00000000000..e974588fa5e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ValakutInvoker.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LevelX2 + */ +public class ValakutInvoker extends CardImpl { + + public ValakutInvoker(UUID ownerId) { + super(ownerId, 159, "Valakut Invoker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {8}: Valakut Invoker deals 3 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3), new GenericManaCost(8)); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public ValakutInvoker(final ValakutInvoker card) { + super(card); + } + + @Override + public ValakutInvoker copy() { + return new ValakutInvoker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ValakutPredator.java b/Mage.Sets/src/mage/sets/battleforzendikar/ValakutPredator.java new file mode 100644 index 00000000000..21e53fa69eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ValakutPredator.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class ValakutPredator extends CardImpl { + + public ValakutPredator(UUID ownerId) { + super(ownerId, 160, "Valakut Predator", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elemental"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Landfall - Whenever a land enters the battlefield under your control, Valakut Predator gets +2/+2 until end of turn. + this.addAbility(new LandfallAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false)); + } + + public ValakutPredator(final ValakutPredator card) { + super(card); + } + + @Override + public ValakutPredator copy() { + return new ValakutPredator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/VampiricRites.java b/Mage.Sets/src/mage/sets/battleforzendikar/VampiricRites.java new file mode 100644 index 00000000000..349e6d21773 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/VampiricRites.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class VampiricRites extends CardImpl { + + public VampiricRites(UUID ownerId) { + super(ownerId, 124, "Vampiric Rites", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); + this.expansionSetCode = "BFZ"; + + // {1}{B}, Sacrifice a creature: You gain 1 life and draw a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new ManaCostsImpl<>("{1}{B}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + Effect effect = new DrawCardSourceControllerEffect(1); + effect.setText("and draw a card"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public VampiricRites(final VampiricRites card) { + super(card); + } + + @Override + public VampiricRites copy() { + return new VampiricRites(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/VestigeOfEmrakul.java b/Mage.Sets/src/mage/sets/battleforzendikar/VestigeOfEmrakul.java new file mode 100644 index 00000000000..3f49bcfc75c --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/VestigeOfEmrakul.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class VestigeOfEmrakul extends CardImpl { + + public VestigeOfEmrakul(UUID ownerId) { + super(ownerId, 136, "Vestige of Emrakul", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // Trample + this.addAbility(TrampleAbility.getInstance()); + } + + public VestigeOfEmrakul(final VestigeOfEmrakul card) { + super(card); + } + + @Override + public VestigeOfEmrakul copy() { + return new VestigeOfEmrakul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/VeteranWarleader.java b/Mage.Sets/src/mage/sets/battleforzendikar/VeteranWarleader.java new file mode 100644 index 00000000000..e46455b6092 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/VeteranWarleader.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class VeteranWarleader extends mage.sets.zendikarvseldrazi.VeteranWarleader { + + public VeteranWarleader(UUID ownerId) { + super(ownerId); + this.cardNumber = 221; + this.expansionSetCode = "BFZ"; + } + + public VeteranWarleader(final VeteranWarleader card) { + super(card); + } + + @Override + public VeteranWarleader copy() { + return new VeteranWarleader(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/VileAggregate.java b/Mage.Sets/src/mage/sets/battleforzendikar/VileAggregate.java new file mode 100644 index 00000000000..60d925eb737 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/VileAggregate.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.IngestAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; + +/** + * + * @author LevelX2 + */ +public class VileAggregate extends CardImpl { + + private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("colorless creatures you control"); + + static { + filter.add(new ColorlessPredicate()); + } + + public VileAggregate(UUID ownerId) { + super(ownerId, 137, "Vile Aggregate", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(0); + this.toughness = new MageInt(5); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + // Vile Aggregate's power is equal to the number of colorless creatures you control. + Effect effect = new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame); + this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Ingest + this.addAbility(new IngestAbility()); + } + + public VileAggregate(final VileAggregate card) { + super(card); + } + + @Override + public VileAggregate copy() { + return new VileAggregate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/VoidAttendant.java b/Mage.Sets/src/mage/sets/battleforzendikar/VoidAttendant.java new file mode 100644 index 00000000000..44baa72841d --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/VoidAttendant.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileOpponentsCardFromExileToGraveyardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.EldraziScionToken; + +/** + * + * @author LevelX2 + */ +public class VoidAttendant extends CardImpl { + + public VoidAttendant(UUID ownerId) { + super(ownerId, 169, "Void Attendant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Processor"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // {1}{G}, Put a card an opponent owns from exile into that player's graveyard: Put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + Effect effect = new CreateTokenEffect(new EldraziScionToken()); + effect.setText("put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has \"Sacrifice this creature: Add {1} to your mana pool.\""); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{G}")); + ability.addCost(new ExileOpponentsCardFromExileToGraveyardCost(true)); + this.addAbility(ability); + + } + + public VoidAttendant(final VoidAttendant card) { + super(card); + } + + @Override + public VoidAttendant copy() { + return new VoidAttendant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/VoidWinnower.java b/Mage.Sets/src/mage/sets/battleforzendikar/VoidWinnower.java new file mode 100644 index 00000000000..474486e7019 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/VoidWinnower.java @@ -0,0 +1,157 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.RestrictionEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; + +/** + * + * @author LevelX2 + */ +public class VoidWinnower extends CardImpl { + + public VoidWinnower(UUID ownerId) { + super(ownerId, 17, "Void Winnower", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{9}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + + this.power = new MageInt(11); + this.toughness = new MageInt(9); + + // Your opponent can't cast spells with even converted mana costs. (Zero is even.) + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new VoidWinnowerCantCastEffect())); + + // Your opponents can't block with creatures with even converted mana costs. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new VoidWinnowerCantBlockEffect())); + } + + public VoidWinnower(final VoidWinnower card) { + super(card); + } + + @Override + public VoidWinnower copy() { + return new VoidWinnower(this); + } +} + +class VoidWinnowerCantCastEffect extends ContinuousRuleModifyingEffectImpl { + + public VoidWinnowerCantCastEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "Your opponent can't cast spells with even converted mana costs. (Zero is even.)"; + } + + public VoidWinnowerCantCastEffect(final VoidWinnowerCantCastEffect effect) { + super(effect); + } + + @Override + public VoidWinnowerCantCastEffect copy() { + return new VoidWinnowerCantCastEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public String getInfoMessage(Ability source, GameEvent event, Game game) { + MageObject mageObject = game.getObject(source.getSourceId()); + if (mageObject != null) { + return "You can't cast spells with even converted mana costs (" + mageObject.getIdName() + ")."; + } + return null; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == EventType.CAST_SPELL_LATE; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null) { + // the low bit will always be set on an odd number. + return (spell.getConvertedManaCost() & 1) == 0; + } + } + return false; + } +} + +class VoidWinnowerCantBlockEffect extends RestrictionEffect { + + public VoidWinnowerCantBlockEffect() { + super(Duration.WhileOnBattlefield); + staticText = "Your opponents can't block with creatures with even converted mana costs"; + } + + public VoidWinnowerCantBlockEffect(final VoidWinnowerCantBlockEffect effect) { + super(effect); + } + + @Override + public VoidWinnowerCantBlockEffect copy() { + return new VoidWinnowerCantBlockEffect(this); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (game.getOpponents(source.getControllerId()).contains(permanent.getControllerId())) { + // the low bit will always be set on an odd number. + return (permanent.getManaCost().convertedManaCost() & 1) == 0; + } + return false; + } + + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/VolcanicUpheaval.java b/Mage.Sets/src/mage/sets/battleforzendikar/VolcanicUpheaval.java new file mode 100644 index 00000000000..dfb56c8fb84 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/VolcanicUpheaval.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LevelX2 + */ +public class VolcanicUpheaval extends CardImpl { + + public VolcanicUpheaval(UUID ownerId) { + super(ownerId, 161, "Volcanic Upheaval", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{R}"); + this.expansionSetCode = "BFZ"; + + // Destroy target land. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + + } + + public VolcanicUpheaval(final VolcanicUpheaval card) { + super(card); + } + + @Override + public VolcanicUpheaval copy() { + return new VolcanicUpheaval(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/VoraciousNull.java b/Mage.Sets/src/mage/sets/battleforzendikar/VoraciousNull.java new file mode 100644 index 00000000000..e8ddb52479b --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/VoraciousNull.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class VoraciousNull extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature"); + + static { + filter.add(new AnotherPredicate()); + } + + public VoraciousNull(UUID ownerId) { + super(ownerId, 125, "Voracious Null", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {1}{B}, Sacrifice another creature: Put two +1/+1 counters on Voracious Null. Activate this ability only any time you could cast a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), new ManaCostsImpl("{1}{B}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false))); + this.addAbility(ability); + } + + public VoraciousNull(final VoraciousNull card) { + super(card); + } + + @Override + public VoraciousNull copy() { + return new VoraciousNull(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/WastelandStrangler.java b/Mage.Sets/src/mage/sets/battleforzendikar/WastelandStrangler.java new file mode 100644 index 00000000000..739f0d27721 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/WastelandStrangler.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.ExileOpponentsCardFromExileToGraveyardCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class WastelandStrangler extends CardImpl { + + public WastelandStrangler(UUID ownerId) { + super(ownerId, 102, "Wasteland Strangler", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Processor"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // When Wasteland Strangler enters the battlefield, you may put a card an opponent owns from exile into that player's graveyard. If you do, target creature gets -3/-3 until end of turn. + Ability ability = new EntersBattlefieldTriggeredAbility( + new DoIfCostPaid(new BoostTargetEffect(-3, -3, Duration.EndOfTurn), new ExileOpponentsCardFromExileToGraveyardCost(true)), true); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public WastelandStrangler(final WastelandStrangler card) { + super(card); + } + + @Override + public WastelandStrangler copy() { + return new WastelandStrangler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/WaveWingElemental.java b/Mage.Sets/src/mage/sets/battleforzendikar/WaveWingElemental.java new file mode 100644 index 00000000000..6baccf24d65 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/WaveWingElemental.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class WaveWingElemental extends CardImpl { + + public WaveWingElemental(UUID ownerId) { + super(ownerId, 88, "Wave-Wing Elemental", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elemental"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Landfall — Whenever a land enters the battlefield under your control, Wave-Wing Elemental gets +2/+2 until end of turn. + this.addAbility(new LandfallAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false)); + + } + + public WaveWingElemental(final WaveWingElemental card) { + super(card); + } + + @Override + public WaveWingElemental copy() { + return new WaveWingElemental(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/WindriderPatrol.java b/Mage.Sets/src/mage/sets/battleforzendikar/WindriderPatrol.java new file mode 100644 index 00000000000..bde6805b885 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/WindriderPatrol.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.keyword.ScryEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class WindriderPatrol extends CardImpl { + + public WindriderPatrol(UUID ownerId) { + super(ownerId, 89, "Windrider Patrol", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Merfolk"); + this.subtype.add("Wizard"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Whenever Windrider Patrol deals combat damage to a player, scry 2. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ScryEffect(2), false)); + } + + public WindriderPatrol(final WindriderPatrol card) { + super(card); + } + + @Override + public WindriderPatrol copy() { + return new WindriderPatrol(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/WoodlandWanderer.java b/Mage.Sets/src/mage/sets/battleforzendikar/WoodlandWanderer.java new file mode 100644 index 00000000000..0ddd17b5cbf --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/WoodlandWanderer.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.dynamicvalue.common.ColorsOfManaSpentToCastCount; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LevelX2 + */ +public class WoodlandWanderer extends CardImpl { + + public WoodlandWanderer(UUID ownerId) { + super(ownerId, 198, "Woodland Wanderer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Elemental"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Converge - Woodland Wanderer enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it. + this.addAbility(new EntersBattlefieldAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance(), ColorsOfManaSpentToCastCount.getInstance(), true), + null, "Converge — {this} enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.", null)); + } + + public WoodlandWanderer(final WoodlandWanderer card) { + super(card); + } + + @Override + public WoodlandWanderer copy() { + return new WoodlandWanderer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ZadaHedronGrinder.java b/Mage.Sets/src/mage/sets/battleforzendikar/ZadaHedronGrinder.java new file mode 100644 index 00000000000..e20744b3694 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ZadaHedronGrinder.java @@ -0,0 +1,207 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.Target; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class ZadaHedronGrinder extends CardImpl { + + public ZadaHedronGrinder(UUID ownerId) { + super(ownerId, 162, "Zada, Hedron Grinder", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "BFZ"; + this.supertype.add("Legendary"); + this.subtype.add("Goblin"); + this.subtype.add("Ally"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever you cast an instant or sorcery spell that targets only Zada, Hedron Grinder, copy that spell for each other creature you control that the spell could target. Each copy targets a different one of those creatures. + this.addAbility(new ZadaHedronGrinderTriggeredAbility()); + + } + + public ZadaHedronGrinder(final ZadaHedronGrinder card) { + super(card); + } + + @Override + public ZadaHedronGrinder copy() { + return new ZadaHedronGrinder(this); + } +} + +class ZadaHedronGrinderTriggeredAbility extends TriggeredAbilityImpl { + + ZadaHedronGrinderTriggeredAbility() { + super(Zone.BATTLEFIELD, new ZadaHedronGrinderEffect(), false); + } + + ZadaHedronGrinderTriggeredAbility(final ZadaHedronGrinderTriggeredAbility ability) { + super(ability); + } + + @Override + public ZadaHedronGrinderTriggeredAbility copy() { + return new ZadaHedronGrinderTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getPlayerId().equals(this.getControllerId())) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (isControlledInstantOrSorcery(spell)) { + boolean targetsSource = false; + for (Mode mode : spell.getSpellAbility().getModes().getSelectedModes()) { + for (Target target : mode.getTargets()) { + for (UUID targetId : target.getTargets()) { + if (targetId.equals(getSourceId())) { + targetsSource = true; + } else { + return false; + } + } + } + } + if (targetsSource) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(spell.getId())); + return true; + } + } + } + return false; + } + + private boolean isControlledInstantOrSorcery(Spell spell) { + return spell != null + && (spell.getControllerId().equals(this.getControllerId())) + && (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY)); + } + + @Override + public String getRule() { + return "Whenever you cast an instant or sorcery spell that targets only {this}, copy that spell for each other creature you control that the spell could target. Each copy targets a different one of those creatures."; + } +} + +class ZadaHedronGrinderEffect extends OneShotEffect { + + public ZadaHedronGrinderEffect() { + super(Outcome.Detriment); + this.staticText = "copy that spell for each other creature you control that the spell could target. Each copy targets a different one of those creatures"; + } + + public ZadaHedronGrinderEffect(final ZadaHedronGrinderEffect effect) { + super(effect); + } + + @Override + public ZadaHedronGrinderEffect copy() { + return new ZadaHedronGrinderEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); + if (spell == null) { + spell = (Spell) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.STACK); + } + Player controller = game.getPlayer(source.getControllerId()); + if (spell != null && controller != null) { + Target usedTarget = null; + setUsedTarget: + for (Mode mode : spell.getSpellAbility().getModes().getSelectedModes()) { + for (Target target : mode.getTargets()) { + if (target.getFirstTarget().equals(source.getSourceId())) { + usedTarget = target.copy(); + usedTarget.clearChosen(); + break setUsedTarget; + } + } + } + if (usedTarget == null) { + return false; + } + for (Permanent creature : game.getState().getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + if (!creature.getId().equals(source.getSourceId()) && usedTarget.canTarget(source.getControllerId(), creature.getId(), source, game)) { + Spell copy = spell.copySpell(); + setTarget: + for (Mode mode : spell.getSpellAbility().getModes().getSelectedModes()) { + for (Target target : mode.getTargets()) { + if (target.getClass().equals(usedTarget.getClass())) { + target.clearChosen(); // For targets with Max > 1 we need to clear before the text is comapred + if (target.getMessage().equals(usedTarget.getMessage())) { + target.add(creature.getId(), game); + break setTarget; + } + } + } + } + copy.setControllerId(source.getControllerId()); + copy.setCopiedSpell(true); + game.getStack().push(copy); + String activateMessage = copy.getActivatedMessage(game); + if (activateMessage.startsWith(" casts ")) { + activateMessage = activateMessage.substring(6); + } + if (!game.isSimulation()) { + game.informPlayers(controller.getLogName() + activateMessage); + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ZulaportCutthroat.java b/Mage.Sets/src/mage/sets/battleforzendikar/ZulaportCutthroat.java new file mode 100644 index 00000000000..0264a61edf6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ZulaportCutthroat.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LevelX2 + */ +public class ZulaportCutthroat extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you control"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public ZulaportCutthroat(UUID ownerId) { + super(ownerId, 126, "Zulaport Cutthroat", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Human"); + this.subtype.add("Rogue"); + this.subtype.add("Ally"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Zulaport Cutthroat or another creature you control dies, each opponent loses 1 life and you gain 1 life. + Ability ability = new DiesThisOrAnotherCreatureTriggeredAbility(new LoseLifeOpponentsEffect(1), false, filter); + Effect effect = new GainLifeEffect(1); + effect.setText("and you gain 1 life"); + ability.addEffect(effect); + this.addAbility(ability); + + } + + public ZulaportCutthroat(final ZulaportCutthroat card) { + super(card); + } + + @Override + public ZulaportCutthroat copy() { + return new ZulaportCutthroat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/BlindingPowder.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/BlindingPowder.java index d1030fbd9c8..727a67b0c6f 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/BlindingPowder.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/BlindingPowder.java @@ -61,7 +61,7 @@ public class BlindingPowder extends CardImpl { // Equipped creature has "Unattach Blinding Powder: Prevent all combat damage that would be dealt to this creature this turn." Effect effect = new PreventCombatDamageToSourceEffect(Duration.EndOfTurn); effect.setText("Prevent all combat damage that would be dealt to this creature this turn"); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new BlindingPowderUnattachCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new BlindingPowderUnattachCost(getName(), getId())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability, AttachmentType.EQUIPMENT, Duration.WhileOnBattlefield))); // Equip {2} this.addAbility(new EquipAbility(Outcome.PreventDamage, new GenericManaCost(2))); @@ -79,28 +79,32 @@ public class BlindingPowder extends CardImpl { class BlindingPowderUnattachCost extends CostImpl { - public BlindingPowderUnattachCost() { - this.text = "Unattach Blinding Powder"; + protected UUID sourceEquipmentId; + + public BlindingPowderUnattachCost(String name, UUID sourceId) { + this.text = "Unattach " + name; + this.sourceEquipmentId = sourceId; } public BlindingPowderUnattachCost(final BlindingPowderUnattachCost cost) { super(cost); + this.sourceEquipmentId = cost.sourceEquipmentId; } @Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { Permanent permanent = game.getPermanent(sourceId); if (permanent != null) { - for (UUID attachmentId :permanent.getAttachments()) { + for (UUID attachmentId : permanent.getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.getName().equals("Blinding Powder")) { + if (attachment != null && attachment.getId().equals(sourceEquipmentId)) { paid = permanent.removeAttachment(attachmentId, game); if (paid) { break; } } } - + } return paid; } @@ -109,9 +113,9 @@ class BlindingPowderUnattachCost extends CostImpl { public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Permanent permanent = game.getPermanent(sourceId); if (permanent != null) { - for (UUID attachmentId :permanent.getAttachments()) { + for (UUID attachmentId : permanent.getAttachments()) { Permanent attachment = game.getPermanent(attachmentId); - if (attachment != null && attachment.getName().equals("Blinding Powder")) { + if (attachment != null && attachment.getId().equals(sourceEquipmentId)) { return true; } } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/Floodbringer.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/Floodbringer.java index fa8a52c1232..cc2eab2da77 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/Floodbringer.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/Floodbringer.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.keyword.FlyingAbility; @@ -64,7 +64,7 @@ public class Floodbringer extends CardImpl { // {2}, Return a land you control to its owner's hand: Tap target land. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new GenericManaCost(2)); - ReturnToHandTargetPermanentCost cost = new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)); + ReturnToHandChosenControlledPermanentCost cost = new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)); cost.setText("Return a land you control to its owner's hand"); ability.addCost(cost); ability.addTarget(new TargetLandPermanent()); diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/FumikoTheLowblood.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/FumikoTheLowblood.java index aa93e4cf8d5..02af73fe030 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/FumikoTheLowblood.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/FumikoTheLowblood.java @@ -40,6 +40,7 @@ import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; +import mage.watchers.common.AttackedThisTurnWatcher; /** * @@ -63,7 +64,7 @@ public class FumikoTheLowblood extends CardImpl { // Creatures your opponents control attack each turn if able. FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control"); filter.add(new ControllerPredicate(TargetController.OPPONENT)); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter)), new AttackedThisTurnWatcher()); } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/GenjuOfTheRealm.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/GenjuOfTheRealm.java index d973dc72a98..6afd9f2b81a 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/GenjuOfTheRealm.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/GenjuOfTheRealm.java @@ -62,6 +62,7 @@ public class GenjuOfTheRealm extends CardImpl { super(ownerId, 151, "Genju of the Realm", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{W}{U}{B}{R}{G}"); this.expansionSetCode = "BOK"; this.subtype.add("Aura"); + this.supertype.add("Legendary"); // Enchant Land diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/GoryosVengeance.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/GoryosVengeance.java index 87999170a71..16bef199b09 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/GoryosVengeance.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/GoryosVengeance.java @@ -70,7 +70,6 @@ public class GoryosVengeance extends CardImpl { this.expansionSetCode = "BOK"; this.subtype.add("Arcane"); - // Return target legendary creature card from your graveyard to the battlefield. That creature gains haste. Exile it at the beginning of the next end step. this.getSpellAbility().addEffect(new GoryosVengeanceEffect()); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); @@ -111,16 +110,16 @@ class GoryosVengeanceEffect extends OneShotEffect { if (controller != null) { Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { - if (controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) { + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { // Haste ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); - effect.setTargetPointer(new FixedTarget(permanent.getId())); + effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); // Exile it at end of turn - Effect exileEffect = new ExileTargetEffect(new StringBuilder("Exile ").append(permanent.getName()).append(" at the beginning of the next end step").toString()); - exileEffect.setTargetPointer(new FixedTarget(card.getId())); + Effect exileEffect = new ExileTargetEffect("Exile " + permanent.getName() + " at the beginning of the next end step"); + exileEffect.setTargetPointer(new FixedTarget(permanent, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setControllerId(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/HokoriDustDrinker.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/HokoriDustDrinker.java index 62bb2f97366..6a126e4d3de 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/HokoriDustDrinker.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/HokoriDustDrinker.java @@ -62,7 +62,7 @@ public class HokoriDustDrinker extends CardImpl { this.subtype.add("Spirit"); this.power = new MageInt(2); - this.toughness = new MageInt(1); + this.toughness = new MageInt(2); // Lands don't untap during their controllers' untap steps. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, new FilterLandPermanent("Lands")))); diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/IwamoriOfTheOpenFist.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/IwamoriOfTheOpenFist.java index 98bc1dbe5f7..b37336ee341 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/IwamoriOfTheOpenFist.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/IwamoriOfTheOpenFist.java @@ -84,26 +84,26 @@ public class IwamoriOfTheOpenFist extends CardImpl { class IwamoriOfTheOpenFistEffect extends OneShotEffect { private static final FilterCard filter = new FilterCard("legendary creature card"); - + static { filter.add(new SupertypePredicate("Legendary")); filter.add(new CardTypePredicate(CardType.CREATURE)); } - + public IwamoriOfTheOpenFistEffect() { super(Outcome.Detriment); this.staticText = "each opponent may put a legendary creature card from his or her hand onto the battlefield"; } - + public IwamoriOfTheOpenFistEffect(final IwamoriOfTheOpenFistEffect effect) { super(effect); } - + @Override public IwamoriOfTheOpenFistEffect copy() { return new IwamoriOfTheOpenFistEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); @@ -123,14 +123,7 @@ class IwamoriOfTheOpenFistEffect extends OneShotEffect { } } } - if (cards.size() > 0) { - for (Card card: cards.getCards(game)) { - Player player = game.getPlayer(card.getOwnerId()); - if (player != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); - } - } - } + controller.moveCards(cards.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null); return true; } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java index abdfe0da0fe..1c2c466eeb1 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java @@ -31,8 +31,10 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; import mage.MageInt; +import mage.MageObjectReference; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.keyword.FlyingAbility; @@ -40,12 +42,15 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; +import mage.constants.WatcherScope; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.target.TargetStackObject; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; +import mage.watchers.Watcher; /** * @@ -59,7 +64,6 @@ public class KiraGreatGlassSpinner extends CardImpl { this.subtype.add("Spirit"); this.supertype.add("Legendary"); - this.power = new MageInt(2); this.toughness = new MageInt(2); @@ -67,7 +71,10 @@ public class KiraGreatGlassSpinner extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Creatures you control have "Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability." - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new KiraGreatGlassSpinnerAbility(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures you control")))); + Effect effect = new CounterTargetEffect(); + effect.setText("counter that spell or ability"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new KiraGreatGlassSpinnerAbility(effect), Duration.WhileOnBattlefield, new FilterCreaturePermanent("Creatures you control"))), + new CreatureWasTargetedThisTurnWatcher()); } @@ -80,21 +87,15 @@ public class KiraGreatGlassSpinner extends CardImpl { return new KiraGreatGlassSpinner(this); } } -// TODO: -// not perfectly implemented. It doesnt't handles if a creature was already targeted the turn Kira comes into play. -// Maybe it's better to implement it with a watcher class KiraGreatGlassSpinnerAbility extends TriggeredAbilityImpl { - protected Map turnUsed = new HashMap<>(); - - public KiraGreatGlassSpinnerAbility() { - super(Zone.BATTLEFIELD, new CounterTargetEffect(), false); + public KiraGreatGlassSpinnerAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect, false); } public KiraGreatGlassSpinnerAbility(final KiraGreatGlassSpinnerAbility ability) { super(ability); - turnUsed = ability.turnUsed; } @Override @@ -110,20 +111,15 @@ class KiraGreatGlassSpinnerAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId().equals(this.getSourceId())) { - Integer turn = turnUsed.get(event.getTargetId()); - if (turn == null || turn < game.getTurnNum()) { - this.getTargets().clear(); - TargetStackObject target = new TargetStackObject(); - target.add(event.getSourceId(), game); - this.addTarget(target); - if (turnUsed.containsKey(event.getTargetId())) { - turnUsed.remove(event.getTargetId()); - turnUsed.put(event.getTargetId(), game.getTurnNum()); - } else { - turnUsed.put(event.getTargetId(), game.getTurnNum()); + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { + CreatureWasTargetedThisTurnWatcher watcher = (CreatureWasTargetedThisTurnWatcher) game.getState().getWatchers().get("CreatureWasTargetedThisTurn"); + if (watcher != null && watcher.notMoreThanOnceTargetedThisTurn(permanent, game)) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); + } + return true; } - - return true; } } return false; @@ -135,3 +131,50 @@ class KiraGreatGlassSpinnerAbility extends TriggeredAbilityImpl { } } + +class CreatureWasTargetedThisTurnWatcher extends Watcher { + + private final Map creaturesTargeted = new HashMap<>(); + + public CreatureWasTargetedThisTurnWatcher() { + super("CreatureWasTargetedThisTurn", WatcherScope.GAME); + } + + public CreatureWasTargetedThisTurnWatcher(final CreatureWasTargetedThisTurnWatcher watcher) { + super(watcher); + this.creaturesTargeted.putAll(creaturesTargeted); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.TARGETED) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { + MageObjectReference mor = new MageObjectReference(permanent, game); + int amount = 0; + if (creaturesTargeted.containsKey(mor)) { + amount = creaturesTargeted.get(mor); + } + creaturesTargeted.put(mor, ++amount); + } + } + } + + public boolean notMoreThanOnceTargetedThisTurn(Permanent creature, Game game) { + if (creaturesTargeted.containsKey(new MageObjectReference(creature, game))) { + return creaturesTargeted.get(new MageObjectReference(creature, game)) < 2; + } + return true; + } + + @Override + public void reset() { + super.reset(); + creaturesTargeted.clear(); + } + + @Override + public CreatureWasTargetedThisTurnWatcher copy() { + return new CreatureWasTargetedThisTurnWatcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KitsunePalliator.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KitsunePalliator.java index 4940e8ce24f..9af055fbbd3 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KitsunePalliator.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KitsunePalliator.java @@ -39,8 +39,6 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.PreventDamageToTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -52,12 +50,6 @@ import mage.target.targetpointer.FixedTarget; */ public class KitsunePalliator extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Samurai you control"); - static { - filter.add(new ControllerPredicate(TargetController.YOU)); - filter.add(new SubtypePredicate("Samurai")); - } - public KitsunePalliator(UUID ownerId) { super(ownerId, 14, "Kitsune Palliator", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.expansionSetCode = "BOK"; diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/MinamoSightbender.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MinamoSightbender.java index 10062690021..60331f9d608 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/MinamoSightbender.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MinamoSightbender.java @@ -28,9 +28,6 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,6 +36,8 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; @@ -54,6 +53,7 @@ import mage.target.common.TargetCreaturePermanent; public class MinamoSightbender extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power X or less"); + private final UUID originalId; public MinamoSightbender(UUID ownerId) { super(ownerId, 41, "Minamo Sightbender", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); @@ -62,26 +62,27 @@ public class MinamoSightbender extends CardImpl { this.subtype.add("Wizard"); this.power = new MageInt(1); - this.toughness = new MageInt(1); + this.toughness = new MageInt(2); // {X}, {T}: Target creature with power X or less can't be blocked this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(), new ManaCostsImpl("{X}")); Target target = new TargetCreaturePermanent(filter); ability.addTarget(target); ability.addCost(new TapSourceCost()); + originalId = ability.getOriginalId(); this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SimpleActivatedAbility) { - for (Effect effect :ability.getEffects()) { + if (ability.getOriginalId().equals(originalId)) { + for (Effect effect : ability.getEffects()) { if (effect instanceof CantBeBlockedTargetEffect) { int manaX = ability.getManaCostsToPay().getX(); ability.getTargets().clear(); FilterCreaturePermanent newFilter = new FilterCreaturePermanent(new StringBuilder("creature with power ").append(manaX).append(" or less").toString()); - filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, manaX +1)); + filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, manaX + 1)); Target target = new TargetCreaturePermanent(newFilter); ability.addTarget(target); break; @@ -92,6 +93,7 @@ public class MinamoSightbender extends CardImpl { public MinamoSightbender(final MinamoSightbender card) { super(card); + this.originalId = card.originalId; } @Override diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/OrbOfDreams.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/OrbOfDreams.java index b896f12a2c3..487d04fcf35 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/OrbOfDreams.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/OrbOfDreams.java @@ -28,13 +28,17 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -47,7 +51,7 @@ public class OrbOfDreams extends CardImpl { public OrbOfDreams(UUID ownerId) { super(ownerId, 156, "Orb of Dreams", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); this.expansionSetCode = "BOK"; - + // Permanents enter the battlefield tapped. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OrbOfDreamsEffect())); } @@ -60,7 +64,7 @@ public class OrbOfDreams extends CardImpl { public OrbOfDreams copy() { return new OrbOfDreams(this); } - + private class OrbOfDreamsEffect extends ReplacementEffectImpl { OrbOfDreamsEffect() { @@ -79,23 +83,22 @@ public class OrbOfDreams extends CardImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(event.getTargetId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null) { permanent.setTapped(true); } return false; } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { return true; } - } + } } - diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/OrnateKanzashi.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/OrnateKanzashi.java index 504916c8d76..29b2018d772 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/OrnateKanzashi.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/OrnateKanzashi.java @@ -79,6 +79,7 @@ public class OrnateKanzashi extends CardImpl { } } + class OrnateKanzashiEffect extends OneShotEffect { public OrnateKanzashiEffect() { @@ -98,14 +99,14 @@ class OrnateKanzashiEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); - MageObject sourceObject = game.getObject(source.getSourceId()); + MageObject sourceObject = game.getObject(source.getSourceId()); if (sourceObject != null && opponent != null) { if (opponent.getLibrary().size() > 0) { Library library = opponent.getLibrary(); Card card = library.getFromTop(game); if (card != null) { opponent.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getName(), source.getSourceId(), game, Zone.LIBRARY, true); - ContinuousEffect effect = new OrnateKanzashiCastFromExileEffect(card.getId()); + ContinuousEffect effect = new OrnateKanzashiCastFromExileEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); } @@ -118,7 +119,7 @@ class OrnateKanzashiEffect extends OneShotEffect { class OrnateKanzashiCastFromExileEffect extends AsThoughEffectImpl { - public OrnateKanzashiCastFromExileEffect(UUID cardId) { + public OrnateKanzashiCastFromExileEffect() { super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "You may play that card from exile this turn"; } @@ -139,6 +140,7 @@ class OrnateKanzashiCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) && objectId.equals(getTargetPointer().getFirst(game, source)); + return source.getControllerId().equals(affectedControllerId) + && objectId.equals(getTargetPointer().getFirst(game, source)); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/PatronOfTheMoon.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/PatronOfTheMoon.java index 826408a71be..f6d16875adc 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/PatronOfTheMoon.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/PatronOfTheMoon.java @@ -35,8 +35,8 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.OfferingAbility; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -100,13 +100,8 @@ class PatronOfTheMoonEffect extends OneShotEffect { if (controller != null) { TargetCard target = new TargetCardInHand(0, 2, new FilterLandCard("up to two land cards to put onto the battlefield tapped")); controller.chooseTarget(outcome, controller.getHand(), target, source, game); - for (UUID cardId : target.getTargets()) { - Card card = game.getCard(cardId); - if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId(), true); - } - } - return true; + return controller.moveCards(new CardsImpl(target.getTargets()).getCards(game), + Zone.BATTLEFIELD, source, game, true, false, false, null); } return false; } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/QuillmaneBaku.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/QuillmaneBaku.java index b367b8f020f..f20848de39f 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/QuillmaneBaku.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/QuillmaneBaku.java @@ -59,6 +59,7 @@ import mage.target.common.TargetCreaturePermanent; public class QuillmaneBaku extends CardImpl { private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard(); + private final UUID originalId; public QuillmaneBaku(UUID ownerId) { super(ownerId, 48, "Quillmane Baku", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); @@ -76,12 +77,13 @@ public class QuillmaneBaku extends CardImpl { ability.addCost(new TapSourceCost()); ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance(1))); ability.addTarget(new TargetCreaturePermanent()); + originalId = ability.getOriginalId(); this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SimpleActivatedAbility) { + if (ability.getOriginalId().equals(originalId)) { int maxConvManaCost = 0; for (Cost cost : ability.getCosts()) { if (cost instanceof RemoveVariableCountersSourceCost) { @@ -98,6 +100,7 @@ public class QuillmaneBaku extends CardImpl { public QuillmaneBaku(final QuillmaneBaku card) { super(card); + this.originalId = card.originalId; } @Override diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/SoratamiMindsweeper.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/SoratamiMindsweeper.java index 141dfacf5e8..d3905fda60b 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/SoratamiMindsweeper.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/SoratamiMindsweeper.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.abilities.keyword.FlyingAbility; @@ -66,7 +66,7 @@ public class SoratamiMindsweeper extends CardImpl { // {2}, Return a land you control to its owner's hand: Target player puts the top two cards of his or her library into his or her graveyard. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,new PutLibraryIntoGraveTargetEffect(2), new ManaCostsImpl("{2}")); ability.addTarget(new TargetPlayer()); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/SwayOfTheStars.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/SwayOfTheStars.java index 5641bb5968e..4764132a428 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/SwayOfTheStars.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/SwayOfTheStars.java @@ -28,14 +28,18 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.abilities.effects.common.SetPlayerLifeAllEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.CardImpl; +import mage.filter.FilterPermanent; +import mage.filter.predicate.other.OwnerIdPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -50,9 +54,12 @@ public class SwayOfTheStars extends CardImpl { super(ownerId, 54, "Sway of the Stars", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{8}{U}{U}"); this.expansionSetCode = "BOK"; - // Each player shuffles his or her hand, graveyard, and permanents he or she owns into his or her library, then draws seven cards. Each player's life total becomes 7. this.getSpellAbility().addEffect(new SwayOfTheStarsEffect()); + Effect effect = new DrawCardAllEffect(7); + effect.setText(", then draws seven cards"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addEffect(new SetPlayerLifeAllEffect(7)); } @@ -66,7 +73,6 @@ public class SwayOfTheStars extends CardImpl { } } - class SwayOfTheStarsEffect extends OneShotEffect { public SwayOfTheStarsEffect() { @@ -80,24 +86,19 @@ class SwayOfTheStarsEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player sourcePlayer = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); - for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - - for (UUID playerId: sourcePlayer.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card: player.getHand().getCards(game)) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - for (Card card: player.getGraveyard().getCards(game)) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } + player.moveCards(player.getHand(), Zone.HAND, Zone.LIBRARY, source, game); + player.moveCards(player.getGraveyard(), Zone.GRAVEYARD, Zone.LIBRARY, source, game); + FilterPermanent filter = new FilterPermanent(); + filter.add(new OwnerIdPredicate(playerId)); + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, controller.getId(), source.getSourceId(), game)) { + permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + } player.shuffleLibrary(game); - player.drawCards(7, game); - player.setLife(7, game); } } return true; @@ -108,4 +109,4 @@ class SwayOfTheStarsEffect extends OneShotEffect { return new SwayOfTheStarsEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/VeilOfSecrecy.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/VeilOfSecrecy.java index c0184c3793c..7b4c81b3575 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/VeilOfSecrecy.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/VeilOfSecrecy.java @@ -29,7 +29,7 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; import mage.ObjectColor; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.Effect; import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; @@ -71,7 +71,7 @@ public class VeilOfSecrecy extends CardImpl { this.getSpellAbility().addEffect(effect); // Splice onto Arcane-Return a blue creature you control to its owner's hand. - this.addAbility(new SpliceOntoArcaneAbility(new ReturnToHandTargetPermanentCost(new TargetControlledCreaturePermanent(filter)))); + this.addAbility(new SpliceOntoArcaneAbility(new ReturnToHandChosenControlledPermanentCost(new TargetControlledCreaturePermanent(filter)))); } public VeilOfSecrecy(final VeilOfSecrecy card) { diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/WardOfPiety.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/WardOfPiety.java index 1edee8058ed..94b13e99c31 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/WardOfPiety.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/WardOfPiety.java @@ -28,11 +28,11 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; +import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.PreventionEffectData; -import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.RedirectionEffect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; @@ -44,7 +44,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.TargetPermanent; import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreaturePermanent; @@ -60,7 +59,6 @@ public class WardOfPiety extends CardImpl { this.expansionSetCode = "BOK"; this.subtype.add("Aura"); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -84,10 +82,12 @@ public class WardOfPiety extends CardImpl { } } -class WardOfPietyPreventDamageTargetEffect extends PreventionEffectImpl { +class WardOfPietyPreventDamageTargetEffect extends RedirectionEffect { + + protected MageObjectReference redirectToObject; public WardOfPietyPreventDamageTargetEffect() { - super(Duration.EndOfTurn, 1, false, true); + super(Duration.EndOfTurn, 1, true); staticText = "The next 1 damage that would be dealt to enchanted creature this turn is dealt to target creature or player instead"; } @@ -106,35 +106,21 @@ class WardOfPietyPreventDamageTargetEffect extends PreventionEffectImpl { } @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - PreventionEffectData preventionData = preventDamageAction(event, source, game); - // deal damage now - if (preventionData.getPreventedDamage() > 0) { - Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (permanent != null) { - game.informPlayers("Dealing " + preventionData.getPreventedDamage() + " damage to " + permanent.getLogName() + " instead"); - // keep the original source id as it is redirecting - permanent.damage(preventionData.getPreventedDamage(), event.getSourceId(), game, false, true); - } - Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); - if (player != null) { - game.informPlayers("Dealing " + preventionData.getPreventedDamage() + " damage to " + player.getLogName() + " instead"); - // keep the original source id as it is redirecting - player.damage(preventionData.getPreventedDamage(), event.getSourceId(), game, false, true); - } - } - return false; + public void init(Ability source, Game game) { + super.init(source, game); + redirectToObject = new MageObjectReference(source.getTargets().get(0).getFirstTarget(), game); } @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (super.applies(event, source, game)) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && event.getTargetId().equals(enchantment.getAttachedTo())) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && event.getTargetId().equals(enchantment.getAttachedTo())) { + if (redirectToObject.equals(new MageObjectReference(source.getTargets().get(0).getFirstTarget(), game))) { + redirectTarget = source.getTargets().get(0); return true; } } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/AstralCornucopia.java b/Mage.Sets/src/mage/sets/bornofthegods/AstralCornucopia.java index 72046e837c1..6d57185c284 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/AstralCornucopia.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/AstralCornucopia.java @@ -31,17 +31,14 @@ import java.util.List; import java.util.UUID; import mage.Mana; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.ManaEffect; import mage.abilities.mana.ManaAbility; import mage.cards.CardImpl; import mage.choices.ChoiceColor; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; @@ -60,7 +57,7 @@ public class AstralCornucopia extends CardImpl { this.expansionSetCode = "BNG"; // Astral Cornucopia enters the battlefield with X charge counters on it. - this.addAbility(new EntersBattlefieldAbility(new AstralCornucopiaEffect(), "with X charge counters on it")); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.CHARGE.createInstance()))); // {T}: Choose a color. Add one mana of that color to your mana pool for each charge counter on Astral Cornucopia. this.addAbility(new AstralCornucopiaManaAbility()); @@ -76,38 +73,6 @@ public class AstralCornucopia extends CardImpl { } } -class AstralCornucopiaEffect extends OneShotEffect { - public AstralCornucopiaEffect() { - super(Outcome.Benefit); - } - - public AstralCornucopiaEffect(final AstralCornucopiaEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public AstralCornucopiaEffect copy() { - return new AstralCornucopiaEffect(this); - } -} - class AstralCornucopiaManaAbility extends ManaAbility { public AstralCornucopiaManaAbility() { @@ -130,7 +95,7 @@ class AstralCornucopiaManaAbility extends ManaAbility { if (sourcePermanent != null) { int counters = sourcePermanent.getCounters().getCount(CounterType.CHARGE.getName()); if (counters > 0) { - netMana.add(new Mana(0,0,0,0,0,0,counters)); + netMana.add(new Mana(0, 0, 0, 0, 0, 0, counters)); } } return netMana; diff --git a/Mage.Sets/src/mage/sets/bornofthegods/BrimazKingOfOreskos.java b/Mage.Sets/src/mage/sets/bornofthegods/BrimazKingOfOreskos.java index 7d967d2d226..8ebc5ab5fc8 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/BrimazKingOfOreskos.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/BrimazKingOfOreskos.java @@ -64,10 +64,10 @@ public class BrimazKingOfOreskos extends CardImpl { // Vigilance this.addAbility(VigilanceAbility.getInstance()); - + // Whenever Brimaz, King of Oreskos attacks, put a 1/1 white Cat Soldier creature token with vigilance onto the battlefield attacking. this.addAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new CatSoldierCreatureToken(), 1, false, true), false)); - + // Whenever Brimaz blocks a creature, put a 1/1 white Cat Soldier creature token with vigilance onto the battlefield blocking that creature. this.addAbility(new BlocksCreatureTriggeredAbility(new BrimazKingOfOreskosEffect(), false, true)); } @@ -83,44 +83,49 @@ public class BrimazKingOfOreskos extends CardImpl { } class BrimazKingOfOreskosEffect extends OneShotEffect { - + public BrimazKingOfOreskosEffect() { super(Outcome.Benefit); this.staticText = "put a 1/1 white Cat Soldier creature token with vigilance onto the battlefield blocking that creature"; } - + public BrimazKingOfOreskosEffect(final BrimazKingOfOreskosEffect effect) { super(effect); } - + @Override public BrimazKingOfOreskosEffect copy() { return new BrimazKingOfOreskosEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - + if (controller != null) { Token token = new CatSoldierCreatureToken(); token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - Permanent catToken = game.getPermanent(token.getLastAddedToken()); - Permanent attackingCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (catToken != null && attackingCreature != null && game.getState().getCombat() != null) { + Permanent attackingCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (attackingCreature != null && game.getState().getCombat() != null) { // Possible ruling (see Ætherplasm) // The token you put onto the battlefield is blocking the attacking creature, // even if the block couldn't legally be declared (for example, if that creature - // enters the battlefield tapped, or it can't block, or the attacking creature + // enters the battlefield tapped, or it can't block, or the attacking creature // has protection from it) CombatGroup combatGroup = game.getState().getCombat().findGroup(attackingCreature.getId()); if (combatGroup != null) { - combatGroup.addBlocker(catToken.getId(), source.getControllerId(), game); - game.getCombat().addBlockingGroup(catToken.getId(),attackingCreature.getId() , source.getControllerId(), game); + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent catToken = game.getPermanent(tokenId); + if (catToken != null) { + combatGroup.addBlocker(tokenId, source.getControllerId(), game); + game.getCombat().addBlockingGroup(tokenId, attackingCreature.getId(), controller.getId(), game); + } + } + combatGroup.pickBlockerOrder(attackingCreature.getControllerId(), game); } } return true; - } + } return false; } } diff --git a/Mage.Sets/src/mage/sets/bornofthegods/ChampionOfStraySouls.java b/Mage.Sets/src/mage/sets/bornofthegods/ChampionOfStraySouls.java index a59de281863..421d4ef2737 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/ChampionOfStraySouls.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/ChampionOfStraySouls.java @@ -27,6 +27,7 @@ */ package mage.sets.bornofthegods; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -47,14 +48,13 @@ import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.target.common.TargetCardInYourGraveyard; -import java.util.UUID; - /** * * @author LevelX2 */ public class ChampionOfStraySouls extends CardImpl { + private final UUID originalId; private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other creatures"); static { @@ -71,8 +71,9 @@ public class ChampionOfStraySouls extends CardImpl { this.toughness = new MageInt(4); /** - * You choose the targets of the first ability as you activate that ability, - * before you pay any costs. You can't target any of the creatures you sacrifice. + * You choose the targets of the first ability as you activate that + * ability, before you pay any costs. You can't target any of the + * creatures you sacrifice. */ // {3}{B}{B}, {T}, Sacrifice X other creatures: Return X target creatures from your graveyard to the battlefield. Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect(); @@ -80,11 +81,12 @@ public class ChampionOfStraySouls extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{3}{B}{B}")); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeXTargetCost(filter)); - ability.addTarget(new TargetCardInYourGraveyard(0,Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard"))); + ability.addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard"))); + originalId = ability.getOriginalId(); this.addAbility(ability); // {5}{B}{B}: Put Champion of Stray Souls on top of your library from your graveyard. - this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, + this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new PutOnLibrarySourceEffect(true, "Put {this} on top of your library from your graveyard"), new ManaCostsImpl("{5}{B}{B}"))); @@ -92,12 +94,12 @@ public class ChampionOfStraySouls extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SimpleActivatedAbility) { + if (ability.getOriginalId().equals(originalId)) { for (Effect effect : ability.getEffects()) { if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) { int xValue = new GetXValue().calculate(game, ability, null); ability.getTargets().clear(); - ability.addTarget(new TargetCardInYourGraveyard(xValue,xValue, new FilterCreatureCard("creature cards from your graveyard"))); + ability.addTarget(new TargetCardInYourGraveyard(xValue, xValue, new FilterCreatureCard("creature cards from your graveyard"))); } } } @@ -105,6 +107,7 @@ public class ChampionOfStraySouls extends CardImpl { public ChampionOfStraySouls(final ChampionOfStraySouls card) { super(card); + this.originalId = card.originalId; } @Override diff --git a/Mage.Sets/src/mage/sets/bornofthegods/EverflameEidolon.java b/Mage.Sets/src/mage/sets/bornofthegods/EverflameEidolon.java index 3239aff414b..dc091c0b57f 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/EverflameEidolon.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/EverflameEidolon.java @@ -29,19 +29,22 @@ package mage.sets.bornofthegods; import java.util.UUID; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.common.SourceHasSubtypeCondition; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.BestowAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; /** * @@ -60,12 +63,7 @@ public class EverflameEidolon extends CardImpl { // Bestow {2}{R} this.addAbility(new BestowAbility(this, "{2}{R}")); // {R}: Everflame Eidolon gets +1/+0 until end of turn. If it's an Aura, enchanted creature gets +1/+0 until end of turn instead. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostEnchantedEffect(1, 0, Duration.EndOfTurn), - new BoostSourceEffect(1, 0, Duration.EndOfTurn), - new SourceHasSubtypeCondition("Aura"), - "{this} gets +1/+0 until end of turn. If it's an Aura, enchanted creature gets +1/+0 until end of turn instead"), - new ManaCostsImpl("{R}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new EverflameEidolonEffect(), new ManaCostsImpl("{R}"))); // Enchanted creature gets +1/+1. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); } @@ -79,3 +77,34 @@ public class EverflameEidolon extends CardImpl { return new EverflameEidolon(this); } } + +class EverflameEidolonEffect extends OneShotEffect { + + public EverflameEidolonEffect() { + super(Outcome.BoostCreature); + this.staticText = "{this} gets +1/+0 until end of turn. If it's an Aura, enchanted creature gets +1/+0 until end of turn instead"; + } + + public EverflameEidolonEffect(final EverflameEidolonEffect effect) { + super(effect); + } + + @Override + public EverflameEidolonEffect copy() { + return new EverflameEidolonEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (sourceObject != null) { + if (sourceObject.getSubtype().contains("Aura")) { + new BoostEnchantedEffect(1, 0, Duration.EndOfTurn).apply(game, source); + } else { + game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/FelhideSpiritbinder.java b/Mage.Sets/src/mage/sets/bornofthegods/FelhideSpiritbinder.java index 31d52cf2d2f..7d31be41b06 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/FelhideSpiritbinder.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/FelhideSpiritbinder.java @@ -71,7 +71,7 @@ public class FelhideSpiritbinder extends CardImpl { this.toughness = new MageInt(4); // Inspired - Whenever Felhide Spiritbinder becomes untapped, you may pay {1}{R}. If you do, put a token onto the battlefield that's a copy of another target creature except it's an enchantment in addition to its other types. It gains haste. Exile it at the beginning of the next end step. - Ability ability = new InspiredAbility(new DoIfCostPaid(new FelhideSpiritbinderEffect(), new ManaCostsImpl("{1}{R}"),"Use effect of {source}?")); + Ability ability = new InspiredAbility(new DoIfCostPaid(new FelhideSpiritbinderEffect(), new ManaCostsImpl("{1}{R}"), "Use effect of {source}?")); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } @@ -108,15 +108,16 @@ class FelhideSpiritbinderEffect extends OneShotEffect { if (permanent != null) { PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(null, CardType.ENCHANTMENT, true); effect.setTargetPointer(getTargetPointer()); - if (effect.apply(game, source) && effect.getAddedPermanent() != null) { - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(effect.getAddedPermanent().getId())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - + if (effect.apply(game, source)) { + for (Permanent tokenPermanent : effect.getAddedPermanent()) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } return true; } } diff --git a/Mage.Sets/src/mage/sets/bornofthegods/FloodtideSerpent.java b/Mage.Sets/src/mage/sets/bornofthegods/FloodtideSerpent.java index 0fcebf1fd79..16e5cd91835 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/FloodtideSerpent.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/FloodtideSerpent.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.PayCostToAttackBlockEffectImpl; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.combat.CantAttackBlockUnlessPaysSourceEffect; @@ -71,7 +71,7 @@ public class FloodtideSerpent extends CardImpl { // Floodtide Serpent can't attack unless you return an enchantment you control to its owner's hand (This cost is paid as attackers are declared.) this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackBlockUnlessPaysSourceEffect( - new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)), PayCostToAttackBlockEffectImpl.RestrictType.ATTACK))); + new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)), PayCostToAttackBlockEffectImpl.RestrictType.ATTACK))); } @@ -106,7 +106,7 @@ class FloodtideSerpentReplacementEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player player = game.getPlayer(event.getPlayerId()); if (player != null) { - ReturnToHandTargetPermanentCost attackCost = new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)); + ReturnToHandChosenControlledPermanentCost attackCost = new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)); if (attackCost.canPay(source, source.getSourceId(), event.getPlayerId(), game) && player.chooseUse(Outcome.Neutral, "Return an enchantment you control to hand to attack?", source, game)) { if (attackCost.pay(source, game, source.getSourceId(), event.getPlayerId(), true)) { diff --git a/Mage.Sets/src/mage/sets/bornofthegods/ImpetuousSunchaser.java b/Mage.Sets/src/mage/sets/bornofthegods/ImpetuousSunchaser.java index 3e50e54d85d..2a8c1ac7024 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/ImpetuousSunchaser.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/ImpetuousSunchaser.java @@ -30,12 +30,10 @@ package mage.sets.bornofthegods; import java.util.UUID; import mage.MageInt; import mage.abilities.common.AttacksEachTurnStaticAbility; -import mage.abilities.effects.common.combat.AttacksIfAbleSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Duration; import mage.constants.Rarity; /** diff --git a/Mage.Sets/src/mage/sets/bornofthegods/KioraTheCrashingWave.java b/Mage.Sets/src/mage/sets/bornofthegods/KioraTheCrashingWave.java index e7d04f82ebb..ccfb16f61e7 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/KioraTheCrashingWave.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/KioraTheCrashingWave.java @@ -32,20 +32,18 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.PreventionEffectImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.continuous.PlayAdditionalLandsControllerEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; @@ -64,6 +62,7 @@ import mage.util.CardUtil; public class KioraTheCrashingWave extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("permanent an opponent control"); + static { filter.add(new ControllerPredicate(TargetController.OPPONENT)); } @@ -73,8 +72,7 @@ public class KioraTheCrashingWave extends CardImpl { this.expansionSetCode = "BNG"; this.subtype.add("Kiora"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(2)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(2)); // +1: Until your next turn, prevent all damage that would be dealt to and dealt by target permanent an opponent controls. LoyaltyAbility ability = new LoyaltyAbility(new KioraPreventionEffect(), 1); @@ -89,7 +87,6 @@ public class KioraTheCrashingWave extends CardImpl { // -5: You get an emblem with "At the beginning of your end step, put a 9/9 blue Kraken creature token onto the battlefield." this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new KioraEmblem()), -5)); - } public KioraTheCrashingWave(final KioraTheCrashingWave card) { @@ -126,10 +123,10 @@ class KioraPreventionEffect extends PreventionEffectImpl { @Override public void init(Ability source, Game game) { super.init(source, game); - for(UUID targetId :this.getTargetPointer().getTargets(game, source)) { + for (UUID targetId : this.getTargetPointer().getTargets(game, source)) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { - permanent.addInfo(new StringBuilder("kioraPrevention").append(getId()).toString(),CardUtil.addToolTipMarkTags("All damage that would be dealt to and dealt by this permanent is prevented."), game); + permanent.addInfo(new StringBuilder("kioraPrevention").append(getId()).toString(), CardUtil.addToolTipMarkTags("All damage that would be dealt to and dealt by this permanent is prevented."), game); } } } @@ -138,7 +135,7 @@ class KioraPreventionEffect extends PreventionEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game) && event instanceof DamageEvent) { Permanent targetPermanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - if (targetPermanent != null + if (targetPermanent != null && (event.getSourceId().equals(targetPermanent.getId()) || event.getTargetId().equals(targetPermanent.getId()))) { return true; } @@ -149,10 +146,10 @@ class KioraPreventionEffect extends PreventionEffectImpl { @Override public boolean isInactive(Ability source, Game game) { if (super.isInactive(source, game)) { - for(UUID targetId :this.getTargetPointer().getTargets(game, source)) { + for (UUID targetId : this.getTargetPointer().getTargets(game, source)) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { - permanent.addInfo(new StringBuilder("kioraPrevention").append(getId()).toString(),"", game); + permanent.addInfo(new StringBuilder("kioraPrevention").append(getId()).toString(), "", game); } } return true; @@ -162,9 +159,11 @@ class KioraPreventionEffect extends PreventionEffectImpl { } /** - * Emblem: "At the beginning of your end step, put a 9/9 blue Kraken creature token onto the battlefield." + * Emblem: "At the beginning of your end step, put a 9/9 blue Kraken creature + * token onto the battlefield." */ class KioraEmblem extends Emblem { + public KioraEmblem() { this.setName("EMBLEM: Kiora, the Crashing Wave"); Ability ability = new BeginningOfEndStepTriggeredAbility(Zone.COMMAND, new CreateTokenEffect(new KioraKrakenToken()), TargetController.YOU, null, false); diff --git a/Mage.Sets/src/mage/sets/bornofthegods/Mindreaver.java b/Mage.Sets/src/mage/sets/bornofthegods/Mindreaver.java index 231854d0afb..7d218025f4a 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/Mindreaver.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/Mindreaver.java @@ -58,8 +58,7 @@ import mage.target.TargetSpell; import mage.util.CardUtil; /** - import mage.constants.Outcome; -* + * * @author LevelX2 */ public class Mindreaver extends CardImpl { @@ -77,10 +76,10 @@ public class Mindreaver extends CardImpl { Ability ability = new HeroicAbility(new MindreaverExileEffect(), false); ability.addTarget(new TargetPlayer()); this.addAbility(ability); - - // {U}{U}, Sacrifice Mindreaver: Counter target spell with the same name as a card exiled with mindreaver. + + // {U}{U}, Sacrifice Mindreaver: Counter target spell with the same name as a card exiled with Mindreaver. ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{U}{U}")); - FilterSpell filter = new FilterSpell("spell with the same name as a card exiled with mindreaver"); + FilterSpell filter = new FilterSpell("spell with the same name as a card exiled with {this}"); filter.add(new MindreaverNamePredicate(this.getId())); ability.addTarget(new TargetSpell(filter)); ability.addCost(new SacrificeSourceCost()); @@ -116,12 +115,13 @@ class MindreaverExileEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { UUID exileId = CardUtil.getCardExileZoneId(game, source); + MageObject sourceObject = source.getSourceObject(game); Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source)); - if (opponent != null) { + if (opponent != null && sourceObject != null) { for (int i = 0; i < 3; i++) { Card card = opponent.getLibrary().getFromTop(game); if (card != null) { - card.moveToExile(exileId, "Mindreaver", source.getSourceId(), game); + card.moveToExile(exileId, sourceObject.getIdName(), source.getSourceId(), game); } } } @@ -130,29 +130,29 @@ class MindreaverExileEffect extends OneShotEffect { } class MindreaverNamePredicate implements Predicate { - + private final UUID sourceId; - + public MindreaverNamePredicate(UUID sourceId) { this.sourceId = sourceId; } - + @Override public boolean apply(MageObject input, Game game) { Set cardNames = new HashSet(); UUID exileId = CardUtil.getCardExileZoneId(game, sourceId); ExileZone exileZone = game.getExile().getExileZone(exileId); if (exileZone != null) { - for(Card card : exileZone.getCards(game)) { + for (Card card : exileZone.getCards(game)) { cardNames.add(card.getName()); } } - // If a player names a card, the player may name either half of a split card, but not both. + // If a player names a card, the player may name either half of a split card, but not both. // A split card has the chosen name if one of its two names matches the chosen name. if (input instanceof SplitCard) { - return cardNames.contains(((SplitCard)input).getLeftHalfCard().getName()) || cardNames.contains(((SplitCard)input).getRightHalfCard().getName()); - } else if (input instanceof Spell && ((Spell)input).getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)){ - SplitCard card = (SplitCard) ((Spell)input).getCard(); + return cardNames.contains(((SplitCard) input).getLeftHalfCard().getName()) || cardNames.contains(((SplitCard) input).getRightHalfCard().getName()); + } else if (input instanceof Spell && ((Spell) input).getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)) { + SplitCard card = (SplitCard) ((Spell) input).getCard(); return cardNames.contains(card.getLeftHalfCard().getName()) || cardNames.contains(card.getRightHalfCard().getName()); } else { return cardNames.contains(input.getName()); @@ -163,4 +163,4 @@ class MindreaverNamePredicate implements Predicate { public String toString() { return "spell with the same name as a card exiled with {source}"; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/MogisGodOfSlaughter.java b/Mage.Sets/src/mage/sets/bornofthegods/MogisGodOfSlaughter.java index 85fb229bf73..d5bd22552ac 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/MogisGodOfSlaughter.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/MogisGodOfSlaughter.java @@ -74,9 +74,9 @@ public class MogisGodOfSlaughter extends CardImpl { // As long as your devotion to black and red is less than seven, Mogis isn't a creature. Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ColoredManaSymbol.B, ColoredManaSymbol.R), 7); effect.setText("As long as your devotion to black and red is less than seven, Mogis isn't a creature"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); - - // At the beginning of each opponent's upkeep, Mogis deals 2 damage to that player unless he or she sacrifices a creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + + // At the beginning of each opponent's upkeep, Mogis deals 2 damage to that player unless he or she sacrifices a creature. effect = new DoUnlessTargetPaysCost(new DamageTargetEffect(2, false, "that player"), new SacrificeTargetCost(new TargetControlledCreaturePermanent()), "Sacrifice a creature? (otherwise you get 2 damage)"); effect.setText("Mogis deals 2 damage to that player unless he or she sacrifices a creature"); @@ -95,6 +95,7 @@ public class MogisGodOfSlaughter extends CardImpl { } class DoUnlessTargetPaysCost extends OneShotEffect { + private final OneShotEffect executingEffect; private final Cost cost; private final String userMessage; @@ -102,6 +103,7 @@ class DoUnlessTargetPaysCost extends OneShotEffect { public DoUnlessTargetPaysCost(OneShotEffect effect, Cost cost) { this(effect, cost, null); } + public DoUnlessTargetPaysCost(OneShotEffect effect, Cost cost, String userMessage) { super(Outcome.Benefit); this.executingEffect = effect; @@ -123,7 +125,7 @@ class DoUnlessTargetPaysCost extends OneShotEffect { if (player != null && mageObject != null) { String message = userMessage; if (message == null) { - message = new StringBuilder(getCostText()).append(" to prevent ").append(executingEffect.getText(source.getModes().getMode())).append("?").toString(); + message = getCostText() + " to prevent " + executingEffect.getText(source.getModes().getMode()) + "?"; } message = CardUtil.replaceSourceName(message, mageObject.getLogName()); cost.clearPaid(); @@ -132,8 +134,8 @@ class DoUnlessTargetPaysCost extends OneShotEffect { } if (!cost.isPaid()) { executingEffect.setTargetPointer(this.targetPointer); - return executingEffect.apply(game, source); - } + return executingEffect.apply(game, source); + } return true; } return false; @@ -153,8 +155,8 @@ class DoUnlessTargetPaysCost extends OneShotEffect { private String getCostText() { StringBuilder sb = new StringBuilder(); String costText = cost.getText(); - if (costText != null && - !costText.toLowerCase().startsWith("discard") + if (costText != null + && !costText.toLowerCase().startsWith("discard") && !costText.toLowerCase().startsWith("sacrifice") && !costText.toLowerCase().startsWith("remove")) { sb.append("pay "); diff --git a/Mage.Sets/src/mage/sets/bornofthegods/Ornitharch.java b/Mage.Sets/src/mage/sets/bornofthegods/Ornitharch.java index 4095a377198..930ff9345d3 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/Ornitharch.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/Ornitharch.java @@ -29,7 +29,6 @@ package mage.sets.bornofthegods; import java.util.UUID; import mage.MageInt; -import mage.ObjectColor; import mage.abilities.TriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.TributeNotPaidCondition; @@ -40,7 +39,7 @@ import mage.abilities.keyword.TributeAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.BirdToken; /** * @@ -63,7 +62,7 @@ public class Ornitharch extends CardImpl { // When Ornitharch enters the battlefield, if tribute wasn't paid, put two 1/1 white Bird creature tokens with flying onto the battlefield. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new BirdToken(), 2), false); this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), - "When {this} enters the battlefield, if its tribute wasn't paid, put two 1/1 white Bird creature tokens with flying onto the battlefield.")); + "When {this} enters the battlefield, if its tribute wasn't paid, put two 1/1 white Bird creature tokens with flying onto the battlefield.")); } public Ornitharch(final Ornitharch card) { @@ -75,20 +74,3 @@ public class Ornitharch extends CardImpl { return new Ornitharch(this); } } - -class BirdToken extends Token { - - public BirdToken() { - super("Bird", "1/1 white Bird creature tokens with flying"); - this.setOriginalExpansionSetCode("BNG"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Bird"); - power = new MageInt(1); - toughness = new MageInt(1); - - this.addAbility(FlyingAbility.getInstance()); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/bornofthegods/Peregrination.java b/Mage.Sets/src/mage/sets/bornofthegods/Peregrination.java index d5fdc7aca32..688d96d8083 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/Peregrination.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/Peregrination.java @@ -113,14 +113,13 @@ class PeregrinationEffect extends OneShotEffect { TargetCard target2 = new TargetCard(Zone.LIBRARY, filter); controller.choose(Outcome.Benefit, revealed, target2, game); Card card = revealed.get(target2.getFirstTarget(), game); - - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); revealed.remove(card); card = revealed.getCards(game).iterator().next(); - controller.moveCards(card, null, Zone.HAND, source, game); + controller.moveCards(card, Zone.HAND, source, game); } else if (target.getTargets().size() == 1) { Card card = revealed.getCards(game).iterator().next(); - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); } } diff --git a/Mage.Sets/src/mage/sets/bornofthegods/PillarOfWar.java b/Mage.Sets/src/mage/sets/bornofthegods/PillarOfWar.java index 7cad13237fc..cc7caa3973d 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/PillarOfWar.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/PillarOfWar.java @@ -1,78 +1,78 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.bornofthegods; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.common.EnchantedCondition; -import mage.abilities.decorator.ConditionalAsThoughEffect; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; -import mage.abilities.keyword.DefenderAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; - -/** - * - * @author LevelX2 - */ -public class PillarOfWar extends CardImpl { - - public PillarOfWar(UUID ownerId) { - super(ownerId, 160, "Pillar of War", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); - this.expansionSetCode = "BNG"; - this.subtype.add("Golem"); - - this.power = new MageInt(3); - this.toughness = new MageInt(3); - - // Defender - this.addAbility(DefenderAbility.getInstance()); - // As long as Pillar of War is enchanted, it can attack as though it didn't have defender. - Effect effect = new ConditionalAsThoughEffect( - new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), - new EnchantedCondition()); - effect.setText("As long as {this} is enchanted, it can attack as though it didn't have defender"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); - - } - - public PillarOfWar(final PillarOfWar card) { - super(card); - } - - @Override - public PillarOfWar copy() { - return new PillarOfWar(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.bornofthegods; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.EnchantedCondition; +import mage.abilities.decorator.ConditionalAsThoughEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class PillarOfWar extends CardImpl { + + public PillarOfWar(UUID ownerId) { + super(ownerId, 160, "Pillar of War", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "BNG"; + this.subtype.add("Golem"); + + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // As long as Pillar of War is enchanted, it can attack as though it didn't have defender. + Effect effect = new ConditionalAsThoughEffect( + new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), + new EnchantedCondition()); + effect.setText("As long as {this} is enchanted, it can attack as though it didn't have defender"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + + } + + public PillarOfWar(final PillarOfWar card) { + super(card); + } + + @Override + public PillarOfWar copy() { + return new PillarOfWar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/RaisedByWolves.java b/Mage.Sets/src/mage/sets/bornofthegods/RaisedByWolves.java index 9ae5c235150..d0f51973bd3 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/RaisedByWolves.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/RaisedByWolves.java @@ -28,7 +28,6 @@ package mage.sets.bornofthegods; import java.util.UUID; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -47,7 +46,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.WolfToken; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -92,16 +91,3 @@ public class RaisedByWolves extends CardImpl { return new RaisedByWolves(this); } } - -class WolfToken extends Token { - - public WolfToken() { - super("Wolf", "2/2 green Wolf creature token"); - this.setOriginalExpansionSetCode("BNG"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Wolf"); - power = new MageInt(2); - toughness = new MageInt(2); - } -} diff --git a/Mage.Sets/src/mage/sets/bornofthegods/SatyrNyxSmith.java b/Mage.Sets/src/mage/sets/bornofthegods/SatyrNyxSmith.java index 0c39cbb9c97..79f54d94c8f 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/SatyrNyxSmith.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/SatyrNyxSmith.java @@ -29,7 +29,6 @@ package mage.sets.bornofthegods; import java.util.UUID; import mage.MageInt; -import mage.ObjectColor; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DoIfCostPaid; diff --git a/Mage.Sets/src/mage/sets/bornofthegods/SpitefulReturned.java b/Mage.Sets/src/mage/sets/bornofthegods/SpitefulReturned.java index 3f132ca5074..93a3d82a419 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/SpitefulReturned.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/SpitefulReturned.java @@ -67,7 +67,7 @@ public class SpitefulReturned extends CardImpl { effect.setText("defending player loses 2 life"); this.addAbility(new SpitefulReturnedTriggeredAbility(effect)); // Enchanted creature gets +1/+1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1,1, Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); } public SpitefulReturned(final SpitefulReturned card) { @@ -105,7 +105,8 @@ class SpitefulReturnedTriggeredAbility extends TriggeredAbilityImpl { Permanent sourcePermanent = game.getPermanent(this.getSourceId()); if (sourcePermanent != null) { if (sourcePermanent.getCardType().contains(CardType.CREATURE)) { - if (event.getSourceId() == this.getSourceId()) { + if (event.getSourceId() != null + && event.getSourceId().equals(this.getSourceId())) { UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game); this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); return true; diff --git a/Mage.Sets/src/mage/sets/bornofthegods/UnravelTheAEther.java b/Mage.Sets/src/mage/sets/bornofthegods/UnravelTheAEther.java index 94705d22086..fd87b5d72d8 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/UnravelTheAEther.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/UnravelTheAEther.java @@ -53,17 +53,16 @@ public class UnravelTheAEther extends CardImpl { static { filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), - new CardTypePredicate(CardType.ENCHANTMENT))); + new CardTypePredicate(CardType.ENCHANTMENT))); } public UnravelTheAEther(UUID ownerId) { super(ownerId, 143, "Unravel the AEther", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); this.expansionSetCode = "BNG"; - // Choose target artifact or enchantment. Its owner shuffles it into his or her library. this.getSpellAbility().addEffect(new UnravelTheAEtherShuffleIntoLibraryEffect()); - Target target = new TargetPermanent(1,1,filter,true); + Target target = new TargetPermanent(1, 1, filter, false); this.getSpellAbility().addTarget(target); } @@ -76,6 +75,7 @@ public class UnravelTheAEther extends CardImpl { return new UnravelTheAEther(this); } } + class UnravelTheAEtherShuffleIntoLibraryEffect extends OneShotEffect { public UnravelTheAEtherShuffleIntoLibraryEffect() { @@ -96,7 +96,7 @@ class UnravelTheAEtherShuffleIntoLibraryEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null) { - if (permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true) ) { + if (permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true)) { game.getPlayer(permanent.getOwnerId()).shuffleLibrary(game); return true; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java index ac0d7e7614c..d1a0b5dda3c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java @@ -28,14 +28,11 @@ package mage.sets.championsofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ControlPermanentCost; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CountersCount; @@ -43,6 +40,10 @@ import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -54,7 +55,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class BloodthirstyOgre extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("Demon"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control a Demon"); + static { filter.add(new SubtypePredicate("Demon")); } @@ -71,11 +73,13 @@ public class BloodthirstyOgre extends CardImpl { // {T}: Put a devotion counter on Bloodthirsty Ogre this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.DEVOTION.createInstance()),new TapSourceCost())); + // {T}: Target creature gets -X/-X until end of turn, where X is the number of devotion counters on Bloodthirsty Ogre. Activate this ability only if you control a Demon. DynamicValue devotionCounters = new SignInversionDynamicValue(new CountersCount(CounterType.DEVOTION)); - Ability ability; - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(devotionCounters,devotionCounters, Duration.EndOfTurn, true),new TapSourceCost()); - ability.addCost(new ControlPermanentCost(filter)); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new BoostTargetEffect(devotionCounters,devotionCounters, Duration.EndOfTurn, true), + new TapSourceCost(), + new PermanentsOnTheBattlefieldCondition(filter)); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } @@ -87,6 +91,6 @@ public class BloodthirstyOgre extends CardImpl { @Override public BloodthirstyOgre copy() { return new BloodthirstyOgre(this); - } + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/CrushingPain.java b/Mage.Sets/src/mage/sets/championsofkamigawa/CrushingPain.java index 048fa176252..8d797e53819 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/CrushingPain.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/CrushingPain.java @@ -54,7 +54,7 @@ public class CrushingPain extends CardImpl { public CrushingPain (UUID ownerId) { super(ownerId, 162, "Crushing Pain", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); this.expansionSetCode = "CHK"; - + this.subtype.add("Arcane"); // Crushing Pain deals 6 damage to target creature that was dealt damage this turn. this.getSpellAbility().addEffect(new DamageTargetEffect(6)); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/EtherealHaze.java b/Mage.Sets/src/mage/sets/championsofkamigawa/EtherealHaze.java index 8c6eb77fe52..308de9cef81 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/EtherealHaze.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/EtherealHaze.java @@ -45,7 +45,7 @@ public class EtherealHaze extends CardImpl { public EtherealHaze (UUID ownerId) { super(ownerId, 9, "Ethereal Haze", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); this.expansionSetCode = "CHK"; - + this.subtype.add("Arcane"); // Prevent all damage that would be dealt by creatures this turn. this.getSpellAbility().addEffect(new PreventAllDamageByAllEffect(new FilterCreaturePermanent("creatures"), Duration.EndOfTurn, false)); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HallOfTheBanditLord.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HallOfTheBanditLord.java index b07a5806979..a23e783906b 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HallOfTheBanditLord.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HallOfTheBanditLord.java @@ -69,7 +69,7 @@ public class HallOfTheBanditLord extends CardImpl { // Hall of the Bandit Lord enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); - + // {T}, Pay 3 life: Add {1} to your mana pool. If that mana is spent on a creature spell, it gains haste. Mana mana = Mana.ColorlessMana; mana.setFlag(true); @@ -94,12 +94,12 @@ class HallOfTheBanditLordWatcher extends Watcher { private final Ability source; private final List creatures = new ArrayList<>(); - + HallOfTheBanditLordWatcher(Ability source) { super("HallOfTheBanditLordWatcher", WatcherScope.CARD); this.source = source; } - + HallOfTheBanditLordWatcher(final HallOfTheBanditLordWatcher watcher) { super(watcher); this.creatures.addAll(watcher.creatures); @@ -110,22 +110,25 @@ class HallOfTheBanditLordWatcher extends Watcher { public HallOfTheBanditLordWatcher copy() { return new HallOfTheBanditLordWatcher(this); } - + @Override public void watch(GameEvent event, Game game) { if (event.getType() == EventType.MANA_PAYED) { MageObject target = game.getObject(event.getTargetId()); - if (event.getSourceId() == this.getSourceId() && target != null && target.getCardType().contains(CardType.CREATURE) && event.getFlag()) { + if (event.getSourceId() != null + && event.getSourceId().equals(this.getSourceId()) + && target != null && target.getCardType().contains(CardType.CREATURE) + && event.getFlag()) { if (target instanceof Spell) { this.creatures.add(((Spell) target).getCard().getId()); } } } if (event.getType() == EventType.COUNTERED) { - if (creatures.contains(event.getTargetId())) { + if (creatures.contains(event.getTargetId())) { creatures.remove(event.getSourceId()); - } - } + } + } if (event.getType() == EventType.ZONE_CHANGE) { if (creatures.contains(event.getSourceId())) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; @@ -133,22 +136,22 @@ class HallOfTheBanditLordWatcher extends Watcher { if (zEvent.getToZone() == Zone.STACK) { creatures.remove(event.getSourceId()); } - } - } + } + } if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) { - if (creatures.contains(event.getSourceId())) { + if (creatures.contains(event.getSourceId())) { ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); effect.setTargetPointer(new FixedTarget(event.getSourceId())); game.addEffect(effect, source); creatures.remove(event.getSourceId()); - } + } } } - + @Override public void reset() { super.reset(); creatures.clear(); } - + } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HearthKami.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HearthKami.java index 1b9764a3912..8920c45bf6d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HearthKami.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HearthKami.java @@ -25,20 +25,19 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.championsofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; -import mage.abilities.costs.mana.*; +import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.Filter; import mage.filter.common.FilterArtifactPermanent; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; @@ -51,6 +50,8 @@ import mage.target.TargetPermanent; */ public class HearthKami extends CardImpl { + private final UUID originalId; + public HearthKami(UUID ownerId) { super(ownerId, 171, "Hearth Kami", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.expansionSetCode = "CHK"; @@ -63,12 +64,13 @@ public class HearthKami extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}")); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetPermanent(new FilterArtifactPermanent("artifact with converted mana cost X"))); + originalId = ability.getOriginalId(); this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SimpleActivatedAbility) { + if (ability.getOriginalId().equals(originalId)) { int xValue = ability.getManaCostsToPay().getX(); ability.getTargets().clear(); FilterArtifactPermanent filter = new FilterArtifactPermanent(new StringBuilder("artifact with converted mana cost ").append(xValue).toString()); @@ -80,6 +82,7 @@ public class HearthKami extends CardImpl { public HearthKami(final HearthKami card) { super(card); + this.originalId = card.originalId; } @Override diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Hinder.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Hinder.java index dac84fa0c2d..378e07cfa4a 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Hinder.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Hinder.java @@ -28,27 +28,12 @@ package mage.sets.championsofkamigawa; import java.util.UUID; +import mage.abilities.effects.common.CounterTargetWithReplacementEffect; +import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.ReplacementEffectImpl; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.constants.Duration; -import mage.constants.PhaseStep; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.events.ZoneChangeEvent; -import mage.game.stack.Spell; -import mage.game.stack.StackObject; -import mage.players.Player; import mage.target.TargetSpell; -import mage.target.targetpointer.FixedTarget; /** * @@ -61,7 +46,7 @@ public class Hinder extends CardImpl { this.expansionSetCode = "CHK"; // Counter target spell. If that spell is countered this way, put that card on the top or bottom of its owner's library instead of into that player's graveyard. - this.getSpellAbility().addEffect(new HinderEffect()); + this.getSpellAbility().addEffect(new CounterTargetWithReplacementEffect(Zone.LIBRARY, true)); this.getSpellAbility().addTarget(new TargetSpell()); } @@ -74,119 +59,3 @@ public class Hinder extends CardImpl { return new Hinder(this); } } - -class HinderEffect extends OneShotEffect { - - public HinderEffect() { - super(Outcome.Detriment); - this.staticText = "Counter target spell. If that spell is countered this way, put that card on the top or bottom of its owner's library instead of into that player's graveyard"; - } - - public HinderEffect(final HinderEffect effect) { - super(effect); - } - - @Override - public HinderEffect copy() { - return new HinderEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - UUID objectId = source.getFirstTarget(); - UUID sourceId = source.getSourceId(); - // counter code from Spellstack - StackObject stackObject = game.getStack().getStackObject(objectId); - MageObject sourceObject = game.getObject(sourceId); - if (stackObject != null && sourceObject != null) { - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) { - if ( stackObject instanceof Spell ) { - game.rememberLKI(objectId, Zone.STACK, (Spell)stackObject); - } - // Hinder specific code - ReplacementEffectImpl effect = new HinderReplacementEffect(); - effect.setTargetPointer(new FixedTarget(stackObject.getId())); - game.addEffect(effect, source); - // Hinder specific code end - game.informPlayers(new StringBuilder(stackObject.getName()).append(" is countered by ").append(sourceObject.getLogName()).toString()); - game.getStack().remove(stackObject); - stackObject.counter(sourceId, game); // tries to move to graveyard - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId())); - } else { - game.informPlayers(new StringBuilder(stackObject.getName()).append(" could not be countered by ").append(sourceObject.getLogName()).toString()); - } - return true; - } - return false; - // counter code from Spellstack end - } -} - -class HinderReplacementEffect extends ReplacementEffectImpl { - - private PhaseStep phaseStep; - - public HinderReplacementEffect() { - super(Duration.OneUse, Outcome.Benefit); - staticText = "If that spell is countered this way, put that card on the top or bottom of its owner's library instead of into that player's graveyard"; - phaseStep = null; - } - - public HinderReplacementEffect(final HinderReplacementEffect effect) { - super(effect); - phaseStep = effect.phaseStep; - } - - @Override - public HinderReplacementEffect copy() { - return new HinderReplacementEffect(this); - } - - @Override - public boolean isInactive(Ability source, Game game) { - if (!game.getPhase().getStep().getType().equals(phaseStep)) { - return true; - } - return super.isInactive(source, game); - } - - @Override - public void init(Ability source, Game game) { - phaseStep = game.getPhase().getStep().getType(); - super.init(source, game); - } - - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - MageObject targetObject = game.getObject(event.getTargetId()); - if (targetObject instanceof Card) { - Card card = (Card) targetObject; - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - boolean top = player.chooseUse(Outcome.Neutral, "Put " + card.getName() + " on top of the library? Otherwise it will be put on the bottom.", source, game); - if (card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, top, event.getAppliedEffects())) { - game.informPlayers(player.getLogName() + " has put " + card.getName() + " on " + (top ? "top" : "the bottom") + " of the library."); - } - return true; - } - } - return false; - } - - @Override - public boolean checksEventType(GameEvent event, Game game) { - return event.getType() == EventType.ZONE_CHANGE; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (((ZoneChangeEvent)event).getToZone().equals(Zone.GRAVEYARD)) { - MageObject mageObject = game.getLastKnownInformation(getTargetPointer().getFirst(game, source), Zone.STACK); - if (mageObject instanceof Spell) { - return ((Spell)mageObject).getSourceId().equals(event.getTargetId()); - } - } - return false; - } - -} diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java index a254027b6a5..3e81a41733e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java @@ -37,8 +37,6 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -51,11 +49,6 @@ import mage.target.targetpointer.FixedTarget; */ public class HorobiDeathsWail extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("Demon"); - static { - filter.add(new SubtypePredicate("Demon")); - } - public HorobiDeathsWail(UUID ownerId) { super(ownerId, 117, "Horobi, Death's Wail", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); this.expansionSetCode = "CHK"; @@ -67,6 +60,7 @@ public class HorobiDeathsWail extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); + // Whenever a creature becomes the target of a spell or ability, destroy that creature. this.addAbility(new HorobiDeathsWailAbility(new DestroyTargetEffect())); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java b/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java index 238a54f0116..006973f52e9 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java @@ -1,111 +1,108 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.championsofkamigawa; - -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.SearchEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.constants.Outcome; -import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.players.Player; -import mage.target.common.TargetCardInLibrary; - -/** - * - * @author Loki - */ -public class InameDeathAspect extends CardImpl { - - public InameDeathAspect(UUID ownerId) { - super(ownerId, 118, "Iname, Death Aspect", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); - this.expansionSetCode = "CHK"; - this.supertype.add("Legendary"); - this.subtype.add("Spirit"); - - this.power = new MageInt(4); - this.toughness = new MageInt(4); - this.addAbility(new EntersBattlefieldTriggeredAbility(new InameDeathAspectEffect(), true)); - } - - public InameDeathAspect(final InameDeathAspect card) { - super(card); - } - - @Override - public InameDeathAspect copy() { - return new InameDeathAspect(this); - } -} - -class InameDeathAspectEffect extends SearchEffect { - - private static final FilterCreatureCard filter = new FilterCreatureCard(); - - static { - filter.add(new SubtypePredicate("Spirit")); - } - - public InameDeathAspectEffect() { - super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Outcome.Neutral); - staticText = "search your library for any number of Spirit cards and put them into your graveyard. If you do, shuffle your library"; - } - - public InameDeathAspectEffect(final InameDeathAspectEffect effect) { - super(effect); - } - - @Override - public InameDeathAspectEffect copy() { - return new InameDeathAspectEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null && player.searchLibrary(target, game)) { - if (target.getTargets().size() > 0) { - player.moveCards(new CardsImpl(target.getTargets()), Zone.LIBRARY, Zone.GRAVEYARD, source, game); - } - player.shuffleLibrary(game); - return true; - } - return false; - } +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.championsofkamigawa; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.SearchEffect; +import mage.cards.CardImpl; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author Loki + */ +public class InameDeathAspect extends CardImpl { + + public InameDeathAspect(UUID ownerId) { + super(ownerId, 118, "Iname, Death Aspect", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "CHK"; + this.supertype.add("Legendary"); + this.subtype.add("Spirit"); + + this.power = new MageInt(4); + this.toughness = new MageInt(4); + this.addAbility(new EntersBattlefieldTriggeredAbility(new InameDeathAspectEffect(), true)); + } + + public InameDeathAspect(final InameDeathAspect card) { + super(card); + } + + @Override + public InameDeathAspect copy() { + return new InameDeathAspect(this); + } +} + +class InameDeathAspectEffect extends SearchEffect { + + private static final FilterCreatureCard filter = new FilterCreatureCard(); + + static { + filter.add(new SubtypePredicate("Spirit")); + } + + public InameDeathAspectEffect() { + super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Outcome.Neutral); + staticText = "search your library for any number of Spirit cards and put them into your graveyard. If you do, shuffle your library"; + } + + public InameDeathAspectEffect(final InameDeathAspectEffect effect) { + super(effect); + } + + @Override + public InameDeathAspectEffect copy() { + return new InameDeathAspectEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null && player.searchLibrary(target, game)) { + if (target.getTargets().size() > 0) { + player.moveCards(new CardsImpl(target.getTargets()), Zone.LIBRARY, Zone.GRAVEYARD, source, game); + } + player.shuffleLibrary(game); + return true; + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/InameLifeAspect.java b/Mage.Sets/src/mage/sets/championsofkamigawa/InameLifeAspect.java index f9352d28dc8..fc3414cf5e7 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/InameLifeAspect.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/InameLifeAspect.java @@ -28,20 +28,18 @@ package mage.sets.championsofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.DiesTriggeredAbility; -import mage.abilities.costs.common.ExileSourceFromGraveCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.ExileSourceEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; -import mage.constants.Zone; +import mage.constants.Rarity; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; @@ -107,8 +105,11 @@ class InameLifeAspectEffect extends OneShotEffect { MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { if (controller.chooseUse(outcome, "Exile " + sourceObject.getLogName() + " to return Spirit cards?", source, game)) { + Effect effect = new ReturnToHandTargetEffect(); + effect.setTargetPointer(getTargetPointer()); + effect.getTargetPointer().init(game, source); new ExileSourceEffect().apply(game, source); - return new ReturnToHandTargetEffect().apply(game, source); + return effect.apply(game, source); } return true; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/JunkyoBell.java b/Mage.Sets/src/mage/sets/championsofkamigawa/JunkyoBell.java index 7e1c9efce0f..da08e4cd46b 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/JunkyoBell.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/JunkyoBell.java @@ -25,13 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -41,8 +37,10 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.TargetController; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; @@ -58,8 +56,8 @@ public class JunkyoBell extends CardImpl { public JunkyoBell(UUID ownerId) { super(ownerId, 258, "Junkyo Bell", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "CHK"; - - // At the beginning of your upkeep, you may have target creature you control get +X/+X until end of turn, + + // At the beginning of your upkeep, you may have target creature you control get +X/+X until end of turn, // where X is the number of creatures you control. If you do, sacrifice that creature at the beginning of the next end step. PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()); Ability ability = new BeginningOfUpkeepTriggeredAbility(new BoostTargetEffect(amount, amount, Duration.EndOfTurn), TargetController.YOU, true); @@ -77,37 +75,36 @@ public class JunkyoBell extends CardImpl { return new JunkyoBell(this); } - -private class JunkyoBellSacrificeEffect extends OneShotEffect { + private class JunkyoBellSacrificeEffect extends OneShotEffect { - public JunkyoBellSacrificeEffect() { - super(Outcome.Sacrifice); - this.staticText = "If you do, sacrifice that creature at the beginning of the next end step"; - } - - public JunkyoBellSacrificeEffect(final JunkyoBellSacrificeEffect effect) { - super(effect); - } - - @Override - public JunkyoBellSacrificeEffect copy() { - return new JunkyoBellSacrificeEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent creature = game.getPermanent(source.getFirstTarget()); - if (creature != null) { - SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice boosted " + creature.getName()); - sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - return true; + public JunkyoBellSacrificeEffect() { + super(Outcome.Sacrifice); + this.staticText = "If you do, sacrifice that creature at the beginning of the next end step"; + } + + public JunkyoBellSacrificeEffect(final JunkyoBellSacrificeEffect effect) { + super(effect); + } + + @Override + public JunkyoBellSacrificeEffect copy() { + return new JunkyoBellSacrificeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanent(source.getFirstTarget()); + if (creature != null) { + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice boosted " + creature.getName(), source.getControllerId()); + sacrificeEffect.setTargetPointer(new FixedTarget(creature, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + return false; } - return false; } - } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KikiJikiMirrorBreaker.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KikiJikiMirrorBreaker.java index 3d8eac8a7cd..8eef2b60f3a 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KikiJikiMirrorBreaker.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KikiJikiMirrorBreaker.java @@ -28,10 +28,6 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; @@ -39,19 +35,21 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.targetpointer.FixedTarget; -import mage.util.CardUtil; /** * @@ -112,26 +110,20 @@ class KikiJikiMirrorBreakerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); - } - + Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); if (permanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - - token.addAbility(HasteAbility.getInstance()); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - - SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect(); - sacrificeEffect.setText("Sacrifice the token at the beginning of the next end step"); - sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, true); + effect.setTargetPointer(new FixedTarget(permanent, game)); + effect.apply(game, source); + for (Permanent addedToken : effect.getAddedPermanent()) { + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice the token at the beginning of the next end step", source.getControllerId()); + sacrificeEffect.setTargetPointer(new FixedTarget(addedToken.getId())); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } return true; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KondasBanner.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KondasBanner.java index 14109095917..ede835d57b0 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KondasBanner.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KondasBanner.java @@ -154,14 +154,16 @@ class KondasBannerColorBoostEffect extends BoostAllEffect { Permanent equipment = game.getPermanent(source.getSourceId()); if (equipment != null && equipment.getAttachedTo() != null) { Permanent equipedCreature = game.getPermanent(equipment.getAttachedTo()); - for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { - if (equipedCreature.getColor(game).shares(perm.getColor(game))) { - perm.addPower(power.calculate(game, source, this)); - perm.addToughness(toughness.calculate(game, source, this)); + if (equipedCreature != null) { + for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + if (equipedCreature.getColor(game).shares(perm.getColor(game))) { + perm.addPower(power.calculate(game, source, this)); + perm.addToughness(toughness.calculate(game, source, this)); + } } + return true; } - return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/MelokuTheCloudedMirror.java b/Mage.Sets/src/mage/sets/championsofkamigawa/MelokuTheCloudedMirror.java index d4e8b1e5690..f1678c2c14c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/MelokuTheCloudedMirror.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/MelokuTheCloudedMirror.java @@ -35,7 +35,7 @@ import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlyingAbility; @@ -66,7 +66,7 @@ public class MelokuTheCloudedMirror extends CardImpl { // {1}, Return a land you control to its owner's hand: Put a 1/1 blue Illusion creature token with flying onto the battlefield. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new MelokuTheCloudedMirrorToken(), 1), new GenericManaCost(1)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/MyojinOfInfiniteRage.java b/Mage.Sets/src/mage/sets/championsofkamigawa/MyojinOfInfiniteRage.java index bc9ef137476..ac250e6c060 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/MyojinOfInfiniteRage.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/MyojinOfInfiniteRage.java @@ -59,7 +59,7 @@ public class MyojinOfInfiniteRage extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("lands"); public MyojinOfInfiniteRage(UUID ownerId) { - super(ownerId, 181, "Myojin Of Infinite Rage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{7}{R}{R}{R}"); + super(ownerId, 181, "Myojin of Infinite Rage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{7}{R}{R}{R}"); this.expansionSetCode = "CHK"; this.supertype.add("Legendary"); this.subtype.add("Spirit"); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/NightDealings.java b/Mage.Sets/src/mage/sets/championsofkamigawa/NightDealings.java index 2a9ee7434df..79ca6d3680c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/NightDealings.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/NightDealings.java @@ -25,14 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleActivatedAbility; @@ -44,7 +39,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.Filter; import mage.filter.common.FilterNonlandCard; @@ -61,7 +59,7 @@ import mage.target.common.TargetCardInLibrary; */ public class NightDealings extends CardImpl { - public NightDealings (UUID ownerId) { + public NightDealings(UUID ownerId) { super(ownerId, 132, "Night Dealings", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); this.expansionSetCode = "CHK"; @@ -74,7 +72,7 @@ public class NightDealings extends CardImpl { this.addAbility(ability); } - public NightDealings (final NightDealings card) { + public NightDealings(final NightDealings card) { super(card); } @@ -83,7 +81,6 @@ public class NightDealings extends CardImpl { return new NightDealings(this); } - private class NightDealingsTriggeredAbility extends TriggeredAbilityImpl { public NightDealingsTriggeredAbility() { @@ -106,17 +103,17 @@ public class NightDealings extends CardImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - // to another player + // to another player if (this.getControllerId() != event.getTargetId()) { // a source you control UUID sourceControllerId = game.getControllerId(event.getSourceId()); - if (sourceControllerId != null && sourceControllerId == this.getControllerId()) { + if (sourceControllerId != null && sourceControllerId.equals(this.getControllerId())) { // save amount of damage to effect this.getEffects().get(0).setValue("damageAmount", event.getAmount()); return true; } } - return false; + return false; } @Override @@ -181,9 +178,9 @@ public class NightDealings extends CardImpl { int cmc = 0; for (Cost cost : source.getCosts()) { if (cost instanceof RemoveVariableCountersSourceCost) { - cmc = ((RemoveVariableCountersSourceCost)cost).getAmount(); + cmc = ((RemoveVariableCountersSourceCost) cost).getAmount(); } - } + } FilterNonlandCard filter = new FilterNonlandCard("nonland card with converted mana cost X = " + cmc); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, cmc)); @@ -192,8 +189,8 @@ public class NightDealings extends CardImpl { if (player.searchLibrary(target, game)) { Card card = player.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) { - card.moveToZone(Zone.HAND, source.getSourceId(), game, false); - + card.moveToZone(Zone.HAND, source.getSourceId(), game, false); + String name = "Reveal"; Cards cards = new CardsImpl(); cards.add(card); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/NineRingedBo.java b/Mage.Sets/src/mage/sets/championsofkamigawa/NineRingedBo.java index 6914d9ff5bb..8f5ac8aaffa 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/NineRingedBo.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/NineRingedBo.java @@ -28,27 +28,19 @@ package mage.sets.championsofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.ActivateAsSorceryActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.Effect; -import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.replacement.DealtDamageToCreatureBySourceDies; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.events.ZoneChangeEvent; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetCreaturePermanent; import mage.watchers.common.DamagedByWatcher; @@ -74,7 +66,7 @@ public class NineRingedBo extends CardImpl { Effect effect = new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn); effect.setText("If that creature would die this turn, exile it instead"); ability.addEffect(effect); - this.addAbility(ability); + this.addAbility(ability, new DamagedByWatcher()); } public NineRingedBo(final NineRingedBo card) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OniPossession.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OniPossession.java index bc1c23d49e2..44fd1be0eb2 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OniPossession.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OniPossession.java @@ -30,22 +30,26 @@ package mage.sets.championsofkamigawa; import java.util.ArrayList; import java.util.List; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.effects.common.continuous.SetCardSubtypeAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.TargetPermanent; -import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; /** @@ -54,7 +58,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class OniPossession extends CardImpl { - private static final List setSubtypes = new ArrayList(); + private static final List setSubtypes = new ArrayList<>(); + static { setSubtypes.add("Demon"); setSubtypes.add("Spirit"); @@ -67,13 +72,14 @@ public class OniPossession extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // At the beginning of your upkeep, sacrifice a creature. - Ability ability2 = new BeginningOfUpkeepTriggeredAbility(new SacrificeTargetEffect("sacrifice a creature"), TargetController.YOU, false); - ability2.addTarget(new TargetControlledCreaturePermanent(1,1, new FilterControlledCreaturePermanent(),false)); + Ability ability2 = new BeginningOfUpkeepTriggeredAbility( + new SacrificeControllerEffect(new FilterControlledCreaturePermanent(), 1, ""), TargetController.YOU, false); this.addAbility(ability2); // Enchanted creature gets +3/+3 and has trample. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield))); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java index 242e3557c13..ca6ed57092f 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -28,24 +28,19 @@ package mage.sets.championsofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.CountersCount; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.game.permanent.token.SnakeToken; /** @@ -58,10 +53,10 @@ public class OrochiHatchery extends CardImpl { this.expansionSetCode = "CHK"; // Orochi Hatchery enters the battlefield with X charge counters on it. - this.addAbility(new EntersBattlefieldAbility(new OrochiHatcheryEffect(), "with X charge counters on it")); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.CHARGE.createInstance()))); // {5}, {T}: Put a 1/1 green Snake creature token onto the battlefield for each charge counter on Orochi Hatchery. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SnakeToken(),new CountersCount(CounterType.CHARGE)), new GenericManaCost(5)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SnakeToken(), new CountersCount(CounterType.CHARGE)), new GenericManaCost(5)); ability.addCost(new TapSourceCost()); this.addAbility(ability); } @@ -76,35 +71,3 @@ public class OrochiHatchery extends CardImpl { } } - -class OrochiHatcheryEffect extends OneShotEffect { - public OrochiHatcheryEffect() { - super(Outcome.Benefit); - } - - public OrochiHatcheryEffect(final OrochiHatcheryEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public OrochiHatcheryEffect copy() { - return new OrochiHatcheryEffect(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OtherworldlyJourney.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OtherworldlyJourney.java index 00a11497edb..248b962c6f1 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OtherworldlyJourney.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OtherworldlyJourney.java @@ -25,14 +25,10 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.championsofkamigawa; import java.util.UUID; import mage.MageObjectReference; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; @@ -40,12 +36,15 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.ReplacementEffectImpl; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.ExileZone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -61,7 +60,7 @@ public class OtherworldlyJourney extends CardImpl { super(ownerId, 37, "Otherworldly Journey", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - + // Exile target creature. At the beginning of the next end step, return that card to the battlefield under its owner's control with a +1/+1 counter on it. this.getSpellAbility().addEffect(new OtherworldlyJourneyEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); @@ -82,7 +81,7 @@ class OtherworldlyJourneyEffect extends OneShotEffect { private static final String effectText = "Exile target creature. At the beginning of the next end step, return that card to the battlefield under its owner's control with a +1/+1 counter on it"; - OtherworldlyJourneyEffect ( ) { + OtherworldlyJourneyEffect() { super(Outcome.Benefit); staticText = effectText; } @@ -102,12 +101,12 @@ class OtherworldlyJourneyEffect extends OneShotEffect { Card card = game.getCard(permanent.getId()); if (card != null) { //create delayed triggered ability - DelayedTriggeredAbility delayedAbility = - new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new OtherworldlyJourneyReturnFromExileEffect(new MageObjectReference(card, game))); + DelayedTriggeredAbility delayedAbility + = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new OtherworldlyJourneyReturnFromExileEffect(new MageObjectReference(card, game))); delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setControllerId(source.getControllerId()); delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + game.addDelayedTriggeredAbility(delayedAbility); } } return true; @@ -126,6 +125,7 @@ class OtherworldlyJourneyEffect extends OneShotEffect { class OtherworldlyJourneyReturnFromExileEffect extends OneShotEffect { MageObjectReference objectToReturn; + public OtherworldlyJourneyReturnFromExileEffect(MageObjectReference objectToReturn) { super(Outcome.PutCardInPlay); this.objectToReturn = objectToReturn; @@ -148,19 +148,18 @@ class OtherworldlyJourneyReturnFromExileEffect extends OneShotEffect { if (card != null && objectToReturn.refersTo(card, game)) { Player owner = game.getPlayer(card.getOwnerId()); if (owner != null) { - game.addEffect(new OtherworldlyJourneyEntersBattlefieldEffect(objectToReturn), source); - owner.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); + game.addEffect(new OtherworldlyJourneyEntersBattlefieldEffect(objectToReturn), source); + owner.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, true, null); } } return true; } } - class OtherworldlyJourneyEntersBattlefieldEffect extends ReplacementEffectImpl { - + MageObjectReference objectToReturn; - + public OtherworldlyJourneyEntersBattlefieldEffect(MageObjectReference objectToReturn) { super(Duration.Custom, Outcome.BoostCreature); this.objectToReturn = objectToReturn; @@ -187,7 +186,7 @@ class OtherworldlyJourneyEntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(event.getTargetId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null) { permanent.addCounters(CounterType.P1P1.createInstance(), game); discard(); // use only once diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Reciprocate.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Reciprocate.java index 65eac2b615a..5098fa1427c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Reciprocate.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Reciprocate.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.championsofkamigawa; import java.util.HashSet; @@ -48,8 +47,8 @@ import mage.watchers.common.PlayerDamagedBySourceWatcher; */ public class Reciprocate extends CardImpl { - public Reciprocate(UUID ownerId) { - super(ownerId, 40, "Reciprocate", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + public Reciprocate(UUID ownerId) { + super(ownerId, 40, "Reciprocate", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); this.expansionSetCode = "CHK"; // Exile target creature that dealt damage to you this turn. @@ -81,7 +80,7 @@ class ReciprocateTarget extends TargetPermanent { @Override public boolean canTarget(UUID id, Ability source, Game game) { - PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get("PlayerDamagedBySource",source.getControllerId()); + PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get("PlayerDamagedBySource", source.getControllerId()); if (watcher != null && watcher.hasSourceDoneDamage(id, game)) { return super.canTarget(id, source, game); } @@ -95,7 +94,7 @@ class ReciprocateTarget extends TargetPermanent { PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get("PlayerDamagedBySource", sourceControllerId); for (UUID targetId : availablePossibleTargets) { Permanent permanent = game.getPermanent(targetId); - if(permanent != null && watcher != null && watcher.hasSourceDoneDamage(targetId, game)){ + if (permanent != null && watcher != null && watcher.hasSourceDoneDamage(targetId, game)) { possibleTargets.add(targetId); } } @@ -111,14 +110,14 @@ class ReciprocateTarget extends TargetPermanent { int count = 0; MageObject targetSource = game.getObject(sourceId); PlayerDamagedBySourceWatcher watcher = (PlayerDamagedBySourceWatcher) game.getState().getWatchers().get("PlayerDamagedBySource", sourceControllerId); - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { - if (!targets.containsKey(permanent.getId()) && permanent.canBeTargetedBy(targetSource, sourceControllerId, game) + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { + if (!targets.containsKey(permanent.getId()) && permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && watcher != null && watcher.hasSourceDoneDamage(permanent.getId(), game)) { - count++; - if (count >= remainingTargets) { - return true; - } + count++; + if (count >= remainingTargets) { + return true; } + } } return false; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Reweave.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Reweave.java index 665831faad9..6a82d96309c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Reweave.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Reweave.java @@ -28,6 +28,7 @@ package mage.sets.championsofkamigawa; import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.SpliceOntoArcaneAbility; @@ -58,7 +59,6 @@ public class Reweave extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - // Target permanent's controller sacrifices it. If he or she does, that player reveals cards from the top of his or her library until he or she reveals a permanent card that shares a card type with the sacrificed permanent, puts that card onto the battlefield, then shuffles his or her library. this.getSpellAbility().addEffect(new ReweaveEffect()); Target target = new TargetPermanent(); @@ -97,9 +97,10 @@ class ReweaveEffect extends OneShotEffect { } @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); - if (permanent != null) { + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + MageObject sourceObject = source.getSourceObject(game); + if (permanent != null && sourceObject != null) { if (permanent.sacrifice(source.getSourceId(), game)) { Player permanentController = game.getPlayer(permanent.getControllerId()); if (permanentController != null) { @@ -122,11 +123,11 @@ class ReweaveEffect extends OneShotEffect { } } } while (!cardFound && library.size() > 0); - permanentController.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + permanentController.moveCards(card, Zone.BATTLEFIELD, source, game); } if (cards.size() > 0) { - permanentController.revealCards("Reweave", cards, game); + permanentController.revealCards(sourceObject.getIdName(), cards, game); if (cardFound && card != null) { cards.remove(card); } @@ -137,7 +138,7 @@ class ReweaveEffect extends OneShotEffect { return true; } return false; - } + } } return true; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/RyuseiTheFallingStar.java b/Mage.Sets/src/mage/sets/championsofkamigawa/RyuseiTheFallingStar.java index 22072830492..db772aa455f 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/RyuseiTheFallingStar.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/RyuseiTheFallingStar.java @@ -53,7 +53,7 @@ public class RyuseiTheFallingStar extends CardImpl { } public RyuseiTheFallingStar(UUID ownerID) { - super(ownerID, 185, "Ryusei, The Falling Star", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}"); + super(ownerID, 185, "Ryusei, the Falling Star", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}"); this.expansionSetCode = "CHK"; this.supertype.add("Legendary"); this.subtype.add("Dragon"); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/ShimatsuTheBloodcloaked.java b/Mage.Sets/src/mage/sets/championsofkamigawa/ShimatsuTheBloodcloaked.java index 49f139f2639..958837afe7a 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/ShimatsuTheBloodcloaked.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/ShimatsuTheBloodcloaked.java @@ -28,16 +28,20 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.constants.*; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterControlledPermanent; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -61,7 +65,7 @@ public class ShimatsuTheBloodcloaked extends CardImpl { this.toughness = new MageInt(0); // As Shimatsu the Bloodcloaked enters the battlefield, sacrifice any number of permanents. Shimatsu enters the battlefield with that many +1/+1 counters on it. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ShimatsuTheBloodcloakedEffect())); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new ShimatsuTheBloodcloakedEffect())); } public ShimatsuTheBloodcloaked(final ShimatsuTheBloodcloaked card) { @@ -75,16 +79,16 @@ public class ShimatsuTheBloodcloaked extends CardImpl { } class ShimatsuTheBloodcloakedEffect extends ReplacementEffectImpl { - + public ShimatsuTheBloodcloakedEffect() { - super(Duration.WhileOnBattlefield, Outcome.BoostCreature); + super(Duration.EndOfGame, Outcome.BoostCreature); this.staticText = "As {this} enters the battlefield, sacrifice any number of permanents. {this} enters the battlefield with that many +1/+1 counters on it"; } - + public ShimatsuTheBloodcloakedEffect(final ShimatsuTheBloodcloakedEffect effect) { super(effect); } - + @Override public ShimatsuTheBloodcloakedEffect copy() { return new ShimatsuTheBloodcloakedEffect(this); @@ -94,15 +98,15 @@ class ShimatsuTheBloodcloakedEffect extends ReplacementEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - return event.getTargetId().equals(source.getSourceId()); + return event.getTargetId().equals(source.getSourceId()); } - + @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getTargetId()); + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); Player controller = game.getPlayer(source.getControllerId()); if (creature != null && controller != null) { Target target = new TargetControlledPermanent(0, Integer.MAX_VALUE, new FilterControlledPermanent(), true); @@ -112,8 +116,8 @@ class ShimatsuTheBloodcloakedEffect extends ReplacementEffectImpl { controller.chooseTarget(Outcome.Detriment, target, source, game); if (target.getTargets().size() > 0) { int sacrificedCreatures = target.getTargets().size(); - game.informPlayers(new StringBuilder(controller.getLogName()).append(" sacrifices ").append(sacrificedCreatures).append(" creatures for ").append(creature.getName()).toString()); - for (UUID targetId: target.getTargets()) { + game.informPlayers(controller.getLogName() + " sacrifices " + sacrificedCreatures + " creatures for " + creature.getLogName()); + for (UUID targetId : target.getTargets()) { Permanent targetCreature = game.getPermanent(targetId); if (targetCreature == null || !targetCreature.sacrifice(source.getSourceId(), game)) { return false; @@ -124,5 +128,5 @@ class ShimatsuTheBloodcloakedEffect extends ReplacementEffectImpl { } return false; } - + } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SiftThroughSands.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SiftThroughSands.java index 58e84d068ab..2e2206feef0 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SiftThroughSands.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SiftThroughSands.java @@ -32,8 +32,8 @@ import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.discard.DiscardControllerEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.discard.DiscardControllerEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -56,6 +56,7 @@ public class SiftThroughSands extends CardImpl { private static final String rule = "If you've cast a spell named Peer Through Depths and a spell named Reach Through Mists this turn, you may search your library for a card named The Unspeakable, put it onto the battlefield, then shuffle your library"; private static final FilterCreatureCard filter = new FilterCreatureCard("a card named The Unspeakable"); + static { filter.add(new NamePredicate("The Unspeakable")); } @@ -65,13 +66,12 @@ public class SiftThroughSands extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - // Draw two cards, then discard a card. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2)); Effect effect = new DiscardControllerEffect(1); effect.setText(", then discard a card"); this.getSpellAbility().addEffect(effect); - + // If you've cast a spell named Peer Through Depths and a spell named Reach Through Mists this turn, you may search your library for a card named The Unspeakable, put it onto the battlefield, then shuffle your library. this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), false, true), new SiftThroughSandsCondition(), rule)); this.getSpellAbility().addWatcher(new SiftThroughSandsWatcher()); @@ -125,7 +125,7 @@ class SiftThroughSandsWatcher extends Watcher { return; } if (event.getType() == EventType.SPELL_CAST - && controllerId == event.getPlayerId()) { + && controllerId.equals(event.getPlayerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell.getCard().getName().equals("Peer Through Depths")) { castPeerThroughDepths = true; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiCloudskater.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiCloudskater.java index bbcd6a5665e..4832aa5cd82 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiCloudskater.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiCloudskater.java @@ -25,21 +25,20 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.championsofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.DrawDiscardControllerEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; import mage.target.common.TargetControlledPermanent; @@ -65,7 +64,7 @@ public class SoratamiCloudskater extends CardImpl { // {2}, Return a land you control to its owner's hand: Draw a card, then discard a card. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawDiscardControllerEffect(), new GenericManaCost(2)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(1, 1, filter, true))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorGuard.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorGuard.java index c429582b1d1..f06f9b1ef96 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorGuard.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorGuard.java @@ -35,7 +35,7 @@ import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; import mage.abilities.keyword.FlyingAbility; @@ -74,7 +74,7 @@ public class SoratamiMirrorGuard extends CardImpl { // {2}, Return a land you control to its owner's hand: Target creature with power 2 or less can't be blocked this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(), new GenericManaCost(2)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetCreaturePermanent(filterCreature)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorMage.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorMage.java index 458fdc8a00c..e93013bedc7 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorMage.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorMage.java @@ -25,21 +25,20 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.championsofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; import mage.target.common.TargetControlledPermanent; @@ -66,7 +65,7 @@ public class SoratamiMirrorMage extends CardImpl { // {3}, Return three lands you control to their owner's hand: Return target creature to its owner's hand. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new GenericManaCost(3)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(3, 3, filter, false))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(3, 3, filter, true))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiRainshaper.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiRainshaper.java index 7f32cbe86db..3d0e59bc518 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiRainshaper.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiRainshaper.java @@ -35,7 +35,7 @@ import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.FlyingAbility; @@ -69,7 +69,7 @@ public class SoratamiRainshaper extends CardImpl { // {3}, Return a land you control to its owner's hand: Target creature you control gains shroud until end of turn. (It can't be the target of spells or abilities.) Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(ShroudAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(3)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSavant.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSavant.java index 1060fdd8b36..9d479f7d85e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSavant.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSavant.java @@ -35,7 +35,7 @@ import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CounterUnlessPaysEffect; import mage.abilities.keyword.FlyingAbility; @@ -67,7 +67,7 @@ public class SoratamiSavant extends CardImpl { // {3}, Return a land you control to its owner's hand: Counter target spell unless its controller pays {3}. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(3)), new GenericManaCost(3)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetSpell()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSeer.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSeer.java index 344923e03db..9887cb743b1 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSeer.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSeer.java @@ -36,7 +36,7 @@ import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; @@ -70,7 +70,7 @@ public class SoratamiSeer extends CardImpl { // {4}, Return two lands you control to their owner's hand: Discard all the cards in your hand, then draw that many cards. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SoratamiSeerEffect(), new GenericManaCost(4)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(2, 2, filter, false))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2, 2, filter, false))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java index 29c128af844..8cdf926c72c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java @@ -29,17 +29,16 @@ package mage.sets.championsofkamigawa; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; @@ -76,7 +75,10 @@ public class SosukeSonOfSeshiro extends CardImpl { // Other Snake creatures you control get +1/+0. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 0, Duration.WhileOnBattlefield, filter, true))); // Whenever a Warrior you control deals combat damage to a creature, destroy that creature at end of combat. - this.addAbility(new SosukeSonOfSeshiroTriggeredAbility()); + Effect effect = new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); + effect.setText("destroy that creature at end of combat"); + this.addAbility(new SosukeSonOfSeshiroTriggeredAbility(effect)); } public SosukeSonOfSeshiro(final SosukeSonOfSeshiro card) { @@ -91,8 +93,8 @@ public class SosukeSonOfSeshiro extends CardImpl { class SosukeSonOfSeshiroTriggeredAbility extends TriggeredAbilityImpl { - SosukeSonOfSeshiroTriggeredAbility() { - super(Zone.BATTLEFIELD, new SosukeSonOfSeshiroEffect()); + SosukeSonOfSeshiroTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); } SosukeSonOfSeshiroTriggeredAbility(final SosukeSonOfSeshiroTriggeredAbility ability) { @@ -128,35 +130,3 @@ class SosukeSonOfSeshiroTriggeredAbility extends TriggeredAbilityImpl { return "Whenever a Warrior you control deals combat damage to a creature, destroy that creature at end of combat."; } } - -class SosukeSonOfSeshiroEffect extends OneShotEffect { - - SosukeSonOfSeshiroEffect() { - super(Outcome.DestroyPermanent); - staticText = "destroy that creature at end of combat"; - } - - SosukeSonOfSeshiroEffect(final SosukeSonOfSeshiroEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - if (targetCreature != null) { - AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId())); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - return false; - } - - @Override - public SosukeSonOfSeshiroEffect copy() { - return new SosukeSonOfSeshiroEffect(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java index a9e7ff37dbf..1cd6c9b8a55 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java @@ -35,9 +35,10 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.ExileSourceCost; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlSourceEffect; +import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect; import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.FlyingAbility; @@ -51,6 +52,7 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.target.targetpointer.FixedTarget; @@ -73,7 +75,7 @@ public class TatsumasaTheDragonsFang extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TatsumaTheDragonsFangEffect(), new GenericManaCost(6)); ability.addCost(new ExileSourceCost(true)); this.addAbility(ability); - + // Equip {3} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); } @@ -106,14 +108,21 @@ class TatsumaTheDragonsFangEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - CreateTokenEffect effect = new CreateTokenEffect(new TatsumaDragonToken()); + CreateTokenEffect effect = new CreateTokenEffect(new TatsumaDragonToken()); effect.apply(game, source); - FixedTarget fixedTarget = new FixedTarget(effect.getLastAddedTokenId()); - DelayedTriggeredAbility delayedAbility = new TatsumaTheDragonsFangTriggeredAbility(fixedTarget); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + for (UUID tokenId : effect.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + FixedTarget fixedTarget = new FixedTarget(tokenPermanent, game); + Effect returnEffect = new ReturnToBattlefieldUnderOwnerControlTargetEffect(); + returnEffect.setTargetPointer(new FixedTarget(source.getSourceId(), game.getState().getZoneChangeCounter(source.getSourceId()))); + DelayedTriggeredAbility delayedAbility = new TatsumaTheDragonsFangTriggeredAbility(fixedTarget, returnEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } + } return true; } @@ -123,8 +132,8 @@ class TatsumaTheDragonsFangTriggeredAbility extends DelayedTriggeredAbility { protected FixedTarget fixedTarget; - public TatsumaTheDragonsFangTriggeredAbility(FixedTarget fixedTarget) { - super(new ReturnToBattlefieldUnderYourControlSourceEffect(), Duration.OneUse); + public TatsumaTheDragonsFangTriggeredAbility(FixedTarget fixedTarget, Effect effect) { + super(effect, Duration.OneUse); this.fixedTarget = fixedTarget; } @@ -155,11 +164,12 @@ class TatsumaTheDragonsFangTriggeredAbility extends DelayedTriggeredAbility { @Override public String getRule() { - return "Return {this} to the battlefield under its owner's control when that token dies." ; + return "Return {this} to the battlefield under its owner's control when that token dies."; } } class TatsumaDragonToken extends Token { + public TatsumaDragonToken() { super("Dragon Spirit", "5/5 blue Dragon Spirit creature token with flying"); cardType.add(CardType.CREATURE); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/ThroughTheBreach.java b/Mage.Sets/src/mage/sets/championsofkamigawa/ThroughTheBreach.java index 86980d0f771..f8510304312 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/ThroughTheBreach.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/ThroughTheBreach.java @@ -63,7 +63,6 @@ public class ThroughTheBreach extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - // You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step. this.getSpellAbility().addEffect(new ThroughTheBreachEffect()); // Splice onto Arcane {2}{R}{R} @@ -81,7 +80,7 @@ public class ThroughTheBreach extends CardImpl { } class ThroughTheBreachEffect extends OneShotEffect { - + private static final String choiceText = "Put a creature card from your hand onto the battlefield?"; public ThroughTheBreachEffect() { @@ -107,14 +106,14 @@ class ThroughTheBreachEffect extends OneShotEffect { if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - if (controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId())) { + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); - effect.setTargetPointer(new FixedTarget(permanent.getId())); + effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); - SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName()); - sacrificeEffect.setTargetPointer(new FixedTarget(card.getId())); + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName(), source.getControllerId()); + sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setControllerId(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/UnearthlyBlizzard.java b/Mage.Sets/src/mage/sets/championsofkamigawa/UnearthlyBlizzard.java index 242df18ed16..29f76f4196d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/UnearthlyBlizzard.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/UnearthlyBlizzard.java @@ -43,7 +43,7 @@ import mage.target.common.TargetCreaturePermanent; public class UnearthlyBlizzard extends CardImpl { public UnearthlyBlizzard(UUID ownerId) { - super(ownerId, 196, "Unearthly Blizzard", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); + super(ownerId, 196, "Unearthly Blizzard", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{R}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/UyoSilentProphet.java b/Mage.Sets/src/mage/sets/championsofkamigawa/UyoSilentProphet.java index 9b0b414d4ae..e3f4928b4fa 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/UyoSilentProphet.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/UyoSilentProphet.java @@ -34,7 +34,7 @@ import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.abilities.keyword.FlyingAbility; @@ -75,7 +75,7 @@ public class UyoSilentProphet extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // {2}, Return two lands you control to their owner's hand: Copy target instant or sorcery spell. You may choose new targets for the copy. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CopyTargetSpellEffect(), new GenericManaCost(2)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("lands"), false))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("lands"), false))); ability.addTarget(new TargetSpell(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/VassalsDuty.java b/Mage.Sets/src/mage/sets/championsofkamigawa/VassalsDuty.java index 71230bc44e6..abd2d87510e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/VassalsDuty.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/VassalsDuty.java @@ -31,8 +31,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.PreventionEffectData; -import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.RedirectionEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -42,8 +41,7 @@ import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; -import mage.players.Player; +import mage.target.TargetPlayer; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -53,6 +51,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class VassalsDuty extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("legendary creature you control"); + static { filter.add(new SupertypePredicate("Legendary")); } @@ -61,10 +60,9 @@ public class VassalsDuty extends CardImpl { super(ownerId, 48, "Vassal's Duty", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); this.expansionSetCode = "CHK"; - // {1}: The next 1 damage that would be dealt to target legendary creature you control this turn is dealt to you instead. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new VassalsDutyPreventDamageTargetEffect(Duration.EndOfTurn, 1), new GenericManaCost(1)); - ability.addTarget(new TargetControlledCreaturePermanent(1,1,filter, false)); + ability.addTarget(new TargetControlledCreaturePermanent(1, 1, filter, false)); this.addAbility(ability); } @@ -78,10 +76,10 @@ public class VassalsDuty extends CardImpl { } } -class VassalsDutyPreventDamageTargetEffect extends PreventionEffectImpl { +class VassalsDutyPreventDamageTargetEffect extends RedirectionEffect { public VassalsDutyPreventDamageTargetEffect(Duration duration, int amount) { - super(duration, amount, false); + super(duration, amount, true); staticText = "The next " + amount + " damage that would be dealt to target legendary creature you control this turn is dealt to you instead"; } @@ -94,29 +92,13 @@ class VassalsDutyPreventDamageTargetEffect extends PreventionEffectImpl { return new VassalsDutyPreventDamageTargetEffect(this); } - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - PreventionEffectData preventionResult = preventDamageAction(event, source, game); - // deal damage now - if (preventionResult.getPreventedDamage() > 0) { - UUID redirectTo = source.getControllerId(); - Player player = game.getPlayer(redirectTo); - if (player != null) { - game.informPlayers("Dealing " + preventionResult.getPreventedDamage() + " to " + player.getLogName() + " instead"); - // keep the original source id as it is redirecting - player.damage(preventionResult.getPreventedDamage(), event.getSourceId(), game, false, true); - } - } - // damage amount is reduced or set to 0 so complete replacement of damage event is never neccessary - return false; - } - @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (!this.used && super.applies(event, source, game)) { - if (event.getTargetId().equals(getTargetPointer().getFirst(game, source))) { - return game.getPermanent(event.getTargetId()) != null; - } + if (event.getTargetId().equals(getTargetPointer().getFirst(game, source))) { + TargetPlayer target = new TargetPlayer(); + target.add(source.getControllerId(), game); + redirectTarget = target; + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/YamabushisStorm.java b/Mage.Sets/src/mage/sets/championsofkamigawa/YamabushisStorm.java index 9ec4a27bccf..ad1ceef375e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/YamabushisStorm.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/YamabushisStorm.java @@ -77,45 +77,3 @@ public class YamabushisStorm extends CardImpl { } } - -class YamabushisStormEffect extends ReplacementEffectImpl { - - public YamabushisStormEffect() { - super(Duration.EndOfTurn, Outcome.Exile); - staticText = "If a creature dealt damage this way would die this turn, exile it instead"; - } - - public YamabushisStormEffect(final YamabushisStormEffect effect) { - super(effect); - } - - @Override - public YamabushisStormEffect copy() { - return new YamabushisStormEffect(this); - } - - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Player controller = game.getPlayer(source.getControllerId()); - Permanent permanent = ((ZoneChangeEvent) event).getTarget(); - if (controller != null && permanent != null) { - return controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true); - } - return false; - } - - @Override - public boolean checksEventType(GameEvent event, Game game) { - return event.getType() == EventType.ZONE_CHANGE; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (((ZoneChangeEvent) event).isDiesEvent()) { - DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); - return watcher != null && watcher.wasDamaged(event.getTargetId(), game); - } - return false; - } - -} diff --git a/Mage.Sets/src/mage/sets/chronicles/ActiveVolcano.java b/Mage.Sets/src/mage/sets/chronicles/ActiveVolcano.java new file mode 100644 index 00000000000..609dc9bf888 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/ActiveVolcano.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ActiveVolcano extends mage.sets.legends.ActiveVolcano { + + public ActiveVolcano(UUID ownerId) { + super(ownerId); + this.cardNumber = 43; + this.expansionSetCode = "CHR"; + } + + public ActiveVolcano(final ActiveVolcano card) { + super(card); + } + + @Override + public ActiveVolcano copy() { + return new ActiveVolcano(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/AkronLegionnaire.java b/Mage.Sets/src/mage/sets/chronicles/AkronLegionnaire.java new file mode 100644 index 00000000000..fa86851783d --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/AkronLegionnaire.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class AkronLegionnaire extends mage.sets.legends.AkronLegionnaire { + + public AkronLegionnaire(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "CHR"; + } + + public AkronLegionnaire(final AkronLegionnaire card) { + super(card); + } + + @Override + public AkronLegionnaire copy() { + return new AkronLegionnaire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/Aladdin.java b/Mage.Sets/src/mage/sets/chronicles/Aladdin.java new file mode 100644 index 00000000000..fc6e364fec4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/Aladdin.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class Aladdin extends mage.sets.masterseditioniv.Aladdin { + + public Aladdin(UUID ownerId) { + super(ownerId); + this.cardNumber = 44; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.RARE; // U1 + } + + public Aladdin(final Aladdin card) { + super(card); + } + + @Override + public Aladdin copy() { + return new Aladdin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/ArcadesSabboth.java b/Mage.Sets/src/mage/sets/chronicles/ArcadesSabboth.java new file mode 100644 index 00000000000..8da622b1bac --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/ArcadesSabboth.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ArcadesSabboth extends mage.sets.masterseditioniii.ArcadesSabboth { + + public ArcadesSabboth(UUID ownerId) { + super(ownerId); + this.cardNumber = 106; + this.expansionSetCode = "CHR"; + } + + public ArcadesSabboth(final ArcadesSabboth card) { + super(card); + } + + @Override + public ArcadesSabboth copy() { + return new ArcadesSabboth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/ArenaOfTheAncients.java b/Mage.Sets/src/mage/sets/chronicles/ArenaOfTheAncients.java new file mode 100644 index 00000000000..949c905e289 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/ArenaOfTheAncients.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ArenaOfTheAncients extends mage.sets.legends.ArenaOfTheAncients { + + public ArenaOfTheAncients(UUID ownerId) { + super(ownerId); + this.cardNumber = 71; + this.expansionSetCode = "CHR"; + } + + public ArenaOfTheAncients(final ArenaOfTheAncients card) { + super(card); + } + + @Override + public ArenaOfTheAncients copy() { + return new ArenaOfTheAncients(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/AshnodsAltar.java b/Mage.Sets/src/mage/sets/chronicles/AshnodsAltar.java new file mode 100644 index 00000000000..35e6c8a928e --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/AshnodsAltar.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class AshnodsAltar extends mage.sets.fifthedition.AshnodsAltar { + + public AshnodsAltar(UUID ownerId) { + super(ownerId); + this.cardNumber = 72; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.COMMON; + } + + public AshnodsAltar(final AshnodsAltar card) { + super(card); + } + + @Override + public AshnodsAltar copy() { + return new AshnodsAltar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/AshnodsTransmogrant.java b/Mage.Sets/src/mage/sets/chronicles/AshnodsTransmogrant.java new file mode 100644 index 00000000000..82f86a2c7e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/AshnodsTransmogrant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class AshnodsTransmogrant extends mage.sets.fifthedition.AshnodsTransmogrant { + + public AshnodsTransmogrant(UUID ownerId) { + super(ownerId); + this.cardNumber = 73; + this.expansionSetCode = "CHR"; + } + + public AshnodsTransmogrant(final AshnodsTransmogrant card) { + super(card); + } + + @Override + public AshnodsTransmogrant copy() { + return new AshnodsTransmogrant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/AzureDrake.java b/Mage.Sets/src/mage/sets/chronicles/AzureDrake.java new file mode 100644 index 00000000000..f101b17327b --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/AzureDrake.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class AzureDrake extends mage.sets.magic2011.AzureDrake { + + public AzureDrake(UUID ownerId) { + super(ownerId); + this.cardNumber = 15; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.UNCOMMON; + } + + public AzureDrake(final AzureDrake card) { + super(card); + } + + @Override + public AzureDrake copy() { + return new AzureDrake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/BarlsCage.java b/Mage.Sets/src/mage/sets/chronicles/BarlsCage.java new file mode 100644 index 00000000000..ce0b7e01fb8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/BarlsCage.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class BarlsCage extends mage.sets.thedark.BarlsCage { + + public BarlsCage(UUID ownerId) { + super(ownerId); + this.cardNumber = 74; + this.expansionSetCode = "CHR"; + } + + public BarlsCage(final BarlsCage card) { + super(card); + } + + @Override + public BarlsCage copy() { + return new BarlsCage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/BloodMoon.java b/Mage.Sets/src/mage/sets/chronicles/BloodMoon.java new file mode 100644 index 00000000000..5d9ec363d5c --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/BloodMoon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class BloodMoon extends mage.sets.ninthedition.BloodMoon { + + public BloodMoon(UUID ownerId) { + super(ownerId); + this.cardNumber = 46; + this.expansionSetCode = "CHR"; + } + + public BloodMoon(final BloodMoon card) { + super(card); + } + + @Override + public BloodMoon copy() { + return new BloodMoon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/BogRats.java b/Mage.Sets/src/mage/sets/chronicles/BogRats.java new file mode 100644 index 00000000000..43bdee011ee --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/BogRats.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class BogRats extends mage.sets.thedark.BogRats { + + public BogRats(UUID ownerId) { + super(ownerId); + this.cardNumber = 2; + this.expansionSetCode = "CHR"; + } + + public BogRats(final BogRats card) { + super(card); + } + + @Override + public BogRats copy() { + return new BogRats(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/BookOfRass.java b/Mage.Sets/src/mage/sets/chronicles/BookOfRass.java new file mode 100644 index 00000000000..0619b5de2bc --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/BookOfRass.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class BookOfRass extends mage.sets.thedark.BookOfRass { + + public BookOfRass(UUID ownerId) { + super(ownerId); + this.cardNumber = 75; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.RARE; + } + + public BookOfRass(final BookOfRass card) { + super(card); + } + + @Override + public BookOfRass copy() { + return new BookOfRass(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/Boomerang.java b/Mage.Sets/src/mage/sets/chronicles/Boomerang.java new file mode 100644 index 00000000000..fcbcab9d347 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/Boomerang.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Boomerang extends mage.sets.tenthedition.Boomerang { + + public Boomerang(UUID ownerId) { + super(ownerId); + this.cardNumber = 16; + this.expansionSetCode = "CHR"; + } + + public Boomerang(final Boomerang card) { + super(card); + } + + @Override + public Boomerang copy() { + return new Boomerang(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/CatWarriors.java b/Mage.Sets/src/mage/sets/chronicles/CatWarriors.java new file mode 100644 index 00000000000..c72a5f8e779 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/CatWarriors.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class CatWarriors extends mage.sets.fifthedition.CatWarriors { + + public CatWarriors(UUID ownerId) { + super(ownerId); + this.cardNumber = 30; + this.expansionSetCode = "CHR"; + } + + public CatWarriors(final CatWarriors card) { + super(card); + } + + @Override + public CatWarriors copy() { + return new CatWarriors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/Chromium.java b/Mage.Sets/src/mage/sets/chronicles/Chromium.java new file mode 100644 index 00000000000..d537746a3a3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/Chromium.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Chromium extends mage.sets.masterseditioniii.Chromium { + + public Chromium(UUID ownerId) { + super(ownerId); + this.cardNumber = 109; + this.expansionSetCode = "CHR"; + } + + public Chromium(final Chromium card) { + super(card); + } + + @Override + public Chromium copy() { + return new Chromium(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/CityOfBrass.java b/Mage.Sets/src/mage/sets/chronicles/CityOfBrass.java new file mode 100644 index 00000000000..734a42b855c --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/CityOfBrass.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class CityOfBrass extends mage.sets.seventhedition.CityOfBrass { + + public CityOfBrass(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "CHR"; + } + + public CityOfBrass(final CityOfBrass card) { + super(card); + } + + @Override + public CityOfBrass copy() { + return new CityOfBrass(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/ConcordantCrossroads.java b/Mage.Sets/src/mage/sets/chronicles/ConcordantCrossroads.java new file mode 100644 index 00000000000..3115c10a6ce --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/ConcordantCrossroads.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ConcordantCrossroads extends mage.sets.masterseditioniii.ConcordantCrossroads { + + public ConcordantCrossroads(UUID ownerId) { + super(ownerId); + this.cardNumber = 32; + this.expansionSetCode = "CHR"; + } + + public ConcordantCrossroads(final ConcordantCrossroads card) { + super(card); + } + + @Override + public ConcordantCrossroads copy() { + return new ConcordantCrossroads(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/CrawGiant.java b/Mage.Sets/src/mage/sets/chronicles/CrawGiant.java new file mode 100644 index 00000000000..11cb2e90afa --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/CrawGiant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class CrawGiant extends mage.sets.legends.CrawGiant { + + public CrawGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 33; + this.expansionSetCode = "CHR"; + } + + public CrawGiant(final CrawGiant card) { + super(card); + } + + @Override + public CrawGiant copy() { + return new CrawGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/eighthedition/GiantOctopus.java b/Mage.Sets/src/mage/sets/chronicles/CuombajjWitches.java similarity index 82% rename from Mage.Sets/src/mage/sets/eighthedition/GiantOctopus.java rename to Mage.Sets/src/mage/sets/chronicles/CuombajjWitches.java index 81c464613c1..dea6e097dff 100644 --- a/Mage.Sets/src/mage/sets/eighthedition/GiantOctopus.java +++ b/Mage.Sets/src/mage/sets/chronicles/CuombajjWitches.java @@ -25,7 +25,7 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ -package mage.sets.eighthedition; +package mage.sets.chronicles; import java.util.UUID; @@ -33,20 +33,20 @@ import java.util.UUID; * * @author LevelX2 */ -public class GiantOctopus extends mage.sets.seventhedition.GiantOctopus { +public class CuombajjWitches extends mage.sets.mastersedition.CuombajjWitches { - public GiantOctopus(UUID ownerId) { + public CuombajjWitches(UUID ownerId) { super(ownerId); this.cardNumber = 3; - this.expansionSetCode = "8ED"; + this.expansionSetCode = "CHR"; } - public GiantOctopus(final GiantOctopus card) { + public CuombajjWitches(final CuombajjWitches card) { super(card); } @Override - public GiantOctopus copy() { - return new GiantOctopus(this); + public CuombajjWitches copy() { + return new CuombajjWitches(this); } } diff --git a/Mage.Sets/src/mage/sets/chronicles/DAvenantArcher.java b/Mage.Sets/src/mage/sets/chronicles/DAvenantArcher.java new file mode 100644 index 00000000000..c730cf781a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/DAvenantArcher.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class DAvenantArcher extends mage.sets.fifthedition.DAvenantArcher { + + public DAvenantArcher(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "CHR"; + } + + public DAvenantArcher(final DAvenantArcher card) { + super(card); + } + + @Override + public DAvenantArcher copy() { + return new DAvenantArcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/DakkonBlackblade.java b/Mage.Sets/src/mage/sets/chronicles/DakkonBlackblade.java new file mode 100644 index 00000000000..c2e877d05de --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/DakkonBlackblade.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class DakkonBlackblade extends mage.sets.legends.DakkonBlackblade { + + public DakkonBlackblade(UUID ownerId) { + super(ownerId); + this.cardNumber = 110; + this.expansionSetCode = "CHR"; + } + + public DakkonBlackblade(final DakkonBlackblade card) { + super(card); + } + + @Override + public DakkonBlackblade copy() { + return new DakkonBlackblade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/DanceOfMany.java b/Mage.Sets/src/mage/sets/chronicles/DanceOfMany.java new file mode 100644 index 00000000000..70efd0bc8f8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/DanceOfMany.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class DanceOfMany extends mage.sets.thedark.DanceOfMany { + + public DanceOfMany(UUID ownerId) { + super(ownerId); + this.cardNumber = 17; + this.expansionSetCode = "CHR"; + } + + public DanceOfMany(final DanceOfMany card) { + super(card); + } + + @Override + public DanceOfMany copy() { + return new DanceOfMany(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/Dandan.java b/Mage.Sets/src/mage/sets/chronicles/Dandan.java new file mode 100644 index 00000000000..3c00a357d01 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/Dandan.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Dandan extends mage.sets.fifthedition.Dandan { + + public Dandan(UUID ownerId) { + super(ownerId); + this.cardNumber = 18; + this.expansionSetCode = "CHR"; + } + + public Dandan(final Dandan card) { + super(card); + } + + @Override + public Dandan copy() { + return new Dandan(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/DivineOffering.java b/Mage.Sets/src/mage/sets/chronicles/DivineOffering.java new file mode 100644 index 00000000000..3875e9ed8a7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/DivineOffering.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class DivineOffering extends mage.sets.mirrodinbesieged.DivineOffering { + + public DivineOffering(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "CHR"; + } + + public DivineOffering(final DivineOffering card) { + super(card); + } + + @Override + public DivineOffering copy() { + return new DivineOffering(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/ErhnamDjinn.java b/Mage.Sets/src/mage/sets/chronicles/ErhnamDjinn.java new file mode 100644 index 00000000000..f7504e6689f --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/ErhnamDjinn.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class ErhnamDjinn extends mage.sets.judgment.ErhnamDjinn { + + public ErhnamDjinn(UUID ownerId) { + super(ownerId); + this.cardNumber = 36; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.UNCOMMON; + } + + public ErhnamDjinn(final ErhnamDjinn card) { + super(card); + } + + @Override + public ErhnamDjinn copy() { + return new ErhnamDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/FallenAngel.java b/Mage.Sets/src/mage/sets/chronicles/FallenAngel.java new file mode 100644 index 00000000000..3399b9f7b4b --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/FallenAngel.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class FallenAngel extends mage.sets.seventhedition.FallenAngel { + + public FallenAngel(UUID ownerId) { + super(ownerId); + this.cardNumber = 4; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.UNCOMMON; + } + + public FallenAngel(final FallenAngel card) { + super(card); + } + + @Override + public FallenAngel copy() { + return new FallenAngel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/FeldonsCane.java b/Mage.Sets/src/mage/sets/chronicles/FeldonsCane.java new file mode 100644 index 00000000000..652f6cb1251 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/FeldonsCane.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class FeldonsCane extends mage.sets.timeshifted.FeldonsCane { + + public FeldonsCane(UUID ownerId) { + super(ownerId); + this.cardNumber = 77; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.COMMON; + } + + public FeldonsCane(final FeldonsCane card) { + super(card); + } + + @Override + public FeldonsCane copy() { + return new FeldonsCane(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/FireDrake.java b/Mage.Sets/src/mage/sets/chronicles/FireDrake.java new file mode 100644 index 00000000000..495eed1b302 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/FireDrake.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class FireDrake extends mage.sets.fifthedition.FireDrake { + + public FireDrake(UUID ownerId) { + super(ownerId); + this.cardNumber = 47; + this.expansionSetCode = "CHR"; + } + + public FireDrake(final FireDrake card) { + super(card); + } + + @Override + public FireDrake copy() { + return new FireDrake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/FlashFlood.java b/Mage.Sets/src/mage/sets/chronicles/FlashFlood.java new file mode 100644 index 00000000000..42961156fa0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/FlashFlood.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class FlashFlood extends mage.sets.legends.FlashFlood { + + public FlashFlood(UUID ownerId) { + super(ownerId); + this.cardNumber = 21; + this.expansionSetCode = "CHR"; + } + + public FlashFlood(final FlashFlood card) { + super(card); + } + + @Override + public FlashFlood copy() { + return new FlashFlood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/FountainOfYouth.java b/Mage.Sets/src/mage/sets/chronicles/FountainOfYouth.java new file mode 100644 index 00000000000..c1bcf6311d9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/FountainOfYouth.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class FountainOfYouth extends mage.sets.tenthedition.FountainOfYouth { + + public FountainOfYouth(UUID ownerId) { + super(ownerId); + this.cardNumber = 78; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.COMMON; + } + + public FountainOfYouth(final FountainOfYouth card) { + super(card); + } + + @Override + public FountainOfYouth copy() { + return new FountainOfYouth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/GoblinDiggingTeam.java b/Mage.Sets/src/mage/sets/chronicles/GoblinDiggingTeam.java new file mode 100644 index 00000000000..2e9152c2ef6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/GoblinDiggingTeam.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class GoblinDiggingTeam extends mage.sets.thedark.GoblinDiggingTeam { + + public GoblinDiggingTeam(UUID ownerId) { + super(ownerId); + this.cardNumber = 49; + this.expansionSetCode = "CHR"; + } + + public GoblinDiggingTeam(final GoblinDiggingTeam card) { + super(card); + } + + @Override + public GoblinDiggingTeam copy() { + return new GoblinDiggingTeam(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/GoblinsOfTheFlarg.java b/Mage.Sets/src/mage/sets/chronicles/GoblinsOfTheFlarg.java new file mode 100644 index 00000000000..fbe8a0072c9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/GoblinsOfTheFlarg.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class GoblinsOfTheFlarg extends mage.sets.thedark.GoblinsOfTheFlarg { + + public GoblinsOfTheFlarg(UUID ownerId) { + super(ownerId); + this.cardNumber = 51; + this.expansionSetCode = "CHR"; + } + + public GoblinsOfTheFlarg(final GoblinsOfTheFlarg card) { + super(card); + } + + @Override + public GoblinsOfTheFlarg copy() { + return new GoblinsOfTheFlarg(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java b/Mage.Sets/src/mage/sets/chronicles/HasranOgress.java similarity index 93% rename from Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java rename to Mage.Sets/src/mage/sets/chronicles/HasranOgress.java index 767c07fa5c3..6071dbb25af 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java +++ b/Mage.Sets/src/mage/sets/chronicles/HasranOgress.java @@ -25,21 +25,20 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ -package mage.sets.arabiannights; +package mage.sets.chronicles; import java.util.UUID; /** * - * @author LoneFox - + * @author LevelX2 */ public class HasranOgress extends mage.sets.masterseditioniv.HasranOgress { public HasranOgress(UUID ownerId) { super(ownerId); this.cardNumber = 6; - this.expansionSetCode = "ARN"; + this.expansionSetCode = "CHR"; } public HasranOgress(final HasranOgress card) { diff --git a/Mage.Sets/src/mage/sets/chronicles/HellsCaretaker.java b/Mage.Sets/src/mage/sets/chronicles/HellsCaretaker.java new file mode 100644 index 00000000000..a067672e161 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/HellsCaretaker.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class HellsCaretaker extends mage.sets.ninthedition.HellsCaretaker { + + public HellsCaretaker(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "CHR"; + } + + public HellsCaretaker(final HellsCaretaker card) { + super(card); + } + + @Override + public HellsCaretaker copy() { + return new HellsCaretaker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/HornOfDeafening.java b/Mage.Sets/src/mage/sets/chronicles/HornOfDeafening.java new file mode 100644 index 00000000000..cbd9780da1a --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/HornOfDeafening.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class HornOfDeafening extends mage.sets.legends.HornOfDeafening { + + public HornOfDeafening(UUID ownerId) { + super(ownerId); + this.cardNumber = 80; + this.expansionSetCode = "CHR"; + } + + public HornOfDeafening(final HornOfDeafening card) { + super(card); + } + + @Override + public HornOfDeafening copy() { + return new HornOfDeafening(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/IvoryGuardians.java b/Mage.Sets/src/mage/sets/chronicles/IvoryGuardians.java new file mode 100644 index 00000000000..2819a071d27 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/IvoryGuardians.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class IvoryGuardians extends mage.sets.legends.IvoryGuardians { + + public IvoryGuardians(UUID ownerId) { + super(ownerId); + this.cardNumber = 64; + this.expansionSetCode = "CHR"; + } + + public IvoryGuardians(final IvoryGuardians card) { + super(card); + } + + @Override + public IvoryGuardians copy() { + return new IvoryGuardians(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/JalumTome.java b/Mage.Sets/src/mage/sets/chronicles/JalumTome.java new file mode 100644 index 00000000000..baf68f49246 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/JalumTome.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class JalumTome extends mage.sets.seventhedition.JalumTome { + + public JalumTome(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "CHR"; + } + + public JalumTome(final JalumTome card) { + super(card); + } + + @Override + public JalumTome copy() { + return new JalumTome(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/Juxtapose.java b/Mage.Sets/src/mage/sets/chronicles/Juxtapose.java new file mode 100644 index 00000000000..78d68a0e715 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/Juxtapose.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Juxtapose extends mage.sets.fifthedition.Juxtapose { + + public Juxtapose(UUID ownerId) { + super(ownerId); + this.cardNumber = 22; + this.expansionSetCode = "CHR"; + } + + public Juxtapose(final Juxtapose card) { + super(card); + } + + @Override + public Juxtapose copy() { + return new Juxtapose(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/KeepersOfTheFaith.java b/Mage.Sets/src/mage/sets/chronicles/KeepersOfTheFaith.java new file mode 100644 index 00000000000..2ab714d0f34 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/KeepersOfTheFaith.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class KeepersOfTheFaith extends mage.sets.legends.KeepersOfTheFaith { + + public KeepersOfTheFaith(UUID ownerId) { + super(ownerId); + this.cardNumber = 65; + this.expansionSetCode = "CHR"; + } + + public KeepersOfTheFaith(final KeepersOfTheFaith card) { + super(card); + } + + @Override + public KeepersOfTheFaith copy() { + return new KeepersOfTheFaith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/KeiTakahashi.java b/Mage.Sets/src/mage/sets/chronicles/KeiTakahashi.java new file mode 100644 index 00000000000..2f6f3960acb --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/KeiTakahashi.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class KeiTakahashi extends mage.sets.masterseditioniii.KeiTakahashi { + + public KeiTakahashi(UUID ownerId) { + super(ownerId); + this.cardNumber = 113; + this.expansionSetCode = "CHR"; + } + + public KeiTakahashi(final KeiTakahashi card) { + super(card); + } + + @Override + public KeiTakahashi copy() { + return new KeiTakahashi(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/MarhaultElsdragon.java b/Mage.Sets/src/mage/sets/chronicles/MarhaultElsdragon.java new file mode 100644 index 00000000000..8e8e8cc446f --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/MarhaultElsdragon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class MarhaultElsdragon extends mage.sets.legends.MarhaultElsdragon { + + public MarhaultElsdragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 114; + this.expansionSetCode = "CHR"; + } + + public MarhaultElsdragon(final MarhaultElsdragon card) { + super(card); + } + + @Override + public MarhaultElsdragon copy() { + return new MarhaultElsdragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/MountainYeti.java b/Mage.Sets/src/mage/sets/chronicles/MountainYeti.java new file mode 100644 index 00000000000..ccac499bab6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/MountainYeti.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class MountainYeti extends mage.sets.legends.MountainYeti { + + public MountainYeti(UUID ownerId) { + super(ownerId); + this.cardNumber = 53; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.COMMON; + } + + public MountainYeti(final MountainYeti card) { + super(card); + } + + @Override + public MountainYeti copy() { + return new MountainYeti(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/NicolBolas.java b/Mage.Sets/src/mage/sets/chronicles/NicolBolas.java new file mode 100644 index 00000000000..f22cb409534 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/NicolBolas.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class NicolBolas extends mage.sets.legends.NicolBolas { + + public NicolBolas(UUID ownerId) { + super(ownerId); + this.cardNumber = 116; + this.expansionSetCode = "CHR"; + } + + public NicolBolas(final NicolBolas card) { + super(card); + } + + @Override + public NicolBolas copy() { + return new NicolBolas(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/PalladiaMors.java b/Mage.Sets/src/mage/sets/chronicles/PalladiaMors.java new file mode 100644 index 00000000000..9557eb555d1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/PalladiaMors.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class PalladiaMors extends mage.sets.masterseditioniii.PalladiaMors { + + public PalladiaMors(UUID ownerId) { + super(ownerId); + this.cardNumber = 117; + this.expansionSetCode = "CHR"; + } + + public PalladiaMors(final PalladiaMors card) { + super(card); + } + + @Override + public PalladiaMors copy() { + return new PalladiaMors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/Recall.java b/Mage.Sets/src/mage/sets/chronicles/Recall.java new file mode 100644 index 00000000000..796d838744b --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/Recall.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class Recall extends mage.sets.fifthedition.Recall { + + public Recall(UUID ownerId) { + super(ownerId); + this.cardNumber = 24; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.UNCOMMON; + } + + public Recall(final Recall card) { + super(card); + } + + @Override + public Recall copy() { + return new Recall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/RemoveSoul.java b/Mage.Sets/src/mage/sets/chronicles/RemoveSoul.java new file mode 100644 index 00000000000..2b747e9bd1d --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/RemoveSoul.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class RemoveSoul extends mage.sets.tenthedition.RemoveSoul { + + public RemoveSoul(UUID ownerId) { + super(ownerId); + this.cardNumber = 25; + this.expansionSetCode = "CHR"; + } + + public RemoveSoul(final RemoveSoul card) { + super(card); + } + + @Override + public RemoveSoul copy() { + return new RemoveSoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/RepentantBlacksmith.java b/Mage.Sets/src/mage/sets/chronicles/RepentantBlacksmith.java new file mode 100644 index 00000000000..8b2c4969154 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/RepentantBlacksmith.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class RepentantBlacksmith extends mage.sets.fifthedition.RepentantBlacksmith { + + public RepentantBlacksmith(UUID ownerId) { + super(ownerId); + this.cardNumber = 67; + this.expansionSetCode = "CHR"; + } + + public RepentantBlacksmith(final RepentantBlacksmith card) { + super(card); + } + + @Override + public RepentantBlacksmith copy() { + return new RepentantBlacksmith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/Revelation.java b/Mage.Sets/src/mage/sets/chronicles/Revelation.java new file mode 100644 index 00000000000..4da02eed941 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/Revelation.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Revelation extends mage.sets.legends.Revelation { + + public Revelation(UUID ownerId) { + super(ownerId); + this.cardNumber = 87; + this.expansionSetCode = "CHR"; + } + + public Revelation(final Revelation card) { + super(card); + } + + @Override + public Revelation copy() { + return new Revelation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/RubiniaSoulsinger.java b/Mage.Sets/src/mage/sets/chronicles/RubiniaSoulsinger.java new file mode 100644 index 00000000000..09bfe646c1e --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/RubiniaSoulsinger.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class RubiniaSoulsinger extends mage.sets.commander2013.RubiniaSoulsinger { + + public RubiniaSoulsinger(UUID ownerId) { + super(ownerId); + this.cardNumber = 118; + this.expansionSetCode = "CHR"; + } + + public RubiniaSoulsinger(final RubiniaSoulsinger card) { + super(card); + } + + @Override + public RubiniaSoulsinger copy() { + return new RubiniaSoulsinger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/SafeHaven.java b/Mage.Sets/src/mage/sets/chronicles/SafeHaven.java new file mode 100644 index 00000000000..e46fba9d594 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/SafeHaven.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SafeHaven extends mage.sets.thedark.SafeHaven { + + public SafeHaven(UUID ownerId) { + super(ownerId); + this.cardNumber = 93; + this.expansionSetCode = "CHR"; + } + + public SafeHaven(final SafeHaven card) { + super(card); + } + + @Override + public SafeHaven copy() { + return new SafeHaven(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/ScavengerFolk.java b/Mage.Sets/src/mage/sets/chronicles/ScavengerFolk.java new file mode 100644 index 00000000000..5949e815c89 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/ScavengerFolk.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ScavengerFolk extends mage.sets.fifthedition.ScavengerFolk { + + public ScavengerFolk(UUID ownerId) { + super(ownerId); + this.cardNumber = 41; + this.expansionSetCode = "CHR"; + } + + public ScavengerFolk(final ScavengerFolk card) { + super(card); + } + + @Override + public ScavengerFolk copy() { + return new ScavengerFolk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/Sentinel.java b/Mage.Sets/src/mage/sets/chronicles/Sentinel.java new file mode 100644 index 00000000000..f0804924335 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/Sentinel.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Sentinel extends mage.sets.legends.Sentinel { + + public Sentinel(UUID ownerId) { + super(ownerId); + this.cardNumber = 281; + this.expansionSetCode = "CHR"; + } + + public Sentinel(final Sentinel card) { + super(card); + } + + @Override + public Sentinel copy() { + return new Sentinel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/ShieldWall.java b/Mage.Sets/src/mage/sets/chronicles/ShieldWall.java new file mode 100644 index 00000000000..5c3fb0ba3a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/ShieldWall.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ShieldWall extends mage.sets.legends.ShieldWall { + + public ShieldWall(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "CHR"; + } + + public ShieldWall(final ShieldWall card) { + super(card); + } + + @Override + public ShieldWall copy() { + return new ShieldWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/SivitriScarzam.java b/Mage.Sets/src/mage/sets/chronicles/SivitriScarzam.java new file mode 100644 index 00000000000..def65aa7fc1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/SivitriScarzam.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SivitriScarzam extends mage.sets.legends.SivitriScarzam { + + public SivitriScarzam(UUID ownerId) { + super(ownerId); + this.cardNumber = 119; + this.expansionSetCode = "CHR"; + } + + public SivitriScarzam(final SivitriScarzam card) { + super(card); + } + + @Override + public SivitriScarzam copy() { + return new SivitriScarzam(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/SolkanarTheSwampKing.java b/Mage.Sets/src/mage/sets/chronicles/SolkanarTheSwampKing.java new file mode 100644 index 00000000000..99081a82801 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/SolkanarTheSwampKing.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class SolkanarTheSwampKing extends mage.sets.timeshifted.SolkanarTheSwampKing { + + public SolkanarTheSwampKing(UUID ownerId) { + super(ownerId); + this.cardNumber = 120; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.RARE; + } + + public SolkanarTheSwampKing(final SolkanarTheSwampKing card) { + super(card); + } + + @Override + public SolkanarTheSwampKing copy() { + return new SolkanarTheSwampKing(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/StormSeeker.java b/Mage.Sets/src/mage/sets/chronicles/StormSeeker.java new file mode 100644 index 00000000000..8d0515a2542 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/StormSeeker.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class StormSeeker extends mage.sets.mastersedition.StormSeeker { + + public StormSeeker(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "CHR"; + } + + public StormSeeker(final StormSeeker card) { + super(card); + } + + @Override + public StormSeeker copy() { + return new StormSeeker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/TheWretched.java b/Mage.Sets/src/mage/sets/chronicles/TheWretched.java new file mode 100644 index 00000000000..1b2326ce759 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/TheWretched.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class TheWretched extends mage.sets.fifthedition.TheWretched { + + public TheWretched(UUID ownerId) { + super(ownerId); + this.cardNumber = 11; + this.expansionSetCode = "CHR"; + } + + public TheWretched(final TheWretched card) { + super(card); + } + + @Override + public TheWretched copy() { + return new TheWretched(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/TobiasAndrion.java b/Mage.Sets/src/mage/sets/chronicles/TobiasAndrion.java new file mode 100644 index 00000000000..0ab33718406 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/TobiasAndrion.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class TobiasAndrion extends mage.sets.legends.TobiasAndrion { + + public TobiasAndrion(UUID ownerId) { + super(ownerId); + this.cardNumber = 122; + this.expansionSetCode = "CHR"; + } + + public TobiasAndrion(final TobiasAndrion card) { + super(card); + } + + @Override + public TobiasAndrion copy() { + return new TobiasAndrion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/TorWauki.java b/Mage.Sets/src/mage/sets/chronicles/TorWauki.java new file mode 100644 index 00000000000..4bc994b5666 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/TorWauki.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class TorWauki extends mage.sets.legends.TorWauki { + + public TorWauki(UUID ownerId) { + super(ownerId); + this.cardNumber = 123; + this.expansionSetCode = "CHR"; + } + + public TorWauki(final TorWauki card) { + super(card); + } + + @Override + public TorWauki copy() { + return new TorWauki(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/TormodsCrypt.java b/Mage.Sets/src/mage/sets/chronicles/TormodsCrypt.java new file mode 100644 index 00000000000..a6d5dc22cff --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/TormodsCrypt.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class TormodsCrypt extends mage.sets.timeshifted.TormodsCrypt { + + public TormodsCrypt(UUID ownerId) { + super(ownerId); + this.cardNumber = 89; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.COMMON; + } + + public TormodsCrypt(final TormodsCrypt card) { + super(card); + } + + @Override + public TormodsCrypt copy() { + return new TormodsCrypt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/Transmutation.java b/Mage.Sets/src/mage/sets/chronicles/Transmutation.java new file mode 100644 index 00000000000..a111c343cbe --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/Transmutation.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Transmutation extends mage.sets.legends.Transmutation { + + public Transmutation(UUID ownerId) { + super(ownerId); + this.cardNumber = 12; + this.expansionSetCode = "CHR"; + } + + public Transmutation(final Transmutation card) { + super(card); + } + + @Override + public Transmutation copy() { + return new Transmutation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/TriassicEgg.java b/Mage.Sets/src/mage/sets/chronicles/TriassicEgg.java new file mode 100644 index 00000000000..c847ab3d56e --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/TriassicEgg.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class TriassicEgg extends mage.sets.legends.TriassicEgg { + + public TriassicEgg(UUID ownerId) { + super(ownerId); + this.cardNumber = 90; + this.expansionSetCode = "CHR"; + } + + public TriassicEgg(final TriassicEgg card) { + super(card); + } + + @Override + public TriassicEgg copy() { + return new TriassicEgg(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasMine.java b/Mage.Sets/src/mage/sets/chronicles/UrzasMine.java similarity index 92% rename from Mage.Sets/src/mage/sets/antiquities/UrzasMine.java rename to Mage.Sets/src/mage/sets/chronicles/UrzasMine.java index 559743cbbb2..f72d01b125e 100644 --- a/Mage.Sets/src/mage/sets/antiquities/UrzasMine.java +++ b/Mage.Sets/src/mage/sets/chronicles/UrzasMine.java @@ -25,21 +25,21 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ -package mage.sets.antiquities; +package mage.sets.chronicles; import java.util.UUID; import mage.constants.Rarity; /** * - * @author North + * @author LevelX2 */ public class UrzasMine extends mage.sets.fifthedition.UrzasMine { public UrzasMine(UUID ownerId) { super(ownerId); - this.cardNumber = 75; - this.expansionSetCode = "ATQ"; + this.cardNumber = 94; + this.expansionSetCode = "CHR"; this.rarity = Rarity.UNCOMMON; } diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant.java b/Mage.Sets/src/mage/sets/chronicles/UrzasPowerPlant.java similarity index 92% rename from Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant.java rename to Mage.Sets/src/mage/sets/chronicles/UrzasPowerPlant.java index 2dbae8f015b..69f0205044c 100644 --- a/Mage.Sets/src/mage/sets/antiquities/UrzasPowerPlant.java +++ b/Mage.Sets/src/mage/sets/chronicles/UrzasPowerPlant.java @@ -25,21 +25,21 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ -package mage.sets.antiquities; +package mage.sets.chronicles; import java.util.UUID; import mage.constants.Rarity; /** * - * @author North + * @author LevelX2 */ public class UrzasPowerPlant extends mage.sets.fifthedition.UrzasPowerPlant { public UrzasPowerPlant(UUID ownerId) { super(ownerId); - this.cardNumber = 79; - this.expansionSetCode = "ATQ"; + this.cardNumber = 98; + this.expansionSetCode = "CHR"; this.rarity = Rarity.UNCOMMON; } diff --git a/Mage.Sets/src/mage/sets/antiquities/UrzasTower.java b/Mage.Sets/src/mage/sets/chronicles/UrzasTower.java similarity index 92% rename from Mage.Sets/src/mage/sets/antiquities/UrzasTower.java rename to Mage.Sets/src/mage/sets/chronicles/UrzasTower.java index dbca4117bf7..ffdca13343a 100644 --- a/Mage.Sets/src/mage/sets/antiquities/UrzasTower.java +++ b/Mage.Sets/src/mage/sets/chronicles/UrzasTower.java @@ -25,21 +25,21 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ -package mage.sets.antiquities; +package mage.sets.chronicles; import java.util.UUID; import mage.constants.Rarity; /** * - * @author North + * @author LevelX2 */ public class UrzasTower extends mage.sets.fifthedition.UrzasTower { public UrzasTower(UUID ownerId) { super(ownerId); - this.cardNumber = 83; - this.expansionSetCode = "ATQ"; + this.cardNumber = 102; + this.expansionSetCode = "CHR"; this.rarity = Rarity.UNCOMMON; } diff --git a/Mage.Sets/src/mage/sets/chronicles/VaevictisAsmadi.java b/Mage.Sets/src/mage/sets/chronicles/VaevictisAsmadi.java new file mode 100644 index 00000000000..595eb6b55ae --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/VaevictisAsmadi.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class VaevictisAsmadi extends mage.sets.masterseditioniii.VaevictisAsmadi { + + public VaevictisAsmadi(UUID ownerId) { + super(ownerId); + this.cardNumber = 124; + this.expansionSetCode = "CHR"; + } + + public VaevictisAsmadi(final VaevictisAsmadi card) { + super(card); + } + + @Override + public VaevictisAsmadi copy() { + return new VaevictisAsmadi(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/WallOfHeat.java b/Mage.Sets/src/mage/sets/chronicles/WallOfHeat.java new file mode 100644 index 00000000000..25c84670ea7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/WallOfHeat.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class WallOfHeat extends mage.sets.legends.WallOfHeat { + + public WallOfHeat(UUID ownerId) { + super(ownerId); + this.cardNumber = 55; + this.expansionSetCode = "CHR"; + } + + public WallOfHeat(final WallOfHeat card) { + super(card); + } + + @Override + public WallOfHeat copy() { + return new WallOfHeat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/WallOfWonder.java b/Mage.Sets/src/mage/sets/chronicles/WallOfWonder.java new file mode 100644 index 00000000000..2aafbe3e6b4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/WallOfWonder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class WallOfWonder extends mage.sets.seventhedition.WallOfWonder { + + public WallOfWonder(UUID ownerId) { + super(ownerId); + this.cardNumber = 28; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.UNCOMMON; + } + + public WallOfWonder(final WallOfWonder card) { + super(card); + } + + @Override + public WallOfWonder copy() { + return new WallOfWonder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/WitchHunter.java b/Mage.Sets/src/mage/sets/chronicles/WitchHunter.java new file mode 100644 index 00000000000..d2fb61367f5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/WitchHunter.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class WitchHunter extends mage.sets.thedark.WitchHunter { + + public WitchHunter(UUID ownerId) { + super(ownerId); + this.cardNumber = 70; + this.expansionSetCode = "CHR"; + this.rarity = Rarity.UNCOMMON; + } + + public WitchHunter(final WitchHunter card) { + super(card); + } + + @Override + public WitchHunter copy() { + return new WitchHunter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/chronicles/XiraArien.java b/Mage.Sets/src/mage/sets/chronicles/XiraArien.java new file mode 100644 index 00000000000..32e258892c1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/XiraArien.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.chronicles; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class XiraArien extends mage.sets.legends.XiraArien { + + public XiraArien(UUID ownerId) { + super(ownerId); + this.cardNumber = 125; + this.expansionSetCode = "CHR"; + } + + public XiraArien(final XiraArien card) { + super(card); + } + + @Override + public XiraArien copy() { + return new XiraArien(this); + } +} diff --git a/Mage.Sets/src/mage/sets/classicsixthedition/CelestialDawn.java b/Mage.Sets/src/mage/sets/classicsixthedition/CelestialDawn.java new file mode 100644 index 00000000000..8d4443648a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/classicsixthedition/CelestialDawn.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.classicsixthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class CelestialDawn extends mage.sets.timeshifted.CelestialDawn { + + public CelestialDawn(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "6ED"; + this.rarity = Rarity.RARE; + } + + public CelestialDawn(final CelestialDawn card) { + super(card); + } + + @Override + public CelestialDawn copy() { + return new CelestialDawn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/AdarkarWindform.java b/Mage.Sets/src/mage/sets/coldsnap/AdarkarWindform.java new file mode 100644 index 00000000000..8d37e4cf9bb --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/AdarkarWindform.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.LoseAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class AdarkarWindform extends CardImpl { + + public AdarkarWindform(UUID ownerId) { + super(ownerId, 26, "Adarkar Windform", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Illusion"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {1}{S}: Target creature loses flying until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseAbilityTargetEffect( + FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{1}{S}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public AdarkarWindform(final AdarkarWindform card) { + super(card); + } + + @Override + public AdarkarWindform copy() { + return new AdarkarWindform(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/ArcumDagsson.java b/Mage.Sets/src/mage/sets/coldsnap/ArcumDagsson.java index 653bb2a81d0..7205351a470 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/ArcumDagsson.java +++ b/Mage.Sets/src/mage/sets/coldsnap/ArcumDagsson.java @@ -56,8 +56,9 @@ import mage.target.common.TargetCardInLibrary; * @author emerald000 */ public class ArcumDagsson extends CardImpl { - + private static final FilterPermanent filter = new FilterArtifactPermanent("artifact creature"); + static { filter.add(new CardTypePredicate(CardType.CREATURE)); } @@ -88,26 +89,27 @@ public class ArcumDagsson extends CardImpl { } class ArcumDagssonEffect extends OneShotEffect { - + private static final FilterCard filter = new FilterArtifactCard("noncreature artifact card"); + static { filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } - + ArcumDagssonEffect() { super(Outcome.Removal); this.staticText = "Target artifact creature's controller sacrifices it. That player may search his or her library for a noncreature artifact card, put it onto the battlefield, then shuffle his or her library"; } - + ArcumDagssonEffect(final ArcumDagssonEffect effect) { super(effect); } - + @Override public ArcumDagssonEffect copy() { return new ArcumDagssonEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Permanent artifactCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); @@ -120,7 +122,7 @@ class ArcumDagssonEffect extends OneShotEffect { if (player.searchLibrary(target, game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + player.moveCards(card, Zone.BATTLEFIELD, source, game); } } player.shuffleLibrary(game); diff --git a/Mage.Sets/src/mage/sets/coldsnap/AurochsHerd.java b/Mage.Sets/src/mage/sets/coldsnap/AurochsHerd.java new file mode 100644 index 00000000000..c22028e8bea --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/AurochsHerd.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LoneFox + */ +public class AurochsHerd extends CardImpl { + + private static final FilterCard filter1 = new FilterCard("Aurocs card"); + private static final FilterAttackingCreature filter2 = new FilterAttackingCreature("other attacking Aurochs"); + + static { + filter1.add(new SubtypePredicate("Aurochs")); + filter2.add(new SubtypePredicate("Aurochs")); + filter2.add(new AnotherPredicate()); + } + + public AurochsHerd(UUID ownerId) { + super(ownerId, 103, "Aurochs Herd", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Aurochs"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // When Aurochs Herd enters the battlefield, you may search your library for an Aurochs card, reveal it, and put it into your hand. If you do, shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect( + new TargetCardInLibrary(filter1), true), true)); + // Whenever Aurochs Herd attacks, it gets +1/+0 until end of turn for each other attacking Aurochs. + PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter2, 1); + this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(value, new StaticValue(0), Duration.EndOfTurn, true), false)); + } + + public AurochsHerd(final AurochsHerd card) { + super(card); + } + + @Override + public AurochsHerd copy() { + return new AurochsHerd(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/BlizzardSpecter.java b/Mage.Sets/src/mage/sets/coldsnap/BlizzardSpecter.java index e9e77e9fbdf..dbebe6e16fc 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/BlizzardSpecter.java +++ b/Mage.Sets/src/mage/sets/coldsnap/BlizzardSpecter.java @@ -32,7 +32,6 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; -import mage.abilities.costs.common.DiscardTargetCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.keyword.FlyingAbility; @@ -41,7 +40,6 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledPermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -65,14 +63,17 @@ public class BlizzardSpecter extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - // Whenever Blizzard Specter deals combat damage to a player, choose one - That player returns a permanent he or she controls to its owner's hand; or that player discards a card. - Ability ability2 = new DealsCombatDamageToAPlayerTriggeredAbility(new ReturnToHandEffect(), false); - - Mode mode2 = new Mode(); - mode2.getEffects().add(new DiscardTargetEffect(1, false)); - ability2.addMode(mode2); - - this.addAbility(ability2); + + // Whenever Blizzard Specter deals combat damage to a player, choose one + // - That player returns a permanent he or she controls to its owner's hand; + Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new ReturnToHandEffect(), false, true); + + // or that player discards a card. + Mode mode = new Mode(); + mode.getEffects().add(new DiscardTargetEffect(1, false)); + ability.addMode(mode); + + this.addAbility(ability); } public BlizzardSpecter(final BlizzardSpecter card) { @@ -103,26 +104,19 @@ class ReturnToHandEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - boolean result = false; - - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - if (player == null) { + Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + if (targetPlayer == null) { return false; } - Target target = new TargetControlledPermanent(1, 1, new FilterControlledPermanent(), true); - if (target.canChoose(player.getId(), game)) { - while (player.canRespond() && !target.isChosen() && target.canChoose(player.getId(), game)) { - player.chooseTarget(Outcome.ReturnToHand, target, source, game); + if (target.canChoose(targetPlayer.getId(), game)) { + targetPlayer.chooseTarget(Outcome.ReturnToHand, target, source, game); + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if (permanent != null) { + targetPlayer.moveCards(permanent, null, Zone.HAND, source, game); } - for (UUID targetId: target.getTargets()) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - result |= permanent.moveToZone(Zone.HAND, source.getSourceId(), game, false); - } - } } - return result; + return true; } } diff --git a/Mage.Sets/src/mage/sets/coldsnap/BorealCentaur.java b/Mage.Sets/src/mage/sets/coldsnap/BorealCentaur.java new file mode 100644 index 00000000000..dfd766231be --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/BorealCentaur.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class BorealCentaur extends CardImpl { + + public BorealCentaur(UUID ownerId) { + super(ownerId, 104, "Boreal Centaur", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Centaur"); + this.subtype.add("Warrior"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {S}: Boreal Centaur gets +1/+1 until end of turn. Activate this ability only once each turn. + this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{S}"))); + } + + public BorealCentaur(final BorealCentaur card) { + super(card); + } + + @Override + public BorealCentaur copy() { + return new BorealCentaur(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/BorealGriffin.java b/Mage.Sets/src/mage/sets/coldsnap/BorealGriffin.java new file mode 100644 index 00000000000..713afdec699 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/BorealGriffin.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class BorealGriffin extends CardImpl { + + public BorealGriffin(UUID ownerId) { + super(ownerId, 2, "Boreal Griffin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Griffin"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {S}: Boreal Griffin gains first strike until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect( + FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{S}"))); + } + + public BorealGriffin(final BorealGriffin card) { + super(card); + } + + @Override + public BorealGriffin copy() { + return new BorealGriffin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/BraidOfFire.java b/Mage.Sets/src/mage/sets/coldsnap/BraidOfFire.java new file mode 100644 index 00000000000..e08dc4e32f9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/BraidOfFire.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.costs.CostImpl; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author AlumiuN + */ +public class BraidOfFire extends CardImpl { + + public BraidOfFire(UUID ownerId) { + super(ownerId, 78, "Braid of Fire", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "CSP"; + + // Cumulative upkeep-Add {R} to your mana pool. + this.addAbility(new CumulativeUpkeepAbility(new BraidOfFireCost())); + } + + public BraidOfFire(final BraidOfFire card) { + super(card); + } + + @Override + public BraidOfFire copy() { + return new BraidOfFire(this); + } +} + +class BraidOfFireCost extends CostImpl { + + public BraidOfFireCost() { + this.text = "Add {R} to your mana pool"; + } + + public BraidOfFireCost(BraidOfFireCost cost) { + super(cost); + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Player player = game.getPlayer(controllerId); + player.getManaPool().addMana(Mana.RedMana, game, ability); + paid = true; + return true; + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + return game.getPlayer(controllerId) != null; + } + + @Override + public BraidOfFireCost copy() { + return new BraidOfFireCost(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/BullAurochs.java b/Mage.Sets/src/mage/sets/coldsnap/BullAurochs.java new file mode 100644 index 00000000000..0d1ed967d00 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/BullAurochs.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LoneFox + */ +public class BullAurochs extends CardImpl { + + private static final FilterAttackingCreature filter = new FilterAttackingCreature("other attacking Aurochs"); + + static { + filter.add(new SubtypePredicate("Aurochs")); + filter.add(new AnotherPredicate()); + } + + public BullAurochs(UUID ownerId) { + super(ownerId, 107, "Bull Aurochs", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Aurochs"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Whenever Bull Aurochs attacks, it gets +1/+0 until end of turn for each other attacking Aurochs. + PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter, 1); + this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(value, new StaticValue(0), Duration.EndOfTurn, true), false)); + } + + public BullAurochs(final BullAurochs card) { + super(card); + } + + @Override + public BullAurochs copy() { + return new BullAurochs(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/ChillToTheBone.java b/Mage.Sets/src/mage/sets/coldsnap/ChillToTheBone.java new file mode 100644 index 00000000000..45d1b5b365e --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/ChillToTheBone.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ChillToTheBone extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonsnow creature"); + + static { + filter.add(Predicates.not(new SupertypePredicate("Snow"))); + } + + public ChillToTheBone(UUID ownerId) { + super(ownerId, 52, "Chill to the Bone", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{B}"); + this.expansionSetCode = "CSP"; + + // Destroy target nonsnow creature. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + } + + public ChillToTheBone(final ChillToTheBone card) { + super(card); + } + + @Override + public ChillToTheBone copy() { + return new ChillToTheBone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/ChillingShade.java b/Mage.Sets/src/mage/sets/coldsnap/ChillingShade.java new file mode 100644 index 00000000000..7b528f7e90c --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/ChillingShade.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class ChillingShade extends CardImpl { + + public ChillingShade(UUID ownerId) { + super(ownerId, 53, "Chilling Shade", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Shade"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {S}: Chilling Shade gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{S}"))); + } + + public ChillingShade(final ChillingShade card) { + super(card); + } + + @Override + public ChillingShade copy() { + return new ChillingShade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/ColdsteelHeart.java b/Mage.Sets/src/mage/sets/coldsnap/ColdsteelHeart.java index 14bfb69089a..73bcef4442d 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/ColdsteelHeart.java +++ b/Mage.Sets/src/mage/sets/coldsnap/ColdsteelHeart.java @@ -60,8 +60,8 @@ public class ColdsteelHeart extends CardImpl { // Coldsteel Heart enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); // As Coldsteel Heart enters the battlefield, choose a color. - this.addAbility(new EntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral))); - // {tap}: Add one mana of the chosen color to your mana pool. + this.addAbility(new EntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral), null, "As {this} enters the battlefield, choose a color.", null)); + // {T}: Add one mana of the chosen color to your mana pool. this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new ColdsteelHeartManaEffect(), new TapSourceCost())); } @@ -90,7 +90,7 @@ class ColdsteelHeartManaEffect extends ManaEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - player.getManaPool().addMana(getMana(game, source), game, source); + player.getManaPool().addMana(getMana(game, source), game, source); } return true; } @@ -109,4 +109,4 @@ class ColdsteelHeartManaEffect extends ManaEffect { public ColdsteelHeartManaEffect copy() { return new ColdsteelHeartManaEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/DiamondFaerie.java b/Mage.Sets/src/mage/sets/coldsnap/DiamondFaerie.java new file mode 100644 index 00000000000..0edd7386510 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/DiamondFaerie.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author LoneFox + */ +public class DiamondFaerie extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Snow creatures"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public DiamondFaerie(UUID ownerId) { + super(ownerId, 128, "Diamond Faerie", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{W}{U}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Faerie"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {1}{S}: Snow creatures you control get +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, + Duration.EndOfTurn, filter), new ManaCostsImpl("{1}{S}"))); + } + + public DiamondFaerie(final DiamondFaerie card) { + super(card); + } + + @Override + public DiamondFaerie copy() { + return new DiamondFaerie(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/DiscipleOfTeveshSzat.java b/Mage.Sets/src/mage/sets/coldsnap/DiscipleOfTeveshSzat.java new file mode 100644 index 00000000000..4d5297e1013 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/DiscipleOfTeveshSzat.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DiscipleOfTeveshSzat extends CardImpl { + + public DiscipleOfTeveshSzat(UUID ownerId) { + super(ownerId, 55, "Disciple of Tevesh Szat", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // {tap}: Target creature gets -1/-1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-1, -1, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + // {4}{B}{B}, {tap}, Sacrifice Disciple of Tevesh Szat: Target creature gets -6/-6 until end of turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-6, -6, Duration.EndOfTurn), new ManaCostsImpl("{4}{B}{B}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public DiscipleOfTeveshSzat(final DiscipleOfTeveshSzat card) { + super(card); + } + + @Override + public DiscipleOfTeveshSzat copy() { + return new DiscipleOfTeveshSzat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/Drelnoch.java b/Mage.Sets/src/mage/sets/coldsnap/Drelnoch.java new file mode 100644 index 00000000000..d13ed83c9be --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/Drelnoch.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Drelnoch extends CardImpl { + + public Drelnoch(UUID ownerId) { + super(ownerId, 32, "Drelnoch", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Yeti"); + this.subtype.add("Mutant"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Drelnoch becomes blocked, you may draw two cards. + this.addAbility(new BecomesBlockedTriggeredAbility(new DrawCardSourceControllerEffect(2), true)); + } + + public Drelnoch(final Drelnoch card) { + super(card); + } + + @Override + public Drelnoch copy() { + return new Drelnoch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/FrostRaptor.java b/Mage.Sets/src/mage/sets/coldsnap/FrostRaptor.java new file mode 100644 index 00000000000..b355fcbd3cb --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/FrostRaptor.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FrostRaptor extends CardImpl { + + public FrostRaptor(UUID ownerId) { + super(ownerId, 34, "Frost Raptor", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {S}{S}: Frost Raptor gains shroud until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect( + ShroudAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{S}{S}"))); + } + + public FrostRaptor(final FrostRaptor card) { + super(card); + } + + @Override + public FrostRaptor copy() { + return new FrostRaptor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/FrozenSolid.java b/Mage.Sets/src/mage/sets/coldsnap/FrozenSolid.java new file mode 100644 index 00000000000..750dcca0a40 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/FrozenSolid.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.DamageDealtToAttachedTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FrozenSolid extends CardImpl { + + public FrozenSolid(UUID ownerId) { + super(ownerId, 35, "Frozen Solid", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature doesn't untap during its controller's untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect())); + // When enchanted creature is dealt damage, destroy it. + this.addAbility(new DamageDealtToAttachedTriggeredAbility(new DestroyAttachedEffect("it"), false)); + } + + public FrozenSolid(final FrozenSolid card) { + super(card); + } + + @Override + public FrozenSolid copy() { + return new FrozenSolid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/GreaterStoneSpirit.java b/Mage.Sets/src/mage/sets/coldsnap/GreaterStoneSpirit.java new file mode 100644 index 00000000000..44c03edc0f7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/GreaterStoneSpirit.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GreaterStoneSpirit extends mage.sets.venservskoth.GreaterStoneSpirit { + + public GreaterStoneSpirit(UUID ownerId) { + super(ownerId); + this.cardNumber = 84; + this.expansionSetCode = "CSP"; + } + + public GreaterStoneSpirit(final GreaterStoneSpirit card) { + super(card); + } + + @Override + public GreaterStoneSpirit copy() { + return new GreaterStoneSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/GristleGrinner.java b/Mage.Sets/src/mage/sets/coldsnap/GristleGrinner.java new file mode 100644 index 00000000000..46edb011e8b --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/GristleGrinner.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class GristleGrinner extends CardImpl { + + public GristleGrinner(UUID ownerId) { + super(ownerId, 59, "Gristle Grinner", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Zombie"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever a creature dies, Gristle Grinner gets +2/+2 until end of turn. + this.addAbility(new DiesCreatureTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false)); + } + + public GristleGrinner(final GristleGrinner card) { + super(card); + } + + @Override + public GristleGrinner copy() { + return new GristleGrinner(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/GutlessGhoul.java b/Mage.Sets/src/mage/sets/coldsnap/GutlessGhoul.java new file mode 100644 index 00000000000..61c564f1459 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/GutlessGhoul.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class GutlessGhoul extends CardImpl { + + public GutlessGhoul(UUID ownerId) { + super(ownerId, 60, "Gutless Ghoul", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {1}, Sacrifice a creature: You gain 2 life. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), new ManaCostsImpl("{1}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + this.addAbility(ability); + } + + public GutlessGhoul(final GutlessGhoul card) { + super(card); + } + + @Override + public GutlessGhoul copy() { + return new GutlessGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/HeidarRimewindMaster.java b/Mage.Sets/src/mage/sets/coldsnap/HeidarRimewindMaster.java new file mode 100644 index 00000000000..6011ac418d9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/HeidarRimewindMaster.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class HeidarRimewindMaster extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control four or more snow permanents"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public HeidarRimewindMaster(UUID ownerId) { + super(ownerId, 36, "Heidar, Rimewind Master", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {2}, {tap}: Return target permanent to its owner's hand. Activate this ability only if you control four or more snow permanents. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new ReturnToHandTargetEffect(), + new GenericManaCost(2), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 3)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public HeidarRimewindMaster(final HeidarRimewindMaster card) { + super(card); + } + + @Override + public HeidarRimewindMaster copy() { + return new HeidarRimewindMaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/HibernationsEnd.java b/Mage.Sets/src/mage/sets/coldsnap/HibernationsEnd.java new file mode 100644 index 00000000000..09d46b4974c --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/HibernationsEnd.java @@ -0,0 +1,140 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LoneFox + */ +public class HibernationsEnd extends CardImpl { + + public HibernationsEnd(UUID ownerId) { + super(ownerId, 110, "Hibernation's End", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{G}"); + this.expansionSetCode = "CSP"; + + // Cumulative upkeep {1} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}"))); + // Whenever you pay Hibernation's End's cumulative upkeep, you may search your library for a creature card with converted mana cost equal to the number of age counters on Hibernation's End and put it onto the battlefield. If you do, shuffle your library. + this.addAbility(new HibernationsEndAbility()); + } + + public HibernationsEnd(final HibernationsEnd card) { + super(card); + } + + @Override + public HibernationsEnd copy() { + return new HibernationsEnd(this); + } +} + +class HibernationsEndAbility extends TriggeredAbilityImpl { + + public HibernationsEndAbility() { + super(Zone.BATTLEFIELD, new HibernationsEndEffect(), true); + } + + public HibernationsEndAbility(final HibernationsEndAbility ability) { + super(ability); + } + + @Override + public HibernationsEndAbility copy() { + return new HibernationsEndAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.PAID_CUMULATIVE_UPKEEP; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getSourceId() != null && event.getSourceId().equals(this.getSourceId()); + } + + @Override + public String getRule() { + return "Whenever you pay {this}'s cumulative upkeep, " + super.getRule(); + } +} + +class HibernationsEndEffect extends OneShotEffect { + + public HibernationsEndEffect() { + super(Outcome.Benefit); + this.staticText = "search your library for a creature card with converted mana cost equal to the number of age counters on {this} and put it onto the battlefield. If you do, shuffle your library."; + } + + public HibernationsEndEffect(final HibernationsEndEffect effect) { + super(effect); + } + + @Override + public HibernationsEndEffect copy() { + return new HibernationsEndEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (sourcePermanent != null && player != null) { + int newConvertedCost = sourcePermanent.getCounters().getCount("age"); + FilterCard filter = new FilterCard("creature card with converted mana cost " + newConvertedCost); + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, newConvertedCost)); + filter.add(new CardTypePredicate(CardType.CREATURE)); + TargetCardInLibrary target = new TargetCardInLibrary(filter); + return new SearchLibraryPutInPlayEffect(target).apply(game, source); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/Jokulmorder.java b/Mage.Sets/src/mage/sets/coldsnap/Jokulmorder.java new file mode 100644 index 00000000000..f35509c7ac3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/Jokulmorder.java @@ -0,0 +1,126 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author fireshoes + */ +public class Jokulmorder extends CardImpl { + + public Jokulmorder(UUID ownerId) { + super(ownerId, 37, "Jokulmorder", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}{U}{U}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Leviathan"); + this.power = new MageInt(12); + this.toughness = new MageInt(12); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Jokulmorder enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // When Jokulmorder enters the battlefield, sacrifice it unless you sacrifice five lands. + Effect effect = new SacrificeSourceUnlessPaysEffect( + new SacrificeTargetCost(new TargetControlledPermanent(5, 5, new FilterControlledLandPermanent("five lands"), true))); + effect.setText("sacrifice it unless you sacrifice five lands"); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false)); + + // Jokulmorder doesn't untap during your untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepSourceEffect())); + + // Whenever you play an Island, you may untap Jokulmorder. + this.addAbility(new JokulmorderTriggeredAbility()); + } + + public Jokulmorder(final Jokulmorder card) { + super(card); + } + + @Override + public Jokulmorder copy() { + return new Jokulmorder(this); + } +} + +class JokulmorderTriggeredAbility extends TriggeredAbilityImpl { + + JokulmorderTriggeredAbility() { + super(Zone.BATTLEFIELD, new UntapSourceEffect(), true); + } + + JokulmorderTriggeredAbility(JokulmorderTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LAND_PLAYED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent land = game.getPermanent(event.getTargetId()); + return land.getSubtype().contains("Island") + && land.getControllerId().equals(this.controllerId); + } + + @Override + public JokulmorderTriggeredAbility copy() { + return new JokulmorderTriggeredAbility(this); + } + + @Override + public String getRule() { + return "When you play an Island, you may untap {this}"; + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/KjeldoranOutrider.java b/Mage.Sets/src/mage/sets/coldsnap/KjeldoranOutrider.java new file mode 100644 index 00000000000..f7fe42c7c35 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/KjeldoranOutrider.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class KjeldoranOutrider extends CardImpl { + + public KjeldoranOutrider(UUID ownerId) { + super(ownerId, 12, "Kjeldoran Outrider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {W}: Kjeldoran Outrider gets +0/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{W}"))); + } + + public KjeldoranOutrider(final KjeldoranOutrider card) { + super(card); + } + + @Override + public KjeldoranOutrider copy() { + return new KjeldoranOutrider(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/LightningSerpent.java b/Mage.Sets/src/mage/sets/coldsnap/LightningSerpent.java new file mode 100644 index 00000000000..fb07bb59cd7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/LightningSerpent.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + */ +public class LightningSerpent extends CardImpl { + + public LightningSerpent(UUID ownerId) { + super(ownerId, 88, "Lightning Serpent", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{X}{R}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Elemental"); + this.subtype.add("Serpent"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Haste + this.addAbility(HasteAbility.getInstance()); + // Lightning Serpent enters the battlefield with X +1/+0 counters on it. + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P0.createInstance()))); + // At the beginning of the end step, sacrifice Lightning Serpent. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new SacrificeSourceEffect(), TargetController.ANY, false)); + } + + public LightningSerpent(final LightningSerpent card) { + super(card); + } + + @Override + public LightningSerpent copy() { + return new LightningSerpent(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/LightningStorm.java b/Mage.Sets/src/mage/sets/coldsnap/LightningStorm.java index fd05403b5b5..4505fa176ca 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/LightningStorm.java +++ b/Mage.Sets/src/mage/sets/coldsnap/LightningStorm.java @@ -29,6 +29,7 @@ package mage.sets.coldsnap; import java.util.UUID; import mage.abilities.Ability; +import mage.abilities.ActivatedAbilityImpl; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.DiscardTargetCost; import mage.abilities.dynamicvalue.DynamicValue; @@ -59,7 +60,6 @@ public class LightningStorm extends CardImpl { super(ownerId, 89, "Lightning Storm", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}{R}"); this.expansionSetCode = "CSP"; - // Lightning Storm deals X damage to target creature or player, where X is 3 plus the number of charge counters on it. Effect effect = new DamageTargetEffect(new LightningStormCountCondition(CounterType.CHARGE)); effect.setText("{this} deals X damage to target creature or player, where X is 3 plus the number of charge counters on it"); @@ -67,7 +67,7 @@ public class LightningStorm extends CardImpl { this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); // Discard a land card: Put two charge counters on Lightning Storm. You may choose a new target for it. Any player may activate this ability but only if Lightning Storm is on the stack. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.STACK, - new LightningStormAddCounterEffect() , + new LightningStormAddCounterEffect(), new DiscardTargetCost(new TargetCardInHand(new FilterLandCard()))); ability.setMayActivate(TargetController.ANY); ability.addEffect(new InfoEffect("Any player may activate this ability but only if {this} is on the stack")); @@ -85,6 +85,7 @@ public class LightningStorm extends CardImpl { } class LightningStormCountCondition implements DynamicValue { + private final CounterType counter; public LightningStormCountCondition(CounterType counter) { @@ -141,7 +142,7 @@ class LightningStormAddCounterEffect extends OneShotEffect { Spell spell = game.getStack().getSpell(source.getSourceId()); if (spell != null) { spell.addCounters(CounterType.CHARGE.createInstance(2), game); - return spell.chooseNewTargets(game, source.getControllerId(), false, false, null); + return spell.chooseNewTargets(game, ((ActivatedAbilityImpl) source).getActivatorId(), false, false, null); } return false; } diff --git a/Mage.Sets/src/mage/sets/coldsnap/LovisaColdeyes.java b/Mage.Sets/src/mage/sets/coldsnap/LovisaColdeyes.java new file mode 100644 index 00000000000..ebdff5a9086 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/LovisaColdeyes.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class LovisaColdeyes extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you control that's a Barbarian, a Warrior, or a Berserker"); + + static { + filter.add(Predicates.or(new SubtypePredicate("Barbarian"), new SubtypePredicate("Warrior"), new SubtypePredicate("Berserker"))); + } + + public LovisaColdeyes(UUID ownerId) { + super(ownerId, 90, "Lovisa Coldeyes", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Each creature you control that's a Barbarian, a Warrior, or a Berserker gets +2/+2 and has haste. + Effect effect = new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, filter, false); + effect.setText("Each creature you control that's a Barbarian, a Warrior, or a Berserker gets +2/+2"); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); + effect = new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, false); + effect.setText("and has haste"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public LovisaColdeyes(final LovisaColdeyes card) { + super(card); + } + + @Override + public LovisaColdeyes copy() { + return new LovisaColdeyes(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/MartyrOfBones.java b/Mage.Sets/src/mage/sets/coldsnap/MartyrOfBones.java index a08beb1ada4..0c017fd3786 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/MartyrOfBones.java +++ b/Mage.Sets/src/mage/sets/coldsnap/MartyrOfBones.java @@ -57,6 +57,8 @@ import mage.target.common.TargetCardInHand; */ public class MartyrOfBones extends CardImpl { + private final UUID originalId; + public MartyrOfBones(UUID ownerId) { super(ownerId, 65, "Martyr of Bones", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); this.expansionSetCode = "CSP"; @@ -72,16 +74,18 @@ public class MartyrOfBones extends CardImpl { ability.addCost(new RevealVariableBlackCardsFromHandCost()); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetCardInASingleGraveyard(0, 1, new FilterCard("cards in a single graveyard"))); + originalId = ability.getOriginalId(); this.addAbility(ability); } - + public MartyrOfBones(final MartyrOfBones card) { super(card); + this.originalId = card.originalId; } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SimpleActivatedAbility) { + if (ability.getOriginalId().equals(originalId)) { int amount = 0; for (Cost cost : ability.getCosts()) { if (cost instanceof RevealVariableBlackCardsFromHandCost) { @@ -100,36 +104,37 @@ public class MartyrOfBones extends CardImpl { } class RevealVariableBlackCardsFromHandCost extends VariableCostImpl { - + private static final FilterCard filter = new FilterCard("X black cards from your hand"); + static { filter.add(new ColorPredicate(ObjectColor.BLACK)); } - + RevealVariableBlackCardsFromHandCost() { super("black cards to reveal"); this.text = new StringBuilder("Reveal ").append(xText).append(" black cards from {this}").toString(); } - + RevealVariableBlackCardsFromHandCost(final RevealVariableBlackCardsFromHandCost cost) { super(cost); } - + @Override public RevealVariableBlackCardsFromHandCost copy() { return new RevealVariableBlackCardsFromHandCost(this); } - + @Override public Cost getFixedCostsFromAnnouncedValue(int xValue) { return new RevealTargetFromHandCost(new TargetCardInHand(0, xValue, filter)); } - + @Override public int getMinValue(Ability source, Game game) { return 0; } - + @Override public int getMaxValue(Ability source, Game game) { Player player = game.getPlayer(source.getControllerId()); @@ -138,4 +143,4 @@ class RevealVariableBlackCardsFromHandCost extends VariableCostImpl { } return 0; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/MouthOfRonom.java b/Mage.Sets/src/mage/sets/coldsnap/MouthOfRonom.java index 97e51075d93..b4ea1d2ab05 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/MouthOfRonom.java +++ b/Mage.Sets/src/mage/sets/coldsnap/MouthOfRonom.java @@ -52,15 +52,15 @@ public class MouthOfRonom extends CardImpl { this.expansionSetCode = "CSP"; this.supertype.add("Snow"); - // {tap}: Add {1} to your mana pool. + // {T}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); - // {4}{snow}, {tap}, Sacrifice Mouth of Ronom: Mouth of Ronom deals 4 damage to target creature. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(4), new ManaCostsImpl("{4}{snow}")); + // {4}{S}, {T}, Sacrifice Mouth of Ronom: Mouth of Ronom deals 4 damage to target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(4), new ManaCostsImpl("{4}{S}")); ability.addTarget(new TargetCreaturePermanent()); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); - + } public MouthOfRonom(final MouthOfRonom card) { diff --git a/Mage.Sets/src/mage/sets/coldsnap/MysticMelting.java b/Mage.Sets/src/mage/sets/coldsnap/MysticMelting.java new file mode 100644 index 00000000000..df32d4ef617 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/MysticMelting.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterArtifactOrEnchantmentPermanent; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class MysticMelting extends CardImpl { + + public MysticMelting(UUID ownerId) { + super(ownerId, 114, "Mystic Melting", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{G}"); + this.expansionSetCode = "CSP"; + + // Destroy target artifact or enchantment. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent())); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public MysticMelting(final MysticMelting card) { + super(card); + } + + @Override + public MysticMelting copy() { + return new MysticMelting(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/OhranYeti.java b/Mage.Sets/src/mage/sets/coldsnap/OhranYeti.java new file mode 100644 index 00000000000..cd5fcb64786 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/OhranYeti.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class OhranYeti extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("snow creature"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public OhranYeti(UUID ownerId) { + super(ownerId, 93, "Ohran Yeti", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Yeti"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {2}{S}: Target snow creature gains first strike until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect( + FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{2}{S}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public OhranYeti(final OhranYeti card) { + super(card); + } + + @Override + public OhranYeti copy() { + return new OhranYeti(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/PhobianPhantasm.java b/Mage.Sets/src/mage/sets/coldsnap/PhobianPhantasm.java new file mode 100644 index 00000000000..f70ed990556 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/PhobianPhantasm.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.abilities.keyword.FearAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class PhobianPhantasm extends CardImpl { + + public PhobianPhantasm(UUID ownerId) { + super(ownerId, 66, "Phobian Phantasm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Illusion"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying; fear + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(FearAbility.getInstance()); + // Cumulative upkeep {B} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{B}"))); + } + + public PhobianPhantasm(final PhobianPhantasm card) { + super(card); + } + + @Override + public PhobianPhantasm copy() { + return new PhobianPhantasm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/PhyrexianIronfoot.java b/Mage.Sets/src/mage/sets/coldsnap/PhyrexianIronfoot.java new file mode 100644 index 00000000000..978939a710d --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/PhyrexianIronfoot.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class PhyrexianIronfoot extends CardImpl { + + public PhyrexianIronfoot(UUID ownerId) { + super(ownerId, 139, "Phyrexian Ironfoot", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Construct"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Phyrexian Ironfoot doesn't untap during your untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepSourceEffect())); + + // {1}{S}: Untap Phyrexian Ironfoot. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new ManaCostsImpl("{1}{S}"))); + } + + public PhyrexianIronfoot(final PhyrexianIronfoot card) { + super(card); + } + + @Override + public PhyrexianIronfoot copy() { + return new PhyrexianIronfoot(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/PhyrexianSnowcrusher.java b/Mage.Sets/src/mage/sets/coldsnap/PhyrexianSnowcrusher.java new file mode 100644 index 00000000000..5d72c75fddc --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/PhyrexianSnowcrusher.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksEachTurnStaticAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class PhyrexianSnowcrusher extends CardImpl { + + public PhyrexianSnowcrusher(UUID ownerId) { + super(ownerId, 140, "Phyrexian Snowcrusher", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Juggernaut"); + this.power = new MageInt(6); + this.toughness = new MageInt(5); + + // Phyrexian Snowcrusher attacks each turn if able. + this.addAbility(new AttacksEachTurnStaticAbility()); + // {1}{S}: Phyrexian Snowcrusher gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{1}{S}"))); + } + + public PhyrexianSnowcrusher(final PhyrexianSnowcrusher card) { + super(card); + } + + @Override + public PhyrexianSnowcrusher copy() { + return new PhyrexianSnowcrusher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/RimeTransfusion.java b/Mage.Sets/src/mage/sets/coldsnap/RimeTransfusion.java new file mode 100644 index 00000000000..9e0941fbcfa --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/RimeTransfusion.java @@ -0,0 +1,97 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class RimeTransfusion extends CardImpl { + + static final String rule = "and has \"{S}: This creature can't be blocked this turn except by snow creatures.\""; + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("except by snow creatures until end of turn"); + + static { + filter.add(Predicates.not(new SupertypePredicate("Snow"))); + } + + public RimeTransfusion(UUID ownerId) { + super(ownerId, 68, "Rime Transfusion", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets +2/+1 and has "{S}: This creature can't be blocked this turn except by snow creatures." + SimpleStaticAbility ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 1, Duration.WhileOnBattlefield)); + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.EndOfTurn))),new ManaCostsImpl("{S}")); + ability2.addEffect(new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, rule)); + this.addAbility(ability2); + } + + public RimeTransfusion(final RimeTransfusion card) { + super(card); + } + + @Override + public RimeTransfusion copy() { + return new RimeTransfusion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/RimeboundDead.java b/Mage.Sets/src/mage/sets/coldsnap/RimeboundDead.java new file mode 100644 index 00000000000..f204b09e073 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/RimeboundDead.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class RimeboundDead extends CardImpl { + + public RimeboundDead(UUID ownerId) { + super(ownerId, 69, "Rimebound Dead", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Skeleton"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {S}: Regenerate Rimebound Dead. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{S}"))); + } + + public RimeboundDead(final RimeboundDead card) { + super(card); + } + + @Override + public RimeboundDead copy() { + return new RimeboundDead(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/RimewindCryomancer.java b/Mage.Sets/src/mage/sets/coldsnap/RimewindCryomancer.java new file mode 100644 index 00000000000..41775a35a3b --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/RimewindCryomancer.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.common.TargetActivatedAbility; + +/** + * + * @author fireshoes + */ +public class RimewindCryomancer extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control four or more snow permanents"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public RimewindCryomancer(UUID ownerId) { + super(ownerId, 43, "Rimewind Cryomancer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {1}, {tap}: Counter target activated ability. Activate this ability only if you control four or more snow permanents. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new CounterTargetEffect(), + new GenericManaCost(1), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 3)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetActivatedAbility()); + this.addAbility(ability); + } + + public RimewindCryomancer(final RimewindCryomancer card) { + super(card); + } + + @Override + public RimewindCryomancer copy() { + return new RimewindCryomancer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/RimewindTaskmage.java b/Mage.Sets/src/mage/sets/coldsnap/RimewindTaskmage.java new file mode 100644 index 00000000000..420ca2ecc6c --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/RimewindTaskmage.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class RimewindTaskmage extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control four or more snow permanents"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public RimewindTaskmage(UUID ownerId) { + super(ownerId, 44, "Rimewind Taskmage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {1}, {tap}: You may tap or untap target permanent. Activate this ability only if you control four or more snow permanents. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new MayTapOrUntapTargetEffect(), + new GenericManaCost(1), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 3)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public RimewindTaskmage(final RimewindTaskmage card) { + super(card); + } + + @Override + public RimewindTaskmage copy() { + return new RimewindTaskmage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/RonomHulk.java b/Mage.Sets/src/mage/sets/coldsnap/RonomHulk.java new file mode 100644 index 00000000000..3ccf0bb3e21 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/RonomHulk.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author LoneFox + */ +public class RonomHulk extends CardImpl { + + private static final FilterCard filter = new FilterCard("snow"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public RonomHulk(UUID ownerId) { + super(ownerId, 119, "Ronom Hulk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Beast"); + this.power = new MageInt(5); + this.toughness = new MageInt(6); + + // Protection from snow + this.addAbility(new ProtectionAbility(filter)); + // Cumulative upkeep {1} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}"))); + } + + public RonomHulk(final RonomHulk card) { + super(card); + } + + @Override + public RonomHulk copy() { + return new RonomHulk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/ScryingSheets.java b/Mage.Sets/src/mage/sets/coldsnap/ScryingSheets.java index 2669da9ec02..0aaf3714f36 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/ScryingSheets.java +++ b/Mage.Sets/src/mage/sets/coldsnap/ScryingSheets.java @@ -59,8 +59,8 @@ public class ScryingSheets extends CardImpl { // {tap}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); - // {1}{snow}, {tap}: Look at the top card of your library. If that card is snow, you may reveal it and put it into your hand. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScryingSheetsEffect(), new ManaCostsImpl<>("{1}{snow}")); + // {1}{S}, {T}: Look at the top card of your library. If that card is snow, you may reveal it and put it into your hand. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScryingSheetsEffect(), new ManaCostsImpl<>("{1}{S}")); ability.addCost(new TapSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/coldsnap/SimianBrawler.java b/Mage.Sets/src/mage/sets/coldsnap/SimianBrawler.java new file mode 100644 index 00000000000..937acb55a3c --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/SimianBrawler.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterLandCard; + +/** + * + * @author LoneFox + */ +public class SimianBrawler extends CardImpl { + + public SimianBrawler(UUID ownerId) { + super(ownerId, 122, "Simian Brawler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Ape"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Discard a land card: Simian Brawler gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), + new DiscardCardCost(new FilterLandCard("a land card")))); + } + + public SimianBrawler(final SimianBrawler card) { + super(card); + } + + @Override + public SimianBrawler copy() { + return new SimianBrawler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/SteamSpitter.java b/Mage.Sets/src/mage/sets/coldsnap/SteamSpitter.java new file mode 100644 index 00000000000..bc75f972163 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/SteamSpitter.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class SteamSpitter extends CardImpl { + + public SteamSpitter(UUID ownerId) { + super(ownerId, 124, "Steam Spitter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Spider"); + this.power = new MageInt(1); + this.toughness = new MageInt(5); + + // Reach + this.addAbility(ReachAbility.getInstance()); + // {R}: Steam Spitter gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public SteamSpitter(final SteamSpitter card) { + super(card); + } + + @Override + public SteamSpitter copy() { + return new SteamSpitter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/SurgingAEther.java b/Mage.Sets/src/mage/sets/coldsnap/SurgingAEther.java new file mode 100644 index 00000000000..49a2b4d0791 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/SurgingAEther.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.RippleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class SurgingAEther extends CardImpl { + + public SurgingAEther(UUID ownerId) { + super(ownerId, 47, "Surging AEther", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{U}"); + this.expansionSetCode = "CSP"; + + // Ripple 4 + this.addAbility(new RippleAbility(4)); + // Return target permanent to its owner's hand. + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent()); + } + + public SurgingAEther(final SurgingAEther card) { + super(card); + } + + @Override + public SurgingAEther copy() { + return new SurgingAEther(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/SurgingFlame.java b/Mage.Sets/src/mage/sets/coldsnap/SurgingFlame.java new file mode 100644 index 00000000000..3976ad6ba80 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/SurgingFlame.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.RippleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class SurgingFlame extends CardImpl { + + public SurgingFlame(UUID ownerId) { + super(ownerId, 99, "Surging Flame", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "CSP"; + + // Ripple 4 + this.addAbility(new RippleAbility(4)); + // Surging Flame deals 2 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(2)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public SurgingFlame(final SurgingFlame card) { + super(card); + } + + @Override + public SurgingFlame copy() { + return new SurgingFlame(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/SurgingMight.java b/Mage.Sets/src/mage/sets/coldsnap/SurgingMight.java new file mode 100644 index 00000000000..b932abbe517 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/SurgingMight.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.RippleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SurgingMight extends CardImpl { + + public SurgingMight(UUID ownerId) { + super(ownerId, 125, "Surging Might", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +2/+2. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield))); + // Ripple 4 + this.addAbility(new RippleAbility(4)); + } + + public SurgingMight(final SurgingMight card) { + super(card); + } + + @Override + public SurgingMight copy() { + return new SurgingMight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/SurgingSentinels.java b/Mage.Sets/src/mage/sets/coldsnap/SurgingSentinels.java new file mode 100644 index 00000000000..01ef0154caa --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/SurgingSentinels.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.abilities.keyword.RippleAbility; + +/** + * + * @author LoneFox + */ +public class SurgingSentinels extends CardImpl { + + public SurgingSentinels(UUID ownerId) { + super(ownerId, 20, "Surging Sentinels", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // Ripple 4 + this.addAbility(new RippleAbility(4)); + } + + public SurgingSentinels(final SurgingSentinels card) { + super(card); + } + + @Override + public SurgingSentinels copy() { + return new SurgingSentinels(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/SwiftManeuver.java b/Mage.Sets/src/mage/sets/coldsnap/SwiftManeuver.java new file mode 100644 index 00000000000..a503d425883 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/SwiftManeuver.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class SwiftManeuver extends CardImpl { + + public SwiftManeuver(UUID ownerId) { + super(ownerId, 21, "Swift Maneuver", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "CSP"; + + // Prevent the next 2 damage that would be dealt to target creature or player this turn. + this.getSpellAbility().addEffect(new PreventDamageToTargetEffect(Duration.EndOfTurn, 2)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public SwiftManeuver(final SwiftManeuver card) { + super(card); + } + + @Override + public SwiftManeuver copy() { + return new SwiftManeuver(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/Thermopod.java b/Mage.Sets/src/mage/sets/coldsnap/Thermopod.java new file mode 100644 index 00000000000..910a63f366b --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/Thermopod.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Thermopod extends CardImpl { + + public Thermopod(UUID ownerId) { + super(ownerId, 100, "Thermopod", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + this.subtype.add("Slug"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // {S}: Thermopod gains haste until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect( + HasteAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{S}"))); + // Sacrifice a creature: Add {R} to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.RedMana(1), new SacrificeTargetCost( + new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))))); + } + + public Thermopod(final Thermopod card) { + super(card); + } + + @Override + public Thermopod copy() { + return new Thermopod(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/UrsineFylgja.java b/Mage.Sets/src/mage/sets/coldsnap/UrsineFylgja.java new file mode 100644 index 00000000000..98a464f1cb4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/UrsineFylgja.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventDamageToSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + */ +public class UrsineFylgja extends CardImpl { + + public UrsineFylgja(UUID ownerId) { + super(ownerId, 22, "Ursine Fylgja", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Spirit"); + this.subtype.add("Bear"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Ursine Fylgja enters the battlefield with four healing counters on it. + Effect effect = new AddCountersSourceEffect(CounterType.HEALING.createInstance(4)); + effect.setText("with four healing counters on it."); + this.addAbility(new EntersBattlefieldAbility(effect)); + // Remove a healing counter from Ursine Fylgja: Prevent the next 1 damage that would be dealt to Ursine Fylgja this turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToSourceEffect(Duration.EndOfTurn, 1), + new RemoveCountersSourceCost(CounterType.HEALING.createInstance(1)))); + // {2}{W}: Put a healing counter on Ursine Fylgja. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.HEALING.createInstance(1)), + new ManaCostsImpl("{2}{W}"))); + } + + public UrsineFylgja(final UrsineFylgja card) { + super(card); + } + + @Override + public UrsineFylgja copy() { + return new UrsineFylgja(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/WildernessElemental.java b/Mage.Sets/src/mage/sets/coldsnap/WildernessElemental.java new file mode 100644 index 00000000000..97909523dff --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/WildernessElemental.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LoneFox + */ +public class WildernessElemental extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("nonbasic lands your opponents control"); + + static { + filter.add(Predicates.not(new SupertypePredicate("Basic"))); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public WildernessElemental(UUID ownerId) { + super(ownerId, 134, "Wilderness Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{G}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Elemental"); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Wilderness Elemental's power is equal to the number of nonbasic lands your opponents control. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + } + + public WildernessElemental(final WildernessElemental card) { + super(card); + } + + @Override + public WildernessElemental copy() { + return new WildernessElemental(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/WoollyRazorback.java b/Mage.Sets/src/mage/sets/coldsnap/WoollyRazorback.java new file mode 100644 index 00000000000..9183bf81de9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/WoollyRazorback.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.SourceHasCounterCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.decorator.ConditionalReplacementEffect; +import mage.abilities.effects.common.PreventCombatDamageBySourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.counter.RemoveCounterSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + */ +public class WoollyRazorback extends CardImpl { + + public WoollyRazorback(UUID ownerId) { + super(ownerId, 25, "Woolly Razorback", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Boar"); + this.subtype.add("Beast"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Woolly Razorback enters the battlefield with three ice counters on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.ICE.createInstance(3)), + "with three ice counters on it")); + // As long as Woolly Razorback has an ice counter on it, prevent all combat damage it would deal and it has defender. + ConditionalReplacementEffect effect = new ConditionalReplacementEffect(new PreventCombatDamageBySourceEffect(Duration.WhileOnBattlefield), + new SourceHasCounterCondition(CounterType.ICE)); + effect.setText("as long as {this} has an ice counter on it, prevent all combat damage it would deal"); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalReplacementEffect(effect)); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(DefenderAbility.getInstance()), + new SourceHasCounterCondition(CounterType.ICE), "and it has defender")); + this.addAbility(ability); + // Whenever Woolly Razorback blocks, remove an ice counter from it. + this.addAbility(new BlocksTriggeredAbility(new RemoveCounterSourceEffect(CounterType.ICE.createInstance()), false)); + } + + public WoollyRazorback(final WoollyRazorback card) { + super(card); + } + + @Override + public WoollyRazorback copy() { + return new WoollyRazorback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander/AcornCatapult.java b/Mage.Sets/src/mage/sets/commander/AcornCatapult.java new file mode 100644 index 00000000000..c1bcbce94e4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/AcornCatapult.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.SquirrelToken; +import mage.players.Player; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class AcornCatapult extends CardImpl { + + public AcornCatapult(UUID ownerId) { + super(ownerId, 241, "Acorn Catapult", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "CMD"; + + // {1}, {tap}: Acorn Catapult deals 1 damage to target creature or player. That creature's controller or that player puts a 1/1 green Squirrel creature token onto the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}")); + ability.addCost(new TapSourceCost()); + ability.addEffect(new AcornCatapultEffect()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public AcornCatapult(final AcornCatapult card) { + super(card); + } + + @Override + public AcornCatapult copy() { + return new AcornCatapult(this); + } +} + + +class AcornCatapultEffect extends OneShotEffect { + + public AcornCatapultEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "that creature's controller or that player puts a 1/1 green Squirrel creature token onto the battlefield"; + } + + public AcornCatapultEffect(final AcornCatapultEffect effect) { + super(effect); + } + + @Override + public AcornCatapultEffect copy() { + return new AcornCatapultEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID targetId = getTargetPointer().getFirst(game, source); + Player player = game.getPlayer(targetId); + if(player == null) { + Permanent permanent = game.getPermanent(targetId); + if(permanent != null) { + player = game.getPlayer(permanent.getControllerId()); + } + } + + if(player != null) { + new SquirrelToken().putOntoBattlefield(1, game, source.getSourceId(), player.getId()); + return true; + } + + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander/AvatarOfSlaughter.java b/Mage.Sets/src/mage/sets/commander/AvatarOfSlaughter.java index bfe50914d20..2213b77abfe 100644 --- a/Mage.Sets/src/mage/sets/commander/AvatarOfSlaughter.java +++ b/Mage.Sets/src/mage/sets/commander/AvatarOfSlaughter.java @@ -41,6 +41,7 @@ import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; +import mage.watchers.common.AttackedThisTurnWatcher; /** * @@ -56,13 +57,13 @@ public class AvatarOfSlaughter extends CardImpl { this.toughness = new MageInt(8); // All creatures have double strike and attack each turn if able. - Effect effect = new GainAbilityAllEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield); + Effect effect = new GainAbilityAllEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures")); effect.setText("All creatures have double strike"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); effect = new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures")); effect.setText("and attack each turn if able"); ability.addEffect(effect); - this.addAbility(ability); + this.addAbility(ability, new AttackedThisTurnWatcher()); } public AvatarOfSlaughter(final AvatarOfSlaughter card) { diff --git a/Mage.Sets/src/mage/sets/commander/ChorusOfTheConclave.java b/Mage.Sets/src/mage/sets/commander/ChorusOfTheConclave.java index 7454b495669..4875d2aca7e 100644 --- a/Mage.Sets/src/mage/sets/commander/ChorusOfTheConclave.java +++ b/Mage.Sets/src/mage/sets/commander/ChorusOfTheConclave.java @@ -46,9 +46,9 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; -import mage.game.stack.Spell; import mage.players.Player; /** @@ -102,33 +102,6 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl { return new ChorusOfTheConclaveReplacementEffect(this); } - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - int xCost = 0; - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { - if (you.chooseUse(Outcome.Benefit, "Do you wish to pay the additonal cost to add +1/+1 counters to the creature you cast?", source, game)) { - xCost += playerPaysXGenericMana(you, source, game); - // save the x value to be available for ETB replacement effect - Object object = game.getState().getValue("spellX" + source.getSourceId()); - Map spellX; - if (object != null && object instanceof Map) { - spellX = (Map) object; - } else { - spellX = new HashMap<>(); - } - spellX.put(event.getSourceId(), xCost); - game.getState().setValue("spellX" + source.getSourceId(), spellX); - } - } - return false; - } - @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.CAST_SPELL; @@ -136,7 +109,7 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getPlayerId() == source.getControllerId()) { + if (event.getPlayerId().equals(source.getControllerId())) { MageObject spellObject = game.getObject(event.getSourceId()); if (spellObject != null) { return spellObject.getCardType().contains(CardType.CREATURE); @@ -145,6 +118,28 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl { return false; } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + int xCost = 0; + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + if (controller.chooseUse(Outcome.Benefit, "Do you wish to pay the additonal cost to add +1/+1 counters to the creature you cast?", source, game)) { + xCost += playerPaysXGenericMana(controller, source, game); + // save the x value to be available for ETB replacement effect + Object object = game.getState().getValue("spellX" + source.getSourceId()); + Map spellX; + if (object != null && object instanceof Map) { + spellX = (Map) object; + } else { + spellX = new HashMap<>(); + } + spellX.put(event.getSourceId().toString() + game.getState().getZoneChangeCounter(event.getSourceId()), xCost); + game.getState().setValue("spellX" + source.getSourceId(), spellX); + } + } + return false; + } + protected static int playerPaysXGenericMana(Player player, Ability source, Game game) { int xValue = 0; boolean payed = false; @@ -157,7 +152,7 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl { payed = true; } } - game.informPlayers(new StringBuilder(player.getLogName()).append(" pays {").append(xValue).append("}.").toString()); + game.informPlayers(player.getLogName() + " pays {" + xValue + "}"); return xValue; } @@ -191,22 +186,25 @@ class ChorusOfTheConclaveReplacementEffect2 extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - Map spellX = (Map) game.getState().getValue("spellX" + source.getSourceId()); - return spellX != null && spellX.containsKey(event.getSourceId()); + Map spellX = (Map) game.getState().getValue("spellX" + source.getSourceId()); + return spellX != null + && event.getSourceId() != null + && spellX.containsKey(event.getSourceId().toString() + (game.getState().getZoneChangeCounter(event.getSourceId()) - 1)); } @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getSourceId()); - Map spellX = (Map) game.getState().getValue("spellX" + source.getSourceId()); + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); + Map spellX = (Map) game.getState().getValue("spellX" + source.getSourceId()); MageObject sourceObject = source.getSourceObject(game); if (sourceObject != null && creature != null && spellX != null) { - int xValue = spellX.get(event.getSourceId()); + String key = event.getSourceId().toString() + (game.getState().getZoneChangeCounter(event.getSourceId()) - 1); + int xValue = spellX.get(key); if (xValue > 0) { creature.addCounters(CounterType.P1P1.createInstance(xValue), game); - game.informPlayers(sourceObject.getName() +": Added " + xValue +" +1/+1 counter" + (xValue > 1 ? "s":"") + "on " + creature.getName()); + game.informPlayers(sourceObject.getLogName() + ": " + creature.getLogName() + " enters the battlefield with " + xValue + " +1/+1 counter" + (xValue > 1 ? "s" : "") + " on it"); } - spellX.remove(event.getSourceId()); + spellX.remove(key); } return false; } diff --git a/Mage.Sets/src/mage/sets/commander/CrescendoOfWar.java b/Mage.Sets/src/mage/sets/commander/CrescendoOfWar.java new file mode 100644 index 00000000000..a2799d9dfc0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/CrescendoOfWar.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CrescendoOfWar extends mage.sets.vintagemasters.CrescendoOfWar { + + public CrescendoOfWar(UUID ownerId) { + super(ownerId); + this.cardNumber = 12; + this.expansionSetCode = "CMD"; + } + + public CrescendoOfWar(final CrescendoOfWar card) { + super(card); + } + + @Override + public CrescendoOfWar copy() { + return new CrescendoOfWar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander/DeathByDragons.java b/Mage.Sets/src/mage/sets/commander/DeathByDragons.java index b9498933341..60572acafe6 100644 --- a/Mage.Sets/src/mage/sets/commander/DeathByDragons.java +++ b/Mage.Sets/src/mage/sets/commander/DeathByDragons.java @@ -28,16 +28,15 @@ package mage.sets.commander; import java.util.UUID; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.game.Game; +import mage.game.permanent.token.DragonToken2; import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.TargetPlayer; @@ -90,7 +89,7 @@ class DeathByDragonsEffect extends OneShotEffect { if (controller != null) { for (UUID playerId : controller.getInRange()) { if (!playerId.equals(this.getTargetPointer().getFirst(game, source))) { - Token token = new DragonToken(); + Token token = new DragonToken2(); token.putOntoBattlefield(1, game, source.getSourceId(), playerId); } } @@ -99,18 +98,3 @@ class DeathByDragonsEffect extends OneShotEffect { return false; } } - -class DragonToken extends Token { - - public DragonToken() { - super("Dragon", "5/5 red Dragon creature token with flying"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add("Dragon"); - power = new MageInt(5); - toughness = new MageInt(5); - addAbility(FlyingAbility.getInstance()); - // set a set with correct token image - this.setOriginalExpansionSetCode("WWK"); - } -} diff --git a/Mage.Sets/src/mage/sets/commander/GwyllionHedgeMage.java b/Mage.Sets/src/mage/sets/commander/GwyllionHedgeMage.java index 8e1840aac88..d596de1eae2 100644 --- a/Mage.Sets/src/mage/sets/commander/GwyllionHedgeMage.java +++ b/Mage.Sets/src/mage/sets/commander/GwyllionHedgeMage.java @@ -40,30 +40,28 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.counters.CounterType; -import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.KithkinToken; -import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; /** * * @author jeffwadsworth - + * */ public class GwyllionHedgeMage extends CardImpl { - + private static final FilterLandPermanent filter = new FilterLandPermanent("Plains"); private static final FilterLandPermanent filter2 = new FilterLandPermanent("Swamps"); - private static final FilterCreaturePermanent filter3 = new FilterCreaturePermanent(); static { filter.add(new SubtypePredicate("Plains")); - filter2.add(new SubtypePredicate("Swamps")); + filter2.add(new SubtypePredicate("Swamp")); } - - private String rule1 = "When {this} enters the battlefield, if you control two or more Plains, you may put a 1/1 white Kithkin Soldier creature token onto the battlefield."; - private String rule2 = "When {this} enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature."; + + private final String rule1 = "When {this} enters the battlefield, if you control two or more Plains, you may put a 1/1 white Kithkin Soldier creature token onto the battlefield."; + private final String rule2 = "When {this} enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature."; public GwyllionHedgeMage(UUID ownerId) { super(ownerId, 202, "Gwyllion Hedge-Mage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W/B}"); @@ -77,12 +75,15 @@ public class GwyllionHedgeMage extends CardImpl { // When Gwyllion Hedge-Mage enters the battlefield, if you control two or more Plains, you may put a 1/1 white Kithkin Soldier creature token onto the battlefield. Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new KithkinToken()), true), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1), rule1); this.addAbility(ability); - + // When Gwyllion Hedge-Mage enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature. - Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance()), true), new PermanentsOnTheBattlefieldCondition(filter2, CountType.MORE_THAN, 1), rule2); - ability2.addTarget(new TargetPermanent(filter3)); + Ability ability2 = new ConditionalTriggeredAbility( + new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance()), true), + new PermanentsOnTheBattlefieldCondition(filter2, CountType.MORE_THAN, 1), + rule2); + ability2.addTarget(new TargetCreaturePermanent()); this.addAbility(ability2); - + } public GwyllionHedgeMage(final GwyllionHedgeMage card) { diff --git a/Mage.Sets/src/mage/sets/commander/HydraOmnivore.java b/Mage.Sets/src/mage/sets/commander/HydraOmnivore.java index fea88abc3d2..2f56264ff0f 100644 --- a/Mage.Sets/src/mage/sets/commander/HydraOmnivore.java +++ b/Mage.Sets/src/mage/sets/commander/HydraOmnivore.java @@ -55,7 +55,7 @@ public class HydraOmnivore extends CardImpl { this.toughness = new MageInt(8); // Whenever Hydra Omnivore deals combat damage to an opponent, it deals that much damage to each other opponent. - this.addAbility(new DealsDamageToOpponentTriggeredAbility(new HydraOmnivoreEffect(), false, true)); + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new HydraOmnivoreEffect(), false, true, true)); } public HydraOmnivore(final HydraOmnivore card) { diff --git a/Mage.Sets/src/mage/sets/commander/KaaliaOfTheVast.java b/Mage.Sets/src/mage/sets/commander/KaaliaOfTheVast.java index ae71daeb4db..ab1c397d693 100644 --- a/Mage.Sets/src/mage/sets/commander/KaaliaOfTheVast.java +++ b/Mage.Sets/src/mage/sets/commander/KaaliaOfTheVast.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -148,20 +148,19 @@ class KaaliaOfTheVastEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, "Put an Angel, Demon, or Dragon creature card from your hand onto the battlefield tapped and attacking?", source, game)) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null || !controller.chooseUse(Outcome.PutCreatureInPlay, "Put an Angel, Demon, or Dragon creature card from your hand onto the battlefield tapped and attacking?", source, game)) { return false; } TargetCardInHand target = new TargetCardInHand(filter); - if (target.canChoose(player.getId(), game) && target.choose(getOutcome(), player.getId(), source.getSourceId(), game)) { + if (target.canChoose(controller.getId(), game) && target.choose(getOutcome(), controller.getId(), source.getSourceId(), game)) { if (target.getTargets().size() > 0) { UUID cardId = target.getFirstTarget(); Card card = game.getCard(cardId); if (card != null && game.getCombat() != null) { UUID defenderId = game.getCombat().getDefendingPlayerId(source.getSourceId(), game); if (defenderId != null) { - player.getHand().remove(card); - player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId(), true); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); Permanent creature = game.getPermanent(cardId); if (creature != null) { game.getCombat().addAttackerToCombat(card.getId(), defenderId, game); diff --git a/Mage.Sets/src/mage/sets/commander/KodamasReach.java b/Mage.Sets/src/mage/sets/commander/KodamasReach.java index 6b7883e9e8b..103a617285c 100644 --- a/Mage.Sets/src/mage/sets/commander/KodamasReach.java +++ b/Mage.Sets/src/mage/sets/commander/KodamasReach.java @@ -110,17 +110,17 @@ class KodamasReachEffect extends OneShotEffect { controller.choose(Outcome.Benefit, revealed, target2, game); Card card = revealed.get(target2.getFirstTarget(), game); if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); revealed.remove(card); } card = revealed.getCards(game).iterator().next(); if (card != null) { - controller.moveCards(card, null, Zone.HAND, source, game); + controller.moveCards(card, Zone.HAND, source, game); } } else if (target.getTargets().size() == 1) { Card card = revealed.getCards(game).iterator().next(); if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); } } diff --git a/Mage.Sets/src/mage/sets/commander/ReinsOfPower.java b/Mage.Sets/src/mage/sets/commander/ReinsOfPower.java new file mode 100644 index 00000000000..5d5f0064b44 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/ReinsOfPower.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class ReinsOfPower extends mage.sets.stronghold.ReinsOfPower { + + public ReinsOfPower(UUID ownerId) { + super(ownerId); + this.cardNumber = 57; + this.expansionSetCode = "CMD"; + } + + public ReinsOfPower(final ReinsOfPower card) { + super(card); + } + + @Override + public ReinsOfPower copy() { + return new ReinsOfPower(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander/RikuOfTwoReflections.java b/Mage.Sets/src/mage/sets/commander/RikuOfTwoReflections.java index e975b2db45b..f1d4582bf77 100644 --- a/Mage.Sets/src/mage/sets/commander/RikuOfTwoReflections.java +++ b/Mage.Sets/src/mage/sets/commander/RikuOfTwoReflections.java @@ -30,11 +30,13 @@ package mage.sets.commander; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -48,11 +50,8 @@ import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.TokenPredicate; import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.game.stack.Spell; import mage.players.Player; -import mage.util.CardUtil; /** * @@ -62,6 +61,7 @@ public class RikuOfTwoReflections extends CardImpl { private static final FilterSpell filter = new FilterSpell("an instant or sorcery spell"); private static final FilterControlledCreaturePermanent filterPermanent = new FilterControlledCreaturePermanent("another nontoken creature"); + static { filter.add(Predicates.or( new CardTypePredicate(CardType.INSTANT), @@ -85,12 +85,10 @@ public class RikuOfTwoReflections extends CardImpl { this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid(new RikuOfTwoReflectionsCopyEffect(), new ManaCostsImpl("{U}{R}")), filter, false, true)); // Whenever another nontoken creature enters the battlefield under your control, you may pay {G}{U}. If you do, put a token that's a copy of that creature onto the battlefield. - Ability ability = new EntersBattlefieldAllTriggeredAbility( - Zone.BATTLEFIELD, new RikuOfTwoReflectionsCopyTokenEffect(),filterPermanent, false, SetTargetPointer.PERMANENT, - "Whenever another nontoken creature enters the battlefield under your control, you may pay {G}{U}. If you do, put a token that's a copy of that creature onto the battlefield.", - true); - ability.addCost(new ManaCostsImpl("{G}{U}")); - this.addAbility(ability); + Effect effect = new DoIfCostPaid(new PutTokenOntoBattlefieldCopyTargetEffect(), + new ManaCostsImpl("{G}{U}"), "Put a token that's a copy of that creature onto the battlefield?"); + effect.setText("you may pay {G}{U}. If you do, put a token that's a copy of that creature onto the battlefield"); + this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, effect, filterPermanent, false, SetTargetPointer.PERMANENT, null)); } public RikuOfTwoReflections(final RikuOfTwoReflections card) { @@ -139,32 +137,3 @@ class RikuOfTwoReflectionsCopyEffect extends OneShotEffect { return new RikuOfTwoReflectionsCopyEffect(this); } } - -class RikuOfTwoReflectionsCopyTokenEffect extends OneShotEffect { - - public RikuOfTwoReflectionsCopyTokenEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "put a token that's a copy of that creature onto the battlefield"; - } - - public RikuOfTwoReflectionsCopyTokenEffect(final RikuOfTwoReflectionsCopyTokenEffect effect) { - super(effect); - } - - @Override - public RikuOfTwoReflectionsCopyTokenEffect copy() { - return new RikuOfTwoReflectionsCopyTokenEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); - if (permanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/commander/ScatteringStroke.java b/Mage.Sets/src/mage/sets/commander/ScatteringStroke.java index 7512eb1a801..7f7cdd7bccc 100644 --- a/Mage.Sets/src/mage/sets/commander/ScatteringStroke.java +++ b/Mage.Sets/src/mage/sets/commander/ScatteringStroke.java @@ -1,112 +1,110 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.commander; - -import java.util.UUID; -import mage.Mana; -import mage.abilities.Ability; -import mage.abilities.common.delayed.AtTheBeginOMainPhaseDelayedTriggeredAbility; -import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect; -import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect; -import mage.abilities.effects.common.ClashEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.game.Game; -import mage.game.stack.Spell; -import mage.players.Player; -import mage.target.TargetSpell; -import mage.target.targetpointer.FixedTarget; - -/** - * - * @author LevelX2 - */ -public class ScatteringStroke extends CardImpl { - - public ScatteringStroke(UUID ownerId) { - super(ownerId, 60, "Scattering Stroke", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); - this.expansionSetCode = "CMD"; - - - // Counter target spell. Clash with an opponent. If you win, at the beginning of your next main phase, you may add {X} to your mana pool, where X is that spell's converted mana cost. - this.getSpellAbility().addEffect(new ScatteringStrokeEffect()); - this.getSpellAbility().addTarget(new TargetSpell()); - } - - public ScatteringStroke(final ScatteringStroke card) { - super(card); - } - - @Override - public ScatteringStroke copy() { - return new ScatteringStroke(this); - } -} - - -class ScatteringStrokeEffect extends OneShotEffect { - - public ScatteringStrokeEffect() { - super(Outcome.Benefit); - this.staticText = "Counter target spell. Clash with an opponent. If you win, at the beginning of your next main phase, you may add {X} to your mana pool, where X is that spell's converted mana cost"; - } - - public ScatteringStrokeEffect(final ScatteringStrokeEffect effect) { - super(effect); - } - - @Override - public ScatteringStrokeEffect copy() { - return new ScatteringStrokeEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Spell spell = (Spell) game.getStack().getStackObject(getTargetPointer().getFirst(game, source)); - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null && spell != null) { - game.getStack().counter(spell.getId(), source.getSourceId(), game); - if (ClashEffect.getInstance().apply(game, source)) { - Effect effect = new AddManaToManaPoolSourceControllerEffect(new Mana(0,0,0,0,0,spell.getConvertedManaCost(),0)); - AtTheBeginOMainPhaseDelayedTriggeredAbility delayedAbility = - new AtTheBeginOMainPhaseDelayedTriggeredAbility(effect, true, TargetController.YOU, AtTheBeginOMainPhaseDelayedTriggeredAbility.PhaseSelection.NEXT_MAIN); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - } - return true; - } - return false; - } +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfMainPhaseDelayedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect; +import mage.abilities.effects.common.ClashEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author LevelX2 + */ +public class ScatteringStroke extends CardImpl { + + public ScatteringStroke(UUID ownerId) { + super(ownerId, 60, "Scattering Stroke", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); + this.expansionSetCode = "CMD"; + + + // Counter target spell. Clash with an opponent. If you win, at the beginning of your next main phase, you may add {X} to your mana pool, where X is that spell's converted mana cost. + this.getSpellAbility().addEffect(new ScatteringStrokeEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + public ScatteringStroke(final ScatteringStroke card) { + super(card); + } + + @Override + public ScatteringStroke copy() { + return new ScatteringStroke(this); + } +} + + +class ScatteringStrokeEffect extends OneShotEffect { + + public ScatteringStrokeEffect() { + super(Outcome.Benefit); + this.staticText = "Counter target spell. Clash with an opponent. If you win, at the beginning of your next main phase, you may add {X} to your mana pool, where X is that spell's converted mana cost"; + } + + public ScatteringStrokeEffect(final ScatteringStrokeEffect effect) { + super(effect); + } + + @Override + public ScatteringStrokeEffect copy() { + return new ScatteringStrokeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = (Spell) game.getStack().getStackObject(getTargetPointer().getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null && spell != null) { + game.getStack().counter(spell.getId(), source.getSourceId(), game); + if (ClashEffect.getInstance().apply(game, source)) { + Effect effect = new AddManaToManaPoolSourceControllerEffect(new Mana(0,0,0,0,0,spell.getConvertedManaCost(),0)); + AtTheBeginOfMainPhaseDelayedTriggeredAbility delayedAbility = + new AtTheBeginOfMainPhaseDelayedTriggeredAbility(effect, true, TargetController.YOU, AtTheBeginOfMainPhaseDelayedTriggeredAbility.PhaseSelection.NEXT_MAIN); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } + return true; + } + return false; + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/commander/SewerNemesis.java b/Mage.Sets/src/mage/sets/commander/SewerNemesis.java index fa7df34d3fa..e8955959eee 100644 --- a/Mage.Sets/src/mage/sets/commander/SewerNemesis.java +++ b/Mage.Sets/src/mage/sets/commander/SewerNemesis.java @@ -35,7 +35,7 @@ import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChoosePlayerEffect; import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveTargetEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.cards.CardImpl; @@ -47,9 +47,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.players.Player; -import mage.target.TargetPlayer; import mage.target.targetpointer.FixedTarget; /** @@ -67,7 +65,7 @@ public class SewerNemesis extends CardImpl { this.toughness = new MageInt(0); // As Sewer Nemesis enters the battlefield, choose a player. - this.addAbility(new AsEntersBattlefieldAbility(new SewerNemesisChoosePlayerEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChoosePlayerEffect(Outcome.Detriment))); // Sewer Nemesis's power and toughness are each equal to the number of cards in the chosen player's graveyard. this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInTargetOpponentsGraveyardCount(), Duration.WhileOnBattlefield))); // Whenever the chosen player casts a spell, that player puts the top card of his or her library into his or her graveyard. @@ -85,42 +83,8 @@ public class SewerNemesis extends CardImpl { } } -class SewerNemesisChoosePlayerEffect extends OneShotEffect { - - public SewerNemesisChoosePlayerEffect() { - super(Outcome.Detriment); - this.staticText = "choose a player"; - } - - public SewerNemesisChoosePlayerEffect(final SewerNemesisChoosePlayerEffect effect) { - super(effect); - } - - @Override - public SewerNemesisChoosePlayerEffect copy() { - return new SewerNemesisChoosePlayerEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - TargetPlayer target = new TargetPlayer(1,1,true); - if (player.choose(this.outcome, target, source.getSourceId(), game)) { - Player chosenPlayer = game.getPlayer(target.getFirstTarget()); - if (chosenPlayer != null) { - game.informPlayers(permanent.getLogName() + ": " + player.getLogName() + " has chosen " + chosenPlayer.getLogName()); - game.getState().setValue(permanent.getId() + "_player", target.getFirstTarget()); - return true; - } - } - } - return false; - } -} - class CardsInTargetOpponentsGraveyardCount implements DynamicValue { + @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { if (sourceAbility != null) { diff --git a/Mage.Sets/src/mage/sets/commander/Spawnwrithe.java b/Mage.Sets/src/mage/sets/commander/Spawnwrithe.java index fed6939173d..9fc589a8482 100644 --- a/Mage.Sets/src/mage/sets/commander/Spawnwrithe.java +++ b/Mage.Sets/src/mage/sets/commander/Spawnwrithe.java @@ -30,7 +30,7 @@ package mage.sets.commander; import java.util.UUID; import mage.MageInt; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; -import mage.abilities.effects.common.PutTokenOntoBattlefieldCopySource; +import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -53,7 +53,7 @@ public class Spawnwrithe extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); // Whenever Spawnwrithe deals combat damage to a player, put a token that's a copy of Spawnwrithe onto the battlefield. - this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new PutTokenOntoBattlefieldCopySource(), false)); + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new PutTokenOntoBattlefieldCopySourceEffect(), false)); } diff --git a/Mage.Sets/src/mage/sets/commander/SpellCrumple.java b/Mage.Sets/src/mage/sets/commander/SpellCrumple.java index 08c38924c81..1f1c8bd5f31 100644 --- a/Mage.Sets/src/mage/sets/commander/SpellCrumple.java +++ b/Mage.Sets/src/mage/sets/commander/SpellCrumple.java @@ -28,28 +28,17 @@ package mage.sets.commander; import java.util.UUID; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.ReturnToLibrarySpellEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Duration; import mage.constants.Outcome; -import mage.constants.PhaseStep; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.events.ZoneChangeEvent; -import mage.game.stack.Spell; -import mage.game.stack.StackObject; import mage.players.Player; import mage.target.TargetSpell; -import mage.target.targetpointer.FixedTarget; /** * @@ -63,7 +52,7 @@ public class SpellCrumple extends CardImpl { // Counter target spell. If that spell is countered this way, put it on the bottom of its owner's library instead of into that player's graveyard. Put Spell Crumple on the bottom of its owner's library. this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new SpellCrumpleCounterEffect()); + this.getSpellAbility().addEffect(new SpellCrumpleCounterEffect()); this.getSpellAbility().addEffect(new ReturnToLibrarySpellEffect(false)); } @@ -95,99 +84,10 @@ class SpellCrumpleCounterEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - UUID objectId = source.getFirstTarget(); - UUID sourceId = source.getSourceId(); - // counter code from SpellStack - StackObject stackObject = game.getStack().getStackObject(objectId); - MageObject sourceObject = game.getObject(sourceId); - if (stackObject != null && sourceObject != null) { - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) { - if ( stackObject instanceof Spell ) { - game.rememberLKI(objectId, Zone.STACK, (Spell)stackObject); - } - // Spell Crumple specific code - ReplacementEffectImpl effect = new SpellCrumpleReplacementEffect(); - effect.setTargetPointer(new FixedTarget(stackObject.getId())); - game.addEffect(effect, source); - // Spell Crumple specific code end - game.informPlayers(new StringBuilder(stackObject.getName()).append(" is countered by ").append(sourceObject.getLogName()).toString()); - game.getStack().remove(stackObject); - stackObject.counter(sourceId, game); // tries to move to graveyard - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId())); - } else { - game.informPlayers(new StringBuilder(stackObject.getName()).append(" could not be countered by ").append(sourceObject.getLogName()).toString()); - } - return true; - } - return false; - // counter code from SpellStack end - } -} - -class SpellCrumpleReplacementEffect extends ReplacementEffectImpl { - - private PhaseStep phaseStep; - - public SpellCrumpleReplacementEffect() { - super(Duration.OneUse, Outcome.Benefit); - staticText = "If that spell is countered this way, put it on the bottom of its owner's library instead of into that player's graveyard"; - phaseStep = null; - } - - public SpellCrumpleReplacementEffect(final SpellCrumpleReplacementEffect effect) { - super(effect); - phaseStep = effect.phaseStep; - } - - @Override - public SpellCrumpleReplacementEffect copy() { - return new SpellCrumpleReplacementEffect(this); - } - - @Override - public boolean isInactive(Ability source, Game game) { - if (!game.getPhase().getStep().getType().equals(phaseStep)) { - return true; - } - return super.isInactive(source, game); - } - - @Override - public void init(Ability source, Game game) { - phaseStep = game.getPhase().getStep().getType(); - super.init(source, game); - } - - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - MageObject targetObject = game.getObject(event.getTargetId()); - if (targetObject instanceof Card) { - Card card = (Card) targetObject; - if (card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false, event.getAppliedEffects())) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - game.informPlayers(controller.getLogName() + " has put " + card.getName() + " on the bottom of the library."); - } - return true; - } - } - return false; - } - - @Override - public boolean checksEventType(GameEvent event, Game game) { - return event.getType() == EventType.ZONE_CHANGE; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (((ZoneChangeEvent)event).getToZone().equals(Zone.GRAVEYARD)) { - MageObject mageObject = game.getLastKnownInformation(getTargetPointer().getFirst(game, source), Zone.STACK); - if (mageObject instanceof Spell) { - return ((Spell)mageObject).getSourceId().equals(event.getTargetId()); - } + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + return game.getStack().counter(targetPointer.getFirst(game, source), source.getSourceId(), game, Zone.LIBRARY, false, false); } return false; } - } diff --git a/Mage.Sets/src/mage/sets/commander/TarielReckonerOfSouls.java b/Mage.Sets/src/mage/sets/commander/TarielReckonerOfSouls.java index 7cfe1e0b577..cb464431dbc 100644 --- a/Mage.Sets/src/mage/sets/commander/TarielReckonerOfSouls.java +++ b/Mage.Sets/src/mage/sets/commander/TarielReckonerOfSouls.java @@ -110,7 +110,7 @@ class TarielReckonerOfSoulsEffect extends OneShotEffect { } if (!creatureCards.isEmpty()) { Card card = creatureCards.getRandom(game); - controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } return true; } diff --git a/Mage.Sets/src/mage/sets/commander/TheMimeoplasm.java b/Mage.Sets/src/mage/sets/commander/TheMimeoplasm.java index 5be1bed0a24..f5d7604ef74 100644 --- a/Mage.Sets/src/mage/sets/commander/TheMimeoplasm.java +++ b/Mage.Sets/src/mage/sets/commander/TheMimeoplasm.java @@ -80,27 +80,27 @@ public class TheMimeoplasm extends CardImpl { } class TheMimeoplasmEffect extends OneShotEffect { - + TheMimeoplasmEffect() { super(Outcome.Copy); } - + TheMimeoplasmEffect(final TheMimeoplasmEffect effect) { super(effect); } - + @Override public TheMimeoplasmEffect copy() { return new TheMimeoplasmEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (controller != null && permanent != null) { if (new CardsInAllGraveyardsCount(new FilterCreatureCard()).calculate(game, source, this) >= 2) { - if (controller.chooseUse(Outcome.Benefit, "Do you want to exile two creature cards from graveyards?", source, game)) { + if (controller.chooseUse(Outcome.Benefit, "Do you want to exile two creature cards from graveyards?", source, game)) { TargetCardInGraveyard targetCopy = new TargetCardInGraveyard(new FilterCreatureCard("creature card to become a copy of")); TargetCardInGraveyard targetCounters = new TargetCardInGraveyard(new FilterCreatureCard("creature card to determine amount of additional +1/+1 counters")); if (controller.choose(Outcome.Copy, targetCopy, source.getSourceId(), game)) { @@ -112,7 +112,7 @@ class TheMimeoplasmEffect extends OneShotEffect { Cards cardsToExile = new CardsImpl(); cardsToExile.add(cardToCopy); cardsToExile.add(cardForCounters); - controller.moveCards(cardsToExile, Zone.GRAVEYARD, Zone.EXILED, source, game); + controller.moveCards(cardsToExile, Zone.EXILED, source, game); CopyEffect copyEffect = new CopyEffect(Duration.Custom, cardToCopy, source.getSourceId()); game.addEffect(copyEffect, source); permanent.addCounters(CounterType.P1P1.createInstance(cardForCounters.getPower().getValue()), game); @@ -122,7 +122,7 @@ class TheMimeoplasmEffect extends OneShotEffect { } } } - return true; + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/commander/TrenchGorger.java b/Mage.Sets/src/mage/sets/commander/TrenchGorger.java index cc5820767c1..b9ca2c24126 100644 --- a/Mage.Sets/src/mage/sets/commander/TrenchGorger.java +++ b/Mage.Sets/src/mage/sets/commander/TrenchGorger.java @@ -40,6 +40,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.constants.Zone; import mage.filter.common.FilterLandCard; import mage.game.Game; @@ -100,13 +101,13 @@ class TrenchGorgerEffect extends OneShotEffect { TargetCardInLibrary target = new TargetCardInLibrary(0, Integer.MAX_VALUE, new FilterLandCard("any number of land cards")); target.choose(outcome, controller.getId(), controller.getId(), game); int count = 0; - for (UUID cardId: target.getTargets()) { + for (UUID cardId : target.getTargets()) { Card card = game.getCard(cardId); controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, true); count++; } controller.shuffleLibrary(game); - game.addEffect(new SetPowerToughnessSourceEffect(count, count, Duration.EndOfGame), source); + game.addEffect(new SetPowerToughnessSourceEffect(count, count, Duration.EndOfGame, SubLayer.SetPT_7b), source); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/commander/Triskelavus.java b/Mage.Sets/src/mage/sets/commander/Triskelavus.java new file mode 100644 index 00000000000..4c7a7f021c3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/Triskelavus.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Triskelavus extends mage.sets.timespiral.Triskelavus { + + public Triskelavus(UUID ownerId) { + super(ownerId); + this.cardNumber = 263; + this.expansionSetCode = "CMD"; + } + + public Triskelavus(final Triskelavus card) { + super(card); + } + + @Override + public Triskelavus copy() { + return new Triskelavus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2013/CurseOfShallowGraves.java b/Mage.Sets/src/mage/sets/commander2013/CurseOfShallowGraves.java index fa2e34e982f..d51655b3c7d 100644 --- a/Mage.Sets/src/mage/sets/commander2013/CurseOfShallowGraves.java +++ b/Mage.Sets/src/mage/sets/commander2013/CurseOfShallowGraves.java @@ -28,9 +28,11 @@ package mage.sets.commander2013; import java.util.UUID; +import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.CreateTokenTargetEffect; import mage.abilities.keyword.EnchantAbility; @@ -44,6 +46,7 @@ import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.ZombieToken; +import mage.players.Player; import mage.target.TargetPlayer; import mage.target.targetpointer.FixedTarget; @@ -59,7 +62,6 @@ public class CurseOfShallowGraves extends CardImpl { this.subtype.add("Aura"); this.subtype.add("Curse"); - // Enchant player TargetPlayer auraTarget = new TargetPlayer(); this.getSpellAbility().addTarget(auraTarget); @@ -83,7 +85,7 @@ public class CurseOfShallowGraves extends CardImpl { class CurseOfShallowTriggeredAbility extends TriggeredAbilityImpl { public CurseOfShallowTriggeredAbility() { - super(Zone.BATTLEFIELD, new CreateTokenTargetEffect(new ZombieToken(), new StaticValue(1), true, false), true); + super(Zone.BATTLEFIELD, new CurseOfShallowEffect()); } public CurseOfShallowTriggeredAbility(Effect effect, boolean optional, String text) { @@ -105,7 +107,7 @@ class CurseOfShallowTriggeredAbility extends TriggeredAbilityImpl { if (enchantment != null && enchantment.getAttachedTo() != null && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) { - for (Effect effect: this.getEffects()) { + for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId())); } return true; @@ -124,3 +126,31 @@ class CurseOfShallowTriggeredAbility extends TriggeredAbilityImpl { } } + +class CurseOfShallowEffect extends OneShotEffect { + + public CurseOfShallowEffect() { + super(Outcome.Benefit); + this.staticText = "that attacking player may put a 2/2 black Zombie creature token onto the battlefield tapped"; + } + + public CurseOfShallowEffect(final CurseOfShallowEffect effect) { + super(effect); + } + + @Override + public CurseOfShallowEffect copy() { + return new CurseOfShallowEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player attacker = game.getPlayer(this.getTargetPointer().getFirst(game, source)); + if (attacker != null && attacker.chooseUse(outcome, "Put a 2/2 black Zombie creature token onto the battlefield tapped?", source, game)) { + Effect effect = new CreateTokenTargetEffect(new ZombieToken(), new StaticValue(1), true, false); + effect.setTargetPointer(targetPointer); + return effect.apply(game, source); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2013/DeepfireElemental.java b/Mage.Sets/src/mage/sets/commander2013/DeepfireElemental.java index e49ad954f6c..d3b093498b2 100644 --- a/Mage.Sets/src/mage/sets/commander2013/DeepfireElemental.java +++ b/Mage.Sets/src/mage/sets/commander2013/DeepfireElemental.java @@ -52,11 +52,14 @@ import mage.target.TargetPermanent; */ public class DeepfireElemental extends CardImpl { + private final UUID originalId; + private static final FilterPermanent filter = new FilterPermanent("artifact or creature with converted mana cost X"); + static { filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE))); } - + public DeepfireElemental(UUID ownerId) { super(ownerId, 185, "Deepfire Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}{R}"); this.expansionSetCode = "C13"; @@ -68,12 +71,13 @@ public class DeepfireElemental extends CardImpl { // {X}{X}{1}: Destroy target artifact or creature with converted mana cost X. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{1}")); ability.addTarget(new TargetPermanent(filter)); + originalId = ability.getOriginalId(); this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SimpleActivatedAbility) { + if (ability.getOriginalId().equals(originalId)) { ability.getTargets().clear(); FilterPermanent newFilter = filter.copy(); newFilter.setMessage(new StringBuilder("artifact or creature with converted mana cost {").append(ability.getManaCostsToPay().getX()).append("}").toString()); @@ -85,6 +89,7 @@ public class DeepfireElemental extends CardImpl { public DeepfireElemental(final DeepfireElemental card) { super(card); + this.originalId = card.originalId; } @Override diff --git a/Mage.Sets/src/mage/sets/commander2013/EndrekSahrMasterBreeder.java b/Mage.Sets/src/mage/sets/commander2013/EndrekSahrMasterBreeder.java index dfed94b5507..a0f9f59306a 100644 --- a/Mage.Sets/src/mage/sets/commander2013/EndrekSahrMasterBreeder.java +++ b/Mage.Sets/src/mage/sets/commander2013/EndrekSahrMasterBreeder.java @@ -45,7 +45,7 @@ import mage.filter.FilterSpell; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.ThrullToken; import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; @@ -114,22 +114,10 @@ class EndrekSahrMasterBreederEffect extends OneShotEffect { if (spell != null) { int cmc = spell.getConvertedManaCost(); if (cmc > 0) { - return new CreateTokenEffect(new EndrekSahrMasterBreederThrullToken(), cmc).apply(game, source); + return new CreateTokenEffect(new ThrullToken(), cmc).apply(game, source); } return true; } return false; } } - -class EndrekSahrMasterBreederThrullToken extends Token { - - public EndrekSahrMasterBreederThrullToken() { - super("Thrull", "1/1 black Thrull creature token"); - cardType.add(CardType.CREATURE); - color.setBlack(true); - subtype.add("Thrull"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/commander2013/HullBreach.java b/Mage.Sets/src/mage/sets/commander2013/HullBreach.java index c47d23d6667..0ab48a04ed8 100644 --- a/Mage.Sets/src/mage/sets/commander2013/HullBreach.java +++ b/Mage.Sets/src/mage/sets/commander2013/HullBreach.java @@ -38,7 +38,7 @@ import mage.filter.common.FilterEnchantmentPermanent; import mage.target.Target; import mage.target.TargetPermanent; import mage.target.common.TargetArtifactPermanent; -import mage.target.targetpointer.SecondTargetPointer; +import mage.target.common.TargetEnchantmentPermanent; /** * @@ -50,7 +50,6 @@ public class HullBreach extends CardImpl { super(ownerId, 193, "Hull Breach", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}{G}"); this.expansionSetCode = "C13"; - // Choose one - Destroy target artifact; this.getSpellAbility().addEffect(new DestroyTargetEffect()); Target target = new TargetArtifactPermanent(); @@ -63,18 +62,13 @@ public class HullBreach extends CardImpl { this.getSpellAbility().addMode(mode); // or destroy target artifact and target enchantment. mode = new Mode(); - mode.getEffects().add(new DestroyTargetEffect()); - target = new TargetArtifactPermanent(); - mode.getTargets().add(target); - Effect effect = new DestroyTargetEffect(); - effect.setTargetPointer(new SecondTargetPointer()); - effect.setText("and target enchantment"); + Effect effect = new DestroyTargetEffect(false, true); + effect.setText("destroy target artifact and target enchantment"); mode.getEffects().add(effect); - target = new TargetPermanent(new FilterEnchantmentPermanent()); - mode.getTargets().add(target); + mode.getTargets().add(new TargetArtifactPermanent()); + mode.getTargets().add(new TargetEnchantmentPermanent()); this.getSpellAbility().addMode(mode); - } public HullBreach(final HullBreach card) { diff --git a/Mage.Sets/src/mage/sets/commander2013/IncendiaryCommand.java b/Mage.Sets/src/mage/sets/commander2013/IncendiaryCommand.java index 133206403f4..15d7bd457fe 100644 --- a/Mage.Sets/src/mage/sets/commander2013/IncendiaryCommand.java +++ b/Mage.Sets/src/mage/sets/commander2013/IncendiaryCommand.java @@ -27,6 +27,8 @@ */ package mage.sets.commander2013; +import java.util.HashMap; +import java.util.Map; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; @@ -54,8 +56,7 @@ public class IncendiaryCommand extends CardImpl { super(ownerId, 113, "Incendiary Command", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); this.expansionSetCode = "C13"; - - // Choose two - + // Choose two - this.getSpellAbility().getModes().setMinModes(2); this.getSpellAbility().getModes().setMaxModes(2); // Incendiary Command deals 4 damage to target player; @@ -107,16 +108,23 @@ class IncendiaryCommandDrawEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (UUID playerId : controller.getInRange()) { + Map cardsToDraw = new HashMap<>(); + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - int cards = player.getHand().size(); - if (cards > 0) { - player.discard(cards, source, game); - player.drawCards(cards, game); + int cardsInHand = player.getHand().size(); + player.discard(cardsInHand, false, source, game); + if (cardsInHand > 0) { + cardsToDraw.put(playerId, cardsInHand); } } } + for (UUID playerId : cardsToDraw.keySet()) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.drawCards(cardsToDraw.get(playerId), game); + } + } return true; } return false; diff --git a/Mage.Sets/src/mage/sets/commander2013/JelevaNephaliasScourge.java b/Mage.Sets/src/mage/sets/commander2013/JelevaNephaliasScourge.java index 4fbc4aba7cb..965cb69fd59 100644 --- a/Mage.Sets/src/mage/sets/commander2013/JelevaNephaliasScourge.java +++ b/Mage.Sets/src/mage/sets/commander2013/JelevaNephaliasScourge.java @@ -116,7 +116,7 @@ class JelevaNephaliasScourgeEffect extends OneShotEffect { Player player = game.getPlayer(playerId); if (player != null) { int cardsToExile = Math.min(player.getLibrary().size(), xValue); - for(int i = 0; i < cardsToExile; i++) { + for (int i = 0; i < cardsToExile; i++) { Card card = player.getLibrary().removeFromTop(game); if (card != null) { card.moveToExile(CardUtil.getCardExileZoneId(game, source), sourceCard.getName(), source.getSourceId(), game); @@ -170,7 +170,7 @@ class JelevaNephaliasCastEffect extends OneShotEffect { class JelevaNephaliasWatcher extends Watcher { - private Map manaSpendToCast = new HashMap<>(); // cast + private final Map manaSpendToCast = new HashMap<>(); // cast public JelevaNephaliasWatcher() { super("ManaPaidToCastJelevaNephalias", WatcherScope.CARD); @@ -190,10 +190,10 @@ class JelevaNephaliasWatcher extends Watcher { if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getSourceId().equals(sourceId)) { if (!game.getStack().isEmpty()) { for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell && ((Spell)stackObject).getSourceId().equals(sourceId)) { + if (stackObject instanceof Spell && ((Spell) stackObject).getSourceId().equals(sourceId)) { Card card = game.getCard(sourceId); if (!manaSpendToCast.containsValue(card.getZoneChangeCounter(game))) { - manaSpendToCast.put(new Integer(card.getZoneChangeCounter(game)), new Integer(((Spell)stackObject).getSpellAbility().getManaCostsToPay().convertedManaCost())); + manaSpendToCast.put(card.getZoneChangeCounter(game), ((Spell) stackObject).getSpellAbility().getManaCostsToPay().convertedManaCost()); } } } diff --git a/Mage.Sets/src/mage/sets/commander2013/KirtarsWrath.java b/Mage.Sets/src/mage/sets/commander2013/KirtarsWrath.java index 1fd341cdece..0ace8899522 100644 --- a/Mage.Sets/src/mage/sets/commander2013/KirtarsWrath.java +++ b/Mage.Sets/src/mage/sets/commander2013/KirtarsWrath.java @@ -59,7 +59,7 @@ public class KirtarsWrath extends CardImpl { new KirtarsWrathEffect(), new DestroyAllEffect(new FilterCreaturePermanent("all creatures"), true), new CardsInControllerGraveCondition(7), - "Destroy all creatures. They can't be regenerated.

Threshold - If seven or more cards are in your graveyard, instead destroy all creatures, then put two 1/1 white Spirit creature tokens with flying onto the battlefield. Creatures destroyed this way can't be regenerated")); + "Destroy all creatures. They can't be regenerated.

Threshold - If seven or more cards are in your graveyard, instead destroy all creatures, then put two 1/1 white Spirit creature tokens with flying onto the battlefield. Creatures destroyed this way can't be regenerated")); } diff --git a/Mage.Sets/src/mage/sets/commander2013/LeafdrakeRoost.java b/Mage.Sets/src/mage/sets/commander2013/LeafdrakeRoost.java index 97101a89d01..b8ee63186e4 100644 --- a/Mage.Sets/src/mage/sets/commander2013/LeafdrakeRoost.java +++ b/Mage.Sets/src/mage/sets/commander2013/LeafdrakeRoost.java @@ -70,7 +70,7 @@ public class LeafdrakeRoost extends CardImpl { this.addAbility(ability); // Enchanted land has "{G}{U}, {tap}: Put a 2/2 green and blue Drake creature token with flying onto the battlefield." - Ability abilityToGain = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new LeafdrakeRoostDragonToken()), new ManaCostsImpl("{G}{U}")); + Ability abilityToGain = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new LeafdrakeRoostDrakeToken()), new ManaCostsImpl("{G}{U}")); abilityToGain.addCost(new TapSourceCost()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(abilityToGain, AttachmentType.AURA, Duration.WhileOnBattlefield, "Enchanted land has \"{G}{U}, {t}: Put a 2/2 green and blue Drake creature token with flying onto the battlefield.\""))); @@ -87,14 +87,14 @@ public class LeafdrakeRoost extends CardImpl { } } -class LeafdrakeRoostDragonToken extends Token { +class LeafdrakeRoostDrakeToken extends Token { - public LeafdrakeRoostDragonToken() { - super("Dragon", "2/2 green and blue Drake creature token with flying"); + public LeafdrakeRoostDrakeToken() { + super("Drake", "2/2 green and blue Drake creature token with flying"); cardType.add(CardType.CREATURE); color.setGreen(true); color.setBlue(true); - subtype.add("Dragon"); + subtype.add("Drake"); power = new MageInt(2); toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/commander2013/Mirari.java b/Mage.Sets/src/mage/sets/commander2013/Mirari.java index a0ed6f66ee0..a2129f2259d 100644 --- a/Mage.Sets/src/mage/sets/commander2013/Mirari.java +++ b/Mage.Sets/src/mage/sets/commander2013/Mirari.java @@ -30,6 +30,7 @@ package mage.sets.commander2013; import java.util.UUID; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.abilities.effects.common.DoIfCostPaid; import mage.cards.CardImpl; @@ -44,6 +45,7 @@ import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.TargetSpell; +import mage.target.targetpointer.FixedTarget; /** * @@ -71,7 +73,6 @@ public class Mirari extends CardImpl { } } - class MirariTriggeredAbility extends TriggeredAbilityImpl { private static final FilterSpell filter = new FilterSpell(); @@ -106,8 +107,9 @@ class MirariTriggeredAbility extends TriggeredAbilityImpl { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (isControlledInstantOrSorcery(spell)) { - this.getTargets().get(0).clearChosen(); - this.getTargets().get(0).add(spell.getId(), game); + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(spell.getId())); + } return true; } } @@ -115,9 +117,9 @@ class MirariTriggeredAbility extends TriggeredAbilityImpl { } private boolean isControlledInstantOrSorcery(Spell spell) { - return spell != null && - (spell.getControllerId().equals(this.getControllerId())) && - (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY)); + return spell != null + && (spell.getControllerId().equals(this.getControllerId())) + && (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY)); } @Override diff --git a/Mage.Sets/src/mage/sets/commander2013/NayaSoulbeast.java b/Mage.Sets/src/mage/sets/commander2013/NayaSoulbeast.java index a858e59187f..64a2febb12e 100644 --- a/Mage.Sets/src/mage/sets/commander2013/NayaSoulbeast.java +++ b/Mage.Sets/src/mage/sets/commander2013/NayaSoulbeast.java @@ -66,8 +66,9 @@ public class NayaSoulbeast extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); - // When you cast Naya Soulbeast, each player reveals the top card of his or her library. Naya Soulbeast enters the battlefield with X +1/+1 counters on it, where X is the total converted mana cost of all cards revealed this way. + // When you cast Naya Soulbeast, each player reveals the top card of his or her library. Ability ability = new CastSourceTriggeredAbility(new NayaSoulbeastCastEffect(), false); + // Naya Soulbeast enters the battlefield with X +1/+1 counters on it, where X is the total converted mana cost of all cards revealed this way. ability.addEffect(new NayaSoulbeastReplacementEffect()); this.addAbility(ability); } @@ -104,7 +105,7 @@ class NayaSoulbeastCastEffect extends OneShotEffect { MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { int cmc = 0; - for (UUID playerId :controller.getInRange()) { + for (UUID playerId : controller.getInRange()) { Player player = game.getPlayer(playerId); if (player != null) { if (player.getLibrary().size() > 0) { @@ -130,19 +131,19 @@ class NayaSoulbeastReplacementEffect extends ReplacementEffectImpl { public static final String SOURCE_CAST_SPELL_ABILITY = "sourceCastSpellAbility"; public NayaSoulbeastReplacementEffect() { - super(Duration.OneUse, Outcome.BoostCreature, true); + super(Duration.OneUse, Outcome.BoostCreature); staticText = "{this} enters the battlefield with X +1/+1 counters on it, where X is the total converted mana cost of all cards revealed this way"; } public NayaSoulbeastReplacementEffect(final NayaSoulbeastReplacementEffect effect) { super(effect); } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { return event.getTargetId().equals(source.getSourceId()); @@ -152,7 +153,7 @@ class NayaSoulbeastReplacementEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Object object = this.getValue("NayaSoulbeastCounters"); if (object instanceof Integer) { - int amount = ((Integer)object); + int amount = ((Integer) object); new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount)).apply(game, source); } return false; diff --git a/Mage.Sets/src/mage/sets/commander2013/OloroAgelessAscetic.java b/Mage.Sets/src/mage/sets/commander2013/OloroAgelessAscetic.java index 569209b09f5..766fb5bd628 100644 --- a/Mage.Sets/src/mage/sets/commander2013/OloroAgelessAscetic.java +++ b/Mage.Sets/src/mage/sets/commander2013/OloroAgelessAscetic.java @@ -29,23 +29,20 @@ package mage.sets.commander2013; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.GainLifeControllerTriggeredAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.StaticValue; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.game.Game; /** * @@ -65,11 +62,17 @@ public class OloroAgelessAscetic extends CardImpl { // At the beginning of your upkeep, you gain 2 life. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(2), TargetController.YOU, false)); + // Whenever you gain life, you may pay {1}. If you do, draw a card and each opponent loses 1 life. - this.addAbility(new GainLifeControllerTriggeredAbility(new DoIfCostPaid(new OloroAgelessAsceticEffect(), new GenericManaCost(1)),false)); + DoIfCostPaid effect = new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new GenericManaCost(1)); + Effect effectToAdd = new LoseLifeOpponentsEffect(1); + effectToAdd.setText("and each opponent loses 1 life"); + effect.addEffect(effectToAdd); + this.addAbility(new GainLifeControllerTriggeredAbility(effect, false)); + // At the beginning of your upkeep, if Oloro, Ageless Ascetic is in the command zone, you gain 2 life. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.COMMAND, - new GainLifeEffect(new StaticValue(2), "if Oloro, Ageless Ascetic is in the command zone, you gain 2 life"),TargetController.YOU, false)); + new GainLifeEffect(new StaticValue(2), "if {this} is in the command zone, you gain 2 life"), TargetController.YOU, false)); } public OloroAgelessAscetic(final OloroAgelessAscetic card) { @@ -81,27 +84,3 @@ public class OloroAgelessAscetic extends CardImpl { return new OloroAgelessAscetic(this); } } - -class OloroAgelessAsceticEffect extends OneShotEffect { - - public OloroAgelessAsceticEffect() { - super(Outcome.Benefit); - this.staticText = "draw a card and each opponent loses 1 life"; - } - - public OloroAgelessAsceticEffect(final OloroAgelessAsceticEffect effect) { - super(effect); - } - - @Override - public OloroAgelessAsceticEffect copy() { - return new OloroAgelessAsceticEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - new DrawCardSourceControllerEffect(1).apply(game, source); - new DamagePlayersEffect(1, TargetController.OPPONENT).apply(game, source); - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/commander2013/OpalPalace.java b/Mage.Sets/src/mage/sets/commander2013/OpalPalace.java index 4601e1a29d5..53bb7eb50b8 100644 --- a/Mage.Sets/src/mage/sets/commander2013/OpalPalace.java +++ b/Mage.Sets/src/mage/sets/commander2013/OpalPalace.java @@ -47,6 +47,7 @@ import mage.constants.WatcherScope; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -74,7 +75,7 @@ public class OpalPalace extends CardImpl { ability = new SimpleStaticAbility(Zone.ALL, new OpalPalaceEntersBattlefieldEffect()); ability.setRuleVisible(false); this.addAbility(ability); - + } public OpalPalace(final OpalPalace card) { @@ -91,10 +92,10 @@ class OpalPalaceWatcher extends Watcher { public List commanderId = new ArrayList<>(); private final String originalId; - + public OpalPalaceWatcher(String originalId) { super("ManaPaidFromOpalPalaceWatcher", WatcherScope.CARD); - this.originalId = originalId; + this.originalId = originalId; } public OpalPalaceWatcher(final OpalPalaceWatcher watcher) { @@ -116,16 +117,16 @@ class OpalPalaceWatcher extends Watcher { if (spell != null) { Card card = spell.getCard(); if (card != null) { - for (UUID playerId :game.getPlayerList()) { + for (UUID playerId : game.getPlayerList()) { Player player = game.getPlayer(playerId); if (player != null) { if (player.getCommanderId() != null && player.getCommanderId().equals(card.getId())) { commanderId.add(card.getId()); break; } - } + } } - } + } } } } @@ -153,19 +154,19 @@ class OpalPalaceEntersBattlefieldEffect extends ReplacementEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { OpalPalaceWatcher watcher = (OpalPalaceWatcher) game.getState().getWatchers().get("ManaPaidFromOpalPalaceWatcher", source.getSourceId()); - return watcher != null && - watcher.commanderId.contains(event.getTargetId()); + return watcher != null + && watcher.commanderId.contains(event.getTargetId()); } @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(event.getTargetId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null) { - Integer castCount = (Integer)game.getState().getValue(permanent.getId() + "_castCount"); + Integer castCount = (Integer) game.getState().getValue(permanent.getId() + "_castCount"); if (castCount != null && castCount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(castCount), game); } diff --git a/Mage.Sets/src/mage/sets/commander2013/PrimalVigor.java b/Mage.Sets/src/mage/sets/commander2013/PrimalVigor.java index ee069e6b007..468b0b9fae7 100644 --- a/Mage.Sets/src/mage/sets/commander2013/PrimalVigor.java +++ b/Mage.Sets/src/mage/sets/commander2013/PrimalVigor.java @@ -51,7 +51,6 @@ public class PrimalVigor extends CardImpl { super(ownerId, 162, "Primal Vigor", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{G}"); this.expansionSetCode = "C13"; - // If one or more tokens would be put onto the battlefield, twice that many of those tokens are put onto the battlefield instead. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PrimalVigorTokenEffect())); // If one or more +1/+1 counters would be placed on a creature, twice that many +1/+1 counters are placed on that creature instead. @@ -121,7 +120,7 @@ class PrimalVigorCounterEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - event.setAmount(event.getAmount() *2); + event.setAmount(event.getAmount() * 2); return false; } @@ -132,8 +131,11 @@ class PrimalVigorCounterEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - Permanent target = game.getPermanent(event.getTargetId()); - if (target != null && target.getCardType().contains(CardType.CREATURE) + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent == null) { + permanent = game.getPermanentEntering(event.getTargetId()); + } + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && event.getData() != null && event.getData().equals("+1/+1")) { return true; } diff --git a/Mage.Sets/src/mage/sets/commander2013/RubiniaSoulsinger.java b/Mage.Sets/src/mage/sets/commander2013/RubiniaSoulsinger.java index 0580c020d38..26b8c62ebfa 100644 --- a/Mage.Sets/src/mage/sets/commander2013/RubiniaSoulsinger.java +++ b/Mage.Sets/src/mage/sets/commander2013/RubiniaSoulsinger.java @@ -92,9 +92,9 @@ class RubiniaSoulsingerCondition implements Condition { controllerId = source.getControllerId(); } Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); - if (permanent != null){ - if (permanent.isTapped()){ - return controllerId == source.getControllerId(); + if (permanent != null) { + if (permanent.isTapped()) { + return controllerId.equals(source.getControllerId()); } } return false; diff --git a/Mage.Sets/src/mage/sets/commander2013/SpringjackPasture.java b/Mage.Sets/src/mage/sets/commander2013/SpringjackPasture.java index 8fafdc13ef2..d4873e2dd16 100644 --- a/Mage.Sets/src/mage/sets/commander2013/SpringjackPasture.java +++ b/Mage.Sets/src/mage/sets/commander2013/SpringjackPasture.java @@ -50,7 +50,7 @@ import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoatToken; import mage.players.Player; /** @@ -136,17 +136,3 @@ class SpringjackPastureEffect extends OneShotEffect { return new SpringjackPastureEffect(this); } } - -class GoatToken extends Token { - - public GoatToken() { - super("Goat", "0/1 white Goat creature token"); - setOriginalExpansionSetCode("EVE"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Goat"); - power = new MageInt(0); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/commander2013/Stonecloaker.java b/Mage.Sets/src/mage/sets/commander2013/Stonecloaker.java index 5cc2d1a4c95..92b4f50836f 100644 --- a/Mage.Sets/src/mage/sets/commander2013/Stonecloaker.java +++ b/Mage.Sets/src/mage/sets/commander2013/Stonecloaker.java @@ -32,14 +32,14 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.ExileTargetEffect; -import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect; import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.common.TargetCardInGraveyard; -import mage.target.common.TargetControlledCreaturePermanent; /** * @@ -60,8 +60,8 @@ public class Stonecloaker extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // When Stonecloaker enters the battlefield, return a creature you control to its owner's hand. - Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), false); - ability.addTarget(new TargetControlledCreaturePermanent()); + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandChosenControlledPermanentEffect(new FilterControlledCreaturePermanent()), true); + this.addAbility(ability); // When Stonecloaker enters the battlefield, exile target card from a graveyard. ability = new EntersBattlefieldTriggeredAbility(new ExileTargetEffect(), false); diff --git a/Mage.Sets/src/mage/sets/commander2013/TemptWithDiscovery.java b/Mage.Sets/src/mage/sets/commander2013/TemptWithDiscovery.java index e684acd3028..608f28407cd 100644 --- a/Mage.Sets/src/mage/sets/commander2013/TemptWithDiscovery.java +++ b/Mage.Sets/src/mage/sets/commander2013/TemptWithDiscovery.java @@ -27,6 +27,8 @@ */ package mage.sets.commander2013; +import java.util.LinkedHashSet; +import java.util.Set; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; @@ -51,7 +53,6 @@ public class TemptWithDiscovery extends CardImpl { super(ownerId, 174, "Tempt with Discovery", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{G}"); this.expansionSetCode = "C13"; - // Tempting offer - Search your library for a land card and put it onto the battlefield. // Each opponent may search his or her library for a land card and put it onto the battlefield. // For each opponent who searches a library this way, search your library for a land card and put it onto the battlefield. @@ -89,12 +90,14 @@ class TemptWithDiscoveryEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { + Set playersShuffle = new LinkedHashSet<>(); + playersShuffle.add(controller.getId()); TargetCardInLibrary target = new TargetCardInLibrary(new FilterLandCard()); if (controller.searchLibrary(target, game)) { - for (UUID cardId: target.getTargets()) { + for (UUID cardId : target.getTargets()) { Card card = game.getCard(cardId); if (card != null) { - card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), controller.getId()); + controller.moveCards(card, null, Zone.BATTLEFIELD, source, game); } } } @@ -105,11 +108,12 @@ class TemptWithDiscoveryEffect extends OneShotEffect { if (opponent.chooseUse(outcome, "Search your library for a land card and put it onto the battlefield?", source, game)) { target.clearChosen(); opponentsUsedSearch++; + playersShuffle.add(playerId); if (opponent.searchLibrary(target, game)) { - for (UUID cardId: target.getTargets()) { + for (UUID cardId : target.getTargets()) { Card card = game.getCard(cardId); if (card != null) { - card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), opponent.getId()); + opponent.moveCards(card, null, Zone.BATTLEFIELD, source, game); } } } @@ -119,17 +123,23 @@ class TemptWithDiscoveryEffect extends OneShotEffect { if (opponentsUsedSearch > 0) { target = new TargetCardInLibrary(0, opponentsUsedSearch, new FilterLandCard()); if (controller.searchLibrary(target, game)) { - for (UUID cardId: target.getTargets()) { + for (UUID cardId : target.getTargets()) { Card card = game.getCard(cardId); if (card != null) { - card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), controller.getId()); + controller.moveCards(card, null, Zone.BATTLEFIELD, source, game); } } } } + for (UUID playerId : playersShuffle) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.shuffleLibrary(game); + } + } return true; } - + return false; } } diff --git a/Mage.Sets/src/mage/sets/commander2013/TemptWithReflections.java b/Mage.Sets/src/mage/sets/commander2013/TemptWithReflections.java index 53cecb0c1c1..a32f7140ef4 100644 --- a/Mage.Sets/src/mage/sets/commander2013/TemptWithReflections.java +++ b/Mage.Sets/src/mage/sets/commander2013/TemptWithReflections.java @@ -40,12 +40,9 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; -import mage.game.permanent.token.Token; import mage.players.Player; import mage.players.PlayerList; import mage.target.common.TargetControlledCreaturePermanent; -import mage.util.CardUtil; /** * @@ -57,7 +54,6 @@ public class TemptWithReflections extends CardImpl { super(ownerId, 60, "Tempt with Reflections", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}"); this.expansionSetCode = "C13"; - // Tempting offer - Choose target creature you control. Put a token onto the battlefield that's a copy of that creature. Each opponent may put a token onto the battlefield that's a copy of that creature. For each opponent who does, put a token onto the battlefield that's a copy of that creature. this.getSpellAbility().addEffect(new TemptWithReflectionsEffect()); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); @@ -115,16 +111,16 @@ class TemptWithReflectionsEffect extends OneShotEffect { player = playerList.getNext(game); } while (!player.getId().equals(game.getActivePlayerId())); - for (UUID playerId: playersSaidYes) { + for (UUID playerId : playersSaidYes) { effect = new PutTokenOntoBattlefieldCopyTargetEffect(playerId); effect.setTargetPointer(getTargetPointer()); - effect.apply(game, source); + effect.apply(game, source); } if (playersSaidYes.size() > 0) { effect = new PutTokenOntoBattlefieldCopyTargetEffect(); effect.setTargetPointer(getTargetPointer()); - effect.apply(game, source); + effect.apply(game, source); } return true; } diff --git a/Mage.Sets/src/mage/sets/commander2013/TerraRavager.java b/Mage.Sets/src/mage/sets/commander2013/TerraRavager.java index 79aa1e48467..0dda70fa4d0 100644 --- a/Mage.Sets/src/mage/sets/commander2013/TerraRavager.java +++ b/Mage.Sets/src/mage/sets/commander2013/TerraRavager.java @@ -106,6 +106,6 @@ class TerraRavagerLandCount implements DynamicValue { @Override public String getMessage() { - return "land defending player controls"; + return "the number of lands defending player controls"; } } diff --git a/Mage.Sets/src/mage/sets/commander2013/TrueNameNemesis.java b/Mage.Sets/src/mage/sets/commander2013/TrueNameNemesis.java index 18c7db6b708..6c3967a3e6d 100644 --- a/Mage.Sets/src/mage/sets/commander2013/TrueNameNemesis.java +++ b/Mage.Sets/src/mage/sets/commander2013/TrueNameNemesis.java @@ -30,9 +30,8 @@ package mage.sets.commander2013; import java.util.UUID; import mage.MageInt; import mage.MageObject; -import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChoosePlayerEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.Card; import mage.cards.CardImpl; @@ -44,18 +43,19 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.game.stack.StackObject; -import mage.players.Player; -import mage.target.TargetPlayer; /** - * Protection from a player is a new variant of the protection ability. It means the following: - * -- True-Name Nemesis can’t be the target of spells or abilities controlled by the chosen player. - * -- True-Name Nemesis can’t be enchanted by Auras or equipped by Equipment controlled - * by the chosen player. (The same is true for Fortifications controlled by the chosen player, - * if True-Name Nemesis becomes a land.) - * -- True-Name Nemesis can’t be blocked by creatures controlled by the chosen player. - * -- All damage that would be dealt to True-Name Nemesis by sources controlled by the chosen player - * is prevented. (The same is true for sources owned by the chosen player that don’t have controllers.) + * Protection from a player is a new variant of the protection ability. It means + * the following: -- True-Name Nemesis can’t be the target of spells or + * abilities controlled by the chosen player. -- True-Name Nemesis can’t be + * enchanted by Auras or equipped by Equipment controlled by the chosen player. + * (The same is true for Fortifications controlled by the chosen player, if + * True-Name Nemesis becomes a land.) -- True-Name Nemesis can’t be blocked by + * creatures controlled by the chosen player. -- All damage that would be dealt + * to True-Name Nemesis by sources controlled by the chosen player is prevented. + * (The same is true for sources owned by the chosen player that don’t have + * controllers.) + * * @author LevelX2 */ public class TrueNameNemesis extends CardImpl { @@ -70,7 +70,7 @@ public class TrueNameNemesis extends CardImpl { this.toughness = new MageInt(1); // As True-Name Nemesis enters the battlefield, choose a player. - this.addAbility(new AsEntersBattlefieldAbility(new TrueNameNemesisChoosePlayerEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChoosePlayerEffect(Outcome.Protect))); // True-Name Nemesis has protection from the chosen player. this.addAbility(new ProtectionFromPlayerAbility()); } @@ -85,42 +85,6 @@ public class TrueNameNemesis extends CardImpl { } } -class TrueNameNemesisChoosePlayerEffect extends OneShotEffect { - - public TrueNameNemesisChoosePlayerEffect() { - super(Outcome.Detriment); - this.staticText = "choose a player"; - } - - public TrueNameNemesisChoosePlayerEffect(final TrueNameNemesisChoosePlayerEffect effect) { - super(effect); - } - - @Override - public TrueNameNemesisChoosePlayerEffect copy() { - return new TrueNameNemesisChoosePlayerEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - TargetPlayer target = new TargetPlayer(1,1,true); - if (player.choose(this.outcome, target, source.getSourceId(), game)) { - Player chosenPlayer = game.getPlayer(target.getFirstTarget()); - if (chosenPlayer != null) { - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + chosenPlayer.getLogName()); - game.getState().setValue(permanent.getId() + "_player", target.getFirstTarget()); - permanent.addInfo("chosen player", "Chosen player: " + chosenPlayer.getLogName() + "", game); - return true; - } - } - } - return false; - } -} - class ProtectionFromPlayerAbility extends ProtectionAbility { public ProtectionFromPlayerAbility() { diff --git a/Mage.Sets/src/mage/sets/commander2014/BitterFeud.java b/Mage.Sets/src/mage/sets/commander2014/BitterFeud.java index 7ba41f23715..0ce63beead1 100644 --- a/Mage.Sets/src/mage/sets/commander2014/BitterFeud.java +++ b/Mage.Sets/src/mage/sets/commander2014/BitterFeud.java @@ -91,7 +91,7 @@ class BitterFeudEntersBattlefieldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (controller != null && permanent != null) { TargetPlayer target = new TargetPlayer(2, 2, true); controller.chooseTarget(outcome, target, source, game); diff --git a/Mage.Sets/src/mage/sets/commander2014/CoralAtoll.java b/Mage.Sets/src/mage/sets/commander2014/CoralAtoll.java index d2a186eb83c..3785405c2c3 100644 --- a/Mage.Sets/src/mage/sets/commander2014/CoralAtoll.java +++ b/Mage.Sets/src/mage/sets/commander2014/CoralAtoll.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.Mana; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.mana.SimpleManaAbility; @@ -66,7 +66,7 @@ public class CoralAtoll extends CardImpl { // Coral Atoll enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); // When Coral Atoll enters the battlefield, sacrifice it unless you return an untapped Island you control to its owner's hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))))); // {tap}: Add {1}{U} to your mana pool. this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 0, 1, 0, 0, 1,0 ), new TapSourceCost())); diff --git a/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java b/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java index 48b846573c7..0f07b4a61ab 100644 --- a/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java +++ b/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java @@ -33,13 +33,12 @@ import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; @@ -47,7 +46,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.common.FilterArtifactCard; import mage.filter.common.FilterControlledArtifactPermanent; @@ -75,7 +73,7 @@ public class DarettiScrapSavant extends CardImpl { this.expansionSetCode = "C14"; this.subtype.add("Daretti"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +2: Discard up to two cards, then draw that many cards. this.addAbility(new LoyaltyAbility(new DarettiDiscardDrawEffect(), 2)); @@ -166,7 +164,7 @@ class DarettiSacrificeEffect extends OneShotEffect { if (artifact != null && artifact.sacrifice(source.getSourceId(), game)) { Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null) { - return controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + return controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } } @@ -179,7 +177,6 @@ class DarettiSacrificeEffect extends OneShotEffect { class DarettiScrapSavantEmblem extends Emblem { // You get an emblem with "Whenever an artifact is put into your graveyard from the battlefield, return that card to the battlefield at the beginning of the next end step." - public DarettiScrapSavantEmblem() { this.setName("Emblem - Daretti"); this.getAbilities().add(new DarettiScrapSavantTriggeredAbility()); diff --git a/Mage.Sets/src/mage/sets/commander2014/DomineeringWill.java b/Mage.Sets/src/mage/sets/commander2014/DomineeringWill.java index df27ae5176b..31497d4ee8a 100644 --- a/Mage.Sets/src/mage/sets/commander2014/DomineeringWill.java +++ b/Mage.Sets/src/mage/sets/commander2014/DomineeringWill.java @@ -30,25 +30,25 @@ package mage.sets.commander2014; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffect; -import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.RequirementEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.effects.common.combat.BlocksIfAbleTargetEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.SubLayer; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.permanent.AttackingPredicate; import mage.game.Game; -import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPlayer; import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.SecondTargetPointer; /** * @@ -66,7 +66,6 @@ public class DomineeringWill extends CardImpl { super(ownerId, 13, "Domineering Will", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{U}"); this.expansionSetCode = "C14"; - // Target player gains control of up to three target nonattacking creatures until end of turn. Untap those creatures. They block this turn if able. this.getSpellAbility().addEffect(new DomineeringWillEffect()); this.getSpellAbility().addTarget(new TargetPlayer()); @@ -102,14 +101,20 @@ class DomineeringWillEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (targetPlayer != null) { - ContinuousEffect effect = new DomineeringWillControlEffect(); + ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, targetPlayer.getId()); + effect.setTargetPointer(new SecondTargetPointer()); + effect.setText("Target player gains control of up to three target nonattacking creatures until end of turn"); game.addEffect(effect, source); - Effect effect2 = new DomineeringWillUntapTargetEffect(); + + Effect effect2 = new UntapTargetEffect(); + effect2.setTargetPointer(new SecondTargetPointer()); effect2.setText("Untap those creatures"); effect2.apply(game, source); - RequirementEffect effect3 = new DomineeringWillBlocksIfAbleTargetEffect(Duration.EndOfTurn); + + RequirementEffect effect3 = new BlocksIfAbleTargetEffect(Duration.EndOfTurn); + effect3.setTargetPointer(new SecondTargetPointer()); effect3.setText("They block this turn if able"); game.addEffect(effect3, source); return true; @@ -117,109 +122,3 @@ class DomineeringWillEffect extends OneShotEffect { return false; } } - -class DomineeringWillControlEffect extends ContinuousEffectImpl { - - public DomineeringWillControlEffect() { - super(Duration.EndOfTurn, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); - } - - public DomineeringWillControlEffect(final DomineeringWillControlEffect effect) { - super(effect); - } - - @Override - public DomineeringWillControlEffect copy() { - return new DomineeringWillControlEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); - if (targetPlayer != null) { - boolean targetStillExists = false; - for (UUID permanentId : source.getTargets().get(1).getTargets()) { - Permanent permanent = game.getPermanent(permanentId); - if (permanent != null) { - targetStillExists = true; - if (targetPlayer != null) { - permanent.changeControllerId(targetPlayer.getId(), game); - permanent.getAbilities().setControllerId(targetPlayer.getId()); - } else { - permanent.changeControllerId(source.getControllerId(), game); - permanent.getAbilities().setControllerId(source.getControllerId()); - } - } - } - if (!targetStillExists) { - // no valid target exists, effect can be discarded - discard(); - } - return true; - } - return false; - } -} - -class DomineeringWillUntapTargetEffect extends OneShotEffect { - - public DomineeringWillUntapTargetEffect() { - super(Outcome.Untap); - } - - public DomineeringWillUntapTargetEffect(final DomineeringWillUntapTargetEffect effect) { - super(effect); - } - - @Override - public DomineeringWillUntapTargetEffect copy() { - return new DomineeringWillUntapTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - for (UUID target : source.getTargets().get(1).getTargets()) { - Permanent permanent = game.getPermanent(target); - if (permanent != null) { - permanent.untap(game); - } - } - return true; - } -} - -class DomineeringWillBlocksIfAbleTargetEffect extends RequirementEffect { - - public DomineeringWillBlocksIfAbleTargetEffect(Duration duration) { - super(duration); - } - - public DomineeringWillBlocksIfAbleTargetEffect(final DomineeringWillBlocksIfAbleTargetEffect effect) { - super(effect); - } - - @Override - public DomineeringWillBlocksIfAbleTargetEffect copy() { - return new DomineeringWillBlocksIfAbleTargetEffect(this); - } - - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - return source.getTargets().get(1).getTargets().contains(permanent.getId()); - } - - @Override - public boolean mustAttack(Game game) { - return false; - } - - @Override - public boolean mustBlock(Game game) { - return false; - } - - @Override - public boolean mustBlockAny(Game game) { - return true; - } -} diff --git a/Mage.Sets/src/mage/sets/commander2014/DormantVolcano.java b/Mage.Sets/src/mage/sets/commander2014/DormantVolcano.java index 800f515fca7..c4b046863bd 100644 --- a/Mage.Sets/src/mage/sets/commander2014/DormantVolcano.java +++ b/Mage.Sets/src/mage/sets/commander2014/DormantVolcano.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.Mana; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.mana.SimpleManaAbility; @@ -66,7 +66,7 @@ public class DormantVolcano extends CardImpl { this.addAbility(new EntersBattlefieldTappedAbility()); // When Dormant Volcano enters the battlefield, sacrifice it unless you return an untapped Mountain you control to its owner's hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))))); // {tap}: Add {1}{R} to your mana pool. this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(1, 0, 0, 0, 0, 1,0 ), new TapSourceCost())); diff --git a/Mage.Sets/src/mage/sets/commander2014/Everglades.java b/Mage.Sets/src/mage/sets/commander2014/Everglades.java index 7cf1f874132..e9693d66a88 100644 --- a/Mage.Sets/src/mage/sets/commander2014/Everglades.java +++ b/Mage.Sets/src/mage/sets/commander2014/Everglades.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.Mana; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.mana.SimpleManaAbility; @@ -53,7 +53,7 @@ public class Everglades extends CardImpl { private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("an untapped Swamp"); - static{ + static { filter.add(new SubtypePredicate("Swamp")); filter.add(Predicates.not(new TappedPredicate())); } @@ -66,10 +66,10 @@ public class Everglades extends CardImpl { this.addAbility(new EntersBattlefieldTappedAbility()); // When Everglades enters the battlefield, sacrifice it unless you return an untapped Swamp you control to its owner's hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(1, 1, filter, true))))); // {tap}: Add {1}{B} to your mana pool. - this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 0, 0, 0, 1, 1,0 ), new TapSourceCost())); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 0, 0, 0, 1, 1, 0), new TapSourceCost())); } diff --git a/Mage.Sets/src/mage/sets/commander2014/FeldonOfTheThirdPath.java b/Mage.Sets/src/mage/sets/commander2014/FeldonOfTheThirdPath.java index ad667be3a2f..77840101add 100644 --- a/Mage.Sets/src/mage/sets/commander2014/FeldonOfTheThirdPath.java +++ b/Mage.Sets/src/mage/sets/commander2014/FeldonOfTheThirdPath.java @@ -36,8 +36,8 @@ import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbil import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.effects.common.SacrificeTargetEffect; -import mage.abilities.keyword.HasteAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; @@ -46,10 +46,9 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; -import mage.game.permanent.token.EmptyToken; +import mage.game.permanent.Permanent; import mage.target.common.TargetCardInYourGraveyard; import mage.target.targetpointer.FixedTarget; -import mage.util.CardUtil; /** * @@ -104,24 +103,18 @@ class FeldonOfTheThirdPathEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null) { - EmptyToken token = new EmptyToken(); - // TODO: This fails if a card will be copied, that uses adjustTargets() method. - CardUtil.copyTo(token).from(card); - - if (!token.getCardType().contains(CardType.ARTIFACT)) { - token.getCardType().add(CardType.ARTIFACT); + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), CardType.ARTIFACT, true); + effect.setTargetPointer(new FixedTarget(card.getId(), game.getState().getZoneChangeCounter(card.getId()))); + effect.apply(game, source); + for (Permanent addedToken : effect.getAddedPermanent()) { + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice the token at the beginning of the next end step", source.getControllerId()); + sacrificeEffect.setTargetPointer(new FixedTarget(addedToken, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); } - token.addAbility(HasteAbility.getInstance()); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - - SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect(); - sacrificeEffect.setText("Sacrifice the token at the beginning of the next end step"); - sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); return true; } diff --git a/Mage.Sets/src/mage/sets/commander2014/FreyaliseLlanowarsFury.java b/Mage.Sets/src/mage/sets/commander2014/FreyaliseLlanowarsFury.java index adf5daa6ca5..e8d82a0618a 100644 --- a/Mage.Sets/src/mage/sets/commander2014/FreyaliseLlanowarsFury.java +++ b/Mage.Sets/src/mage/sets/commander2014/FreyaliseLlanowarsFury.java @@ -32,19 +32,17 @@ import mage.MageInt; import mage.ObjectColor; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.GreenManaAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.counters.CounterType; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterArtifactOrEnchantmentPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.permanent.token.Token; import mage.target.TargetPermanent; @@ -56,6 +54,7 @@ import mage.target.TargetPermanent; public class FreyaliseLlanowarsFury extends CardImpl { private static final FilterControlledCreaturePermanent filterGreen = new FilterControlledCreaturePermanent("green creature you control"); + static { filterGreen.add(new ColorPredicate(ObjectColor.GREEN)); } @@ -65,8 +64,8 @@ public class FreyaliseLlanowarsFury extends CardImpl { this.expansionSetCode = "C14"; this.subtype.add("Freyalise"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); - + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + // +2: Put a 1/1 green Elf Druid creature token onto the battlefield with "{T}: Add {G} to your mana pool." this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new FreyaliseLlanowarsFuryToken()), 2)); // -2: Destroy target artifact or enchantment. @@ -106,4 +105,4 @@ class FreyaliseLlanowarsFuryToken extends Token { // {T}: Add {G} to your mana pool. this.addAbility(new GreenManaAbility()); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/commander2014/GiftOfEstates.java b/Mage.Sets/src/mage/sets/commander2014/GiftOfEstates.java index c87bb2c1f4f..e4c6731a64d 100644 --- a/Mage.Sets/src/mage/sets/commander2014/GiftOfEstates.java +++ b/Mage.Sets/src/mage/sets/commander2014/GiftOfEstates.java @@ -28,7 +28,7 @@ package mage.sets.commander2014; import java.util.UUID; -import mage.abilities.condition.common.OpponentControllsMoreCondition; +import mage.abilities.condition.common.OpponentControlsMoreCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; @@ -60,7 +60,7 @@ public class GiftOfEstates extends CardImpl { // If an opponent controls more lands than you, search your library for up to three Plains cards, reveal them, and put them into your hand. Then shuffle your library. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 3, filter), true), - new OpponentControllsMoreCondition(new FilterLandPermanent("lands")))); + new OpponentControlsMoreCondition(new FilterLandPermanent("lands")))); } public GiftOfEstates(final GiftOfEstates card) { diff --git a/Mage.Sets/src/mage/sets/commander2014/HallowedSpiritkeeper.java b/Mage.Sets/src/mage/sets/commander2014/HallowedSpiritkeeper.java index b052260ed7e..e9fd02c7262 100644 --- a/Mage.Sets/src/mage/sets/commander2014/HallowedSpiritkeeper.java +++ b/Mage.Sets/src/mage/sets/commander2014/HallowedSpiritkeeper.java @@ -39,7 +39,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.filter.common.FilterCreatureCard; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SpiritWhiteToken; /** * @@ -59,7 +59,7 @@ public class HallowedSpiritkeeper extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // When Hallowed Spiritkeeper dies, put X 1/1 white Spirit creature tokens with flying onto the battlefield, where X is the number of creature cards in your graveyard. - Effect effect = new CreateTokenEffect(new HallowedSpiritkeeperSpiritToken(), new CardsInControllerGraveyardCount(new FilterCreatureCard("creature cards"))); + Effect effect = new CreateTokenEffect(new SpiritWhiteToken(), new CardsInControllerGraveyardCount(new FilterCreatureCard("creature cards"))); effect.setText("put X 1/1 white Spirit creature tokens with flying onto the battlefield, where X is the number of creature cards in your graveyard"); this.addAbility(new DiesTriggeredAbility(effect, false)); @@ -74,19 +74,3 @@ public class HallowedSpiritkeeper extends CardImpl { return new HallowedSpiritkeeper(this); } } - -class HallowedSpiritkeeperSpiritToken extends Token { - - public HallowedSpiritkeeperSpiritToken() { - super("Spirit", "1/1 white Spirit creature token with flying"); - setOriginalExpansionSetCode("C14"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Spirit"); - power = new MageInt(1); - toughness = new MageInt(1); - - addAbility(FlyingAbility.getInstance()); - - } -} diff --git a/Mage.Sets/src/mage/sets/commander2014/InfernalOffering.java b/Mage.Sets/src/mage/sets/commander2014/InfernalOffering.java index f0bb1741adc..07816fa09d4 100644 --- a/Mage.Sets/src/mage/sets/commander2014/InfernalOffering.java +++ b/Mage.Sets/src/mage/sets/commander2014/InfernalOffering.java @@ -61,10 +61,9 @@ public class InfernalOffering extends CardImpl { super(ownerId, 24, "Infernal Offering", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}"); this.expansionSetCode = "C14"; - // Choose an opponent. You and that player each sacrifice a creature. Each player who sacrificed a creature this way draws two cards. this.getSpellAbility().addEffect(new InfernalOfferingSacrificeEffect()); - + // Choose an opponent. Return a creature card from your graveyard to the battlefield, then that player returns a creature card from his or her graveyard to the battlefield. this.getSpellAbility().addEffect(new InfernalOfferingReturnEffect()); } @@ -80,21 +79,21 @@ public class InfernalOffering extends CardImpl { } class InfernalOfferingSacrificeEffect extends OneShotEffect { - + InfernalOfferingSacrificeEffect() { super(Outcome.Sacrifice); this.staticText = "Choose an opponent. You and that player each sacrifice a creature. Each player who sacrificed a creature this way draws two cards"; } - + InfernalOfferingSacrificeEffect(final InfernalOfferingSacrificeEffect effect) { super(effect); } - + @Override public InfernalOfferingSacrificeEffect copy() { return new InfernalOfferingSacrificeEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); @@ -105,8 +104,8 @@ class InfernalOfferingSacrificeEffect extends OneShotEffect { if (opponent != null) { //Choose creatures to sacrifice Map toSacrifice = new HashMap<>(2); - for (UUID playerId : player.getInRange()) { - if (playerId == player.getId() || playerId == opponent.getId()) { + for (UUID playerId : game.getState().getPlayersInRange(player.getId(), game)) { + if (playerId.equals(player.getId()) || playerId.equals(opponent.getId())) { target = new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent(), true); if (target.choose(Outcome.Sacrifice, playerId, source.getControllerId(), game)) { toSacrifice.put(playerId, target.getFirstTarget()); @@ -138,33 +137,33 @@ class InfernalOfferingSacrificeEffect extends OneShotEffect { } class InfernalOfferingReturnEffect extends OneShotEffect { - + InfernalOfferingReturnEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "Choose an opponent. Return a creature card from your graveyard to the battlefield, then that player returns a creature card from his or her graveyard to the battlefield"; } - + InfernalOfferingReturnEffect(final InfernalOfferingReturnEffect effect) { super(effect); } - + @Override public InfernalOfferingReturnEffect copy() { return new InfernalOfferingReturnEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { Target target = new TargetOpponent(true); target.choose(Outcome.PutCreatureInPlay, source.getControllerId(), source.getSourceId(), game); Player opponent = game.getPlayer(target.getFirstTarget()); target = new TargetCardInYourGraveyard(new FilterCreatureCard("creature card in your graveyard")); - if (target.choose(Outcome.PutCreatureInPlay, player.getId(), source.getSourceId(), game)) { - Card card = player.getGraveyard().get(target.getFirstTarget(), game); + if (target.choose(Outcome.PutCreatureInPlay, controller.getId(), source.getSourceId(), game)) { + Card card = controller.getGraveyard().get(target.getFirstTarget(), game); if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } if (opponent != null) { @@ -172,7 +171,7 @@ class InfernalOfferingReturnEffect extends OneShotEffect { if (target.choose(Outcome.PutCreatureInPlay, opponent.getId(), source.getSourceId(), game)) { Card card = opponent.getGraveyard().get(target.getFirstTarget(), game); if (card != null) { - opponent.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + opponent.moveCards(card, Zone.BATTLEFIELD, source, game); } } } diff --git a/Mage.Sets/src/mage/sets/commander2014/JungleBasin.java b/Mage.Sets/src/mage/sets/commander2014/JungleBasin.java index c90e7f0e107..dfa53c525a9 100644 --- a/Mage.Sets/src/mage/sets/commander2014/JungleBasin.java +++ b/Mage.Sets/src/mage/sets/commander2014/JungleBasin.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.Mana; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.mana.SimpleManaAbility; @@ -66,7 +66,7 @@ public class JungleBasin extends CardImpl { this.addAbility(new EntersBattlefieldTappedAbility()); // When Jungle Basin enters the battlefield, sacrifice it unless you return an untapped Forest you control to its owner's hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))))); // {tap}: Add {1}{G} to your mana pool. this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 1, 0, 0, 0, 1,0 ), new TapSourceCost())); diff --git a/Mage.Sets/src/mage/sets/commander2014/Karoo.java b/Mage.Sets/src/mage/sets/commander2014/Karoo.java index eed52e1bc32..095d04b79d6 100644 --- a/Mage.Sets/src/mage/sets/commander2014/Karoo.java +++ b/Mage.Sets/src/mage/sets/commander2014/Karoo.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.Mana; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.mana.SimpleManaAbility; @@ -66,7 +66,7 @@ public class Karoo extends CardImpl { this.addAbility(new EntersBattlefieldTappedAbility()); // When Karoo enters the battlefield, sacrifice it unless you return an untapped Plains you control to its owner's hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))))); // {tap}: Add {1}{W} to your mana pool. this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0, 0, 0, 1, 0, 1,0 ), new TapSourceCost())); diff --git a/Mage.Sets/src/mage/sets/commander2014/LifebloodHydra.java b/Mage.Sets/src/mage/sets/commander2014/LifebloodHydra.java index dbe2f5c4441..9dad251209d 100644 --- a/Mage.Sets/src/mage/sets/commander2014/LifebloodHydra.java +++ b/Mage.Sets/src/mage/sets/commander2014/LifebloodHydra.java @@ -30,11 +30,10 @@ package mage.sets.commander2014; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -61,9 +60,9 @@ public class LifebloodHydra extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); - + // Lifeblood Hydra enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new LifebloodHydraComesIntoPlayEffect(), "with X +1/+1 counters on it")); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // When Lifeblood Hydra dies, you gain life and draw cards equal to its power. this.addAbility(new DiesTriggeredAbility(new LifebloodHydraEffect(), false)); @@ -79,38 +78,6 @@ public class LifebloodHydra extends CardImpl { } } -class LifebloodHydraComesIntoPlayEffect extends OneShotEffect { - - public LifebloodHydraComesIntoPlayEffect() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - public LifebloodHydraComesIntoPlayEffect(final LifebloodHydraComesIntoPlayEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && !permanent.isFaceDown(game)) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public LifebloodHydraComesIntoPlayEffect copy() { - return new LifebloodHydraComesIntoPlayEffect(this); - } - -} class LifebloodHydraEffect extends OneShotEffect { public LifebloodHydraEffect() { @@ -132,7 +99,7 @@ class LifebloodHydraEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Permanent diedPermanent = (Permanent) getValue("diedPermanent"); + Permanent diedPermanent = (Permanent) getValue("permanentLeftBattlefield"); if (diedPermanent != null) { controller.gainLife(diedPermanent.getPower().getValue(), game); controller.drawCards(diedPermanent.getPower().getValue(), game); diff --git a/Mage.Sets/src/mage/sets/commander2014/MasterworkOfIngenuity.java b/Mage.Sets/src/mage/sets/commander2014/MasterworkOfIngenuity.java index 7485d6c1534..1ec61bbb10e 100644 --- a/Mage.Sets/src/mage/sets/commander2014/MasterworkOfIngenuity.java +++ b/Mage.Sets/src/mage/sets/commander2014/MasterworkOfIngenuity.java @@ -28,14 +28,11 @@ package mage.sets.commander2014; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -45,6 +42,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; * @author LevelX2 */ public class MasterworkOfIngenuity extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent("artifact"); static { @@ -58,12 +56,7 @@ public class MasterworkOfIngenuity extends CardImpl { this.subtype.add("Equipment"); // You may have Masterwork of Ingenuity enter the battlefield as a copy of any Equipment on the battlefield. - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( - new CopyPermanentEffect(filter), - "You may have {this} enter the battlefield as a copy of any Equipment on the battlefield", - true)); - this.addAbility(ability); - + this.addAbility(new EntersBattlefieldAbility(new CopyPermanentEffect(filter), true)); } public MasterworkOfIngenuity(final MasterworkOfIngenuity card) { diff --git a/Mage.Sets/src/mage/sets/commander2014/NahiriTheLithomancer.java b/Mage.Sets/src/mage/sets/commander2014/NahiriTheLithomancer.java index 826add7420e..0e303f39bcf 100644 --- a/Mage.Sets/src/mage/sets/commander2014/NahiriTheLithomancer.java +++ b/Mage.Sets/src/mage/sets/commander2014/NahiriTheLithomancer.java @@ -27,15 +27,11 @@ */ package mage.sets.commander2014; -import java.io.Serializable; -import java.util.HashMap; -import java.util.Map; import java.util.UUID; -import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.Effect; @@ -43,7 +39,6 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.DoubleStrikeAbility; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.IndestructibleAbility; @@ -55,12 +50,12 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.game.permanent.token.KorSoldierToken; import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.Target; @@ -79,20 +74,19 @@ public class NahiriTheLithomancer extends CardImpl { this.expansionSetCode = "C14"; this.subtype.add("Nahiri"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +2: Put a 1/1 white Kor Soldier creature token onto the battlefield. You may attach an Equipment you control to it. this.addAbility(new LoyaltyAbility(new NahiriTheLithomancerFirstAbilityEffect(), 2)); - + // -2: You may put an Equipment card from your hand or graveyard onto the battlefield. this.addAbility(new LoyaltyAbility(new NahiriTheLithomancerSecondAbilityEffect(), -2)); - + // -10: Put a colorless Equipment artifact token named Stoneforged Blade onto the battlefield. It has indestructible, "Equipped creature gets +5/+5 and has double strike," and equip {0}. Effect effect = new CreateTokenEffect(new NahiriTheLithomancerEquipmentToken()); effect.setText("Put a colorless Equipment artifact token named Stoneforged Blade onto the battlefield. It has indestructible, \"Equipped creature gets +5/+5 and has double strike,\" and equip {0}"); this.addAbility(new LoyaltyAbility(effect, -10)); - + // Nahiri, the Lithomancer can be your commander. this.addAbility(CanBeYourCommanderAbility.getInstance()); } @@ -108,46 +102,49 @@ public class NahiriTheLithomancer extends CardImpl { } class NahiriTheLithomancerFirstAbilityEffect extends OneShotEffect { - + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an Equipment you control"); + static { filter.add(new SubtypePredicate("Equipment")); } - + NahiriTheLithomancerFirstAbilityEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "Put a 1/1 white Kor Soldier creature token onto the battlefield. You may attach an Equipment you control to it"; } - + NahiriTheLithomancerFirstAbilityEffect(final NahiriTheLithomancerFirstAbilityEffect effect) { super(effect); } - + @Override public NahiriTheLithomancerFirstAbilityEffect copy() { return new NahiriTheLithomancerFirstAbilityEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Token token = new NahiriTheLithomancerKorSoldierToken(); + Token token = new KorSoldierToken(); if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { - Permanent tokenPermanent = game.getPermanent(token.getLastAddedToken()); - if (tokenPermanent != null) { - //TODO: Make sure the Equipment can legally enchant the token, preferably on targetting. - Target target = new TargetControlledPermanent(0, 1, filter, true); - if (target.canChoose(source.getSourceId(), controller.getId(), game) && - controller.chooseUse(outcome, "Attach an Equipment you control to the created Token?", source, game)) { - if (target.choose(Outcome.Neutral, source.getControllerId(), source.getSourceId(), game)) { - Permanent equipmentPermanent = game.getPermanent(target.getFirstTarget()); - if (equipmentPermanent != null) { - Permanent attachedTo = game.getPermanent(equipmentPermanent.getAttachedTo()); - if (attachedTo != null) { - attachedTo.removeAttachment(equipmentPermanent.getId(), game); + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + //TODO: Make sure the Equipment can legally enchant the token, preferably on targetting. + Target target = new TargetControlledPermanent(0, 1, filter, true); + if (target.canChoose(source.getSourceId(), controller.getId(), game) + && controller.chooseUse(outcome, "Attach an Equipment you control to the created " + tokenPermanent.getIdName() + "?", source, game)) { + if (target.choose(Outcome.Neutral, source.getControllerId(), source.getSourceId(), game)) { + Permanent equipmentPermanent = game.getPermanent(target.getFirstTarget()); + if (equipmentPermanent != null) { + Permanent attachedTo = game.getPermanent(equipmentPermanent.getAttachedTo()); + if (attachedTo != null) { + attachedTo.removeAttachment(equipmentPermanent.getId(), game); + } + tokenPermanent.addAttachment(equipmentPermanent.getId(), game); } - tokenPermanent.addAttachment(equipmentPermanent.getId(), game); } } } @@ -160,41 +157,28 @@ class NahiriTheLithomancerFirstAbilityEffect extends OneShotEffect { } } -class NahiriTheLithomancerKorSoldierToken extends Token { - - NahiriTheLithomancerKorSoldierToken() { - super("Kor Soldier", "1/1 white Kor Soldier creature token"); - setOriginalExpansionSetCode("C14"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Kor"); - subtype.add("Soldier"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} - class NahiriTheLithomancerSecondAbilityEffect extends OneShotEffect { - + private static final FilterCard filter = new FilterCard("an Equipment"); + static { filter.add(new SubtypePredicate("Equipment")); } - + NahiriTheLithomancerSecondAbilityEffect() { super(Outcome.PutCardInPlay); this.staticText = "You may put an Equipment card from your hand or graveyard onto the battlefield"; } - + NahiriTheLithomancerSecondAbilityEffect(final NahiriTheLithomancerSecondAbilityEffect effect) { super(effect); } - + @Override public NahiriTheLithomancerSecondAbilityEffect copy() { return new NahiriTheLithomancerSecondAbilityEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); @@ -204,15 +188,14 @@ class NahiriTheLithomancerSecondAbilityEffect extends OneShotEffect { controller.choose(outcome, target, source.getSourceId(), game); Card card = controller.getHand().get(target.getFirstTarget(), game); if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } - } - else { + } else { Target target = new TargetCardInYourGraveyard(0, 1, filter); target.choose(Outcome.PutCardInPlay, source.getControllerId(), source.getSourceId(), game); Card card = controller.getGraveyard().get(target.getFirstTarget(), game); if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } return true; @@ -227,13 +210,13 @@ class NahiriTheLithomancerEquipmentToken extends Token { super("Stoneforged Blade", "colorless Equipment artifact token named Stoneforged Blade with indestructible, \"Equipped creature gets +5/+5 and has double strike,\" and equip {0}"); cardType.add(CardType.ARTIFACT); subtype.add("Equipment"); - + this.addAbility(IndestructibleAbility.getInstance()); - + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(5, 5)); ability.addEffect(new GainAbilityAttachedEffect(DoubleStrikeAbility.getInstance(), AttachmentType.EQUIPMENT, Duration.WhileOnBattlefield, "and has double strike")); this.addAbility(ability); - + this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(0))); } } diff --git a/Mage.Sets/src/mage/sets/commander2014/NecromanticSelection.java b/Mage.Sets/src/mage/sets/commander2014/NecromanticSelection.java index b595331cf91..240f34a2f5f 100644 --- a/Mage.Sets/src/mage/sets/commander2014/NecromanticSelection.java +++ b/Mage.Sets/src/mage/sets/commander2014/NecromanticSelection.java @@ -71,7 +71,6 @@ public class NecromanticSelection extends CardImpl { super(ownerId, 26, "Necromantic Selection", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}{B}{B}"); this.expansionSetCode = "C14"; - // Destroy all creatures, then return a creature card put into a graveyard this way to the battlefield under your control. It's a black Zombie in addition to its other colors and types. Exile Necromantic Selection. this.getSpellAbility().addEffect(new NecromanticSelectionEffect()); this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); @@ -110,7 +109,7 @@ class NecromanticSelectionEffect extends OneShotEffect { MageObject sourceObject = game.getObject(source.getSourceId()); if (sourceObject != null && controller != null) { Cards cards = new CardsImpl(); - for(Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) { permanent.destroy(source.getSourceId(), game, false); if (game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) { cards.add(permanent); @@ -118,7 +117,7 @@ class NecromanticSelectionEffect extends OneShotEffect { } FilterCard filter = new FilterCreatureCard("creature card put into a graveyard with " + sourceObject.getLogName()); ArrayList> cardIdPredicates = new ArrayList<>(); - for(UUID cardId: cards) { + for (UUID cardId : cards) { cardIdPredicates.add(new CardIdPredicate(cardId)); } filter.add(Predicates.or(cardIdPredicates)); @@ -126,7 +125,7 @@ class NecromanticSelectionEffect extends OneShotEffect { if (controller.chooseTarget(outcome, target, source, game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); ContinuousEffect effect = new NecromanticSelectionContinuousEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/sets/commander2014/ObNixilisOfTheBlackOath.java b/Mage.Sets/src/mage/sets/commander2014/ObNixilisOfTheBlackOath.java index 79cb66aa248..2a1e6544c52 100644 --- a/Mage.Sets/src/mage/sets/commander2014/ObNixilisOfTheBlackOath.java +++ b/Mage.Sets/src/mage/sets/commander2014/ObNixilisOfTheBlackOath.java @@ -28,11 +28,10 @@ package mage.sets.commander2014; import java.util.UUID; -import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; @@ -45,17 +44,14 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.LoseLifeSourceControllerEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.game.Game; import mage.game.command.Emblem; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.DemonToken; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -70,20 +66,19 @@ public class ObNixilisOfTheBlackOath extends CardImpl { this.expansionSetCode = "C14"; this.subtype.add("Nixilis"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +2: Each opponent loses 1 life. You gain life equal to the life lost this way. this.addAbility(new LoyaltyAbility(new ObNixilisOfTheBlackOathEffect1(), 2)); // -2: Put a 5/5 black Demon creature token with flying onto the battlefield. You lose 2 life. - LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new CreateTokenEffect(new ObNixilisDemonToken()), -2); + LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new CreateTokenEffect(new DemonToken()), -2); loyaltyAbility.addEffect(new LoseLifeSourceControllerEffect(2)); this.addAbility(loyaltyAbility); // -8: You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power." this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new ObNixilisOfTheBlackOathEmblem()), -8)); - + // Ob Nixilis of the Black Oath can be your commander. this.addAbility(CanBeYourCommanderAbility.getInstance()); } @@ -114,7 +109,7 @@ class ObNixilisOfTheBlackOathEffect1 extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int loseLife = 0; - for (UUID opponentId: game.getOpponents(source.getControllerId())) { + for (UUID opponentId : game.getOpponents(source.getControllerId())) { Player opponent = game.getPlayer(opponentId); if (opponent != null) { loseLife += opponent.loseLife(1, game); @@ -134,31 +129,16 @@ class ObNixilisOfTheBlackOathEffect1 extends OneShotEffect { } -class ObNixilisDemonToken extends Token { - - ObNixilisDemonToken() { - super("Demon", "5/5 black Demon creature token with flying"); - setTokenType(1); - setOriginalExpansionSetCode("C14"); - cardType.add(CardType.CREATURE); - subtype.add("Demon"); - - color.setBlack(true); - power = new MageInt(5); - toughness = new MageInt(5); - - addAbility(FlyingAbility.getInstance()); - } -} - class ObNixilisOfTheBlackOathEmblem extends Emblem { + // You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power." + public ObNixilisOfTheBlackOathEmblem() { this.setName("EMBLEM: Ob Nixilis of the Black Oath"); DynamicValue xValue = new SacrificeCostCreaturesPower(); Effect effect = new GainLifeEffect(xValue); effect.setText("You gain X life"); - Ability ability = new SimpleActivatedAbility(Zone.COMMAND, effect, new ManaCostsImpl("{1}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.COMMAND, effect, new ManaCostsImpl("{1}{B}")); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); effect = new DrawCardSourceControllerEffect(xValue); effect.setText("and draw X cards, where X is the sacrificed creature's power"); diff --git a/Mage.Sets/src/mage/sets/commander2014/RushOfKnowledge.java b/Mage.Sets/src/mage/sets/commander2014/RushOfKnowledge.java index fbaf91c4549..e288a020a36 100644 --- a/Mage.Sets/src/mage/sets/commander2014/RushOfKnowledge.java +++ b/Mage.Sets/src/mage/sets/commander2014/RushOfKnowledge.java @@ -28,15 +28,11 @@ package mage.sets.commander2014; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.HighestConvertedManaCostValue; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; /** * @@ -48,10 +44,10 @@ public class RushOfKnowledge extends CardImpl { super(ownerId, 123, "Rush of Knowledge", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{U}"); this.expansionSetCode = "C14"; - // Draw cards equal to the highest converted mana cost among permanents you control. - this.getSpellAbility().addEffect(new RushOfKnowledgeEffect()); - + DrawCardSourceControllerEffect effect = new DrawCardSourceControllerEffect(new HighestConvertedManaCostValue()); + effect.setText("Draw cards equal to the highest converted mana cost among permanents you control"); + this.getSpellAbility().addEffect(effect); } public RushOfKnowledge(final RushOfKnowledge card) { @@ -63,41 +59,3 @@ public class RushOfKnowledge extends CardImpl { return new RushOfKnowledge(this); } } - -class RushOfKnowledgeEffect extends OneShotEffect { - - public RushOfKnowledgeEffect() { - super(Outcome.DrawCard); - this.staticText = "Draw cards equal to the highest converted mana cost among permanents you control"; - } - - public RushOfKnowledgeEffect(final RushOfKnowledgeEffect effect) { - super(effect); - } - - @Override - public RushOfKnowledgeEffect copy() { - return new RushOfKnowledgeEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - int highCMC = 0; - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) { - if (permanent.getSpellAbility() != null) { - int cmc = permanent.getSpellAbility().getManaCosts().convertedManaCost(); - if (cmc > highCMC) { - highCMC = cmc; - } - } - } - if (highCMC > 0) { - controller.drawCards(highCMC, game); - } - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/commander2014/ScrapMastery.java b/Mage.Sets/src/mage/sets/commander2014/ScrapMastery.java index 95c2ae286fc..badafeb966f 100644 --- a/Mage.Sets/src/mage/sets/commander2014/ScrapMastery.java +++ b/Mage.Sets/src/mage/sets/commander2014/ScrapMastery.java @@ -28,7 +28,6 @@ package mage.sets.commander2014; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.UUID; @@ -56,7 +55,6 @@ public class ScrapMastery extends CardImpl { super(ownerId, 38, "Scrap Mastery", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); this.expansionSetCode = "C14"; - // Each player exiles all artifact cards from his or her graveyard, then sacrifices all artifacts he or she controls, then puts all cards he or she exiled this way onto the battlefield. this.getSpellAbility().addEffect(new ScrapMasteryEffect()); } @@ -91,38 +89,30 @@ class ScrapMasteryEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Map> exiledCards = new HashMap<>(); + Map> exiledCards = new HashMap<>(); // exile artifacts from graveyard - for (UUID playerId: controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - Set cards = new HashSet<>(); - for (Card card: player.getGraveyard().getCards(new FilterArtifactCard(), game)) { - cards.add(card.getId()); - player.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true); - } + Set cards = player.getGraveyard().getCards(new FilterArtifactCard(), game); + controller.moveCards(cards, Zone.EXILED, source, game); exiledCards.put(player.getId(), cards); } } // sacrifice all artifacts - for (UUID playerId: controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(new FilterArtifactPermanent(), playerId, game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterArtifactPermanent(), playerId, game)) { permanent.sacrifice(source.getSourceId(), game); } } } // puts all cards he or she exiled this way onto the battlefield - for (UUID playerId: controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (UUID cardId: exiledCards.get(playerId)) { - Card card = game.getCard(cardId); - if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, cardId); - } - } + controller.moveCards(exiledCards.get(playerId), Zone.BATTLEFIELD, source, game); } } return true; diff --git a/Mage.Sets/src/mage/sets/commander2014/SongOfTheDryads.java b/Mage.Sets/src/mage/sets/commander2014/SongOfTheDryads.java index 8af2e622f3c..f37d1508087 100644 --- a/Mage.Sets/src/mage/sets/commander2014/SongOfTheDryads.java +++ b/Mage.Sets/src/mage/sets/commander2014/SongOfTheDryads.java @@ -30,14 +30,20 @@ package mage.sets.commander2014; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.continuous.BecomesBasicLandEnchantedEffect; import mage.abilities.keyword.EnchantAbility; +import mage.abilities.mana.GreenManaAbility; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; import mage.target.TargetPermanent; /** @@ -51,7 +57,6 @@ public class SongOfTheDryads extends CardImpl { this.expansionSetCode = "C14"; this.subtype.add("Aura"); - // Enchant permanent TargetPermanent auraTarget = new TargetPermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -60,7 +65,7 @@ public class SongOfTheDryads extends CardImpl { this.addAbility(ability); // Enchanted permanent is a colorless Forest land. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect("Forest"))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesColorlessForestLandEffect())); } @@ -73,3 +78,61 @@ public class SongOfTheDryads extends CardImpl { return new SongOfTheDryads(this); } } + +class BecomesColorlessForestLandEffect extends ContinuousEffectImpl { + + public BecomesColorlessForestLandEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + this.staticText = "Enchanted permanent is a colorless Forest land"; + } + + public BecomesColorlessForestLandEffect(final BecomesColorlessForestLandEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public BecomesColorlessForestLandEffect copy() { + return new BecomesColorlessForestLandEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); + if (permanent != null) { + switch (layer) { + case ColorChangingEffects_5: + permanent.getColor(game).setWhite(false); + permanent.getColor(game).setGreen(false); + permanent.getColor(game).setBlack(false); + permanent.getColor(game).setBlue(false); + permanent.getColor(game).setRed(false); + break; + case AbilityAddingRemovingEffects_6: + permanent.removeAllAbilities(source.getSourceId(), game); + permanent.addAbility(new GreenManaAbility(), source.getSourceId(), game); + break; + case TypeChangingEffects_4: + permanent.getCardType().clear(); + permanent.getCardType().add(CardType.LAND); + permanent.getSubtype().clear(); + permanent.getSubtype().add("Forest"); + break; + } + return true; + } + } + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2014/SylvanOffering.java b/Mage.Sets/src/mage/sets/commander2014/SylvanOffering.java index 069978000ba..fab6eea4bed 100644 --- a/Mage.Sets/src/mage/sets/commander2014/SylvanOffering.java +++ b/Mage.Sets/src/mage/sets/commander2014/SylvanOffering.java @@ -41,6 +41,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.game.Game; import mage.game.permanent.token.SpiritWhiteToken; +import mage.game.permanent.token.ElfToken; import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.Target; @@ -149,28 +150,13 @@ class SylvanOfferingEffect2 extends OneShotEffect { Player opponent = game.getPlayer(target.getFirstTarget()); if (opponent != null) { int xValue = source.getManaCostsToPay().getX(); - Effect effect = new CreateTokenTargetEffect(new SylvanOfferingElfWarriorToken(), xValue); + Effect effect = new CreateTokenTargetEffect(new ElfToken(), xValue); effect.setTargetPointer(new FixedTarget(opponent.getId())); effect.apply(game, source); - new CreateTokenEffect(new SylvanOfferingElfWarriorToken(), xValue).apply(game, source); + new CreateTokenEffect(new ElfToken(), xValue).apply(game, source); return true; } } return false; } } - -class SylvanOfferingElfWarriorToken extends Token { - - public SylvanOfferingElfWarriorToken() { - super("Elf Warrior", "1/1 green Elf Warrior creature token"); - setOriginalExpansionSetCode("C14"); - cardType.add(CardType.CREATURE); - subtype.add("Elf"); - subtype.add("Warrior"); - color.setGreen(true); - power = new MageInt(1); - toughness = new MageInt(1); - - } -} diff --git a/Mage.Sets/src/mage/sets/commander2014/TeferiTemporalArchmage.java b/Mage.Sets/src/mage/sets/commander2014/TeferiTemporalArchmage.java index bbe6c7346a5..bf6477bc1ea 100644 --- a/Mage.Sets/src/mage/sets/commander2014/TeferiTemporalArchmage.java +++ b/Mage.Sets/src/mage/sets/commander2014/TeferiTemporalArchmage.java @@ -31,14 +31,13 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.CanBeYourCommanderAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.abilities.effects.common.UntapTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.AsThoughEffectType; import mage.constants.CardType; @@ -46,12 +45,10 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.command.Emblem; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; /** @@ -65,21 +62,20 @@ public class TeferiTemporalArchmage extends CardImpl { this.expansionSetCode = "C14"; this.subtype.add("Teferi"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); // +1: Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library. this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect( new StaticValue(2), false, new StaticValue(1), new FilterCard(), Zone.LIBRARY, false, false), 1)); // -1: Untap up to four target permanents. - LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new UntapTargetEffect(), -1); - loyaltyAbility.addTarget(new TargetPermanent(0,4, new FilterPermanent(), false)); + LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new UntapTargetEffect(), -1); + loyaltyAbility.addTarget(new TargetPermanent(0, 4, new FilterPermanent(), false)); this.addAbility(loyaltyAbility); // -10: You get an emblem with "You may activate loyalty abilities of planeswalkers you control on any player's turn any time you could cast an instant." this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new TeferiTemporalArchmageEmblem()), -10)); - + // Teferi, Temporal Archmage can be your commander. this.addAbility(CanBeYourCommanderAbility.getInstance()); @@ -96,6 +92,7 @@ public class TeferiTemporalArchmage extends CardImpl { } class TeferiTemporalArchmageEmblem extends Emblem { + // "You may activate loyalty abilities of planeswalkers you control on any player's turn any time you could cast an instant." public TeferiTemporalArchmageEmblem() { this.setName("EMBLEM: Teferi, Temporal Archmage"); @@ -114,7 +111,6 @@ class TeferiTemporalArchmageAsThoughEffect extends AsThoughEffectImpl { super(effect); } - @Override public boolean apply(Game game, Ability source) { return true; @@ -135,7 +131,7 @@ class TeferiTemporalArchmageAsThoughEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return false; // Not used + return false; // Not used } } diff --git a/Mage.Sets/src/mage/sets/commander2014/TyrantsFamiliar.java b/Mage.Sets/src/mage/sets/commander2014/TyrantsFamiliar.java index df09c2e46e2..38017589d07 100644 --- a/Mage.Sets/src/mage/sets/commander2014/TyrantsFamiliar.java +++ b/Mage.Sets/src/mage/sets/commander2014/TyrantsFamiliar.java @@ -38,7 +38,6 @@ import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; -import mage.constants.AbilityType; import mage.constants.CardType; import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; @@ -52,6 +51,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class TyrantsFamiliar extends CardImpl { + private final UUID originalId; + public TyrantsFamiliar(UUID ownerId) { super(ownerId, 39, "Tyrant's Familiar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}{R}"); this.expansionSetCode = "C14"; @@ -62,30 +63,32 @@ public class TyrantsFamiliar extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // Haste this.addAbility(HasteAbility.getInstance()); - + // Lieutenant - As long as you control your commander, Tyrant's Familiar gets +2/+2 and has "Whenever Tyrant's Familiar attacks, it deals 7 damage to target creature defending player controls." Ability gainedAbility = new AttacksTriggeredAbility(new DamageTargetEffect(7), false); gainedAbility.addTarget(new TargetCreaturePermanent()); ContinuousEffect effect = new GainAbilitySourceEffect(gainedAbility); effect.setText("and has \"Whenever {this} attacks, it deals 7 damage to target creature defending player controls\""); + originalId = gainedAbility.getOriginalId(); this.addAbility(new LieutenantAbility(effect)); } public TyrantsFamiliar(final TyrantsFamiliar card) { super(card); + this.originalId = card.originalId; } @Override public TyrantsFamiliar copy() { return new TyrantsFamiliar(this); } - + @Override public void adjustTargets(Ability ability, Game game) { - if (ability.getAbilityType().equals(AbilityType.TRIGGERED)) { + if (ability.getOriginalId().equals(originalId)) { ability.getTargets().clear(); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId()); diff --git a/Mage.Sets/src/mage/sets/commander2014/WakeTheDead.java b/Mage.Sets/src/mage/sets/commander2014/WakeTheDead.java index f196efa60cf..eb7e9438ae7 100644 --- a/Mage.Sets/src/mage/sets/commander2014/WakeTheDead.java +++ b/Mage.Sets/src/mage/sets/commander2014/WakeTheDead.java @@ -33,13 +33,13 @@ import mage.abilities.DelayedTriggeredAbility; import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; -import mage.abilities.dynamicvalue.common.GetXValue; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.SacrificeTargetEffect; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -64,7 +64,6 @@ public class WakeTheDead extends CardImpl { super(ownerId, 31, "Wake the Dead", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{B}{B}"); this.expansionSetCode = "C14"; - // Cast Wake the Dead only during combat on an opponent's turn. Ability ability = new SimpleStaticAbility(Zone.ALL, new WakeTheDeadEffect()); ability.setRuleAtTheTop(true); @@ -72,7 +71,7 @@ public class WakeTheDead extends CardImpl { // Return X target creature cards from your graveyard to the battlefield. Sacrifice those creatures at the beginning of the next end step. this.getSpellAbility().addEffect(new WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect()); - this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0,Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard"))); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard"))); } @Override @@ -80,7 +79,7 @@ public class WakeTheDead extends CardImpl { if (ability instanceof SpellAbility) { int xValue = ability.getManaCostsToPay().getX(); ability.getTargets().clear(); - ability.addTarget(new TargetCardInYourGraveyard(xValue,xValue, new FilterCreatureCard("creature cards from your graveyard"))); + ability.addTarget(new TargetCardInYourGraveyard(xValue, xValue, new FilterCreatureCard("creature cards from your graveyard"))); } } @@ -150,26 +149,22 @@ class WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect extends OneShotEff @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - for (UUID targetId : getTargetPointer().getTargets(game, source)) { - Card card = game.getCard(targetId); - if (card != null) { - if (player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), false)) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.changeControllerId(source.getControllerId(), game); - Effect effect = new SacrificeTargetEffect("Sacrifice those creatures at the beginning of the next end step"); - effect.setTargetPointer(new FixedTarget(permanent.getId())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - } - - } + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Cards cards = new CardsImpl(getTargetPointer().getTargets(game, source)); + controller.moveCards(cards, Zone.BATTLEFIELD, source, game); + for (UUID targetId : cards) { + Permanent creature = game.getPermanent(targetId); + if (creature != null) { + Effect effect = new SacrificeTargetEffect("Sacrifice those creatures at the beginning of the next end step", source.getControllerId()); + effect.setTargetPointer(new FixedTarget(creature, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); } + } return true; } diff --git a/Mage.Sets/src/mage/sets/commander2014/WarmongerHellkite.java b/Mage.Sets/src/mage/sets/commander2014/WarmongerHellkite.java index facef8d227a..450a026bcab 100644 --- a/Mage.Sets/src/mage/sets/commander2014/WarmongerHellkite.java +++ b/Mage.Sets/src/mage/sets/commander2014/WarmongerHellkite.java @@ -62,7 +62,7 @@ public class WarmongerHellkite extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // All creatures attack each combat if able. - Effect effect = new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures")); + Effect effect = new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures"), Duration.WhileOnBattlefield, true); effect.setText("All creatures attack each combat if able"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/sets/commander2014/WaveOfVitriol.java b/Mage.Sets/src/mage/sets/commander2014/WaveOfVitriol.java index 19994d3145c..bb5bb951b94 100644 --- a/Mage.Sets/src/mage/sets/commander2014/WaveOfVitriol.java +++ b/Mage.Sets/src/mage/sets/commander2014/WaveOfVitriol.java @@ -28,12 +28,15 @@ package mage.sets.commander2014; import java.util.HashMap; +import java.util.LinkedHashSet; import java.util.Map; +import java.util.Set; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -86,9 +89,9 @@ class WaveOfVitriolEffect extends OneShotEffect { new CardTypePredicate(CardType.LAND), Predicates.not(new SupertypePredicate("Basic")) ) - )); } + public WaveOfVitriolEffect() { super(Outcome.Benefit); this.staticText = "Each player sacrifices all artifacts, enchantments, and nonbasic lands he or she controls. For each land sacrificed this way, its controller may search his or her library for a basic land card and put it onto the battlefield tapped. Then each player who searched his or her library this way shuffles it"; @@ -108,11 +111,11 @@ class WaveOfVitriolEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Map sacrificedLands = new HashMap<>(); - for(UUID playerId: controller.getInRange()) { + for (UUID playerId : controller.getInRange()) { Player player = game.getPlayer(playerId); if (player != null) { int count = 0; - for(Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, playerId, game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, playerId, game)) { if (permanent.sacrifice(source.getSourceId(), game) && permanent.getCardType().contains(CardType.LAND)) { count++; } @@ -123,25 +126,19 @@ class WaveOfVitriolEffect extends OneShotEffect { } } game.getState().handleSimultaneousEvent(game); - for(Map.Entry entry: sacrificedLands.entrySet()) { + Cards toBattlefield = new CardsImpl(); + Set playersToShuffle = new LinkedHashSet<>(); + for (Map.Entry entry : sacrificedLands.entrySet()) { if (entry.getKey().chooseUse(Outcome.PutLandInPlay, "Search your library for up to " + entry.getValue() + " basic lands?", source, game)) { Target target = new TargetCardInLibrary(0, entry.getValue(), new FilterBasicLandCard()); entry.getKey().chooseTarget(outcome, target, source, game); - for(UUID targetId: target.getTargets()) { - Card card = game.getCard(targetId); - if (card != null) { - entry.getKey().putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true); - } - } - entry.getKey().shuffleLibrary(game); - } else { - entry.setValue(0); + toBattlefield.addAll(target.getTargets()); + playersToShuffle.add(entry.getKey()); } } - for(Map.Entry entry: sacrificedLands.entrySet()) { - if (entry.getValue() > 0) { - entry.getKey().shuffleLibrary(game); - } + controller.moveCards(toBattlefield.getCards(game), Zone.BATTLEFIELD, source, game, true, false, true, null); + for (Player player : playersToShuffle) { + player.shuffleLibrary(game); } return true; diff --git a/Mage.Sets/src/mage/sets/commander2014/WordOfSeizing.java b/Mage.Sets/src/mage/sets/commander2014/WordOfSeizing.java index 2688c3eb3c0..f503d13fd3d 100644 --- a/Mage.Sets/src/mage/sets/commander2014/WordOfSeizing.java +++ b/Mage.Sets/src/mage/sets/commander2014/WordOfSeizing.java @@ -50,17 +50,16 @@ public class WordOfSeizing extends CardImpl { super(ownerId, 185, "Word of Seizing", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{R}{R}"); this.expansionSetCode = "C14"; - // Split second this.addAbility(new SplitSecondAbility()); // Untap target permanent and gain control of it until end of turn. It gains haste until end of turn. this.getSpellAbility().addEffect(new UntapTargetEffect()); Effect effect = new GainControlTargetEffect(Duration.EndOfTurn); - effect.setText("and gain control of it until end of turn. "); + effect.setText("and gain control of it until end of turn"); this.getSpellAbility().addEffect(effect); effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); - effect.setText("It gains haste until end of turn. "); + effect.setText("It gains haste until end of turn"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetPermanent()); diff --git a/Mage.Sets/src/mage/sets/commander2015/AEtherize.java b/Mage.Sets/src/mage/sets/commander2015/AEtherize.java new file mode 100644 index 00000000000..685ee6dd1f5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/AEtherize.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AEtherize extends mage.sets.gatecrash.AEtherize { + + public AEtherize(UUID ownerId) { + super(ownerId); + this.cardNumber = 85; + this.expansionSetCode = "C15"; + } + + public AEtherize(final AEtherize card) { + super(card); + } + + @Override + public AEtherize copy() { + return new AEtherize(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/AEthersnatch.java b/Mage.Sets/src/mage/sets/commander2015/AEthersnatch.java new file mode 100644 index 00000000000..c54aef189ca --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/AEthersnatch.java @@ -0,0 +1,94 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author emerald000 + */ +public class AEthersnatch extends CardImpl { + + public AEthersnatch(UUID ownerId) { + super(ownerId, 9, "AEthersnatch", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{4}{U}{U}"); + this.expansionSetCode = "C15"; + + // Gain control of target spell. You may choose new targets for it. + this.getSpellAbility().addEffect(new AEthersnatchEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + public AEthersnatch(final AEthersnatch card) { + super(card); + } + + @Override + public AEthersnatch copy() { + return new AEthersnatch(this); + } +} + +class AEthersnatchEffect extends OneShotEffect { + + AEthersnatchEffect() { + super(Outcome.GainControl); + this.staticText = "Gain control of target spell. You may choose new targets for it"; + } + + AEthersnatchEffect(final AEthersnatchEffect effect) { + super(effect); + } + + @Override + public AEthersnatchEffect copy() { + return new AEthersnatchEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Spell spell = game.getStack().getSpell(this.getTargetPointer().getFirst(game, source)); + if (controller != null && spell != null) { + spell.setControllerId(controller.getId()); + spell.chooseNewTargets(game, controller.getId(), false, false, null); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/AcidicSlime.java b/Mage.Sets/src/mage/sets/commander2015/AcidicSlime.java new file mode 100644 index 00000000000..945b3012712 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/AcidicSlime.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AcidicSlime extends mage.sets.magic2010.AcidicSlime { + + public AcidicSlime(UUID ownerId) { + super(ownerId); + this.cardNumber = 173; + this.expansionSetCode = "C15"; + } + + public AcidicSlime(final AcidicSlime card) { + super(card); + } + + @Override + public AcidicSlime copy() { + return new AcidicSlime(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ActOfAggression.java b/Mage.Sets/src/mage/sets/commander2015/ActOfAggression.java new file mode 100644 index 00000000000..2720002549c --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ActOfAggression.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ActOfAggression extends mage.sets.newphyrexia.ActOfAggression { + + public ActOfAggression(UUID ownerId) { + super(ownerId); + this.cardNumber = 141; + this.expansionSetCode = "C15"; + } + + public ActOfAggression(final ActOfAggression card) { + super(card); + } + + @Override + public ActOfAggression copy() { + return new ActOfAggression(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/AjanisChosen.java b/Mage.Sets/src/mage/sets/commander2015/AjanisChosen.java new file mode 100644 index 00000000000..aac099f95e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/AjanisChosen.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AjanisChosen extends mage.sets.magic2014.AjanisChosen { + + public AjanisChosen(UUID ownerId) { + super(ownerId); + this.cardNumber = 57; + this.expansionSetCode = "C15"; + } + + public AjanisChosen(final AjanisChosen card) { + super(card); + } + + @Override + public AjanisChosen copy() { + return new AjanisChosen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/AltarsReap.java b/Mage.Sets/src/mage/sets/commander2015/AltarsReap.java new file mode 100644 index 00000000000..70e3023ad7e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/AltarsReap.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AltarsReap extends mage.sets.innistrad.AltarsReap { + + public AltarsReap(UUID ownerId) { + super(ownerId); + this.cardNumber = 112; + this.expansionSetCode = "C15"; + } + + public AltarsReap(final AltarsReap card) { + super(card); + } + + @Override + public AltarsReap copy() { + return new AltarsReap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/AmbitionsCost.java b/Mage.Sets/src/mage/sets/commander2015/AmbitionsCost.java new file mode 100644 index 00000000000..b0ebdb59ca0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/AmbitionsCost.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AmbitionsCost extends mage.sets.eighthedition.AmbitionsCost { + + public AmbitionsCost(UUID ownerId) { + super(ownerId); + this.cardNumber = 113; + this.expansionSetCode = "C15"; + } + + public AmbitionsCost(final AmbitionsCost card) { + super(card); + } + + @Override + public AmbitionsCost copy() { + return new AmbitionsCost(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/AncientAmphitheater.java b/Mage.Sets/src/mage/sets/commander2015/AncientAmphitheater.java new file mode 100644 index 00000000000..21a5f92ec76 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/AncientAmphitheater.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AncientAmphitheater extends mage.sets.lorwyn.AncientAmphitheater { + + public AncientAmphitheater(UUID ownerId) { + super(ownerId); + this.cardNumber = 276; + this.expansionSetCode = "C15"; + } + + public AncientAmphitheater(final AncientAmphitheater card) { + super(card); + } + + @Override + public AncientAmphitheater copy() { + return new AncientAmphitheater(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/AncientCraving.java b/Mage.Sets/src/mage/sets/commander2015/AncientCraving.java new file mode 100644 index 00000000000..ec231cde4a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/AncientCraving.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AncientCraving extends mage.sets.starter1999.AncientCraving { + + public AncientCraving(UUID ownerId) { + super(ownerId); + this.cardNumber = 114; + this.expansionSetCode = "C15"; + } + + public AncientCraving(final AncientCraving card) { + super(card); + } + + @Override + public AncientCraving copy() { + return new AncientCraving(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/AngelOfSerenity.java b/Mage.Sets/src/mage/sets/commander2015/AngelOfSerenity.java new file mode 100644 index 00000000000..f20decba2c1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/AngelOfSerenity.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AngelOfSerenity extends mage.sets.returntoravnica.AngelOfSerenity { + + public AngelOfSerenity(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "C15"; + } + + public AngelOfSerenity(final AngelOfSerenity card) { + super(card); + } + + @Override + public AngelOfSerenity copy() { + return new AngelOfSerenity(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/AnyaMercilessAngel.java b/Mage.Sets/src/mage/sets/commander2015/AnyaMercilessAngel.java new file mode 100644 index 00000000000..1bb34a90c3e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/AnyaMercilessAngel.java @@ -0,0 +1,144 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.MultipliedValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author emerald000 + */ +public class AnyaMercilessAngel extends CardImpl { + + public AnyaMercilessAngel(UUID ownerId) { + super(ownerId, 41, "Anya, Merciless Angel", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{R}{W}"); + this.expansionSetCode = "C15"; + this.supertype.add("Legendary"); + this.subtype.add("Angel"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Anya, Merciless Angel gets +3/+3 for each opponent whose life total is less than half his or her starting life total. + DynamicValue dValue = new MultipliedValue(new AnyaMercilessAngelDynamicValue(), 3); + Effect effect = new BoostSourceEffect(dValue, dValue, Duration.WhileOnBattlefield); + effect.setText("{this{ gets +3/+3 for each opponent whose life total is less than half his or her starting life total"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(dValue, dValue, Duration.WhileOnBattlefield))); + + // As long as an opponent's life total is less than half his or her starting life total, Anya has indestructible. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield), + AnyaMercilessAngelCondition.getInstance(), + "As long as an opponent's life total is less than half his or her starting life total, {this} has indestructible"))); + } + + public AnyaMercilessAngel(final AnyaMercilessAngel card) { + super(card); + } + + @Override + public AnyaMercilessAngel copy() { + return new AnyaMercilessAngel(this); + } +} + +class AnyaMercilessAngelDynamicValue implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + int opponentCount = 0; + Player controller = game.getPlayer(sourceAbility.getControllerId()); + if (controller != null) { + int startingLifeTotal = game.getLife(); + for (UUID opponentId : game.getOpponents(controller.getId())) { + Player opponent = game.getPlayer(opponentId); + if (opponent != null && opponent.getLife() < startingLifeTotal / 2) { + opponentCount++; + } + } + } + return opponentCount; + } + + @Override + public AnyaMercilessAngelDynamicValue copy() { + return new AnyaMercilessAngelDynamicValue(); + } + + @Override + public String getMessage() { + return "number of opponents whose life total is less than half his or her starting life total"; + } + + @Override + public String toString() { + return "X"; + } +} + +class AnyaMercilessAngelCondition implements Condition { + + private static final AnyaMercilessAngelCondition fInstance = new AnyaMercilessAngelCondition(); + + public static AnyaMercilessAngelCondition getInstance() { + return fInstance; + }; + + private AnyaMercilessAngelCondition() {} + + @Override + public boolean apply(Game game, Ability source) { + return new AnyaMercilessAngelDynamicValue().calculate(game, source, null) > 0; + } + + @Override + public String toString() { + return "an opponent's life total is less than half his or her starting life total"; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Arachnogenesis.java b/Mage.Sets/src/mage/sets/commander2015/Arachnogenesis.java new file mode 100644 index 00000000000..3f500fc132e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Arachnogenesis.java @@ -0,0 +1,104 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.PreventAllDamageByAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.combat.CombatGroup; +import mage.game.permanent.token.SpiderToken; + +/** + * + * @author fireshoes + */ +public class Arachnogenesis extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Spider creatures"); + + static { + filter.add(Predicates.not(new SubtypePredicate("Spider"))); + } + + public Arachnogenesis(UUID ownerId) { + super(ownerId, 32, "Arachnogenesis", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{G}"); + this.expansionSetCode = "C15"; + + // Put X 1/2 green Spider creature tokens with reach onto the battlefield, where X is the number of creatures attacking you. + Effect effect = new CreateTokenEffect(new SpiderToken(), new ArachnogenesisCount()); + effect.setText("Put X 1/2 green Spider creature tokens with reach onto the battlefield, where X is the number of creatures attacking you"); + this.getSpellAbility().addEffect(effect); + + // Prevent all combat damage that would be dealt this turn by non-Spider creatures. + this.getSpellAbility().addEffect(new PreventAllDamageByAllEffect(filter, Duration.EndOfTurn, true)); + } + + public Arachnogenesis(final Arachnogenesis card) { + super(card); + } + + @Override + public Arachnogenesis copy() { + return new Arachnogenesis(this); + } +} + +class ArachnogenesisCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + int count = 0; + for (CombatGroup combatGroup : game.getCombat().getGroups()) { + if (combatGroup.getDefenderId().equals(sourceAbility.getControllerId())) { + count += combatGroup.getAttackers().size(); + } + } + return count; + } + + @Override + public DynamicValue copy() { + return this; + } + + @Override + public String getMessage() { + return "creatures attacking you"; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/commander2015/ArbiterOfKnollridge.java b/Mage.Sets/src/mage/sets/commander2015/ArbiterOfKnollridge.java new file mode 100644 index 00000000000..9c0a178294d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ArbiterOfKnollridge.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ArbiterOfKnollridge extends mage.sets.lorwyn.ArbiterOfKnollridge { + + public ArbiterOfKnollridge(UUID ownerId) { + super(ownerId); + this.cardNumber = 59; + this.expansionSetCode = "C15"; + } + + public ArbiterOfKnollridge(final ArbiterOfKnollridge card) { + super(card); + } + + @Override + public ArbiterOfKnollridge copy() { + return new ArbiterOfKnollridge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ArborColossus.java b/Mage.Sets/src/mage/sets/commander2015/ArborColossus.java new file mode 100644 index 00000000000..9c70b372a2a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ArborColossus.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ArborColossus extends mage.sets.theros.ArborColossus { + + public ArborColossus(UUID ownerId) { + super(ownerId); + this.cardNumber = 174; + this.expansionSetCode = "C15"; + } + + public ArborColossus(final ArborColossus card) { + super(card); + } + + @Override + public ArborColossus copy() { + return new ArborColossus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ArjunTheShiftingFlame.java b/Mage.Sets/src/mage/sets/commander2015/ArjunTheShiftingFlame.java new file mode 100644 index 00000000000..2c146818d31 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ArjunTheShiftingFlame.java @@ -0,0 +1,125 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; + +/** + * + * @author fireshoes + */ +public class ArjunTheShiftingFlame extends CardImpl { + + public ArjunTheShiftingFlame(UUID ownerId) { + super(ownerId, 42, "Arjun, the Shifting Flame", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{U}{R}"); + this.expansionSetCode = "C15"; + this.supertype.add("Legendary"); + this.subtype.add("Sphinx"); + this.subtype.add("Wizard"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever you cast a spell, put the cards in your hand on the bottom of your library in any order, then draw that many cards. + this.addAbility(new SpellCastControllerTriggeredAbility(new ArjunTheShiftingFlameEffect(), false)); + } + + public ArjunTheShiftingFlame(final ArjunTheShiftingFlame card) { + super(card); + } + + @Override + public ArjunTheShiftingFlame copy() { + return new ArjunTheShiftingFlame(this); + } +} + +class ArjunTheShiftingFlameEffect extends OneShotEffect { + + public ArjunTheShiftingFlameEffect() { + super(Outcome.Neutral); + staticText = "put the cards in your hand on the bottom of your library in any order, then draw that many cards"; + } + + public ArjunTheShiftingFlameEffect(final ArjunTheShiftingFlameEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player you = game.getPlayer(source.getControllerId()); + if (you != null) { + int count = you.getHand().size(); + Cards cards = new CardsImpl(); + for (Card card : you.getHand().getCards(game)) { + cards.add(card.getId()); + } + TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library")); + while (you.canRespond() && cards.size() > 1) { + you.choose(Outcome.Neutral, cards, target, game); + Card card = cards.get(target.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); + } + target.clearChosen(); + } + if (cards.size() == 1) { + Card card = cards.get(cards.iterator().next(), game); + card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); + } + you.getHand().clear(); + you.drawCards(count, game); + } + return true; + } + + @Override + public ArjunTheShiftingFlameEffect copy() { + return new ArjunTheShiftingFlameEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/commander2015/AuraOfSilence.java b/Mage.Sets/src/mage/sets/commander2015/AuraOfSilence.java new file mode 100644 index 00000000000..bde64e9122e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/AuraOfSilence.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AuraOfSilence extends mage.sets.weatherlight.AuraOfSilence { + + public AuraOfSilence(UUID ownerId) { + super(ownerId); + this.cardNumber = 60; + this.expansionSetCode = "C15"; + } + + public AuraOfSilence(final AuraOfSilence card) { + super(card); + } + + @Override + public AuraOfSilence copy() { + return new AuraOfSilence(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/AwakenTheSkyTyrant.java b/Mage.Sets/src/mage/sets/commander2015/AwakenTheSkyTyrant.java new file mode 100644 index 00000000000..8f9a09481cb --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/AwakenTheSkyTyrant.java @@ -0,0 +1,102 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.token.DragonToken2; + +/** + * + * @author LevelX2 + */ +public class AwakenTheSkyTyrant extends CardImpl { + + public AwakenTheSkyTyrant(UUID ownerId) { + super(ownerId, 24, "Awaken the Sky Tyrant", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); + this.expansionSetCode = "C15"; + + // When a source an opponent controls deals damage to you, sacrifice Awaken the Sky Tyrant. If you do, put a 5/5 red Dragon creature token with flying onto the battlefield. + this.addAbility(new AwakenTheSkyTyrantTriggeredAbility()); + } + + public AwakenTheSkyTyrant(final AwakenTheSkyTyrant card) { + super(card); + } + + @Override + public AwakenTheSkyTyrant copy() { + return new AwakenTheSkyTyrant(this); + } +} + +class AwakenTheSkyTyrantTriggeredAbility extends TriggeredAbilityImpl { + + public AwakenTheSkyTyrantTriggeredAbility() { + super(Zone.BATTLEFIELD, new DoIfCostPaid(new CreateTokenEffect(new DragonToken2(), 1), new SacrificeSourceCost(), null, false), false); + } + + public AwakenTheSkyTyrantTriggeredAbility(final AwakenTheSkyTyrantTriggeredAbility ability) { + super(ability); + } + + @java.lang.Override + public AwakenTheSkyTyrantTriggeredAbility copy() { + return new AwakenTheSkyTyrantTriggeredAbility(this); + } + + @java.lang.Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER); + } + + @java.lang.Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getTargetId().equals(controllerId)) { + UUID sourceControllerId = game.getControllerId(event.getSourceId()); + if (sourceControllerId != null && game.getOpponents(getControllerId()).contains(sourceControllerId)) { + return true; + } + } + return false; + } + + @java.lang.Override + public String getRule() { + return "When a source an opponent controls deals damage to you, " + super.getRule(); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BaneOfProgress.java b/Mage.Sets/src/mage/sets/commander2015/BaneOfProgress.java new file mode 100644 index 00000000000..470b1b0d020 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BaneOfProgress.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BaneOfProgress extends mage.sets.commander2013.BaneOfProgress { + + public BaneOfProgress(UUID ownerId) { + super(ownerId); + this.cardNumber = 175; + this.expansionSetCode = "C15"; + } + + public BaneOfProgress(final BaneOfProgress card) { + super(card); + } + + @Override + public BaneOfProgress copy() { + return new BaneOfProgress(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BanishingLight.java b/Mage.Sets/src/mage/sets/commander2015/BanishingLight.java new file mode 100644 index 00000000000..56f19fe651f --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BanishingLight.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BanishingLight extends mage.sets.journeyintonyx.BanishingLight { + + public BanishingLight(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "C15"; + } + + public BanishingLight(final BanishingLight card) { + super(card); + } + + @Override + public BanishingLight copy() { + return new BanishingLight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BansheeOfTheDreadChoir.java b/Mage.Sets/src/mage/sets/commander2015/BansheeOfTheDreadChoir.java new file mode 100644 index 00000000000..061d769c8ce --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BansheeOfTheDreadChoir.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.MyriadAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class BansheeOfTheDreadChoir extends CardImpl { + + public BansheeOfTheDreadChoir(UUID ownerId) { + super(ownerId, 16, "Banshee of the Dread Choir", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "C15"; + this.subtype.add("Spirit"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Myriad + this.addAbility(new MyriadAbility()); + // Whenever Banshee of the Dread Choir deals combat damage to a player, that player discards a card. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1), false, true)); + } + + public BansheeOfTheDreadChoir(final BansheeOfTheDreadChoir card) { + super(card); + } + + @Override + public BansheeOfTheDreadChoir copy() { + return new BansheeOfTheDreadChoir(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BarrenMoor.java b/Mage.Sets/src/mage/sets/commander2015/BarrenMoor.java new file mode 100644 index 00000000000..95a642c1e9d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BarrenMoor.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BarrenMoor extends mage.sets.onslaught.BarrenMoor { + + public BarrenMoor(UUID ownerId) { + super(ownerId); + this.cardNumber = 277; + this.expansionSetCode = "C15"; + } + + public BarrenMoor(final BarrenMoor card) { + super(card); + } + + @Override + public BarrenMoor copy() { + return new BarrenMoor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BarterInBlood.java b/Mage.Sets/src/mage/sets/commander2015/BarterInBlood.java new file mode 100644 index 00000000000..88b004a8537 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BarterInBlood.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BarterInBlood extends mage.sets.avacynrestored.BarterInBlood { + + public BarterInBlood(UUID ownerId) { + super(ownerId); + this.cardNumber = 115; + this.expansionSetCode = "C15"; + } + + public BarterInBlood(final BarterInBlood card) { + super(card); + } + + @Override + public BarterInBlood copy() { + return new BarterInBlood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BasaltMonolith.java b/Mage.Sets/src/mage/sets/commander2015/BasaltMonolith.java new file mode 100644 index 00000000000..8caccf89593 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BasaltMonolith.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BasaltMonolith extends mage.sets.limitedalpha.BasaltMonolith { + + public BasaltMonolith(UUID ownerId) { + super(ownerId); + this.cardNumber = 244; + this.expansionSetCode = "C15"; + } + + public BasaltMonolith(final BasaltMonolith card) { + super(card); + } + + @Override + public BasaltMonolith copy() { + return new BasaltMonolith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BastionProtector.java b/Mage.Sets/src/mage/sets/commander2015/BastionProtector.java new file mode 100644 index 00000000000..0293878ca10 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BastionProtector.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.CommanderPredicate; + +/** + * + * @author LevelX2 + */ +public class BastionProtector extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Commander creatures you control"); + + static { + filter.add(new CommanderPredicate()); + } + + public BastionProtector(UUID ownerId) { + super(ownerId, 1, "Bastion Protector", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "C15"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Commander creatures you control get +2/+2 and have indestructible. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, filter)); + Effect effect = new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter); + effect.setText("and have indestructible"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public BastionProtector(final BastionProtector card) { + super(card); + } + + @Override + public BastionProtector copy() { + return new BastionProtector(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BeastmasterAscension.java b/Mage.Sets/src/mage/sets/commander2015/BeastmasterAscension.java new file mode 100644 index 00000000000..86569950108 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BeastmasterAscension.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BeastmasterAscension extends mage.sets.zendikar.BeastmasterAscension { + + public BeastmasterAscension(UUID ownerId) { + super(ownerId); + this.cardNumber = 176; + this.expansionSetCode = "C15"; + } + + public BeastmasterAscension(final BeastmasterAscension card) { + super(card); + } + + @Override + public BeastmasterAscension copy() { + return new BeastmasterAscension(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BidentOfThassa.java b/Mage.Sets/src/mage/sets/commander2015/BidentOfThassa.java new file mode 100644 index 00000000000..3423b6dc814 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BidentOfThassa.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BidentOfThassa extends mage.sets.theros.BidentOfThassa { + + public BidentOfThassa(UUID ownerId) { + super(ownerId); + this.cardNumber = 86; + this.expansionSetCode = "C15"; + } + + public BidentOfThassa(final BidentOfThassa card) { + super(card); + } + + @Override + public BidentOfThassa copy() { + return new BidentOfThassa(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BiomanticMastery.java b/Mage.Sets/src/mage/sets/commander2015/BiomanticMastery.java new file mode 100644 index 00000000000..971dd0f6fe0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BiomanticMastery.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BiomanticMastery extends mage.sets.dissension.BiomanticMastery { + + public BiomanticMastery(UUID ownerId) { + super(ownerId); + this.cardNumber = 239; + this.expansionSetCode = "C15"; + } + + public BiomanticMastery(final BiomanticMastery card) { + super(card); + } + + @Override + public BiomanticMastery copy() { + return new BiomanticMastery(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BlackMarket.java b/Mage.Sets/src/mage/sets/commander2015/BlackMarket.java new file mode 100644 index 00000000000..e957cb54e9e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BlackMarket.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BlackMarket extends mage.sets.mercadianmasques.BlackMarket { + + public BlackMarket(UUID ownerId) { + super(ownerId); + this.cardNumber = 116; + this.expansionSetCode = "C15"; + } + + public BlackMarket(final BlackMarket card) { + super(card); + } + + @Override + public BlackMarket copy() { + return new BlackMarket(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BladeOfSelves.java b/Mage.Sets/src/mage/sets/commander2015/BladeOfSelves.java new file mode 100644 index 00000000000..440c76269a2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BladeOfSelves.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.MyriadAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class BladeOfSelves extends CardImpl { + + public BladeOfSelves(UUID ownerId) { + super(ownerId, 51, "Blade of Selves", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "C15"; + this.subtype.add("Equipment"); + + // Equipped creature has myriad. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new MyriadAbility(), AttachmentType.EQUIPMENT))); + + // Equip {4} + this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(4))); + } + + public BladeOfSelves(final BladeOfSelves card) { + super(card); + } + + @Override + public BladeOfSelves copy() { + return new BladeOfSelves(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BlastedLandscape.java b/Mage.Sets/src/mage/sets/commander2015/BlastedLandscape.java new file mode 100644 index 00000000000..8a3be219592 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BlastedLandscape.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BlastedLandscape extends mage.sets.urzassaga.BlastedLandscape { + + public BlastedLandscape(UUID ownerId) { + super(ownerId); + this.cardNumber = 278; + this.expansionSetCode = "C15"; + } + + public BlastedLandscape(final BlastedLandscape card) { + super(card); + } + + @Override + public BlastedLandscape copy() { + return new BlastedLandscape(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BlatantThievery.java b/Mage.Sets/src/mage/sets/commander2015/BlatantThievery.java new file mode 100644 index 00000000000..d201393e233 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BlatantThievery.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BlatantThievery extends mage.sets.onslaught.BlatantThievery { + + public BlatantThievery(UUID ownerId) { + super(ownerId); + this.cardNumber = 87; + this.expansionSetCode = "C15"; + } + + public BlatantThievery(final BlatantThievery card) { + super(card); + } + + @Override + public BlatantThievery copy() { + return new BlatantThievery(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BloodBairn.java b/Mage.Sets/src/mage/sets/commander2015/BloodBairn.java new file mode 100644 index 00000000000..a6572bd9fb2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BloodBairn.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BloodBairn extends mage.sets.magic2014.BloodBairn { + + public BloodBairn(UUID ownerId) { + super(ownerId); + this.cardNumber = 117; + this.expansionSetCode = "C15"; + } + + public BloodBairn(final BloodBairn card) { + super(card); + } + + @Override + public BloodBairn copy() { + return new BloodBairn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BloodsporeThrinax.java b/Mage.Sets/src/mage/sets/commander2015/BloodsporeThrinax.java new file mode 100644 index 00000000000..5a5d699db54 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BloodsporeThrinax.java @@ -0,0 +1,121 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.DevourEffect; +import mage.abilities.keyword.DevourAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; + +/** + * + * @author fireshoes + */ +public class BloodsporeThrinax extends CardImpl { + + public BloodsporeThrinax(UUID ownerId) { + super(ownerId, 33, "Bloodspore Thrinax", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "C15"; + this.subtype.add("Lizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Devour 1 + this.addAbility(new DevourAbility(DevourEffect.DevourFactor.Devour1)); + + // Each other creature you control enters the battlefield with an additional X +1/+1 counters on it, where X is the number of +1/+1 counters on Bloodspire Thrinax. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BloodsporeThrinaxEntersBattlefieldEffect())); + } + + public BloodsporeThrinax(final BloodsporeThrinax card) { + super(card); + } + + @Override + public BloodsporeThrinax copy() { + return new BloodsporeThrinax(this); + } +} + +class BloodsporeThrinaxEntersBattlefieldEffect extends ReplacementEffectImpl { + + public BloodsporeThrinaxEntersBattlefieldEffect() { + super(Duration.WhileOnBattlefield, Outcome.BoostCreature); + staticText = "Each other creature you control enters the battlefield with an additional X +1/+1 counters on it, where X is the number of +1/+1 counters on {this}"; + } + + public BloodsporeThrinaxEntersBattlefieldEffect(BloodsporeThrinaxEntersBattlefieldEffect effect) { + super(effect); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); + return creature != null && creature.getControllerId().equals(source.getControllerId()) + && creature.getCardType().contains(CardType.CREATURE) + && !event.getTargetId().equals(source.getSourceId()); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent sourceCreature = game.getPermanent(source.getSourceId()); + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); + if (sourceCreature != null && creature != null) { + int amount = sourceCreature.getCounters().getCount(CounterType.P1P1); + if (amount > 0) { + creature.addCounters(CounterType.P1P1.createInstance(amount), game); + } + } + return false; + } + + @Override + public BloodsporeThrinaxEntersBattlefieldEffect copy() { + return new BloodsporeThrinaxEntersBattlefieldEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BlueSunsZenith.java b/Mage.Sets/src/mage/sets/commander2015/BlueSunsZenith.java new file mode 100644 index 00000000000..2b03a31ef30 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BlueSunsZenith.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BlueSunsZenith extends mage.sets.mirrodinbesieged.BlueSunsZenith { + + public BlueSunsZenith(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "C15"; + } + + public BlueSunsZenith(final BlueSunsZenith card) { + super(card); + } + + @Override + public BlueSunsZenith copy() { + return new BlueSunsZenith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Blustersquall.java b/Mage.Sets/src/mage/sets/commander2015/Blustersquall.java new file mode 100644 index 00000000000..0277432714b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Blustersquall.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Blustersquall extends mage.sets.returntoravnica.Blustersquall { + + public Blustersquall(UUID ownerId) { + super(ownerId); + this.cardNumber = 89; + this.expansionSetCode = "C15"; + } + + public Blustersquall(final Blustersquall card) { + super(card); + } + + @Override + public Blustersquall copy() { + return new Blustersquall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Bonehoard.java b/Mage.Sets/src/mage/sets/commander2015/Bonehoard.java new file mode 100644 index 00000000000..1594dc38220 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Bonehoard.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Bonehoard extends mage.sets.mirrodinbesieged.Bonehoard { + + public Bonehoard(UUID ownerId) { + super(ownerId); + this.cardNumber = 245; + this.expansionSetCode = "C15"; + } + + public Bonehoard(final Bonehoard card) { + super(card); + } + + @Override + public Bonehoard copy() { + return new Bonehoard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BorderlandBehemoth.java b/Mage.Sets/src/mage/sets/commander2015/BorderlandBehemoth.java new file mode 100644 index 00000000000..dc851589646 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BorderlandBehemoth.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.PermanentIdPredicate; + +/** + * + * @author fireshoes + */ +public class BorderlandBehemoth extends CardImpl { + + public BorderlandBehemoth(UUID ownerId) { + super(ownerId, 142, "Borderland Behemoth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}{R}"); + this.expansionSetCode = "C15"; + this.subtype.add("Giant"); + this.subtype.add("Warrior"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Borderland Behemoth gets +4/+4 for each other Giant you control. + FilterCreaturePermanent filter = new FilterCreaturePermanent("other Giant you control"); + filter.add(new SubtypePredicate("Giant")); + filter.add(Predicates.not(new PermanentIdPredicate(this.getId()))); + filter.add(new ControllerPredicate(TargetController.YOU)); + DynamicValue xValue = new PermanentsOnBattlefieldCount(filter, 4); + Effect effect = new BoostSourceEffect(xValue, xValue, Duration.WhileOnBattlefield, false); + effect.setText("{this} gets +4/+4 for each other Giant you control"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public BorderlandBehemoth(final BorderlandBehemoth card) { + super(card); + } + + @Override + public BorderlandBehemoth copy() { + return new BorderlandBehemoth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BorosCluestone.java b/Mage.Sets/src/mage/sets/commander2015/BorosCluestone.java new file mode 100644 index 00000000000..c6b00359f38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BorosCluestone.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BorosCluestone extends mage.sets.dragonsmaze.BorosCluestone { + + public BorosCluestone(UUID ownerId) { + super(ownerId); + this.cardNumber = 246; + this.expansionSetCode = "C15"; + } + + public BorosCluestone(final BorosCluestone card) { + super(card); + } + + @Override + public BorosCluestone copy() { + return new BorosCluestone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BorosGarrison.java b/Mage.Sets/src/mage/sets/commander2015/BorosGarrison.java new file mode 100644 index 00000000000..4228b3b0c76 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BorosGarrison.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BorosGarrison extends mage.sets.planechase.BorosGarrison { + + public BorosGarrison(UUID ownerId) { + super(ownerId); + this.cardNumber = 279; + this.expansionSetCode = "C15"; + } + + public BorosGarrison(final BorosGarrison card) { + super(card); + } + + @Override + public BorosGarrison copy() { + return new BorosGarrison(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BorosGuildgate.java b/Mage.Sets/src/mage/sets/commander2015/BorosGuildgate.java new file mode 100644 index 00000000000..e0358daa1e3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BorosGuildgate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BorosGuildgate extends mage.sets.gatecrash.BorosGuildgate { + + public BorosGuildgate(UUID ownerId) { + super(ownerId); + this.cardNumber = 280; + this.expansionSetCode = "C15"; + } + + public BorosGuildgate(final BorosGuildgate card) { + super(card); + } + + @Override + public BorosGuildgate copy() { + return new BorosGuildgate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BorosSignet.java b/Mage.Sets/src/mage/sets/commander2015/BorosSignet.java new file mode 100644 index 00000000000..c5ff28ea13d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BorosSignet.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BorosSignet extends mage.sets.ravnica.BorosSignet { + + public BorosSignet(UUID ownerId) { + super(ownerId); + this.cardNumber = 247; + this.expansionSetCode = "C15"; + } + + public BorosSignet(final BorosSignet card) { + super(card); + } + + @Override + public BorosSignet copy() { + return new BorosSignet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Brainstorm.java b/Mage.Sets/src/mage/sets/commander2015/Brainstorm.java new file mode 100644 index 00000000000..d7eed4c41d6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Brainstorm.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Brainstorm extends mage.sets.fifthedition.Brainstorm { + + public Brainstorm(UUID ownerId) { + super(ownerId); + this.cardNumber = 90; + this.expansionSetCode = "C15"; + } + + public Brainstorm(final Brainstorm card) { + super(card); + } + + @Override + public Brainstorm copy() { + return new Brainstorm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BreathOfDarigaaz.java b/Mage.Sets/src/mage/sets/commander2015/BreathOfDarigaaz.java new file mode 100644 index 00000000000..004bec7ae2c --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BreathOfDarigaaz.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BreathOfDarigaaz extends mage.sets.commander.BreathOfDarigaaz { + + public BreathOfDarigaaz(UUID ownerId) { + super(ownerId); + this.cardNumber = 143; + this.expansionSetCode = "C15"; + } + + public BreathOfDarigaaz(final BreathOfDarigaaz card) { + super(card); + } + + @Override + public BreathOfDarigaaz copy() { + return new BreathOfDarigaaz(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BroodbirthViper.java b/Mage.Sets/src/mage/sets/commander2015/BroodbirthViper.java new file mode 100644 index 00000000000..4f4c3d16d12 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BroodbirthViper.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.MyriadAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class BroodbirthViper extends CardImpl { + + public BroodbirthViper(UUID ownerId) { + super(ownerId, 10, "Broodbirth Viper", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "C15"; + this.subtype.add("Snake"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Myriad + this.addAbility(new MyriadAbility()); + // Whenever Broodbirth Viper deals combat damage to a player, you may draw a card. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1), true, false)); + } + + public BroodbirthViper(final BroodbirthViper card) { + super(card); + } + + @Override + public BroodbirthViper copy() { + return new BroodbirthViper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/BurnishedHart.java b/Mage.Sets/src/mage/sets/commander2015/BurnishedHart.java new file mode 100644 index 00000000000..37d613e3eca --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/BurnishedHart.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BurnishedHart extends mage.sets.theros.BurnishedHart { + + public BurnishedHart(UUID ownerId) { + super(ownerId); + this.cardNumber = 248; + this.expansionSetCode = "C15"; + } + + public BurnishedHart(final BurnishedHart card) { + super(card); + } + + @Override + public BurnishedHart copy() { + return new BurnishedHart(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ButcherOfMalakir.java b/Mage.Sets/src/mage/sets/commander2015/ButcherOfMalakir.java new file mode 100644 index 00000000000..cc13809840e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ButcherOfMalakir.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ButcherOfMalakir extends mage.sets.worldwake.ButcherOfMalakir { + + public ButcherOfMalakir(UUID ownerId) { + super(ownerId); + this.cardNumber = 118; + this.expansionSetCode = "C15"; + } + + public ButcherOfMalakir(final ButcherOfMalakir card) { + super(card); + } + + @Override + public ButcherOfMalakir copy() { + return new ButcherOfMalakir(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CageOfHands.java b/Mage.Sets/src/mage/sets/commander2015/CageOfHands.java new file mode 100644 index 00000000000..b66d7722b73 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CageOfHands.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CageOfHands extends mage.sets.championsofkamigawa.CageOfHands { + + public CageOfHands(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "C15"; + } + + public CageOfHands(final CageOfHands card) { + super(card); + } + + @Override + public CageOfHands copy() { + return new CageOfHands(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CallTheSkybreaker.java b/Mage.Sets/src/mage/sets/commander2015/CallTheSkybreaker.java new file mode 100644 index 00000000000..6fc69f0e5aa --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CallTheSkybreaker.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CallTheSkybreaker extends mage.sets.commander.CallTheSkybreaker { + + public CallTheSkybreaker(UUID ownerId) { + super(ownerId); + this.cardNumber = 240; + this.expansionSetCode = "C15"; + } + + public CallTheSkybreaker(final CallTheSkybreaker card) { + super(card); + } + + @Override + public CallTheSkybreaker copy() { + return new CallTheSkybreaker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CallerOfTheClaw.java b/Mage.Sets/src/mage/sets/commander2015/CallerOfTheClaw.java new file mode 100644 index 00000000000..00e1be423a7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CallerOfTheClaw.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CallerOfTheClaw extends mage.sets.legions.CallerOfTheClaw { + + public CallerOfTheClaw(UUID ownerId) { + super(ownerId); + this.cardNumber = 177; + this.expansionSetCode = "C15"; + } + + public CallerOfTheClaw(final CallerOfTheClaw card) { + super(card); + } + + @Override + public CallerOfTheClaw copy() { + return new CallerOfTheClaw(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CallerOfThePack.java b/Mage.Sets/src/mage/sets/commander2015/CallerOfThePack.java new file mode 100644 index 00000000000..c3d55334a4a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CallerOfThePack.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.MyriadAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class CallerOfThePack extends CardImpl { + + public CallerOfThePack(UUID ownerId) { + super(ownerId, 34, "Caller of the Pack", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{G}{G}"); + this.expansionSetCode = "C15"; + this.subtype.add("Beast"); + this.power = new MageInt(8); + this.toughness = new MageInt(6); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Myriad (Whenever this creature attacks, for each opponent other than the defending player, put a token that's a copy of this creature onto the battlefield tapped and attacking that player or a planeswalker he or she controls. Exile those tokens at the end of combat.) + this.addAbility(new MyriadAbility()); + + } + + public CallerOfThePack(final CallerOfThePack card) { + super(card); + } + + @Override + public CallerOfThePack copy() { + return new CallerOfThePack(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CelestialAncient.java b/Mage.Sets/src/mage/sets/commander2015/CelestialAncient.java new file mode 100644 index 00000000000..0d4a44192b2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CelestialAncient.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CelestialAncient extends mage.sets.dissension.CelestialAncient { + + public CelestialAncient(UUID ownerId) { + super(ownerId); + this.cardNumber = 63; + this.expansionSetCode = "C15"; + } + + public CelestialAncient(final CelestialAncient card) { + super(card); + } + + @Override + public CelestialAncient copy() { + return new CelestialAncient(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CelestialArchon.java b/Mage.Sets/src/mage/sets/commander2015/CelestialArchon.java new file mode 100644 index 00000000000..efc1c6bcef5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CelestialArchon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CelestialArchon extends mage.sets.theros.CelestialArchon { + + public CelestialArchon(UUID ownerId) { + super(ownerId); + this.cardNumber = 64; + this.expansionSetCode = "C15"; + } + + public CelestialArchon(final CelestialArchon card) { + super(card); + } + + @Override + public CelestialArchon copy() { + return new CelestialArchon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CentaurVinecrasher.java b/Mage.Sets/src/mage/sets/commander2015/CentaurVinecrasher.java new file mode 100644 index 00000000000..cb5b90bf3be --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CentaurVinecrasher.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PutCardIntoGraveFromAnywhereAllTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.filter.common.FilterLandCard; + +/** + * + * @author LevelX2 + */ +public class CentaurVinecrasher extends CardImpl { + + public CentaurVinecrasher(UUID ownerId) { + super(ownerId, 35, "Centaur Vinecrasher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "C15"; + this.subtype.add("Plant"); + this.subtype.add("Centaur"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Centaur Vinecrasher enters the battlefield with a number of +1/+1 counters on it equal to the number of land cards in all graveyards. + Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new CardsInAllGraveyardsCount(new FilterLandCard()), true); + effect.setText("with a number of +1/+1 counters on it equal to the number of land cards in all graveyards"); + this.addAbility(new EntersBattlefieldAbility(effect)); + // Whenever a land card is put into a graveyard from anywhere, you may pay {G}{G}. If you do, return Centaur Vinecrasher from your graveyard to your hand. + this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility( + new DoIfCostPaid(new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl<>("{G}{G}")), + false, new FilterLandCard("a land card"), TargetController.ANY + )); + } + + public CentaurVinecrasher(final CentaurVinecrasher card) { + super(card); + } + + @Override + public CentaurVinecrasher copy() { + return new CentaurVinecrasher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ChainReaction.java b/Mage.Sets/src/mage/sets/commander2015/ChainReaction.java new file mode 100644 index 00000000000..f4a7e53e109 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ChainReaction.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ChainReaction extends mage.sets.worldwake.ChainReaction { + + public ChainReaction(UUID ownerId) { + super(ownerId); + this.cardNumber = 144; + this.expansionSetCode = "C15"; + } + + public ChainReaction(final ChainReaction card) { + super(card); + } + + @Override + public ChainReaction copy() { + return new ChainReaction(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ChameleonColossus.java b/Mage.Sets/src/mage/sets/commander2015/ChameleonColossus.java new file mode 100644 index 00000000000..93d764688fb --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ChameleonColossus.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ChameleonColossus extends mage.sets.morningtide.ChameleonColossus { + + public ChameleonColossus(UUID ownerId) { + super(ownerId); + this.cardNumber = 178; + this.expansionSetCode = "C15"; + } + + public ChameleonColossus(final ChameleonColossus card) { + super(card); + } + + @Override + public ChameleonColossus copy() { + return new ChameleonColossus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ChampionOfStraySouls.java b/Mage.Sets/src/mage/sets/commander2015/ChampionOfStraySouls.java new file mode 100644 index 00000000000..de9ca779824 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ChampionOfStraySouls.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ChampionOfStraySouls extends mage.sets.bornofthegods.ChampionOfStraySouls { + + public ChampionOfStraySouls(UUID ownerId) { + super(ownerId); + this.cardNumber = 119; + this.expansionSetCode = "C15"; + } + + public ChampionOfStraySouls(final ChampionOfStraySouls card) { + super(card); + } + + @Override + public ChampionOfStraySouls copy() { + return new ChampionOfStraySouls(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CharmbreakerDevils.java b/Mage.Sets/src/mage/sets/commander2015/CharmbreakerDevils.java new file mode 100644 index 00000000000..932ff9b7e47 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CharmbreakerDevils.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CharmbreakerDevils extends mage.sets.innistrad.CharmbreakerDevils { + + public CharmbreakerDevils(UUID ownerId) { + super(ownerId); + this.cardNumber = 145; + this.expansionSetCode = "C15"; + } + + public CharmbreakerDevils(final CharmbreakerDevils card) { + super(card); + } + + @Override + public CharmbreakerDevils copy() { + return new CharmbreakerDevils(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Cloudthresher.java b/Mage.Sets/src/mage/sets/commander2015/Cloudthresher.java new file mode 100644 index 00000000000..8cded421966 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Cloudthresher.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Cloudthresher extends mage.sets.lorwyn.Cloudthresher { + + public Cloudthresher(UUID ownerId) { + super(ownerId); + this.cardNumber = 179; + this.expansionSetCode = "C15"; + } + + public Cloudthresher(final Cloudthresher card) { + super(card); + } + + @Override + public Cloudthresher copy() { + return new Cloudthresher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CobraTrap.java b/Mage.Sets/src/mage/sets/commander2015/CobraTrap.java new file mode 100644 index 00000000000..d8a6571c1df --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CobraTrap.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CobraTrap extends mage.sets.zendikar.CobraTrap { + + public CobraTrap(UUID ownerId) { + super(ownerId); + this.cardNumber = 180; + this.expansionSetCode = "C15"; + } + + public CobraTrap(final CobraTrap card) { + super(card); + } + + @Override + public CobraTrap copy() { + return new CobraTrap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CoilingOracle.java b/Mage.Sets/src/mage/sets/commander2015/CoilingOracle.java new file mode 100644 index 00000000000..43d7eaa1642 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CoilingOracle.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CoilingOracle extends mage.sets.dissension.CoilingOracle { + + public CoilingOracle(UUID ownerId) { + super(ownerId); + this.cardNumber = 213; + this.expansionSetCode = "C15"; + } + + public CoilingOracle(final CoilingOracle card) { + super(card); + } + + @Override + public CoilingOracle copy() { + return new CoilingOracle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ColdEyedSelkie.java b/Mage.Sets/src/mage/sets/commander2015/ColdEyedSelkie.java new file mode 100644 index 00000000000..adb74c1e18e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ColdEyedSelkie.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ColdEyedSelkie extends mage.sets.eventide.ColdEyedSelkie { + + public ColdEyedSelkie(UUID ownerId) { + super(ownerId); + this.cardNumber = 241; + this.expansionSetCode = "C15"; + } + + public ColdEyedSelkie(final ColdEyedSelkie card) { + super(card); + } + + @Override + public ColdEyedSelkie copy() { + return new ColdEyedSelkie(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ColdsteelHeart.java b/Mage.Sets/src/mage/sets/commander2015/ColdsteelHeart.java new file mode 100644 index 00000000000..af66575ecae --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ColdsteelHeart.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ColdsteelHeart extends mage.sets.coldsnap.ColdsteelHeart { + + public ColdsteelHeart(UUID ownerId) { + super(ownerId); + this.cardNumber = 249; + this.expansionSetCode = "C15"; + } + + public ColdsteelHeart(final ColdsteelHeart card) { + super(card); + } + + @Override + public ColdsteelHeart copy() { + return new ColdsteelHeart(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CometStorm.java b/Mage.Sets/src/mage/sets/commander2015/CometStorm.java new file mode 100644 index 00000000000..2da821aaf9a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CometStorm.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CometStorm extends mage.sets.worldwake.CometStorm { + + public CometStorm(UUID ownerId) { + super(ownerId); + this.cardNumber = 146; + this.expansionSetCode = "C15"; + } + + public CometStorm(final CometStorm card) { + super(card); + } + + @Override + public CometStorm copy() { + return new CometStorm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CommandBeacon.java b/Mage.Sets/src/mage/sets/commander2015/CommandBeacon.java new file mode 100644 index 00000000000..9d7004c9e3b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CommandBeacon.java @@ -0,0 +1,102 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author emerald000 + */ +public class CommandBeacon extends CardImpl { + + public CommandBeacon(UUID ownerId) { + super(ownerId, 56, "Command Beacon", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "C15"; + + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + // {T}, Sacrifice Command Beacon: Put your commander into your hand from the command zone. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CommandBeaconEffect(), new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public CommandBeacon(final CommandBeacon card) { + super(card); + } + + @Override + public CommandBeacon copy() { + return new CommandBeacon(this); + } +} + +class CommandBeaconEffect extends OneShotEffect { + + CommandBeaconEffect() { + super(Outcome.ReturnToHand); + this.staticText = "Put your commander into your hand from the command zone"; + } + + CommandBeaconEffect(final CommandBeaconEffect effect) { + super(effect); + } + + @Override + public CommandBeaconEffect copy() { + return new CommandBeaconEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Card commander = game.getCard(controller.getCommanderId()); + if (commander != null && game.getState().getZone(commander.getId()) == Zone.COMMAND) { + controller.moveCards(commander, Zone.HAND, source, game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CommandTower.java b/Mage.Sets/src/mage/sets/commander2015/CommandTower.java new file mode 100644 index 00000000000..c49aab943d5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CommandTower.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CommandTower extends mage.sets.commander2013.CommandTower { + + public CommandTower(UUID ownerId) { + super(ownerId); + this.cardNumber = 281; + this.expansionSetCode = "C15"; + } + + public CommandTower(final CommandTower card) { + super(card); + } + + @Override + public CommandTower copy() { + return new CommandTower(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CorpseAugur.java b/Mage.Sets/src/mage/sets/commander2015/CorpseAugur.java new file mode 100644 index 00000000000..28a05b4c32f --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CorpseAugur.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.dynamicvalue.common.CardsInTargetPlayersGraveyardCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class CorpseAugur extends CardImpl { + + public CorpseAugur(UUID ownerId) { + super(ownerId, 17, "Corpse Augur", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "C15"; + this.subtype.add("Zombie"); + this.subtype.add("Wizard"); + this.power = new MageInt(4); + this.toughness = new MageInt(2); + + // When Corpse Augur dies, you draw X cards and you lose X life, where X is the number of creature cards in target player's graveyard. + Effect effect = new DrawCardSourceControllerEffect(new CardsInTargetPlayersGraveyardCount()); + effect.setText("You draw X cards"); + Ability ability = new DiesTriggeredAbility(effect, false); + effect = new LoseLifeSourceControllerEffect(new CardsInTargetPlayersGraveyardCount()); + effect.setText("and you lose X life, where X is the number of creature cards in target player's graveyard"); + ability.addEffect(effect); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public CorpseAugur(final CorpseAugur card) { + super(card); + } + + @Override + public CorpseAugur copy() { + return new CorpseAugur(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Counterflux.java b/Mage.Sets/src/mage/sets/commander2015/Counterflux.java new file mode 100644 index 00000000000..97bb07599db --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Counterflux.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Counterflux extends mage.sets.returntoravnica.Counterflux { + + public Counterflux(UUID ownerId) { + super(ownerId); + this.cardNumber = 214; + this.expansionSetCode = "C15"; + } + + public Counterflux(final Counterflux card) { + super(card); + } + + @Override + public Counterflux copy() { + return new Counterflux(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CribSwap.java b/Mage.Sets/src/mage/sets/commander2015/CribSwap.java new file mode 100644 index 00000000000..6a8f7f533af --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CribSwap.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CribSwap extends mage.sets.lorwyn.CribSwap { + + public CribSwap(UUID ownerId) { + super(ownerId); + this.cardNumber = 65; + this.expansionSetCode = "C15"; + } + + public CribSwap(final CribSwap card) { + super(card); + } + + @Override + public CribSwap copy() { + return new CribSwap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CrystalChimes.java b/Mage.Sets/src/mage/sets/commander2015/CrystalChimes.java new file mode 100644 index 00000000000..8de0ce6f940 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CrystalChimes.java @@ -0,0 +1,98 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterEnchantmentCard; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class CrystalChimes extends CardImpl { + + public CrystalChimes(UUID ownerId) { + super(ownerId, 250, "Crystal Chimes", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "C15"; + + // {3}, {tap}, Sacrifice Crystal Chimes: Return all enchantment cards from your graveyard to your hand. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CrystalChimesEffect(), new GenericManaCost(3)); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public CrystalChimes(final CrystalChimes card) { + super(card); + } + + @Override + public CrystalChimes copy() { + return new CrystalChimes(this); + } +} + +class CrystalChimesEffect extends OneShotEffect { + + CrystalChimesEffect() { + super(Outcome.PutCardInPlay); + this.staticText = "Return all enchantment cards from your graveyard to your hand"; + } + + CrystalChimesEffect(final CrystalChimesEffect effect) { + super(effect); + } + + @Override + public CrystalChimesEffect copy() { + return new CrystalChimesEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + return controller.moveCards(controller.getGraveyard().getCards(new FilterEnchantmentCard(), source.getSourceId(), + source.getControllerId(), game), Zone.HAND, source, game); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/CurseOfTheNightlyHunt.java b/Mage.Sets/src/mage/sets/commander2015/CurseOfTheNightlyHunt.java new file mode 100644 index 00000000000..51092b5411b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/CurseOfTheNightlyHunt.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CurseOfTheNightlyHunt extends mage.sets.innistrad.CurseOfTheNightlyHunt { + + public CurseOfTheNightlyHunt(UUID ownerId) { + super(ownerId); + this.cardNumber = 147; + this.expansionSetCode = "C15"; + } + + public CurseOfTheNightlyHunt(final CurseOfTheNightlyHunt card) { + super(card); + } + + @Override + public CurseOfTheNightlyHunt copy() { + return new CurseOfTheNightlyHunt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DarksteelIngot.java b/Mage.Sets/src/mage/sets/commander2015/DarksteelIngot.java new file mode 100644 index 00000000000..02be9f3a793 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DarksteelIngot.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class DarksteelIngot extends mage.sets.darksteel.DarksteelIngot { + + public DarksteelIngot(UUID ownerId) { + super(ownerId); + this.cardNumber = 251; + this.expansionSetCode = "C15"; + this.rarity = Rarity.UNCOMMON; + } + + public DarksteelIngot(final DarksteelIngot card) { + super(card); + } + + @Override + public DarksteelIngot copy() { + return new DarksteelIngot(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DawnToDusk.java b/Mage.Sets/src/mage/sets/commander2015/DawnToDusk.java new file mode 100644 index 00000000000..49ebac93230 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DawnToDusk.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DawnToDusk extends mage.sets.bornofthegods.DawnToDusk { + + public DawnToDusk(UUID ownerId) { + super(ownerId); + this.cardNumber = 66; + this.expansionSetCode = "C15"; + } + + public DawnToDusk(final DawnToDusk card) { + super(card); + } + + @Override + public DawnToDusk copy() { + return new DawnToDusk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DawnbreakReclaimer.java b/Mage.Sets/src/mage/sets/commander2015/DawnbreakReclaimer.java new file mode 100644 index 00000000000..6e47df60283 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DawnbreakReclaimer.java @@ -0,0 +1,135 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.other.OwnerIdPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetCardInOpponentsGraveyard; +import mage.util.MessageToClient; + +/** + * + * @author LevelX2 + */ +public class DawnbreakReclaimer extends CardImpl { + + public DawnbreakReclaimer(UUID ownerId) { + super(ownerId, 2, "Dawnbreak Reclaimer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + this.expansionSetCode = "C15"; + this.subtype.add("Angel"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // At the beginning of your end step, choose a creature card in an opponent's graveyard, then that player chooses a creature card in your graveyard. + // You may return those cards to the battlefield under their owners' control. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new DawnbreakReclaimerEffect(), TargetController.YOU, false)); + } + + public DawnbreakReclaimer(final DawnbreakReclaimer card) { + super(card); + } + + @Override + public DawnbreakReclaimer copy() { + return new DawnbreakReclaimer(this); + } +} + +class DawnbreakReclaimerEffect extends OneShotEffect { + + public DawnbreakReclaimerEffect() { + super(Outcome.Detriment); + this.staticText = "choose a creature card in an opponent's graveyard, then that player chooses a creature card in your graveyard. You may return those cards to the battlefield under their owners' control"; + } + + public DawnbreakReclaimerEffect(final DawnbreakReclaimerEffect effect) { + super(effect); + } + + @Override + public DawnbreakReclaimerEffect copy() { + return new DawnbreakReclaimerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + TargetCardInOpponentsGraveyard targetCreature = new TargetCardInOpponentsGraveyard(new FilterCreatureCard("a creature card in an opponent's graveyard")); + if (controller.choose(Outcome.Detriment, targetCreature, source.getSourceId(), game)) { + Card creatureCard = game.getCard(targetCreature.getFirstTarget()); + Player opponent = game.getPlayer(creatureCard.getOwnerId()); + if (opponent != null) { + game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " has chosen " + creatureCard.getIdName() + " of " + opponent.getLogName()); + FilterCreatureCard filter = new FilterCreatureCard("a creature card in " + controller.getName() + "'s the graveyard"); + filter.add(new OwnerIdPredicate(controller.getId())); + TargetCardInGraveyard targetCard = new TargetCardInGraveyard(filter); + targetCard.setNotTarget(true); + if (opponent.choose(outcome, targetCard, source.getSourceId(), game)) { + Card controllerCreatureCard = game.getCard(targetCard.getFirstTarget()); + if (controllerCreatureCard != null) { + MessageToClient message = new MessageToClient("Return those cards to the battlefield under their owners' control?", + "Opponent's creature card: " + creatureCard.getLogName() + " - Your creature: " + controllerCreatureCard.getLogName()); + if (controller.chooseUse(outcome, message, source, game)) { + Set cards = new HashSet<>(); + cards.add(creatureCard); + cards.add(controllerCreatureCard); + opponent.moveCards(cards, Zone.BATTLEFIELD, source, game, false, false, true, null); + } + } + } + } + } + return true; + } + return false; + + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DawnglareInvoker.java b/Mage.Sets/src/mage/sets/commander2015/DawnglareInvoker.java new file mode 100644 index 00000000000..9fbb403666b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DawnglareInvoker.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DawnglareInvoker extends mage.sets.riseoftheeldrazi.DawnglareInvoker { + + public DawnglareInvoker(UUID ownerId) { + super(ownerId); + this.cardNumber = 67; + this.expansionSetCode = "C15"; + } + + public DawnglareInvoker(final DawnglareInvoker card) { + super(card); + } + + @Override + public DawnglareInvoker copy() { + return new DawnglareInvoker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DaxosTheReturned.java b/Mage.Sets/src/mage/sets/commander2015/DaxosTheReturned.java new file mode 100644 index 00000000000..f0909282109 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DaxosTheReturned.java @@ -0,0 +1,147 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.counter.AddCountersControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.Token; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class DaxosTheReturned extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("an enchantment spell"); + static { + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); + } + + public DaxosTheReturned(UUID ownerId) { + super(ownerId, 43, "Daxos the Returned", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{W}{B}"); + this.expansionSetCode = "C15"; + this.supertype.add("Legendary"); + this.subtype.add("Zombie"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever you cast an enchantment spell, you get an experience counter. + Effect effect = new AddCountersControllerEffect(CounterType.EXPERIENCE.createInstance(1), false); + effect.setText("you get an experience counter"); + Ability ability = new SpellCastControllerTriggeredAbility(effect, filter, false); + this.addAbility(ability); + + // {1}{W}{B}: Put a white and black Spirit enchantment creature token onto the battlefield. It has + // "This creature's power and toughness are each equal to the number of experience counters you have." + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new DaxosSpiritToken(), 1), new ManaCostsImpl("{1}{W}{B}"))); + } + + public DaxosTheReturned(final DaxosTheReturned card) { + super(card); + } + + @Override + public DaxosTheReturned copy() { + return new DaxosTheReturned(this); + } +} + + +class DaxosSpiritToken extends Token { + DaxosSpiritToken() { + super("Spirit", "white and black Spirit enchantment creature token with \"This creature's power and toughness are each equal to the number of experience counters you have.\""); + this.setOriginalExpansionSetCode("C15"); + cardType.add(CardType.CREATURE); + cardType.add(CardType.ENCHANTMENT); + color.setWhite(true); + color.setBlack(true); + subtype.add("Spirit"); + power = new MageInt(0); + toughness = new MageInt(0); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DaxosSpiritSetPTEffect())); + } +} + +class DaxosSpiritSetPTEffect extends ContinuousEffectImpl { + + public DaxosSpiritSetPTEffect() { + super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); + staticText = "This creature's power and toughness are each equal to the number of experience counters you have"; + } + + public DaxosSpiritSetPTEffect(final DaxosSpiritSetPTEffect effect) { + super(effect); + } + + @Override + public DaxosSpiritSetPTEffect copy() { + return new DaxosSpiritSetPTEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null && new MageObjectReference(source.getSourceObject(game), game).refersTo(permanent, game)) { + int amount = controller.getCounters().getCount(CounterType.EXPERIENCE); + permanent.getPower().setValue(amount); + permanent.getToughness().setValue(amount); + return true; + } else { + discard(); + } + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/commander2015/DaxossTorment.java b/Mage.Sets/src/mage/sets/commander2015/DaxossTorment.java new file mode 100644 index 00000000000..1ef4d5f4059 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DaxossTorment.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.abilityword.ConstellationAbility; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.permanent.token.Token; + +/** + * + * @author fireshoes + */ +public class DaxossTorment extends CardImpl { + + public DaxossTorment(UUID ownerId) { + super(ownerId, 18, "Daxos's Torment", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}"); + this.expansionSetCode = "C15"; + + // Constellation - Whenever Daxos's Torment or another enchantment enters the battlefield under your control, Daxos's Torment becomes a 5/5 Demon creature with flying and haste until end of turn in addition to its other types. + this.addAbility(new ConstellationAbility(new BecomesCreatureSourceEffect(new DaxossTormentToken(), "", Duration.EndOfTurn))); + } + + public DaxossTorment(final DaxossTorment card) { + super(card); + } + + @Override + public DaxossTorment copy() { + return new DaxossTorment(this); + } +} + +class DaxossTormentToken extends Token { + + public DaxossTormentToken() { + super("", "a 5/5 Demon creature with flying and haste"); + cardType.add(CardType.CREATURE); + + subtype.add("Demon"); + power = new MageInt(5); + toughness = new MageInt(5); + addAbility(FlyingAbility.getInstance()); + addAbility(HasteAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DayOfTheDragons.java b/Mage.Sets/src/mage/sets/commander2015/DayOfTheDragons.java new file mode 100644 index 00000000000..8e29a7a39d3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DayOfTheDragons.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DayOfTheDragons extends mage.sets.scourge.DayOfTheDragons { + + public DayOfTheDragons(UUID ownerId) { + super(ownerId); + this.cardNumber = 91; + this.expansionSetCode = "C15"; + } + + public DayOfTheDragons(final DayOfTheDragons card) { + super(card); + } + + @Override + public DayOfTheDragons copy() { + return new DayOfTheDragons(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DeadlyTempest.java b/Mage.Sets/src/mage/sets/commander2015/DeadlyTempest.java new file mode 100644 index 00000000000..7af864bd0f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DeadlyTempest.java @@ -0,0 +1,107 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.HashMap; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class DeadlyTempest extends CardImpl { + + public DeadlyTempest(UUID ownerId) { + super(ownerId, 19, "Deadly Tempest", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}{B}"); + this.expansionSetCode = "C15"; + + // Destroy all creatures. Each player loses life equal to the number of creatures he or she controlled that were destroyed this way. + getSpellAbility().addEffect(new DeadlyTempestEffect()); + } + + public DeadlyTempest(final DeadlyTempest card) { + super(card); + } + + @Override + public DeadlyTempest copy() { + return new DeadlyTempest(this); + } +} + +class DeadlyTempestEffect extends OneShotEffect { + + public DeadlyTempestEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Destroy all creatures. Each player loses life equal to the number of creatures he or she controlled that were destroyed this way"; + } + + public DeadlyTempestEffect(final DeadlyTempestEffect effect) { + super(effect); + } + + @Override + public DeadlyTempestEffect copy() { + return new DeadlyTempestEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + HashMap destroyedCreatures = new HashMap<>(); + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + if (permanent.destroy(source.getSourceId(), game, false)) { + int count = destroyedCreatures.containsKey(permanent.getControllerId()) ? destroyedCreatures.get(permanent.getControllerId()) : 0; + destroyedCreatures.put(permanent.getControllerId(), count + 1); + } + } + for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) { + int count = destroyedCreatures.containsKey(playerId) ? destroyedCreatures.get(playerId) : 0; + if (count > 0) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.damage(count, playerId, game, false, true); + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DeathGrasp.java b/Mage.Sets/src/mage/sets/commander2015/DeathGrasp.java new file mode 100644 index 00000000000..55f24816b8e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DeathGrasp.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DeathGrasp extends mage.sets.apocalypse.DeathGrasp { + + public DeathGrasp(UUID ownerId) { + super(ownerId); + this.cardNumber = 215; + this.expansionSetCode = "C15"; + } + + public DeathGrasp(final DeathGrasp card) { + super(card); + } + + @Override + public DeathGrasp copy() { + return new DeathGrasp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DesertTwister.java b/Mage.Sets/src/mage/sets/commander2015/DesertTwister.java new file mode 100644 index 00000000000..bd7d8a64ff2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DesertTwister.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DesertTwister extends mage.sets.revisededition.DesertTwister { + + public DesertTwister(UUID ownerId) { + super(ownerId); + this.cardNumber = 181; + this.expansionSetCode = "C15"; + } + + public DesertTwister(final DesertTwister card) { + super(card); + } + + @Override + public DesertTwister copy() { + return new DesertTwister(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DesolationGiant.java b/Mage.Sets/src/mage/sets/commander2015/DesolationGiant.java new file mode 100644 index 00000000000..76982a9f582 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DesolationGiant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DesolationGiant extends mage.sets.apocalypse.DesolationGiant { + + public DesolationGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 148; + this.expansionSetCode = "C15"; + } + + public DesolationGiant(final DesolationGiant card) { + super(card); + } + + @Override + public DesolationGiant copy() { + return new DesolationGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DesperateRavings.java b/Mage.Sets/src/mage/sets/commander2015/DesperateRavings.java new file mode 100644 index 00000000000..2991bbcb075 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DesperateRavings.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DesperateRavings extends mage.sets.innistrad.DesperateRavings { + + public DesperateRavings(UUID ownerId) { + super(ownerId); + this.cardNumber = 149; + this.expansionSetCode = "C15"; + } + + public DesperateRavings(final DesperateRavings card) { + super(card); + } + + @Override + public DesperateRavings copy() { + return new DesperateRavings(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DiabolicServitude.java b/Mage.Sets/src/mage/sets/commander2015/DiabolicServitude.java new file mode 100644 index 00000000000..7e226b8f4cd --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DiabolicServitude.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DiabolicServitude extends mage.sets.urzassaga.DiabolicServitude { + + public DiabolicServitude(UUID ownerId) { + super(ownerId); + this.cardNumber = 120; + this.expansionSetCode = "C15"; + } + + public DiabolicServitude(final DiabolicServitude card) { + super(card); + } + + @Override + public DiabolicServitude copy() { + return new DiabolicServitude(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DictateOfHeliod.java b/Mage.Sets/src/mage/sets/commander2015/DictateOfHeliod.java new file mode 100644 index 00000000000..e78f9123474 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DictateOfHeliod.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DictateOfHeliod extends mage.sets.journeyintonyx.DictateOfHeliod { + + public DictateOfHeliod(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "C15"; + } + + public DictateOfHeliod(final DictateOfHeliod card) { + super(card); + } + + @Override + public DictateOfHeliod copy() { + return new DictateOfHeliod(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DisasterRadius.java b/Mage.Sets/src/mage/sets/commander2015/DisasterRadius.java new file mode 100644 index 00000000000..cfb6de05ba2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DisasterRadius.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DisasterRadius extends mage.sets.riseoftheeldrazi.DisasterRadius { + + public DisasterRadius(UUID ownerId) { + super(ownerId); + this.cardNumber = 150; + this.expansionSetCode = "C15"; + } + + public DisasterRadius(final DisasterRadius card) { + super(card); + } + + @Override + public DisasterRadius copy() { + return new DisasterRadius(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Dominate.java b/Mage.Sets/src/mage/sets/commander2015/Dominate.java new file mode 100644 index 00000000000..8a6c392e218 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Dominate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Dominate extends mage.sets.nemesis.Dominate { + + public Dominate(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "C15"; + } + + public Dominate(final Dominate card) { + super(card); + } + + @Override + public Dominate copy() { + return new Dominate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DoomwakeGiant.java b/Mage.Sets/src/mage/sets/commander2015/DoomwakeGiant.java new file mode 100644 index 00000000000..e4fcc3a412c --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DoomwakeGiant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DoomwakeGiant extends mage.sets.journeyintonyx.DoomwakeGiant { + + public DoomwakeGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 121; + this.expansionSetCode = "C15"; + } + + public DoomwakeGiant(final DoomwakeGiant card) { + super(card); + } + + @Override + public DoomwakeGiant copy() { + return new DoomwakeGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DragonMage.java b/Mage.Sets/src/mage/sets/commander2015/DragonMage.java new file mode 100644 index 00000000000..985eeb5a07a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DragonMage.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DragonMage extends mage.sets.scourge.DragonMage { + + public DragonMage(UUID ownerId) { + super(ownerId); + this.cardNumber = 151; + this.expansionSetCode = "C15"; + } + + public DragonMage(final DragonMage card) { + super(card); + } + + @Override + public DragonMage copy() { + return new DragonMage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DreadSummons.java b/Mage.Sets/src/mage/sets/commander2015/DreadSummons.java new file mode 100644 index 00000000000..4f2b645a370 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DreadSummons.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.token.ZombieToken; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class DreadSummons extends CardImpl { + + public DreadSummons(UUID ownerId) { + super(ownerId, 20, "Dread Summons", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{B}{B}"); + this.expansionSetCode = "C15"; + + // Each player puts the top X cards of his or her library into his or her graveyard. For each creature card put into a graveyard this way, you put a 2/2 black Zombie creature token onto the battlefield tapped. + getSpellAbility().addEffect(new DreadSummonsEffect()); + } + + public DreadSummons(final DreadSummons card) { + super(card); + } + + @Override + public DreadSummons copy() { + return new DreadSummons(this); + } +} + +class DreadSummonsEffect extends OneShotEffect { + + public DreadSummonsEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "Each player puts the top X cards of his or her library into his or her graveyard. For each creature card put into a graveyard this way, you put a 2/2 black Zombie creature token onto the battlefield tapped"; + } + + public DreadSummonsEffect(final DreadSummonsEffect effect) { + super(effect); + } + + @Override + public DreadSummonsEffect copy() { + return new DreadSummonsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int numberOfCards = source.getManaCostsToPay().getX(); + if (numberOfCards > 0) { + int numberOfCreatureCards = 0; + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + Set movedCards = player.moveCardsToGraveyardWithInfo(player.getLibrary().getTopCards(game, numberOfCards), source, game, Zone.LIBRARY); + for (Card card : movedCards) { + if (card.getCardType().contains(CardType.CREATURE)) { + numberOfCreatureCards++; + } + } + } + } + if (numberOfCreatureCards > 0) { + return new CreateTokenEffect(new ZombieToken(), numberOfCreatureCards, true, false).apply(game, source); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DreadbringerLampads.java b/Mage.Sets/src/mage/sets/commander2015/DreadbringerLampads.java new file mode 100644 index 00000000000..40bd277c596 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DreadbringerLampads.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DreadbringerLampads extends mage.sets.journeyintonyx.DreadbringerLampads { + + public DreadbringerLampads(UUID ownerId) { + super(ownerId); + this.cardNumber = 122; + this.expansionSetCode = "C15"; + } + + public DreadbringerLampads(final DreadbringerLampads card) { + super(card); + } + + @Override + public DreadbringerLampads copy() { + return new DreadbringerLampads(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DreamPillager.java b/Mage.Sets/src/mage/sets/commander2015/DreamPillager.java new file mode 100644 index 00000000000..e3845f46a27 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DreamPillager.java @@ -0,0 +1,190 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.Set; +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.DamagedPlayerEvent; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class DreamPillager extends CardImpl { + + public DreamPillager(UUID ownerId) { + super(ownerId, 25, "Dream Pillager", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}{R}"); + this.expansionSetCode = "C15"; + this.subtype.add("Dragon"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Whenever Dream Pillager deals combat damage to a player, exile that many cards from the top of your library. Until end of turn, you may cast nonland cards exiled this way. + this.addAbility(new DreamPillagerTriggeredAbility()); + } + + public DreamPillager(final DreamPillager card) { + super(card); + } + + @Override + public DreamPillager copy() { + return new DreamPillager(this); + } +} + +class DreamPillagerTriggeredAbility extends TriggeredAbilityImpl { + + public DreamPillagerTriggeredAbility() { + super(Zone.BATTLEFIELD, new DreamPillagerEffect(), false); + } + + public DreamPillagerTriggeredAbility(final DreamPillagerTriggeredAbility ability) { + super(ability); + } + + @Override + public DreamPillagerTriggeredAbility copy() { + return new DreamPillagerTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) { + for (Effect effect : getEffects()) { + effect.setValue("damage", event.getAmount()); + } + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} deals combat damage to a player, exile that many cards from the top of your library. Until end of turn, you may cast nonland cards exiled this way."; + } +} + +class DreamPillagerEffect extends OneShotEffect { + + public DreamPillagerEffect() { + super(Outcome.Benefit); + this.staticText = "exile that many cards from the top of your library. Until end of turn, you may cast nonland cards exiled this way"; + } + + public DreamPillagerEffect(final DreamPillagerEffect effect) { + super(effect); + } + + @Override + public DreamPillagerEffect copy() { + return new DreamPillagerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + int amount = (Integer) getValue("damage"); + if (amount > 0) { + Set cards = controller.getLibrary().getTopCards(game, amount); + if (!cards.isEmpty()) { + controller.moveCards(cards, Zone.EXILED, source, game); + for (Card card : cards) { + if (!card.getCardType().contains(CardType.LAND)) { + ContinuousEffect effect = new DreamPillagerCastFromExileEffect(); + effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); + game.addEffect(effect, source); + } + } + } + return true; + } + return true; + } + return false; + } +} + +class DreamPillagerCastFromExileEffect extends AsThoughEffectImpl { + + public DreamPillagerCastFromExileEffect() { + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + staticText = "You may play the card from exile"; + } + + public DreamPillagerCastFromExileEffect(final DreamPillagerCastFromExileEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public DreamPillagerCastFromExileEffect copy() { + return new DreamPillagerCastFromExileEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + return source.getControllerId().equals(affectedControllerId) + && objectId.equals(getTargetPointer().getFirst(game, source)); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DreamstoneHedron.java b/Mage.Sets/src/mage/sets/commander2015/DreamstoneHedron.java new file mode 100644 index 00000000000..75d8d6a1a21 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DreamstoneHedron.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DreamstoneHedron extends mage.sets.riseoftheeldrazi.DreamstoneHedron { + + public DreamstoneHedron(UUID ownerId) { + super(ownerId); + this.cardNumber = 252; + this.expansionSetCode = "C15"; + } + + public DreamstoneHedron(final DreamstoneHedron card) { + super(card); + } + + @Override + public DreamstoneHedron copy() { + return new DreamstoneHedron(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/DriftingMeadow.java b/Mage.Sets/src/mage/sets/commander2015/DriftingMeadow.java new file mode 100644 index 00000000000..3f456bfd3bd --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/DriftingMeadow.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DriftingMeadow extends mage.sets.urzassaga.DriftingMeadow { + + public DriftingMeadow(UUID ownerId) { + super(ownerId); + this.cardNumber = 282; + this.expansionSetCode = "C15"; + } + + public DriftingMeadow(final DriftingMeadow card) { + super(card); + } + + @Override + public DriftingMeadow copy() { + return new DriftingMeadow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Earthquake.java b/Mage.Sets/src/mage/sets/commander2015/Earthquake.java new file mode 100644 index 00000000000..bb54ec42ef4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Earthquake.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Earthquake extends mage.sets.magic2010.Earthquake { + + public Earthquake(UUID ownerId) { + super(ownerId); + this.cardNumber = 152; + this.expansionSetCode = "C15"; + } + + public Earthquake(final Earthquake card) { + super(card); + } + + @Override + public Earthquake copy() { + return new Earthquake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/EaterOfHope.java b/Mage.Sets/src/mage/sets/commander2015/EaterOfHope.java new file mode 100644 index 00000000000..b044d9823fc --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/EaterOfHope.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EaterOfHope extends mage.sets.bornofthegods.EaterOfHope { + + public EaterOfHope(UUID ownerId) { + super(ownerId); + this.cardNumber = 123; + this.expansionSetCode = "C15"; + } + + public EaterOfHope(final EaterOfHope card) { + super(card); + } + + @Override + public EaterOfHope copy() { + return new EaterOfHope(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/EchoingTruth.java b/Mage.Sets/src/mage/sets/commander2015/EchoingTruth.java new file mode 100644 index 00000000000..db0fe308b0d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/EchoingTruth.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EchoingTruth extends mage.sets.elspethvstezzeret.EchoingTruth { + + public EchoingTruth(UUID ownerId) { + super(ownerId); + this.cardNumber = 93; + this.expansionSetCode = "C15"; + } + + public EchoingTruth(final EchoingTruth card) { + super(card); + } + + @Override + public EchoingTruth copy() { + return new EchoingTruth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/EldraziMonument.java b/Mage.Sets/src/mage/sets/commander2015/EldraziMonument.java new file mode 100644 index 00000000000..ade27871472 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/EldraziMonument.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EldraziMonument extends mage.sets.zendikar.EldraziMonument { + + public EldraziMonument(UUID ownerId) { + super(ownerId); + this.cardNumber = 253; + this.expansionSetCode = "C15"; + } + + public EldraziMonument(final EldraziMonument card) { + super(card); + } + + @Override + public EldraziMonument copy() { + return new EldraziMonument(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ElvishVisionary.java b/Mage.Sets/src/mage/sets/commander2015/ElvishVisionary.java new file mode 100644 index 00000000000..c06da388daa --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ElvishVisionary.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ElvishVisionary extends mage.sets.shardsofalara.ElvishVisionary { + + public ElvishVisionary(UUID ownerId) { + super(ownerId); + this.cardNumber = 182; + this.expansionSetCode = "C15"; + } + + public ElvishVisionary(final ElvishVisionary card) { + super(card); + } + + @Override + public ElvishVisionary copy() { + return new ElvishVisionary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/EpicExperiment.java b/Mage.Sets/src/mage/sets/commander2015/EpicExperiment.java new file mode 100644 index 00000000000..dd720ca83b0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/EpicExperiment.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EpicExperiment extends mage.sets.returntoravnica.EpicExperiment { + + public EpicExperiment(UUID ownerId) { + super(ownerId); + this.cardNumber = 216; + this.expansionSetCode = "C15"; + } + + public EpicExperiment(final EpicExperiment card) { + super(card); + } + + @Override + public EpicExperiment copy() { + return new EpicExperiment(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/EternalWitness.java b/Mage.Sets/src/mage/sets/commander2015/EternalWitness.java new file mode 100644 index 00000000000..6d8b8f5065b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/EternalWitness.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EternalWitness extends mage.sets.fifthdawn.EternalWitness { + + public EternalWitness(UUID ownerId) { + super(ownerId); + this.cardNumber = 183; + this.expansionSetCode = "C15"; + } + + public EternalWitness(final EternalWitness card) { + super(card); + } + + @Override + public EternalWitness copy() { + return new EternalWitness(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/EtheriumHornSorcerer.java b/Mage.Sets/src/mage/sets/commander2015/EtheriumHornSorcerer.java new file mode 100644 index 00000000000..82017cf6a11 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/EtheriumHornSorcerer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EtheriumHornSorcerer extends mage.sets.planechase2012.EtheriumHornSorcerer { + + public EtheriumHornSorcerer(UUID ownerId) { + super(ownerId); + this.cardNumber = 217; + this.expansionSetCode = "C15"; + } + + public EtheriumHornSorcerer(final EtheriumHornSorcerer card) { + super(card); + } + + @Override + public EtheriumHornSorcerer copy() { + return new EtheriumHornSorcerer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/EvolvingWilds.java b/Mage.Sets/src/mage/sets/commander2015/EvolvingWilds.java new file mode 100644 index 00000000000..aa2e84982df --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/EvolvingWilds.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EvolvingWilds extends mage.sets.riseoftheeldrazi.EvolvingWilds { + + public EvolvingWilds(UUID ownerId) { + super(ownerId); + this.cardNumber = 283; + this.expansionSetCode = "C15"; + } + + public EvolvingWilds(final EvolvingWilds card) { + super(card); + } + + @Override + public EvolvingWilds copy() { + return new EvolvingWilds(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ExperimentOne.java b/Mage.Sets/src/mage/sets/commander2015/ExperimentOne.java new file mode 100644 index 00000000000..4f670a31e1b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ExperimentOne.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ExperimentOne extends mage.sets.gatecrash.ExperimentOne { + + public ExperimentOne(UUID ownerId) { + super(ownerId); + this.cardNumber = 184; + this.expansionSetCode = "C15"; + } + + public ExperimentOne(final ExperimentOne card) { + super(card); + } + + @Override + public ExperimentOne copy() { + return new ExperimentOne(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ExtractorDemon.java b/Mage.Sets/src/mage/sets/commander2015/ExtractorDemon.java new file mode 100644 index 00000000000..36ea2095660 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ExtractorDemon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ExtractorDemon extends mage.sets.conflux.ExtractorDemon { + + public ExtractorDemon(UUID ownerId) { + super(ownerId); + this.cardNumber = 124; + this.expansionSetCode = "C15"; + } + + public ExtractorDemon(final ExtractorDemon card) { + super(card); + } + + @Override + public ExtractorDemon copy() { + return new ExtractorDemon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/EzuriClawOfProgress.java b/Mage.Sets/src/mage/sets/commander2015/EzuriClawOfProgress.java new file mode 100644 index 00000000000..7c26e6acfa2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/EzuriClawOfProgress.java @@ -0,0 +1,127 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.AddCountersControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.Filter; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class EzuriClawOfProgress extends CardImpl { + + final private static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + final private static FilterControlledCreaturePermanent filter2 = new FilterControlledCreaturePermanent(); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, 3)); + filter2.add(new AnotherPredicate()); + } + + String rule = "Whenever a creature with power 2 or less enters the battlefield under your control, you get an experience counter."; + + public EzuriClawOfProgress(UUID ownerId) { + super(ownerId, 44, "Ezuri, Claw of Progress", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}{U}"); + this.expansionSetCode = "C15"; + this.supertype.add("Legendary"); + this.subtype.add("Elf"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever a creature with power 2 or less enters the battlefield under your control, you get an experience counter. + this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new AddCountersControllerEffect( + CounterType.EXPERIENCE.createInstance(1), false), filter, false, rule, true)); + + // At the beginning of combat on your turn, put X +1/+1 counters on another target creature you control, where X is the number of experience counters you have. + Ability ability = new BeginningOfCombatTriggeredAbility(new EzuriClawOfProgressEffect(), TargetController.YOU, false); + ability.addTarget(new TargetControlledCreaturePermanent(filter2)); + this.addAbility(ability); + } + + public EzuriClawOfProgress(final EzuriClawOfProgress card) { + super(card); + } + + @Override + public EzuriClawOfProgress copy() { + return new EzuriClawOfProgress(this); + } +} + +class EzuriClawOfProgressEffect extends OneShotEffect { + + public EzuriClawOfProgressEffect() { + super(Outcome.Benefit); + this.staticText = "put X +1/+1 counters on another target creature you control, where X is the number of experience counters you have"; + } + + public EzuriClawOfProgressEffect(final EzuriClawOfProgressEffect effect) { + super(effect); + } + + @Override + public EzuriClawOfProgressEffect copy() { + return new EzuriClawOfProgressEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent target = game.getPermanent(source.getFirstTarget()); + if (target == null) { + return false; + } + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int amount = controller.getCounters().getCount(CounterType.EXPERIENCE); + target.addCounters(CounterType.P1P1.createInstance(amount), game); + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/commander2015/EzurisPredation.java b/Mage.Sets/src/mage/sets/commander2015/EzurisPredation.java new file mode 100644 index 00000000000..3cf34bdbca4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/EzurisPredation.java @@ -0,0 +1,126 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.BeastToken2; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class EzurisPredation extends CardImpl { + + public EzurisPredation(UUID ownerId) { + super(ownerId, 36, "Ezuri's Predation", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{G}{G}{G}"); + this.expansionSetCode = "C15"; + + // For each creature your opponents control, put a 4/4 green Beast creature token onto the battlefield. Each of those Beasts fights a different one of those creatures. + this.getSpellAbility().addEffect(new EzurisPredationEffect()); + } + + public EzurisPredation(final EzurisPredation card) { + super(card); + } + + @Override + public EzurisPredation copy() { + return new EzurisPredation(this); + } +} + +class EzurisPredationEffect extends OneShotEffect { + + public EzurisPredationEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "For each creature your opponents control, put a 4/4 green Beast creature token onto the battlefield. Each of those Beasts fights a different one of those creatures"; + } + + public EzurisPredationEffect(final EzurisPredationEffect effect) { + super(effect); + } + + @Override + public EzurisPredationEffect copy() { + return new EzurisPredationEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + /* + * Players can't cast spells or activate any abilities in between the + * Beasts entering the battlefield and fighting the other creatures. + * Ifthe Beasts entering the battlefield cause any abilities to trigger, + * those abilities will be put onto the stack after Ezuri's Predation is + * finished resolving. + * You choose which Beast is fighting which creature + * an opponent controls. Each of the "fights" happens at the same time. + * If Ezuri's Predation creates more than one token for any given + * creature (due to an effect such as the one Doubling Season creates), + * the extra tokens won't fight any creature. + */ + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + FilterCreaturePermanent filterCreature = new FilterCreaturePermanent(); + filterCreature.add(new ControllerPredicate(TargetController.OPPONENT)); + List creaturesOfOpponents = game.getBattlefield().getActivePermanents(filterCreature, source.getControllerId(), source.getSourceId(), game); + if (!creaturesOfOpponents.isEmpty()) { + CreateTokenEffect effect = new CreateTokenEffect(new BeastToken2(), creaturesOfOpponents.size()); + effect.apply(game, source); + for (UUID tokenId : effect.getLastAddedTokenIds()) { + Permanent token = game.getPermanent(tokenId); + if (token != null) { + if (creaturesOfOpponents.isEmpty()) { + break; + } + Permanent opponentCreature = creaturesOfOpponents.iterator().next(); + creaturesOfOpponents.remove(opponentCreature); + token.fight(opponentCreature, source, game); + game.informPlayers(token.getLogName() + " fights " + opponentCreature.getLogName()); + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/FactOrFiction.java b/Mage.Sets/src/mage/sets/commander2015/FactOrFiction.java new file mode 100644 index 00000000000..388260e835d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/FactOrFiction.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FactOrFiction extends mage.sets.invasion.FactOrFiction { + + public FactOrFiction(UUID ownerId) { + super(ownerId); + this.cardNumber = 94; + this.expansionSetCode = "C15"; + } + + public FactOrFiction(final FactOrFiction card) { + super(card); + } + + @Override + public FactOrFiction copy() { + return new FactOrFiction(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/FaithlessLooting.java b/Mage.Sets/src/mage/sets/commander2015/FaithlessLooting.java new file mode 100644 index 00000000000..e6ca2d645d8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/FaithlessLooting.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FaithlessLooting extends mage.sets.darkascension.FaithlessLooting { + + public FaithlessLooting(UUID ownerId) { + super(ownerId); + this.cardNumber = 153; + this.expansionSetCode = "C15"; + } + + public FaithlessLooting(final FaithlessLooting card) { + super(card); + } + + @Override + public FaithlessLooting copy() { + return new FaithlessLooting(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/FaithsFetters.java b/Mage.Sets/src/mage/sets/commander2015/FaithsFetters.java new file mode 100644 index 00000000000..533bef26454 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/FaithsFetters.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FaithsFetters extends mage.sets.divinevsdemonic.FaithsFetters { + + public FaithsFetters(UUID ownerId) { + super(ownerId); + this.cardNumber = 69; + this.expansionSetCode = "C15"; + } + + public FaithsFetters(final FaithsFetters card) { + super(card); + } + + @Override + public FaithsFetters copy() { + return new FaithsFetters(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/FallOfTheHammer.java b/Mage.Sets/src/mage/sets/commander2015/FallOfTheHammer.java new file mode 100644 index 00000000000..0d1ec478b72 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/FallOfTheHammer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FallOfTheHammer extends mage.sets.bornofthegods.FallOfTheHammer { + + public FallOfTheHammer(UUID ownerId) { + super(ownerId); + this.cardNumber = 154; + this.expansionSetCode = "C15"; + } + + public FallOfTheHammer(final FallOfTheHammer card) { + super(card); + } + + @Override + public FallOfTheHammer copy() { + return new FallOfTheHammer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/FallenIdeal.java b/Mage.Sets/src/mage/sets/commander2015/FallenIdeal.java new file mode 100644 index 00000000000..e5efb44f102 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/FallenIdeal.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FallenIdeal extends mage.sets.timespiral.FallenIdeal { + + public FallenIdeal(UUID ownerId) { + super(ownerId); + this.cardNumber = 125; + this.expansionSetCode = "C15"; + } + + public FallenIdeal(final FallenIdeal card) { + super(card); + } + + @Override + public FallenIdeal copy() { + return new FallenIdeal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/FateUnraveler.java b/Mage.Sets/src/mage/sets/commander2015/FateUnraveler.java new file mode 100644 index 00000000000..f176fee9136 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/FateUnraveler.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FateUnraveler extends mage.sets.bornofthegods.FateUnraveler { + + public FateUnraveler(UUID ownerId) { + super(ownerId); + this.cardNumber = 126; + this.expansionSetCode = "C15"; + } + + public FateUnraveler(final FateUnraveler card) { + super(card); + } + + @Override + public FateUnraveler copy() { + return new FateUnraveler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/FellwarStone.java b/Mage.Sets/src/mage/sets/commander2015/FellwarStone.java new file mode 100644 index 00000000000..94c57e79de3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/FellwarStone.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FellwarStone extends mage.sets.ninthedition.FellwarStone { + + public FellwarStone(UUID ownerId) { + super(ownerId); + this.cardNumber = 254; + this.expansionSetCode = "C15"; + } + + public FellwarStone(final FellwarStone card) { + super(card); + } + + @Override + public FellwarStone copy() { + return new FellwarStone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/FieryConfluence.java b/Mage.Sets/src/mage/sets/commander2015/FieryConfluence.java new file mode 100644 index 00000000000..29491222bbc --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/FieryConfluence.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author fireshoes + */ +public class FieryConfluence extends CardImpl { + + public FieryConfluence(UUID ownerId) { + super(ownerId, 26, "Fiery Confluence", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{R}{R}"); + this.expansionSetCode = "C15"; + + // Choose three. You may choose the same mode more than once. + this.getSpellAbility().getModes().setMinModes(3); + this.getSpellAbility().getModes().setMaxModes(3); + this.getSpellAbility().getModes().setEachModeMoreThanOnce(true); + + // - Fiery Confluence deals 1 damage to each creature; + this.getSpellAbility().addEffect(new DamageAllEffect(1, new FilterCreaturePermanent())); + + // Fiery Confluence deals 2 damage to each opponent; + Mode mode = new Mode(); + mode.getEffects().add(new DamagePlayersEffect(2, TargetController.OPPONENT)); + this.getSpellAbility().getModes().addMode(mode); + + // Destroy target artifact. + mode = new Mode(); + mode.getEffects().add(new DestroyTargetEffect()); + mode.getTargets().add(new TargetArtifactPermanent()); + this.getSpellAbility().getModes().addMode(mode); + } + + public FieryConfluence(final FieryConfluence card) { + super(card); + } + + @Override + public FieryConfluence copy() { + return new FieryConfluence(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/FiremindsForesight.java b/Mage.Sets/src/mage/sets/commander2015/FiremindsForesight.java new file mode 100644 index 00000000000..4d5b379d655 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/FiremindsForesight.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FiremindsForesight extends mage.sets.returntoravnica.FiremindsForesight { + + public FiremindsForesight(UUID ownerId) { + super(ownerId); + this.cardNumber = 218; + this.expansionSetCode = "C15"; + } + + public FiremindsForesight(final FiremindsForesight card) { + super(card); + } + + @Override + public FiremindsForesight copy() { + return new FiremindsForesight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Forest1.java b/Mage.Sets/src/mage/sets/commander2015/Forest1.java new file mode 100644 index 00000000000..57e1a2f25d2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Forest1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest1 extends mage.cards.basiclands.Forest { + + public Forest1(UUID ownerId) { + super(ownerId, 339); + this.expansionSetCode = "C15"; + } + + public Forest1(final Forest1 card) { + super(card); + } + + @Override + public Forest1 copy() { + return new Forest1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Forest2.java b/Mage.Sets/src/mage/sets/commander2015/Forest2.java new file mode 100644 index 00000000000..f38f60ee4d9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Forest2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest2 extends mage.cards.basiclands.Forest { + + public Forest2(UUID ownerId) { + super(ownerId, 340); + this.expansionSetCode = "C15"; + } + + public Forest2(final Forest2 card) { + super(card); + } + + @Override + public Forest2 copy() { + return new Forest2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Forest3.java b/Mage.Sets/src/mage/sets/commander2015/Forest3.java new file mode 100644 index 00000000000..e8b284ad208 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Forest3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest3 extends mage.cards.basiclands.Forest { + + public Forest3(UUID ownerId) { + super(ownerId, 341); + this.expansionSetCode = "C15"; + } + + public Forest3(final Forest3 card) { + super(card); + } + + @Override + public Forest3 copy() { + return new Forest3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Forest4.java b/Mage.Sets/src/mage/sets/commander2015/Forest4.java new file mode 100644 index 00000000000..4ae9df6c82c --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Forest4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest4 extends mage.cards.basiclands.Forest { + + public Forest4(UUID ownerId) { + super(ownerId, 342); + this.expansionSetCode = "C15"; + } + + public Forest4(final Forest4 card) { + super(card); + } + + @Override + public Forest4 copy() { + return new Forest4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ForgottenAncient.java b/Mage.Sets/src/mage/sets/commander2015/ForgottenAncient.java new file mode 100644 index 00000000000..b056f39142b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ForgottenAncient.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ForgottenAncient extends mage.sets.scourge.ForgottenAncient { + + public ForgottenAncient(UUID ownerId) { + super(ownerId); + this.cardNumber = 185; + this.expansionSetCode = "C15"; + } + + public ForgottenAncient(final ForgottenAncient card) { + super(card); + } + + @Override + public ForgottenAncient copy() { + return new ForgottenAncient(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ForgottenCave.java b/Mage.Sets/src/mage/sets/commander2015/ForgottenCave.java new file mode 100644 index 00000000000..4fd1f75ed06 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ForgottenCave.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ForgottenCave extends mage.sets.onslaught.ForgottenCave { + + public ForgottenCave(UUID ownerId) { + super(ownerId); + this.cardNumber = 284; + this.expansionSetCode = "C15"; + } + + public ForgottenCave(final ForgottenCave card) { + super(card); + } + + @Override + public ForgottenCave copy() { + return new ForgottenCave(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/FumikoTheLowblood.java b/Mage.Sets/src/mage/sets/commander2015/FumikoTheLowblood.java new file mode 100644 index 00000000000..08db13e13b1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/FumikoTheLowblood.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FumikoTheLowblood extends mage.sets.betrayersofkamigawa.FumikoTheLowblood { + + public FumikoTheLowblood(UUID ownerId) { + super(ownerId); + this.cardNumber = 155; + this.expansionSetCode = "C15"; + } + + public FumikoTheLowblood(final FumikoTheLowblood card) { + super(card); + } + + @Override + public FumikoTheLowblood copy() { + return new FumikoTheLowblood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GhostQuarter.java b/Mage.Sets/src/mage/sets/commander2015/GhostQuarter.java new file mode 100644 index 00000000000..d1e13df5a1a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GhostQuarter.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GhostQuarter extends mage.sets.innistrad.GhostQuarter { + + public GhostQuarter(UUID ownerId) { + super(ownerId); + this.cardNumber = 285; + this.expansionSetCode = "C15"; + } + + public GhostQuarter(final GhostQuarter card) { + super(card); + } + + @Override + public GhostQuarter copy() { + return new GhostQuarter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GhostbladeEidolon.java b/Mage.Sets/src/mage/sets/commander2015/GhostbladeEidolon.java new file mode 100644 index 00000000000..5f0ab56bf8a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GhostbladeEidolon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GhostbladeEidolon extends mage.sets.bornofthegods.GhostbladeEidolon { + + public GhostbladeEidolon(UUID ownerId) { + super(ownerId); + this.cardNumber = 70; + this.expansionSetCode = "C15"; + } + + public GhostbladeEidolon(final GhostbladeEidolon card) { + super(card); + } + + @Override + public GhostbladeEidolon copy() { + return new GhostbladeEidolon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Gigantoplasm.java b/Mage.Sets/src/mage/sets/commander2015/Gigantoplasm.java new file mode 100644 index 00000000000..d7e6e9a85db --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Gigantoplasm.java @@ -0,0 +1,104 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CopyPermanentEffect; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.util.functions.ApplyToPermanent; + +/** + * + * @author fireshoes + */ +public class Gigantoplasm extends CardImpl { + + public Gigantoplasm(UUID ownerId) { + super(ownerId, 11, "Gigantoplasm", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "C15"; + this.subtype.add("Shapeshifter"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // You may have Gigantoplasm enter the battlefield as a copy of any creature on the battlefield except it gains "{X}: This creature has base power and toughness X/X." + Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new GigantoplasmApplyToPermanent()); + effect.setText("a copy of any creature on the battlefield except it gains \"{X}: This creature has base power and toughness X/X.\""); + this.addAbility(new EntersBattlefieldAbility(effect, true)); + } + + public Gigantoplasm(final Gigantoplasm card) { + super(card); + } + + @Override + public Gigantoplasm copy() { + return new Gigantoplasm(this); + } +} + +class GigantoplasmApplyToPermanent extends ApplyToPermanent { + + @Override + public Boolean apply(Game game, Permanent permanent) { + DynamicValue variableMana = new ManacostVariableValue(); + Effect effect = new SetPowerToughnessSourceEffect(variableMana, Duration.WhileOnBattlefield, SubLayer.SetPT_7b); + effect.setText("This creature has base power and toughness X/X"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}")); + permanent.getAbilities().add(ability); + return true; + } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + DynamicValue variableMana = new ManacostVariableValue(); + Effect effect = new SetPowerToughnessSourceEffect(variableMana, Duration.WhileOnBattlefield, SubLayer.SetPT_7b); + effect.setText("This creature has base power and toughness X/X"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}")); + mageObject.getAbilities().add(ability); + return true; + } + +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Gild.java b/Mage.Sets/src/mage/sets/commander2015/Gild.java new file mode 100644 index 00000000000..1131c232dbc --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Gild.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Gild extends mage.sets.bornofthegods.Gild { + + public Gild(UUID ownerId) { + super(ownerId); + this.cardNumber = 127; + this.expansionSetCode = "C15"; + } + + public Gild(final Gild card) { + super(card); + } + + @Override + public Gild copy() { + return new Gild(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GiselaBladeOfGoldnight.java b/Mage.Sets/src/mage/sets/commander2015/GiselaBladeOfGoldnight.java new file mode 100644 index 00000000000..4f76ad72e2b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GiselaBladeOfGoldnight.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GiselaBladeOfGoldnight extends mage.sets.avacynrestored.GiselaBladeOfGoldnight { + + public GiselaBladeOfGoldnight(UUID ownerId) { + super(ownerId); + this.cardNumber = 219; + this.expansionSetCode = "C15"; + } + + public GiselaBladeOfGoldnight(final GiselaBladeOfGoldnight card) { + super(card); + } + + @Override + public GiselaBladeOfGoldnight copy() { + return new GiselaBladeOfGoldnight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GoblinElectromancer.java b/Mage.Sets/src/mage/sets/commander2015/GoblinElectromancer.java new file mode 100644 index 00000000000..27b2012a43a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GoblinElectromancer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GoblinElectromancer extends mage.sets.returntoravnica.GoblinElectromancer { + + public GoblinElectromancer(UUID ownerId) { + super(ownerId); + this.cardNumber = 220; + this.expansionSetCode = "C15"; + } + + public GoblinElectromancer(final GoblinElectromancer card) { + super(card); + } + + @Override + public GoblinElectromancer copy() { + return new GoblinElectromancer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GolgariCharm.java b/Mage.Sets/src/mage/sets/commander2015/GolgariCharm.java new file mode 100644 index 00000000000..9df10beca4d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GolgariCharm.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GolgariCharm extends mage.sets.returntoravnica.GolgariCharm { + + public GolgariCharm(UUID ownerId) { + super(ownerId); + this.cardNumber = 221; + this.expansionSetCode = "C15"; + } + + public GolgariCharm(final GolgariCharm card) { + super(card); + } + + @Override + public GolgariCharm copy() { + return new GolgariCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GolgariGuildgate.java b/Mage.Sets/src/mage/sets/commander2015/GolgariGuildgate.java new file mode 100644 index 00000000000..cf2660d6772 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GolgariGuildgate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GolgariGuildgate extends mage.sets.returntoravnica.GolgariGuildgate { + + public GolgariGuildgate(UUID ownerId) { + super(ownerId); + this.cardNumber = 286; + this.expansionSetCode = "C15"; + } + + public GolgariGuildgate(final GolgariGuildgate card) { + super(card); + } + + @Override + public GolgariGuildgate copy() { + return new GolgariGuildgate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GolgariRotFarm.java b/Mage.Sets/src/mage/sets/commander2015/GolgariRotFarm.java new file mode 100644 index 00000000000..cfe7028460f --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GolgariRotFarm.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GolgariRotFarm extends mage.sets.ravnica.GolgariRotFarm { + + public GolgariRotFarm(UUID ownerId) { + super(ownerId); + this.cardNumber = 287; + this.expansionSetCode = "C15"; + } + + public GolgariRotFarm(final GolgariRotFarm card) { + super(card); + } + + @Override + public GolgariRotFarm copy() { + return new GolgariRotFarm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GolgariSignet.java b/Mage.Sets/src/mage/sets/commander2015/GolgariSignet.java new file mode 100644 index 00000000000..21269b7641e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GolgariSignet.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GolgariSignet extends mage.sets.ravnica.GolgariSignet { + + public GolgariSignet(UUID ownerId) { + super(ownerId); + this.cardNumber = 255; + this.expansionSetCode = "C15"; + } + + public GolgariSignet(final GolgariSignet card) { + super(card); + } + + @Override + public GolgariSignet copy() { + return new GolgariSignet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GraspOfFate.java b/Mage.Sets/src/mage/sets/commander2015/GraspOfFate.java new file mode 100644 index 00000000000..2849a7d5c53 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GraspOfFate.java @@ -0,0 +1,120 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import static mage.filter.predicate.permanent.ControllerControlsIslandPredicate.filter; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.util.CardUtil; + +/** + * + * @author fireshoes + */ +public class GraspOfFate extends CardImpl { + + public GraspOfFate(UUID ownerId) { + super(ownerId, 3, "Grasp of Fate", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); + this.expansionSetCode = "C15"; + + // When Grasp of Fate enters the battlefield, for each opponent, exile up to one target nonland permanent that player controls until Grasp of Fate leaves the battlefield. + Ability ability = new EntersBattlefieldTriggeredAbility(new GraspOfFateExileEffect()); + ability.addTarget(new TargetPermanent(filter)); + ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility())); + this.addAbility(ability); + } + + public GraspOfFate(final GraspOfFate card) { + super(card); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if (ability instanceof EntersBattlefieldTriggeredAbility) { + ability.getTargets().clear(); + for(UUID opponentId : game.getOpponents(ability.getControllerId())) { + Player opponent = game.getPlayer(opponentId); + if (opponent != null) { + FilterPermanent filter = new FilterPermanent("nonland permanent from opponent " + opponent.getLogName()); + filter.add(new ControllerIdPredicate(opponentId)); + filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); + TargetPermanent target = new TargetPermanent(0, 1, filter,false); + ability.addTarget(target); + } + } + } + } + + @Override + public GraspOfFate copy() { + return new GraspOfFate(this); + } +} + +class GraspOfFateExileEffect extends OneShotEffect { + + public GraspOfFateExileEffect() { + super(Outcome.Benefit); + this.staticText = "exile up to one target nonland permanent that player controls until {this} leaves the battlefield"; + } + + public GraspOfFateExileEffect(final GraspOfFateExileEffect effect) { + super(effect); + } + + @Override + public GraspOfFateExileEffect copy() { + return new GraspOfFateExileEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GravePeril.java b/Mage.Sets/src/mage/sets/commander2015/GravePeril.java new file mode 100644 index 00000000000..dfe28a2ea02 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GravePeril.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class GravePeril extends mage.sets.futuresight.GravePeril { + + public GravePeril(UUID ownerId) { + super(ownerId); + this.cardNumber = 128; + this.expansionSetCode = "C15"; + } + + public GravePeril(final GravePeril card) { + super(card); + } + + @Override + public GravePeril copy() { + return new GravePeril(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GreatOakGuardian.java b/Mage.Sets/src/mage/sets/commander2015/GreatOakGuardian.java new file mode 100644 index 00000000000..3ed072bed0c --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GreatOakGuardian.java @@ -0,0 +1,128 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.Iterator; +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.keyword.FlashAbility; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class GreatOakGuardian extends CardImpl { + + public GreatOakGuardian(UUID ownerId) { + super(ownerId, 37, "Great Oak Guardian", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{G}"); + this.expansionSetCode = "C15"; + this.subtype.add("Treefolk"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Reach + this.addAbility(ReachAbility.getInstance()); + + // When Great Oak Guardian enters the battlefield, creatures target player controls get +2/+2 until end of turn. Untap them. + Ability ability = new EntersBattlefieldTriggeredAbility(new GreatOakGuardianEffect(), false); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public GreatOakGuardian(final GreatOakGuardian card) { + super(card); + } + + @Override + public GreatOakGuardian copy() { + return new GreatOakGuardian(this); + } +} + +class GreatOakGuardianEffect extends ContinuousEffectImpl { + + public GreatOakGuardianEffect() { + super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); + staticText = "creatures target player controls get +2/+2 until end of turn. Untap them"; + } + + public GreatOakGuardianEffect(final GreatOakGuardianEffect effect) { + super(effect); + } + + @Override + public GreatOakGuardianEffect copy() { + return new GreatOakGuardianEffect(this); + } + + @Override + public void init(Ability source, Game game) { + super.init(source, game); + if (this.affectedObjectsSet) { + List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game); + for (Permanent creature : creatures) { + affectedObjectList.add(new MageObjectReference(creature, game)); + } + } + } + + @Override + public boolean apply(Game game, Ability source) { + for (Iterator it = affectedObjectList.iterator(); it.hasNext();) { + Permanent permanent = it.next().getPermanent(game); + if (permanent != null) { + permanent.addPower(2); + permanent.addToughness(2); + permanent.untap(game); + } else { + it.remove(); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GrimBackwoods.java b/Mage.Sets/src/mage/sets/commander2015/GrimBackwoods.java new file mode 100644 index 00000000000..a2d518a782b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GrimBackwoods.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GrimBackwoods extends mage.sets.darkascension.GrimBackwoods { + + public GrimBackwoods(UUID ownerId) { + super(ownerId); + this.cardNumber = 288; + this.expansionSetCode = "C15"; + } + + public GrimBackwoods(final GrimBackwoods card) { + super(card); + } + + @Override + public GrimBackwoods copy() { + return new GrimBackwoods(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/GrislySalvage.java b/Mage.Sets/src/mage/sets/commander2015/GrislySalvage.java new file mode 100644 index 00000000000..8e1ef1e8103 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/GrislySalvage.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GrislySalvage extends mage.sets.returntoravnica.GrislySalvage { + + public GrislySalvage(UUID ownerId) { + super(ownerId); + this.cardNumber = 222; + this.expansionSetCode = "C15"; + } + + public GrislySalvage(final GrislySalvage card) { + super(card); + } + + @Override + public GrislySalvage copy() { + return new GrislySalvage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/HamletbackGoliath.java b/Mage.Sets/src/mage/sets/commander2015/HamletbackGoliath.java new file mode 100644 index 00000000000..cf996481c2b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/HamletbackGoliath.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class HamletbackGoliath extends mage.sets.magic2013.HamletbackGoliath { + + public HamletbackGoliath(UUID ownerId) { + super(ownerId); + this.cardNumber = 156; + this.expansionSetCode = "C15"; + } + + public HamletbackGoliath(final HamletbackGoliath card) { + super(card); + } + + @Override + public HamletbackGoliath copy() { + return new HamletbackGoliath(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/HammerfistGiant.java b/Mage.Sets/src/mage/sets/commander2015/HammerfistGiant.java new file mode 100644 index 00000000000..2b4697036a0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/HammerfistGiant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class HammerfistGiant extends mage.sets.ravnica.HammerfistGiant { + + public HammerfistGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 157; + this.expansionSetCode = "C15"; + } + + public HammerfistGiant(final HammerfistGiant card) { + super(card); + } + + @Override + public HammerfistGiant copy() { + return new HammerfistGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/HeraldOfTheHost.java b/Mage.Sets/src/mage/sets/commander2015/HeraldOfTheHost.java new file mode 100644 index 00000000000..662c7ff1228 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/HeraldOfTheHost.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.abilities.keyword.MyriadAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class HeraldOfTheHost extends CardImpl { + + public HeraldOfTheHost(UUID ownerId) { + super(ownerId, 4, "Herald of the Host", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "C15"; + this.subtype.add("Angel"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // Myriad + this.addAbility(new MyriadAbility()); + } + + public HeraldOfTheHost(final HeraldOfTheHost card) { + super(card); + } + + @Override + public HeraldOfTheHost copy() { + return new HeraldOfTheHost(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/HighMarket.java b/Mage.Sets/src/mage/sets/commander2015/HighMarket.java new file mode 100644 index 00000000000..48b361b8b11 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/HighMarket.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class HighMarket extends mage.sets.mercadianmasques.HighMarket { + + public HighMarket(UUID ownerId) { + super(ownerId); + this.cardNumber = 289; + this.expansionSetCode = "C15"; + } + + public HighMarket(final HighMarket card) { + super(card); + } + + @Override + public HighMarket copy() { + return new HighMarket(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Hostility.java b/Mage.Sets/src/mage/sets/commander2015/Hostility.java new file mode 100644 index 00000000000..e4573dede9c --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Hostility.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Hostility extends mage.sets.jacevschandra.Hostility { + + public Hostility(UUID ownerId) { + super(ownerId); + this.cardNumber = 158; + this.expansionSetCode = "C15"; + } + + public Hostility(final Hostility card) { + super(card); + } + + @Override + public Hostility copy() { + return new Hostility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/HuntedDragon.java b/Mage.Sets/src/mage/sets/commander2015/HuntedDragon.java new file mode 100644 index 00000000000..994af27c70d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/HuntedDragon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class HuntedDragon extends mage.sets.ravnica.HuntedDragon { + + public HuntedDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 159; + this.expansionSetCode = "C15"; + } + + public HuntedDragon(final HuntedDragon card) { + super(card); + } + + @Override + public HuntedDragon copy() { + return new HuntedDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/IllusoryAmbusher.java b/Mage.Sets/src/mage/sets/commander2015/IllusoryAmbusher.java new file mode 100644 index 00000000000..78cd559b0db --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/IllusoryAmbusher.java @@ -0,0 +1,103 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealtDamageToSourceTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class IllusoryAmbusher extends CardImpl { + + public IllusoryAmbusher(UUID ownerId) { + super(ownerId, 12, "Illusory Ambusher", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "C15"; + this.subtype.add("Cat"); + this.subtype.add("Illusion"); + this.power = new MageInt(4); + this.toughness = new MageInt(1); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Whenever Illusory Ambusher is dealt damage, draw that many cards. + this.addAbility(new DealtDamageToSourceTriggeredAbility(Zone.BATTLEFIELD, new IllusoryAmbusherDealtDamageEffect(), false)); + } + + public IllusoryAmbusher(final IllusoryAmbusher card) { + super(card); + } + + @Override + public IllusoryAmbusher copy() { + return new IllusoryAmbusher(this); + } +} + +class IllusoryAmbusherDealtDamageEffect extends OneShotEffect { + + public IllusoryAmbusherDealtDamageEffect() { + super(Outcome.Damage); + this.staticText = "draw that many cards"; + } + + public IllusoryAmbusherDealtDamageEffect(final IllusoryAmbusherDealtDamageEffect effect) { + super(effect); + } + + @Override + public IllusoryAmbusherDealtDamageEffect copy() { + return new IllusoryAmbusherDealtDamageEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + int amount = (Integer) getValue("damage"); + if (amount > 0) { + player.drawCards(amount, game); + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/commander2015/IndrikStomphowler.java b/Mage.Sets/src/mage/sets/commander2015/IndrikStomphowler.java new file mode 100644 index 00000000000..ebd219d35a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/IndrikStomphowler.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class IndrikStomphowler extends mage.sets.dissension.IndrikStomphowler { + + public IndrikStomphowler(UUID ownerId) { + super(ownerId); + this.cardNumber = 186; + this.expansionSetCode = "C15"; + } + + public IndrikStomphowler(final IndrikStomphowler card) { + super(card); + } + + @Override + public IndrikStomphowler copy() { + return new IndrikStomphowler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/InfernoTitan.java b/Mage.Sets/src/mage/sets/commander2015/InfernoTitan.java new file mode 100644 index 00000000000..332a7608c70 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/InfernoTitan.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class InfernoTitan extends mage.sets.magic2011.InfernoTitan { + + public InfernoTitan(UUID ownerId) { + super(ownerId); + this.cardNumber = 160; + this.expansionSetCode = "C15"; + } + + public InfernoTitan(final InfernoTitan card) { + super(card); + } + + @Override + public InfernoTitan copy() { + return new InfernoTitan(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Island1.java b/Mage.Sets/src/mage/sets/commander2015/Island1.java new file mode 100644 index 00000000000..4bf7f900120 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Island1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island1 extends mage.cards.basiclands.Island { + + public Island1(UUID ownerId) { + super(ownerId, 327); + this.expansionSetCode = "C15"; + } + + public Island1(final Island1 card) { + super(card); + } + + @Override + public Island1 copy() { + return new Island1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Island2.java b/Mage.Sets/src/mage/sets/commander2015/Island2.java new file mode 100644 index 00000000000..4981eb8d8ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Island2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island2 extends mage.cards.basiclands.Island { + + public Island2(UUID ownerId) { + super(ownerId, 328); + this.expansionSetCode = "C15"; + } + + public Island2(final Island2 card) { + super(card); + } + + @Override + public Island2 copy() { + return new Island2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Island3.java b/Mage.Sets/src/mage/sets/commander2015/Island3.java new file mode 100644 index 00000000000..57a1ab281de --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Island3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island3 extends mage.cards.basiclands.Island { + + public Island3(UUID ownerId) { + super(ownerId, 329); + this.expansionSetCode = "C15"; + } + + public Island3(final Island3 card) { + super(card); + } + + @Override + public Island3 copy() { + return new Island3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Island4.java b/Mage.Sets/src/mage/sets/commander2015/Island4.java new file mode 100644 index 00000000000..40faa87d88a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Island4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island4 extends mage.cards.basiclands.Island { + + public Island4(UUID ownerId) { + super(ownerId, 330); + this.expansionSetCode = "C15"; + } + + public Island4(final Island4 card) { + super(card); + } + + @Override + public Island4 copy() { + return new Island4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/IzzetBoilerworks.java b/Mage.Sets/src/mage/sets/commander2015/IzzetBoilerworks.java new file mode 100644 index 00000000000..0c13f02a235 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/IzzetBoilerworks.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class IzzetBoilerworks extends mage.sets.guildpact.IzzetBoilerworks { + + public IzzetBoilerworks(UUID ownerId) { + super(ownerId); + this.cardNumber = 290; + this.expansionSetCode = "C15"; + } + + public IzzetBoilerworks(final IzzetBoilerworks card) { + super(card); + } + + @Override + public IzzetBoilerworks copy() { + return new IzzetBoilerworks(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/IzzetGuildgate.java b/Mage.Sets/src/mage/sets/commander2015/IzzetGuildgate.java new file mode 100644 index 00000000000..4b3e168dae1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/IzzetGuildgate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class IzzetGuildgate extends mage.sets.returntoravnica.IzzetGuildgate { + + public IzzetGuildgate(UUID ownerId) { + super(ownerId); + this.cardNumber = 291; + this.expansionSetCode = "C15"; + } + + public IzzetGuildgate(final IzzetGuildgate card) { + super(card); + } + + @Override + public IzzetGuildgate copy() { + return new IzzetGuildgate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/IzzetSignet.java b/Mage.Sets/src/mage/sets/commander2015/IzzetSignet.java new file mode 100644 index 00000000000..93ef94f95ed --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/IzzetSignet.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class IzzetSignet extends mage.sets.guildpact.IzzetSignet { + + public IzzetSignet(UUID ownerId) { + super(ownerId); + this.cardNumber = 256; + this.expansionSetCode = "C15"; + } + + public IzzetSignet(final IzzetSignet card) { + super(card); + } + + @Override + public IzzetSignet copy() { + return new IzzetSignet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/JacesArchivist.java b/Mage.Sets/src/mage/sets/commander2015/JacesArchivist.java new file mode 100644 index 00000000000..536237f18ed --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/JacesArchivist.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class JacesArchivist extends mage.sets.magic2012.JacesArchivist { + + public JacesArchivist(UUID ownerId) { + super(ownerId); + this.cardNumber = 95; + this.expansionSetCode = "C15"; + } + + public JacesArchivist(final JacesArchivist card) { + super(card); + } + + @Override + public JacesArchivist copy() { + return new JacesArchivist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/JaradGolgariLichLord.java b/Mage.Sets/src/mage/sets/commander2015/JaradGolgariLichLord.java new file mode 100644 index 00000000000..111783a9e5e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/JaradGolgariLichLord.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class JaradGolgariLichLord extends mage.sets.returntoravnica.JaradGolgariLichLord { + + public JaradGolgariLichLord(UUID ownerId) { + super(ownerId); + this.cardNumber = 223; + this.expansionSetCode = "C15"; + } + + public JaradGolgariLichLord(final JaradGolgariLichLord card) { + super(card); + } + + @Override + public JaradGolgariLichLord copy() { + return new JaradGolgariLichLord(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/JarethLeonineTitan.java b/Mage.Sets/src/mage/sets/commander2015/JarethLeonineTitan.java new file mode 100644 index 00000000000..fcfe6a64726 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/JarethLeonineTitan.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class JarethLeonineTitan extends mage.sets.onslaught.JarethLeonineTitan { + + public JarethLeonineTitan(UUID ownerId) { + super(ownerId); + this.cardNumber = 71; + this.expansionSetCode = "C15"; + } + + public JarethLeonineTitan(final JarethLeonineTitan card) { + super(card); + } + + @Override + public JarethLeonineTitan copy() { + return new JarethLeonineTitan(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/JungleHollow.java b/Mage.Sets/src/mage/sets/commander2015/JungleHollow.java new file mode 100644 index 00000000000..459a994596a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/JungleHollow.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class JungleHollow extends mage.sets.khansoftarkir.JungleHollow { + + public JungleHollow(UUID ownerId) { + super(ownerId); + this.cardNumber = 292; + this.expansionSetCode = "C15"; + } + + public JungleHollow(final JungleHollow card) { + super(card); + } + + @Override + public JungleHollow copy() { + return new JungleHollow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/KalemneDiscipleOfIroas.java b/Mage.Sets/src/mage/sets/commander2015/KalemneDiscipleOfIroas.java new file mode 100644 index 00000000000..eb779a5b60a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/KalemneDiscipleOfIroas.java @@ -0,0 +1,129 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.counter.AddCountersControllerEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.Filter; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class KalemneDiscipleOfIroas extends CardImpl { + + private static final FilterSpell filterSpell = new FilterSpell("a creature spell with converted mana cost 5 or greater"); + + static { + filterSpell.add(new CardTypePredicate(CardType.CREATURE)); + filterSpell.add(new ConvertedManaCostPredicate(Filter.ComparisonType.GreaterThan, 4)); + } + + public KalemneDiscipleOfIroas(UUID ownerId) { + super(ownerId, 45, "Kalemne, Disciple of Iroas", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{R}{W}"); + this.expansionSetCode = "C15"; + this.supertype.add("Legendary"); + this.subtype.add("Giant"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Double strike + this.addAbility(DoubleStrikeAbility.getInstance()); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Whenever you cast a creature spell with converted mana cost 5 or greater, you get an experience counter. + Effect effect = new AddCountersControllerEffect(CounterType.EXPERIENCE.createInstance(1), false); + effect.setText("you get an experience counter"); + Ability ability = new SpellCastControllerTriggeredAbility(effect, filterSpell, false); + this.addAbility(ability); + + // Kalemne, Disciple of Iroas gets +1/+1 for each experience counter you have. + DynamicValue value = new SourceControllerExperienceCountersCount(); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(value, value, Duration.WhileOnBattlefield))); + } + + public KalemneDiscipleOfIroas(final KalemneDiscipleOfIroas card) { + super(card); + } + + @Override + public KalemneDiscipleOfIroas copy() { + return new KalemneDiscipleOfIroas(this); + } +} + +class SourceControllerExperienceCountersCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + int amount = 0; + Player player = game.getPlayer(sourceAbility.getControllerId()); + if (player != null) { + amount = player.getCounters().getCount(CounterType.EXPERIENCE); + } + return amount; + } + + @Override + public SourceControllerExperienceCountersCount copy() { + return new SourceControllerExperienceCountersCount(); + } + + @Override + public String toString() { + return "1"; + } + + @Override + public String getMessage() { + return "experience counter you have"; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/KalemnesCaptain.java b/Mage.Sets/src/mage/sets/commander2015/KalemnesCaptain.java new file mode 100644 index 00000000000..f6db27fa069 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/KalemnesCaptain.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesMonstrousSourceTriggeredAbility; +import mage.abilities.effects.common.ExileAllEffect; +import mage.abilities.keyword.MonstrosityAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author fireshoes + */ +public class KalemnesCaptain extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifacts and enchantments"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); + } + + public KalemnesCaptain(UUID ownerId) { + super(ownerId, 5, "Kalemne's Captain", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "C15"; + this.subtype.add("Giant"); + this.subtype.add("Soldier"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // {5}{W}{W}: Monstrosity 3. + this.addAbility(new MonstrosityAbility("{5}{W}{W}", 3)); + + // When Kalemne's Captain becomes monstrous, exile all artifacts and enchantments. + this.addAbility(new BecomesMonstrousSourceTriggeredAbility(new ExileAllEffect(filter))); + } + + public KalemnesCaptain(final KalemnesCaptain card) { + super(card); + } + + @Override + public KalemnesCaptain copy() { + return new KalemnesCaptain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/KarlovOfTheGhostCouncil.java b/Mage.Sets/src/mage/sets/commander2015/KarlovOfTheGhostCouncil.java new file mode 100644 index 00000000000..673e4f155d2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/KarlovOfTheGhostCouncil.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.GainLifeControllerTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class KarlovOfTheGhostCouncil extends CardImpl { + + public KarlovOfTheGhostCouncil(UUID ownerId) { + super(ownerId, 46, "Karlov of the Ghost Council", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{W}{B}"); + this.expansionSetCode = "C15"; + this.supertype.add("Legendary"); + this.subtype.add("Spirit"); + this.subtype.add("Advisor"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever you gain life, put two +1/+1 counter on Karlov of the Ghost Council. + this.addAbility(new GainLifeControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), false)); + + // {W}{B}, Remove six +1/+1 counters from Karlov of the Ghost Council: Exile target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new ManaCostsImpl("{W}{B}")); + ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(6))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public KarlovOfTheGhostCouncil(final KarlovOfTheGhostCouncil card) { + super(card); + } + + @Override + public KarlovOfTheGhostCouncil copy() { + return new KarlovOfTheGhostCouncil(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/KarmicJustice.java b/Mage.Sets/src/mage/sets/commander2015/KarmicJustice.java new file mode 100644 index 00000000000..fa59189a762 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/KarmicJustice.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class KarmicJustice extends mage.sets.odyssey.KarmicJustice { + + public KarmicJustice(UUID ownerId) { + super(ownerId); + this.cardNumber = 72; + this.expansionSetCode = "C15"; + } + + public KarmicJustice(final KarmicJustice card) { + super(card); + } + + @Override + public KarmicJustice copy() { + return new KarmicJustice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/KasetoOrochiArchmage.java b/Mage.Sets/src/mage/sets/commander2015/KasetoOrochiArchmage.java new file mode 100644 index 00000000000..02f9e111977 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/KasetoOrochiArchmage.java @@ -0,0 +1,108 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class KasetoOrochiArchmage extends CardImpl { + + public KasetoOrochiArchmage(UUID ownerId) { + super(ownerId, 47, "Kaseto, Orochi Archmage", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{G}{U}"); + this.expansionSetCode = "C15"; + this.supertype.add("Legendary"); + this.subtype.add("Snake"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {G}{U}: Target creature can't be blocked this turn. If that creature is a Snake, it gets +2/+2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new KasetoEffect(), new ManaCostsImpl<>("{G}{U}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public KasetoOrochiArchmage(final KasetoOrochiArchmage card) { + super(card); + } + + @Override + public KasetoOrochiArchmage copy() { + return new KasetoOrochiArchmage(this); + } +} + +class KasetoEffect extends OneShotEffect { + + public KasetoEffect() { + super(Outcome.BoostCreature); + staticText = "Target creature can't be blocked this turn. If that creature is a Snake, it gets +2/+2 until end of turn"; + } + + public KasetoEffect(final KasetoEffect effect) { + super(effect); + } + + @Override + public KasetoEffect copy() { + return new KasetoEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null) { + game.addEffect(new CantBeBlockedTargetEffect(Duration.EndOfTurn), source); + if (permanent.getSubtype().contains("Snake")) { + game.addEffect(new BoostTargetEffect(2,2,Duration.EndOfTurn), source); + } + return true; + } + return false; + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/commander2015/KessigCagebreakers.java b/Mage.Sets/src/mage/sets/commander2015/KessigCagebreakers.java new file mode 100644 index 00000000000..c8853c1200d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/KessigCagebreakers.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class KessigCagebreakers extends mage.sets.innistrad.KessigCagebreakers { + + public KessigCagebreakers(UUID ownerId) { + super(ownerId); + this.cardNumber = 187; + this.expansionSetCode = "C15"; + } + + public KessigCagebreakers(final KessigCagebreakers card) { + super(card); + } + + @Override + public KessigCagebreakers copy() { + return new KessigCagebreakers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/KodamasReach.java b/Mage.Sets/src/mage/sets/commander2015/KodamasReach.java new file mode 100644 index 00000000000..578869279f0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/KodamasReach.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class KodamasReach extends mage.sets.commander.KodamasReach { + + public KodamasReach(UUID ownerId) { + super(ownerId); + this.cardNumber = 188; + this.expansionSetCode = "C15"; + } + + public KodamasReach(final KodamasReach card) { + super(card); + } + + @Override + public KodamasReach copy() { + return new KodamasReach(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/KorSanctifiers.java b/Mage.Sets/src/mage/sets/commander2015/KorSanctifiers.java new file mode 100644 index 00000000000..55363b484fc --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/KorSanctifiers.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class KorSanctifiers extends mage.sets.zendikar.KorSanctifiers { + + public KorSanctifiers(UUID ownerId) { + super(ownerId); + this.cardNumber = 73; + this.expansionSetCode = "C15"; + } + + public KorSanctifiers(final KorSanctifiers card) { + super(card); + } + + @Override + public KorSanctifiers copy() { + return new KorSanctifiers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/KorozdaGuildmage.java b/Mage.Sets/src/mage/sets/commander2015/KorozdaGuildmage.java new file mode 100644 index 00000000000..de30f3299b4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/KorozdaGuildmage.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class KorozdaGuildmage extends mage.sets.returntoravnica.KorozdaGuildmage { + + public KorozdaGuildmage(UUID ownerId) { + super(ownerId); + this.cardNumber = 224; + this.expansionSetCode = "C15"; + } + + public KorozdaGuildmage(final KorozdaGuildmage card) { + super(card); + } + + @Override + public KorozdaGuildmage copy() { + return new KorozdaGuildmage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/KrosanGrip.java b/Mage.Sets/src/mage/sets/commander2015/KrosanGrip.java new file mode 100644 index 00000000000..218786c9fdc --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/KrosanGrip.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class KrosanGrip extends mage.sets.timespiral.KrosanGrip { + + public KrosanGrip(UUID ownerId) { + super(ownerId); + this.cardNumber = 189; + this.expansionSetCode = "C15"; + } + + public KrosanGrip(final KrosanGrip card) { + super(card); + } + + @Override + public KrosanGrip copy() { + return new KrosanGrip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/LightningGreaves.java b/Mage.Sets/src/mage/sets/commander2015/LightningGreaves.java new file mode 100644 index 00000000000..c3bb0358be0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/LightningGreaves.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class LightningGreaves extends mage.sets.mirrodin.LightningGreaves { + + public LightningGreaves(UUID ownerId) { + super(ownerId); + this.cardNumber = 257; + this.expansionSetCode = "C15"; + } + + public LightningGreaves(final LightningGreaves card) { + super(card); + } + + @Override + public LightningGreaves copy() { + return new LightningGreaves(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/LlanowarReborn.java b/Mage.Sets/src/mage/sets/commander2015/LlanowarReborn.java new file mode 100644 index 00000000000..0186c1edf6c --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/LlanowarReborn.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class LlanowarReborn extends mage.sets.heroesvsmonsters.LlanowarReborn { + + public LlanowarReborn(UUID ownerId) { + super(ownerId); + this.cardNumber = 293; + this.expansionSetCode = "C15"; + } + + public LlanowarReborn(final LlanowarReborn card) { + super(card); + } + + @Override + public LlanowarReborn copy() { + return new LlanowarReborn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/LoamingShaman.java b/Mage.Sets/src/mage/sets/commander2015/LoamingShaman.java new file mode 100644 index 00000000000..e40d9147cb0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/LoamingShaman.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class LoamingShaman extends mage.sets.dissension.LoamingShaman { + + public LoamingShaman(UUID ownerId) { + super(ownerId); + this.cardNumber = 190; + this.expansionSetCode = "C15"; + } + + public LoamingShaman(final LoamingShaman card) { + super(card); + } + + @Override + public LoamingShaman copy() { + return new LoamingShaman(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/LoneRevenant.java b/Mage.Sets/src/mage/sets/commander2015/LoneRevenant.java new file mode 100644 index 00000000000..5f209497ea5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/LoneRevenant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class LoneRevenant extends mage.sets.avacynrestored.LoneRevenant { + + public LoneRevenant(UUID ownerId) { + super(ownerId); + this.cardNumber = 96; + this.expansionSetCode = "C15"; + } + + public LoneRevenant(final LoneRevenant card) { + super(card); + } + + @Override + public LoneRevenant copy() { + return new LoneRevenant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/LorescaleCoatl.java b/Mage.Sets/src/mage/sets/commander2015/LorescaleCoatl.java new file mode 100644 index 00000000000..974ff8433cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/LorescaleCoatl.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class LorescaleCoatl extends mage.sets.alarareborn.LorescaleCoatl { + + public LorescaleCoatl(UUID ownerId) { + super(ownerId); + this.cardNumber = 225; + this.expansionSetCode = "C15"; + } + + public LorescaleCoatl(final LorescaleCoatl card) { + super(card); + } + + @Override + public LorescaleCoatl copy() { + return new LorescaleCoatl(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/LotlethTroll.java b/Mage.Sets/src/mage/sets/commander2015/LotlethTroll.java new file mode 100644 index 00000000000..9ee92a7b725 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/LotlethTroll.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class LotlethTroll extends mage.sets.returntoravnica.LotlethTroll { + + public LotlethTroll(UUID ownerId) { + super(ownerId); + this.cardNumber = 226; + this.expansionSetCode = "C15"; + } + + public LotlethTroll(final LotlethTroll card) { + super(card); + } + + @Override + public LotlethTroll copy() { + return new LotlethTroll(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/LoxodonWarhammer.java b/Mage.Sets/src/mage/sets/commander2015/LoxodonWarhammer.java new file mode 100644 index 00000000000..eb96bcf7997 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/LoxodonWarhammer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class LoxodonWarhammer extends mage.sets.planechase.LoxodonWarhammer { + + public LoxodonWarhammer(UUID ownerId) { + super(ownerId); + this.cardNumber = 258; + this.expansionSetCode = "C15"; + } + + public LoxodonWarhammer(final LoxodonWarhammer card) { + super(card); + } + + @Override + public LoxodonWarhammer copy() { + return new LoxodonWarhammer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MagmaGiant.java b/Mage.Sets/src/mage/sets/commander2015/MagmaGiant.java new file mode 100644 index 00000000000..050fa02e2ab --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MagmaGiant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MagmaGiant extends mage.sets.portalsecondage.MagmaGiant { + + public MagmaGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 161; + this.expansionSetCode = "C15"; + } + + public MagmaGiant(final MagmaGiant card) { + super(card); + } + + @Override + public MagmaGiant copy() { + return new MagmaGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Magmaquake.java b/Mage.Sets/src/mage/sets/commander2015/Magmaquake.java new file mode 100644 index 00000000000..3c4691c3713 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Magmaquake.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Magmaquake extends mage.sets.magic2013.Magmaquake { + + public Magmaquake(UUID ownerId) { + super(ownerId); + this.cardNumber = 162; + this.expansionSetCode = "C15"; + } + + public Magmaquake(final Magmaquake card) { + super(card); + } + + @Override + public Magmaquake copy() { + return new Magmaquake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MagusOfTheWheel.java b/Mage.Sets/src/mage/sets/commander2015/MagusOfTheWheel.java new file mode 100644 index 00000000000..d27a4a3acfe --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MagusOfTheWheel.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.abilities.effects.common.discard.DiscardHandAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class MagusOfTheWheel extends CardImpl { + + public MagusOfTheWheel(UUID ownerId) { + super(ownerId, 27, "Magus of the Wheel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "C15"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {1}{R}, {T}, Sacrifice Magus of the Wheel: Each player discards his or her hand, then draws seven cards. + Effect effect = new DrawCardAllEffect(7); + effect.setText(", then draws seven cards"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DiscardHandAllEffect(), new ManaCostsImpl("{1}{R}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addEffect(effect); + this.addAbility(ability); + } + + public MagusOfTheWheel(final MagusOfTheWheel card) { + super(card); + } + + @Override + public MagusOfTheWheel copy() { + return new MagusOfTheWheel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MarshalsAnthem.java b/Mage.Sets/src/mage/sets/commander2015/MarshalsAnthem.java new file mode 100644 index 00000000000..7478fe0e180 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MarshalsAnthem.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MarshalsAnthem extends mage.sets.worldwake.MarshalsAnthem { + + public MarshalsAnthem(UUID ownerId) { + super(ownerId); + this.cardNumber = 74; + this.expansionSetCode = "C15"; + } + + public MarshalsAnthem(final MarshalsAnthem card) { + super(card); + } + + @Override + public MarshalsAnthem copy() { + return new MarshalsAnthem(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MazirekKraulDeathPriest.java b/Mage.Sets/src/mage/sets/commander2015/MazirekKraulDeathPriest.java new file mode 100644 index 00000000000..522f1c383f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MazirekKraulDeathPriest.java @@ -0,0 +1,109 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; + +/** + * + * @author fireshoes + */ +public class MazirekKraulDeathPriest extends CardImpl { + + public MazirekKraulDeathPriest(UUID ownerId) { + super(ownerId, 48, "Mazirek, Kraul Death Priest", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{B}{G}"); + this.expansionSetCode = "C15"; + this.supertype.add("Legendary"); + this.subtype.add("Insect"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever a player sacrifices another permanent, put a +1/+1 counter on each creature you control. + this.addAbility(new PlayerSacrificesPermanentTriggeredAbility(new AddCountersAllEffect(CounterType.P1P1.createInstance(), new FilterControlledCreaturePermanent()), false)); + } + + public MazirekKraulDeathPriest(final MazirekKraulDeathPriest card) { + super(card); + } + + @Override + public MazirekKraulDeathPriest copy() { + return new MazirekKraulDeathPriest(this); + } +} + +class PlayerSacrificesPermanentTriggeredAbility extends TriggeredAbilityImpl { + + public PlayerSacrificesPermanentTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, optional); + } + + public PlayerSacrificesPermanentTriggeredAbility(final PlayerSacrificesPermanentTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SACRIFICED_PERMANENT; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + return mageObject != null && !event.getTargetId().equals(this.getSourceId()); + } + + @Override + public String getRule() { + return "Whenever a player sacrifices a permanent, " + super.getRule(); + } + + @Override + public PlayerSacrificesPermanentTriggeredAbility copy() { + return new PlayerSacrificesPermanentTriggeredAbility(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/commander2015/MelekIzzetParagon.java b/Mage.Sets/src/mage/sets/commander2015/MelekIzzetParagon.java new file mode 100644 index 00000000000..1ddf055d2d8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MelekIzzetParagon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MelekIzzetParagon extends mage.sets.dragonsmaze.MelekIzzetParagon { + + public MelekIzzetParagon(UUID ownerId) { + super(ownerId); + this.cardNumber = 227; + this.expansionSetCode = "C15"; + } + + public MelekIzzetParagon(final MelekIzzetParagon card) { + super(card); + } + + @Override + public MelekIzzetParagon copy() { + return new MelekIzzetParagon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MerenOfClanNelToth.java b/Mage.Sets/src/mage/sets/commander2015/MerenOfClanNelToth.java new file mode 100644 index 00000000000..fc4a496309f --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MerenOfClanNelToth.java @@ -0,0 +1,136 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.AddCountersControllerEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author fireshoes + */ +public class MerenOfClanNelToth extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature you control"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public MerenOfClanNelToth(UUID ownerId) { + super(ownerId, 49, "Meren of Clan Nel Toth", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{B}{G}"); + this.expansionSetCode = "C15"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Shaman"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Whenever another creature you control dies, you get an experience counter. + Effect effect = new AddCountersControllerEffect(CounterType.EXPERIENCE.createInstance(1), false); + effect.setText("you get an experience counter"); + this.addAbility(new DiesCreatureTriggeredAbility(effect, false, filter)); + + // At the beginning of your end step, choose target creature card in your graveyard. + // If that card's converted mana cost is less than or equal to the number of experience counters you have, return it to the battlefield. Otherwise, put it into your hand. + Target target = new TargetCardInYourGraveyard(new FilterCreatureCard("creature card in your graveyard")); + Ability ability = new BeginningOfYourEndStepTriggeredAbility(new MerenOfClanNelTothEffect(), false); + ability.addTarget(target); + this.addAbility(ability); + } + + public MerenOfClanNelToth(final MerenOfClanNelToth card) { + super(card); + } + + @Override + public MerenOfClanNelToth copy() { + return new MerenOfClanNelToth(this); + } +} + +class MerenOfClanNelTothEffect extends OneShotEffect { + + public MerenOfClanNelTothEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "choose target creature card in your graveyard. If that card's converted mana cost is less than or equal to the number of experience counters you have, return it to the battlefield. Otherwise, put it into your hand"; + } + + public MerenOfClanNelTothEffect(final MerenOfClanNelTothEffect effect) { + super(effect); + } + + @Override + public MerenOfClanNelTothEffect copy() { + return new MerenOfClanNelTothEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + int amount = player.getCounters().getCount(CounterType.EXPERIENCE); + Card card = game.getCard(targetPointer.getFirst(game, source)); + if (card != null) { + Zone targetZone = Zone.HAND; + String text = " put into hand of "; + if (card.getManaCost().convertedManaCost() <= amount) { + targetZone = Zone.BATTLEFIELD; + text = " put onto battlefield for "; + } + card.moveToZone(targetZone, source.getSourceId(), game, false); + game.informPlayers(new StringBuilder("Meren of Clan Nel Toth: ").append(card.getName()).append(text).append(player.getLogName()).toString()); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MesaEnchantress.java b/Mage.Sets/src/mage/sets/commander2015/MesaEnchantress.java new file mode 100644 index 00000000000..c2d51b3c8be --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MesaEnchantress.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MesaEnchantress extends mage.sets.magic2010.MesaEnchantress { + + public MesaEnchantress(UUID ownerId) { + super(ownerId); + this.cardNumber = 75; + this.expansionSetCode = "C15"; + } + + public MesaEnchantress(final MesaEnchantress card) { + super(card); + } + + @Override + public MesaEnchantress copy() { + return new MesaEnchantress(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MeteorBlast.java b/Mage.Sets/src/mage/sets/commander2015/MeteorBlast.java new file mode 100644 index 00000000000..91f6998f97c --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MeteorBlast.java @@ -0,0 +1,113 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class MeteorBlast extends CardImpl { + + public MeteorBlast(UUID ownerId) { + super(ownerId, 28, "Meteor Blast", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{R}{R}{R}"); + this.expansionSetCode = "C15"; + + // Meteor Blast deals 4 damage to each of X target creatures and/or players. + this.getSpellAbility().addEffect(new MeteorBlastEffect()); + } + + public MeteorBlast(final MeteorBlast card) { + super(card); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + int xValue = ability.getManaCostsToPay().getX(); + if (xValue > 0) { + Target target = new TargetCreatureOrPlayer(xValue); + ability.addTarget(target); + } + } + + @Override + public MeteorBlast copy() { + return new MeteorBlast(this); + } +} + +class MeteorBlastEffect extends OneShotEffect { + + public MeteorBlastEffect() { + super(Outcome.Damage); + staticText = "{this} deals 4 damage to each of X target creatures and/or players"; + } + + public MeteorBlastEffect(final MeteorBlastEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + if (source.getTargets().size() > 0) { + for (UUID targetId : this.getTargetPointer().getTargets(game, source)) { + Permanent creature = game.getPermanent(targetId); + if (creature != null) { + creature.damage(4, source.getSourceId(), game, false, true); + } else { + Player player = game.getPlayer(targetId); + if (player != null) { + player.damage(4, source.getSourceId(), game, false, true); + } + } + } + } + return true; + } + return false; + } + + @Override + public MeteorBlastEffect copy() { + return new MeteorBlastEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MindStone.java b/Mage.Sets/src/mage/sets/commander2015/MindStone.java new file mode 100644 index 00000000000..3b699f31480 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MindStone.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MindStone extends mage.sets.tenthedition.MindStone { + + public MindStone(UUID ownerId) { + super(ownerId); + this.cardNumber = 259; + this.expansionSetCode = "C15"; + } + + public MindStone(final MindStone card) { + super(card); + } + + @Override + public MindStone copy() { + return new MindStone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MirrorMatch.java b/Mage.Sets/src/mage/sets/commander2015/MirrorMatch.java new file mode 100644 index 00000000000..dcff7fbe257 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MirrorMatch.java @@ -0,0 +1,166 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.combat.CombatGroup; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class MirrorMatch extends CardImpl { + + public MirrorMatch(UUID ownerId) { + super(ownerId, 13, "Mirror Match", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{U}{U}"); + this.expansionSetCode = "C15"; + + // Cast Mirror Match only during the declare blockers step. + Ability ability = new SimpleStaticAbility(Zone.ALL, new MirrorMatchRuleModifyingEffect()); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + + // For each creature attacking you or a planeswalker you control, put a token that's a copy of that creature onto the battlefield blocking that creature. Exile those tokens at end of combat. + this.getSpellAbility().addEffect(new MirrorMatchEffect()); + + } + + public MirrorMatch(final MirrorMatch card) { + super(card); + } + + @Override + public MirrorMatch copy() { + return new MirrorMatch(this); + } +} + +class MirrorMatchRuleModifyingEffect extends ContinuousRuleModifyingEffectImpl { + + MirrorMatchRuleModifyingEffect() { + super(Duration.EndOfGame, Outcome.Detriment); + staticText = "Cast {this} only during the declare blockers step"; + } + + MirrorMatchRuleModifyingEffect(final MirrorMatchRuleModifyingEffect effect) { + super(effect); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return GameEvent.EventType.CAST_SPELL.equals(event.getType()); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getSourceId().equals(source.getSourceId())) { + return !game.getTurn().getStepType().equals(PhaseStep.DECLARE_BLOCKERS); + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public MirrorMatchRuleModifyingEffect copy() { + return new MirrorMatchRuleModifyingEffect(this); + } +} + +class MirrorMatchEffect extends OneShotEffect { + + public MirrorMatchEffect() { + super(Outcome.Benefit); + this.staticText = "For each creature attacking you or a planeswalker you control, put a token that's a copy of that creature onto the battlefield blocking that creature. Exile those tokens at end of combat"; + } + + public MirrorMatchEffect(final MirrorMatchEffect effect) { + super(effect); + } + + @Override + public MirrorMatchEffect copy() { + return new MirrorMatchEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID attackerId : game.getCombat().getAttackers()) { + Permanent attacker = game.getPermanent(attackerId); + if (attacker != null + && source.getControllerId().equals(game.getCombat().getDefendingPlayerId(attackerId, game))) { + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, false); + effect.setTargetPointer(new FixedTarget(attacker, game)); + effect.apply(game, source); + CombatGroup group = game.getCombat().findGroup(attacker.getId()); + boolean isCreature = false; + if (group != null) { + for (Permanent addedToken : effect.getAddedPermanent()) { + if (addedToken.getCardType().contains(CardType.CREATURE)) { + group.addBlockerToGroup(addedToken.getId(), attackerId, game); + isCreature = true; + } + ExileTargetEffect exileEffect = new ExileTargetEffect("Exile the token at end of combat"); + exileEffect.setTargetPointer(new FixedTarget(addedToken, game)); + game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect), source); + } + if (isCreature) { + group.pickBlockerOrder(attacker.getControllerId(), game); + } + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MizziumMortars.java b/Mage.Sets/src/mage/sets/commander2015/MizziumMortars.java new file mode 100644 index 00000000000..1c7969c8a00 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MizziumMortars.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MizziumMortars extends mage.sets.returntoravnica.MizziumMortars { + + public MizziumMortars(UUID ownerId) { + super(ownerId); + this.cardNumber = 163; + this.expansionSetCode = "C15"; + } + + public MizziumMortars(final MizziumMortars card) { + super(card); + } + + @Override + public MizziumMortars copy() { + return new MizziumMortars(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MizzixOfTheIzmagnus.java b/Mage.Sets/src/mage/sets/commander2015/MizzixOfTheIzmagnus.java new file mode 100644 index 00000000000..32b287c0cbf --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MizzixOfTheIzmagnus.java @@ -0,0 +1,158 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.effects.common.counter.AddCountersControllerEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.CostModificationType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterInstantOrSorceryCard; +import mage.filter.common.FilterInstantOrSorcerySpell; +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.util.CardUtil; + +/** + * + * @author emerald000 + */ +public class MizzixOfTheIzmagnus extends CardImpl { + + private static final FilterInstantOrSorcerySpell filter = new FilterInstantOrSorcerySpell("an instant or sorcery spell with converted mana cost greater than the number of experience counters you have"); + + static { + filter.add(new MizzixOfTheIzmagnusPredicate()); + } + + public MizzixOfTheIzmagnus(UUID ownerId) { + super(ownerId, 50, "Mizzix of the Izmagnus", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{U}{R}"); + this.expansionSetCode = "C15"; + this.supertype.add("Legendary"); + this.subtype.add("Goblin"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever you cast an instant or sorcery spell with converted mana cost greater than the number of experience counters you have, you get an experience counter. + this.addAbility(new SpellCastControllerTriggeredAbility( + new AddCountersControllerEffect(CounterType.EXPERIENCE.createInstance(1), false), filter, false)); + + // Instant and sorcery spells you cast cost {1} less to cast for each experience counter you have. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MizzixOfTheIzmagnusCostReductionEffect())); + } + + public MizzixOfTheIzmagnus(final MizzixOfTheIzmagnus card) { + super(card); + } + + @Override + public MizzixOfTheIzmagnus copy() { + return new MizzixOfTheIzmagnus(this); + } +} + +class MizzixOfTheIzmagnusPredicate implements Predicate { + + @Override + public boolean apply(MageObject input, Game game) { + Spell spell = game.getStack().getSpell(input.getId()); + if (spell != null) { + Player controller = game.getPlayer(spell.getControllerId()); + if (controller != null) { + if (spell.getConvertedManaCost() > controller.getCounters().getCount(CounterType.EXPERIENCE)) { + return true; + } + } + } + return false; + } + + @Override + public String toString() { + return "VariableManaCost"; + } +} + +class MizzixOfTheIzmagnusCostReductionEffect extends CostModificationEffectImpl { + + MizzixOfTheIzmagnusCostReductionEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); + staticText = "Instant and sorcery spells you cast cost {1} less to cast for each experience counter you have"; + } + + MizzixOfTheIzmagnusCostReductionEffect(MizzixOfTheIzmagnusCostReductionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + CardUtil.adjustCost(spellAbility, controller.getCounters().getCount(CounterType.EXPERIENCE)); + return true; + } + return false; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (abilityToModify instanceof SpellAbility && abilityToModify.getControllerId().equals(source.getControllerId())) { + Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); + if (spell != null) { + return new FilterInstantOrSorceryCard().match(spell, source.getSourceId(), source.getControllerId(), game); + } else { + // used at least for flashback ability because Flashback ability doesn't use stack or for getPlayables where spell is not cast yet + Card sourceCard = game.getCard(abilityToModify.getSourceId()); + return sourceCard != null && new FilterInstantOrSorceryCard().match(sourceCard, source.getSourceId(), source.getControllerId(), game); + } + } + return false; + } + + @Override + public MizzixOfTheIzmagnusCostReductionEffect copy() { + return new MizzixOfTheIzmagnusCostReductionEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MizzixsMastery.java b/Mage.Sets/src/mage/sets/commander2015/MizzixsMastery.java new file mode 100644 index 00000000000..52032c63ce5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MizzixsMastery.java @@ -0,0 +1,168 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.keyword.OverloadAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TimingRule; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterInstantOrSorceryCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LevelX2 + */ +public class MizzixsMastery extends CardImpl { + + public MizzixsMastery(UUID ownerId) { + super(ownerId, 29, "Mizzix's Mastery", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}"); + this.expansionSetCode = "C15"; + + // Exile target card that's an instant or sorcery from your graveyard. For each card exiled this way, copy it, and you may cast the copy without paying its mana cost. Exile Mizzix's Mastery. + this.getSpellAbility().addEffect(new MizzixsMasteryEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterInstantOrSorceryCard("card that's an instant or sorcery from your graveyard"))); + this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); + + // Overload {5}{R}{R}{R} + Ability ability = new OverloadAbility(this, new MizzixsMasteryOverloadEffect(), new ManaCostsImpl("{5}{R}{R}{R}"), TimingRule.SORCERY); + ability.addEffect(ExileSpellEffect.getInstance()); + this.addAbility(ability); + } + + public MizzixsMastery(final MizzixsMastery card) { + super(card); + } + + @Override + public MizzixsMastery copy() { + return new MizzixsMastery(this); + } +} + +class MizzixsMasteryEffect extends OneShotEffect { + + public MizzixsMasteryEffect() { + super(Outcome.PlayForFree); + this.staticText = "Exile target card that's an instant or sorcery from your graveyard. For each card exiled this way, copy it, and you may cast the copy without paying its mana cost"; + } + + public MizzixsMasteryEffect(final MizzixsMasteryEffect effect) { + super(effect); + } + + @Override + public MizzixsMasteryEffect copy() { + return new MizzixsMasteryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Card card = game.getCard(getTargetPointer().getFirst(game, source)); + if (card != null) { + if (controller.moveCards(card, Zone.EXILED, source, game)) { + Card cardCopy = game.copyCard(card, source, source.getControllerId()); + if (cardCopy.getSpellAbility().canChooseTarget(game) + && controller.chooseUse(outcome, "Cast copy of " + card.getName() + " without paying its mana cost?", source, game)) { + controller.cast(cardCopy.getSpellAbility(), game, true); + } + } + } + return true; + } + return false; + } +} + +class MizzixsMasteryOverloadEffect extends OneShotEffect { + + public MizzixsMasteryOverloadEffect() { + super(Outcome.PlayForFree); + this.staticText = "Exile each card that's an instant or sorcery from your graveyard. For each card exiled this way, copy it, and you may cast the copy without paying its mana cost. Exile {this}"; + } + + public MizzixsMasteryOverloadEffect(final MizzixsMasteryOverloadEffect effect) { + super(effect); + } + + @Override + public MizzixsMasteryOverloadEffect copy() { + return new MizzixsMasteryOverloadEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Set cardsToExile = controller.getGraveyard().getCards(new FilterInstantOrSorceryCard(), source.getId(), source.getControllerId(), game); + if (!cardsToExile.isEmpty()) { + if (controller.moveCards(cardsToExile, Zone.EXILED, source, game)) { + Cards copiedCards = new CardsImpl(); + for (Card card : cardsToExile) { + copiedCards.add(game.copyCard(card, source, source.getControllerId())); + } + boolean continueCasting = true; + while (continueCasting) { + TargetCard targetCard = new TargetCard(0, 1, Zone.EXILED, new FilterCard("copied card to cast without paying its mana cost?")); + targetCard.setNotTarget(true); + if (controller.choose(outcome, copiedCards, targetCard, game)) { + Card selectedCard = game.getCard(targetCard.getFirstTarget()); + if (selectedCard != null && selectedCard.getSpellAbility().canChooseTarget(game)) { + if (controller.cast(selectedCard.getSpellAbility(), game, true)) { + copiedCards.remove(selectedCard); + } + } + } + continueCasting = copiedCards.size() > 0 + && controller.chooseUse(outcome, "Cast one of the copied cards without paying its mana cost?", source, game); + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MonkIdealist.java b/Mage.Sets/src/mage/sets/commander2015/MonkIdealist.java new file mode 100644 index 00000000000..91dac8c97ec --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MonkIdealist.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MonkIdealist extends mage.sets.urzassaga.MonkIdealist { + + public MonkIdealist(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + this.expansionSetCode = "C15"; + } + + public MonkIdealist(final MonkIdealist card) { + super(card); + } + + @Override + public MonkIdealist copy() { + return new MonkIdealist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MosswortBridge.java b/Mage.Sets/src/mage/sets/commander2015/MosswortBridge.java new file mode 100644 index 00000000000..a67796f6cc0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MosswortBridge.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MosswortBridge extends mage.sets.commander2013.MosswortBridge { + + public MosswortBridge(UUID ownerId) { + super(ownerId); + this.cardNumber = 294; + this.expansionSetCode = "C15"; + } + + public MosswortBridge(final MosswortBridge card) { + super(card); + } + + @Override + public MosswortBridge copy() { + return new MosswortBridge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Mountain1.java b/Mage.Sets/src/mage/sets/commander2015/Mountain1.java new file mode 100644 index 00000000000..653e03ee182 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Mountain1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain1 extends mage.cards.basiclands.Mountain { + + public Mountain1(UUID ownerId) { + super(ownerId, 335); + this.expansionSetCode = "C15"; + } + + public Mountain1(final Mountain1 card) { + super(card); + } + + @Override + public Mountain1 copy() { + return new Mountain1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Mountain2.java b/Mage.Sets/src/mage/sets/commander2015/Mountain2.java new file mode 100644 index 00000000000..2abb1ad2b3f --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Mountain2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain2 extends mage.cards.basiclands.Mountain { + + public Mountain2(UUID ownerId) { + super(ownerId, 336); + this.expansionSetCode = "C15"; + } + + public Mountain2(final Mountain2 card) { + super(card); + } + + @Override + public Mountain2 copy() { + return new Mountain2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Mountain3.java b/Mage.Sets/src/mage/sets/commander2015/Mountain3.java new file mode 100644 index 00000000000..02af3e46f1c --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Mountain3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain3 extends mage.cards.basiclands.Mountain { + + public Mountain3(UUID ownerId) { + super(ownerId, 337); + this.expansionSetCode = "C15"; + } + + public Mountain3(final Mountain3 card) { + super(card); + } + + @Override + public Mountain3 copy() { + return new Mountain3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Mountain4.java b/Mage.Sets/src/mage/sets/commander2015/Mountain4.java new file mode 100644 index 00000000000..ea3e2e7f8aa --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Mountain4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain4 extends mage.cards.basiclands.Mountain { + + public Mountain4(UUID ownerId) { + super(ownerId, 338); + this.expansionSetCode = "C15"; + } + + public Mountain4(final Mountain4 card) { + super(card); + } + + @Override + public Mountain4 copy() { + return new Mountain4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Mulch.java b/Mage.Sets/src/mage/sets/commander2015/Mulch.java new file mode 100644 index 00000000000..d5eab8ce891 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Mulch.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mulch extends mage.sets.innistrad.Mulch { + + public Mulch(UUID ownerId) { + super(ownerId); + this.cardNumber = 191; + this.expansionSetCode = "C15"; + } + + public Mulch(final Mulch card) { + super(card); + } + + @Override + public Mulch copy() { + return new Mulch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Mulldrifter.java b/Mage.Sets/src/mage/sets/commander2015/Mulldrifter.java new file mode 100644 index 00000000000..b916017ea3e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Mulldrifter.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Mulldrifter extends mage.sets.commander.Mulldrifter { + + public Mulldrifter(UUID ownerId) { + super(ownerId); + this.cardNumber = 97; + this.expansionSetCode = "C15"; + this.rarity = Rarity.UNCOMMON; + } + + public Mulldrifter(final Mulldrifter card) { + super(card); + } + + @Override + public Mulldrifter copy() { + return new Mulldrifter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Mycoloth.java b/Mage.Sets/src/mage/sets/commander2015/Mycoloth.java new file mode 100644 index 00000000000..5174b44b871 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Mycoloth.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mycoloth extends mage.sets.shardsofalara.Mycoloth { + + public Mycoloth(UUID ownerId) { + super(ownerId); + this.cardNumber = 192; + this.expansionSetCode = "C15"; + } + + public Mycoloth(final Mycoloth card) { + super(card); + } + + @Override + public Mycoloth copy() { + return new Mycoloth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MysticConfluence.java b/Mage.Sets/src/mage/sets/commander2015/MysticConfluence.java new file mode 100644 index 00000000000..cd6e2f946ea --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MysticConfluence.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetSpell; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class MysticConfluence extends CardImpl { + + public MysticConfluence(UUID ownerId) { + super(ownerId, 14, "Mystic Confluence", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{U}{U}"); + this.expansionSetCode = "C15"; + + // Choose three. You may choose the same mode more than once. + this.getSpellAbility().getModes().setMinModes(3); + this.getSpellAbility().getModes().setMaxModes(3); + this.getSpellAbility().getModes().setEachModeMoreThanOnce(true); + + // - Counter target spell unless its controller pays {3}; + this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(3))); + this.getSpellAbility().addTarget(new TargetSpell()); + + // Return target creature to its owner's hand; + Mode mode = new Mode(); + mode.getEffects().add(new ReturnToHandTargetEffect()); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().getModes().addMode(mode); + + // Draw a card. + mode = new Mode(); + mode.getEffects().add(new DrawCardSourceControllerEffect(1)); + this.getSpellAbility().getModes().addMode(mode); + } + + public MysticConfluence(final MysticConfluence card) { + super(card); + } + + @Override + public MysticConfluence copy() { + return new MysticConfluence(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MysticRetrieval.java b/Mage.Sets/src/mage/sets/commander2015/MysticRetrieval.java new file mode 100644 index 00000000000..68841139585 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MysticRetrieval.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MysticRetrieval extends mage.sets.darkascension.MysticRetrieval { + + public MysticRetrieval(UUID ownerId) { + super(ownerId); + this.cardNumber = 98; + this.expansionSetCode = "C15"; + } + + public MysticRetrieval(final MysticRetrieval card) { + super(card); + } + + @Override + public MysticRetrieval copy() { + return new MysticRetrieval(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/MysticSnake.java b/Mage.Sets/src/mage/sets/commander2015/MysticSnake.java new file mode 100644 index 00000000000..7f52cfdad5a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/MysticSnake.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MysticSnake extends mage.sets.apocalypse.MysticSnake { + + public MysticSnake(UUID ownerId) { + super(ownerId); + this.cardNumber = 228; + this.expansionSetCode = "C15"; + } + + public MysticSnake(final MysticSnake card) { + super(card); + } + + @Override + public MysticSnake copy() { + return new MysticSnake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/NecromancersCovenant.java b/Mage.Sets/src/mage/sets/commander2015/NecromancersCovenant.java new file mode 100644 index 00000000000..4e33f502456 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/NecromancersCovenant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class NecromancersCovenant extends mage.sets.alarareborn.NecromancersCovenant { + + public NecromancersCovenant(UUID ownerId) { + super(ownerId); + this.cardNumber = 229; + this.expansionSetCode = "C15"; + } + + public NecromancersCovenant(final NecromancersCovenant card) { + super(card); + } + + @Override + public NecromancersCovenant copy() { + return new NecromancersCovenant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/NewBenalia.java b/Mage.Sets/src/mage/sets/commander2015/NewBenalia.java new file mode 100644 index 00000000000..25f45dcb9cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/NewBenalia.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class NewBenalia extends mage.sets.futuresight.NewBenalia { + + public NewBenalia(UUID ownerId) { + super(ownerId); + this.cardNumber = 295; + this.expansionSetCode = "C15"; + } + + public NewBenalia(final NewBenalia card) { + super(card); + } + + @Override + public NewBenalia copy() { + return new NewBenalia(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Nighthowler.java b/Mage.Sets/src/mage/sets/commander2015/Nighthowler.java new file mode 100644 index 00000000000..35fb765437d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Nighthowler.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Nighthowler extends mage.sets.theros.Nighthowler { + + public Nighthowler(UUID ownerId) { + super(ownerId); + this.cardNumber = 129; + this.expansionSetCode = "C15"; + } + + public Nighthowler(final Nighthowler card) { + super(card); + } + + @Override + public Nighthowler copy() { + return new Nighthowler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/NinjaOfTheDeepHours.java b/Mage.Sets/src/mage/sets/commander2015/NinjaOfTheDeepHours.java new file mode 100644 index 00000000000..e3e028c6240 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/NinjaOfTheDeepHours.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class NinjaOfTheDeepHours extends mage.sets.betrayersofkamigawa.NinjaOfTheDeepHours { + + public NinjaOfTheDeepHours(UUID ownerId) { + super(ownerId); + this.cardNumber = 99; + this.expansionSetCode = "C15"; + } + + public NinjaOfTheDeepHours(final NinjaOfTheDeepHours card) { + super(card); + } + + @Override + public NinjaOfTheDeepHours copy() { + return new NinjaOfTheDeepHours(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/NobleQuarry.java b/Mage.Sets/src/mage/sets/commander2015/NobleQuarry.java new file mode 100644 index 00000000000..29d430a5a0b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/NobleQuarry.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class NobleQuarry extends mage.sets.bornofthegods.NobleQuarry { + + public NobleQuarry(UUID ownerId) { + super(ownerId); + this.cardNumber = 193; + this.expansionSetCode = "C15"; + } + + public NobleQuarry(final NobleQuarry card) { + super(card); + } + + @Override + public NobleQuarry copy() { + return new NobleQuarry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/NovijenHeartOfProgress.java b/Mage.Sets/src/mage/sets/commander2015/NovijenHeartOfProgress.java new file mode 100644 index 00000000000..d1863b2f480 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/NovijenHeartOfProgress.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class NovijenHeartOfProgress extends mage.sets.dissension.NovijenHeartOfProgress { + + public NovijenHeartOfProgress(UUID ownerId) { + super(ownerId); + this.cardNumber = 296; + this.expansionSetCode = "C15"; + } + + public NovijenHeartOfProgress(final NovijenHeartOfProgress card) { + super(card); + } + + @Override + public NovijenHeartOfProgress copy() { + return new NovijenHeartOfProgress(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/OhranViper.java b/Mage.Sets/src/mage/sets/commander2015/OhranViper.java new file mode 100644 index 00000000000..2b7dbbef605 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/OhranViper.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class OhranViper extends mage.sets.jacevsvraska.OhranViper { + + public OhranViper(UUID ownerId) { + super(ownerId); + this.cardNumber = 194; + this.expansionSetCode = "C15"; + } + + public OhranViper(final OhranViper card) { + super(card); + } + + @Override + public OhranViper copy() { + return new OhranViper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/OpenTheVaults.java b/Mage.Sets/src/mage/sets/commander2015/OpenTheVaults.java new file mode 100644 index 00000000000..4cf2f4529b7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/OpenTheVaults.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class OpenTheVaults extends mage.sets.magic2010.OpenTheVaults { + + public OpenTheVaults(UUID ownerId) { + super(ownerId); + this.cardNumber = 77; + this.expansionSetCode = "C15"; + } + + public OpenTheVaults(final OpenTheVaults card) { + super(card); + } + + @Override + public OpenTheVaults copy() { + return new OpenTheVaults(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/OranRiefTheVastwood.java b/Mage.Sets/src/mage/sets/commander2015/OranRiefTheVastwood.java new file mode 100644 index 00000000000..3ddc215763b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/OranRiefTheVastwood.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class OranRiefTheVastwood extends mage.sets.zendikar.OranRiefTheVastwood { + + public OranRiefTheVastwood(UUID ownerId) { + super(ownerId); + this.cardNumber = 297; + this.expansionSetCode = "C15"; + } + + public OranRiefTheVastwood(final OranRiefTheVastwood card) { + super(card); + } + + @Override + public OranRiefTheVastwood copy() { + return new OranRiefTheVastwood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/OreskosExplorer.java b/Mage.Sets/src/mage/sets/commander2015/OreskosExplorer.java new file mode 100644 index 00000000000..2eaff4701ed --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/OreskosExplorer.java @@ -0,0 +1,129 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterBasicLandCard; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LevelX2 + */ +public class OreskosExplorer extends CardImpl { + + public OreskosExplorer(UUID ownerId) { + super(ownerId, 6, "Oreskos Explorer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "C15"; + this.subtype.add("Cat"); + this.subtype.add("Scout"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Oreskos Explorer enters the battlefield, search your library for up to X Plains cards, + // where X is the number of players who control more lands than you. Reveal those cards, put them into your hand, then shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new OreskosExplorerEffect())); + + } + + public OreskosExplorer(final OreskosExplorer card) { + super(card); + } + + @Override + public OreskosExplorer copy() { + return new OreskosExplorer(this); + } +} + +class OreskosExplorerEffect extends OneShotEffect { + + public OreskosExplorerEffect() { + super(Outcome.PutLandInPlay); + this.staticText = "search your library for up to X Plains cards, where X is the number of players who control more lands than you. Reveal those cards, put them into your hand, then shuffle your library"; + } + + public OreskosExplorerEffect(final OreskosExplorerEffect effect) { + super(effect); + } + + @Override + public OreskosExplorerEffect copy() { + return new OreskosExplorerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller == null || sourceObject == null) { + return false; + } + + int controllerLands = game.getBattlefield().countAll(new FilterLandPermanent(), controller.getId(), game); + int landsToSearch = 0; + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + if (!playerId.equals(controller.getId())) { + if (controllerLands < game.getBattlefield().countAll(new FilterLandPermanent(), playerId, game)) { + landsToSearch++; + } + } + } + if (landsToSearch > 0) { + FilterBasicLandCard filterPlains = new FilterBasicLandCard("up to " + landsToSearch + " Plains cards"); + filterPlains.add(new ControllerPredicate(TargetController.YOU)); + filterPlains.add(new SubtypePredicate("Plains")); + TargetCardInLibrary target = new TargetCardInLibrary(0, landsToSearch, filterPlains); + if (controller.searchLibrary(target, game)) { + Cards cards = new CardsImpl(target.getTargets()); + controller.revealCards(sourceObject.getIdName(), cards, game); + controller.moveCards(cards.getCards(game), Zone.HAND, source, game); + } + } + controller.shuffleLibrary(game); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/OrimsThunder.java b/Mage.Sets/src/mage/sets/commander2015/OrimsThunder.java new file mode 100644 index 00000000000..d729ba66a6e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/OrimsThunder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class OrimsThunder extends mage.sets.apocalypse.OrimsThunder { + + public OrimsThunder(UUID ownerId) { + super(ownerId); + this.cardNumber = 78; + this.expansionSetCode = "C15"; + } + + public OrimsThunder(final OrimsThunder card) { + super(card); + } + + @Override + public OrimsThunder copy() { + return new OrimsThunder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/OrochiHatchery.java b/Mage.Sets/src/mage/sets/commander2015/OrochiHatchery.java new file mode 100644 index 00000000000..fd94f987e1f --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/OrochiHatchery.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class OrochiHatchery extends mage.sets.championsofkamigawa.OrochiHatchery { + + public OrochiHatchery(UUID ownerId) { + super(ownerId); + this.cardNumber = 260; + this.expansionSetCode = "C15"; + } + + public OrochiHatchery(final OrochiHatchery card) { + super(card); + } + + @Override + public OrochiHatchery copy() { + return new OrochiHatchery(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/OrzhovBasilica.java b/Mage.Sets/src/mage/sets/commander2015/OrzhovBasilica.java new file mode 100644 index 00000000000..8415f299711 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/OrzhovBasilica.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class OrzhovBasilica extends mage.sets.guildpact.OrzhovBasilica { + + public OrzhovBasilica(UUID ownerId) { + super(ownerId); + this.cardNumber = 298; + this.expansionSetCode = "C15"; + } + + public OrzhovBasilica(final OrzhovBasilica card) { + super(card); + } + + @Override + public OrzhovBasilica copy() { + return new OrzhovBasilica(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/OrzhovCluestone.java b/Mage.Sets/src/mage/sets/commander2015/OrzhovCluestone.java new file mode 100644 index 00000000000..0849f9dfee0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/OrzhovCluestone.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class OrzhovCluestone extends mage.sets.dragonsmaze.OrzhovCluestone { + + public OrzhovCluestone(UUID ownerId) { + super(ownerId); + this.cardNumber = 261; + this.expansionSetCode = "C15"; + } + + public OrzhovCluestone(final OrzhovCluestone card) { + super(card); + } + + @Override + public OrzhovCluestone copy() { + return new OrzhovCluestone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/OrzhovGuildgate.java b/Mage.Sets/src/mage/sets/commander2015/OrzhovGuildgate.java new file mode 100644 index 00000000000..ecbb8a36281 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/OrzhovGuildgate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class OrzhovGuildgate extends mage.sets.gatecrash.OrzhovGuildgate { + + public OrzhovGuildgate(UUID ownerId) { + super(ownerId); + this.cardNumber = 299; + this.expansionSetCode = "C15"; + } + + public OrzhovGuildgate(final OrzhovGuildgate card) { + super(card); + } + + @Override + public OrzhovGuildgate copy() { + return new OrzhovGuildgate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/OrzhovSignet.java b/Mage.Sets/src/mage/sets/commander2015/OrzhovSignet.java new file mode 100644 index 00000000000..50ac955686b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/OrzhovSignet.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class OrzhovSignet extends mage.sets.guildpact.OrzhovSignet { + + public OrzhovSignet(UUID ownerId) { + super(ownerId); + this.cardNumber = 262; + this.expansionSetCode = "C15"; + } + + public OrzhovSignet(final OrzhovSignet card) { + super(card); + } + + @Override + public OrzhovSignet copy() { + return new OrzhovSignet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Overrun.java b/Mage.Sets/src/mage/sets/commander2015/Overrun.java new file mode 100644 index 00000000000..cb335fa682e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Overrun.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Overrun extends mage.sets.magic2010.Overrun { + + public Overrun(UUID ownerId) { + super(ownerId); + this.cardNumber = 195; + this.expansionSetCode = "C15"; + } + + public Overrun(final Overrun card) { + super(card); + } + + @Override + public Overrun copy() { + return new Overrun(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/OverwhelmingStampede.java b/Mage.Sets/src/mage/sets/commander2015/OverwhelmingStampede.java new file mode 100644 index 00000000000..83b92aa7745 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/OverwhelmingStampede.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class OverwhelmingStampede extends mage.sets.magic2011.OverwhelmingStampede { + + public OverwhelmingStampede(UUID ownerId) { + super(ownerId); + this.cardNumber = 196; + this.expansionSetCode = "C15"; + } + + public OverwhelmingStampede(final OverwhelmingStampede card) { + super(card); + } + + @Override + public OverwhelmingStampede copy() { + return new OverwhelmingStampede(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/PatagiaViper.java b/Mage.Sets/src/mage/sets/commander2015/PatagiaViper.java new file mode 100644 index 00000000000..1a4949fe0be --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/PatagiaViper.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PatagiaViper extends mage.sets.dissension.PatagiaViper { + + public PatagiaViper(UUID ownerId) { + super(ownerId); + this.cardNumber = 197; + this.expansionSetCode = "C15"; + } + + public PatagiaViper(final PatagiaViper card) { + super(card); + } + + @Override + public PatagiaViper copy() { + return new PatagiaViper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/PathbreakerIbex.java b/Mage.Sets/src/mage/sets/commander2015/PathbreakerIbex.java new file mode 100644 index 00000000000..6b04e6a228f --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/PathbreakerIbex.java @@ -0,0 +1,107 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author fireshoes + */ +public class PathbreakerIbex extends CardImpl { + + public PathbreakerIbex(UUID ownerId) { + super(ownerId, 38, "Pathbreaker Ibex", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "C15"; + this.subtype.add("Goat"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Pathbreaker Ibex attacks, creatures you control gain trample and get +X/+X until end of turn, where X is the greatest power among creatures you control. + this.addAbility(new AttacksTriggeredAbility(new PathbreakerIbexEffect(), false)); + } + + public PathbreakerIbex(final PathbreakerIbex card) { + super(card); + } + + @Override + public PathbreakerIbex copy() { + return new PathbreakerIbex(this); + } +} + +class PathbreakerIbexEffect extends OneShotEffect { + + public PathbreakerIbexEffect() { + super(Outcome.BoostCreature); + this.staticText = "creatures you control gain trample and get +X/+X until end of turn, where X is the greatest power among creatures you control"; + } + + public PathbreakerIbexEffect(final PathbreakerIbexEffect effect) { + super(effect); + } + + @Override + public PathbreakerIbexEffect copy() { + return new PathbreakerIbexEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int maxPower = 0; + for (Permanent perm: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + if (perm.getPower().getValue() > maxPower) { + maxPower = perm.getPower().getValue(); + } + } + ContinuousEffect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfStep, new FilterCreaturePermanent()); + game.addEffect(effect, source); + if (maxPower != 0) { + effect = new BoostControlledEffect(maxPower, maxPower, Duration.EndOfTurn); + game.addEffect(effect, source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/PhyrexianArena.java b/Mage.Sets/src/mage/sets/commander2015/PhyrexianArena.java new file mode 100644 index 00000000000..5d56aca5124 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/PhyrexianArena.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PhyrexianArena extends mage.sets.apocalypse.PhyrexianArena { + + public PhyrexianArena(UUID ownerId) { + super(ownerId); + this.cardNumber = 130; + this.expansionSetCode = "C15"; + } + + public PhyrexianArena(final PhyrexianArena card) { + super(card); + } + + @Override + public PhyrexianArena copy() { + return new PhyrexianArena(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/PhyrexianPlaguelord.java b/Mage.Sets/src/mage/sets/commander2015/PhyrexianPlaguelord.java new file mode 100644 index 00000000000..07d62c005ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/PhyrexianPlaguelord.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PhyrexianPlaguelord extends mage.sets.urzaslegacy.PhyrexianPlaguelord { + + public PhyrexianPlaguelord(UUID ownerId) { + super(ownerId); + this.cardNumber = 131; + this.expansionSetCode = "C15"; + } + + public PhyrexianPlaguelord(final PhyrexianPlaguelord card) { + super(card); + } + + @Override + public PhyrexianPlaguelord copy() { + return new PhyrexianPlaguelord(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/PhyrexianRager.java b/Mage.Sets/src/mage/sets/commander2015/PhyrexianRager.java new file mode 100644 index 00000000000..c7bbc39f9b8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/PhyrexianRager.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PhyrexianRager extends mage.sets.tenthedition.PhyrexianRager { + + public PhyrexianRager(UUID ownerId) { + super(ownerId); + this.cardNumber = 132; + this.expansionSetCode = "C15"; + } + + public PhyrexianRager(final PhyrexianRager card) { + super(card); + } + + @Override + public PhyrexianRager copy() { + return new PhyrexianRager(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/PhyrexianReclamation.java b/Mage.Sets/src/mage/sets/commander2015/PhyrexianReclamation.java new file mode 100644 index 00000000000..09c579380e7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/PhyrexianReclamation.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PhyrexianReclamation extends mage.sets.urzaslegacy.PhyrexianReclamation { + + public PhyrexianReclamation(UUID ownerId) { + super(ownerId); + this.cardNumber = 133; + this.expansionSetCode = "C15"; + } + + public PhyrexianReclamation(final PhyrexianReclamation card) { + super(card); + } + + @Override + public PhyrexianReclamation copy() { + return new PhyrexianReclamation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Plains1.java b/Mage.Sets/src/mage/sets/commander2015/Plains1.java new file mode 100644 index 00000000000..6df3c22bdf6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Plains1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains1 extends mage.cards.basiclands.Plains { + + public Plains1(UUID ownerId) { + super(ownerId, 323); + this.expansionSetCode = "C15"; + } + + public Plains1(final Plains1 card) { + super(card); + } + + @Override + public Plains1 copy() { + return new Plains1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Plains2.java b/Mage.Sets/src/mage/sets/commander2015/Plains2.java new file mode 100644 index 00000000000..656f5074bd8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Plains2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains2 extends mage.cards.basiclands.Plains { + + public Plains2(UUID ownerId) { + super(ownerId, 324); + this.expansionSetCode = "C15"; + } + + public Plains2(final Plains2 card) { + super(card); + } + + @Override + public Plains2 copy() { + return new Plains2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Plains3.java b/Mage.Sets/src/mage/sets/commander2015/Plains3.java new file mode 100644 index 00000000000..fdd6a0e8f15 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Plains3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains3 extends mage.cards.basiclands.Plains { + + public Plains3(UUID ownerId) { + super(ownerId, 325); + this.expansionSetCode = "C15"; + } + + public Plains3(final Plains3 card) { + super(card); + } + + @Override + public Plains3 copy() { + return new Plains3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Plains4.java b/Mage.Sets/src/mage/sets/commander2015/Plains4.java new file mode 100644 index 00000000000..630aab930c1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Plains4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains4 extends mage.cards.basiclands.Plains { + + public Plains4(UUID ownerId) { + super(ownerId, 326); + this.expansionSetCode = "C15"; + } + + public Plains4(final Plains4 card) { + super(card); + } + + @Override + public Plains4 copy() { + return new Plains4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Plaxmanta.java b/Mage.Sets/src/mage/sets/commander2015/Plaxmanta.java new file mode 100644 index 00000000000..1526d4e5c6d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Plaxmanta.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plaxmanta extends mage.sets.dissension.Plaxmanta { + + public Plaxmanta(UUID ownerId) { + super(ownerId); + this.cardNumber = 100; + this.expansionSetCode = "C15"; + } + + public Plaxmanta(final Plaxmanta card) { + super(card); + } + + @Override + public Plaxmanta copy() { + return new Plaxmanta(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/PollutedMire.java b/Mage.Sets/src/mage/sets/commander2015/PollutedMire.java new file mode 100644 index 00000000000..558092f2ec0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/PollutedMire.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PollutedMire extends mage.sets.urzassaga.PollutedMire { + + public PollutedMire(UUID ownerId) { + super(ownerId); + this.cardNumber = 300; + this.expansionSetCode = "C15"; + } + + public PollutedMire(final PollutedMire card) { + super(card); + } + + @Override + public PollutedMire copy() { + return new PollutedMire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Preordain.java b/Mage.Sets/src/mage/sets/commander2015/Preordain.java new file mode 100644 index 00000000000..0bbe13d95f8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Preordain.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Preordain extends mage.sets.magic2011.Preordain { + + public Preordain(UUID ownerId) { + super(ownerId); + this.cardNumber = 101; + this.expansionSetCode = "C15"; + } + + public Preordain(final Preordain card) { + super(card); + } + + @Override + public Preordain copy() { + return new Preordain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/PrimalGrowth.java b/Mage.Sets/src/mage/sets/commander2015/PrimalGrowth.java new file mode 100644 index 00000000000..67fafd594ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/PrimalGrowth.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PrimalGrowth extends mage.sets.planeshift.PrimalGrowth { + + public PrimalGrowth(UUID ownerId) { + super(ownerId); + this.cardNumber = 198; + this.expansionSetCode = "C15"; + } + + public PrimalGrowth(final PrimalGrowth card) { + super(card); + } + + @Override + public PrimalGrowth copy() { + return new PrimalGrowth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/PrimeSpeakerZegana.java b/Mage.Sets/src/mage/sets/commander2015/PrimeSpeakerZegana.java new file mode 100644 index 00000000000..df10f933722 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/PrimeSpeakerZegana.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PrimeSpeakerZegana extends mage.sets.gatecrash.PrimeSpeakerZegana { + + public PrimeSpeakerZegana(UUID ownerId) { + super(ownerId); + this.cardNumber = 230; + this.expansionSetCode = "C15"; + } + + public PrimeSpeakerZegana(final PrimeSpeakerZegana card) { + super(card); + } + + @Override + public PrimeSpeakerZegana copy() { + return new PrimeSpeakerZegana(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/PropheticBolt.java b/Mage.Sets/src/mage/sets/commander2015/PropheticBolt.java new file mode 100644 index 00000000000..bd9a87ca73e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/PropheticBolt.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PropheticBolt extends mage.sets.commander.PropheticBolt { + + public PropheticBolt(UUID ownerId) { + super(ownerId); + this.cardNumber = 231; + this.expansionSetCode = "C15"; + } + + public PropheticBolt(final PropheticBolt card) { + super(card); + } + + @Override + public PropheticBolt copy() { + return new PropheticBolt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/PsychosisCrawler.java b/Mage.Sets/src/mage/sets/commander2015/PsychosisCrawler.java new file mode 100644 index 00000000000..745fa7cdfa1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/PsychosisCrawler.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PsychosisCrawler extends mage.sets.mirrodinbesieged.PsychosisCrawler { + + public PsychosisCrawler(UUID ownerId) { + super(ownerId); + this.cardNumber = 263; + this.expansionSetCode = "C15"; + } + + public PsychosisCrawler(final PsychosisCrawler card) { + super(card); + } + + @Override + public PsychosisCrawler copy() { + return new PsychosisCrawler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Putrefy.java b/Mage.Sets/src/mage/sets/commander2015/Putrefy.java new file mode 100644 index 00000000000..b2f063a6f08 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Putrefy.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Putrefy extends mage.sets.ravnica.Putrefy { + + public Putrefy(UUID ownerId) { + super(ownerId); + this.cardNumber = 232; + this.expansionSetCode = "C15"; + } + + public Putrefy(final Putrefy card) { + super(card); + } + + @Override + public Putrefy copy() { + return new Putrefy(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/RampantGrowth.java b/Mage.Sets/src/mage/sets/commander2015/RampantGrowth.java new file mode 100644 index 00000000000..2905ac935b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/RampantGrowth.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RampantGrowth extends mage.sets.magic2010.RampantGrowth { + + public RampantGrowth(UUID ownerId) { + super(ownerId); + this.cardNumber = 199; + this.expansionSetCode = "C15"; + } + + public RampantGrowth(final RampantGrowth card) { + super(card); + } + + @Override + public RampantGrowth copy() { + return new RampantGrowth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/RapidHybridization.java b/Mage.Sets/src/mage/sets/commander2015/RapidHybridization.java new file mode 100644 index 00000000000..8a781f07163 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/RapidHybridization.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RapidHybridization extends mage.sets.gatecrash.RapidHybridization { + + public RapidHybridization(UUID ownerId) { + super(ownerId); + this.cardNumber = 102; + this.expansionSetCode = "C15"; + } + + public RapidHybridization(final RapidHybridization card) { + super(card); + } + + @Override + public RapidHybridization copy() { + return new RapidHybridization(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ReinsOfPower.java b/Mage.Sets/src/mage/sets/commander2015/ReinsOfPower.java new file mode 100644 index 00000000000..ad4a9c1826e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ReinsOfPower.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class ReinsOfPower extends mage.sets.stronghold.ReinsOfPower { + + public ReinsOfPower(UUID ownerId) { + super(ownerId); + this.cardNumber = 103; + this.expansionSetCode = "C15"; + } + + public ReinsOfPower(final ReinsOfPower card) { + super(card); + } + + @Override + public ReinsOfPower copy() { + return new ReinsOfPower(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ReliquaryTower.java b/Mage.Sets/src/mage/sets/commander2015/ReliquaryTower.java new file mode 100644 index 00000000000..b9590f51361 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ReliquaryTower.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ReliquaryTower extends mage.sets.conflux.ReliquaryTower { + + public ReliquaryTower(UUID ownerId) { + super(ownerId); + this.cardNumber = 301; + this.expansionSetCode = "C15"; + } + + public ReliquaryTower(final ReliquaryTower card) { + super(card); + } + + @Override + public ReliquaryTower copy() { + return new ReliquaryTower(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Repeal.java b/Mage.Sets/src/mage/sets/commander2015/Repeal.java new file mode 100644 index 00000000000..cb707e76bff --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Repeal.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Repeal extends mage.sets.guildpact.Repeal { + + public Repeal(UUID ownerId) { + super(ownerId); + this.cardNumber = 104; + this.expansionSetCode = "C15"; + } + + public Repeal(final Repeal card) { + super(card); + } + + @Override + public Repeal copy() { + return new Repeal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/RighteousConfluence.java b/Mage.Sets/src/mage/sets/commander2015/RighteousConfluence.java new file mode 100644 index 00000000000..1edf38b36f9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/RighteousConfluence.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.KnightToken; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author LevelX2 + */ +public class RighteousConfluence extends CardImpl { + + public RighteousConfluence(UUID ownerId) { + super(ownerId, 7, "Righteous Confluence", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{W}{W}"); + this.expansionSetCode = "C15"; + + // Choose three - You may choose the same mode more than once. + this.getSpellAbility().getModes().setMinModes(3); + this.getSpellAbility().getModes().setMaxModes(3); + this.getSpellAbility().getModes().setEachModeMoreThanOnce(true); + + // - Put a 2/2 white Knight creature token with vigilance onto the battlefield; + this.getSpellAbility().addEffect(new CreateTokenEffect(new KnightToken())); + + // - Exile target enchantment; + Mode mode = new Mode(); + mode.getEffects().add(new ExileTargetEffect()); + mode.getTargets().add(new TargetEnchantmentPermanent()); + this.getSpellAbility().getModes().addMode(mode); + + // You gain 5 life; + mode = new Mode(); + mode.getEffects().add(new GainLifeEffect(5)); + this.getSpellAbility().getModes().addMode(mode); + } + + public RighteousConfluence(final RighteousConfluence card) { + super(card); + } + + @Override + public RighteousConfluence copy() { + return new RighteousConfluence(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/RiseFromTheGrave.java b/Mage.Sets/src/mage/sets/commander2015/RiseFromTheGrave.java new file mode 100644 index 00000000000..8ff6e8908b8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/RiseFromTheGrave.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RiseFromTheGrave extends mage.sets.magic2010.RiseFromTheGrave { + + public RiseFromTheGrave(UUID ownerId) { + super(ownerId); + this.cardNumber = 134; + this.expansionSetCode = "C15"; + } + + public RiseFromTheGrave(final RiseFromTheGrave card) { + super(card); + } + + @Override + public RiseFromTheGrave copy() { + return new RiseFromTheGrave(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/RiteOfReplication.java b/Mage.Sets/src/mage/sets/commander2015/RiteOfReplication.java new file mode 100644 index 00000000000..59d33de7632 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/RiteOfReplication.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RiteOfReplication extends mage.sets.zendikar.RiteOfReplication { + + public RiteOfReplication(UUID ownerId) { + super(ownerId); + this.cardNumber = 105; + this.expansionSetCode = "C15"; + } + + public RiteOfReplication(final RiteOfReplication card) { + super(card); + } + + @Override + public RiteOfReplication copy() { + return new RiteOfReplication(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/RiteOfTheRagingStorm.java b/Mage.Sets/src/mage/sets/commander2015/RiteOfTheRagingStorm.java new file mode 100644 index 00000000000..00bba6e1e66 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/RiteOfTheRagingStorm.java @@ -0,0 +1,136 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.effects.common.combat.CantAttackYouOrPlaneswalkerAllEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class RiteOfTheRagingStorm extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures named Lightning Rager"); + + static { + filter.add(new NamePredicate("Lightning Rager")); + } + + public RiteOfTheRagingStorm(UUID ownerId) { + super(ownerId, 30, "Rite of the Raging Storm", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}"); + this.expansionSetCode = "C15"; + + // Creatures named Lightning Rager can't attack you or planeswalkers you control. + Effect effect = new CantAttackYouOrPlaneswalkerAllEffect(Duration.WhileOnBattlefield, filter); + effect.setText("Creatures named Lightning Rager can't attack you or planeswalkers you control"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + + // At the beginning of each player's upkeep, that player puts a 5/1 red Elemental creature token named Lightning Rager onto the battlefield. + // It has trample, haste, and "At the beginning of the end step, sacrifice this creature." + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new RiteOfTheRagingStormEffect(), TargetController.ANY, false)); + } + + public RiteOfTheRagingStorm(final RiteOfTheRagingStorm card) { + super(card); + } + + @Override + public RiteOfTheRagingStorm copy() { + return new RiteOfTheRagingStorm(this); + } +} + +class RiteOfTheRagingStormEffect extends OneShotEffect { + + private static final String effectText = "that player puts a 5/1 red Elemental creature token named Lightning Rager onto the battlefield. " + + "It has trample, haste, and \"At the beginning of the end step, sacrifice this creature.\""; + + RiteOfTheRagingStormEffect() { + super(Outcome.Sacrifice); + staticText = effectText; + } + + RiteOfTheRagingStormEffect(RiteOfTheRagingStormEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { + Token lightningRagerToken = new LightningRagerToken(); + lightningRagerToken.putOntoBattlefield(1, game, this.getId(), player.getId()); + } + return false; + } + + @Override + public RiteOfTheRagingStormEffect copy() { + return new RiteOfTheRagingStormEffect(this); + } +} + +class LightningRagerToken extends Token { + + LightningRagerToken() { + super("Lightning Rager", "5/1 red Elemental creature token named Lightning Rager onto the battlefield." + + "It has trample, haste, and \"At the beginning of the end step, sacrifice this creature.\""); + this.setOriginalExpansionSetCode("C15"); + cardType.add(CardType.CREATURE); + color.setRed(true); + subtype.add("Elemental"); + power = new MageInt(5); + toughness = new MageInt(1); + addAbility(TrampleAbility.getInstance()); + addAbility(HasteAbility.getInstance()); + this.addAbility(new BeginningOfEndStepTriggeredAbility(new SacrificeSourceEffect(), TargetController.NEXT, false)); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/RoguesPassage.java b/Mage.Sets/src/mage/sets/commander2015/RoguesPassage.java new file mode 100644 index 00000000000..021d39a08aa --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/RoguesPassage.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RoguesPassage extends mage.sets.returntoravnica.RoguesPassage { + + public RoguesPassage(UUID ownerId) { + super(ownerId); + this.cardNumber = 302; + this.expansionSetCode = "C15"; + } + + public RoguesPassage(final RoguesPassage card) { + super(card); + } + + @Override + public RoguesPassage copy() { + return new RoguesPassage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SakuraTribeElder.java b/Mage.Sets/src/mage/sets/commander2015/SakuraTribeElder.java new file mode 100644 index 00000000000..c291e2e14fc --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SakuraTribeElder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SakuraTribeElder extends mage.sets.championsofkamigawa.SakuraTribeElder { + + public SakuraTribeElder(UUID ownerId) { + super(ownerId); + this.cardNumber = 200; + this.expansionSetCode = "C15"; + } + + public SakuraTribeElder(final SakuraTribeElder card) { + super(card); + } + + @Override + public SakuraTribeElder copy() { + return new SakuraTribeElder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SandstoneOracle.java b/Mage.Sets/src/mage/sets/commander2015/SandstoneOracle.java new file mode 100644 index 00000000000..d8b5e75178a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SandstoneOracle.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author emerald000 + */ +public class SandstoneOracle extends CardImpl { + + public SandstoneOracle(UUID ownerId) { + super(ownerId, 52, "Sandstone Oracle", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}"); + this.expansionSetCode = "C15"; + this.subtype.add("Sphinx"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Sandstone Oracle enters the battlefield, choose an opponent. If that player has more cards in hand that you, draw cards equal to the difference. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SandstoneOracleEffect())); + } + + public SandstoneOracle(final SandstoneOracle card) { + super(card); + } + + @Override + public SandstoneOracle copy() { + return new SandstoneOracle(this); + } +} + +class SandstoneOracleEffect extends OneShotEffect { + + SandstoneOracleEffect() { + super(Outcome.DrawCard); + this.staticText = "choose an opponent. If that player has more cards in hand than you, draw cards equal to the difference"; + } + + SandstoneOracleEffect(final SandstoneOracleEffect effect) { + super(effect); + } + + @Override + public SandstoneOracleEffect copy() { + return new SandstoneOracleEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + TargetOpponent target = new TargetOpponent(true); + if (controller.choose(Outcome.DrawCard, target, source.getSourceId(), game)) { + Player opponent = game.getPlayer(target.getFirstTarget()); + if (opponent != null) { + game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " has chosen " + opponent.getLogName()); + int cardsDiff = opponent.getHand().size() - controller.getHand().size(); + if (cardsDiff > 0) { + controller.drawCards(cardsDiff, game); + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SatyrWayfinder.java b/Mage.Sets/src/mage/sets/commander2015/SatyrWayfinder.java new file mode 100644 index 00000000000..61aebcfce3c --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SatyrWayfinder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SatyrWayfinder extends mage.sets.bornofthegods.SatyrWayfinder { + + public SatyrWayfinder(UUID ownerId) { + super(ownerId); + this.cardNumber = 201; + this.expansionSetCode = "C15"; + } + + public SatyrWayfinder(final SatyrWayfinder card) { + super(card); + } + + @Override + public SatyrWayfinder copy() { + return new SatyrWayfinder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ScouredBarrens.java b/Mage.Sets/src/mage/sets/commander2015/ScouredBarrens.java new file mode 100644 index 00000000000..217cf672c24 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ScouredBarrens.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ScouredBarrens extends mage.sets.khansoftarkir.ScouredBarrens { + + public ScouredBarrens(UUID ownerId) { + super(ownerId); + this.cardNumber = 302; + this.expansionSetCode = "C15"; + } + + public ScouredBarrens(final ScouredBarrens card) { + super(card); + } + + @Override + public ScouredBarrens copy() { + return new ScouredBarrens(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ScourgeOfNelToth.java b/Mage.Sets/src/mage/sets/commander2015/ScourgeOfNelToth.java new file mode 100644 index 00000000000..38eaaf4a7ea --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ScourgeOfNelToth.java @@ -0,0 +1,120 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.Costs; +import mage.abilities.costs.CostsImpl; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ScourgeOfNelToth extends CardImpl { + + public ScourgeOfNelToth(UUID ownerId) { + super(ownerId, 21, "Scourge of Nel Toth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); + this.expansionSetCode = "C15"; + this.subtype.add("Zombie"); + this.subtype.add("Dragon"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // You may cast Scourge of Nel Toth from your graveyard by paying {B}{B} and sacrificing two creatures rather than paying its mana cost. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new ScourgeOfNelTothPlayEffect())); + } + + public ScourgeOfNelToth(final ScourgeOfNelToth card) { + super(card); + } + + @Override + public ScourgeOfNelToth copy() { + return new ScourgeOfNelToth(this); + } +} + +class ScourgeOfNelTothPlayEffect extends AsThoughEffectImpl { + + public ScourgeOfNelTothPlayEffect() { + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); + staticText = "You may cast {this} from your graveyard by paying {B}{B} and sacrificing two creatures rather than paying its mana cost"; + } + + public ScourgeOfNelTothPlayEffect(final ScourgeOfNelTothPlayEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public ScourgeOfNelTothPlayEffect copy() { + return new ScourgeOfNelTothPlayEffect(this); + } + + @Override + public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { + if (sourceId.equals(source.getSourceId()) && source.getControllerId().equals(affectedControllerId)) { + if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { + Player player = game.getPlayer(affectedControllerId); + if (player != null) { + // can sometimes be cast with base mana cost from grave???? + Costs costs = new CostsImpl<>(); + costs.add(new SacrificeTargetCost(new TargetControlledCreaturePermanent(2))); + player.setCastSourceIdWithAlternateMana(sourceId, new ManaCostsImpl<>("{B}{B}"), costs); + return true; + } + } + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Scytheclaw.java b/Mage.Sets/src/mage/sets/commander2015/Scytheclaw.java new file mode 100644 index 00000000000..33aff6d7103 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Scytheclaw.java @@ -0,0 +1,154 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.LivingWeaponAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.DamagedPlayerEvent; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class Scytheclaw extends CardImpl { + + public Scytheclaw(UUID ownerId) { + super(ownerId, 53, "Scytheclaw", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "C15"; + this.subtype.add("Equipment"); + + // Living weapon + this.addAbility(new LivingWeaponAbility()); + + // Equipped creature gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1))); + + // Whenever equipped creature deals combat damage to a player, that player loses half of his or her life, round up. + this.addAbility(new ScytheclawTriggeredAbility()); + + // Equip {3} + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); + } + + public Scytheclaw(final Scytheclaw card) { + super(card); + } + + @Override + public Scytheclaw copy() { + return new Scytheclaw(this); + } +} + +class ScytheclawTriggeredAbility extends TriggeredAbilityImpl { + + public ScytheclawTriggeredAbility() { + super(Zone.BATTLEFIELD, new ScytheclawEffect()); + } + + public ScytheclawTriggeredAbility(final ScytheclawTriggeredAbility ability) { + super(ability); + } + + @Override + public ScytheclawTriggeredAbility copy() { + return new ScytheclawTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + Permanent p = game.getPermanent(event.getSourceId()); + if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); + } + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever equipped creature deals combat damage to a player, " + super.getRule(); + } +} + +class ScytheclawEffect extends OneShotEffect { + + public ScytheclawEffect() { + super(Outcome.Damage); + this.staticText = "that player loses half his or her life, rounded up"; + } + + public ScytheclawEffect(final ScytheclawEffect effect) { + super(effect); + } + + @Override + public ScytheclawEffect copy() { + return new ScytheclawEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (player != null) { + Integer amount = (int) Math.ceil(player.getLife() / 2f); + if (amount > 0) { + player.loseLife(amount, game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SealOfCleansing.java b/Mage.Sets/src/mage/sets/commander2015/SealOfCleansing.java new file mode 100644 index 00000000000..244feeb52a6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SealOfCleansing.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SealOfCleansing extends mage.sets.nemesis.SealOfCleansing { + + public SealOfCleansing(UUID ownerId) { + super(ownerId); + this.cardNumber = 79; + this.expansionSetCode = "C15"; + } + + public SealOfCleansing(final SealOfCleansing card) { + super(card); + } + + @Override + public SealOfCleansing copy() { + return new SealOfCleansing(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SealOfDoom.java b/Mage.Sets/src/mage/sets/commander2015/SealOfDoom.java new file mode 100644 index 00000000000..5012cadab1d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SealOfDoom.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SealOfDoom extends mage.sets.dissension.SealOfDoom { + + public SealOfDoom(UUID ownerId) { + super(ownerId); + this.cardNumber = 135; + this.expansionSetCode = "C15"; + } + + public SealOfDoom(final SealOfDoom card) { + super(card); + } + + @Override + public SealOfDoom copy() { + return new SealOfDoom(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SealOfTheGuildpact.java b/Mage.Sets/src/mage/sets/commander2015/SealOfTheGuildpact.java new file mode 100644 index 00000000000..11cf25b89ca --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SealOfTheGuildpact.java @@ -0,0 +1,190 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageObject; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.choices.ChoiceColor; +import mage.constants.CardType; +import mage.constants.CostModificationType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.util.CardUtil; + +/** + * + * @author emerald000 + */ +public class SealOfTheGuildpact extends CardImpl { + + public SealOfTheGuildpact(UUID ownerId) { + super(ownerId, 54, "Seal of the Guildpact", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "C15"; + + // As Seal of the Guildpact enters the battlefield, choose two colors. + this.addAbility(new EntersBattlefieldAbility(new SealOfTheGuildpactChooseColorEffect())); + + // Each spell you cast costs {1} less to cast for each of the chosen colors it is. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SealOfTheGuildpactCostReductionEffect())); + } + + public SealOfTheGuildpact(final SealOfTheGuildpact card) { + super(card); + } + + @Override + public SealOfTheGuildpact copy() { + return new SealOfTheGuildpact(this); + } +} + +class SealOfTheGuildpactChooseColorEffect extends OneShotEffect { + + SealOfTheGuildpactChooseColorEffect() { + super(Outcome.Benefit); + this.staticText = "choose two colors"; + } + + SealOfTheGuildpactChooseColorEffect(final SealOfTheGuildpactChooseColorEffect effect) { + super(effect); + } + + @Override + public SealOfTheGuildpactChooseColorEffect copy() { + return new SealOfTheGuildpactChooseColorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject mageObject = game.getPermanentEntering(source.getSourceId()); + if (controller != null && mageObject != null) { + ChoiceColor choice1 = new ChoiceColor(); + while (!choice1.isChosen()) { + controller.choose(Outcome.Benefit, choice1, game); + if (!controller.canRespond()) { + return false; + } + } + String color1 = choice1.getChoice(); + Set choices2 = new HashSet<>(); + if (!color1.equals("White")) { + choices2.add("White"); + } + if (!color1.equals("Blue")) { + choices2.add("Blue"); + } + if (!color1.equals("Black")) { + choices2.add("Black"); + } + if (!color1.equals("Red")) { + choices2.add("Red"); + } + if (!color1.equals("Green")) { + choices2.add("Green"); + } + ChoiceColor choice2 = new ChoiceColor(); + choice2.setChoices(choices2); + while (!choice2.isChosen()) { + controller.choose(Outcome.Benefit, choice2, game); + if (!controller.canRespond()) { + return false; + } + } + String color2 = choice2.getChoice(); + if (!game.isSimulation()) { + game.informPlayers(mageObject.getLogName() + ": " + controller.getLogName() + " has chosen " + color1 + " and " + color2 + "."); + } + game.getState().setValue(mageObject.getId() + "_color1", choice1.getColor()); + game.getState().setValue(mageObject.getId() + "_color2", choice2.getColor()); + ((Card) mageObject).addInfo("chosen colors", CardUtil.addToolTipMarkTags("Chosen colors: " + color1 + " and " + color2), game); + return true; + } + return false; + } +} + +class SealOfTheGuildpactCostReductionEffect extends CostModificationEffectImpl { + + SealOfTheGuildpactCostReductionEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); + staticText = "Each spell you cast costs {1} less to cast for each of the chosen colors it is"; + } + + SealOfTheGuildpactCostReductionEffect(SealOfTheGuildpactCostReductionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + MageObject sourceObject = game.getObject(abilityToModify.getSourceId()); + if (sourceObject != null) { + ObjectColor color1 = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color1"); + ObjectColor color2 = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color2"); + int amount = 0; + if (color1 != null && sourceObject.getColor(game).contains(color1)) { + amount++; + } + if (color2 != null && sourceObject.getColor(game).contains(color2)) { + amount++; + } + if (amount > 0) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + CardUtil.adjustCost(spellAbility, amount); + } + return true; + } + return false; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + return abilityToModify.getControllerId().equals(source.getControllerId()) && + abilityToModify instanceof SpellAbility; + } + + @Override + public SealOfTheGuildpactCostReductionEffect copy() { + return new SealOfTheGuildpactCostReductionEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SecludedSteppe.java b/Mage.Sets/src/mage/sets/commander2015/SecludedSteppe.java new file mode 100644 index 00000000000..6443d1f85cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SecludedSteppe.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SecludedSteppe extends mage.sets.onslaught.SecludedSteppe { + + public SecludedSteppe(UUID ownerId) { + super(ownerId); + this.cardNumber = 303; + this.expansionSetCode = "C15"; + } + + public SecludedSteppe(final SecludedSteppe card) { + super(card); + } + + @Override + public SecludedSteppe copy() { + return new SecludedSteppe(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SeersSundial.java b/Mage.Sets/src/mage/sets/commander2015/SeersSundial.java new file mode 100644 index 00000000000..42c73d2a695 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SeersSundial.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SeersSundial extends mage.sets.worldwake.SeersSundial { + + public SeersSundial(UUID ownerId) { + super(ownerId); + this.cardNumber = 264; + this.expansionSetCode = "C15"; + } + + public SeersSundial(final SeersSundial card) { + super(card); + } + + @Override + public SeersSundial copy() { + return new SeersSundial(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SeverTheBloodline.java b/Mage.Sets/src/mage/sets/commander2015/SeverTheBloodline.java new file mode 100644 index 00000000000..74b87eef069 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SeverTheBloodline.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SeverTheBloodline extends mage.sets.innistrad.SeverTheBloodline { + + public SeverTheBloodline(UUID ownerId) { + super(ownerId); + this.cardNumber = 136; + this.expansionSetCode = "C15"; + } + + public SeverTheBloodline(final SeverTheBloodline card) { + super(card); + } + + @Override + public SeverTheBloodline copy() { + return new SeverTheBloodline(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ShieldedByFaith.java b/Mage.Sets/src/mage/sets/commander2015/ShieldedByFaith.java new file mode 100644 index 00000000000..c88b135a944 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ShieldedByFaith.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class ShieldedByFaith extends CardImpl { + + public ShieldedByFaith(UUID ownerId) { + super(ownerId, 8, "Shielded by Faith", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); + this.expansionSetCode = "C15"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + + // Enchanted creature has indestructible. + Effect effect = new GainAbilityAttachedEffect(IndestructibleAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield); + effect.setText("Enchanted creature has indestructible"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + + // Whenever a creature enters the battlefield, you may attach Shielded by Faith to that creature. + this.addAbility(new EntersBattlefieldAllTriggeredAbility( + Zone.BATTLEFIELD, new AttachEffect(Outcome.Neutral, "attach {source} to that creature"), + new FilterCreaturePermanent("a creature"), true, SetTargetPointer.PERMANENT, null, false)); + } + + public ShieldedByFaith(final ShieldedByFaith card) { + super(card); + } + + @Override + public ShieldedByFaith copy() { + return new ShieldedByFaith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Shriekmaw.java b/Mage.Sets/src/mage/sets/commander2015/Shriekmaw.java new file mode 100644 index 00000000000..025aad0dbf6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Shriekmaw.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Shriekmaw extends mage.sets.commander.Shriekmaw { + + public Shriekmaw(UUID ownerId) { + super(ownerId); + this.cardNumber = 137; + this.expansionSetCode = "C15"; + } + + public Shriekmaw(final Shriekmaw card) { + super(card); + } + + @Override + public Shriekmaw copy() { + return new Shriekmaw(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SigilOfTheEmptyThrone.java b/Mage.Sets/src/mage/sets/commander2015/SigilOfTheEmptyThrone.java new file mode 100644 index 00000000000..c78877b3f84 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SigilOfTheEmptyThrone.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SigilOfTheEmptyThrone extends mage.sets.conflux.SigilOfTheEmptyThrone { + + public SigilOfTheEmptyThrone(UUID ownerId) { + super(ownerId); + this.cardNumber = 80; + this.expansionSetCode = "C15"; + } + + public SigilOfTheEmptyThrone(final SigilOfTheEmptyThrone card) { + super(card); + } + + @Override + public SigilOfTheEmptyThrone copy() { + return new SigilOfTheEmptyThrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SilentSentinel.java b/Mage.Sets/src/mage/sets/commander2015/SilentSentinel.java new file mode 100644 index 00000000000..d608fe628c6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SilentSentinel.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SilentSentinel extends mage.sets.bornofthegods.SilentSentinel { + + public SilentSentinel(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "C15"; + } + + public SilentSentinel(final SilentSentinel card) { + super(card); + } + + @Override + public SilentSentinel copy() { + return new SilentSentinel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SimicGrowthChamber.java b/Mage.Sets/src/mage/sets/commander2015/SimicGrowthChamber.java new file mode 100644 index 00000000000..ef06b1b9f01 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SimicGrowthChamber.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SimicGrowthChamber extends mage.sets.dissension.SimicGrowthChamber { + + public SimicGrowthChamber(UUID ownerId) { + super(ownerId); + this.cardNumber = 305; + this.expansionSetCode = "C15"; + } + + public SimicGrowthChamber(final SimicGrowthChamber card) { + super(card); + } + + @Override + public SimicGrowthChamber copy() { + return new SimicGrowthChamber(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SimicGuildgate.java b/Mage.Sets/src/mage/sets/commander2015/SimicGuildgate.java new file mode 100644 index 00000000000..254b864fcb4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SimicGuildgate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SimicGuildgate extends mage.sets.gatecrash.SimicGuildgate { + + public SimicGuildgate(UUID ownerId) { + super(ownerId); + this.cardNumber = 306; + this.expansionSetCode = "C15"; + } + + public SimicGuildgate(final SimicGuildgate card) { + super(card); + } + + @Override + public SimicGuildgate copy() { + return new SimicGuildgate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SimicKeyrune.java b/Mage.Sets/src/mage/sets/commander2015/SimicKeyrune.java new file mode 100644 index 00000000000..f1f1b75b73a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SimicKeyrune.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SimicKeyrune extends mage.sets.gatecrash.SimicKeyrune { + + public SimicKeyrune(UUID ownerId) { + super(ownerId); + this.cardNumber = 265; + this.expansionSetCode = "C15"; + } + + public SimicKeyrune(final SimicKeyrune card) { + super(card); + } + + @Override + public SimicKeyrune copy() { + return new SimicKeyrune(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SimicSignet.java b/Mage.Sets/src/mage/sets/commander2015/SimicSignet.java new file mode 100644 index 00000000000..771152803e4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SimicSignet.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SimicSignet extends mage.sets.dissension.SimicSignet { + + public SimicSignet(UUID ownerId) { + super(ownerId); + this.cardNumber = 266; + this.expansionSetCode = "C15"; + } + + public SimicSignet(final SimicSignet card) { + super(card); + } + + @Override + public SimicSignet copy() { + return new SimicSignet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Skullclamp.java b/Mage.Sets/src/mage/sets/commander2015/Skullclamp.java new file mode 100644 index 00000000000..88b37bc1598 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Skullclamp.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Skullclamp extends mage.sets.darksteel.Skullclamp { + + public Skullclamp(UUID ownerId) { + super(ownerId); + this.cardNumber = 267; + this.expansionSetCode = "C15"; + } + + public Skullclamp(final Skullclamp card) { + super(card); + } + + @Override + public Skullclamp copy() { + return new Skullclamp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Skullwinder.java b/Mage.Sets/src/mage/sets/commander2015/Skullwinder.java new file mode 100644 index 00000000000..b098242ec27 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Skullwinder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetOpponent; + +/** + * + * @author LevelX2 + */ +public class Skullwinder extends CardImpl { + + public Skullwinder(UUID ownerId) { + super(ownerId, 39, "Skullwinder", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "C15"; + this.subtype.add("Snake"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // When Skullwinder enters the battlefield, return target card from your graveyard to your hand, then choose an opponent. That player returns a card from his or her graveyard to his or her hand. + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect()); + ability.addTarget(new TargetCardInYourGraveyard()); + ability.addEffect(new SkullwinderEffect()); + this.addAbility(ability); + } + + public Skullwinder(final Skullwinder card) { + super(card); + } + + @Override + public Skullwinder copy() { + return new Skullwinder(this); + } +} + +class SkullwinderEffect extends OneShotEffect { + + public SkullwinderEffect() { + super(Outcome.Benefit); + this.staticText = ", then choose an opponent. That player returns a card from his or her graveyard to his or her hand"; + } + + public SkullwinderEffect(final SkullwinderEffect effect) { + super(effect); + } + + @Override + public SkullwinderEffect copy() { + return new SkullwinderEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + TargetOpponent targetOpponent = new TargetOpponent(true); + if (controller.choose(Outcome.Detriment, targetOpponent, source.getSourceId(), game)) { + Player opponent = game.getPlayer(targetOpponent.getFirstTarget()); + if (opponent != null) { + game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " has chosen " + opponent.getLogName()); + // That player returns a card from his or her graveyard to his or her hand + TargetCardInYourGraveyard targetCard = new TargetCardInYourGraveyard(new FilterCard("a card from your graveyard to return to your hand")); + targetCard.setNotTarget(true); + if (opponent.choose(outcome, targetCard, source.getSourceId(), game)) { + Card card = game.getCard(targetCard.getFirstTarget()); + if (card != null) { + opponent.moveCards(card, Zone.HAND, source, game); + } + } + } + } + return true; + } + return false; + + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Sleep.java b/Mage.Sets/src/mage/sets/commander2015/Sleep.java new file mode 100644 index 00000000000..00425abf8a6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Sleep.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Sleep extends mage.sets.magic2010.Sleep { + + public Sleep(UUID ownerId) { + super(ownerId); + this.cardNumber = 106; + this.expansionSetCode = "C15"; + } + + public Sleep(final Sleep card) { + super(card); + } + + @Override + public Sleep copy() { + return new Sleep(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SlipperyKarst.java b/Mage.Sets/src/mage/sets/commander2015/SlipperyKarst.java new file mode 100644 index 00000000000..c1db1cdc6cc --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SlipperyKarst.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SlipperyKarst extends mage.sets.urzassaga.SlipperyKarst { + + public SlipperyKarst(UUID ownerId) { + super(ownerId); + this.cardNumber = 307; + this.expansionSetCode = "C15"; + } + + public SlipperyKarst(final SlipperyKarst card) { + super(card); + } + + @Override + public SlipperyKarst copy() { + return new SlipperyKarst(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SmolderingCrater.java b/Mage.Sets/src/mage/sets/commander2015/SmolderingCrater.java new file mode 100644 index 00000000000..f8f6dac90bc --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SmolderingCrater.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SmolderingCrater extends mage.sets.urzassaga.SmolderingCrater { + + public SmolderingCrater(UUID ownerId) { + super(ownerId); + this.cardNumber = 308; + this.expansionSetCode = "C15"; + } + + public SmolderingCrater(final SmolderingCrater card) { + super(card); + } + + @Override + public SmolderingCrater copy() { + return new SmolderingCrater(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Snakeform.java b/Mage.Sets/src/mage/sets/commander2015/Snakeform.java new file mode 100644 index 00000000000..1d9be22ebf1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Snakeform.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Snakeform extends mage.sets.eventide.Snakeform { + + public Snakeform(UUID ownerId) { + super(ownerId); + this.cardNumber = 242; + this.expansionSetCode = "C15"; + } + + public Snakeform(final Snakeform card) { + super(card); + } + + @Override + public Snakeform copy() { + return new Snakeform(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SolRing.java b/Mage.Sets/src/mage/sets/commander2015/SolRing.java new file mode 100644 index 00000000000..e1f03fe39f9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SolRing.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SolRing extends mage.sets.revisededition.SolRing { + + public SolRing(UUID ownerId) { + super(ownerId); + this.cardNumber = 268; + this.expansionSetCode = "C15"; + } + + public SolRing(final SolRing card) { + super(card); + } + + @Override + public SolRing copy() { + return new SolRing(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SolemnSimulacrum.java b/Mage.Sets/src/mage/sets/commander2015/SolemnSimulacrum.java new file mode 100644 index 00000000000..c09472ce0ec --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SolemnSimulacrum.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SolemnSimulacrum extends mage.sets.magic2012.SolemnSimulacrum { + + public SolemnSimulacrum(UUID ownerId) { + super(ownerId); + this.cardNumber = 269; + this.expansionSetCode = "C15"; + } + + public SolemnSimulacrum(final SolemnSimulacrum card) { + super(card); + } + + @Override + public SolemnSimulacrum copy() { + return new SolemnSimulacrum(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SpiderSpawning.java b/Mage.Sets/src/mage/sets/commander2015/SpiderSpawning.java new file mode 100644 index 00000000000..d91b5c51fee --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SpiderSpawning.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SpiderSpawning extends mage.sets.innistrad.SpiderSpawning { + + public SpiderSpawning(UUID ownerId) { + super(ownerId); + this.cardNumber = 202; + this.expansionSetCode = "C15"; + } + + public SpiderSpawning(final SpiderSpawning card) { + super(card); + } + + @Override + public SpiderSpawning copy() { + return new SpiderSpawning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SpinerockKnoll.java b/Mage.Sets/src/mage/sets/commander2015/SpinerockKnoll.java new file mode 100644 index 00000000000..979edfc61a7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SpinerockKnoll.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SpinerockKnoll extends mage.sets.lorwyn.SpinerockKnoll { + + public SpinerockKnoll(UUID ownerId) { + super(ownerId); + this.cardNumber = 309; + this.expansionSetCode = "C15"; + } + + public SpinerockKnoll(final SpinerockKnoll card) { + super(card); + } + + @Override + public SpinerockKnoll copy() { + return new SpinerockKnoll(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/StaffOfNin.java b/Mage.Sets/src/mage/sets/commander2015/StaffOfNin.java new file mode 100644 index 00000000000..c3a33f04678 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/StaffOfNin.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class StaffOfNin extends mage.sets.magic2013.StaffOfNin { + + public StaffOfNin(UUID ownerId) { + super(ownerId); + this.cardNumber = 270; + this.expansionSetCode = "C15"; + } + + public StaffOfNin(final StaffOfNin card) { + super(card); + } + + @Override + public StaffOfNin copy() { + return new StaffOfNin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SteamAugury.java b/Mage.Sets/src/mage/sets/commander2015/SteamAugury.java new file mode 100644 index 00000000000..e8a9b3bade3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SteamAugury.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SteamAugury extends mage.sets.theros.SteamAugury { + + public SteamAugury(UUID ownerId) { + super(ownerId); + this.cardNumber = 233; + this.expansionSetCode = "C15"; + } + + public SteamAugury(final SteamAugury card) { + super(card); + } + + @Override + public SteamAugury copy() { + return new SteamAugury(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/StingerflingSpider.java b/Mage.Sets/src/mage/sets/commander2015/StingerflingSpider.java new file mode 100644 index 00000000000..c4672e6683b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/StingerflingSpider.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class StingerflingSpider extends mage.sets.magic2012.StingerflingSpider { + + public StingerflingSpider(UUID ownerId) { + super(ownerId); + this.cardNumber = 203; + this.expansionSetCode = "C15"; + } + + public StingerflingSpider(final StingerflingSpider card) { + super(card); + } + + @Override + public StingerflingSpider copy() { + return new StingerflingSpider(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/StinkdrinkerDaredevil.java b/Mage.Sets/src/mage/sets/commander2015/StinkdrinkerDaredevil.java new file mode 100644 index 00000000000..9e8dacaa581 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/StinkdrinkerDaredevil.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class StinkdrinkerDaredevil extends mage.sets.lorwyn.StinkdrinkerDaredevil { + + public StinkdrinkerDaredevil(UUID ownerId) { + super(ownerId); + this.cardNumber = 164; + this.expansionSetCode = "C15"; + } + + public StinkdrinkerDaredevil(final StinkdrinkerDaredevil card) { + super(card); + } + + @Override + public StinkdrinkerDaredevil copy() { + return new StinkdrinkerDaredevil(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/StolenGoods.java b/Mage.Sets/src/mage/sets/commander2015/StolenGoods.java new file mode 100644 index 00000000000..a72735aaf60 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/StolenGoods.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class StolenGoods extends mage.sets.avacynrestored.StolenGoods { + + public StolenGoods(UUID ownerId) { + super(ownerId); + this.cardNumber = 107; + this.expansionSetCode = "C15"; + } + + public StolenGoods(final StolenGoods card) { + super(card); + } + + @Override + public StolenGoods copy() { + return new StolenGoods(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/StoneshockGiant.java b/Mage.Sets/src/mage/sets/commander2015/StoneshockGiant.java new file mode 100644 index 00000000000..fdf6e9245c2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/StoneshockGiant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class StoneshockGiant extends mage.sets.theros.StoneshockGiant { + + public StoneshockGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 165; + this.expansionSetCode = "C15"; + } + + public StoneshockGiant(final StoneshockGiant card) { + super(card); + } + + @Override + public StoneshockGiant copy() { + return new StoneshockGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/StrokeOfGenius.java b/Mage.Sets/src/mage/sets/commander2015/StrokeOfGenius.java new file mode 100644 index 00000000000..79953c02aec --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/StrokeOfGenius.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class StrokeOfGenius extends mage.sets.urzassaga.StrokeOfGenius { + + public StrokeOfGenius(UUID ownerId) { + super(ownerId); + this.cardNumber = 108; + this.expansionSetCode = "C15"; + } + + public StrokeOfGenius(final StrokeOfGenius card) { + super(card); + } + + @Override + public StrokeOfGenius copy() { + return new StrokeOfGenius(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SunTitan.java b/Mage.Sets/src/mage/sets/commander2015/SunTitan.java new file mode 100644 index 00000000000..1e359759529 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SunTitan.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SunTitan extends mage.sets.magic2011.SunTitan { + + public SunTitan(UUID ownerId) { + super(ownerId); + this.cardNumber = 82; + this.expansionSetCode = "C15"; + } + + public SunTitan(final SunTitan card) { + super(card); + } + + @Override + public SunTitan copy() { + return new SunTitan(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SunriseSovereign.java b/Mage.Sets/src/mage/sets/commander2015/SunriseSovereign.java new file mode 100644 index 00000000000..bd0794d0e69 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SunriseSovereign.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SunriseSovereign extends mage.sets.lorwyn.SunriseSovereign { + + public SunriseSovereign(UUID ownerId) { + super(ownerId); + this.cardNumber = 166; + this.expansionSetCode = "C15"; + } + + public SunriseSovereign(final SunriseSovereign card) { + super(card); + } + + @Override + public SunriseSovereign copy() { + return new SunriseSovereign(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Swamp1.java b/Mage.Sets/src/mage/sets/commander2015/Swamp1.java new file mode 100644 index 00000000000..536d848d27f --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Swamp1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp1 extends mage.cards.basiclands.Swamp { + + public Swamp1(UUID ownerId) { + super(ownerId, 331); + this.expansionSetCode = "C15"; + } + + public Swamp1(final Swamp1 card) { + super(card); + } + + @Override + public Swamp1 copy() { + return new Swamp1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Swamp2.java b/Mage.Sets/src/mage/sets/commander2015/Swamp2.java new file mode 100644 index 00000000000..9cca76feb1d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Swamp2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp2 extends mage.cards.basiclands.Swamp { + + public Swamp2(UUID ownerId) { + super(ownerId, 332); + this.expansionSetCode = "C15"; + } + + public Swamp2(final Swamp2 card) { + super(card); + } + + @Override + public Swamp2 copy() { + return new Swamp2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Swamp3.java b/Mage.Sets/src/mage/sets/commander2015/Swamp3.java new file mode 100644 index 00000000000..5c0449b2f4d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Swamp3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp3 extends mage.cards.basiclands.Swamp { + + public Swamp3(UUID ownerId) { + super(ownerId, 333); + this.expansionSetCode = "C15"; + } + + public Swamp3(final Swamp3 card) { + super(card); + } + + @Override + public Swamp3 copy() { + return new Swamp3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Swamp4.java b/Mage.Sets/src/mage/sets/commander2015/Swamp4.java new file mode 100644 index 00000000000..20be7ab8576 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Swamp4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp4 extends mage.cards.basiclands.Swamp { + + public Swamp4(UUID ownerId) { + super(ownerId, 334); + this.expansionSetCode = "C15"; + } + + public Swamp4(final Swamp4 card) { + super(card); + } + + @Override + public Swamp4 copy() { + return new Swamp4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SwiftfootBoots.java b/Mage.Sets/src/mage/sets/commander2015/SwiftfootBoots.java new file mode 100644 index 00000000000..de7e11c4be1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SwiftfootBoots.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SwiftfootBoots extends mage.sets.magic2012.SwiftfootBoots { + + public SwiftfootBoots(UUID ownerId) { + super(ownerId); + this.cardNumber = 271; + this.expansionSetCode = "C15"; + } + + public SwiftfootBoots(final SwiftfootBoots card) { + super(card); + } + + @Override + public SwiftfootBoots copy() { + return new SwiftfootBoots(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SwiftwaterCliffs.java b/Mage.Sets/src/mage/sets/commander2015/SwiftwaterCliffs.java new file mode 100644 index 00000000000..6ca4f2d7015 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SwiftwaterCliffs.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SwiftwaterCliffs extends mage.sets.khansoftarkir.SwiftwaterCliffs { + + public SwiftwaterCliffs(UUID ownerId) { + super(ownerId); + this.cardNumber = 310; + this.expansionSetCode = "C15"; + } + + public SwiftwaterCliffs(final SwiftwaterCliffs card) { + super(card); + } + + @Override + public SwiftwaterCliffs copy() { + return new SwiftwaterCliffs(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SwordOfVengeance.java b/Mage.Sets/src/mage/sets/commander2015/SwordOfVengeance.java new file mode 100644 index 00000000000..b162c58e41b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SwordOfVengeance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SwordOfVengeance extends mage.sets.magic2011.SwordOfVengeance { + + public SwordOfVengeance(UUID ownerId) { + super(ownerId); + this.cardNumber = 272; + this.expansionSetCode = "C15"; + } + + public SwordOfVengeance(final SwordOfVengeance card) { + super(card); + } + + @Override + public SwordOfVengeance copy() { + return new SwordOfVengeance(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/SyntheticDestiny.java b/Mage.Sets/src/mage/sets/commander2015/SyntheticDestiny.java new file mode 100644 index 00000000000..142ddc269ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/SyntheticDestiny.java @@ -0,0 +1,158 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class SyntheticDestiny extends CardImpl { + + public SyntheticDestiny(UUID ownerId) { + super(ownerId, 15, "Synthetic Destiny", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{4}{U}{U}"); + this.expansionSetCode = "C15"; + + // Exile all creatures you control. At the beginning of the next end step, reveal cards from the top of your library until you reveal that many creature cards, put all creature cards revealed this way onto the battlefield, then shuffle the rest of the revealed cards into your library. + getSpellAbility().addEffect(new SyntheticDestinyEffect()); + } + + public SyntheticDestiny(final SyntheticDestiny card) { + super(card); + } + + @Override + public SyntheticDestiny copy() { + return new SyntheticDestiny(this); + } +} + +class SyntheticDestinyEffect extends OneShotEffect { + + public SyntheticDestinyEffect() { + super(Outcome.Detriment); + this.staticText = "Exile all creatures you control. At the beginning of the next end step, reveal cards from the top of your library until you reveal that many creature cards, put all creature cards revealed this way onto the battlefield, then shuffle the rest of the revealed cards into your library"; + } + + public SyntheticDestinyEffect(final SyntheticDestinyEffect effect) { + super(effect); + } + + @Override + public SyntheticDestinyEffect copy() { + return new SyntheticDestinyEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Set cardsToExile = new HashSet<>(); + cardsToExile.addAll(game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controller.getId(), game)); + controller.moveCards(cardsToExile, Zone.EXILED, source, game); + //Delayed ability + Effect effect = new SyntheticDestinyDelayedEffect(cardsToExile.size()); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + + return true; + } + return false; + } +} + +class SyntheticDestinyDelayedEffect extends OneShotEffect { + + protected int numberOfCards; + + public SyntheticDestinyDelayedEffect(int numberOfCards) { + super(Outcome.PutCreatureInPlay); + this.numberOfCards = numberOfCards; + this.staticText = "reveal cards from the top of your library until you reveal that many creature cards, put all creature cards revealed this way onto the battlefield, then shuffle the rest of the revealed cards into your library"; + } + + public SyntheticDestinyDelayedEffect(final SyntheticDestinyDelayedEffect effect) { + super(effect); + this.numberOfCards = effect.numberOfCards; + } + + @Override + public SyntheticDestinyDelayedEffect copy() { + return new SyntheticDestinyDelayedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + Cards revealed = new CardsImpl(); + Set creatureCards = new LinkedHashSet<>(); + Cards nonCreatureCards = new CardsImpl(); + while (creatureCards.size() < numberOfCards && controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().removeFromTop(game); + revealed.add(card); + if (card.getCardType().contains(CardType.CREATURE)) { + creatureCards.add(card); + } else { + nonCreatureCards.add(card); + } + } + controller.revealCards(sourceObject.getIdName(), revealed, game); + controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, true, null); + controller.putCardsOnTopOfLibrary(nonCreatureCards, game, source, false); + controller.shuffleLibrary(game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/TaintedField.java b/Mage.Sets/src/mage/sets/commander2015/TaintedField.java new file mode 100644 index 00000000000..80dc39b9fd2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/TaintedField.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TaintedField extends mage.sets.torment.TaintedField { + + public TaintedField(UUID ownerId) { + super(ownerId); + this.cardNumber = 311; + this.expansionSetCode = "C15"; + } + + public TaintedField(final TaintedField card) { + super(card); + } + + @Override + public TaintedField copy() { + return new TaintedField(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/TaintedWood.java b/Mage.Sets/src/mage/sets/commander2015/TaintedWood.java new file mode 100644 index 00000000000..7a8e5798e46 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/TaintedWood.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TaintedWood extends mage.sets.torment.TaintedWood { + + public TaintedWood(UUID ownerId) { + super(ownerId); + this.cardNumber = 312; + this.expansionSetCode = "C15"; + } + + public TaintedWood(final TaintedWood card) { + super(card); + } + + @Override + public TaintedWood copy() { + return new TaintedWood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/TalrandSkySummoner.java b/Mage.Sets/src/mage/sets/commander2015/TalrandSkySummoner.java new file mode 100644 index 00000000000..7e67d277f57 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/TalrandSkySummoner.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TalrandSkySummoner extends mage.sets.magic2013.TalrandSkySummoner { + + public TalrandSkySummoner(UUID ownerId) { + super(ownerId); + this.cardNumber = 109; + this.expansionSetCode = "C15"; + } + + public TalrandSkySummoner(final TalrandSkySummoner card) { + super(card); + } + + @Override + public TalrandSkySummoner copy() { + return new TalrandSkySummoner(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/TaureanMauler.java b/Mage.Sets/src/mage/sets/commander2015/TaureanMauler.java new file mode 100644 index 00000000000..3647d880d93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/TaureanMauler.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TaureanMauler extends mage.sets.planechase.TaureanMauler { + + public TaureanMauler(UUID ownerId) { + super(ownerId); + this.cardNumber = 167; + this.expansionSetCode = "C15"; + } + + public TaureanMauler(final TaureanMauler card) { + super(card); + } + + @Override + public TaureanMauler copy() { + return new TaureanMauler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/TempleOfTheFalseGod.java b/Mage.Sets/src/mage/sets/commander2015/TempleOfTheFalseGod.java new file mode 100644 index 00000000000..d981aea81dd --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/TempleOfTheFalseGod.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TempleOfTheFalseGod extends mage.sets.commander2013.TempleOfTheFalseGod { + + public TempleOfTheFalseGod(UUID ownerId) { + super(ownerId); + this.cardNumber = 313; + this.expansionSetCode = "C15"; + } + + public TempleOfTheFalseGod(final TempleOfTheFalseGod card) { + super(card); + } + + @Override + public TempleOfTheFalseGod copy() { + return new TempleOfTheFalseGod(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Terastodon.java b/Mage.Sets/src/mage/sets/commander2015/Terastodon.java new file mode 100644 index 00000000000..b63951115bc --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Terastodon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Terastodon extends mage.sets.worldwake.Terastodon { + + public Terastodon(UUID ownerId) { + super(ownerId); + this.cardNumber = 204; + this.expansionSetCode = "C15"; + } + + public Terastodon(final Terastodon card) { + super(card); + } + + @Override + public Terastodon copy() { + return new Terastodon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/TerramorphicExpanse.java b/Mage.Sets/src/mage/sets/commander2015/TerramorphicExpanse.java new file mode 100644 index 00000000000..d3e55e22913 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/TerramorphicExpanse.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TerramorphicExpanse extends mage.sets.tenthedition.TerramorphicExpanse { + + public TerramorphicExpanse(UUID ownerId) { + super(ownerId); + this.cardNumber = 314; + this.expansionSetCode = "C15"; + } + + public TerramorphicExpanse(final TerramorphicExpanse card) { + super(card); + } + + @Override + public TerramorphicExpanse copy() { + return new TerramorphicExpanse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/TeysaEnvoyOfGhosts.java b/Mage.Sets/src/mage/sets/commander2015/TeysaEnvoyOfGhosts.java new file mode 100644 index 00000000000..c912353806a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/TeysaEnvoyOfGhosts.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TeysaEnvoyOfGhosts extends mage.sets.dragonsmaze.TeysaEnvoyOfGhosts { + + public TeysaEnvoyOfGhosts(UUID ownerId) { + super(ownerId); + this.cardNumber = 234; + this.expansionSetCode = "C15"; + } + + public TeysaEnvoyOfGhosts(final TeysaEnvoyOfGhosts card) { + super(card); + } + + @Override + public TeysaEnvoyOfGhosts copy() { + return new TeysaEnvoyOfGhosts(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/TheloniteHermit.java b/Mage.Sets/src/mage/sets/commander2015/TheloniteHermit.java new file mode 100644 index 00000000000..44bc0e0304b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/TheloniteHermit.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TheloniteHermit extends mage.sets.timespiral.TheloniteHermit { + + public TheloniteHermit(UUID ownerId) { + super(ownerId); + this.cardNumber = 205; + this.expansionSetCode = "C15"; + } + + public TheloniteHermit(final TheloniteHermit card) { + super(card); + } + + @Override + public TheloniteHermit copy() { + return new TheloniteHermit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ThiefOfBlood.java b/Mage.Sets/src/mage/sets/commander2015/ThiefOfBlood.java new file mode 100644 index 00000000000..31d1c181cde --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ThiefOfBlood.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.counters.Counter; +import mage.counters.CounterType; +import mage.counters.Counters; +import mage.filter.FilterPermanent; +import mage.filter.predicate.permanent.CounterPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author emerald000 + */ +public class ThiefOfBlood extends CardImpl { + + public ThiefOfBlood(UUID ownerId) { + super(ownerId, 22, "Thief of Blood", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "C15"; + this.power = new MageInt(1); + this.toughness = new MageInt(1); + this.subtype.add("Vampire"); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // As Thief of Blood enters the battlefield, remove all counters from all permanents. Thief of Blood enters the battlefield with a +1/+1 counter on it for each counter removed this way. + this.addAbility(new EntersBattlefieldAbility(new ThiefOfBloodEffect(), null, "As {this} enters the battlefield, remove all counters from all permanents. {this} enters the battlefield with a +1/+1 counter on it for each counter removed this way", null)); + } + + public ThiefOfBlood(final ThiefOfBlood card) { + super(card); + } + + @Override + public ThiefOfBlood copy() { + return new ThiefOfBlood(this); + } +} + +class ThiefOfBloodEffect extends OneShotEffect { + + private static final FilterPermanent filter = new FilterPermanent("permanent with a counter"); + static { + filter.add(new CounterPredicate(null)); + } + + ThiefOfBloodEffect() { + super(Outcome.BoostCreature); + this.staticText = "remove all counters from all permanents. {this} enters the battlefield with a +1/+1 counter on it for each counter removed this way"; + } + + ThiefOfBloodEffect(final ThiefOfBloodEffect effect) { + super(effect); + } + + @Override + public ThiefOfBloodEffect copy() { + return new ThiefOfBloodEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int countersRemoved = 0; + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + Counters counters = permanent.getCounters().copy(); + for (Counter counter : counters.values()) { + permanent.getCounters().removeCounter(counter.getName(), counter.getCount()); + countersRemoved += counter.getCount(); + } + } + if (countersRemoved > 0) { + Permanent sourcePermanent = game.getPermanentEntering(source.getSourceId()); + if (sourcePermanent != null) { + sourcePermanent.addCounters(CounterType.P1P1.createInstance(countersRemoved), game); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ThornwoodFalls.java b/Mage.Sets/src/mage/sets/commander2015/ThornwoodFalls.java new file mode 100644 index 00000000000..4c32317d1a5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ThornwoodFalls.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ThornwoodFalls extends mage.sets.khansoftarkir.ThornwoodFalls { + + public ThornwoodFalls(UUID ownerId) { + super(ownerId); + this.cardNumber = 315; + this.expansionSetCode = "C15"; + } + + public ThornwoodFalls(final ThornwoodFalls card) { + super(card); + } + + @Override + public ThornwoodFalls copy() { + return new ThornwoodFalls(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ThoughtReflection.java b/Mage.Sets/src/mage/sets/commander2015/ThoughtReflection.java new file mode 100644 index 00000000000..16f50b59ca6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ThoughtReflection.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ThoughtReflection extends mage.sets.shadowmoor.ThoughtReflection { + + public ThoughtReflection(UUID ownerId) { + super(ownerId); + this.cardNumber = 110; + this.expansionSetCode = "C15"; + } + + public ThoughtReflection(final ThoughtReflection card) { + super(card); + } + + @Override + public ThoughtReflection copy() { + return new ThoughtReflection(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ThoughtVessel.java b/Mage.Sets/src/mage/sets/commander2015/ThoughtVessel.java new file mode 100644 index 00000000000..d5437bbcb0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ThoughtVessel.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect; +import mage.abilities.mana.ColorlessManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class ThoughtVessel extends CardImpl { + + public ThoughtVessel(UUID ownerId) { + super(ownerId, 55, "Thought Vessel", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "C15"; + + // You have no maximum hand size. + Effect effect = new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Duration.WhileOnBattlefield, MaximumHandSizeControllerEffect.HandSizeModification.SET); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + + // {T}: Add {1} to your mana pool. + this.addAbility(new ColorlessManaAbility()); + } + + public ThoughtVessel(final ThoughtVessel card) { + super(card); + } + + @Override + public ThoughtVessel copy() { + return new ThoughtVessel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ThundercloudShaman.java b/Mage.Sets/src/mage/sets/commander2015/ThundercloudShaman.java new file mode 100644 index 00000000000..9de101c4d2e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ThundercloudShaman.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ThundercloudShaman extends mage.sets.modernmasters.ThundercloudShaman { + + public ThundercloudShaman(UUID ownerId) { + super(ownerId); + this.cardNumber = 168; + this.expansionSetCode = "C15"; + } + + public ThundercloudShaman(final ThundercloudShaman card) { + super(card); + } + + @Override + public ThundercloudShaman copy() { + return new ThundercloudShaman(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/TreasuryThrull.java b/Mage.Sets/src/mage/sets/commander2015/TreasuryThrull.java new file mode 100644 index 00000000000..259f0d81ed7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/TreasuryThrull.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TreasuryThrull extends mage.sets.gatecrash.TreasuryThrull { + + public TreasuryThrull(UUID ownerId) { + super(ownerId); + this.cardNumber = 235; + this.expansionSetCode = "C15"; + } + + public TreasuryThrull(final TreasuryThrull card) { + super(card); + } + + @Override + public TreasuryThrull copy() { + return new TreasuryThrull(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/TributeToTheWild.java b/Mage.Sets/src/mage/sets/commander2015/TributeToTheWild.java new file mode 100644 index 00000000000..ab082b37efd --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/TributeToTheWild.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TributeToTheWild extends mage.sets.commander.TributeToTheWild { + + public TributeToTheWild(UUID ownerId) { + super(ownerId); + this.cardNumber = 206; + this.expansionSetCode = "C15"; + } + + public TributeToTheWild(final TributeToTheWild card) { + super(card); + } + + @Override + public TributeToTheWild copy() { + return new TributeToTheWild(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/TrygonPredator.java b/Mage.Sets/src/mage/sets/commander2015/TrygonPredator.java new file mode 100644 index 00000000000..f1f1b43982f --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/TrygonPredator.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TrygonPredator extends mage.sets.modernmasters.TrygonPredator { + + public TrygonPredator(UUID ownerId) { + super(ownerId); + this.cardNumber = 236; + this.expansionSetCode = "C15"; + } + + public TrygonPredator(final TrygonPredator card) { + super(card); + } + + @Override + public TrygonPredator copy() { + return new TrygonPredator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/UnderworldCoinsmith.java b/Mage.Sets/src/mage/sets/commander2015/UnderworldCoinsmith.java new file mode 100644 index 00000000000..28e3ee5185f --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/UnderworldCoinsmith.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class UnderworldCoinsmith extends mage.sets.journeyintonyx.UnderworldCoinsmith { + + public UnderworldCoinsmith(UUID ownerId) { + super(ownerId); + this.cardNumber = 237; + this.expansionSetCode = "C15"; + } + + public UnderworldCoinsmith(final UnderworldCoinsmith card) { + super(card); + } + + @Override + public UnderworldCoinsmith copy() { + return new UnderworldCoinsmith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/UnderworldConnections.java b/Mage.Sets/src/mage/sets/commander2015/UnderworldConnections.java new file mode 100644 index 00000000000..fc9588828f7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/UnderworldConnections.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class UnderworldConnections extends mage.sets.returntoravnica.UnderworldConnections { + + public UnderworldConnections(UUID ownerId) { + super(ownerId); + this.cardNumber = 138; + this.expansionSetCode = "C15"; + } + + public UnderworldConnections(final UnderworldConnections card) { + super(card); + } + + @Override + public UnderworldConnections copy() { + return new UnderworldConnections(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/UrzasIncubator.java b/Mage.Sets/src/mage/sets/commander2015/UrzasIncubator.java new file mode 100644 index 00000000000..3dc8bf90d6e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/UrzasIncubator.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class UrzasIncubator extends mage.sets.urzasdestiny.UrzasIncubator { + + public UrzasIncubator(UUID ownerId) { + super(ownerId); + this.cardNumber = 273; + this.expansionSetCode = "C15"; + } + + public UrzasIncubator(final UrzasIncubator card) { + super(card); + } + + @Override + public UrzasIncubator copy() { + return new UrzasIncubator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/UrzasRage.java b/Mage.Sets/src/mage/sets/commander2015/UrzasRage.java new file mode 100644 index 00000000000..bfd24ac640d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/UrzasRage.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class UrzasRage extends mage.sets.phyrexiavsthecoalition.UrzasRage { + + public UrzasRage(UUID ownerId) { + super(ownerId); + this.cardNumber = 169; + this.expansionSetCode = "C15"; + this.rarity = Rarity.RARE; + } + + public UrzasRage(final UrzasRage card) { + super(card); + } + + @Override + public UrzasRage copy() { + return new UrzasRage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Vandalblast.java b/Mage.Sets/src/mage/sets/commander2015/Vandalblast.java new file mode 100644 index 00000000000..5d4f5905b80 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Vandalblast.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Vandalblast extends mage.sets.returntoravnica.Vandalblast { + + public Vandalblast(UUID ownerId) { + super(ownerId); + this.cardNumber = 170; + this.expansionSetCode = "C15"; + } + + public Vandalblast(final Vandalblast card) { + super(card); + } + + @Override + public Vandalblast copy() { + return new Vandalblast(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/VerdantConfluence.java b/Mage.Sets/src/mage/sets/commander2015/VerdantConfluence.java new file mode 100644 index 00000000000..31e616feb40 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/VerdantConfluence.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.common.FilterBasicLandCard; +import mage.filter.common.FilterPermanentCard; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class VerdantConfluence extends CardImpl { + + public VerdantConfluence(UUID ownerId) { + super(ownerId, 40, "Verdant Confluence", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{G}{G}"); + this.expansionSetCode = "C15"; + + // Choose three. You may choose the same mode more than once. + this.getSpellAbility().getModes().setMinModes(3); + this.getSpellAbility().getModes().setMaxModes(3); + this.getSpellAbility().getModes().setEachModeMoreThanOnce(true); + + // - Put two +1/+1 counters on target creature; + this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2))); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Return target permanent card from your graveyard to your hand; + Mode mode = new Mode(); + mode.getEffects().add(new ReturnFromGraveyardToHandTargetEffect()); + mode.getTargets().add(new TargetCardInYourGraveyard(new FilterPermanentCard())); + this.getSpellAbility().getModes().addMode(mode); + + // Search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library. + TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); + mode = new Mode(); + mode.getEffects().add(new SearchLibraryPutInPlayEffect(target, true)); + this.getSpellAbility().getModes().addMode(mode); + } + + public VerdantConfluence(final VerdantConfluence card) { + super(card); + } + + @Override + public VerdantConfluence copy() { + return new VerdantConfluence(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/VerdantForce.java b/Mage.Sets/src/mage/sets/commander2015/VerdantForce.java new file mode 100644 index 00000000000..fa57889476a --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/VerdantForce.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class VerdantForce extends mage.sets.tempest.VerdantForce { + + public VerdantForce(UUID ownerId) { + super(ownerId); + this.cardNumber = 207; + this.expansionSetCode = "C15"; + } + + public VerdantForce(final VerdantForce card) { + super(card); + } + + @Override + public VerdantForce copy() { + return new VerdantForce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Victimize.java b/Mage.Sets/src/mage/sets/commander2015/Victimize.java new file mode 100644 index 00000000000..a0f2bee200e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Victimize.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Victimize extends mage.sets.conspiracy.Victimize { + + public Victimize(UUID ownerId) { + super(ownerId); + this.cardNumber = 139; + this.expansionSetCode = "C15"; + } + + public Victimize(final Victimize card) { + super(card); + } + + @Override + public Victimize copy() { + return new Victimize(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/VictorysHerald.java b/Mage.Sets/src/mage/sets/commander2015/VictorysHerald.java new file mode 100644 index 00000000000..6d6de19b30b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/VictorysHerald.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class VictorysHerald extends mage.sets.mirrodinbesieged.VictorysHerald { + + public VictorysHerald(UUID ownerId) { + super(ownerId); + this.cardNumber = 83; + this.expansionSetCode = "C15"; + } + + public VictorysHerald(final VictorysHerald card) { + super(card); + } + + @Override + public VictorysHerald copy() { + return new VictorysHerald(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ViridianEmissary.java b/Mage.Sets/src/mage/sets/commander2015/ViridianEmissary.java new file mode 100644 index 00000000000..b053b67fa3e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ViridianEmissary.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ViridianEmissary extends mage.sets.mirrodinbesieged.ViridianEmissary { + + public ViridianEmissary(UUID ownerId) { + super(ownerId); + this.cardNumber = 208; + this.expansionSetCode = "C15"; + } + + public ViridianEmissary(final ViridianEmissary card) { + super(card); + } + + @Override + public ViridianEmissary copy() { + return new ViridianEmissary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ViridianShaman.java b/Mage.Sets/src/mage/sets/commander2015/ViridianShaman.java new file mode 100644 index 00000000000..786f1301556 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ViridianShaman.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ViridianShaman extends mage.sets.tenthedition.ViridianShaman { + + public ViridianShaman(UUID ownerId) { + super(ownerId); + this.cardNumber = 209; + this.expansionSetCode = "C15"; + } + + public ViridianShaman(final ViridianShaman card) { + super(card); + } + + @Override + public ViridianShaman copy() { + return new ViridianShaman(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ViridianZealot.java b/Mage.Sets/src/mage/sets/commander2015/ViridianZealot.java new file mode 100644 index 00000000000..c5887475312 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ViridianZealot.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ViridianZealot extends mage.sets.darksteel.ViridianZealot { + + public ViridianZealot(UUID ownerId) { + super(ownerId); + this.cardNumber = 210; + this.expansionSetCode = "C15"; + } + + public ViridianZealot(final ViridianZealot card) { + super(card); + } + + @Override + public ViridianZealot copy() { + return new ViridianZealot(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/VividCrag.java b/Mage.Sets/src/mage/sets/commander2015/VividCrag.java new file mode 100644 index 00000000000..af972132ec5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/VividCrag.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class VividCrag extends mage.sets.lorwyn.VividCrag { + + public VividCrag(UUID ownerId) { + super(ownerId); + this.cardNumber = 316; + this.expansionSetCode = "C15"; + } + + public VividCrag(final VividCrag card) { + super(card); + } + + @Override + public VividCrag copy() { + return new VividCrag(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/VividCreek.java b/Mage.Sets/src/mage/sets/commander2015/VividCreek.java new file mode 100644 index 00000000000..5f40f37d310 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/VividCreek.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class VividCreek extends mage.sets.lorwyn.VividCreek { + + public VividCreek(UUID ownerId) { + super(ownerId); + this.cardNumber = 317; + this.expansionSetCode = "C15"; + } + + public VividCreek(final VividCreek card) { + super(card); + } + + @Override + public VividCreek copy() { + return new VividCreek(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/VividGrove.java b/Mage.Sets/src/mage/sets/commander2015/VividGrove.java new file mode 100644 index 00000000000..df5490213ef --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/VividGrove.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class VividGrove extends mage.sets.lorwyn.VividGrove { + + public VividGrove(UUID ownerId) { + super(ownerId); + this.cardNumber = 318; + this.expansionSetCode = "C15"; + } + + public VividGrove(final VividGrove card) { + super(card); + } + + @Override + public VividGrove copy() { + return new VividGrove(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/VividMarsh.java b/Mage.Sets/src/mage/sets/commander2015/VividMarsh.java new file mode 100644 index 00000000000..84a2b6309ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/VividMarsh.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class VividMarsh extends mage.sets.lorwyn.VividMarsh { + + public VividMarsh(UUID ownerId) { + super(ownerId); + this.cardNumber = 319; + this.expansionSetCode = "C15"; + } + + public VividMarsh(final VividMarsh card) { + super(card); + } + + @Override + public VividMarsh copy() { + return new VividMarsh(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/VividMeadow.java b/Mage.Sets/src/mage/sets/commander2015/VividMeadow.java new file mode 100644 index 00000000000..f4261c57aa2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/VividMeadow.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class VividMeadow extends mage.sets.lorwyn.VividMeadow { + + public VividMeadow(UUID ownerId) { + super(ownerId); + this.cardNumber = 320; + this.expansionSetCode = "C15"; + } + + public VividMeadow(final VividMeadow card) { + super(card); + } + + @Override + public VividMeadow copy() { + return new VividMeadow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/VowOfDuty.java b/Mage.Sets/src/mage/sets/commander2015/VowOfDuty.java new file mode 100644 index 00000000000..77bc9a7d50c --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/VowOfDuty.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class VowOfDuty extends mage.sets.commander.VowOfDuty { + + public VowOfDuty(UUID ownerId) { + super(ownerId); + this.cardNumber = 84; + this.expansionSetCode = "C15"; + } + + public VowOfDuty(final VowOfDuty card) { + super(card); + } + + @Override + public VowOfDuty copy() { + return new VowOfDuty(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/VowOfMalice.java b/Mage.Sets/src/mage/sets/commander2015/VowOfMalice.java new file mode 100644 index 00000000000..0b95284416d --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/VowOfMalice.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class VowOfMalice extends mage.sets.commander.VowOfMalice { + + public VowOfMalice(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + this.expansionSetCode = "C15"; + } + + public VowOfMalice(final VowOfMalice card) { + super(card); + } + + @Override + public VowOfMalice copy() { + return new VowOfMalice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/VulturousZombie.java b/Mage.Sets/src/mage/sets/commander2015/VulturousZombie.java new file mode 100644 index 00000000000..a6676ea2c81 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/VulturousZombie.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class VulturousZombie extends mage.sets.commander.VulturousZombie { + + public VulturousZombie(UUID ownerId) { + super(ownerId); + this.cardNumber = 238; + this.expansionSetCode = "C15"; + } + + public VulturousZombie(final VulturousZombie card) { + super(card); + } + + @Override + public VulturousZombie copy() { + return new VulturousZombie(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/WallOfBlossoms.java b/Mage.Sets/src/mage/sets/commander2015/WallOfBlossoms.java new file mode 100644 index 00000000000..49cf49d3a98 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/WallOfBlossoms.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WallOfBlossoms extends mage.sets.stronghold.WallOfBlossoms { + + public WallOfBlossoms(UUID ownerId) { + super(ownerId); + this.cardNumber = 211; + this.expansionSetCode = "C15"; + } + + public WallOfBlossoms(final WallOfBlossoms card) { + super(card); + } + + @Override + public WallOfBlossoms copy() { + return new WallOfBlossoms(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/WarchiefGiant.java b/Mage.Sets/src/mage/sets/commander2015/WarchiefGiant.java new file mode 100644 index 00000000000..57f272644da --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/WarchiefGiant.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.MyriadAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class WarchiefGiant extends CardImpl { + + public WarchiefGiant(UUID ownerId) { + super(ownerId, 31, "Warchief Giant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "C15"; + this.subtype.add("Giant"); + this.subtype.add("Warrior"); + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // Myriad + this.addAbility(new MyriadAbility()); + } + + public WarchiefGiant(final WarchiefGiant card) { + super(card); + } + + @Override + public WarchiefGiant copy() { + return new WarchiefGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/WarstormSurge.java b/Mage.Sets/src/mage/sets/commander2015/WarstormSurge.java new file mode 100644 index 00000000000..8783c693805 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/WarstormSurge.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WarstormSurge extends mage.sets.magic2012.WarstormSurge { + + public WarstormSurge(UUID ownerId) { + super(ownerId); + this.cardNumber = 171; + this.expansionSetCode = "C15"; + } + + public WarstormSurge(final WarstormSurge card) { + super(card); + } + + @Override + public WarstormSurge copy() { + return new WarstormSurge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/WayfarersBauble.java b/Mage.Sets/src/mage/sets/commander2015/WayfarersBauble.java new file mode 100644 index 00000000000..9d3dcccc2a6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/WayfarersBauble.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WayfarersBauble extends mage.sets.commander2013.WayfarersBauble { + + public WayfarersBauble(UUID ownerId) { + super(ownerId); + this.cardNumber = 274; + this.expansionSetCode = "C15"; + } + + public WayfarersBauble(final WayfarersBauble card) { + super(card); + } + + @Override + public WayfarersBauble copy() { + return new WayfarersBauble(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/WindScarredCrag.java b/Mage.Sets/src/mage/sets/commander2015/WindScarredCrag.java new file mode 100644 index 00000000000..36eefa8c030 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/WindScarredCrag.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WindScarredCrag extends mage.sets.khansoftarkir.WindScarredCrag { + + public WindScarredCrag(UUID ownerId) { + super(ownerId); + this.cardNumber = 321; + this.expansionSetCode = "C15"; + } + + public WindScarredCrag(final WindScarredCrag card) { + super(card); + } + + @Override + public WindScarredCrag copy() { + return new WindScarredCrag(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/Windfall.java b/Mage.Sets/src/mage/sets/commander2015/Windfall.java new file mode 100644 index 00000000000..33003e65c58 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/Windfall.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Windfall extends mage.sets.urzassaga.Windfall { + + public Windfall(UUID ownerId) { + super(ownerId); + this.cardNumber = 111; + this.expansionSetCode = "C15"; + } + + public Windfall(final Windfall card) { + super(card); + } + + @Override + public Windfall copy() { + return new Windfall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/WistfulSelkie.java b/Mage.Sets/src/mage/sets/commander2015/WistfulSelkie.java new file mode 100644 index 00000000000..a6b80795e14 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/WistfulSelkie.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WistfulSelkie extends mage.sets.eventide.WistfulSelkie { + + public WistfulSelkie(UUID ownerId) { + super(ownerId); + this.cardNumber = 243; + this.expansionSetCode = "C15"; + } + + public WistfulSelkie(final WistfulSelkie card) { + super(card); + } + + @Override + public WistfulSelkie copy() { + return new WistfulSelkie(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/WoodElves.java b/Mage.Sets/src/mage/sets/commander2015/WoodElves.java new file mode 100644 index 00000000000..9f1cfb554eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/WoodElves.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WoodElves extends mage.sets.ninthedition.WoodElves { + + public WoodElves(UUID ownerId) { + super(ownerId); + this.cardNumber = 212; + this.expansionSetCode = "C15"; + } + + public WoodElves(final WoodElves card) { + super(card); + } + + @Override + public WoodElves copy() { + return new WoodElves(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/WordOfSeizing.java b/Mage.Sets/src/mage/sets/commander2015/WordOfSeizing.java new file mode 100644 index 00000000000..eafa2533010 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/WordOfSeizing.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WordOfSeizing extends mage.sets.commander2014.WordOfSeizing { + + public WordOfSeizing(UUID ownerId) { + super(ownerId); + this.cardNumber = 172; + this.expansionSetCode = "C15"; + } + + public WordOfSeizing(final WordOfSeizing card) { + super(card); + } + + @Override + public WordOfSeizing copy() { + return new WordOfSeizing(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/WornPowerstone.java b/Mage.Sets/src/mage/sets/commander2015/WornPowerstone.java new file mode 100644 index 00000000000..a4cc625b82e --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/WornPowerstone.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WornPowerstone extends mage.sets.urzassaga.WornPowerstone { + + public WornPowerstone(UUID ownerId) { + super(ownerId); + this.cardNumber = 275; + this.expansionSetCode = "C15"; + } + + public WornPowerstone(final WornPowerstone card) { + super(card); + } + + @Override + public WornPowerstone copy() { + return new WornPowerstone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/WretchedConfluence.java b/Mage.Sets/src/mage/sets/commander2015/WretchedConfluence.java new file mode 100644 index 00000000000..f4c162edce1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/WretchedConfluence.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardTargetEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; +import mage.target.TargetPlayer; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class WretchedConfluence extends CardImpl { + + public WretchedConfluence(UUID ownerId) { + super(ownerId, 23, "Wretched Confluence", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{B}{B}"); + this.expansionSetCode = "C15"; + + // Choose three. You may choose the same mode more than once. + this.getSpellAbility().getModes().setMinModes(3); + this.getSpellAbility().getModes().setMaxModes(3); + this.getSpellAbility().getModes().setEachModeMoreThanOnce(true); + + // - Target player draws a card and loses 1 life; + Effect effect = new LoseLifeTargetEffect(1); + effect.setText("and loses 1 life"); + this.getSpellAbility().addEffect(new DrawCardTargetEffect(1)); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Target creature gets -2/-2 until end of turn; + Mode mode = new Mode(); + mode.getEffects().add(new BoostTargetEffect(-2, -2, Duration.EndOfTurn)); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().getModes().addMode(mode); + + // Return target creature card from your graveyard to your hand. + mode = new Mode(); + mode.getEffects().add(new ReturnFromGraveyardToHandTargetEffect()); + mode.getTargets().add(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + this.getSpellAbility().getModes().addMode(mode); + } + + public WretchedConfluence(final WretchedConfluence card) { + super(card); + } + + @Override + public WretchedConfluence copy() { + return new WretchedConfluence(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander2015/ZoeticCavern.java b/Mage.Sets/src/mage/sets/commander2015/ZoeticCavern.java new file mode 100644 index 00000000000..745eb97f48c --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander2015/ZoeticCavern.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.commander2015; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ZoeticCavern extends mage.sets.commander2014.ZoeticCavern { + + public ZoeticCavern(UUID ownerId) { + super(ownerId); + this.cardNumber = 322; + this.expansionSetCode = "C15"; + } + + public ZoeticCavern(final ZoeticCavern card) { + super(card); + } + + @Override + public ZoeticCavern copy() { + return new ZoeticCavern(this); + } +} diff --git a/Mage.Sets/src/mage/sets/conflux/ApocalypseHydra.java b/Mage.Sets/src/mage/sets/conflux/ApocalypseHydra.java index 87ecb7d24dd..5c3a39ffaad 100644 --- a/Mage.Sets/src/mage/sets/conflux/ApocalypseHydra.java +++ b/Mage.Sets/src/mage/sets/conflux/ApocalypseHydra.java @@ -27,8 +27,7 @@ */ package mage.sets.conflux; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.SpellAbility; @@ -40,15 +39,15 @@ import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetCreatureOrPlayer; -import java.util.UUID; - /** * * @author Loki @@ -64,7 +63,8 @@ public class ApocalypseHydra extends CardImpl { this.toughness = new MageInt(0); // Apocalypse Hydra enters the battlefield with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new ApocalypseHydraEffect(), true)); + this.addAbility(new EntersBattlefieldAbility(new ApocalypseHydraEffect())); + // {1}{R}, Remove a +1/+1 counter from Apocalypse Hydra: Apocalypse Hydra deals 1 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}{R}")); ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance())); @@ -83,6 +83,7 @@ public class ApocalypseHydra extends CardImpl { } class ApocalypseHydraEffect extends OneShotEffect { + ApocalypseHydraEffect() { super(Outcome.BoostCreature); staticText = "with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it"; @@ -94,13 +95,13 @@ class ApocalypseHydraEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility)obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { if (amount < 5) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); diff --git a/Mage.Sets/src/mage/sets/conflux/CelestialPurge.java b/Mage.Sets/src/mage/sets/conflux/CelestialPurge.java index cb2aeb00788..5547e8dcce9 100644 --- a/Mage.Sets/src/mage/sets/conflux/CelestialPurge.java +++ b/Mage.Sets/src/mage/sets/conflux/CelestialPurge.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,20 +20,19 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.conflux; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.ObjectColor; import mage.abilities.effects.common.ExileTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; @@ -57,6 +56,7 @@ public class CelestialPurge extends CardImpl { super(ownerId, 5, "Celestial Purge", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); this.expansionSetCode = "CON"; + // Exile target black or red permanent. this.getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellAbility().addEffect(new ExileTargetEffect()); } diff --git a/Mage.Sets/src/mage/sets/conflux/CorruptedRoots.java b/Mage.Sets/src/mage/sets/conflux/CorruptedRoots.java index 71acd4c156a..cec2b4e7def 100644 --- a/Mage.Sets/src/mage/sets/conflux/CorruptedRoots.java +++ b/Mage.Sets/src/mage/sets/conflux/CorruptedRoots.java @@ -29,26 +29,18 @@ package mage.sets.conflux; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.Effect; +import mage.abilities.common.BecomesTappedAttachedTriggeredAbility; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.LoseLifeControllerAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; -import mage.target.common.TargetLandPermanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -56,7 +48,7 @@ import mage.target.targetpointer.FixedTarget; */ public class CorruptedRoots extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent("Forest or Plains"); + private static final FilterPermanent filter = new FilterPermanent("Forest or Plains"); static { filter.add(Predicates.or( @@ -69,17 +61,15 @@ public class CorruptedRoots extends CardImpl { this.expansionSetCode = "CON"; this.subtype.add("Aura"); - // Enchant Forest or Plains - TargetPermanent auraTarget = new TargetLandPermanent(filter); + TargetPermanent auraTarget = new TargetPermanent(filter); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever enchanted land becomes tapped, its controller loses 2 life. - this.addAbility(new CorruptedRootsTriggeredAbility()); - + this.addAbility(new BecomesTappedAttachedTriggeredAbility(new LoseLifeControllerAttachedEffect(2), "enchanted land")); } public CorruptedRoots(final CorruptedRoots card) { @@ -91,44 +81,3 @@ public class CorruptedRoots extends CardImpl { return new CorruptedRoots(this); } } - -class CorruptedRootsTriggeredAbility extends TriggeredAbilityImpl { - - CorruptedRootsTriggeredAbility() { - super(Zone.BATTLEFIELD, new LoseLifeTargetEffect(2)); - } - - CorruptedRootsTriggeredAbility(final CorruptedRootsTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent enchantment = game.getPermanent(this.sourceId); - if (enchantment != null && enchantment.getAttachedTo().equals(event.getTargetId())) { - Permanent attached = game.getPermanent(enchantment.getAttachedTo()); - if (attached != null) { - for (Effect effect : getEffects()) { - effect.setTargetPointer(new FixedTarget(attached.getControllerId())); - } - return true; - } - } - return false; - } - - @Override - public CorruptedRootsTriggeredAbility copy() { - return new CorruptedRootsTriggeredAbility(this); - } - - @Override - public String getRule() { - return "Whenever enchanted land becomes tapped, its controller loses 2 life."; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/conflux/EtherswornAdjudicator.java b/Mage.Sets/src/mage/sets/conflux/EtherswornAdjudicator.java index 96d9df3d93d..6b5c29dcde7 100644 --- a/Mage.Sets/src/mage/sets/conflux/EtherswornAdjudicator.java +++ b/Mage.Sets/src/mage/sets/conflux/EtherswornAdjudicator.java @@ -63,6 +63,8 @@ public class EtherswornAdjudicator extends CardImpl { public EtherswornAdjudicator(UUID ownerId) { super(ownerId, 26, "Ethersworn Adjudicator", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}{U}"); this.expansionSetCode = "CON"; + this.subtype.add("Vedalken"); + this.subtype.add("Knight"); this.power = new MageInt(4); this.toughness = new MageInt(4); diff --git a/Mage.Sets/src/mage/sets/conflux/KnotvineMystic.java b/Mage.Sets/src/mage/sets/conflux/KnotvineMystic.java index 608418d7828..afe5461a9fa 100644 --- a/Mage.Sets/src/mage/sets/conflux/KnotvineMystic.java +++ b/Mage.Sets/src/mage/sets/conflux/KnotvineMystic.java @@ -46,7 +46,7 @@ import mage.constants.Rarity; public class KnotvineMystic extends CardImpl{ public KnotvineMystic(UUID ownerId) { - super(ownerId, 114, "Knotvine Mystic", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}{R}{G}"); + super(ownerId, 114, "Knotvine Mystic", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{R}{G}{W}"); this.expansionSetCode = "CON"; diff --git a/Mage.Sets/src/mage/sets/conflux/MartialCoup.java b/Mage.Sets/src/mage/sets/conflux/MartialCoup.java index 3344214c170..2b856325231 100644 --- a/Mage.Sets/src/mage/sets/conflux/MartialCoup.java +++ b/Mage.Sets/src/mage/sets/conflux/MartialCoup.java @@ -1,46 +1,45 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.sets.conflux; +import java.util.List; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.SoldierToken; - /** * * @author BetaSteward_at_googlemail.com @@ -51,6 +50,7 @@ public class MartialCoup extends CardImpl { super(ownerId, 11, "Martial Coup", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{W}{W}"); this.expansionSetCode = "CON"; + // Put X 1/1 white Soldier creature tokens onto the battlefield. If X is 5 or more, destroy all other creatures. this.getSpellAbility().addEffect(new MartialCoupEffect()); } @@ -85,12 +85,15 @@ class MartialCoupEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int amount = source.getManaCostsToPay().getX(); + token.putOntoBattlefield(amount, game, source.getSourceId(), source.getControllerId()); + List tokens = token.getLastAddedTokenIds(); if (amount > 4) { - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { - permanent.destroy(source.getSourceId(), game, false); + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + if (!tokens.contains(permanent.getId())) { + permanent.destroy(source.getSourceId(), game, false); + } } } - token.putOntoBattlefield(amount, game, source.getSourceId(), source.getControllerId()); return true; } diff --git a/Mage.Sets/src/mage/sets/conflux/MasterTransmuter.java b/Mage.Sets/src/mage/sets/conflux/MasterTransmuter.java index fcae2dcac52..ae89e66ea5d 100644 --- a/Mage.Sets/src/mage/sets/conflux/MasterTransmuter.java +++ b/Mage.Sets/src/mage/sets/conflux/MasterTransmuter.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect; @@ -61,7 +61,7 @@ public class MasterTransmuter extends CardImpl { // {U}, {tap}, Return an artifact you control to its owner's hand: You may put an artifact card from your hand onto the battlefield. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutPermanentOnBattlefieldEffect(new FilterArtifactCard("an artifact card")), new ManaCostsImpl("{U}")); ability.addCost(new TapSourceCost()); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact")))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact")))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/conflux/MirrorSigilSergeant.java b/Mage.Sets/src/mage/sets/conflux/MirrorSigilSergeant.java index 7361afc4052..76dca6a09b9 100644 --- a/Mage.Sets/src/mage/sets/conflux/MirrorSigilSergeant.java +++ b/Mage.Sets/src/mage/sets/conflux/MirrorSigilSergeant.java @@ -29,28 +29,21 @@ package mage.sets.conflux; import java.util.UUID; import mage.MageInt; -import mage.MageObject; import mage.ObjectColor; -import mage.abilities.Ability; import mage.abilities.TriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.game.permanent.token.EmptyToken; -import mage.util.CardUtil; /** * @@ -63,7 +56,7 @@ public class MirrorSigilSergeant extends CardImpl { static { filter.add(new ColorPredicate(ObjectColor.BLUE)); } - + private static final String rule = "At the beginning of your upkeep, if you control a blue permanent, you may put a token that's a copy of Mirror-Sigil Sergeant onto the battlefield."; public MirrorSigilSergeant(UUID ownerId) { @@ -79,7 +72,9 @@ public class MirrorSigilSergeant extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // At the beginning of your upkeep, if you control a blue permanent, you may put a token that's a copy of Mirror-Sigil Sergeant onto the battlefield. - TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new MirrorSigilSergeantEffect(), TargetController.YOU, true); + Effect effect = new PutTokenOntoBattlefieldCopySourceEffect(); + effect.setText("you may put a token that's a copy of {this} onto the battlefield"); + TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, true); this.addAbility(new ConditionalTriggeredAbility(ability, new PermanentsOnTheBattlefieldCondition(filter), rule)); } @@ -93,41 +88,3 @@ public class MirrorSigilSergeant extends CardImpl { return new MirrorSigilSergeant(this); } } - -class MirrorSigilSergeantEffect extends OneShotEffect { - - public MirrorSigilSergeantEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "put a token that's a copy of {this} onto the battlefield"; - } - - public MirrorSigilSergeantEffect(final MirrorSigilSergeantEffect effect) { - super(effect); - } - - @Override - public MirrorSigilSergeantEffect copy() { - return new MirrorSigilSergeantEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - UUID targetId = source.getSourceId(); - if (targetId != null && player != null) { - MageObject target = game.getPermanent(targetId); - if (target == null) { - target = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD); - } - if (target != null) { - if (target instanceof Permanent) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from((Permanent) target); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } - } - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/conflux/NicolBolasPlaneswalker.java b/Mage.Sets/src/mage/sets/conflux/NicolBolasPlaneswalker.java index 892139f72c1..07e9f18043d 100644 --- a/Mage.Sets/src/mage/sets/conflux/NicolBolasPlaneswalker.java +++ b/Mage.Sets/src/mage/sets/conflux/NicolBolasPlaneswalker.java @@ -28,19 +28,17 @@ package mage.sets.conflux; import java.util.UUID; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.SacrificeEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.DestroyTargetEffect; -import mage.abilities.effects.common.discard.DiscardTargetEffect; -import mage.abilities.effects.common.SacrificeEffect; -import mage.abilities.effects.common.continuous.GainControlTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.cards.CardImpl; -import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -65,8 +63,7 @@ public class NicolBolasPlaneswalker extends CardImpl { this.expansionSetCode = "CON"; this.subtype.add("Bolas"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); // +3: Destroy target noncreature permanent. LoyaltyAbility ability = new LoyaltyAbility(new DestroyTargetEffect(), 3); diff --git a/Mage.Sets/src/mage/sets/conflux/Nyxathid.java b/Mage.Sets/src/mage/sets/conflux/Nyxathid.java index 22fb19bcede..0a7e5fee51a 100644 --- a/Mage.Sets/src/mage/sets/conflux/Nyxathid.java +++ b/Mage.Sets/src/mage/sets/conflux/Nyxathid.java @@ -27,6 +27,7 @@ */ package mage.sets.conflux; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; @@ -34,16 +35,16 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseOpponentEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; -import mage.game.permanent.Permanent; import mage.players.Player; -import mage.target.common.TargetOpponent; - -import java.util.UUID; /** * @@ -60,7 +61,7 @@ public class Nyxathid extends CardImpl { this.toughness = new MageInt(7); // As Nyxathid enters the battlefield, choose an opponent. - this.addAbility(new AsEntersBattlefieldAbility(new ChooseOpponent())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseOpponentEffect(Outcome.Detriment))); // Nyxathid gets -1/-1 for each card in the chosen player's hand. DynamicValue chosenPlayerHand = new SignInversionDynamicValue(new CardsInChosenPlayerHandCount()); @@ -78,48 +79,12 @@ public class Nyxathid extends CardImpl { } } -class ChooseOpponent extends OneShotEffect { - - public ChooseOpponent() { - super(Outcome.Neutral); - this.staticText = "choose an opponent"; - } - - public ChooseOpponent(final ChooseOpponent effect) { - super(effect); - } - - @Override - public ChooseOpponent copy() { - return new ChooseOpponent(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - TargetOpponent target = new TargetOpponent(); - target.setNotTarget(true); - if (player.choose(this.outcome, target, source.getSourceId(), game)) { - Player chosenPlayer = game.getPlayer(target.getFirstTarget()); - if (chosenPlayer != null) { - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + chosenPlayer.getLogName()); - game.getState().setValue(permanent.getId() + "_player", target.getFirstTarget()); - return true; - } - } - } - return false; - } -} - class CardsInChosenPlayerHandCount implements DynamicValue { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { if (sourceAbility != null) { - UUID playerId = (UUID) game.getState().getValue(sourceAbility.getSourceId() + "_player"); + UUID playerId = (UUID) game.getState().getValue(sourceAbility.getSourceId() + ChooseOpponentEffect.VALUE_KEY); Player chosenPlayer = game.getPlayer(playerId); if (chosenPlayer != null) { return chosenPlayer.getHand().size(); diff --git a/Mage.Sets/src/mage/sets/conflux/PathToExile.java b/Mage.Sets/src/mage/sets/conflux/PathToExile.java index bc78ddb72ef..ed66cc9597d 100644 --- a/Mage.Sets/src/mage/sets/conflux/PathToExile.java +++ b/Mage.Sets/src/mage/sets/conflux/PathToExile.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.sets.conflux; import java.util.UUID; @@ -52,7 +51,7 @@ public class PathToExile extends CardImpl { public PathToExile(UUID ownerId) { super(ownerId, 15, "Path to Exile", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); - this.expansionSetCode = "CON"; + this.expansionSetCode = "CON"; // Exile target creature. Its controller may search his or her library for a basic land card, // put that card onto the battlefield tapped, then shuffle his or her library. @@ -93,13 +92,13 @@ class PathToExileEffect extends OneShotEffect { if (controller != null && permanent != null) { Player player = game.getPlayer(permanent.getControllerId()); // if the zone change to exile gets replaced does not prevent the target controller to be able to search - controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true); + controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true); if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for a basic land card?", source, game)) { TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); if (player.searchLibrary(target, game)) { Card card = player.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true); + player.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); } } player.shuffleLibrary(game); diff --git a/Mage.Sets/src/mage/sets/conflux/SkywardEyeProphets.java b/Mage.Sets/src/mage/sets/conflux/SkywardEyeProphets.java index 09778edade8..e70912fe986 100644 --- a/Mage.Sets/src/mage/sets/conflux/SkywardEyeProphets.java +++ b/Mage.Sets/src/mage/sets/conflux/SkywardEyeProphets.java @@ -106,9 +106,9 @@ public class SkywardEyeProphets extends CardImpl { cards.add(card); controller.revealCards(sourceObject.getName(), cards, game); if (card.getCardType().contains(CardType.LAND)) { - return controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + return controller.moveCards(card, Zone.BATTLEFIELD, source, game); } else { - controller.moveCards(card, null, Zone.HAND, source, game); + controller.moveCards(card, Zone.HAND, source, game); } } return true; diff --git a/Mage.Sets/src/mage/sets/conflux/YokeOfTheDamned.java b/Mage.Sets/src/mage/sets/conflux/YokeOfTheDamned.java index 3858801fa31..b26829d9e4e 100644 --- a/Mage.Sets/src/mage/sets/conflux/YokeOfTheDamned.java +++ b/Mage.Sets/src/mage/sets/conflux/YokeOfTheDamned.java @@ -30,16 +30,14 @@ package mage.sets.conflux; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.DiesCreatureTriggeredAbility; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -48,7 +46,7 @@ import mage.target.common.TargetCreaturePermanent; * @author jeffwadsworth */ public class YokeOfTheDamned extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature"); public YokeOfTheDamned(UUID ownerId) { @@ -60,13 +58,13 @@ public class YokeOfTheDamned extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - + // When a creature dies, destroy enchanted creature. - this.addAbility(new DiesCreatureTriggeredAbility(new DestroyEnchantedEffect(), false, filter)); - + this.addAbility(new DiesCreatureTriggeredAbility(new DestroyAttachedEffect("enchanted creature"), false, filter)); + } public YokeOfTheDamned(final YokeOfTheDamned card) { @@ -78,37 +76,3 @@ public class YokeOfTheDamned extends CardImpl { return new YokeOfTheDamned(this); } } - -class DestroyEnchantedEffect extends OneShotEffect { - - public DestroyEnchantedEffect() { - super(Outcome.Detriment); - staticText = "destroy enchanted creature"; - } - - public DestroyEnchantedEffect(final DestroyEnchantedEffect effect) { - super(effect); - } - - @Override - public DestroyEnchantedEffect copy() { - return new DestroyEnchantedEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - UUID uuid = getTargetPointer().getFirst(game, source); - Permanent creature = game.getPermanent(uuid); - if (creature == null) { - creature = game.getPermanent(enchantment.getAttachedTo()); - } - if (creature != null) { - return creature.destroy(source.getSourceId(), game, false); - } - } - return false; - } - -} diff --git a/Mage.Sets/src/mage/sets/conspiracy/AcademyElite.java b/Mage.Sets/src/mage/sets/conspiracy/AcademyElite.java index 4889f2165e9..3ca79dcdde7 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/AcademyElite.java +++ b/Mage.Sets/src/mage/sets/conspiracy/AcademyElite.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.conspiracy; import java.util.UUID; @@ -49,14 +48,13 @@ import mage.counters.CounterType; import mage.filter.common.FilterInstantOrSorceryCard; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.target.common.TargetCreatureOrPlayer; /** * * @author andyfries */ - public class AcademyElite extends CardImpl { + public AcademyElite(UUID ownerId) { super(ownerId, 20, "Academy Elite", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.expansionSetCode = "CNS"; @@ -76,7 +74,6 @@ public class AcademyElite extends CardImpl { this.addAbility(ability); } - public AcademyElite(final AcademyElite card) { super(card); } @@ -103,8 +100,10 @@ class AcademyEliteEffect1 extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) { CardsInAllGraveyardsCount instantsAndSorceries = new CardsInAllGraveyardsCount(new FilterInstantOrSorceryCard("instant or sorcery cards")); int instantsAndSorceriesCount = instantsAndSorceries.calculate(game, source, this); if (instantsAndSorceriesCount > 0) { @@ -120,4 +119,3 @@ class AcademyEliteEffect1 extends OneShotEffect { return new AcademyEliteEffect1(this); } } - diff --git a/Mage.Sets/src/mage/sets/conspiracy/BiteOfTheBlackRose.java b/Mage.Sets/src/mage/sets/conspiracy/BiteOfTheBlackRose.java new file mode 100644 index 00000000000..d8f9840867e --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/BiteOfTheBlackRose.java @@ -0,0 +1,114 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostOpponentsEffect; +import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class BiteOfTheBlackRose extends CardImpl { + + public BiteOfTheBlackRose(UUID ownerId) { + super(ownerId, 26, "Bite of the Black Rose", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}"); + this.expansionSetCode = "CNS"; + + // Will of the council - Starting with you, each player votes for sickness or psychosis. If sickness gets more votes, creatures your opponents control get -2/-2 until end of turn. If psychosis gets more votes or the vote is tied, each opponent discards two cards. + this.getSpellAbility().addEffect(new BiteOfTheBlackRoseEffect()); + } + + public BiteOfTheBlackRose(final BiteOfTheBlackRose card) { + super(card); + } + + @Override + public BiteOfTheBlackRose copy() { + return new BiteOfTheBlackRose(this); + } +} + +class BiteOfTheBlackRoseEffect extends OneShotEffect { + + BiteOfTheBlackRoseEffect() { + super(Outcome.Benefit); + this.staticText = "Will of the council - Starting with you, each player votes for sickness or psychosis. If sickness gets more votes, creatures your opponents control get -2/-2 until end of turn. If psychosis gets more votes or the vote is tied, each opponent discards two cards"; + } + + BiteOfTheBlackRoseEffect(final BiteOfTheBlackRoseEffect effect) { + super(effect); + } + + @Override + public BiteOfTheBlackRoseEffect copy() { + return new BiteOfTheBlackRoseEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int sicknessCount = 0; + int psychosisCount = 0; + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + if (player.chooseUse(Outcome.ExtraTurn, "Choose sickness?", source, game)) { + sicknessCount++; + game.informPlayers(player.getLogName() + " has chosen: sickness"); + } else { + psychosisCount++; + game.informPlayers(player.getLogName() + " has chosen: psychosis"); + } + } + } + if (sicknessCount > psychosisCount) { + ContinuousEffect effect = new BoostOpponentsEffect(-2, -2, Duration.EndOfTurn); + game.addEffect(effect, source); + } else { + new DiscardEachPlayerEffect(new StaticValue(2), false, TargetController.OPPONENT).apply(game, source); + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/conspiracy/BoldwyrIntimidator.java b/Mage.Sets/src/mage/sets/conspiracy/BoldwyrIntimidator.java new file mode 100644 index 00000000000..2ab7eb29e08 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/BoldwyrIntimidator.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BoldwyrIntimidator extends mage.sets.morningtide.BoldwyrIntimidator { + + public BoldwyrIntimidator(UUID ownerId) { + super(ownerId); + this.cardNumber = 137; + this.expansionSetCode = "CNS"; + } + + public BoldwyrIntimidator(final BoldwyrIntimidator card) { + super(card); + } + + @Override + public BoldwyrIntimidator copy() { + return new BoldwyrIntimidator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/DackFayden.java b/Mage.Sets/src/mage/sets/conspiracy/DackFayden.java index e9d62fe6ab5..05b0faad94c 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/DackFayden.java +++ b/Mage.Sets/src/mage/sets/conspiracy/DackFayden.java @@ -34,13 +34,12 @@ import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.SpellAbility; import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.continuous.GainControlTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -50,7 +49,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.counters.CounterType; import mage.game.Game; import mage.game.command.Emblem; import mage.game.events.GameEvent; @@ -73,8 +71,7 @@ public class DackFayden extends CardImpl { this.expansionSetCode = "CNS"; this.subtype.add("Dack"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +1: Target player draws two cards, then discards two cards. LoyaltyAbility ability = new LoyaltyAbility(new DrawCardTargetEffect(2), 1); @@ -83,14 +80,14 @@ public class DackFayden extends CardImpl { ability.addEffect(effect); ability.addTarget(new TargetPlayer()); this.addAbility(ability); - + // -2: Gain control of target artifact. effect = new GainControlTargetEffect(Duration.EndOfGame, true); effect.setText("Gain control of target artifact"); ability = new LoyaltyAbility(effect, -2); ability.addTarget(new TargetArtifactPermanent()); this.addAbility(ability); - + // -6: You get an emblem with "Whenever you cast a spell that targets one or more permanents, gain control of those permanents." effect = new GetEmblemEffect(new DackFaydenEmblem()); effect.setText("You get an emblem with \"Whenever you cast a spell that targets one or more permanents, gain control of those permanents.\""); @@ -109,7 +106,7 @@ public class DackFayden extends CardImpl { } class DackFaydenEmblem extends Emblem { - + DackFaydenEmblem() { this.setName("EMBLEM: Dack Fayden"); this.getAbilities().add(new DackFaydenEmblemTriggeredAbility()); @@ -117,15 +114,15 @@ class DackFaydenEmblem extends Emblem { } class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl { - + DackFaydenEmblemTriggeredAbility() { super(Zone.COMMAND, new DackFaydenEmblemEffect(), false); } - + DackFaydenEmblemTriggeredAbility(final DackFaydenEmblemTriggeredAbility ability) { super(ability); } - + @Override public DackFaydenEmblemTriggeredAbility copy() { return new DackFaydenEmblemTriggeredAbility(this); @@ -135,7 +132,7 @@ class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl { public boolean checkEventType(GameEvent event, Game game) { return event.getType() == EventType.SPELL_CAST; } - + @Override public boolean checkTrigger(GameEvent event, Game game) { boolean returnValue = false; @@ -175,7 +172,7 @@ class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl { } return returnValue; } - + @Override public String getRule() { return "Whenever you cast a spell that targets one or more permanents, gain control of those permanents."; @@ -183,24 +180,24 @@ class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl { } class DackFaydenEmblemEffect extends ContinuousEffectImpl { - + protected List permanents; - + DackFaydenEmblemEffect() { super(Duration.EndOfGame, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); this.staticText = "gain control of those permanents"; } - + DackFaydenEmblemEffect(final DackFaydenEmblemEffect effect) { super(effect); this.permanents = effect.permanents; } - + @Override public DackFaydenEmblemEffect copy() { return new DackFaydenEmblemEffect(this); } - + @Override public boolean apply(Game game, Ability source) { for (UUID permanentId : this.permanents) { @@ -211,7 +208,7 @@ class DackFaydenEmblemEffect extends ContinuousEffectImpl { } return true; } - + public void setPermanents(List targettedPermanents) { this.permanents = new ArrayList<>(targettedPermanents); } diff --git a/Mage.Sets/src/mage/sets/conspiracy/ExtractFromDarkness.java b/Mage.Sets/src/mage/sets/conspiracy/ExtractFromDarkness.java index 9b30e45ef2c..4fe08b08edc 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/ExtractFromDarkness.java +++ b/Mage.Sets/src/mage/sets/conspiracy/ExtractFromDarkness.java @@ -30,7 +30,6 @@ package mage.sets.conspiracy; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -114,17 +113,16 @@ class ExtractFromDarknessReturnFromGraveyardToBattlefieldEffect extends OneShotE @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { Target target = new TargetCardInGraveyard(new FilterCreatureCard()); target.setNotTarget(true); if (target.canChoose(source.getSourceId(), source.getControllerId(), game) - && player.chooseTarget(outcome, target, source, game)) { - Card card = game.getCard(target.getFirstTarget()); - player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + && controller.chooseTarget(outcome, target, source, game)) { + return controller.moveCards(game.getCard(target.getFirstTarget()), Zone.BATTLEFIELD, source, game); } return true; } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/GrenzoDungeonWarden.java b/Mage.Sets/src/mage/sets/conspiracy/GrenzoDungeonWarden.java index 4b253a06661..ddc3e84d5a7 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/GrenzoDungeonWarden.java +++ b/Mage.Sets/src/mage/sets/conspiracy/GrenzoDungeonWarden.java @@ -30,11 +30,11 @@ package mage.sets.conspiracy; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; @@ -63,8 +63,8 @@ public class GrenzoDungeonWarden extends CardImpl { this.toughness = new MageInt(2); // Grenzo, Dungeon Warden enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new GrenzoDungeonWardenEtBEffect())); - + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); + // {2}: Put the bottom card of your library into your graveyard. If it's a creature card with power less than or equal to Grenzo's power, put it onto the battlefield. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrenzoDungeonWardenEffect(), new GenericManaCost(2))); } @@ -79,68 +79,34 @@ public class GrenzoDungeonWarden extends CardImpl { } } -class GrenzoDungeonWardenEtBEffect extends OneShotEffect { - - GrenzoDungeonWardenEtBEffect() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - GrenzoDungeonWardenEtBEffect(final GrenzoDungeonWardenEtBEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((Ability) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public GrenzoDungeonWardenEtBEffect copy() { - return new GrenzoDungeonWardenEtBEffect(this); - } -} - class GrenzoDungeonWardenEffect extends OneShotEffect { - + GrenzoDungeonWardenEffect() { super(Outcome.Benefit); this.staticText = "Put the bottom card of your library into your graveyard. If it's a creature card with power less than or equal to {this}'s power, put it onto the battlefield"; } - + GrenzoDungeonWardenEffect(final GrenzoDungeonWardenEffect effect) { super(effect); } - + @Override public GrenzoDungeonWardenEffect copy() { return new GrenzoDungeonWardenEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { if (controller.getLibrary().size() > 0) { - Card card = controller.getLibrary().removeFromBottom(game); + Card card = controller.getLibrary().getFromBottom(game); if (card != null) { - controller.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); + controller.moveCards(card, Zone.GRAVEYARD, source, game); if (card.getCardType().contains(CardType.CREATURE)) { Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (sourcePermanent != null && card.getPower().getValue() <= sourcePermanent.getPower().getValue()) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } } diff --git a/Mage.Sets/src/mage/sets/conspiracy/MagisterOfWorth.java b/Mage.Sets/src/mage/sets/conspiracy/MagisterOfWorth.java new file mode 100644 index 00000000000..c9ede50c8d7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/MagisterOfWorth.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class MagisterOfWorth extends mage.sets.mediainserts.MagisterOfWorth { + + public MagisterOfWorth(UUID ownerId) { + super(ownerId); + this.cardNumber = 48; + this.expansionSetCode = "CNS"; + this.rarity = Rarity.RARE; + } + + public MagisterOfWorth(final MagisterOfWorth card) { + super(card); + } + + @Override + public MagisterOfWorth copy() { + return new MagisterOfWorth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/MuzzioVisionaryArchitect.java b/Mage.Sets/src/mage/sets/conspiracy/MuzzioVisionaryArchitect.java index 71a562bab0f..437601df097 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/MuzzioVisionaryArchitect.java +++ b/Mage.Sets/src/mage/sets/conspiracy/MuzzioVisionaryArchitect.java @@ -99,14 +99,14 @@ class MuzzioVisionaryArchitectEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (player == null || sourcePermanent == null) { + if (controller == null || sourcePermanent == null) { return false; } int highCMC = 0; - List controlledArtifacts = game.getBattlefield().getAllActivePermanents(new FilterArtifactPermanent(), player.getId(), game); + List controlledArtifacts = game.getBattlefield().getAllActivePermanents(new FilterArtifactPermanent(), controller.getId(), game); for (Permanent permanent : controlledArtifacts) { if (permanent.getSpellAbility() != null) { int cmc = permanent.getSpellAbility().getManaCosts().convertedManaCost(); @@ -119,26 +119,26 @@ class MuzzioVisionaryArchitectEffect extends OneShotEffect { Cards cards = new CardsImpl(); for (int i = 0; i < highCMC; i++) { - Card card = player.getLibrary().removeFromTop(game); + Card card = controller.getLibrary().removeFromTop(game); if (card != null) { cards.add(card); } } - player.lookAtCards(sourcePermanent.getName(), cards, game); + controller.lookAtCards(sourcePermanent.getIdName(), cards, game); if (!cards.isEmpty()) { TargetCard target = new TargetCard(Zone.LIBRARY, new FilterArtifactCard("artifact card to put onto the battlefield")); - if (target.canChoose(source.getSourceId(), player.getId(), game) && player.choose(Outcome.Benefit, cards, target, game)) { + if (target.canChoose(source.getSourceId(), controller.getId(), game) && controller.choose(Outcome.Benefit, cards, target, game)) { Card card = cards.get(target.getFirstTarget(), game); if (card != null) { - player.revealCards(sourcePermanent.getName(), new CardsImpl(card), game); + controller.revealCards(sourcePermanent.getIdName(), new CardsImpl(card), game); cards.remove(card); - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } } - player.putCardsOnBottomOfLibrary(cards, game, source, true); + controller.putCardsOnBottomOfLibrary(cards, game, source, true); return true; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/ReignOfThePit.java b/Mage.Sets/src/mage/sets/conspiracy/ReignOfThePit.java new file mode 100644 index 00000000000..da60b466e3c --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/ReignOfThePit.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class ReignOfThePit extends mage.sets.vintagemasters.ReignOfThePit { + + public ReignOfThePit(UUID ownerId) { + super(ownerId); + this.cardNumber = 29; + this.expansionSetCode = "CNS"; + } + + public ReignOfThePit(final ReignOfThePit card) { + super(card); + } + + @Override + public ReignOfThePit copy() { + return new ReignOfThePit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/RousingOfSouls.java b/Mage.Sets/src/mage/sets/conspiracy/RousingOfSouls.java new file mode 100644 index 00000000000..419e0d0a3fa --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/RousingOfSouls.java @@ -0,0 +1,101 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.ParleyCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.token.SpiritWhiteToken; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class RousingOfSouls extends CardImpl { + + public RousingOfSouls(UUID ownerId) { + super(ownerId, 19, "Rousing of Souls", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "CNS"; + + // Parley - Each player reveals the top card of his or her library. For each nonland card revealed this way, + // you put a 1/1 white Spirit creature token with flying onto the battlefield. Then each player draws a card. + this.getSpellAbility().addEffect(new RousingOfSoulsEffect()); + Effect effect = new DrawCardAllEffect(1); + effect.setText("Then each player draws a card"); + this.getSpellAbility().addEffect(effect); + } + + public RousingOfSouls(final RousingOfSouls card) { + super(card); + } + + @Override + public RousingOfSouls copy() { + return new RousingOfSouls(this); + } +} + +class RousingOfSoulsEffect extends OneShotEffect { + + public RousingOfSoulsEffect() { + super(Outcome.Benefit); + this.staticText = "Parley — Each player reveals the top card of his or her library. For each nonland card revealed this way, you put a 1/1 white Spirit creature token with flying onto the battlefield"; + } + + public RousingOfSoulsEffect(final RousingOfSoulsEffect effect) { + super(effect); + } + + @Override + public RousingOfSoulsEffect copy() { + return new RousingOfSoulsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int parley = ParleyCount.getInstance().calculate(game, source, this); + if (parley > 0) { + new CreateTokenEffect(new SpiritWhiteToken(), parley).apply(game, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/SelvalasCharge.java b/Mage.Sets/src/mage/sets/conspiracy/SelvalasCharge.java new file mode 100644 index 00000000000..ea2b5291118 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/SelvalasCharge.java @@ -0,0 +1,100 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.ParleyCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.token.ElephantToken; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class SelvalasCharge extends CardImpl { + + public SelvalasCharge(UUID ownerId) { + super(ownerId, 39, "Selvala's Charge", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{G}"); + this.expansionSetCode = "CNS"; + + // Parley - Each player reveals the top card of his or her library. For each nonland card revealed this way, you put a 3/3 green Elephant creature token onto the battlefield. Then each player draws a card. + this.getSpellAbility().addEffect(new SelvalasChargeEffect()); + Effect effect = new DrawCardAllEffect(1); + effect.setText("Then each player draws a card"); + this.getSpellAbility().addEffect(effect); + } + + public SelvalasCharge(final SelvalasCharge card) { + super(card); + } + + @Override + public SelvalasCharge copy() { + return new SelvalasCharge(this); + } +} + +class SelvalasChargeEffect extends OneShotEffect { + + public SelvalasChargeEffect() { + super(Outcome.Benefit); + this.staticText = "Parley — Each player reveals the top card of his or her library. For each nonland card revealed this way, you put a 3/3 green Elephant creature token onto the battlefield"; + } + + public SelvalasChargeEffect(final SelvalasChargeEffect effect) { + super(effect); + } + + @Override + public SelvalasChargeEffect copy() { + return new SelvalasChargeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int parley = ParleyCount.getInstance().calculate(game, source, this); + if (parley > 0) { + new CreateTokenEffect(new ElephantToken(), parley).apply(game, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/SelvalasEnforcer.java b/Mage.Sets/src/mage/sets/conspiracy/SelvalasEnforcer.java new file mode 100644 index 00000000000..c846d64caa0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/SelvalasEnforcer.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.ParleyCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class SelvalasEnforcer extends CardImpl { + + public SelvalasEnforcer(UUID ownerId) { + super(ownerId, 40, "Selvala's Enforcer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "CNS"; + this.subtype.add("Elf"); + this.subtype.add("Warrior"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Parley - When Selvala's Enforcer enters the battlefield, each player reveals the top card of his or her library. + // For each nonland card revealed this way, put a +1/+1 counter on Selvala's Enforcer. Then each player draws a card. + Ability ability = new EntersBattlefieldTriggeredAbility(new SelvalasEnforcerEffect(), false, "Parley — "); + Effect effect = new DrawCardAllEffect(1); + effect.setText("Then each player draws a card"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public SelvalasEnforcer(final SelvalasEnforcer card) { + super(card); + } + + @Override + public SelvalasEnforcer copy() { + return new SelvalasEnforcer(this); + } +} + +class SelvalasEnforcerEffect extends OneShotEffect { + + public SelvalasEnforcerEffect() { + super(Outcome.Benefit); + this.staticText = "each player reveals the top card of his or her library. For each nonland card revealed this way, put a +1/+1 counter on {this}"; + } + + public SelvalasEnforcerEffect(final SelvalasEnforcerEffect effect) { + super(effect); + } + + @Override + public SelvalasEnforcerEffect copy() { + return new SelvalasEnforcerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int parley = ParleyCount.getInstance().calculate(game, source, this); + if (parley > 0) { + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (sourcePermanent != null) { + sourcePermanent.addCounters(CounterType.P1P1.createInstance(parley), game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/Victimize.java b/Mage.Sets/src/mage/sets/conspiracy/Victimize.java index 5f8a7bf3fc4..a49a512c2d3 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/Victimize.java +++ b/Mage.Sets/src/mage/sets/conspiracy/Victimize.java @@ -31,8 +31,8 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -70,36 +70,32 @@ public class Victimize extends CardImpl { } class VictimizeEffect extends OneShotEffect { - + VictimizeEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "Choose two target creature cards in your graveyard. Sacrifice a creature. If you do, return the chosen cards to the battlefield tapped"; } - + VictimizeEffect(final VictimizeEffect effect) { super(effect); } - + @Override public VictimizeEffect copy() { return new VictimizeEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { - for (UUID targetId: getTargetPointer().getTargets(game, source)) { - Card card = game.getCard(targetId); - if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), true); - } - } + controller.moveCards(new CardsImpl(getTargetPointer().getTargets(game, source)).getCards(game), + Zone.BATTLEFIELD, source, game, true, false, false, null); } return true; } return false; - } + } } diff --git a/Mage.Sets/src/mage/sets/conspiracy/WakestoneGargoyle.java b/Mage.Sets/src/mage/sets/conspiracy/WakestoneGargoyle.java index ef7df54b8ba..aefa67bd5d0 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/WakestoneGargoyle.java +++ b/Mage.Sets/src/mage/sets/conspiracy/WakestoneGargoyle.java @@ -1,80 +1,80 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.conspiracy; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderAllEffect; -import mage.abilities.keyword.DefenderAbility; -import mage.abilities.keyword.FlyingAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.predicate.mageobject.AbilityPredicate; - -/** - * - * @author LevelX2 - */ -public class WakestoneGargoyle extends CardImpl { - - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Creatures you control with defender"); - - static { - filter.add(new AbilityPredicate(DefenderAbility.class)); - } - - public WakestoneGargoyle(UUID ownerId) { - super(ownerId, 88, "Wakestone Gargoyle", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); - this.expansionSetCode = "CNS"; - this.subtype.add("Gargoyle"); - this.power = new MageInt(3); - this.toughness = new MageInt(4); - - // Defender - this.addAbility(DefenderAbility.getInstance()); - // Flying - this.addAbility(FlyingAbility.getInstance()); - // {1}{W}: Creatures you control with defender can attack this turn as though they didn't have defender. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughtItDidntHaveDefenderAllEffect(Duration.EndOfTurn, filter), new ManaCostsImpl("{1}{W}") )); - } - - public WakestoneGargoyle(final WakestoneGargoyle card) { - super(card); - } - - @Override - public WakestoneGargoyle copy() { - return new WakestoneGargoyle(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderAllEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LevelX2 + */ +public class WakestoneGargoyle extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Creatures you control with defender"); + + static { + filter.add(new AbilityPredicate(DefenderAbility.class)); + } + + public WakestoneGargoyle(UUID ownerId) { + super(ownerId, 88, "Wakestone Gargoyle", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "CNS"; + this.subtype.add("Gargoyle"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {1}{W}: Creatures you control with defender can attack this turn as though they didn't have defender. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderAllEffect(Duration.EndOfTurn, filter), new ManaCostsImpl("{1}{W}") )); + } + + public WakestoneGargoyle(final WakestoneGargoyle card) { + super(card); + } + + @Override + public WakestoneGargoyle copy() { + return new WakestoneGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/conspiracy/WoodvineElemental.java b/Mage.Sets/src/mage/sets/conspiracy/WoodvineElemental.java new file mode 100644 index 00000000000..1a6eafc4bf8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/conspiracy/WoodvineElemental.java @@ -0,0 +1,113 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.conspiracy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.dynamicvalue.common.ParleyCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class WoodvineElemental extends CardImpl { + + final private String rule = "Parley — Whenever {this} attacks, each player reveals the top card of his or her library. " + + "For each nonland card revealed this way, attacking creatures you control get +1/+1 until end of turn. Then each player draws a card."; + + public WoodvineElemental(UUID ownerId) { + super(ownerId, 52, "Woodvine Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{W}"); + this.expansionSetCode = "CNS"; + this.subtype.add("Elemental"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Parley - Whenever Woodvine Elemental attacks, each player reveals the top card of his or her library. + // For each nonland card revealed this way, attacking creatures you control get +1/+1 until end of turn. Then each player draws a card. + Ability ability = new AttacksTriggeredAbility(new WoodvineElementalEffect(), false, rule); + Effect effect = new DrawCardAllEffect(1); + ability.addEffect(effect); + this.addAbility(ability); + } + + public WoodvineElemental(final WoodvineElemental card) { + super(card); + } + + @Override + public WoodvineElemental copy() { + return new WoodvineElemental(this); + } +} + +class WoodvineElementalEffect extends OneShotEffect { + + public WoodvineElementalEffect() { + super(Outcome.Benefit); + } + + public WoodvineElementalEffect(final WoodvineElementalEffect effect) { + super(effect); + } + + @Override + public WoodvineElementalEffect copy() { + return new WoodvineElementalEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int parley = ParleyCount.getInstance().calculate(game, source, this); + if (parley > 0) { + game.addEffect(new BoostControlledEffect(parley, parley, Duration.EndOfTurn, new FilterAttackingCreature("Attacking creatures"), false), source); + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java b/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java index 42fc893a116..3fc7222beac 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java +++ b/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java @@ -65,6 +65,7 @@ public class ArchdemonOfGreed extends CardImpl { super(ownerId, 71, "Archdemon of Greed", Rarity.RARE, new CardType[]{CardType.CREATURE}, ""); this.expansionSetCode = "DKA"; this.subtype.add("Demon"); + this.color.setBlack(true); this.nightCard = true; this.canTransform = true; diff --git a/Mage.Sets/src/mage/sets/darkascension/FalkenrathAristocrat.java b/Mage.Sets/src/mage/sets/darkascension/FalkenrathAristocrat.java index f31b0642508..75e242e0968 100644 --- a/Mage.Sets/src/mage/sets/darkascension/FalkenrathAristocrat.java +++ b/Mage.Sets/src/mage/sets/darkascension/FalkenrathAristocrat.java @@ -1,117 +1,117 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.darkascension; - -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.Cost; -import mage.abilities.costs.common.SacrificeTargetCost; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.keyword.FlyingAbility; -import mage.abilities.keyword.HasteAbility; -import mage.abilities.keyword.IndestructibleAbility; -import mage.cards.CardImpl; -import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.target.common.TargetControlledCreaturePermanent; - -/** - * - * @author North - */ -public class FalkenrathAristocrat extends CardImpl { - - public FalkenrathAristocrat(UUID ownerId) { - super(ownerId, 138, "Falkenrath Aristocrat", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{B}{R}"); - this.expansionSetCode = "DKA"; - this.subtype.add("Vampire"); - - this.power = new MageInt(4); - this.toughness = new MageInt(1); - - this.addAbility(FlyingAbility.getInstance()); - this.addAbility(HasteAbility.getInstance()); - // Sacrifice a creature: Falkenrath Aristocrat is indestructible this turn. - // If the sacrificed creature was a Human, put a +1/+1 counter on Falkenrath Aristocrat. - SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), - new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - ability.addEffect(new FalkenrathAristocratEffect()); - this.addAbility(ability); - } - - public FalkenrathAristocrat(final FalkenrathAristocrat card) { - super(card); - } - - @Override - public FalkenrathAristocrat copy() { - return new FalkenrathAristocrat(this); - } -} - -class FalkenrathAristocratEffect extends OneShotEffect { - - public FalkenrathAristocratEffect() { - super(Outcome.BoostCreature); - this.staticText = "If the sacrificed creature was a Human, put a +1/+1 counter on {this}"; - } - - public FalkenrathAristocratEffect(final FalkenrathAristocratEffect effect) { - super(effect); - } - - @Override - public FalkenrathAristocratEffect copy() { - return new FalkenrathAristocratEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - for (Cost cost : source.getCosts()) { - if (cost instanceof SacrificeTargetCost) { - Permanent sacrificedCreature = ((SacrificeTargetCost) cost).getPermanents().get(0); - Permanent sourceCreature = game.getPermanent(source.getSourceId()); - if (sacrificedCreature.hasSubtype("Human") && sourceCreature != null) { - sourceCreature.addCounters(CounterType.P1P1.createInstance(), game); - return true; - } - } - } - return false; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.darkascension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author North + */ +public class FalkenrathAristocrat extends CardImpl { + + public FalkenrathAristocrat(UUID ownerId) { + super(ownerId, 138, "Falkenrath Aristocrat", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{B}{R}"); + this.expansionSetCode = "DKA"; + this.subtype.add("Vampire"); + + this.power = new MageInt(4); + this.toughness = new MageInt(1); + + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(HasteAbility.getInstance()); + // Sacrifice a creature: Falkenrath Aristocrat is indestructible this turn. + // If the sacrificed creature was a Human, put a +1/+1 counter on Falkenrath Aristocrat. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), + new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addEffect(new FalkenrathAristocratEffect()); + this.addAbility(ability); + } + + public FalkenrathAristocrat(final FalkenrathAristocrat card) { + super(card); + } + + @Override + public FalkenrathAristocrat copy() { + return new FalkenrathAristocrat(this); + } +} + +class FalkenrathAristocratEffect extends OneShotEffect { + + public FalkenrathAristocratEffect() { + super(Outcome.BoostCreature); + this.staticText = "If the sacrificed creature was a Human, put a +1/+1 counter on {this}"; + } + + public FalkenrathAristocratEffect(final FalkenrathAristocratEffect effect) { + super(effect); + } + + @Override + public FalkenrathAristocratEffect copy() { + return new FalkenrathAristocratEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Cost cost : source.getCosts()) { + if (cost instanceof SacrificeTargetCost) { + Permanent sacrificedCreature = ((SacrificeTargetCost) cost).getPermanents().get(0); + Permanent sourceCreature = game.getPermanent(source.getSourceId()); + if (sacrificedCreature.hasSubtype("Human") && sourceCreature != null) { + sourceCreature.addCounters(CounterType.P1P1.createInstance(), game); + return true; + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/darkascension/GatherTheTownsfolk.java b/Mage.Sets/src/mage/sets/darkascension/GatherTheTownsfolk.java index d734501cf7f..15553884e18 100644 --- a/Mage.Sets/src/mage/sets/darkascension/GatherTheTownsfolk.java +++ b/Mage.Sets/src/mage/sets/darkascension/GatherTheTownsfolk.java @@ -30,13 +30,12 @@ package mage.sets.darkascension; import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.condition.common.FatefulHourCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.HumanToken; /** * @@ -64,17 +63,3 @@ public class GatherTheTownsfolk extends CardImpl { return new GatherTheTownsfolk(this); } } - -class HumanToken extends Token { - - public HumanToken() { - super("Human", "1/1 white Human creature token"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Human"); - power = new MageInt(1); - toughness = new MageInt(1); - } - -} diff --git a/Mage.Sets/src/mage/sets/darkascension/HuntmasterOfTheFells.java b/Mage.Sets/src/mage/sets/darkascension/HuntmasterOfTheFells.java index 193aee99a9a..22098f98e2f 100644 --- a/Mage.Sets/src/mage/sets/darkascension/HuntmasterOfTheFells.java +++ b/Mage.Sets/src/mage/sets/darkascension/HuntmasterOfTheFells.java @@ -101,7 +101,7 @@ public class HuntmasterOfTheFells extends CardImpl { class HuntmasterOfTheFellsAbility extends TriggeredAbilityImpl { public HuntmasterOfTheFellsAbility() { - super(Zone.BATTLEFIELD, new CreateTokenEffect(new WolfToken(Token.Type.SECOND)), false); + super(Zone.BATTLEFIELD, new CreateTokenEffect(new WolfToken()), false); this.addEffect(new GainLifeEffect(2)); } diff --git a/Mage.Sets/src/mage/sets/darkascension/IncreasingDevotion.java b/Mage.Sets/src/mage/sets/darkascension/IncreasingDevotion.java index e5405b471e6..12f7f2fcd06 100644 --- a/Mage.Sets/src/mage/sets/darkascension/IncreasingDevotion.java +++ b/Mage.Sets/src/mage/sets/darkascension/IncreasingDevotion.java @@ -28,14 +28,18 @@ package mage.sets.darkascension; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TimingRule; +import mage.constants.Zone; import mage.game.Game; +import mage.game.permanent.token.HumanToken; import mage.game.stack.Spell; /** @@ -48,7 +52,6 @@ public class IncreasingDevotion extends CardImpl { super(ownerId, 11, "Increasing Devotion", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{W}{W}"); this.expansionSetCode = "DKA"; - // Put five 1/1 white Human creature tokens onto the battlefield. If Increasing Devotion was cast from a graveyard, put ten of those tokens onto the battlefield instead. this.getSpellAbility().addEffect(new IncreasingDevotionEffect()); diff --git a/Mage.Sets/src/mage/sets/darkascension/MikaeusTheUnhallowed.java b/Mage.Sets/src/mage/sets/darkascension/MikaeusTheUnhallowed.java index 99831fe3acc..6b0ca36525a 100644 --- a/Mage.Sets/src/mage/sets/darkascension/MikaeusTheUnhallowed.java +++ b/Mage.Sets/src/mage/sets/darkascension/MikaeusTheUnhallowed.java @@ -28,10 +28,6 @@ package mage.sets.darkascension; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; @@ -41,6 +37,10 @@ import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.keyword.IntimidateAbility; import mage.abilities.keyword.UndyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -74,6 +74,7 @@ public class MikaeusTheUnhallowed extends CardImpl { this.addAbility(IntimidateAbility.getInstance()); // Whenever a Human deals damage to you, destroy it. this.addAbility(new MikaeusTheUnhallowedAbility()); + // Other non-Human creatures you control get +1/+1 and have undying. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new UndyingAbility(), Duration.WhileOnBattlefield, filter, true))); @@ -109,7 +110,6 @@ class MikaeusTheUnhallowedAbility extends TriggeredAbilityImpl { return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; } - @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId().equals(this.controllerId)) { diff --git a/Mage.Sets/src/mage/sets/darkascension/RequiemAngel.java b/Mage.Sets/src/mage/sets/darkascension/RequiemAngel.java index 3f1263e0fb8..7b98ac2bcb2 100644 --- a/Mage.Sets/src/mage/sets/darkascension/RequiemAngel.java +++ b/Mage.Sets/src/mage/sets/darkascension/RequiemAngel.java @@ -67,7 +67,7 @@ public class RequiemAngel extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever another non-Spirit creature you control dies, put a 1/1 white Spirit creature token with flying onto the battlefield. - this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken(expansionSetCode), 1), false, filter)); + this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken("ISD"), 1), false, filter)); } public RequiemAngel(final RequiemAngel card) { diff --git a/Mage.Sets/src/mage/sets/darkascension/Seance.java b/Mage.Sets/src/mage/sets/darkascension/Seance.java index 944b43994f8..1b28fafa421 100644 --- a/Mage.Sets/src/mage/sets/darkascension/Seance.java +++ b/Mage.Sets/src/mage/sets/darkascension/Seance.java @@ -34,6 +34,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; @@ -43,11 +44,10 @@ import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; -import mage.game.permanent.token.EmptyToken; +import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; import mage.target.targetpointer.FixedTarget; -import mage.util.CardUtil; /** * @@ -59,7 +59,6 @@ public class Seance extends CardImpl { super(ownerId, 20, "Seance", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); this.expansionSetCode = "DKA"; - // At the beginning of each upkeep, you may exile target creature card from your graveyard. If you do, put a token onto the battlefield that's a copy of that card except it's a Spirit in addition to its other types. Exile it at the beginning of the next end step. Ability ability = new BeginningOfUpkeepTriggeredAbility(new SeanceEffect(), TargetController.ANY, true); ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); @@ -97,24 +96,21 @@ class SeanceEffect extends OneShotEffect { Card card = game.getCard(source.getFirstTarget()); Player controller = game.getPlayer(source.getControllerId()); if (controller != null && card != null) { - if (controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true)) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(card); - - if (!token.hasSubtype("Spirit")) { - token.getSubtype().add("Spirit"); - } - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + if (controller.moveCards(card, null, Zone.EXILED, source, game)) { + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, false); + effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); + effect.setAdditionalSubType("Spirit"); + effect.apply(game, source); + for (Permanent addedToken : effect.getAddedPermanent()) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(addedToken, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } } - return true; } diff --git a/Mage.Sets/src/mage/sets/darkascension/SorinLordOfInnistrad.java b/Mage.Sets/src/mage/sets/darkascension/SorinLordOfInnistrad.java index d351fa80033..f5a89e1c6dc 100644 --- a/Mage.Sets/src/mage/sets/darkascension/SorinLordOfInnistrad.java +++ b/Mage.Sets/src/mage/sets/darkascension/SorinLordOfInnistrad.java @@ -27,25 +27,24 @@ */ package mage.sets.darkascension; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.LifelinkAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; import mage.constants.Outcome; -import mage.counters.CounterType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -56,8 +55,6 @@ import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.TargetPermanent; -import java.util.UUID; - /** * * @author BetaSteward @@ -77,8 +74,7 @@ public class SorinLordOfInnistrad extends CardImpl { this.expansionSetCode = "DKA"; this.subtype.add("Sorin"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +1: Put a 1/1 black Vampire creature token with lifelink onto the battlefield. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new VampireToken()), 1)); @@ -103,6 +99,7 @@ public class SorinLordOfInnistrad extends CardImpl { } class VampireToken extends Token { + VampireToken() { super("Vampire", "a 1/1 black Vampire creature token with lifelink"); cardType.add(CardType.CREATURE); @@ -142,7 +139,7 @@ class SorinLordOfInnistradEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - for (UUID targetId: source.getTargets().get(0).getTargets()) { + for (UUID targetId : source.getTargets().get(0).getTargets()) { Permanent perm = game.getPermanent(targetId); if (perm != null) { perm.destroy(source.getSourceId(), game, false); @@ -150,7 +147,7 @@ class SorinLordOfInnistradEffect extends OneShotEffect { } Player player = game.getPlayer(source.getControllerId()); if (player != null) { - for (UUID targetId: source.getTargets().get(0).getTargets()) { + for (UUID targetId : source.getTargets().get(0).getTargets()) { if (game.getState().getZone(targetId) == Zone.GRAVEYARD) { Card card = game.getCard(targetId); if (card != null) { diff --git a/Mage.Sets/src/mage/sets/darkascension/ThrabenDoomsayer.java b/Mage.Sets/src/mage/sets/darkascension/ThrabenDoomsayer.java index 5da2eef4b10..0b0946ed834 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ThrabenDoomsayer.java +++ b/Mage.Sets/src/mage/sets/darkascension/ThrabenDoomsayer.java @@ -28,9 +28,6 @@ package mage.sets.darkascension; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; @@ -40,8 +37,11 @@ import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; +import mage.game.permanent.token.HumanToken; /** * @@ -61,7 +61,7 @@ public class ThrabenDoomsayer extends CardImpl { // {tap}: Put a 1/1 white Human creature token onto the battlefield. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new HumanToken()), new TapSourceCost())); // Fateful hour - As long as you have 5 or less life, other creatures you control get +2/+2. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, false), + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, true), FatefulHourCondition.getInstance(), "As long as you have 5 or less life, other creatures you control get +2/+2"))); } diff --git a/Mage.Sets/src/mage/sets/darkascension/WolfhuntersQuiver.java b/Mage.Sets/src/mage/sets/darkascension/WolfhuntersQuiver.java index 33e582f32ef..b110ad5d363 100644 --- a/Mage.Sets/src/mage/sets/darkascension/WolfhuntersQuiver.java +++ b/Mage.Sets/src/mage/sets/darkascension/WolfhuntersQuiver.java @@ -67,11 +67,11 @@ public class WolfhuntersQuiver extends CardImpl { this.expansionSetCode = "DKA"; this.subtype.add("Equipment"); - // Equipped creature has "{tap}: This creature deals 1 damage to target creature or player" + // Equipped creature has "{T}: This creature deals 1 damage to target creature or player" Ability abilityToGain = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); abilityToGain.addTarget(new TargetCreatureOrPlayer()); Effect effect = new GainAbilityAttachedEffect(abilityToGain, AttachmentType.EQUIPMENT); - effect.setText("Equipped creature has \"{tap}: This creature deals 1 damage to target creature or player\""); + effect.setText("Equipped creature has \"{T}: This creature deals 1 damage to target creature or player\""); SimpleStaticAbility ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); // and "{T}: This creature deals 3 damage to target Werewolf creature." diff --git a/Mage.Sets/src/mage/sets/darksteel/AEtherVial.java b/Mage.Sets/src/mage/sets/darksteel/AEtherVial.java index baa5d24d1c4..8c1332a991b 100644 --- a/Mage.Sets/src/mage/sets/darksteel/AEtherVial.java +++ b/Mage.Sets/src/mage/sets/darksteel/AEtherVial.java @@ -28,11 +28,6 @@ package mage.sets.darksteel; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -41,6 +36,11 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.Filter; import mage.filter.common.FilterCreatureCard; @@ -107,18 +107,20 @@ class AEtherVialEffect extends OneShotEffect { filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, count)); String choiceText = "Put a " + filter.getMessage() + " from your hand onto the battlefield?"; - Player player = game.getPlayer(source.getControllerId()); - if (player == null || player.getHand().count(filter, game) == 0 - || !player.chooseUse(this.outcome, choiceText, source, game)) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } + if (controller.getHand().count(filter, game) == 0 + || !controller.chooseUse(this.outcome, choiceText, source, game)) { + return true; + } TargetCardInHand target = new TargetCardInHand(filter); - if (player.choose(this.outcome, target, source.getSourceId(), game)) { + if (controller.choose(this.outcome, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); - return true; + return controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } return false; diff --git a/Mage.Sets/src/mage/sets/darksteel/ChromescaleDrake.java b/Mage.Sets/src/mage/sets/darksteel/ChromescaleDrake.java new file mode 100644 index 00000000000..9f06247482a --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/ChromescaleDrake.java @@ -0,0 +1,122 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.darksteel; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.AffinityForArtifactsAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class ChromescaleDrake extends CardImpl { + + public ChromescaleDrake(UUID ownerId) { + super(ownerId, 20, "Chromescale Drake", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}{U}{U}"); + this.expansionSetCode = "DST"; + this.subtype.add("Drake"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Affinity for artifacts + this.addAbility(new AffinityForArtifactsAbility()); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Chromescale Drake enters the battlefield, reveal the top three cards of your library. Put all artifact cards revealed this way into your hand and the rest into your graveyard. + this.addAbility(new EntersBattlefieldTriggeredAbility(new ChromescaleDrakeEffect())); + } + + public ChromescaleDrake(final ChromescaleDrake card) { + super(card); + } + + @Override + public ChromescaleDrake copy() { + return new ChromescaleDrake(this); + } +} + +class ChromescaleDrakeEffect extends OneShotEffect { + + public ChromescaleDrakeEffect() { + super(Outcome.Benefit); + staticText = "Reveal the top three cards of your library. Put all artifacts cards revealed this way into your hand and the rest into your graveyard"; + } + + public ChromescaleDrakeEffect(final ChromescaleDrakeEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller == null || sourceObject == null) { + return false; + } + + Cards cards = new CardsImpl(); + Cards cardsToHand = new CardsImpl(); + cards.addAll(controller.getLibrary().getTopCards(game, 3)); + if (!cards.isEmpty()) { + controller.revealCards(sourceObject.getName(), cards, game); + for (Card card: cards.getCards(game)) { + if (card.getCardType().contains(CardType.ARTIFACT)) { + cardsToHand.add(card); + cards.remove(card); + } + } + controller.moveCards(cardsToHand, Zone.LIBRARY, Zone.HAND, source, game); + controller.moveCards(cards, Zone.LIBRARY, Zone.GRAVEYARD, source, game); + } + return true; + } + + @Override + public ChromescaleDrakeEffect copy() { + return new ChromescaleDrakeEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/darksteel/FurnaceDragon.java b/Mage.Sets/src/mage/sets/darksteel/FurnaceDragon.java new file mode 100644 index 00000000000..8c7f749d57b --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/FurnaceDragon.java @@ -0,0 +1,107 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.darksteel; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.ExileAllEffect; +import mage.abilities.keyword.AffinityForArtifactsAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.watchers.Watcher; +import mage.watchers.common.CastFromHandWatcher; + +/** + * + * @author fireshoes + */ +public class FurnaceDragon extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifacts"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + + public FurnaceDragon(UUID ownerId) { + super(ownerId, 62, "Furnace Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{R}{R}{R}"); + this.expansionSetCode = "DST"; + this.subtype.add("Dragon"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Affinity for artifacts + this.addAbility(new AffinityForArtifactsAbility()); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Furnace Dragon enters the battlefield, if you cast it from your hand, exile all artifacts. + this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new ExileAllEffect(filter), new FurnaceDragonCondition()), false), new CastFromHandWatcher()); + } + + public FurnaceDragon(final FurnaceDragon card) { + super(card); + } + + @Override + public FurnaceDragon copy() { + return new FurnaceDragon(this); + } +} + +class FurnaceDragonCondition implements Condition { + + @Override + public boolean apply(Game game, Ability source) { + boolean applies = false; + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + Watcher watcher = game.getState().getWatchers().get("CastFromHand", source.getSourceId()); + if (watcher != null && watcher.conditionMet()) { + applies = true; + } + } + return applies; + } + + @Override + public String toString() { + return "you cast it from your hand"; + } +} diff --git a/Mage.Sets/src/mage/sets/darksteel/GoblinArchaeologist.java b/Mage.Sets/src/mage/sets/darksteel/GoblinArchaeologist.java new file mode 100644 index 00000000000..46f9a5bbcc0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/GoblinArchaeologist.java @@ -0,0 +1,95 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.sets.darksteel; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterArtifactPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; + +/** + * + * @author BursegSardaukar + */ +public class GoblinArchaeologist extends CardImpl { + + public GoblinArchaeologist(UUID ownerId) { + super(ownerId, 63, "Goblin Archaeologist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "DST"; + this.subtype.add("Goblin"); + this.subtype.add("Artificer"); + + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {R}, {T]: Flip a coin. If you win the flip, destroy target artifact and untap Goblin Archaeologist. If you lose the flip, sacrifice Goblin Archaeologist. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GoblinArchaeologistEffect(),new ManaCostsImpl("{R}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPermanent(new FilterArtifactPermanent())); + this.addAbility(ability); + } + + public GoblinArchaeologist(final GoblinArchaeologist card) { + super(card); + } + + @Override + public GoblinArchaeologist copy() { + return new GoblinArchaeologist(this); + } +} + +class GoblinArchaeologistEffect extends OneShotEffect { + + public GoblinArchaeologistEffect() { + super(Outcome.DestroyPermanent); + } + + public GoblinArchaeologistEffect(final GoblinArchaeologistEffect ability) { + super(ability); + } + + @Override + public GoblinArchaeologistEffect copy() { + return new GoblinArchaeologistEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (player != null && permanent != null) { + if (!player.flipCoin(game)) { + permanent.sacrifice(source.getSourceId(), game); + }else{ + Permanent targetArtifact = game.getPermanent(source.getFirstTarget()); + targetArtifact.destroy(source.getSourceId(), game, true); + permanent.untap(game); + } + return true; + } + return false; + } + + @Override + public String getText(Mode mode) { + return "Flip a coin. If you win the flip, destroy target artifact and untap {this}. If you lose the flip, sacrifice {this}"; + } +} diff --git a/Mage.Sets/src/mage/sets/darksteel/HoverguardObserver.java b/Mage.Sets/src/mage/sets/darksteel/HoverguardObserver.java new file mode 100644 index 00000000000..a4f4936ee35 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/HoverguardObserver.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.darksteel; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class HoverguardObserver extends CardImpl { + + public HoverguardObserver(UUID ownerId) { + super(ownerId, 22, "Hoverguard Observer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "DST"; + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Hoverguard Observer can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + } + + public HoverguardObserver(final HoverguardObserver card) { + super(card); + } + + @Override + public HoverguardObserver copy() { + return new HoverguardObserver(this); + } +} diff --git a/Mage.Sets/src/mage/sets/darksteel/LeoninBattlemage.java b/Mage.Sets/src/mage/sets/darksteel/LeoninBattlemage.java new file mode 100644 index 00000000000..937eec54ee4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/LeoninBattlemage.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.darksteel; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class LeoninBattlemage extends CardImpl { + + public LeoninBattlemage(UUID ownerId) { + super(ownerId, 5, "Leonin Battlemage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "DST"; + this.subtype.add("Cat"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {tap}: Target creature gets +1/+1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, 1, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + // Whenever you cast a spell, you may untap Leonin Battlemage. + this.addAbility(new SpellCastControllerTriggeredAbility(new UntapSourceEffect(), true)); + } + + public LeoninBattlemage(final LeoninBattlemage card) { + super(card); + } + + @Override + public LeoninBattlemage copy() { + return new LeoninBattlemage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/darksteel/LichsTomb.java b/Mage.Sets/src/mage/sets/darksteel/LichsTomb.java index 3ec918d0114..33a0f45d56e 100644 --- a/Mage.Sets/src/mage/sets/darksteel/LichsTomb.java +++ b/Mage.Sets/src/mage/sets/darksteel/LichsTomb.java @@ -56,7 +56,7 @@ public class LichsTomb extends CardImpl { // You don't lose the game for having 0 or less life. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontLoseByZeroOrLessLifeEffect(Duration.WhileOnBattlefield))); - + // Whenever you lose life, sacrifice a permanent for each 1 life you lost. this.addAbility(new LichsTombTriggeredAbility()); } @@ -72,15 +72,15 @@ public class LichsTomb extends CardImpl { } class LichsTombTriggeredAbility extends TriggeredAbilityImpl { - + LichsTombTriggeredAbility() { super(Zone.BATTLEFIELD, new SacrificeControllerEffect(new FilterPermanent(), 0, ""), false); } - + LichsTombTriggeredAbility(final LichsTombTriggeredAbility ability) { super(ability); } - + @Override public LichsTombTriggeredAbility copy() { return new LichsTombTriggeredAbility(this); @@ -90,16 +90,16 @@ class LichsTombTriggeredAbility extends TriggeredAbilityImpl { public boolean checkEventType(GameEvent event, Game game) { return event.getType() == EventType.LOST_LIFE; } - + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getPlayerId() == this.getControllerId()) { + if (event.getPlayerId().equals(this.getControllerId())) { ((SacrificeEffect) this.getEffects().get(0)).setAmount(new StaticValue(event.getAmount())); return true; } return false; } - + @Override public String getRule() { return "Whenever you lose life, sacrifice a permanent for each 1 life you lost."; diff --git a/Mage.Sets/src/mage/sets/darksteel/MycosynthLattice.java b/Mage.Sets/src/mage/sets/darksteel/MycosynthLattice.java index 1cd753fd6d0..4696750cc39 100644 --- a/Mage.Sets/src/mage/sets/darksteel/MycosynthLattice.java +++ b/Mage.Sets/src/mage/sets/darksteel/MycosynthLattice.java @@ -34,21 +34,24 @@ import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.AsThoughManaEffect; import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.AsThoughEffectType; -import mage.constants.Rarity; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; +import mage.constants.ManaType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; import mage.game.Game; import mage.game.command.CommandObject; import mage.game.permanent.Permanent; import mage.game.stack.Spell; +import mage.players.ManaPoolItem; import mage.players.Player; /** @@ -79,8 +82,8 @@ public class MycosynthLattice extends CardImpl { } class PermanentsAreArtifactsEffect extends ContinuousEffectImpl { - - public PermanentsAreArtifactsEffect(){ + + public PermanentsAreArtifactsEffect() { super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Neutral); staticText = "All permanents are artifacts in addition to their other types"; } @@ -106,9 +109,8 @@ class PermanentsAreArtifactsEffect extends ContinuousEffectImpl { } } - class EverythingIsColorlessEffect extends ContinuousEffectImpl { - + public EverythingIsColorlessEffect() { super(Duration.WhileOnBattlefield, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Neutral); staticText = "All cards that aren't on the battlefield, spells, and permanents are colorless"; @@ -141,7 +143,7 @@ class EverythingIsColorlessEffect extends ContinuousEffectImpl { Player player = game.getPlayer(playerId); if (player != null) { // hand - for (Card card: player.getHand().getCards(game)) { + for (Card card : player.getHand().getCards(game)) { game.getState().getCreateCardAttribute(card).getColor().setColor(colorless); } // library @@ -169,11 +171,10 @@ class EverythingIsColorlessEffect extends ContinuousEffectImpl { } } - -class ManaCanBeSpentAsAnyColorEffect extends AsThoughEffectImpl { +class ManaCanBeSpentAsAnyColorEffect extends AsThoughEffectImpl implements AsThoughManaEffect { public ManaCanBeSpentAsAnyColorEffect() { - super(AsThoughEffectType.SPEND_ANY_MANA, Duration.WhileOnBattlefield, Outcome.Benefit); + super(AsThoughEffectType.SPEND_OTHER_MANA, Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "Players may spend mana as though it were mana of any color"; } @@ -183,8 +184,14 @@ class ManaCanBeSpentAsAnyColorEffect extends AsThoughEffectImpl { } @Override - public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - return true; + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + Player controller = game.getPlayer(source.getControllerId()); + return controller != null && controller.getInRange().contains(affectedControllerId); + } + + @Override + public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) { + return mana.getFirstAvailable(); } @Override @@ -194,5 +201,5 @@ class ManaCanBeSpentAsAnyColorEffect extends AsThoughEffectImpl { private ManaCanBeSpentAsAnyColorEffect(ManaCanBeSpentAsAnyColorEffect effect) { super(effect); - } + } } diff --git a/Mage.Sets/src/mage/sets/darksteel/NimAbomination.java b/Mage.Sets/src/mage/sets/darksteel/NimAbomination.java index d13bc0e2504..23c0aa159ef 100644 --- a/Mage.Sets/src/mage/sets/darksteel/NimAbomination.java +++ b/Mage.Sets/src/mage/sets/darksteel/NimAbomination.java @@ -29,20 +29,22 @@ package mage.sets.darksteel; import java.util.UUID; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; -import mage.abilities.condition.InvertCondition; -import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.condition.Condition; import mage.abilities.effects.common.LoseLifeSourceControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; /** * * @author LoneFox - + * */ public class NimAbomination extends CardImpl { @@ -55,7 +57,7 @@ public class NimAbomination extends CardImpl { // At the beginning of your end step, if Nim Abomination is untapped, you lose 3 life. this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new LoseLifeSourceControllerEffect(3), - TargetController.YOU, new InvertCondition(new SourceTappedCondition()), false)); + TargetController.YOU, new SourceUntappedCondition(), false)); } public NimAbomination(final NimAbomination card) { @@ -67,3 +69,26 @@ public class NimAbomination extends CardImpl { return new NimAbomination(this); } } + +class SourceUntappedCondition implements Condition { + + private static final SourceUntappedCondition fInstance = new SourceUntappedCondition(); + + public static SourceUntappedCondition getInstance() { + return fInstance; + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); + if (permanent != null) { + return !permanent.isTapped(); + } + return false; + } + + @Override + public String toString() { + return "if {this} is untapped"; + } +} diff --git a/Mage.Sets/src/mage/sets/darksteel/PulseOfTheForge.java b/Mage.Sets/src/mage/sets/darksteel/PulseOfTheForge.java new file mode 100644 index 00000000000..0771972dbfd --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/PulseOfTheForge.java @@ -0,0 +1,99 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.darksteel; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class PulseOfTheForge extends CardImpl { + + public PulseOfTheForge(UUID ownerId) { + super(ownerId, 66, "Pulse of the Forge", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{R}{R}"); + this.expansionSetCode = "DST"; + + // Pulse of the Forge deals 4 damage to target player. Then if that player has more life than you, return Pulse of the Forge to its owner's hand. + this.getSpellAbility().addEffect(new DamageTargetEffect(4)); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new PulseOfTheForgeReturnToHandEffect()); + } + + public PulseOfTheForge(final PulseOfTheForge card) { + super(card); + } + + @Override + public PulseOfTheForge copy() { + return new PulseOfTheForge(this); + } +} + +class PulseOfTheForgeReturnToHandEffect extends OneShotEffect { + + PulseOfTheForgeReturnToHandEffect() { + super(Outcome.Benefit); + this.staticText = "Then if that player has more life than you, return {this} to its owner's hand"; + } + + PulseOfTheForgeReturnToHandEffect(final PulseOfTheForgeReturnToHandEffect effect) { + super(effect); + } + + @Override + public PulseOfTheForgeReturnToHandEffect copy() { + return new PulseOfTheForgeReturnToHandEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null && player.getLife() > controller.getLife()) { + Card card = game.getCard(source.getSourceId()); + controller.moveCards(card, null, Zone.HAND, source, game); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/darksteel/Reshape.java b/Mage.Sets/src/mage/sets/darksteel/Reshape.java index 28303ac7d8d..c1472d3c268 100644 --- a/Mage.Sets/src/mage/sets/darksteel/Reshape.java +++ b/Mage.Sets/src/mage/sets/darksteel/Reshape.java @@ -28,15 +28,14 @@ package mage.sets.darksteel; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.Filter; import mage.filter.FilterCard; @@ -64,7 +63,6 @@ public class Reshape extends CardImpl { super(ownerId, 31, "Reshape", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{U}{U}"); this.expansionSetCode = "DST"; - // As an additional cost to cast Reshape, sacrifice an artifact. this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, false))); // Search your library for an artifact card with converted mana cost X or less and put it onto the battlefield. Then shuffle your library. @@ -94,8 +92,8 @@ class ReshapeSearchEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } //Set the mana cost one higher to 'emulate' a less than or equal to comparison. @@ -104,17 +102,17 @@ class ReshapeSearchEffect extends OneShotEffect { filter.add(new CardTypePredicate(CardType.ARTIFACT)); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, xValue)); TargetCardInLibrary target = new TargetCardInLibrary(filter); - if (player.searchLibrary(target, game)) { + if (controller.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { - Card card = player.getLibrary().getCard(target.getFirstTarget(), game); + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return true; } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return false; } diff --git a/Mage.Sets/src/mage/sets/darksteel/SunderingTitan.java b/Mage.Sets/src/mage/sets/darksteel/SunderingTitan.java index 40e1cc019e2..bf12c5dd792 100644 --- a/Mage.Sets/src/mage/sets/darksteel/SunderingTitan.java +++ b/Mage.Sets/src/mage/sets/darksteel/SunderingTitan.java @@ -32,9 +32,7 @@ import java.util.Set; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersOrLeavesTheBattlefieldSourceTriggeredAbility; -import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -98,19 +96,18 @@ class SunderingTitanDestroyLandEffect extends OneShotEffect { Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); Set lands = new HashSet<>(); if (controller != null && sourcePermanent != null) { - for (String landName : new String[] {"Forest","Island","Mountain","Plains","Swamp"}) { - FilterLandPermanent filter = new FilterLandPermanent(new StringBuilder(landName).append(" to destroy").toString()); + for (String landName : new String[]{"Forest", "Island", "Mountain", "Plains", "Swamp"}) { + FilterLandPermanent filter = new FilterLandPermanent(landName + " to destroy"); filter.add(new SubtypePredicate(landName)); - Target target = new TargetLandPermanent(1,1, filter, true); + Target target = new TargetLandPermanent(1, 1, filter, true); if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { controller.chooseTarget(outcome, target, source, game); lands.add(target.getFirstTarget()); } - } if (!lands.isEmpty()) { int destroyedLands = 0; - for (UUID landId: lands) { + for (UUID landId : lands) { Permanent land = game.getPermanent(landId); if (land != null) { if (land.destroy(source.getSourceId(), game, false)) { @@ -118,9 +115,9 @@ class SunderingTitanDestroyLandEffect extends OneShotEffect { } } } - game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(": ").append(destroyedLands).append(destroyedLands > 1 ? " lands were destroyed":"land was destroyed").toString()); + game.informPlayers(sourcePermanent.getLogName() + ": " + destroyedLands + (destroyedLands > 1 ? " lands were" : "land was") + " destroyed"); } - + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/darksteel/SurestrikeTrident.java b/Mage.Sets/src/mage/sets/darksteel/SurestrikeTrident.java new file mode 100644 index 00000000000..b3606a11a03 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/SurestrikeTrident.java @@ -0,0 +1,144 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.darksteel; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.CostImpl; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPlayer; + +/** + * + * @author AlumiuN + */ +public class SurestrikeTrident extends CardImpl { + + public SurestrikeTrident(UUID ownerId) { + super(ownerId, 147, "Surestrike Trident", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "DST"; + this.subtype.add("Equipment"); + + // Equipped creature has first strike and "{T}, Unattach Surestrike Trident: This creature deals damage equal to its power to target player." + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT)); + DynamicValue xValue = new SourcePermanentPowerCount(); + Effect effect = new DamageTargetEffect(xValue); + effect.setText("This creature deals damage equal to its power to target player"); + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); + gainedAbility.addTarget(new TargetPlayer()); + gainedAbility.addCost(new SurestrikeTridentUnattachCost(getName(), getId())); + effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.EQUIPMENT); + effect.setText("and \"{T}, Unattach {this}: This creature deals damage equal to its power to target player.\""); + ability.addEffect(effect); + this.addAbility(ability); + + // Equip {4} + this.addAbility(new EquipAbility(Outcome.Benefit, new GenericManaCost(4))); + } + + public SurestrikeTrident(final SurestrikeTrident card) { + super(card); + } + + @Override + public SurestrikeTrident copy() { + return new SurestrikeTrident(this); + } +} + +class SurestrikeTridentUnattachCost extends CostImpl { + + protected UUID sourceEquipmentId; + + public SurestrikeTridentUnattachCost(String name, UUID sourceId) { + this.text = "Unattach " + name; + this.sourceEquipmentId = sourceId; + } + + public SurestrikeTridentUnattachCost(final SurestrikeTridentUnattachCost cost) { + super(cost); + this.sourceEquipmentId = cost.sourceEquipmentId; + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent != null) { + for (UUID attachmentId : permanent.getAttachments()) { + Permanent attachment = game.getPermanent(attachmentId); + if (attachment != null && attachment.getId().equals(sourceEquipmentId)) { + paid = permanent.removeAttachment(attachmentId, game); + if (paid) { + break; + } + } + } + + } + return paid; + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent != null) { + for (UUID attachmentId : permanent.getAttachments()) { + Permanent attachment = game.getPermanent(attachmentId); + if (attachment != null && attachment.getId().equals(sourceEquipmentId)) { + return true; + } + } + + } + return false; + } + + @Override + public SurestrikeTridentUnattachCost copy() { + return new SurestrikeTridentUnattachCost(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/dissension/AuroraEidolon.java b/Mage.Sets/src/mage/sets/dissension/AuroraEidolon.java new file mode 100644 index 00000000000..a27927a02e4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/AuroraEidolon.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class AuroraEidolon extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public AuroraEidolon(UUID ownerId) { + super(ownerId, 1, "Aurora Eidolon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {W}, Sacrifice Aurora Eidolon: Prevent the next 3 damage that would be dealt to target creature or player this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 3), new ManaCostsImpl("{W}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + // Whenever you cast a multicolored spell, you may return Aurora Eidolon from your graveyard to your hand. + this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false)); + } + + public AuroraEidolon(final AuroraEidolon card) { + super(card); + } + + @Override + public AuroraEidolon copy() { + return new AuroraEidolon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/BlessingOfTheNephilim.java b/Mage.Sets/src/mage/sets/dissension/BlessingOfTheNephilim.java new file mode 100644 index 00000000000..e3383a8f56a --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/BlessingOfTheNephilim.java @@ -0,0 +1,116 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.*; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Quercitron + */ +public class BlessingOfTheNephilim extends CardImpl { + + public BlessingOfTheNephilim(UUID ownerId) { + super(ownerId, 4, "Blessing of the Nephilim", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets +1/+1 for each of its colors. + DynamicValue numberOfColors = new EnchantedCreatureColorsCount(); + Effect effect = new BoostEnchantedEffect(numberOfColors, numberOfColors, Duration.WhileOnBattlefield); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public BlessingOfTheNephilim(final BlessingOfTheNephilim card) { + super(card); + } + + @Override + public BlessingOfTheNephilim copy() { + return new BlessingOfTheNephilim(this); + } +} + +class EnchantedCreatureColorsCount implements DynamicValue { + + public EnchantedCreatureColorsCount() { + } + + public EnchantedCreatureColorsCount(final EnchantedCreatureColorsCount dynamicValue) { + } + + @Override + public int calculate(Game game, Ability source, Effect effect) { + int count = 0; + Permanent aura = game.getPermanent(source.getSourceId()); + if (aura != null) { + Permanent permanent = game.getPermanent(aura.getAttachedTo()); + if (permanent != null) { + count = permanent.getColor(game).getColorCount(); + } + } + return count; + } + + @Override + public EnchantedCreatureColorsCount copy() { + return new EnchantedCreatureColorsCount(this); + } + + @Override + public String toString() { + return "1"; + } + + @Override + public String getMessage() { + return "of its colors"; + } + +} diff --git a/Mage.Sets/src/mage/sets/dissension/BoundDetermined.java b/Mage.Sets/src/mage/sets/dissension/BoundDetermined.java new file mode 100644 index 00000000000..5fb91193ccc --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/BoundDetermined.java @@ -0,0 +1,179 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ExileSourceEffect; +import mage.cards.CardsImpl; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.FilterSpell; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.MulticoloredPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LevelX2 + */ +public class BoundDetermined extends SplitCard { + + private static final FilterSpell filter = new FilterSpell("multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public BoundDetermined(UUID ownerId) { + super(ownerId, 149, "Bound", "Determined", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{B}{G}", "{G}{U}", false); + this.expansionSetCode = "DIS"; + + // Bound + // Sacrifice a creature. Return up to X cards from your graveyard to your hand, where X is the number of colors that creature was. Exile this card. + getLeftHalfCard().getSpellAbility().addEffect(new BoundEffect()); + Effect effect = new ExileSourceEffect(); + effect.setText("Exile this card"); + getLeftHalfCard().getSpellAbility().addEffect(effect); + // Determined + // Other spells you control can't be countered by spells or abilities this turn. + // Draw a card. + getRightHalfCard().getSpellAbility().addEffect(new DeterminedEffect()); + getRightHalfCard().getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + + } + + public BoundDetermined(final BoundDetermined card) { + super(card); + } + + @Override + public BoundDetermined copy() { + return new BoundDetermined(this); + } +} + +class BoundEffect extends OneShotEffect { + + public BoundEffect() { + super(Outcome.ReturnToHand); + this.staticText = "Sacrifice a creature. Return up to X cards from your graveyard to your hand, where X is the number of colors that creature was"; + } + + public BoundEffect(final BoundEffect effect) { + super(effect); + } + + @Override + public BoundEffect copy() { + return new BoundEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + TargetControlledPermanent target = new TargetControlledPermanent(1, 1, new FilterControlledCreaturePermanent("a creature (to sacrifice)"), true); + if (target.canChoose(source.getSourceId(), controller.getId(), game)) { + if (controller.chooseTarget(outcome, target, source, game)) { + Permanent toSacrifice = game.getPermanent(target.getFirstTarget()); + if (toSacrifice != null) { + toSacrifice.sacrifice(source.getSourceId(), game); + int colors = toSacrifice.getColor(game).getColorCount(); + if (colors > 0) { + TargetCardInYourGraveyard targetCard = new TargetCardInYourGraveyard(0, colors, + new FilterCard("up to " + colors + " card" + (colors > 1 ? "s" : "") + " from your graveyard")); + controller.chooseTarget(outcome, targetCard, source, game); + controller.moveCards(new CardsImpl(targetCard.getTargets()), null, Zone.HAND, source, game); + } + } + } + } + return true; + } + return false; + } +} + +class DeterminedEffect extends ContinuousRuleModifyingEffectImpl { + + DeterminedEffect() { + super(Duration.EndOfTurn, Outcome.Benefit); + staticText = "Other spells you control can't be countered by spells or abilities this turn"; + } + + DeterminedEffect(final DeterminedEffect effect) { + super(effect); + } + + @Override + public DeterminedEffect copy() { + return new DeterminedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public String getInfoMessage(Ability source, GameEvent event, Game game) { + MageObject sourceObject = game.getObject(source.getSourceId()); + if (sourceObject != null) { + return "This spell can't be countered (" + sourceObject.getIdName() + ")."; + } + return null; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.COUNTER; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && !spell.getSourceId().equals(source.getSourceId()) && spell.getControllerId().equals(source.getControllerId()); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/CryptChampion.java b/Mage.Sets/src/mage/sets/dissension/CryptChampion.java index 894a5fdff35..7d29bfdf552 100644 --- a/Mage.Sets/src/mage/sets/dissension/CryptChampion.java +++ b/Mage.Sets/src/mage/sets/dissension/CryptChampion.java @@ -69,10 +69,10 @@ public class CryptChampion extends CardImpl { // Double strike this.addAbility(DoubleStrikeAbility.getInstance()); - + // When Crypt Champion enters the battlefield, each player puts a creature card with converted mana cost 3 or less from his or her graveyard onto the battlefield. this.addAbility(new EntersBattlefieldTriggeredAbility(new CryptChampionEffect())); - + // When Crypt Champion enters the battlefield, sacrifice it unless {R} was spent to cast it. this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.R)), false), new ManaSpentToCastWatcher()); } @@ -88,26 +88,26 @@ public class CryptChampion extends CardImpl { } class CryptChampionEffect extends OneShotEffect { - + CryptChampionEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "each player puts a creature card with converted mana cost 3 or less from his or her graveyard onto the battlefield"; } - + CryptChampionEffect(final CryptChampionEffect effect) { super(effect); } - + @Override public CryptChampionEffect copy() { return new CryptChampionEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (UUID playerId : controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { FilterCard filter = new FilterCreatureCard("creature card with converted mana cost 3 or less from your graveyard"); @@ -117,7 +117,7 @@ class CryptChampionEffect extends OneShotEffect { if (target.canChoose(playerId, game) && player.chooseTarget(outcome, target, source, game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + player.moveCards(card, Zone.BATTLEFIELD, source, game); } } } diff --git a/Mage.Sets/src/mage/sets/dissension/Demonfire.java b/Mage.Sets/src/mage/sets/dissension/Demonfire.java index 02484480095..b71edacc19e 100644 --- a/Mage.Sets/src/mage/sets/dissension/Demonfire.java +++ b/Mage.Sets/src/mage/sets/dissension/Demonfire.java @@ -44,6 +44,7 @@ import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; import mage.target.common.TargetCreatureOrPlayer; +import mage.watchers.common.DamagedByWatcher; /** * @@ -54,30 +55,29 @@ public class Demonfire extends CardImpl { public Demonfire(UUID ownerId) { super(ownerId, 60, "Demonfire", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{R}"); this.expansionSetCode = "DIS"; - - - // Demonfire deals X damage to target creature or player. + // Demonfire deals X damage to target creature or player. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(new ManacostVariableValue()), new InvertCondition(HellbentCondition.getInstance()), - "{this} deals X damage to target creature or player")); + "{this} deals X damage to target creature or player")); // If a creature dealt damage this way would die this turn, exile it instead. - this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn)); - + this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn)); + this.getSpellAbility().addWatcher(new DamagedByWatcher()); + // Hellbent - If you have no cards in hand, Demonfire can't be countered by spells or abilities and the damage can't be prevented. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetEffect(new ManacostVariableValue(), false), HellbentCondition.getInstance(), - "
Hellbent - If you have no cards in hand, {this} can't be countered by spells or abilities and the damage can't be prevented.")); + "
Hellbent - If you have no cards in hand, {this} can't be countered by spells or abilities and the damage can't be prevented.")); // can't be countered - Effect effect = new CantBeCounteredSourceEffect(); - effect.setText(""); + Effect effect = new CantBeCounteredSourceEffect(); + effect.setText(""); this.addAbility(new SimpleStaticAbility(Zone.STACK, new ConditionalContinuousRuleModifyingEffect( - (CantBeCounteredSourceEffect)effect, + (CantBeCounteredSourceEffect) effect, HellbentCondition.getInstance()))); - + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); } diff --git a/Mage.Sets/src/mage/sets/dissension/DreadSlag.java b/Mage.Sets/src/mage/sets/dissension/DreadSlag.java new file mode 100644 index 00000000000..58ccae8ffd8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/DreadSlag.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.MultipliedValue; +import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class DreadSlag extends CardImpl { + + public DreadSlag(UUID ownerId) { + super(ownerId, 109, "Dread Slag", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Horror"); + this.power = new MageInt(9); + this.toughness = new MageInt(9); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Dread Slag gets -4/-4 for each card in your hand. + DynamicValue amount = new MultipliedValue(new CardsInControllerHandCount(), -4); + Effect effect = new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield); + effect.setText("{this} gets -4/-4 for each card in your hand"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public DreadSlag(final DreadSlag card) { + super(card); + } + + @Override + public DreadSlag copy() { + return new DreadSlag(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/EnigmaEidolon.java b/Mage.Sets/src/mage/sets/dissension/EnigmaEidolon.java new file mode 100644 index 00000000000..74fd14bf742 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/EnigmaEidolon.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; +import mage.target.TargetPlayer; + +/** + * + * @author LoneFox + */ +public class EnigmaEidolon extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public EnigmaEidolon(UUID ownerId) { + super(ownerId, 24, "Enigma Eidolon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {U}, Sacrifice Enigma Eidolon: Target player puts the top three cards of his or her library into his or her graveyard. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(3), new ManaCostsImpl("{U}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + // Whenever you cast a multicolored spell, you may return Enigma Eidolon from your graveyard to your hand. + this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false)); + } + + public EnigmaEidolon(final EnigmaEidolon card) { + super(card); + } + + @Override + public EnigmaEidolon copy() { + return new EnigmaEidolon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/EntropicEidolon.java b/Mage.Sets/src/mage/sets/dissension/EntropicEidolon.java new file mode 100644 index 00000000000..46daa29c5ea --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/EntropicEidolon.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; +import mage.target.TargetPlayer; + +/** + * + * @author LoneFox + */ +public class EntropicEidolon extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public EntropicEidolon(UUID ownerId) { + super(ownerId, 45, "Entropic Eidolon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {B}, Sacrifice Entropic Eidolon: Target player loses 1 life and you gain 1 life. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), new ManaCostsImpl("{B}")); + Effect effect = new GainLifeEffect(1); + effect.setText("and you gain 1 life"); + ability.addEffect(effect); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + // Whenever you cast a multicolored spell, you may return Entropic Eidolon from your graveyard to your hand. + this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false)); + } + + public EntropicEidolon(final EntropicEidolon card) { + super(card); + } + + @Override + public EntropicEidolon copy() { + return new EntropicEidolon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/EvolutionVat.java b/Mage.Sets/src/mage/sets/dissension/EvolutionVat.java new file mode 100644 index 00000000000..5d696c45d4e --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/EvolutionVat.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class EvolutionVat extends CardImpl { + + public EvolutionVat(UUID ownerId) { + super(ownerId, 161, "Evolution Vat", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "DIS"; + + // {3}, {tap}: Tap target creature and put a +1/+1 counter on it. Until end of turn, that creature gains "{2}{G}{U}: Double the number of +1/+1 counters on this creature." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); + effect.setText("and put a +1/+1 counter on it"); + ability.addEffect(effect); + effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(), new CountersCount(CounterType.P1P1), false); + effect.setText("Double the number of +1/+1 counters on this creature"); + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{G}{U}")); + ability.addEffect(new GainAbilityTargetEffect(gainedAbility, Duration.EndOfTurn, + "Until end of turn, that creature gains \"{2}{G}{U}: Double the number of +1/+1 counters on this creature.\"")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public EvolutionVat(final EvolutionVat card) { + super(card); + } + + @Override + public EvolutionVat copy() { + return new EvolutionVat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/FlaringFlameKin.java b/Mage.Sets/src/mage/sets/dissension/FlaringFlameKin.java index c8b77cfc298..1cfe02e7dc6 100644 --- a/Mage.Sets/src/mage/sets/dissension/FlaringFlameKin.java +++ b/Mage.Sets/src/mage/sets/dissension/FlaringFlameKin.java @@ -29,9 +29,9 @@ package mage.sets.dissension; import java.util.UUID; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.Condition; import mage.abilities.condition.common.EnchantedCondition; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.decorator.ConditionalContinuousEffect; @@ -50,10 +50,6 @@ import mage.constants.Zone; */ public class FlaringFlameKin extends CardImpl { - private static final String rule1 = "As long as {this} is enchanted, it gets +2/+2"; - private static final String rule2 = "As long as {this} is enchanted, it has trample"; - private static final String rule3 = "As long as {this} is enchanted, it has \"{R}: {this} gets +1/+0 until end of turn.\""; - public FlaringFlameKin(UUID ownerId) { super(ownerId, 62, "Flaring Flame-Kin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.expansionSetCode = "DIS"; @@ -63,17 +59,19 @@ public class FlaringFlameKin extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - SimpleActivatedAbility grantedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new BoostSourceEffect(1, 0, Duration.EndOfTurn), - new ManaCostsImpl("{R}")); - - Condition enchanted = new EnchantedCondition(); - ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), enchanted, rule1); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect1)); - ConditionalContinuousEffect effect2 = new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), enchanted, rule2); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect2)); - ConditionalContinuousEffect effect3 = new ConditionalContinuousEffect(new GainAbilitySourceEffect(grantedAbility), enchanted, rule3); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect3)); + // As long as Flaring Flame-Kin is enchanted, it gets +2/+2, has trample, and has "{R}: Flaring Flame-Kin gets +1/+0 until end of turn." + EnchantedCondition enchanted = new EnchantedCondition(); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), enchanted, + "As long as {this} is enchanted, it gets +2/+2")); + ability.addEffect(new ConditionalContinuousEffect( + new GainAbilitySourceEffect(TrampleAbility.getInstance()), enchanted, + ", has trample")); + Ability grantedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(grantedAbility), + enchanted, ", and has \"{R}: {this} gets +1/+0 until end of turn.\"")); + this.addAbility(ability); } public FlaringFlameKin(final FlaringFlameKin card) { diff --git a/Mage.Sets/src/mage/sets/dissension/HitRun.java b/Mage.Sets/src/mage/sets/dissension/HitRun.java new file mode 100644 index 00000000000..a7452d77914 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/HitRun.java @@ -0,0 +1,156 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.common.TargetControlledPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class HitRun extends SplitCard { + + public HitRun(UUID ownerId) { + super(ownerId, 152, "Hit", "Run", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{B}{R}", "{3}{R}{G}", false); + this.expansionSetCode = "DIS"; + + // Hit + // Target player sacrifices an artifact or creature. Hit deals damage to that player equal to that permanent's converted mana cost. + getLeftHalfCard().getSpellAbility().addEffect(new HitEffect()); + getLeftHalfCard().getSpellAbility().addTarget(new TargetPlayer()); + + // Run + // Attacking creatures you control get +1/+0 until end of turn for each other attacking creature. + getRightHalfCard().getSpellAbility().addEffect(new RunEffect()); + + } + + public HitRun(final HitRun card) { + super(card); + } + + @Override + public HitRun copy() { + return new HitRun(this); + } +} + +class HitEffect extends OneShotEffect { + + public HitEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Target player sacrifices an artifact or creature. Hit deals damage to that player equal to that permanent's converted mana cost"; + } + + public HitEffect(final HitEffect effect) { + super(effect); + } + + @Override + public HitEffect copy() { + return new HitEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(source.getTargets().getFirstTarget()); + if (targetPlayer != null) { + FilterControlledPermanent filter = new FilterControlledPermanent("artifact or creature"); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); + TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, true); + + if (target.canChoose(targetPlayer.getId(), game)) { + targetPlayer.choose(Outcome.Sacrifice, target, source.getSourceId(), game); + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if (permanent != null) { + permanent.sacrifice(source.getSourceId(), game); + int damage = permanent.getManaCost().convertedManaCost(); + if (damage > 0) { + targetPlayer.damage(damage, source.getSourceId(), game, false, true); + } + } + } + } + return true; + } +} + +class RunEffect extends OneShotEffect { + + public RunEffect() { + super(Outcome.BoostCreature); + this.staticText = "Attacking creatures you control get +1/+0 until end of turn for each other attacking creature"; + } + + public RunEffect(final RunEffect effect) { + super(effect); + } + + @Override + public RunEffect copy() { + return new RunEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int attackingCreatures = game.getBattlefield().count(new FilterAttackingCreature(), controller.getId(), controller.getId(), game); + if (attackingCreatures > 1) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterAttackingCreature(), controller.getId(), game)) { + ContinuousEffect effect = new BoostTargetEffect(attackingCreatures - 1, 0, Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(permanent, game)); + game.addEffect(effect, source); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/KillSuitCultist.java b/Mage.Sets/src/mage/sets/dissension/KillSuitCultist.java new file mode 100644 index 00000000000..397c5065970 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/KillSuitCultist.java @@ -0,0 +1,125 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksEachTurnStaticAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class KillSuitCultist extends CardImpl { + + public KillSuitCultist(UUID ownerId) { + super(ownerId, 65, "Kill-Suit Cultist", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Goblin"); + this.subtype.add("Berserker"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Kill-Suit Cultist attacks each turn if able. + this.addAbility(new AttacksEachTurnStaticAbility()); + // {B}, Sacrifice Kill-Suit Cultist: The next time damage would be dealt to target creature this turn, destroy that creature instead. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new KillSuitCultistEffect(), new ManaCostsImpl("{B}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public KillSuitCultist(final KillSuitCultist card) { + super(card); + } + + @Override + public KillSuitCultist copy() { + return new KillSuitCultist(this); + } +} + +class KillSuitCultistEffect extends ReplacementEffectImpl { + + public KillSuitCultistEffect() { + super(Duration.EndOfTurn, Outcome.Detriment); + staticText = "The next time damage would be dealt to target creature this turn, destroy that creature instead"; + } + + public KillSuitCultistEffect(final KillSuitCultistEffect effect) { + super(effect); + } + + @Override + public KillSuitCultistEffect copy() { + return new KillSuitCultistEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGE_CREATURE; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getTargetId().equals(targetPointer.getFirst(game, source)); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if(permanent != null) { + permanent.destroy(source.getSourceId(), game, false); + return true; + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/dissension/MagewrightsStone.java b/Mage.Sets/src/mage/sets/dissension/MagewrightsStone.java new file mode 100644 index 00000000000..d6023e49db6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/MagewrightsStone.java @@ -0,0 +1,110 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Abilities; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.AbilityType; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author BursegSardaukar + */ +public class MagewrightsStone extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that has an ability with {T} in its cost"); + + static { + filter.add(new HasAbilityWithTapSymbolPredicate()); + } + + public MagewrightsStone(UUID ownerId) { + super(ownerId, 162, "Magewright's Stone", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "DIS"; + + // {1}, {T}: Untap target creature that has an activated ability with {T} in its cost. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ManaCostsImpl("{1}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public MagewrightsStone(final MagewrightsStone card) { + super(card); + } + + @Override + public MagewrightsStone copy() { + return new MagewrightsStone(this); + } +} + +class HasAbilityWithTapSymbolPredicate implements Predicate { + + @Override + public boolean apply(MageObject input, Game game) { + Abilities abilities; + if (input instanceof Card) { + abilities = ((Card) input).getAbilities(game); + } else { + abilities = input.getAbilities(); + } + + for (Ability ability : abilities) { + if (ability.getAbilityType().equals(AbilityType.ACTIVATED) && !ability.getCosts().isEmpty()) { + for (Cost cost : ability.getCosts()) { + if (cost instanceof TapSourceCost) { + return true; + } + } + } + } + return false; + } + + @Override + public String toString() { + return "activated ability with {T} in its cost"; + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/MightOfTheNephilim.java b/Mage.Sets/src/mage/sets/dissension/MightOfTheNephilim.java new file mode 100644 index 00000000000..3b177f8b174 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/MightOfTheNephilim.java @@ -0,0 +1,104 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Quercitron + */ +public class MightOfTheNephilim extends CardImpl { + + public MightOfTheNephilim(UUID ownerId) { + super(ownerId, 88, "Might of the Nephilim", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "DIS"; + + // Target creature gets +2/+2 until end of turn for each of its colors. + DynamicValue boostValue = MightOfTheNephilimValue.getInstance(); + Effect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn, true); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public MightOfTheNephilim(final MightOfTheNephilim card) { + super(card); + } + + @Override + public MightOfTheNephilim copy() { + return new MightOfTheNephilim(this); + } +} + +class MightOfTheNephilimValue implements DynamicValue { + + private static final MightOfTheNephilimValue fINSTANCE = new MightOfTheNephilimValue(); + + public static MightOfTheNephilimValue getInstance() { + return fINSTANCE; + } + + private MightOfTheNephilimValue() {} + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Permanent target = game.getPermanentOrLKIBattlefield(sourceAbility.getFirstTarget()); + if (target != null) { + return 2 * target.getColor(game).getColorCount(); + } + return 0; + } + + @Override + public MightOfTheNephilimValue copy() { + return fINSTANCE; + } + + @Override + public String toString() { + return "2"; + } + + @Override + public String getMessage() { + return "of its colors"; + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java b/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java index 0492eea1491..8a23b3a4427 100644 --- a/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java +++ b/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java @@ -27,20 +27,30 @@ */ package mage.sets.dissension; +import java.util.Set; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.ObjectColor; +import mage.abilities.Ability; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; +import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; +import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterSpell; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.players.Player; import mage.target.common.TargetCardInLibrary; /** @@ -76,9 +86,7 @@ public class MomirVigSimicVisionary extends CardImpl { this.addAbility(new SpellCastControllerTriggeredAbility(effect, filter, true)); // Whenever you cast a blue creature spell, reveal the top card of your library. If it's a creature card, put that card into your hand. - Effect effect2 = new RevealLibraryPutIntoHandEffect(1, new FilterCreatureCard(), false); - effect2.setText("reveal the top card of your library. If it's a creature card, put that card into your hand"); - this.addAbility(new SpellCastControllerTriggeredAbility(effect2, filter2, false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new MomirVigSimicVisionaryEffect(), filter2, false)); } @@ -91,3 +99,44 @@ public class MomirVigSimicVisionary extends CardImpl { return new MomirVigSimicVisionary(this); } } + +class MomirVigSimicVisionaryEffect extends OneShotEffect { + + public MomirVigSimicVisionaryEffect() { + super(Outcome.DrawCard); + this.staticText = "reveal the top card of your library. If it's a creature card, put that card into your hand"; + } + + public MomirVigSimicVisionaryEffect(final MomirVigSimicVisionaryEffect effect) { + super(effect); + } + + @Override + public MomirVigSimicVisionaryEffect copy() { + return new MomirVigSimicVisionaryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller == null || sourceObject == null) { + return false; + } + + CardsImpl cards = new CardsImpl(); + cards.addAll(controller.getLibrary().getTopCards(game, 1)); + controller.revealCards(sourceObject.getIdName(), cards, game); + + Set cardsList = cards.getCards(game); + Cards cardsToHand = new CardsImpl(); + for (Card card : cardsList) { + if (card.getCardType().contains(CardType.CREATURE)) { + cardsToHand.add(card); + cards.remove(card); + } + } + controller.moveCards(cardsToHand, null, Zone.HAND, source, game); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/OgreGatecrasher.java b/Mage.Sets/src/mage/sets/dissension/OgreGatecrasher.java new file mode 100644 index 00000000000..c20b4ea4247 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/OgreGatecrasher.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class OgreGatecrasher extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with defender"); + + static { + filter.add(new AbilityPredicate(DefenderAbility.class)); + } + + public OgreGatecrasher(UUID ownerId) { + super(ownerId, 67, "Ogre Gatecrasher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Ogre"); + this.subtype.add("Rogue"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Ogre Gatecrasher enters the battlefield, destroy target creature with defender. + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public OgreGatecrasher(final OgreGatecrasher card) { + super(card); + } + + @Override + public OgreGatecrasher copy() { + return new OgreGatecrasher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/PalliationAccord.java b/Mage.Sets/src/mage/sets/dissension/PalliationAccord.java index 0d98ccb2056..9014dce7344 100644 --- a/Mage.Sets/src/mage/sets/dissension/PalliationAccord.java +++ b/Mage.Sets/src/mage/sets/dissension/PalliationAccord.java @@ -29,7 +29,7 @@ package mage.sets.dissension; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BecomesTappedTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.effects.PreventionEffectImpl; @@ -38,12 +38,14 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; +import mage.constants.TargetController; import mage.constants.Zone; import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; -import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; +import mage.game.events.GameEvent; /** * @@ -51,13 +53,19 @@ import mage.game.permanent.Permanent; */ public class PalliationAccord extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + public PalliationAccord(UUID ownerId) { super(ownerId, 122, "Palliation Accord", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{U}"); this.expansionSetCode = "DIS"; // Whenever a creature an opponent controls becomes tapped, put a shield counter on Palliation Accord. - this.addAbility(new PallationAccordTriggeredAbility()); - + this.addAbility(new BecomesTappedTriggeredAbility(new AddCountersSourceEffect(CounterType.SHIELD.createInstance()), false, filter)); + // Remove a shield counter from Palliation Accord: Prevent the next 1 damage that would be dealt to you this turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PalliationAccordPreventionEffect(), new RemoveCountersSourceCost(CounterType.SHIELD.createInstance()))); } @@ -72,41 +80,6 @@ public class PalliationAccord extends CardImpl { } } -class PallationAccordTriggeredAbility extends TriggeredAbilityImpl { - PallationAccordTriggeredAbility() { - super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.SHIELD.createInstance())); - } - - PallationAccordTriggeredAbility(final PallationAccordTriggeredAbility ability) { - super(ability); - } - - @Override - public PallationAccordTriggeredAbility copy() { - return new PallationAccordTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent p = game.getPermanent(event.getTargetId()); - if (p != null && p.getCardType().contains(CardType.CREATURE)) { - if (game.getOpponents(this.controllerId).contains(p.getControllerId())) - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever a creature an opponent controls becomes tapped, " + modes.getText(); - } -} - class PalliationAccordPreventionEffect extends PreventionEffectImpl { public PalliationAccordPreventionEffect() { @@ -151,4 +124,4 @@ class PalliationAccordPreventionEffect extends PreventionEffectImpl { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/dissension/PillarOfTheParuns.java b/Mage.Sets/src/mage/sets/dissension/PillarOfTheParuns.java index 8278800e994..a548ba5adeb 100644 --- a/Mage.Sets/src/mage/sets/dissension/PillarOfTheParuns.java +++ b/Mage.Sets/src/mage/sets/dissension/PillarOfTheParuns.java @@ -27,22 +27,14 @@ */ package mage.sets.dissension; -import mage.ConditionalMana; -import mage.MageObject; -import mage.Mana; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; -import mage.abilities.condition.Condition; +import java.util.UUID; import mage.abilities.mana.ConditionalAnyColorManaAbility; -import mage.abilities.mana.builder.ConditionalManaBuilder; -import mage.abilities.mana.conditional.ManaCondition; +import mage.abilities.mana.conditional.ConditionalSpellManaBuilder; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; +import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.MulticoloredPredicate; -import mage.game.Game; - -import java.util.UUID; /** * @@ -50,12 +42,18 @@ import java.util.UUID; */ public class PillarOfTheParuns extends CardImpl { + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + public PillarOfTheParuns(UUID ownerId) { super(ownerId, 176, "Pillar of the Paruns", Rarity.RARE, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "DIS"; // {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a multicolored spell. - this.addAbility(new ConditionalAnyColorManaAbility(1, new PillarOfTheParunsManaBuilder())); + this.addAbility(new ConditionalAnyColorManaAbility(1, new ConditionalSpellManaBuilder(filter))); } public PillarOfTheParuns(final PillarOfTheParuns card) { @@ -67,44 +65,3 @@ public class PillarOfTheParuns extends CardImpl { return new PillarOfTheParuns(this); } } - - -class PillarOfTheParunsManaBuilder extends ConditionalManaBuilder { - @Override - public ConditionalMana build(Object... options) { - return new PillarOfTheParunsConditionalMana(this.mana); - } - - @Override - public String getRule() { - return "Spend this mana only to cast a multicolored spell"; - } -} - -class PillarOfTheParunsConditionalMana extends ConditionalMana { - - public PillarOfTheParunsConditionalMana(Mana mana) { - super(mana); - staticText = "Spend this mana only to cast a multicolored spell"; - addCondition(new MultiColoredSpellCastManaCondition()); - } -} - -class MultiColoredSpellCastManaCondition extends ManaCondition implements Condition { - - @Override - public boolean apply(Game game, Ability source) { - if (source instanceof SpellAbility) { - MageObject object = game.getObject(source.getSourceId()); - if (object != null && object.getColor(game).getColorCount() > 1) { - return true; - } - } - return false; - } - - @Override - public boolean apply(Game game, Ability source, UUID originalId) { - return apply(game, source); - } -} diff --git a/Mage.Sets/src/mage/sets/dissension/ProteanHulk.java b/Mage.Sets/src/mage/sets/dissension/ProteanHulk.java index 4a7804b3443..064145d1981 100644 --- a/Mage.Sets/src/mage/sets/dissension/ProteanHulk.java +++ b/Mage.Sets/src/mage/sets/dissension/ProteanHulk.java @@ -78,47 +78,42 @@ public class ProteanHulk extends CardImpl { } class ProteanHulkEffect extends OneShotEffect { - + ProteanHulkEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "search your library for any number of creature cards with total converted mana cost 6 or less and put them onto the battlefield. Then shuffle your library"; } - + ProteanHulkEffect(final ProteanHulkEffect effect) { super(effect); } - + @Override public ProteanHulkEffect copy() { return new ProteanHulkEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { Cards cardsPicked = this.ProteanHulkSearch(game, source); - for (UUID cardId : cardsPicked) { - Card card = game.getCard(cardId); - if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.PICK, source.getSourceId()); - } - } - player.shuffleLibrary(game); + controller.moveCards(cardsPicked.getCards(game), Zone.BATTLEFIELD, source, game); + controller.shuffleLibrary(game); return true; } return false; } - + Cards ProteanHulkSearch(Game game, Ability source) { - Cards cardsPicked = new CardsImpl(Zone.PICK); + Cards cardsPicked = new CardsImpl(Zone.LIBRARY); Player player = game.getPlayer(source.getControllerId()); if (player != null) { GameEvent event = GameEvent.getEvent(GameEvent.EventType.SEARCH_LIBRARY, source.getControllerId(), source.getControllerId(), source.getControllerId(), Integer.MAX_VALUE); if (!game.replaceEvent(event)) { int manaCostLeftToFetch = 6; int librarySearchLimit = event.getAmount(); - + FilterCard filter = new FilterCreatureCard("number of creature cards with total converted mana cost 6 or less (6 CMC left)"); filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, manaCostLeftToFetch + 1)); TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter); @@ -131,15 +126,14 @@ class ProteanHulkEffect extends OneShotEffect { break; } cardsPicked.add(card); - game.setZone(card.getId(), Zone.PICK); game.getState().getLookedAt(source.getControllerId()).add("Protean Hulk", cardsPicked); - + librarySearchLimit--; if (librarySearchLimit == 0) { break; } manaCostLeftToFetch -= card.getManaCost().convertedManaCost(); - filter = new FilterCreatureCard("number of creature cards with total converted mana cost 6 or less ("+ manaCostLeftToFetch +" CMC left)"); + filter = new FilterCreatureCard("number of creature cards with total converted mana cost 6 or less (" + manaCostLeftToFetch + " CMC left)"); filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, manaCostLeftToFetch + 1)); target = new TargetCardInLibrary(0, 1, filter); target.setCardLimit(librarySearchLimit); diff --git a/Mage.Sets/src/mage/sets/dissension/PureSimple.java b/Mage.Sets/src/mage/sets/dissension/PureSimple.java index 9a2b77b35f2..ec456b064da 100644 --- a/Mage.Sets/src/mage/sets/dissension/PureSimple.java +++ b/Mage.Sets/src/mage/sets/dissension/PureSimple.java @@ -25,18 +25,18 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.dissension; import java.util.UUID; import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Rarity; -import mage.cards.SplitCard; import mage.filter.FilterPermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.MulticoloredPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; /** @@ -45,30 +45,26 @@ import mage.target.TargetPermanent; */ public class PureSimple extends SplitCard { - private static final FilterPermanent filterAura = new FilterPermanent("aura"); - private static final FilterPermanent filterEquipment = new FilterPermanent("equipment"); + private static final FilterPermanent filterDestroy = new FilterPermanent("Auras and Equipment"); private static final FilterPermanent filterMulticolor = new FilterPermanent("multicolor permanent"); - + static { - filterAura.add(new SubtypePredicate("Aura")); - filterEquipment.add(new SubtypePredicate("Equipment")); + filterDestroy.add(Predicates.or(new SubtypePredicate("Aura"), new SubtypePredicate("Equipment"))); filterMulticolor.add(new MulticoloredPredicate()); } - + public PureSimple(UUID ownerId) { super(ownerId, 154, "Pure", "Simple", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{R}{G}", "{1}{G}{W}", true); this.expansionSetCode = "DIS"; // Pure - // Destroy all Auras - getLeftHalfCard().getSpellAbility().addEffect(new DestroyAllEffect(filterAura)); - // and Equipment. - getLeftHalfCard().getSpellAbility().addEffect(new DestroyAllEffect(filterEquipment)); + // Destroy target multicolored permanent. + getLeftHalfCard().getSpellAbility().addEffect(new DestroyTargetEffect()); + getLeftHalfCard().getSpellAbility().addTarget(new TargetPermanent(filterMulticolor)); // Simple - // Destroy target multicolored permanent. - getRightHalfCard().getSpellAbility().addEffect(new DestroyTargetEffect()); - getRightHalfCard().getSpellAbility().addTarget(new TargetPermanent(filterMulticolor)); + // Destroy all Auras and Equipment. + getRightHalfCard().getSpellAbility().addEffect(new DestroyAllEffect(filterDestroy)); } public PureSimple(final PureSimple card) { diff --git a/Mage.Sets/src/mage/sets/dissension/RakdosGuildmage.java b/Mage.Sets/src/mage/sets/dissension/RakdosGuildmage.java index b4a6247fbea..0de01f222a7 100644 --- a/Mage.Sets/src/mage/sets/dissension/RakdosGuildmage.java +++ b/Mage.Sets/src/mage/sets/dissension/RakdosGuildmage.java @@ -30,7 +30,6 @@ package mage.sets.dissension; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.costs.common.DiscardCardCost; @@ -46,6 +45,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; @@ -66,11 +66,11 @@ public class RakdosGuildmage extends CardImpl { // ({BR} can be paid with either {B} or {R}.) // {3}{B}, Discard a card: Target creature gets -2/-2 until end of turn. - SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2,-2, Duration.EndOfTurn), new ManaCostsImpl("{3}{B}")); + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{3}{B}")); ability.addTarget(new TargetCreaturePermanent()); ability.addCost(new DiscardCardCost()); this.addAbility(ability); - + // {3}{R}: Put a 2/1 red Goblin creature token with haste onto the battlefield. Exile it at the beginning of the next end step. SimpleActivatedAbility ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RakdosGuildmageEffect(), new ManaCostsImpl("{3}{R}")); this.addAbility(ability2); @@ -86,7 +86,6 @@ public class RakdosGuildmage extends CardImpl { } } - class RakdosGuildmageEffect extends OneShotEffect { public RakdosGuildmageEffect() { @@ -107,13 +106,14 @@ class RakdosGuildmageEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Token token = new RakdosGuildmageGoblinToken(); if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source); + } + } return true; } return false; @@ -131,4 +131,4 @@ class RakdosGuildmageGoblinToken extends Token { toughness = new MageInt(1); this.addAbility(HasteAbility.getInstance()); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/dissension/RakdosIckspitter.java b/Mage.Sets/src/mage/sets/dissension/RakdosIckspitter.java new file mode 100644 index 00000000000..cf276535659 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/RakdosIckspitter.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.LoseLifeTargetControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class RakdosIckspitter extends CardImpl { + + public RakdosIckspitter(UUID ownerId) { + super(ownerId, 128, "Rakdos Ickspitter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Thrull"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Rakdos Ickspitter deals 1 damage to target creature and that creature's controller loses 1 life. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + Effect effect = new LoseLifeTargetControllerEffect(1); + effect.setText("and that creature's controller loses 1 life"); + ability.addEffect(effect); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public RakdosIckspitter(final RakdosIckspitter card) { + super(card); + } + + @Override + public RakdosIckspitter copy() { + return new RakdosIckspitter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/Ratcatcher.java b/Mage.Sets/src/mage/sets/dissension/Ratcatcher.java new file mode 100644 index 00000000000..ca891b48256 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/Ratcatcher.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.abilities.keyword.FearAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author jeffwadsworth + */ +public class Ratcatcher extends CardImpl { + + private static final FilterCard filter = new FilterCard("Rat card"); + + static { + filter.add(new SubtypePredicate("Rat")); + } + + public Ratcatcher(UUID ownerId) { + super(ownerId, 52, "Ratcatcher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Ogre"); + this.subtype.add("Rogue"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Fear + this.addAbility(FearAbility.getInstance()); + + // At the beginning of your upkeep, you may search your library for a Rat card, reveal it, and put it into your hand. If you do, shuffle your library. + TargetCardInLibrary targetCard = new TargetCardInLibrary(1, 1, filter); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(targetCard, true, true), TargetController.YOU, true)); + + } + + public Ratcatcher(final Ratcatcher card) { + super(card); + } + + @Override + public Ratcatcher copy() { + return new Ratcatcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/RiseFall.java b/Mage.Sets/src/mage/sets/dissension/RiseFall.java index 91403495f23..56d0d46b255 100644 --- a/Mage.Sets/src/mage/sets/dissension/RiseFall.java +++ b/Mage.Sets/src/mage/sets/dissension/RiseFall.java @@ -148,7 +148,7 @@ class FallEffect extends OneShotEffect { } while (cards.contains(card.getId())); cards.add(card); } - targetPlayer.revealCards(sourceObject.getName(), cards, game); + targetPlayer.revealCards(sourceObject.getIdName(), cards, game); for (Card cardToDiscard : cards.getCards(game)) { if (!cardToDiscard.getCardType().contains(CardType.LAND)) { targetPlayer.discard(cardToDiscard, source, game); diff --git a/Mage.Sets/src/mage/sets/dissension/SandstormEidolon.java b/Mage.Sets/src/mage/sets/dissension/SandstormEidolon.java new file mode 100644 index 00000000000..67d9b679a82 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/SandstormEidolon.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.abilities.effects.common.combat.CantBlockTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SandstormEidolon extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public SandstormEidolon(UUID ownerId) { + super(ownerId, 70, "Sandstorm Eidolon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {R}, Sacrifice Sandstorm Eidolon: Target creature can't block this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBlockTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{R}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + // Whenever you cast a multicolored spell, you may return Sandstorm Eidolon from your graveyard to your hand. + this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false)); + } + + public SandstormEidolon(final SandstormEidolon card) { + super(card); + } + + @Override + public SandstormEidolon copy() { + return new SandstormEidolon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/ShieldingPlax.java b/Mage.Sets/src/mage/sets/dissension/ShieldingPlax.java index 3d42a62d49e..f2367a6c851 100644 --- a/Mage.Sets/src/mage/sets/dissension/ShieldingPlax.java +++ b/Mage.Sets/src/mage/sets/dissension/ShieldingPlax.java @@ -43,8 +43,8 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; +import mage.filter.FilterObject; import mage.filter.FilterStackObject; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -54,12 +54,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class ShieldingPlax extends CardImpl { - private static final FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control"); + private static final FilterObject filter = new FilterStackObject("spells or abilities your opponents control"); - static { - filter.add(new ControllerPredicate(TargetController.OPPONENT)); - } - public ShieldingPlax(UUID ownerId) { super(ownerId, 147, "Shielding Plax", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G/U}"); this.expansionSetCode = "DIS"; @@ -71,12 +67,13 @@ public class ShieldingPlax extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - + // When Shielding Plax enters the battlefield, draw a card. this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); - + // Enchanted creature can't be the target of spells or abilities your opponents control. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeTargetedAttachedEffect(filter, Duration.WhileOnBattlefield, AttachmentType.AURA))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new CantBeTargetedAttachedEffect(filter, Duration.WhileOnBattlefield, AttachmentType.AURA, TargetController.OPPONENT))); } public ShieldingPlax(final ShieldingPlax card) { diff --git a/Mage.Sets/src/mage/sets/dissension/SimicBasilisk.java b/Mage.Sets/src/mage/sets/dissension/SimicBasilisk.java index 2d6da8494b8..09d54a7ec21 100644 --- a/Mage.Sets/src/mage/sets/dissension/SimicBasilisk.java +++ b/Mage.Sets/src/mage/sets/dissension/SimicBasilisk.java @@ -32,7 +32,10 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.DealsDamageToACreatureTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.GraftAbility; @@ -69,7 +72,10 @@ public class SimicBasilisk extends CardImpl { this.addAbility(new GraftAbility(this, 3)); // {1}{G}: Until end of turn, target creature with a +1/+1 counter on it gains "Whenever this creature deals combat damage to a creature, destroy that creature at end of combat." - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new DealsDamageToACreatureTriggeredAbility(new DestroyTargetEffect(), true, false, true), Duration.EndOfTurn), new ManaCostsImpl("{1}{G}")); + Effect effect = new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); + effect.setText("destroy that creature at end of combat"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new DealsDamageToACreatureTriggeredAbility(effect, true, false, true), Duration.EndOfTurn), new ManaCostsImpl("{1}{G}")); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/dissension/SimicRagworm.java b/Mage.Sets/src/mage/sets/dissension/SimicRagworm.java new file mode 100644 index 00000000000..323d074f30b --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/SimicRagworm.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class SimicRagworm extends CardImpl { + + public SimicRagworm(UUID ownerId) { + super(ownerId, 93, "Simic Ragworm", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Worm"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {U}: Untap Simic Ragworm. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new ManaCostsImpl("{U}"))); + } + + public SimicRagworm(final SimicRagworm card) { + super(card); + } + + @Override + public SimicRagworm copy() { + return new SimicRagworm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/SproutingPhytohydra.java b/Mage.Sets/src/mage/sets/dissension/SproutingPhytohydra.java index 1f941488cf9..29125cb5e58 100644 --- a/Mage.Sets/src/mage/sets/dissension/SproutingPhytohydra.java +++ b/Mage.Sets/src/mage/sets/dissension/SproutingPhytohydra.java @@ -30,7 +30,8 @@ package mage.sets.dissension; import java.util.UUID; import mage.MageInt; import mage.abilities.common.DealtDamageToSourceTriggeredAbility; -import mage.abilities.effects.common.PutTokenOntoBattlefieldCopySource; +import mage.abilities.effects.Effect; +import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -54,7 +55,9 @@ public class SproutingPhytohydra extends CardImpl { // Defender this.addAbility(DefenderAbility.getInstance()); // Whenever Sprouting Phytohydra is dealt damage, you may put a token that's a copy of Sprouting Phytohydra onto the battlefield. - this.addAbility(new DealtDamageToSourceTriggeredAbility(Zone.BATTLEFIELD, new PutTokenOntoBattlefieldCopySource(), false)); + Effect effect = new PutTokenOntoBattlefieldCopySourceEffect(); + effect.setText("you may put a token that's a copy of {this} onto the battlefield"); + this.addAbility(new DealtDamageToSourceTriggeredAbility(Zone.BATTLEFIELD, effect, true)); } public SproutingPhytohydra(final SproutingPhytohydra card) { diff --git a/Mage.Sets/src/mage/sets/dissension/StoicEphemera.java b/Mage.Sets/src/mage/sets/dissension/StoicEphemera.java new file mode 100644 index 00000000000..e8bb93eee2c --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/StoicEphemera.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class StoicEphemera extends CardImpl { + + public StoicEphemera(UUID ownerId) { + super(ownerId, 19, "Stoic Ephemera", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Spirit"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Stoic Ephemera blocks, sacrifice it at end of combat. + this.addAbility(new BlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new SacrificeSourceEffect())), false)); + } + + public StoicEphemera(final StoicEphemera card) { + super(card); + } + + @Override + public StoicEphemera copy() { + return new StoicEphemera(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/SupplyDemand.java b/Mage.Sets/src/mage/sets/dissension/SupplyDemand.java index 8eae6bf7da0..9f57c434cba 100644 --- a/Mage.Sets/src/mage/sets/dissension/SupplyDemand.java +++ b/Mage.Sets/src/mage/sets/dissension/SupplyDemand.java @@ -39,7 +39,6 @@ import mage.filter.predicate.mageobject.MulticoloredPredicate; import mage.game.permanent.token.SaprolingToken; import mage.target.common.TargetCardInLibrary; - /** * * @author LevelX2 @@ -53,16 +52,16 @@ public class SupplyDemand extends SplitCard { } public SupplyDemand(UUID ownerId) { - super(ownerId, 157, "Supply", "Demand", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{W}{U}", "{X}{G}{W}", false); + super(ownerId, 157, "Supply", "Demand", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{G}{W}", "{1}{W}{U}", false); this.expansionSetCode = "DIS"; - // Demand - // Search your library for a multicolored card, reveal it, and put it into your hand. Then shuffle your library. - getLeftHalfCard().getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, filter), true)); - // Supply // Put X 1/1 green Saproling creature tokens onto the battlefield. - getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new ManacostVariableValue())); + getLeftHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new ManacostVariableValue())); + + // Demand + // Search your library for a multicolored card, reveal it, and put it into your hand. Then shuffle your library. + getRightHalfCard().getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(1, filter), true)); } diff --git a/Mage.Sets/src/mage/sets/dissension/TrialError.java b/Mage.Sets/src/mage/sets/dissension/TrialError.java new file mode 100644 index 00000000000..46877c7937c --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/TrialError.java @@ -0,0 +1,133 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.Card; +import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; +import mage.game.Game; +import mage.game.combat.CombatGroup; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetSpell; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class TrialError extends SplitCard { + + private static final FilterSpell filter = new FilterSpell("multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public TrialError(UUID ownerId) { + super(ownerId, 158, "Trial", "Error", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}{U}", "{U}{B}", false); + this.expansionSetCode = "DIS"; + + // Trial + // Return all creatures blocking or blocked by target creature to their owner's hand. + getLeftHalfCard().getSpellAbility().addEffect(new TrialEffect()); + getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Error + // Counter target multicolored spell. + getRightHalfCard().getSpellAbility().addEffect(new CounterTargetEffect()); + getRightHalfCard().getSpellAbility().addTarget(new TargetSpell(filter)); + + } + + public TrialError(final TrialError card) { + super(card); + } + + @Override + public TrialError copy() { + return new TrialError(this); + } +} + +class TrialEffect extends OneShotEffect { + + public TrialEffect() { + super(Outcome.ReturnToHand); + this.staticText = "Return all creatures blocking or blocked by target creature to their owner's hand"; + } + + public TrialEffect(final TrialEffect effect) { + super(effect); + } + + @Override + public TrialEffect copy() { + return new TrialEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (controller != null && creature != null) { + Set toHand = new HashSet<>(); + for (CombatGroup combatGroup : game.getCombat().getGroups()) { + if (combatGroup.getBlockers().contains(creature.getId())) { + for (UUID attackerId : combatGroup.getAttackers()) { + Permanent attacker = game.getPermanent(attackerId); + if (attacker != null) { + toHand.add(attacker); + } + } + } else if (combatGroup.getAttackers().contains(creature.getId())) { + for (UUID blockerId : combatGroup.getBlockers()) { + Permanent blocker = game.getPermanent(blockerId); + if (blocker != null) { + toHand.add(blocker); + } + } + } + } + controller.moveCards(toHand, null, Zone.HAND, source, game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/UtopiaSprawl.java b/Mage.Sets/src/mage/sets/dissension/UtopiaSprawl.java index c92e93989b1..de6633ee6af 100644 --- a/Mage.Sets/src/mage/sets/dissension/UtopiaSprawl.java +++ b/Mage.Sets/src/mage/sets/dissension/UtopiaSprawl.java @@ -32,20 +32,18 @@ import mage.Mana; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ChooseColorEffect; import mage.abilities.effects.common.ManaEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.mana.TriggeredManaAbility; import mage.cards.CardImpl; -import mage.choices.ChoiceColor; import mage.constants.CardType; import mage.constants.ColoredManaSymbol; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterLandPermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -60,18 +58,13 @@ import mage.target.common.TargetLandPermanent; */ public class UtopiaSprawl extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent("Forest"); + private static final FilterLandPermanent filter = new FilterLandPermanent("Forest", "Forest"); - static { - filter.add(new SubtypePredicate("Forest")); - } - public UtopiaSprawl(UUID ownerId) { super(ownerId, 99, "Utopia Sprawl", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); this.expansionSetCode = "DIS"; this.subtype.add("Aura"); - // Enchant Forest TargetPermanent auraTarget = new TargetLandPermanent(filter); this.getSpellAbility().addTarget(auraTarget); @@ -79,7 +72,7 @@ public class UtopiaSprawl extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // As Utopia Sprawl enters the battlefield, choose a color. - this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Detriment))); // Whenever enchanted Forest is tapped for mana, its controller adds one mana of the chosen color to his or her mana pool. this.addAbility(new UtopiaSprawlTriggeredAbility()); } @@ -94,42 +87,8 @@ public class UtopiaSprawl extends CardImpl { } } -class ChooseColorEffect extends OneShotEffect { - - public ChooseColorEffect() { - super(Outcome.BoostCreature); - staticText = "choose a color"; - } - - public ChooseColorEffect(final ChooseColorEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - ChoiceColor colorChoice = new ChoiceColor(); - if (player.choose(Outcome.Neutral, colorChoice, game)) { - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + colorChoice.getChoice()); - game.getState().setValue(permanent.getId() + "_color", colorChoice.getColor()); - permanent.addInfo("chosen color", "Chosen color: " + colorChoice.getColor().getDescription() + "", game); - } - } - return false; - } - - @Override - public ChooseColorEffect copy() { - return new ChooseColorEffect(this); - } - -} - class UtopiaSprawlTriggeredAbility extends TriggeredManaAbility { - public UtopiaSprawlTriggeredAbility() { super(Zone.BATTLEFIELD, new UtopiaSprawlEffect()); } @@ -146,10 +105,7 @@ class UtopiaSprawlTriggeredAbility extends TriggeredManaAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.getSourceId()); - if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { - return true; - } - return false; + return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo()); } @Override @@ -159,11 +115,10 @@ class UtopiaSprawlTriggeredAbility extends TriggeredManaAbility { @Override public String getRule() { - return "Whenever enchanted Forest is tapped for mana, its controller adds one mana of the chosen color to his or her mana pool"; + return "Whenever enchanted Forest is tapped for mana, its controller adds one mana of the chosen color to his or her mana pool."; } } - class UtopiaSprawlEffect extends ManaEffect { public UtopiaSprawlEffect() { @@ -178,9 +133,9 @@ class UtopiaSprawlEffect extends ManaEffect { @Override public boolean apply(Game game, Ability source) { Permanent enchantment = game.getPermanent(source.getSourceId()); - if(enchantment != null){ + if (enchantment != null) { Permanent land = game.getPermanent(enchantment.getAttachedTo()); - if(land != null){ + if (land != null) { Player player = game.getPlayer(land.getControllerId()); if (player != null) { player.getManaPool().addMana(getMana(game, source), game, source); @@ -205,4 +160,4 @@ class UtopiaSprawlEffect extends ManaEffect { public UtopiaSprawlEffect copy() { return new UtopiaSprawlEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/dissension/UtvaraScalper.java b/Mage.Sets/src/mage/sets/dissension/UtvaraScalper.java new file mode 100644 index 00000000000..444333809dc --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/UtvaraScalper.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksEachTurnStaticAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class UtvaraScalper extends CardImpl { + + public UtvaraScalper(UUID ownerId) { + super(ownerId, 76, "Utvara Scalper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Goblin"); + this.subtype.add("Scout"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Utvara Scalper attacks each turn if able. + this.addAbility(new AttacksEachTurnStaticAbility()); + } + + public UtvaraScalper(final UtvaraScalper card) { + super(card); + } + + @Override + public UtvaraScalper copy() { + return new UtvaraScalper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/VerdantEidolon.java b/Mage.Sets/src/mage/sets/dissension/VerdantEidolon.java new file mode 100644 index 00000000000..2f801f83517 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/VerdantEidolon.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AddManaOfAnyColorEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; + +/** + * + * @author LoneFox + */ +public class VerdantEidolon extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public VerdantEidolon(UUID ownerId) { + super(ownerId, 100, "Verdant Eidolon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {G}, Sacrifice Verdant Eidolon: Add three mana of any one color to your mana pool. + Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(3), new ManaCostsImpl("{G}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + // Whenever you cast a multicolored spell, you may return Verdant Eidolon from your graveyard to your hand. + this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false)); + } + + public VerdantEidolon(final VerdantEidolon card) { + super(card); + } + + @Override + public VerdantEidolon copy() { + return new VerdantEidolon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/VesperGhoul.java b/Mage.Sets/src/mage/sets/dissension/VesperGhoul.java new file mode 100644 index 00000000000..1d22a7fe104 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/VesperGhoul.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.AddManaOfAnyColorEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class VesperGhoul extends CardImpl { + + public VesperGhoul(UUID ownerId) { + super(ownerId, 57, "Vesper Ghoul", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Zombie"); + this.subtype.add("Druid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}, Pay 1 life: Add one mana of any color to your mana pool. + Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new TapSourceCost()); + ability.addCost(new PayLifeCost(1)); + this.addAbility(ability); + } + + public VesperGhoul(final VesperGhoul card) { + super(card); + } + + @Override + public VesperGhoul copy() { + return new VesperGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/WhiptailMoloch.java b/Mage.Sets/src/mage/sets/dissension/WhiptailMoloch.java new file mode 100644 index 00000000000..a170be090fe --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/WhiptailMoloch.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class WhiptailMoloch extends CardImpl { + + public WhiptailMoloch(UUID ownerId) { + super(ownerId, 79, "Whiptail Moloch", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Lizard"); + this.power = new MageInt(6); + this.toughness = new MageInt(3); + + // When Whiptail Moloch enters the battlefield, it deals 3 damage to target creature you control. + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(3), false); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + public WhiptailMoloch(final WhiptailMoloch card) { + super(card); + } + + @Override + public WhiptailMoloch copy() { + return new WhiptailMoloch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/divinevsdemonic/FaithsFetters.java b/Mage.Sets/src/mage/sets/divinevsdemonic/FaithsFetters.java index e586bbed0c7..d386108be97 100644 --- a/Mage.Sets/src/mage/sets/divinevsdemonic/FaithsFetters.java +++ b/Mage.Sets/src/mage/sets/divinevsdemonic/FaithsFetters.java @@ -71,7 +71,7 @@ public class FaithsFetters extends CardImpl { // When Faith's Fetters enters the battlefield, you gain 4 life. this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4))); - // Enchanted permanent can't attack or block, and its activated abilities can't be activated unless they're mana abilities. + // Enchanted permanent's activated abilities can't be activated unless they're mana abilities. If enchanted permanent is a creature, it can't attack or block. Effect effect = new CantAttackBlockAttachedEffect(AttachmentType.AURA); effect.setText("Enchanted permanent can't attack or block,"); ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/AEtherling.java b/Mage.Sets/src/mage/sets/dragonsmaze/AEtherling.java index 3dd30d6f2ad..a6b07bc4f1a 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/AEtherling.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/AEtherling.java @@ -57,7 +57,7 @@ public class AEtherling extends CardImpl { // {U}: Exile AEtherling. Return it to the battlefield under its owner's control at the beginning of the next end step. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileReturnToBattlefieldOwnerNextEndStepEffect(true), new ManaCostsImpl("{U}"))); // {U}: AEtherling can't be blocked this turn - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedSourceEffect(), new ManaCostsImpl("{U}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{U}"))); // {1}: AEtherling gets +1/-1 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{1}"))); // {1}: AEtherling gets -1/+1 until end of turn diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/AdventOfTheWurm.java b/Mage.Sets/src/mage/sets/dragonsmaze/AdventOfTheWurm.java index c23ec62ddfa..16eb3ddf20b 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/AdventOfTheWurm.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/AdventOfTheWurm.java @@ -29,14 +29,12 @@ package mage.sets.dragonsmaze; import java.util.UUID; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.WurmToken2; /** * @@ -50,9 +48,8 @@ public class AdventOfTheWurm extends CardImpl { super(ownerId, 51, "Advent of the Wurm", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{G}{G}{W}"); this.expansionSetCode = "DGM"; - // Put a 5/5 green Wurm creature token with trample onto the battlefield. - this.getSpellAbility().addEffect(new CreateTokenEffect(new WurmToken())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new WurmToken2())); } public AdventOfTheWurm(final AdventOfTheWurm card) { @@ -63,21 +60,4 @@ public class AdventOfTheWurm extends CardImpl { public AdventOfTheWurm copy() { return new AdventOfTheWurm(this); } - - private class WurmToken extends Token { - - private WurmToken() { - super("Wurm", "5/5 green Wurm creature token with trample"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Wurm"); - power = new MageInt(5); - toughness = new MageInt(5); - - addAbility(TrampleAbility.getInstance()); - // for image - setOriginalExpansionSetCode("RTR"); - } - - } } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/BeckCall.java b/Mage.Sets/src/mage/sets/dragonsmaze/BeckCall.java index 8bed02cb907..d79ba674371 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/BeckCall.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/BeckCall.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.dragonsmaze; import java.util.UUID; @@ -42,8 +41,7 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; - - +import mage.game.permanent.token.BirdToken; public class BeckCall extends SplitCard { @@ -57,7 +55,7 @@ public class BeckCall extends SplitCard { // Call // Put four 1/1 white Bird creature tokens with flying onto the battlefield. - getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new BirdToken(),4)); + getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new BirdToken(), 4)); } @@ -93,10 +91,7 @@ class BeckTriggeredAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { UUID targetId = event.getTargetId(); Permanent permanent = game.getPermanent(targetId); - if (filter.match(permanent, getSourceId(), getControllerId(), game)) { - return true; - } - return false; + return filter.match(permanent, getSourceId(), getControllerId(), game); } @Override diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/BlazeCommando.java b/Mage.Sets/src/mage/sets/dragonsmaze/BlazeCommando.java index cc64ee14378..f819fdc768d 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/BlazeCommando.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/BlazeCommando.java @@ -31,22 +31,20 @@ package mage.sets.dragonsmaze; import java.util.ArrayList; import java.util.List; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.MageObject; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.HasteAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; -import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; import mage.game.permanent.Permanent; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SoldierTokenWithHaste; import mage.game.stack.StackObject; /** @@ -82,12 +80,13 @@ public class BlazeCommando extends CardImpl { } } + class BlazeCommandoTriggeredAbility extends TriggeredAbilityImpl { private final List handledStackObjects = new ArrayList<>(); public BlazeCommandoTriggeredAbility() { - super(Zone.BATTLEFIELD, new CreateTokenEffect(new BlazeCommandoSoldierToken(), 2), false); + super(Zone.BATTLEFIELD, new CreateTokenEffect(new SoldierTokenWithHaste(), 2), false); } public BlazeCommandoTriggeredAbility(final BlazeCommandoTriggeredAbility ability) { @@ -103,10 +102,10 @@ class BlazeCommandoTriggeredAbility extends TriggeredAbilityImpl { public void reset(Game game) { /** * Blaze Commando's ability triggers each time an instant or sorcery spell you control - * deals damage (or, put another way, the number of times the word “deals” appears in + * deals damage (or, put another way, the number of times the word “deals” appears in * its instructions), no matter how much damage is dealt or how many players or permanents - * are dealt damage. For example, if you cast Punish the Enemy and it “deals 3 damage to - * target player and 3 damage to target creature,” Blaze Commando's ability will trigger + * are dealt damage. For example, if you cast Punish the Enemy and it “deals 3 damage to + * target player and 3 damage to target creature,” Blaze Commando's ability will trigger * once and you'll get two Soldier tokens. */ handledStackObjects.clear(); @@ -138,17 +137,3 @@ class BlazeCommandoTriggeredAbility extends TriggeredAbilityImpl { return new StringBuilder("Whenever an instant or sorcery spell you control deals damage, ").append(super.getRule()).toString(); } } - -class BlazeCommandoSoldierToken extends Token { - - public BlazeCommandoSoldierToken() { - super("Soldier", "1/1 red and white Soldier creature tokens with haste"); - cardType.add(CardType.CREATURE); - color.setRed(true); - color.setWhite(true); - subtype.add("Soldier"); - power = new MageInt(1); - toughness = new MageInt(1); - this.addAbility(HasteAbility.getInstance()); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/BloodBaronOfVizkopa.java b/Mage.Sets/src/mage/sets/dragonsmaze/BloodBaronOfVizkopa.java index 24af9bc9355..d675c36e768 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/BloodBaronOfVizkopa.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/BloodBaronOfVizkopa.java @@ -25,17 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.dragonsmaze; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; @@ -45,6 +37,13 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.LifelinkAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; @@ -52,27 +51,21 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; -/** - * - * @author LevelX2 - */ - - public class BloodBaronOfVizkopa extends CardImpl { private static final FilterCard filter = new FilterCard("white and from black"); + static { filter.add(Predicates.or( new ColorPredicate(ObjectColor.WHITE), new ColorPredicate(ObjectColor.BLACK))); } - public BloodBaronOfVizkopa (UUID ownerId) { + public BloodBaronOfVizkopa(UUID ownerId) { super(ownerId, 57, "Blood Baron of Vizkopa", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{W}{B}"); this.expansionSetCode = "DGM"; this.subtype.add("Vampire"); - this.power = new MageInt(4); this.toughness = new MageInt(4); @@ -85,7 +78,7 @@ public class BloodBaronOfVizkopa extends CardImpl { } - public BloodBaronOfVizkopa (final BloodBaronOfVizkopa card) { + public BloodBaronOfVizkopa(final BloodBaronOfVizkopa card) { super(card); } @@ -97,7 +90,7 @@ public class BloodBaronOfVizkopa extends CardImpl { } class BloodBaronOfVizkopaEffect extends ContinuousEffectImpl { - + public BloodBaronOfVizkopaEffect() { super(Duration.WhileOnBattlefield, Outcome.BoostCreature); staticText = "As long as you have 30 or more life and an opponent has 10 or less life, {this} gets +6/+6 and has flying"; @@ -117,21 +110,21 @@ class BloodBaronOfVizkopaEffect extends ContinuousEffectImpl { if (conditionState(source, game)) { Permanent creature = game.getPermanent(source.getSourceId()); if (creature != null) { - switch (layer) { - case PTChangingEffects_7: - if (sublayer == SubLayer.ModifyPT_7c) { - creature.addPower(6); - creature.addToughness(6); - } - break; - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - creature.addAbility(FlyingAbility.getInstance(), source.getSourceId(), game); - } - break; - default: - } - return true; + switch (layer) { + case PTChangingEffects_7: + if (sublayer == SubLayer.ModifyPT_7c) { + creature.addPower(6); + creature.addToughness(6); + } + break; + case AbilityAddingRemovingEffects_6: + if (sublayer == SubLayer.NA) { + creature.addAbility(FlyingAbility.getInstance(), source.getSourceId(), game); + } + break; + default: + } + return true; } } return false; @@ -140,10 +133,12 @@ class BloodBaronOfVizkopaEffect extends ContinuousEffectImpl { protected boolean conditionState(Ability source, Game game) { Player player = game.getPlayer(source.getControllerId()); if (player != null && player.getLife() >= 30) { - for (UUID opponentId :player.getInRange()) { - Player opponent = game.getPlayer(opponentId); - if (opponent != null && opponent.getLife() < 11) { - return true; + for (UUID opponentId : player.getInRange()) { + if (player.hasOpponent(opponentId, game)) { + Player opponent = game.getPlayer(opponentId); + if (opponent != null && opponent.getLife() < 11) { + return true; + } } } } @@ -159,6 +154,6 @@ class BloodBaronOfVizkopaEffect extends ContinuousEffectImpl { public boolean hasLayer(Layer layer) { return (layer.equals(Layer.AbilityAddingRemovingEffects_6) || layer.equals(layer.PTChangingEffects_7)); - } + } } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/PlasmCapture.java b/Mage.Sets/src/mage/sets/dragonsmaze/PlasmCapture.java index 88a299b5c98..ae7f5f64f05 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/PlasmCapture.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/PlasmCapture.java @@ -1,168 +1,168 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.dragonsmaze; - -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.Mana; -import mage.abilities.Ability; -import mage.abilities.common.delayed.AtTheBeginOMainPhaseDelayedTriggeredAbility; -import mage.abilities.common.delayed.AtTheBeginOMainPhaseDelayedTriggeredAbility.PhaseSelection; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ManaEffect; -import mage.cards.CardImpl; -import mage.choices.ChoiceColor; -import mage.game.Game; -import mage.game.stack.Spell; -import mage.players.Player; -import mage.target.TargetSpell; - -/** - * - * @author LevelX2 - */ -public class PlasmCapture extends CardImpl { - - public PlasmCapture(UUID ownerId) { - super(ownerId, 91, "Plasm Capture", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{G}{G}{U}{U}"); - this.expansionSetCode = "DGM"; - - - // Counter target spell. At the beginning of your next precombat main phase, add X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost. - this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new PlasmCaptureCounterEffect()); - } - - public PlasmCapture(final PlasmCapture card) { - super(card); - } - - @Override - public PlasmCapture copy() { - return new PlasmCapture(this); - } -} - -class PlasmCaptureCounterEffect extends OneShotEffect { - - public PlasmCaptureCounterEffect() { - super(Outcome.Benefit); - this.staticText = "Counter target spell. At the beginning of your next precombat main phase, add X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost"; - } - - public PlasmCaptureCounterEffect(final PlasmCaptureCounterEffect effect) { - super(effect); - } - - @Override - public PlasmCaptureCounterEffect copy() { - return new PlasmCaptureCounterEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); - if (spell != null) { - game.getStack().counter(getTargetPointer().getFirst(game, source), source.getSourceId(), game); - // mana gets added also if counter is not successful - int mana = spell.getConvertedManaCost(); - AtTheBeginOMainPhaseDelayedTriggeredAbility delayedAbility = - new AtTheBeginOMainPhaseDelayedTriggeredAbility(new PlasmCaptureManaEffect(mana), false, TargetController.YOU, PhaseSelection.NEXT_PRECOMBAT_MAIN); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - return false; - } -} - -class PlasmCaptureManaEffect extends ManaEffect { - - int amountOfMana; - - public PlasmCaptureManaEffect(int amountOfMana) { - super(); - this.amountOfMana = amountOfMana; - this.staticText = "add X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost"; - } - - public PlasmCaptureManaEffect(final PlasmCaptureManaEffect effect) { - super(effect); - this.amountOfMana = effect.amountOfMana; - } - - @Override - public PlasmCaptureManaEffect copy() { - return new PlasmCaptureManaEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if(player != null){ - Mana mana = new Mana(); - for(int i = 0; i < amountOfMana; i++){ - ChoiceColor choiceColor = new ChoiceColor(); - while (!player.choose(Outcome.Benefit, choiceColor, game)) { - if (!player.canRespond()) { - return false; - } - } - - if (choiceColor.getColor().isBlack()) { - mana.addBlack(); - } else if (choiceColor.getColor().isBlue()) { - mana.addBlue(); - } else if (choiceColor.getColor().isRed()) { - mana.addRed(); - } else if (choiceColor.getColor().isGreen()) { - mana.addGreen(); - } else if (choiceColor.getColor().isWhite()) { - mana.addWhite(); - } - } - - player.getManaPool().addMana(mana, game, source); - return true; - - } - return false; - } - - @Override - public Mana getMana(Game game, Ability source) { - return null; - } - -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dragonsmaze; + +import java.util.UUID; + +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfMainPhaseDelayedTriggeredAbility; +import mage.abilities.common.delayed.AtTheBeginOfMainPhaseDelayedTriggeredAbility.PhaseSelection; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ManaEffect; +import mage.cards.CardImpl; +import mage.choices.ChoiceColor; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author LevelX2 + */ +public class PlasmCapture extends CardImpl { + + public PlasmCapture(UUID ownerId) { + super(ownerId, 91, "Plasm Capture", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{G}{G}{U}{U}"); + this.expansionSetCode = "DGM"; + + + // Counter target spell. At the beginning of your next precombat main phase, add X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost. + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new PlasmCaptureCounterEffect()); + } + + public PlasmCapture(final PlasmCapture card) { + super(card); + } + + @Override + public PlasmCapture copy() { + return new PlasmCapture(this); + } +} + +class PlasmCaptureCounterEffect extends OneShotEffect { + + public PlasmCaptureCounterEffect() { + super(Outcome.Benefit); + this.staticText = "Counter target spell. At the beginning of your next precombat main phase, add X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost"; + } + + public PlasmCaptureCounterEffect(final PlasmCaptureCounterEffect effect) { + super(effect); + } + + @Override + public PlasmCaptureCounterEffect copy() { + return new PlasmCaptureCounterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); + if (spell != null) { + game.getStack().counter(getTargetPointer().getFirst(game, source), source.getSourceId(), game); + // mana gets added also if counter is not successful + int mana = spell.getConvertedManaCost(); + AtTheBeginOfMainPhaseDelayedTriggeredAbility delayedAbility = + new AtTheBeginOfMainPhaseDelayedTriggeredAbility(new PlasmCaptureManaEffect(mana), false, TargetController.YOU, PhaseSelection.NEXT_PRECOMBAT_MAIN); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + return false; + } +} + +class PlasmCaptureManaEffect extends ManaEffect { + + int amountOfMana; + + public PlasmCaptureManaEffect(int amountOfMana) { + super(); + this.amountOfMana = amountOfMana; + this.staticText = "add X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost"; + } + + public PlasmCaptureManaEffect(final PlasmCaptureManaEffect effect) { + super(effect); + this.amountOfMana = effect.amountOfMana; + } + + @Override + public PlasmCaptureManaEffect copy() { + return new PlasmCaptureManaEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if(player != null){ + Mana mana = new Mana(); + for(int i = 0; i < amountOfMana; i++){ + ChoiceColor choiceColor = new ChoiceColor(); + while (!player.choose(Outcome.Benefit, choiceColor, game)) { + if (!player.canRespond()) { + return false; + } + } + + if (choiceColor.getColor().isBlack()) { + mana.increaseBlack(); + } else if (choiceColor.getColor().isBlue()) { + mana.increaseBlue(); + } else if (choiceColor.getColor().isRed()) { + mana.increaseRed(); + } else if (choiceColor.getColor().isGreen()) { + mana.increaseGreen(); + } else if (choiceColor.getColor().isWhite()) { + mana.increaseWhite(); + } + } + + player.getManaPool().addMana(mana, game, source); + return true; + + } + return false; + } + + @Override + public Mana getMana(Game game, Ability source) { + return null; + } + +} diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/PossibilityStorm.java b/Mage.Sets/src/mage/sets/dragonsmaze/PossibilityStorm.java index 1c6e13edb20..392679db64c 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/PossibilityStorm.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/PossibilityStorm.java @@ -157,7 +157,6 @@ class PossibilityStormEffect extends OneShotEffect { if (exile != null) { while (exile.size() > 0) { card = exile.getRandom(game); - exile.remove(card.getId()); spellController.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.EXILED, false, false); } } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/ProgenitorMimic.java b/Mage.Sets/src/mage/sets/dragonsmaze/ProgenitorMimic.java index 416209d7782..9df44c4d7df 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/ProgenitorMimic.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/ProgenitorMimic.java @@ -29,31 +29,21 @@ package mage.sets.dragonsmaze; import java.util.UUID; import mage.MageInt; -import mage.MageObject; -import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.common.SourceMatchesFilterCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.CopyEffect; +import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect; import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; -import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.permanent.TokenPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; -import mage.util.CardUtil; -import mage.util.functions.ApplyToPermanent; +import mage.util.functions.AbilityApplier; /** * @@ -61,6 +51,12 @@ import mage.util.functions.ApplyToPermanent; */ public class ProgenitorMimic extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("no Token"); + + static { + filter.add(Predicates.not(new TokenPredicate())); + } + public ProgenitorMimic(UUID ownerId) { super(ownerId, 92, "Progenitor Mimic", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{G}{U}"); this.expansionSetCode = "DGM"; @@ -72,11 +68,18 @@ public class ProgenitorMimic extends CardImpl { // You may have Progenitor Mimic enter the battlefield as a copy of any creature on the battlefield // except it gains "At the beginning of your upkeep, if this creature isn't a token, // put a token onto the battlefield that's a copy of this creature." - this.addAbility(new SimpleStaticAbility( - Zone.BATTLEFIELD, - new EntersBattlefieldEffect(new CopyPermanentEffect(new ProgenitorMimicApplyToPermanent()), - "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains \"At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature.\"", - true))); + Effect effect = new PutTokenOntoBattlefieldCopySourceEffect(); + effect.setText("put a token onto the battlefield that's a copy of this creature"); + + AbilityApplier applier = new AbilityApplier( + new ConditionalTriggeredAbility( + new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false), + new SourceMatchesFilterCondition(filter), + "At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature.") + ); + effect = new CopyPermanentEffect(); + effect.setText("as a copy of any creature on the battlefield except it gains \"At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature.\""); + this.addAbility(new EntersBattlefieldAbility(new CopyPermanentEffect(applier), true)); } public ProgenitorMimic(final ProgenitorMimic card) { @@ -88,73 +91,3 @@ public class ProgenitorMimic extends CardImpl { return new ProgenitorMimic(this); } } - -class ProgenitorMimicApplyToPermanent extends ApplyToPermanent { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("no Token"); - static { - filter.add(Predicates.not(new TokenPredicate())); - } - - @Override - public Boolean apply(Game game, Permanent permanent) { - Ability ability = new ConditionalTriggeredAbility( - new BeginningOfUpkeepTriggeredAbility(new ProgenitorMimicCopyEffect(), TargetController.YOU, false), - new SourceMatchesFilterCondition(filter), - "At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature."); - permanent.addAbility(ability, game); - return true; - } -} - -class ProgenitorMimicCopyEffect extends OneShotEffect { - - public ProgenitorMimicCopyEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "put a token onto the battlefield that's a copy of this creature"; - } - - public ProgenitorMimicCopyEffect(final ProgenitorMimicCopyEffect effect) { - super(effect); - } - - @Override - public ProgenitorMimicCopyEffect copy() { - return new ProgenitorMimicCopyEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent copyFromPermanent = null; - // handle copies of copies - for (Effect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) { - if (effect instanceof CopyEffect) { - CopyEffect copyEffect = (CopyEffect) effect; - // there is another copy effect that our targetPermanent copies stats from - if (copyEffect.getSourceId().equals(source.getSourceId())) { - MageObject oldBluePrint = ((CopyEffect) effect).getTarget(); - if (oldBluePrint instanceof Permanent) { - // copy it and apply the applier if any - copyFromPermanent = (Permanent) oldBluePrint; - } - } - } - } - if (copyFromPermanent == null) { - // if it was no copy of copy take the target itself - copyFromPermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); - } - - if (copyFromPermanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(copyFromPermanent); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer) - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - Permanent newPermanentToken = game.getPermanent(token.getLastAddedToken()); - if (newPermanentToken != null) { - game.copyPermanent(copyFromPermanent, newPermanentToken, source, null); - return true; - } - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/RalZarek.java b/Mage.Sets/src/mage/sets/dragonsmaze/RalZarek.java index 829bc093bde..121946e99aa 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/RalZarek.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/RalZarek.java @@ -28,17 +28,15 @@ package mage.sets.dragonsmaze; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.cards.CardImpl; -import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -58,8 +56,7 @@ public class RalZarek extends CardImpl { this.expansionSetCode = "DGM"; this.subtype.add("Ral"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Tap target permanent, then untap another target permanent. LoyaltyAbility ability1 = new LoyaltyAbility(new RalZarekTapUntapEffect(), 1); @@ -86,7 +83,6 @@ public class RalZarek extends CardImpl { } } - class RalZarekTapUntapEffect extends OneShotEffect { public RalZarekTapUntapEffect() { @@ -112,10 +108,10 @@ class RalZarekTapUntapEffect extends OneShotEffect { i++; Permanent permanent = game.getPermanent(targetId); if (permanent != null) { - if (i==1) { + if (i == 1) { permanent.tap(game); } - if (i==2) { + if (i == 2) { permanent.untap(game); } } @@ -146,7 +142,7 @@ class RalZarekExtraTurnsEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (int i=0; i<5; i++) { + for (int i = 0; i < 5; i++) { if (controller.flipCoin(game)) { game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), false)); } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/RenderSilent.java b/Mage.Sets/src/mage/sets/dragonsmaze/RenderSilent.java index 052fb394804..7d819e8b6f9 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/RenderSilent.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/RenderSilent.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.dragonsmaze; import java.util.UUID; @@ -52,11 +51,10 @@ import mage.target.targetpointer.FixedTarget; * * @author LevelX2 */ - - public class RenderSilent extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("multicolored permanent"); + static { filter.add(new MulticoloredPredicate()); } @@ -65,7 +63,6 @@ public class RenderSilent extends CardImpl { super(ownerId, 96, "Render Silent", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{W}{U}{U}"); this.expansionSetCode = "DGM"; - // Counter target spell. Its controller can't cast spells this turn. this.getSpellAbility().addEffect(new RenderSilentCounterEffect()); this.getSpellAbility().addTarget(new TargetSpell()); @@ -139,7 +136,7 @@ class RenderSilentEffect extends ContinuousRuleModifyingEffectImpl { public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't cast spells this turn (" + mageObject.getLogName() + ")."; + return "You can't cast spells this turn (" + mageObject.getIdName() + ")."; } return null; } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/RenegadeKrasis.java b/Mage.Sets/src/mage/sets/dragonsmaze/RenegadeKrasis.java index 6bd8f47bef9..32b2b81941c 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/RenegadeKrasis.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/RenegadeKrasis.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.dragonsmaze; import java.util.UUID; @@ -44,13 +43,10 @@ import mage.filter.predicate.permanent.CounterPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.stack.StackObject; - - public class RenegadeKrasis extends CardImpl { - public RenegadeKrasis (UUID ownerId) { + public RenegadeKrasis(UUID ownerId) { super(ownerId, 47, "Renegade Krasis", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); this.expansionSetCode = "DGM"; this.subtype.add("Beast"); @@ -66,7 +62,7 @@ public class RenegadeKrasis extends CardImpl { this.addAbility(new RenegadeKrasisTriggeredAbility()); } - public RenegadeKrasis (final RenegadeKrasis card) { + public RenegadeKrasis(final RenegadeKrasis card) { super(card); } @@ -80,13 +76,14 @@ public class RenegadeKrasis extends CardImpl { class RenegadeKrasisTriggeredAbility extends TriggeredAbilityImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + static { filter.add(new AnotherPredicate()); filter.add(new CounterPredicate(CounterType.P1P1)); } public RenegadeKrasisTriggeredAbility() { - super(Zone.BATTLEFIELD, new AddCountersAllEffect(CounterType.P1P1.createInstance(1),filter), false); + super(Zone.BATTLEFIELD, new AddCountersAllEffect(CounterType.P1P1.createInstance(1), filter), false); } public RenegadeKrasisTriggeredAbility(final RenegadeKrasisTriggeredAbility ability) { @@ -100,31 +97,16 @@ class RenegadeKrasisTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.COUNTER_ADDED; + return event.getType() == EventType.EVOLVED_CREATURE; } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getTargetId().equals(getSourceId())) { - Object object = game.getState().getValue("EvolveAddCounterActive"); - if (object != null && (Boolean) object) { - StackObject stackObject = game.getStack().getLast(); - if (stackObject.getStackAbility() instanceof EvolveAbility) { - object = game.getState().getValue(this.getId() + "_lastUsedEvolveStackObject"); - if (object != null && ((UUID) object).equals(stackObject.getId())) { - // this evolve was already handled before (prevents to trigger multiple times if counter from evolve is e.g. doubled) - return false; - } - game.getState().setValue(this.getId() + "_lastUsedEvolveStackObject", stackObject.getId()); - return true; - } - } - } - return false; + return event.getTargetId().equals(getSourceId()); } @Override public String getRule() { - return "Whenever Renegade Krasis evolves, put a +1/+1 counter on each other creature you control with a +1/+1 counter on it."; + return "Whenever {this} evolves, put a +1/+1 counter on each other creature you control with a +1/+1 counter on it."; } } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/SavagebornHydra.java b/Mage.Sets/src/mage/sets/dragonsmaze/SavagebornHydra.java index 18a885b82d2..bee58de919f 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/SavagebornHydra.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/SavagebornHydra.java @@ -28,24 +28,18 @@ package mage.sets.dragonsmaze; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.ActivateAsSorceryActivatedAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.DoubleStrikeAbility; import mage.cards.CardImpl; -import mage.constants.Outcome; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -63,10 +57,10 @@ public class SavagebornHydra extends CardImpl { // Double strike this.addAbility(DoubleStrikeAbility.getInstance()); - + // Savageborn Hydra enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new SavageBornHydraEffect(), true)); - + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); + // {1}{RG}: Put a +1/+1 counter on Savageborn Hydra. Activate this ability only any time you could cast a sorcery. this.addAbility(new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{1}{R/G}"))); } @@ -80,37 +74,3 @@ public class SavagebornHydra extends CardImpl { return new SavagebornHydra(this); } } - -class SavageBornHydraEffect extends OneShotEffect { - - public SavageBornHydraEffect() { - super(Outcome.BoostCreature); - staticText = "with X +1/+1 counters on it"; - } - - public SavageBornHydraEffect(final SavageBornHydraEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility)obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public SavageBornHydraEffect copy() { - return new SavageBornHydraEffect(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/ScionOfVituGhazi.java b/Mage.Sets/src/mage/sets/dragonsmaze/ScionOfVituGhazi.java index 1bc24f70cd2..23e1bcc6bdd 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/ScionOfVituGhazi.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/ScionOfVituGhazi.java @@ -29,8 +29,6 @@ package mage.sets.dragonsmaze; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -38,9 +36,10 @@ import mage.abilities.condition.common.CastFromHandCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.PopulateEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.BirdToken; import mage.watchers.common.CastFromHandWatcher; /** @@ -77,17 +76,3 @@ public class ScionOfVituGhazi extends CardImpl { } } - - -class BirdToken extends Token { - public BirdToken() { - super("Bird", "1/1 white Bird creature token with flying"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Bird"); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(FlyingAbility.getInstance()); - setOriginalExpansionSetCode("RTR"); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/SinisterPossession.java b/Mage.Sets/src/mage/sets/dragonsmaze/SinisterPossession.java index a06d7f1042b..961d95af885 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/SinisterPossession.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/SinisterPossession.java @@ -29,19 +29,15 @@ package mage.sets.dragonsmaze; import mage.abilities.Ability; import mage.abilities.common.AttacksOrBlocksEnchantedTriggeredAbility; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.LoseLifeControllerAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -81,61 +77,3 @@ public class SinisterPossession extends CardImpl { return new SinisterPossession(this); } } - -class LoseLifeControllerAttachedEffect extends OneShotEffect { - - protected DynamicValue amount; - - public LoseLifeControllerAttachedEffect(int amount) { - this(new StaticValue(amount)); - } - - public LoseLifeControllerAttachedEffect(DynamicValue amount) { - super(Outcome.Damage); - this.amount = amount; - setText(); - } - - public LoseLifeControllerAttachedEffect(final LoseLifeControllerAttachedEffect effect) { - super(effect); - this.amount = effect.amount.copy(); - } - - @Override - public LoseLifeControllerAttachedEffect copy() { - return new LoseLifeControllerAttachedEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment == null) { - enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - } - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature == null) { - creature = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - } - if (creature != null) { - Player player = game.getPlayer(creature.getControllerId()); - if (player != null) { - player.loseLife(amount.calculate(game, source, this), game); - return true; - } - } - } - return false; - } - - private void setText() { - StringBuilder sb = new StringBuilder(); - sb.append("it's controller loses ").append(amount.toString()).append(" life"); - String message = amount.getMessage(); - if (message.length() > 0) { - sb.append(" for each "); - sb.append(message); - } - staticText = sb.toString(); - } -} diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/SmeltWardGatekeepers.java b/Mage.Sets/src/mage/sets/dragonsmaze/SmeltWardGatekeepers.java index 95f3582d94d..e79e5ae9797 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/SmeltWardGatekeepers.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/SmeltWardGatekeepers.java @@ -70,7 +70,7 @@ public class SmeltWardGatekeepers extends CardImpl { super(ownerId, 39, "Smelt-Ward Gatekeepers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.expansionSetCode = "DGM"; this.subtype.add("Human"); - this.subtype.add("Soldier"); + this.subtype.add("Warrior"); this.power = new MageInt(2); this.toughness = new MageInt(4); diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/UbulSarGatekeepers.java b/Mage.Sets/src/mage/sets/dragonsmaze/UbulSarGatekeepers.java index 16ff85ae354..3bc76090b02 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/UbulSarGatekeepers.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/UbulSarGatekeepers.java @@ -25,21 +25,20 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.dragonsmaze; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TargetController; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; -import mage.counters.CounterType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -51,18 +50,17 @@ import mage.target.common.TargetCreaturePermanent; * * @author LevelX2 */ - - public class UbulSarGatekeepers extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent(); private static final FilterCreaturePermanent targetFilter = new FilterCreaturePermanent("creature an opponent controls"); + static { filter.add(new SubtypePredicate("Gate")); targetFilter.add(new ControllerPredicate(TargetController.OPPONENT)); } - public UbulSarGatekeepers (UUID ownerId) { + public UbulSarGatekeepers(UUID ownerId) { super(ownerId, 30, "Ubul Sar Gatekeepers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); this.expansionSetCode = "DGM"; this.subtype.add("Zombie"); @@ -73,7 +71,7 @@ public class UbulSarGatekeepers extends CardImpl { // Whenever Ubul Sar Gatekeepers enters the battlefield, if you control two or more Gates, target creature an opponent controls gets -2/-2 until end of turn. Ability ability = new ConditionalTriggeredAbility( - new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance(2))), + new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(-2, -2, Duration.EndOfTurn)), new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1), "Whenever {this} enters the battlefield, if you control two or more Gates, target creature an opponent controls gets -2/-2 until end of turn."); Target target = new TargetCreaturePermanent(targetFilter); @@ -81,7 +79,7 @@ public class UbulSarGatekeepers extends CardImpl { this.addAbility(ability); } - public UbulSarGatekeepers (final UbulSarGatekeepers card) { + public UbulSarGatekeepers(final UbulSarGatekeepers card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/VoiceOfResurgence.java b/Mage.Sets/src/mage/sets/dragonsmaze/VoiceOfResurgence.java index 8bebbae8f2e..6e76865f938 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/VoiceOfResurgence.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/VoiceOfResurgence.java @@ -104,7 +104,7 @@ class VoiceOfResurgenceTriggeredAbility extends TriggeredAbilityImpl { return true; } } - // Voice Of Resurgence Dies + // Voice of Resurgence Dies if (event.getType() == GameEvent.EventType.ZONE_CHANGE && getSourceId().equals(event.getTargetId())) { ZoneChangeEvent zce = (ZoneChangeEvent) event; return zce.getFromZone().equals(Zone.BATTLEFIELD) && zce.getToZone().equals(Zone.GRAVEYARD); diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/AssaultFormation.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/AssaultFormation.java index 75a189ac7a7..cc4aa550478 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/AssaultFormation.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/AssaultFormation.java @@ -1,127 +1,127 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.dragonsoftarkir; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderTargetEffect; -import mage.abilities.effects.common.continuous.BoostControlledEffect; -import mage.abilities.keyword.DefenderAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.AbilityPredicate; -import mage.filter.predicate.permanent.ControllerIdPredicate; -import mage.game.Game; -import mage.target.common.TargetCreaturePermanent; - -/** - * - * @author LevelX2 - */ -public class AssaultFormation extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with defender"); - - static { - filter.add(new AbilityPredicate(DefenderAbility.class)); - } - - public AssaultFormation(UUID ownerId) { - super(ownerId, 173, "Assault Formation", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); - this.expansionSetCode = "DTK"; - - // Each creature you control assigns combat damage equal to its toughness rather than its power. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AssaultFormationCombatDamageRuleEffect())); - - // {G}: Target creature with defender can attack this turn as though it didn't have defender. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughtItDidntHaveDefenderTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{G}")); - ability.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(ability); - - // {2}{G}: Creatures you control get +0/+1 until end of turn. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0,1,Duration.EndOfTurn), new ManaCostsImpl("{2}{G}"))); - - } - - public AssaultFormation(final AssaultFormation card) { - super(card); - } - - @Override - public AssaultFormation copy() { - return new AssaultFormation(this); - } -} - -class AssaultFormationCombatDamageRuleEffect extends ContinuousEffectImpl { - - public AssaultFormationCombatDamageRuleEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Each creature you control assigns combat damage equal to its toughness rather than its power"; - } - - public AssaultFormationCombatDamageRuleEffect(final AssaultFormationCombatDamageRuleEffect effect) { - super(effect); - } - - @Override - public AssaultFormationCombatDamageRuleEffect copy() { - return new AssaultFormationCombatDamageRuleEffect(this); - } - - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - // Change the rule - FilterCreaturePermanent filter = new FilterCreaturePermanent(); - filter.add(new ControllerIdPredicate(source.getControllerId())); - game.getCombat().setUseToughnessForDamage(true); - game.getCombat().addUseToughnessForDamageFilter(filter); - return true; - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.RulesEffects; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dragonsoftarkir; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderTargetEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class AssaultFormation extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with defender"); + + static { + filter.add(new AbilityPredicate(DefenderAbility.class)); + } + + public AssaultFormation(UUID ownerId) { + super(ownerId, 173, "Assault Formation", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + this.expansionSetCode = "DTK"; + + // Each creature you control assigns combat damage equal to its toughness rather than its power. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AssaultFormationCombatDamageRuleEffect())); + + // {G}: Target creature with defender can attack this turn as though it didn't have defender. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{G}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + + // {2}{G}: Creatures you control get +0/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0,1,Duration.EndOfTurn), new ManaCostsImpl("{2}{G}"))); + + } + + public AssaultFormation(final AssaultFormation card) { + super(card); + } + + @Override + public AssaultFormation copy() { + return new AssaultFormation(this); + } +} + +class AssaultFormationCombatDamageRuleEffect extends ContinuousEffectImpl { + + public AssaultFormationCombatDamageRuleEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "Each creature you control assigns combat damage equal to its toughness rather than its power"; + } + + public AssaultFormationCombatDamageRuleEffect(final AssaultFormationCombatDamageRuleEffect effect) { + super(effect); + } + + @Override + public AssaultFormationCombatDamageRuleEffect copy() { + return new AssaultFormationCombatDamageRuleEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + // Change the rule + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + filter.add(new ControllerIdPredicate(source.getControllerId())); + game.getCombat().setUseToughnessForDamage(true); + game.getCombat().addUseToughnessForDamageFilter(filter); + return true; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.RulesEffects; + } +} diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/CloneLegion.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/CloneLegion.java index 6225c113df0..bda88f79158 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/CloneLegion.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/CloneLegion.java @@ -30,6 +30,7 @@ package mage.sets.dragonsoftarkir; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -37,10 +38,9 @@ import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.players.Player; import mage.target.TargetPlayer; -import mage.util.CardUtil; +import mage.target.targetpointer.FixedTarget; /** * @@ -91,9 +91,9 @@ class CloneLegionEffect extends OneShotEffect { if (controller != null && targetPlayer != null) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), targetPlayer.getId(), game)) { if (permanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - token.putOntoBattlefield(1, game, source.getSourceId(), controller.getId()); + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); + effect.setTargetPointer(new FixedTarget(permanent, game)); + effect.apply(game, source); } } return true; diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/CommuneWithLava.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/CommuneWithLava.java index 89fe50de8f2..a820a9d6938 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/CommuneWithLava.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/CommuneWithLava.java @@ -151,10 +151,8 @@ class CommuneWithLavaMayPlayEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (targetPointer.getTargets(game, source).contains(sourceId)) { - return game.getState().getZone(sourceId).equals(Zone.EXILED); - } - return false; + return source.getControllerId().equals(affectedControllerId) + && getTargetPointer().getTargets(game, source).contains(sourceId); } } diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/DeadlyWanderings.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/DeadlyWanderings.java index dbedd9f34b6..02dca44575a 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/DeadlyWanderings.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/DeadlyWanderings.java @@ -43,6 +43,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; /** * @@ -59,10 +60,10 @@ public class DeadlyWanderings extends CardImpl { Effect effect = new ConditionalContinuousEffect(boostEffect, new OneControlledCreatureCondition(), "As long as you control exactly one creature, that creature gets +2/+0"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); - ContinuousEffect deathtouchEffect = new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield); + ContinuousEffect deathtouchEffect = new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()); effect = new ConditionalContinuousEffect(deathtouchEffect, new OneControlledCreatureCondition(), "and has deathtouch"); ability.addEffect(effect); - ContinuousEffect lifelinkEffect = new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.WhileOnBattlefield); + ContinuousEffect lifelinkEffect = new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()); effect = new ConditionalContinuousEffect(lifelinkEffect, new OneControlledCreatureCondition(), "and lifelink"); ability.addEffect(effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/DeathmistRaptor.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/DeathmistRaptor.java index 098a319ff68..629a1e35e6a 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/DeathmistRaptor.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/DeathmistRaptor.java @@ -101,9 +101,9 @@ class DeathmistRaptorEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObjectIfItStillExists(game); if (controller != null && (sourceObject instanceof Card)) { - controller.putOntoBattlefieldWithInfo((Card) sourceObject, game, Zone.GRAVEYARD, source.getSourceId(), false, - controller.chooseUse(Outcome.Detriment, "Return " + sourceObject.getLogName() + " face down to battlefield (otherwise face up)?", source, game)); - return true; + return controller.moveCards((Card) sourceObject, Zone.BATTLEFIELD, source, game, false, + controller.chooseUse(Outcome.Detriment, "Return " + sourceObject.getLogName() + " face down to battlefield (otherwise face up)?", source, game), + false, null); } return false; } diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/DragonlordSilumgar.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/DragonlordSilumgar.java index 75905fc5777..72e12b1244f 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/DragonlordSilumgar.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/DragonlordSilumgar.java @@ -33,14 +33,21 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition; import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainControlTargetEffect; -import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Outcome; import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; import mage.target.common.TargetCreatureOrPlaneswalker; +import mage.util.CardUtil; +import mage.util.GameLog; /** * @@ -59,17 +66,15 @@ public class DragonlordSilumgar extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // Deathtouch this.addAbility(DeathtouchAbility.getInstance()); - + // When Dragonlord Silumgar enters the battlefield, gain control of target creature or planeswalker for as long as you control Dragonlord Silumgar. - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), new SourceOnBattlefieldControlUnchangedCondition(), null); - effect.setText("gain control of target creature or planeswalker for as long as you control {this}"); - Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); + Ability ability = new EntersBattlefieldTriggeredAbility(new DragonlordSilumgarEffect(), false); ability.addTarget(new TargetCreatureOrPlaneswalker()); this.addAbility(ability); - + } public DragonlordSilumgar(final DragonlordSilumgar card) { @@ -81,3 +86,36 @@ public class DragonlordSilumgar extends CardImpl { return new DragonlordSilumgar(this); } } + +class DragonlordSilumgarEffect extends OneShotEffect { + + public DragonlordSilumgarEffect() { + super(Outcome.GainControl); + this.staticText = "gain control of target creature or planeswalker for as long as you control {this}"; + } + + public DragonlordSilumgarEffect(final DragonlordSilumgarEffect effect) { + super(effect); + } + + @Override + public DragonlordSilumgarEffect copy() { + return new DragonlordSilumgarEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + Player controller = game.getPlayer(source.getControllerId()); + Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (controller != null && sourcePermanent != null && target != null + && controller.getId().equals(sourcePermanent.getControllerId())) { + game.addEffect(new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), new SourceOnBattlefieldControlUnchangedCondition(), null), source); + if (!game.isSimulation()) { + game.informPlayers(sourcePermanent.getLogName() + ": " + controller.getLogName() + " gained control of " + target.getLogName()); + } + sourcePermanent.addInfo("gained control of", CardUtil.addToolTipMarkTags("Gained control of: " + GameLog.getColoredObjectIdNameForTooltip(target)), game); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/DromokasCommand.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/DromokasCommand.java index 70f308bde33..ef4a3a3af64 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/DromokasCommand.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/DromokasCommand.java @@ -40,14 +40,12 @@ import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.TargetController; import mage.counters.CounterType; -import mage.filter.FilterStackObject; import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterEnchantmentPermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterInstantOrSorcerySpell; import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPlayer; -import mage.target.TargetStackObject; +import mage.target.TargetSpell; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -57,15 +55,11 @@ import mage.target.common.TargetCreaturePermanent; */ public class DromokasCommand extends CardImpl { - private static final FilterStackObject filterInstantOrSorcery = new FilterStackObject("instant or sorcery spell"); private static final FilterEnchantmentPermanent filterEnchantment = new FilterEnchantmentPermanent("an enchantment"); private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("creature to put a +1/+1 counter on it"); private static final FilterCreaturePermanent filterUncontrolledCreature = new FilterCreaturePermanent("creature you don't control"); static { - filterInstantOrSorcery.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - filterUncontrolledCreature.add(new ControllerPredicate(TargetController.NOT_YOU)); } @@ -79,9 +73,9 @@ public class DromokasCommand extends CardImpl { // Prevent all damage target instant or sorcery spell would deal this turn; this.getSpellAbility().getEffects().add(new PreventDamageByTargetEffect(Duration.EndOfTurn)); - this.getSpellAbility().getTargets().add(new TargetStackObject(filterInstantOrSorcery)); + this.getSpellAbility().getTargets().add(new TargetSpell(new FilterInstantOrSorcerySpell())); - // or Target player sacrifices an enchantment; + // or Target player sacrifices an enchantment; Mode mode = new Mode(); Effect effect = new SacrificeEffect(filterEnchantment, 1, "target player"); effect.setText("Target player sacrifices an enchantment"); diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/EnduringScalelord.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/EnduringScalelord.java index a73926993d6..92ea2e6444a 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/EnduringScalelord.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/EnduringScalelord.java @@ -92,12 +92,15 @@ class EnduringScalelordTriggeredAbility extends TriggeredAbilityImpl { return event.getType() == GameEvent.EventType.COUNTERS_ADDED; } - @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getData().equals(CounterType.P1P1.getName())) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - return (!event.getTargetId().equals(this.getSourceId()) + if (permanent == null) { + permanent = game.getPermanentEntering(event.getTargetId()); + } + return (permanent != null + && !event.getTargetId().equals(this.getSourceId()) && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId())); } diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/GladeWatcher.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/GladeWatcher.java index 964d318d109..25e776fc6af 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/GladeWatcher.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/GladeWatcher.java @@ -1,79 +1,78 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.dragonsoftarkir; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.ActivateIfConditionActivatedAbility; -import mage.abilities.condition.common.FormidableCondition; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; -import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.keyword.DefenderAbility; -import mage.cards.CardImpl; -import mage.constants.AbilityWord; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; - -/** - * - * @author LevelX2 - */ -public class GladeWatcher extends CardImpl { - - public GladeWatcher(UUID ownerId) { - super(ownerId, 188, "Glade Watcher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); - this.expansionSetCode = "DTK"; - this.subtype.add("Elemental"); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - - // Defender - this.addAbility(DefenderAbility.getInstance()); - // Formidable - {G}: Glade Watcher can attack this turn as though it didn't have defender. Activate this ability only if creatures you control have total power 8 or greater. - Ability ability = new ActivateIfConditionActivatedAbility( - Zone.BATTLEFIELD, - new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), - new ManaCostsImpl("{G}"), - FormidableCondition.getInstance()); - ability.setAbilityWord(AbilityWord.FORMIDABLE); - this.addAbility(ability); - } - - public GladeWatcher(final GladeWatcher card) { - super(card); - } - - @Override - public GladeWatcher copy() { - return new GladeWatcher(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dragonsoftarkir; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.FormidableCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class GladeWatcher extends CardImpl { + + public GladeWatcher(UUID ownerId) { + super(ownerId, 188, "Glade Watcher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "DTK"; + this.subtype.add("Elemental"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Formidable - {G}: Glade Watcher can attack this turn as though it didn't have defender. Activate this ability only if creatures you control have total power 8 or greater. + Ability ability = new ActivateIfConditionActivatedAbility( + Zone.BATTLEFIELD, + new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), + new ManaCostsImpl("{G}"), + FormidableCondition.getInstance()); + ability.setAbilityWord(AbilityWord.FORMIDABLE); + this.addAbility(ability); + } + + public GladeWatcher(final GladeWatcher card) { + super(card); + } + + @Override + public GladeWatcher copy() { + return new GladeWatcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/IreShaman.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/IreShaman.java index 864a66b66dc..e24b8c59f97 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/IreShaman.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/IreShaman.java @@ -44,10 +44,8 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.players.Library; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -67,10 +65,10 @@ public class IreShaman extends CardImpl { // Menace (This creature can't be blocked except by two or more creatures.) this.addAbility(new MenaceAbility()); - + // Megamorph {R} this.addAbility(new MorphAbility(this, new ManaCostsImpl("{R}"), true)); - + // When Ire Shaman is turned face up, exile the top card of your library. Until end of turn, you may play that card. this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new IreShamanExileEffect(), false)); } @@ -106,11 +104,10 @@ class IreShamanExileEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (sourcePermanent != null && controller != null && controller.getLibrary().size() > 0) { - Library library = controller.getLibrary(); - Card card = library.removeFromTop(game); + Card card = controller.getLibrary().getFromTop(game); if (card != null) { - String exileName = new StringBuilder(sourcePermanent.getIdName()).append(" ").toString(); - controller.moveCardToExileWithInfo(card, source.getSourceId(), exileName, source.getSourceId(), game, Zone.LIBRARY, true); + String exileName = sourcePermanent.getIdName() + " "; + controller.moveCardsToExile(card, source, game, true, source.getSourceId(), exileName); ContinuousEffect effect = new IreShamanCastFromExileEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); @@ -144,7 +141,7 @@ class IreShamanCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) && - objectId.equals(getTargetPointer().getFirst(game, source)); + return source.getControllerId().equals(affectedControllerId) + && objectId.equals(getTargetPointer().getFirst(game, source)); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/LivingLore.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/LivingLore.java index 627a332ce4b..354d93ddef3 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/LivingLore.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/LivingLore.java @@ -71,7 +71,7 @@ public class LivingLore extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new LivingLoreExileEffect(), "exile an instant or sorcery card from your graveyard")); // Living Lore's power and toughness are each equal to the exiled card's converted mana cost. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LivingLoreSetPowerToughnessSourceEffect())); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new LivingLoreSetPowerToughnessSourceEffect())); // Whenever Living Lore deals combat damage, you may sacrifice it. If you do, you may cast the exiled card without paying its mana cost. this.addAbility(new DealsCombatDamageTriggeredAbility(new LivingLoreSacrificeEffect(), true)); @@ -106,14 +106,14 @@ class LivingLoreExileEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - MageObject sourceObject = source.getSourceObject(game); - if (sourceObject != null && controller != null){ + Permanent sourcePermanent = game.getPermanentEntering(source.getSourceId()); + if (sourcePermanent != null && controller != null) { TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(new FilterInstantOrSorceryCard("instant or sorcery card from your graveyard")); if (controller.chooseTarget(outcome, target, source, game)) { - UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); + UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), game.getState().getZoneChangeCounter(source.getSourceId()) + 1); Card card = controller.getGraveyard().get(target.getFirstTarget(), game); if (card != null) { - controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.GRAVEYARD, true); + controller.moveCardsToExile(card, source, game, true, exileId, sourcePermanent.getIdName()); } } return true; @@ -126,7 +126,7 @@ class LivingLoreExileEffect extends OneShotEffect { class LivingLoreSetPowerToughnessSourceEffect extends ContinuousEffectImpl { public LivingLoreSetPowerToughnessSourceEffect() { - super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); + super(Duration.Custom, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); staticText = "{this}'s power and toughness are each equal to the exiled card's converted mana cost"; } @@ -141,20 +141,23 @@ class LivingLoreSetPowerToughnessSourceEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - MageObject mageObject = source.getSourceObject(game); Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && mageObject == null && new MageObjectReference(permanent, game).refersTo(mageObject, game)) { - discard(); - return false; + int zcc = game.getState().getZoneChangeCounter(source.getSourceId()); + if (permanent == null) { + permanent = game.getPermanentEntering(source.getSourceId()); + zcc++; } - UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); + if (permanent == null) { + return true; + } + UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), zcc); if (exileId != null) { ExileZone exileZone = game.getExile().getExileZone(exileId); if (exileZone == null) { return false; } Card exiledCard = null; - for (Card card :exileZone.getCards(game)) { + for (Card card : exileZone.getCards(game)) { exiledCard = card; break; } @@ -197,7 +200,7 @@ class LivingLoreSacrificeEffect extends OneShotEffect { ExileZone exileZone = game.getExile().getExileZone(exileId); Card exiledCard = null; if (exileZone != null) { - for (Card card :exileZone.getCards(game)) { + for (Card card : exileZone.getCards(game)) { exiledCard = card; break; } diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/MirrorMockery.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/MirrorMockery.java index ef10e70c1de..f43c40388d0 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/MirrorMockery.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/MirrorMockery.java @@ -35,6 +35,7 @@ import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.AttachmentType; @@ -43,11 +44,9 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; -import mage.util.CardUtil; /** * @@ -105,18 +104,20 @@ class MirrorMockeryEffect extends OneShotEffect { } Permanent enchanted = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo()); if (enchanted != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(enchanted); - - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); + effect.setTargetPointer(new FixedTarget(enchanted, game)); + effect.apply(game, source); + for (Permanent addedToken : effect.getAddedPermanent()) { + if (addedToken != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(addedToken, game)); + DelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } + } return true; } return false; diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/NarsetTranscendent.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/NarsetTranscendent.java index 639d3f36c38..3873609cb39 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/NarsetTranscendent.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/NarsetTranscendent.java @@ -32,7 +32,7 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; @@ -40,7 +40,6 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.GetEmblemEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.ReboundAbility; import mage.cards.Card; import mage.cards.CardImpl; @@ -52,7 +51,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.counters.CounterType; import mage.game.Game; import mage.game.command.Emblem; import mage.game.events.GameEvent; @@ -71,7 +69,7 @@ public class NarsetTranscendent extends CardImpl { this.expansionSetCode = "DTK"; this.subtype.add("Narset"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6)); // +1: Look at the top card of your library. If it's a noncreature, nonland card, you may reveal it and put it into your hand. this.addAbility(new LoyaltyAbility(new NarsetTranscendentEffect1(), 1)); diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/SarkhanUnbroken.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/SarkhanUnbroken.java index 095e054558d..daf2b769358 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/SarkhanUnbroken.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/SarkhanUnbroken.java @@ -33,10 +33,9 @@ import java.util.UUID; import mage.Mana; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.choices.Choice; @@ -44,7 +43,6 @@ import mage.choices.ChoiceImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; @@ -69,7 +67,7 @@ public class SarkhanUnbroken extends CardImpl { this.expansionSetCode = "DTK"; this.subtype.add("Sarkhan"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Draw a card, then add one mana of any color to your mana pool. this.addAbility(new LoyaltyAbility(new SarkhanUnbrokenAbility1(), 1)); @@ -127,26 +125,26 @@ class SarkhanUnbrokenAbility1 extends OneShotEffect { Mana mana = new Mana(); controller.choose(Outcome.Benefit, manaChoice, game); - + if (manaChoice.getChoice() == null) { return false; } switch (manaChoice.getChoice()) { case "White": - mana.addWhite(); + mana.increaseWhite(); break; case "Blue": - mana.addBlue(); + mana.increaseBlue(); break; case "Black": - mana.addBlack(); + mana.increaseBlack(); break; case "Red": - mana.addRed(); + mana.increaseRed(); break; case "Green": - mana.addGreen(); + mana.increaseGreen(); break; } diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/SecureTheWastes.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/SecureTheWastes.java index 0f3666570af..102d77a2e78 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/SecureTheWastes.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/SecureTheWastes.java @@ -28,13 +28,12 @@ package mage.sets.dragonsoftarkir; import java.util.UUID; -import mage.MageInt; import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.WarriorToken; /** * @@ -47,7 +46,7 @@ public class SecureTheWastes extends CardImpl { this.expansionSetCode = "DTK"; // Put X 1/1 white Warrior creature tokens onto the battlefield. - this.getSpellAbility().addEffect(new CreateTokenEffect(new SecureTheWastesToken(), new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new WarriorToken(), new ManacostVariableValue())); } public SecureTheWastes(final SecureTheWastes card) { @@ -59,17 +58,3 @@ public class SecureTheWastes extends CardImpl { return new SecureTheWastes(this); } } - -class SecureTheWastesToken extends Token { - - SecureTheWastesToken() { - super("Warrior", "1/1 white Warrior creature token"); - this.setOriginalExpansionSetCode("DTK"); - cardType.add(CardType.CREATURE); - subtype.add("Warrior"); - - color.setWhite(true); - power = new MageInt(1); - toughness = new MageInt(1); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/SwiftWarkite.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/SwiftWarkite.java index 7cf4b87280b..bfd5b48ff0d 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/SwiftWarkite.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/SwiftWarkite.java @@ -122,7 +122,7 @@ class SwiftWarkiteEffect extends OneShotEffect { controller.choose(outcome, target, source.getSourceId(), game); Card card = controller.getHand().get(target.getFirstTarget(), game); if (card != null) { - if (controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId())) { + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent creature = game.getPermanent(card.getId()); if (creature != null) { ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); @@ -143,7 +143,7 @@ class SwiftWarkiteEffect extends OneShotEffect { target.choose(Outcome.PutCardInPlay, source.getControllerId(), source.getSourceId(), game); Card card = controller.getGraveyard().get(target.getFirstTarget(), game); if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); Permanent creature = game.getPermanent(card.getId()); if (creature != null) { ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); diff --git a/Mage.Sets/src/mage/sets/eighthedition/RukhEgg.java b/Mage.Sets/src/mage/sets/eighthedition/RukhEgg.java index 88bff7441dd..63122fceb5d 100644 --- a/Mage.Sets/src/mage/sets/eighthedition/RukhEgg.java +++ b/Mage.Sets/src/mage/sets/eighthedition/RukhEgg.java @@ -34,7 +34,7 @@ import mage.constants.Rarity; * * @author anonymous */ -public class RukhEgg extends mage.sets.arabiannights.RukhEgg { +public class RukhEgg extends mage.sets.arabiannights.RukhEgg1 { public RukhEgg(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/elvesvsgoblins/AmbushCommander.java b/Mage.Sets/src/mage/sets/elvesvsgoblins/AmbushCommander.java index 673340d63a6..dc7ab7e9742 100644 --- a/Mage.Sets/src/mage/sets/elvesvsgoblins/AmbushCommander.java +++ b/Mage.Sets/src/mage/sets/elvesvsgoblins/AmbushCommander.java @@ -34,10 +34,12 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; @@ -71,12 +73,13 @@ public class AmbushCommander extends CardImpl { this.toughness = new MageInt(2); // Forests you control are 1/1 green Elf creatures that are still lands. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new AmbushCommanderToken(), - "lands", filter2, Duration.WhileOnBattlefield))); + ContinuousEffect effect = new BecomesCreatureAllEffect(new AmbushCommanderToken(), "lands", filter2, Duration.WhileOnBattlefield); + effect.getDependencyTypes().add(DependencyType.BecomeForest); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // {1}{G}, Sacrifice an Elf: Target creature gets +3/+3 until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(3,3, Duration.EndOfTurn), - new ManaCostsImpl("{1}{G}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1, filter, true))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(3, 3, Duration.EndOfTurn), + new ManaCostsImpl("{1}{G}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } @@ -92,6 +95,7 @@ public class AmbushCommander extends CardImpl { } class AmbushCommanderToken extends Token { + public AmbushCommanderToken() { super("Elf", "1/1 green Elf creatures"); subtype.add("Elf"); diff --git a/Mage.Sets/src/mage/sets/elvesvsgoblins/SkirkDrillSergeant.java b/Mage.Sets/src/mage/sets/elvesvsgoblins/SkirkDrillSergeant.java index fc751e65248..c5abcd76b27 100644 --- a/Mage.Sets/src/mage/sets/elvesvsgoblins/SkirkDrillSergeant.java +++ b/Mage.Sets/src/mage/sets/elvesvsgoblins/SkirkDrillSergeant.java @@ -1,133 +1,129 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.elvesvsgoblins; - -import java.util.UUID; -import mage.MageInt; -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.common.DiesCreatureTriggeredAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DoIfCostPaid; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.common.FilterPermanentCard; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.players.Player; - -/** - * - * @author LevelX2 - */ -public class SkirkDrillSergeant extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("{this} or another Goblin"); - - static { - filter.add(new SubtypePredicate("Goblin")); - } - - public SkirkDrillSergeant(UUID ownerId) { - super(ownerId, 49, "Skirk Drill Sergeant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); - this.expansionSetCode = "EVG"; - this.subtype.add("Goblin"); - - this.power = new MageInt(2); - this.toughness = new MageInt(1); - - // Whenever Skirk Drill Sergeant or another Goblin dies, you may pay {2}{R}. If you do, reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard. - this.addAbility(new DiesCreatureTriggeredAbility(new DoIfCostPaid(new SkirkDrillSergeantEffect(), new ManaCostsImpl("{2}{R}")), false, filter)); - - } - - public SkirkDrillSergeant(final SkirkDrillSergeant card) { - super(card); - } - - @Override - public SkirkDrillSergeant copy() { - return new SkirkDrillSergeant(this); - } -} - -class SkirkDrillSergeantEffect extends OneShotEffect { - - private static final FilterPermanentCard filter = new FilterPermanentCard("Goblin permanent card"); - - static { - filter.add(new SubtypePredicate("Goblin")); - } - - public SkirkDrillSergeantEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard"; - } - - public SkirkDrillSergeantEffect(final SkirkDrillSergeantEffect effect) { - super(effect); - } - - @Override - public SkirkDrillSergeantEffect copy() { - return new SkirkDrillSergeantEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - MageObject sourceObject = game.getObject(source.getSourceId()); - if (player == null || sourceObject == null) { - return false; - } - - if (player.getLibrary().size() > 0) { - Card card = player.getLibrary().getFromTop(game); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards(sourceObject.getName(), cards, game); - - if (card != null) { - if (filter.match(card, game)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); - } else { - player.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); - } - } - } - return true; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.elvesvsgoblins; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class SkirkDrillSergeant extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("{this} or another Goblin"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public SkirkDrillSergeant(UUID ownerId) { + super(ownerId, 49, "Skirk Drill Sergeant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "EVG"; + this.subtype.add("Goblin"); + + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Whenever Skirk Drill Sergeant or another Goblin dies, you may pay {2}{R}. If you do, reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard. + this.addAbility(new DiesThisOrAnotherCreatureTriggeredAbility(new DoIfCostPaid(new SkirkDrillSergeantEffect(), new ManaCostsImpl("{2}{R}")), false, filter)); + + } + + public SkirkDrillSergeant(final SkirkDrillSergeant card) { + super(card); + } + + @Override + public SkirkDrillSergeant copy() { + return new SkirkDrillSergeant(this); + } +} + +class SkirkDrillSergeantEffect extends OneShotEffect { + + private static final FilterPermanentCard filter = new FilterPermanentCard("Goblin permanent card"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public SkirkDrillSergeantEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard"; + } + + public SkirkDrillSergeantEffect(final SkirkDrillSergeantEffect effect) { + super(effect); + } + + @Override + public SkirkDrillSergeantEffect copy() { + return new SkirkDrillSergeantEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller == null || sourceObject == null) { + return false; + } + + if (controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().getFromTop(game); + controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); + if (card != null) { + if (filter.match(card, game)) { + controller.moveCards(card, Zone.BATTLEFIELD, source, game); + } else { + controller.moveCards(card, Zone.GRAVEYARD, source, game); + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java b/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java index 3b525f22126..e8fbba42e5e 100644 --- a/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java +++ b/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.eventide; import java.util.UUID; @@ -51,19 +50,20 @@ import mage.target.common.TargetCreaturePermanent; */ public class AshlingTheExtinguisher extends CardImpl { - public AshlingTheExtinguisher (UUID ownerId) { + public AshlingTheExtinguisher(UUID ownerId) { super(ownerId, 33, "Ashling, the Extinguisher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); this.expansionSetCode = "EVE"; this.supertype.add("Legendary"); this.subtype.add("Elemental"); this.subtype.add("Shaman"); + // Whenever Ashling, the Extinguisher deals combat damage to a player, choose target creature that player controls. He or she sacrifices that creature. this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(new AshlingTheExtinguisherTriggeredAbility()); } - public AshlingTheExtinguisher (final AshlingTheExtinguisher card) { + public AshlingTheExtinguisher(final AshlingTheExtinguisher card) { super(card); } @@ -75,6 +75,7 @@ public class AshlingTheExtinguisher extends CardImpl { } class AshlingTheExtinguisherTriggeredAbility extends TriggeredAbilityImpl { + public AshlingTheExtinguisherTriggeredAbility() { super(Zone.BATTLEFIELD, new SacrificeTargetEffect()); this.addTarget(new TargetCreaturePermanent()); @@ -115,4 +116,4 @@ class AshlingTheExtinguisherTriggeredAbility extends TriggeredAbilityImpl { public String getRule() { return "Whenever {this} deals combat damage to a player, choose target creature that player controls. He or she sacrifices that creature."; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/eventide/BattlegateMimic.java b/Mage.Sets/src/mage/sets/eventide/BattlegateMimic.java index f109141e065..f531d0c82b0 100644 --- a/Mage.Sets/src/mage/sets/eventide/BattlegateMimic.java +++ b/Mage.Sets/src/mage/sets/eventide/BattlegateMimic.java @@ -39,6 +39,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.ColorPredicate; @@ -47,14 +48,14 @@ import mage.filter.predicate.mageobject.ColorPredicate; * @author jeffwadsworth */ public class BattlegateMimic extends CardImpl { - + private static final FilterSpell filter = new FilterSpell("a spell that's both red and white"); - + static { filter.add(new ColorPredicate(ObjectColor.RED)); filter.add(new ColorPredicate(ObjectColor.WHITE)); } - + private String rule = "Whenever you cast a spell that's both red and white, {this} has base power and toughness 4/2 and gains first strike until end of turn."; public BattlegateMimic(UUID ownerId) { @@ -66,10 +67,10 @@ public class BattlegateMimic extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast a spell that's both red and white, Battlegate Mimic has base power and toughness 4/2 and gains first strike until end of turn. - Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(4, 2, Duration.EndOfTurn), filter, false, rule); + Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(4, 2, Duration.EndOfTurn, SubLayer.SetPT_7b), filter, false, rule); ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, false, true)); this.addAbility(ability); - + } public BattlegateMimic(final BattlegateMimic card) { diff --git a/Mage.Sets/src/mage/sets/eventide/BloodiedGhost.java b/Mage.Sets/src/mage/sets/eventide/BloodiedGhost.java index 2d046b50dfa..dd8ae7ec4ba 100644 --- a/Mage.Sets/src/mage/sets/eventide/BloodiedGhost.java +++ b/Mage.Sets/src/mage/sets/eventide/BloodiedGhost.java @@ -29,13 +29,13 @@ package mage.sets.eventide; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.counters.CounterType; /** @@ -48,12 +48,15 @@ public class BloodiedGhost extends CardImpl { super(ownerId, 83, "Bloodied Ghost", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W/B}{W/B}"); this.expansionSetCode = "EVE"; this.subtype.add("Spirit"); - - this.power = new MageInt(3); this.toughness = new MageInt(3); + + // Flying this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance()), "Bloodied Ghost gets a -1/-1 counter")); + + // Bloodied Ghost enters the battlefield with a -1/-1 counter on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance()), + "with a -1/-1 counter on it.")); } public BloodiedGhost (final BloodiedGhost card) { diff --git a/Mage.Sets/src/mage/sets/eventide/BloomTender.java b/Mage.Sets/src/mage/sets/eventide/BloomTender.java index f4544ddc232..ecadab68f71 100644 --- a/Mage.Sets/src/mage/sets/eventide/BloomTender.java +++ b/Mage.Sets/src/mage/sets/eventide/BloomTender.java @@ -107,19 +107,19 @@ class BloomTenderEffect extends ManaEffect { Mana mana = new Mana(); for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) { if (mana.getBlack() == 0 && permanent.getColor(game).isBlack()) { - mana.addBlack(); + mana.increaseBlack(); } if (mana.getBlue() == 0 && permanent.getColor(game).isBlue()) { - mana.addBlue(); + mana.increaseBlue(); } if (mana.getRed() == 0 && permanent.getColor(game).isRed()) { - mana.addRed(); + mana.increaseRed(); } if (mana.getGreen() == 0 && permanent.getColor(game).isGreen()) { - mana.addGreen(); + mana.increaseGreen(); } if (mana.getWhite() == 0 && permanent.getColor(game).isWhite()) { - mana.addWhite(); + mana.increaseWhite(); } } return mana; diff --git a/Mage.Sets/src/mage/sets/eventide/CankerAbomination.java b/Mage.Sets/src/mage/sets/eventide/CankerAbomination.java index 5b8107dd5f1..3af4a21d774 100644 --- a/Mage.Sets/src/mage/sets/eventide/CankerAbomination.java +++ b/Mage.Sets/src/mage/sets/eventide/CankerAbomination.java @@ -61,11 +61,7 @@ public class CankerAbomination extends CardImpl { this.toughness = new MageInt(6); // As Canker Abomination enters the battlefield, choose an opponent. Canker Abomination enters the battlefield with a -1/-1 counter on it for each creature that player controls. - Ability ability = new AsEntersBattlefieldAbility(new CankerAbominationEffect()); - Target target = new TargetOpponent(); - target.setNotTarget(true); - ability.addTarget(target); - this.addAbility(ability); + this.addAbility(new AsEntersBattlefieldAbility(new CankerAbominationEffect())); } @@ -97,14 +93,19 @@ class CankerAbominationEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent CankerAbomination = game.getPermanent(source.getSourceId()); - if (player != null && CankerAbomination != null) { - Player chosenPlayer = game.getPlayer(source.getFirstTarget()); - if (chosenPlayer != null) { - game.informPlayers(CankerAbomination.getName() + ": " + player.getLogName() + " has chosen " + chosenPlayer.getLogName()); - int amount = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), chosenPlayer.getId(), game).size(); - CankerAbomination.addCounters(CounterType.M1M1.createInstance(amount), game); + Player controller = game.getPlayer(source.getControllerId()); + Permanent cankerAbomination = game.getPermanentEntering(source.getSourceId()); + if (controller != null && cankerAbomination != null) { + Target target = new TargetOpponent(); + target.setNotTarget(true); + controller.choose(outcome, target, source.getSourceId(), game); + Player opponent = game.getPlayer(target.getFirstTarget()); + if (opponent != null) { + game.informPlayers(cankerAbomination.getName() + ": " + controller.getLogName() + " has chosen " + opponent.getLogName()); + int amount = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), opponent.getId(), game).size(); + if (amount > 0) { + cankerAbomination.addCounters(CounterType.M1M1.createInstance(amount), game); + } return true; } } diff --git a/Mage.Sets/src/mage/sets/eventide/CennsEnlistment.java b/Mage.Sets/src/mage/sets/eventide/CennsEnlistment.java index 3bbb84df53c..051aa8e3608 100644 --- a/Mage.Sets/src/mage/sets/eventide/CennsEnlistment.java +++ b/Mage.Sets/src/mage/sets/eventide/CennsEnlistment.java @@ -28,14 +28,11 @@ package mage.sets.eventide; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.RetraceAbility; import mage.cards.CardImpl; -import mage.constants.TimingRule; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.game.permanent.token.KithkinToken; /** @@ -50,7 +47,7 @@ public class CennsEnlistment extends CardImpl { // Put two 1/1 white Kithkin Soldier creature tokens onto the battlefield. this.getSpellAbility().addEffect(new CreateTokenEffect(new KithkinToken(), 2)); - + // Retrace this.addAbility(new RetraceAbility(this)); } diff --git a/Mage.Sets/src/mage/sets/eventide/DivinityOfPride.java b/Mage.Sets/src/mage/sets/eventide/DivinityOfPride.java index 19558dcc7f7..19190e1ec5a 100644 --- a/Mage.Sets/src/mage/sets/eventide/DivinityOfPride.java +++ b/Mage.Sets/src/mage/sets/eventide/DivinityOfPride.java @@ -28,11 +28,6 @@ package mage.sets.eventide; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -42,6 +37,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -57,15 +56,19 @@ public class DivinityOfPride extends CardImpl { this.subtype.add("Spirit"); this.subtype.add("Avatar"); - this.power = new MageInt(4); this.toughness = new MageInt(4); + // Flying this.addAbility(FlyingAbility.getInstance()); + + // Lifelink this.addAbility(LifelinkAbility.getInstance()); + + // Divinity of Pride gets +4/+4 as long as you have 25 or more life. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostSourceEffect(4, 4, Duration.WhileOnBattlefield), - new DivinityOfPrideCondition(), - "Divinity of Pride gets +4/+4 as long as you have 25 or more life"))); + new DivinityOfPrideCondition(), + "{this} gets +4/+4 as long as you have 25 or more life"))); } public DivinityOfPride(final DivinityOfPride card) { @@ -85,4 +88,4 @@ class DivinityOfPrideCondition implements Condition { Player player = game.getPlayer(source.getControllerId()); return player != null && player.getLife() >= 25; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/eventide/DreamThief.java b/Mage.Sets/src/mage/sets/eventide/DreamThief.java index f0373c53ccf..a3dc86a47d3 100644 --- a/Mage.Sets/src/mage/sets/eventide/DreamThief.java +++ b/Mage.Sets/src/mage/sets/eventide/DreamThief.java @@ -53,7 +53,7 @@ import mage.watchers.Watcher; * @author jeffwadsworth */ public class DreamThief extends CardImpl { - + private static final String rule = "draw a card if you've cast another blue spell this turn"; public DreamThief(UUID ownerId) { @@ -70,7 +70,7 @@ public class DreamThief extends CardImpl { // When Dream Thief enters the battlefield, draw a card if you've cast another blue spell this turn. this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DrawCardSourceControllerEffect(1), new CastBlueSpellThisTurnCondition(), rule)), new DreamThiefWatcher(this.getId())); - + } public DreamThief(final DreamThief card) { @@ -98,6 +98,7 @@ class CastBlueSpellThisTurnCondition implements Condition { class DreamThiefWatcher extends Watcher { private static final FilterSpell filter = new FilterSpell(); + static { filter.add(new ColorPredicate(ObjectColor.BLUE)); } @@ -125,7 +126,7 @@ class DreamThiefWatcher extends Watcher { return; } if (event.getType() == EventType.SPELL_CAST - && controllerId == event.getPlayerId()) { + && controllerId.equals(event.getPlayerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (!spell.getSourceId().equals(cardId) && filter.match(spell, game)) { condition = true; diff --git a/Mage.Sets/src/mage/sets/eventide/EndlessHorizons.java b/Mage.Sets/src/mage/sets/eventide/EndlessHorizons.java index 240c94a0218..17af8a3fdcf 100644 --- a/Mage.Sets/src/mage/sets/eventide/EndlessHorizons.java +++ b/Mage.Sets/src/mage/sets/eventide/EndlessHorizons.java @@ -40,11 +40,13 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; +import mage.filter.FilterCard; import mage.filter.common.FilterLandCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.ExileZone; import mage.game.Game; import mage.players.Player; +import mage.target.TargetCard; import mage.target.common.TargetCardInLibrary; import mage.util.CardUtil; @@ -58,7 +60,6 @@ public class EndlessHorizons extends CardImpl { super(ownerId, 4, "Endless Horizons", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); this.expansionSetCode = "EVE"; - // When Endless Horizons enters the battlefield, search your library for any number of Plains cards and exile them. Then shuffle your library. this.addAbility(new EntersBattlefieldTriggeredAbility(new EndlessHorizonsEffect(), false)); @@ -122,34 +123,41 @@ class EndlessHorizonsEffect extends SearchEffect { } } - class EndlessHorizonsEffect2 extends OneShotEffect { +class EndlessHorizonsEffect2 extends OneShotEffect { - public EndlessHorizonsEffect2() { - super(Outcome.ReturnToHand); - this.staticText = "you may put a card you own exiled with {this} into your hand"; - } + public EndlessHorizonsEffect2() { + super(Outcome.ReturnToHand); + this.staticText = "you may put a card you own exiled with {this} into your hand"; + } - public EndlessHorizonsEffect2(final EndlessHorizonsEffect2 effect) { - super(effect); - } + public EndlessHorizonsEffect2(final EndlessHorizonsEffect2 effect) { + super(effect); + } - @Override - public EndlessHorizonsEffect2 copy() { - return new EndlessHorizonsEffect2(this); - } + @Override + public EndlessHorizonsEffect2 copy() { + return new EndlessHorizonsEffect2(this); + } - @Override - public boolean apply(Game game, Ability source) { + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { ExileZone exZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)); if (exZone != null) { - for (Card card : exZone.getCards(game)) { - if (card.getOwnerId() == source.getControllerId()) { - card.moveToZone(Zone.HAND, source.getSourceId(), game, false); - break; // only one - } + Card card = null; + if (exZone.size() > 1) { + TargetCard target = new TargetCard(Zone.EXILED, new FilterCard()); + controller.choose(outcome, exZone, target, game); + card = game.getCard(target.getFirstTarget()); + } else { + card = exZone.getRandom(game); } + controller.moveCards(card, null, Zone.HAND, source, game); } return true; } - + return false; + } + } diff --git a/Mage.Sets/src/mage/sets/eventide/GroundlingPouncer.java b/Mage.Sets/src/mage/sets/eventide/GroundlingPouncer.java index 1d7e0ead21c..9d6f8aa0df9 100644 --- a/Mage.Sets/src/mage/sets/eventide/GroundlingPouncer.java +++ b/Mage.Sets/src/mage/sets/eventide/GroundlingPouncer.java @@ -27,32 +27,28 @@ */ package mage.sets.eventide; -import java.util.HashSet; -import java.util.Set; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; import mage.abilities.condition.Condition; +import mage.abilities.condition.common.OpponentControlsPermanentCondition; +import mage.abilities.costs.Cost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalActivatedAbility; import mage.abilities.effects.Effect; +import mage.abilities.effects.Effects; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.constants.AbilityType; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.EffectType; import mage.constants.Rarity; -import mage.constants.WatcherScope; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.AbilityPredicate; import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.stack.StackAbility; -import mage.game.stack.StackObject; -import mage.watchers.Watcher; /** * @@ -60,8 +56,12 @@ import mage.watchers.Watcher; * */ public class GroundlingPouncer extends CardImpl { - - private String rule = "{this} gets +1/+3 and gains flying until end of turn. Activate this ability only once each turn and only if an opponent controls a creature with flying."; + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } public GroundlingPouncer(UUID ownerId) { super(ownerId, 154, "Groundling Pouncer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G/U}"); @@ -72,12 +72,14 @@ public class GroundlingPouncer extends CardImpl { this.toughness = new MageInt(1); // {GU}: Groundling Pouncer gets +1/+3 and gains flying until end of turn. Activate this ability only once each turn and only if an opponent controls a creature with flying. - Condition condition = new GroundingPouncerCondition(); - Effect effect = new BoostSourceEffect(1, 3, Duration.EndOfTurn); - Effect effect2 = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, false, true); - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{G/U}"), condition, rule); - ability.addEffect(effect2); - this.addAbility(ability, new ActivatedAbilityUsedThisTurnWatcher()); + Ability ability = new GroundlingPouncerAbility( + Zone.BATTLEFIELD, + new BoostSourceEffect(1, 3, Duration.EndOfTurn), + new ManaCostsImpl("{G/U}"), + new OpponentControlsPermanentCondition(filter), + "{G/U}: {this} gets +1/+3 and gains flying until end of turn. Activate this ability only once each turn and only if an opponent controls a creature with flying."); + ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, false, true)); + this.addAbility(ability); } @@ -91,69 +93,48 @@ public class GroundlingPouncer extends CardImpl { } } -class GroundingPouncerCondition implements Condition { +class GroundlingPouncerAbility extends LimitedTimesPerTurnActivatedAbility { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final Effects emptyEffects = new Effects(); - static { - filter.add(new AbilityPredicate(FlyingAbility.class)); + private final Condition condition; + private final String ruleText; + + public GroundlingPouncerAbility(Zone zone, Effect effect, Cost cost, Condition condition, String rule) { + super(zone, effect, cost); + this.condition = condition; + this.ruleText = rule; + } + + public GroundlingPouncerAbility(GroundlingPouncerAbility ability) { + super(ability); + this.condition = ability.condition; + this.ruleText = ability.ruleText; } @Override - public boolean apply(Game game, Ability source) { - ActivatedAbilityUsedThisTurnWatcher watcher = (ActivatedAbilityUsedThisTurnWatcher) game.getState().getWatchers().get("ActivatedAbilityUsedThisTurn"); - for (UUID opponentId : game.getOpponents(source.getControllerId())) { - if (game.getBattlefield().countAll(filter, opponentId, game) > 0 && !watcher.getActivatedThisTurn().contains(source.getSourceId())) { - return true; - } + public Effects getEffects(Game game, EffectType effectType) { + if (!condition.apply(game, this)) { + return emptyEffects; } - return false; + return super.getEffects(game, effectType); } @Override - public String toString() { - return "once each turn and only if an opponent controls a flying creature"; + public boolean canActivate(UUID playerId, Game game) { + if (!condition.apply(game, this)) { + return false; + } + return super.canActivate(playerId, game); + } + + @Override + public GroundlingPouncerAbility copy() { + return new GroundlingPouncerAbility(this); + } + + @Override + public String getRule() { + return ruleText; } } - -class ActivatedAbilityUsedThisTurnWatcher extends Watcher { - - public Set activatedThisTurn = new HashSet(); - - public ActivatedAbilityUsedThisTurnWatcher() { - super("ActivatedAbilityUsedThisTurn", WatcherScope.GAME); - } - - public ActivatedAbilityUsedThisTurnWatcher(final ActivatedAbilityUsedThisTurnWatcher watcher) { - super(watcher); - this.activatedThisTurn.addAll(watcher.activatedThisTurn); - } - - @Override - public void watch(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ACTIVATED_ABILITY) { - StackObject stackObject = game.getStack().getStackObject(event.getTargetId()); - if (stackObject != null) { - StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getTargetId()); - if (stackAbility != null && stackAbility.getAbilityType() == AbilityType.ACTIVATED) { - this.activatedThisTurn.add(stackAbility.getOriginalId()); - } - } - } - } - - public Set getActivatedThisTurn() { - return this.activatedThisTurn; - } - - @Override - public ActivatedAbilityUsedThisTurnWatcher copy() { - return new ActivatedAbilityUsedThisTurnWatcher(this); - } - - @Override - public void reset() { - super.reset(); - this.activatedThisTurn.clear(); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/eventide/HotheadedGiant.java b/Mage.Sets/src/mage/sets/eventide/HotheadedGiant.java index 41c797b735b..1e099413f2b 100644 --- a/Mage.Sets/src/mage/sets/eventide/HotheadedGiant.java +++ b/Mage.Sets/src/mage/sets/eventide/HotheadedGiant.java @@ -67,11 +67,11 @@ public class HotheadedGiant extends CardImpl { // Haste this.addAbility(HasteAbility.getInstance()); - + // Hotheaded Giant enters the battlefield with two -1/-1 counters on it unless you've cast another red spell this turn. Condition condition = new CastRedSpellThisTurnCondition(); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.M1M1.createInstance(2)), new InvertCondition(condition), ""), "with two -1/-1 counters on it unless you've cast another red spell this turn"), new HotHeadedGiantWatcher(this.getId())); - + } public HotheadedGiant(final HotheadedGiant card) { @@ -99,6 +99,7 @@ class CastRedSpellThisTurnCondition implements Condition { class HotHeadedGiantWatcher extends Watcher { private static final FilterSpell filter = new FilterSpell(); + static { filter.add(new ColorPredicate(ObjectColor.RED)); } @@ -126,7 +127,7 @@ class HotHeadedGiantWatcher extends Watcher { return; } if (event.getType() == EventType.SPELL_CAST - && controllerId == event.getPlayerId()) { + && controllerId.equals(event.getPlayerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (!spell.getSourceId().equals(cardId) && filter.match(spell, game)) { condition = true; diff --git a/Mage.Sets/src/mage/sets/eventide/ImpelledGiant.java b/Mage.Sets/src/mage/sets/eventide/ImpelledGiant.java index 7c10d02f4d6..ceb04da2360 100644 --- a/Mage.Sets/src/mage/sets/eventide/ImpelledGiant.java +++ b/Mage.Sets/src/mage/sets/eventide/ImpelledGiant.java @@ -154,13 +154,10 @@ class ImpelledGiantBoostEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent impelledGiant = game.getPermanent(source.getSourceId()); - Permanent tappedCreature = game.getPermanent(this.targetPointer.getFirst(game, source)); - if (tappedCreature == null) { - tappedCreature = (Permanent) game.getLastKnownInformation(this.targetPointer.getFirst(game, source), Zone.BATTLEFIELD); - } + Permanent tappedCreature = game.getPermanentOrLKIBattlefield(this.targetPointer.getFirst(game, source)); if (tappedCreature != null && impelledGiant != null) { int amount = tappedCreature.getPower().getValue(); - impelledGiant.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(amount, 0, Duration.EndOfTurn)), source.getSourceId(), game); + game.addEffect(new BoostSourceEffect(amount, 0, Duration.EndOfTurn), source); } return true; } diff --git a/Mage.Sets/src/mage/sets/eventide/MerrowBonegnawer.java b/Mage.Sets/src/mage/sets/eventide/MerrowBonegnawer.java index f8be8da2f87..2273adfe092 100644 --- a/Mage.Sets/src/mage/sets/eventide/MerrowBonegnawer.java +++ b/Mage.Sets/src/mage/sets/eventide/MerrowBonegnawer.java @@ -50,11 +50,11 @@ import mage.target.TargetPlayer; * @author jeffwadsworth */ public class MerrowBonegnawer extends CardImpl { - + private UUID exileId = UUID.randomUUID(); - + private static final FilterSpell filter = new FilterSpell("black spell"); - + static { filter.add(new ColorPredicate(ObjectColor.BLACK)); } @@ -69,13 +69,13 @@ public class MerrowBonegnawer extends CardImpl { this.toughness = new MageInt(1); // {tap}: Target player exiles a card from his or her graveyard. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileFromZoneTargetEffect(Zone.GRAVEYARD, exileId, "Merrow Bonegnawer", new FilterCard("a card")), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileFromZoneTargetEffect(Zone.GRAVEYARD, exileId, getIdName(), new FilterCard()), new TapSourceCost()); ability.addTarget(new TargetPlayer()); this.addAbility(ability); - + // Whenever you cast a black spell, you may untap Merrow Bonegnawer. this.addAbility(new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), filter, true, false)); - + } public MerrowBonegnawer(final MerrowBonegnawer card) { diff --git a/Mage.Sets/src/mage/sets/eventide/Moonhold.java b/Mage.Sets/src/mage/sets/eventide/Moonhold.java index 25d6d5105f4..acb45b4cbea 100644 --- a/Mage.Sets/src/mage/sets/eventide/Moonhold.java +++ b/Mage.Sets/src/mage/sets/eventide/Moonhold.java @@ -58,7 +58,6 @@ public class Moonhold extends CardImpl { super(ownerId, 143, "Moonhold", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{R/W}"); this.expansionSetCode = "EVE"; - // Target player can't play land cards this turn if {R} was spent to cast Moonhold and can't play creature cards this turn if {W} was spent to cast it. ContinuousRuleModifyingEffect effect = new MoonholdEffect(); ContinuousRuleModifyingEffect effect2 = new MoonholdEffect2(); @@ -109,7 +108,7 @@ class MoonholdEffect extends ContinuousRuleModifyingEffectImpl { public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "you can't play land cards this turn (" + mageObject.getLogName() + ")."; + return "you can't play land cards this turn (" + mageObject.getIdName() + ")."; } return null; } @@ -152,7 +151,7 @@ class MoonholdEffect2 extends ContinuousRuleModifyingEffectImpl { public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't play creature cards this turn (" + mageObject.getLogName() + ")."; + return "You can't play creature cards this turn (" + mageObject.getIdName() + ")."; } return null; } diff --git a/Mage.Sets/src/mage/sets/eventide/Necroskitter.java b/Mage.Sets/src/mage/sets/eventide/Necroskitter.java index e3945c2cc46..309521f8d17 100644 --- a/Mage.Sets/src/mage/sets/eventide/Necroskitter.java +++ b/Mage.Sets/src/mage/sets/eventide/Necroskitter.java @@ -80,7 +80,7 @@ public class Necroskitter extends CardImpl { class NecroskitterTriggeredAbility extends TriggeredAbilityImpl { public NecroskitterTriggeredAbility() { - super(Zone.BATTLEFIELD, new ReturnToBattlefieldUnderYourControlTargetEffect()); + super(Zone.BATTLEFIELD, new ReturnToBattlefieldUnderYourControlTargetEffect(), true); } public NecroskitterTriggeredAbility(NecroskitterTriggeredAbility ability) { @@ -100,18 +100,13 @@ class NecroskitterTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (game.getPermanent(sourceId) == null) { - if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) { - return false; - } - } if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { - Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + Permanent permanent = zEvent.getTarget(); if (permanent != null && permanent.getCounters().containsKey(CounterType.M1M1) && game.getOpponents(controllerId).contains(permanent.getControllerId())) { for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); + effect.setTargetPointer(new FixedTarget(event.getTargetId(), game.getState().getZoneChangeCounter(event.getTargetId()))); } return true; } diff --git a/Mage.Sets/src/mage/sets/eventide/NightskyMimic.java b/Mage.Sets/src/mage/sets/eventide/NightskyMimic.java index 195ba1f3771..4bb385b9af1 100644 --- a/Mage.Sets/src/mage/sets/eventide/NightskyMimic.java +++ b/Mage.Sets/src/mage/sets/eventide/NightskyMimic.java @@ -39,18 +39,19 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.ColorPredicate; /** * * @author jeffwadsworth - + * */ public class NightskyMimic extends CardImpl { - + private static final FilterSpell filter = new FilterSpell("a spell that's both black and green"); - + static { filter.add(new ColorPredicate(ObjectColor.WHITE)); filter.add(new ColorPredicate(ObjectColor.BLACK)); @@ -69,7 +70,7 @@ public class NightskyMimic extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast a spell that's both white and black, Nightsky Mimic has base power and toughness 4/4 until end of turn and gains flying until end of turn. - Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(4, 4, Duration.EndOfTurn), filter, false, rule); + Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(4, 4, Duration.EndOfTurn, SubLayer.SetPT_7b), filter, false, rule); ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, false, true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/eventide/PatrolSignaler.java b/Mage.Sets/src/mage/sets/eventide/PatrolSignaler.java index d23a120320f..3f4c9e306f0 100644 --- a/Mage.Sets/src/mage/sets/eventide/PatrolSignaler.java +++ b/Mage.Sets/src/mage/sets/eventide/PatrolSignaler.java @@ -39,7 +39,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.KithkinToken; /** * @@ -57,10 +57,9 @@ public class PatrolSignaler extends CardImpl { this.toughness = new MageInt(1); // {1}{W}, {untap}: Put a 1/1 white Kithkin Soldier creature token onto the battlefield. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new KithkinSoldierToken()), new ManaCostsImpl("{1}{W}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new KithkinToken()), new ManaCostsImpl("{1}{W}")); ability.addCost(new UntapSourceCost()); this.addAbility(ability); - } public PatrolSignaler(final PatrolSignaler card) { @@ -72,17 +71,3 @@ public class PatrolSignaler extends CardImpl { return new PatrolSignaler(this); } } - -class KithkinSoldierToken extends Token { - - public KithkinSoldierToken() { - super("Kithkin Soldier", "1/1 white Kithkin Soldier creature token"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Soldier"); - power = new MageInt(1); - toughness = new MageInt(1); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/eventide/RiverfallMimic.java b/Mage.Sets/src/mage/sets/eventide/RiverfallMimic.java index 43def6c29ad..e3c6f650e7c 100644 --- a/Mage.Sets/src/mage/sets/eventide/RiverfallMimic.java +++ b/Mage.Sets/src/mage/sets/eventide/RiverfallMimic.java @@ -39,23 +39,24 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.ColorPredicate; /** * * @author jeffwadsworth - + * */ public class RiverfallMimic extends CardImpl { - + private static final FilterSpell filter = new FilterSpell("a spell that's both blue and red"); - + static { filter.add(new ColorPredicate(ObjectColor.BLUE)); filter.add(new ColorPredicate(ObjectColor.RED)); } - + private String rule = "Whenever you cast a spell that's both blue and red, {this} has base power and toughness 3/3 until end of turn and can't be blocked this turn."; public RiverfallMimic(UUID ownerId) { @@ -69,7 +70,7 @@ public class RiverfallMimic extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast a spell that's both blue and red, Riverfall Mimic has base power and toughness 3/3 until end of turn and can't be blocked this turn. - Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(3, 3, Duration.EndOfTurn), filter, false, rule); + Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(3, 3, Duration.EndOfTurn, SubLayer.SetPT_7b), filter, false, rule); ability.addEffect(new GainAbilitySourceEffect(new CantBeBlockedSourceAbility(), Duration.EndOfTurn, false, true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/eventide/SaplingOfColfenor.java b/Mage.Sets/src/mage/sets/eventide/SaplingOfColfenor.java index d91784affe7..1d7f50f456c 100644 --- a/Mage.Sets/src/mage/sets/eventide/SaplingOfColfenor.java +++ b/Mage.Sets/src/mage/sets/eventide/SaplingOfColfenor.java @@ -29,6 +29,7 @@ package mage.sets.eventide; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -80,11 +81,9 @@ public class SaplingOfColfenor extends CardImpl { } class SaplingOfColfenorEffect extends OneShotEffect { - - Cards cards = new CardsImpl(); public SaplingOfColfenorEffect() { - super(Outcome.GainLife); + super(Outcome.Benefit); this.staticText = "reveal the top card of your library. If it's a creature card, you gain life equal to that card's toughness, lose life equal to its power, then put it into your hand"; } @@ -99,17 +98,21 @@ class SaplingOfColfenorEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player you = game.getPlayer(source.getControllerId()); - if (you != null && you.getLibrary().size() > 0) { - Card card = you.getLibrary().removeFromTop(game); - cards.add(card); - you.revealCards("Sapling of Colfenor", cards, game); - if (card.getCardType().contains(CardType.CREATURE)) { - you.gainLife(card.getToughness().getValue(), game); - you.loseLife(card.getPower().getValue(), game); - return card.moveToZone(Zone.HAND, source.getSourceId(), game, false); + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + if (controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().getFromTop(game); + Cards cards = new CardsImpl(card); + controller.revealCards(sourceObject.getIdName(), cards, game); + if (card.getCardType().contains(CardType.CREATURE)) { + controller.gainLife(card.getToughness().getValue(), game); + controller.loseLife(card.getPower().getValue(), game); + return controller.moveCards(cards.getCards(game), Zone.HAND, source, game); + } } + return true; } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/eventide/SelkieHedgeMage.java b/Mage.Sets/src/mage/sets/eventide/SelkieHedgeMage.java index 4b93e395876..fef55274374 100644 --- a/Mage.Sets/src/mage/sets/eventide/SelkieHedgeMage.java +++ b/Mage.Sets/src/mage/sets/eventide/SelkieHedgeMage.java @@ -44,27 +44,26 @@ import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.TappedPredicate; import mage.target.TargetPermanent; -import mage.target.common.TargetArtifactPermanent; /** * * @author jeffwadsworth - + * */ public class SelkieHedgeMage extends CardImpl { - + private static final FilterLandPermanent filter = new FilterLandPermanent("Forests"); private static final FilterLandPermanent filter2 = new FilterLandPermanent("Islands"); private static final FilterCreaturePermanent filter3 = new FilterCreaturePermanent("tapped creature"); static { - filter.add(new SubtypePredicate("Forests")); - filter2.add(new SubtypePredicate("Islands")); + filter.add(new SubtypePredicate("Forest")); + filter2.add(new SubtypePredicate("Island")); filter3.add(new TappedPredicate()); } - - private String rule1 = "When {this} enters the battlefield, if you control two or more Forests, you may gain 3 life."; - private String rule2 = "When {this} enters the battlefield, if you control two or more Islands, you may return target tapped creature to its owner's hand."; + + private final String rule1 = "When {this} enters the battlefield, if you control two or more Forests, you may gain 3 life."; + private final String rule2 = "When {this} enters the battlefield, if you control two or more Islands, you may return target tapped creature to its owner's hand."; public SelkieHedgeMage(UUID ownerId) { super(ownerId, 158, "Selkie Hedge-Mage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G/U}"); @@ -80,12 +79,12 @@ public class SelkieHedgeMage extends CardImpl { // When Selkie Hedge-Mage enters the battlefield, if you control two or more Forests, you may gain 3 life. Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(3), true), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1), rule1); this.addAbility(ability); - + // When Selkie Hedge-Mage enters the battlefield, if you control two or more Islands, you may return target tapped creature to its owner's hand. Ability ability2 = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true), new PermanentsOnTheBattlefieldCondition(filter2, CountType.MORE_THAN, 1), rule2); ability2.addTarget(new TargetPermanent(filter3)); this.addAbility(ability2); - + } public SelkieHedgeMage(final SelkieHedgeMage card) { diff --git a/Mage.Sets/src/mage/sets/eventide/ShorecrasherMimic.java b/Mage.Sets/src/mage/sets/eventide/ShorecrasherMimic.java index c4850c75cf4..41711f60d12 100644 --- a/Mage.Sets/src/mage/sets/eventide/ShorecrasherMimic.java +++ b/Mage.Sets/src/mage/sets/eventide/ShorecrasherMimic.java @@ -39,18 +39,19 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.ColorPredicate; /** * * @author jeffwadsworth - + * */ public class ShorecrasherMimic extends CardImpl { - + private static final FilterSpell filter = new FilterSpell("a spell that's both green and blue"); - + static { filter.add(new ColorPredicate(ObjectColor.GREEN)); filter.add(new ColorPredicate(ObjectColor.BLUE)); @@ -69,10 +70,10 @@ public class ShorecrasherMimic extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast a spell that's both green and blue, Shorecrasher Mimic has base power and toughness 5/3 until end of turn and gains trample until end of turn. - Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(5, 3, Duration.EndOfTurn), filter, false, rule); + Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(5, 3, Duration.EndOfTurn, SubLayer.SetPT_7b), filter, false, rule); ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, false, true)); this.addAbility(ability); - + } public ShorecrasherMimic(final ShorecrasherMimic card) { diff --git a/Mage.Sets/src/mage/sets/eventide/SoulReap.java b/Mage.Sets/src/mage/sets/eventide/SoulReap.java index 8c47750a966..3bb073a7dbf 100644 --- a/Mage.Sets/src/mage/sets/eventide/SoulReap.java +++ b/Mage.Sets/src/mage/sets/eventide/SoulReap.java @@ -32,7 +32,6 @@ import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.abilities.decorator.ConditionalOneShotEffect; -import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; @@ -59,26 +58,25 @@ import mage.watchers.Watcher; * @author jeffwadsworth */ public class SoulReap extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nongreen creature"); - + static { filter.add(Predicates.not(new ColorPredicate(ObjectColor.GREEN))); } - + private String rule = "Its controller loses 3 life if you've cast another black spell this turn"; public SoulReap(UUID ownerId) { super(ownerId, 44, "Soul Reap", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{B}"); this.expansionSetCode = "EVE"; - // Destroy target nongreen creature. Its controller loses 3 life if you've cast another black spell this turn. this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new SoulReapEffect(), new CastBlackSpellThisTurnCondition(), rule)); this.getSpellAbility().addWatcher(new SoulReapWatcher(this.getId())); - + } public SoulReap(final SoulReap card) { @@ -106,7 +104,7 @@ class CastBlackSpellThisTurnCondition implements Condition { class SoulReapWatcher extends Watcher { private static final FilterSpell filter = new FilterSpell(); - + static { filter.add(new ColorPredicate(ObjectColor.BLACK)); } @@ -134,7 +132,7 @@ class SoulReapWatcher extends Watcher { return; } if (event.getType() == EventType.SPELL_CAST - && controllerId == event.getPlayerId()) { + && controllerId.equals(event.getPlayerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (!spell.getSourceId().equals(cardId) && filter.match(spell, game)) { condition = true; @@ -177,4 +175,4 @@ class SoulReapEffect extends OneShotEffect { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/eventide/SpittingImage.java b/Mage.Sets/src/mage/sets/eventide/SpittingImage.java index a9eda3c7deb..08a233a9427 100644 --- a/Mage.Sets/src/mage/sets/eventide/SpittingImage.java +++ b/Mage.Sets/src/mage/sets/eventide/SpittingImage.java @@ -30,6 +30,7 @@ package mage.sets.eventide; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.keyword.RetraceAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -45,7 +46,7 @@ import mage.util.CardUtil; /** * * @author jeffwadsworth - + * */ public class SpittingImage extends CardImpl { @@ -54,12 +55,12 @@ public class SpittingImage extends CardImpl { this.expansionSetCode = "EVE"; // Put a token that's a copy of target creature onto the battlefield. - this.getSpellAbility().addEffect(new SpittingImageEffect()); + this.getSpellAbility().addEffect(new PutTokenOntoBattlefieldCopyTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - + // Retrace (You may cast this card from your graveyard by discarding a land card in addition to paying its other costs.) this.addAbility(new RetraceAbility(this)); - + } public SpittingImage(final SpittingImage card) { diff --git a/Mage.Sets/src/mage/sets/eventide/SpringjackShepherd.java b/Mage.Sets/src/mage/sets/eventide/SpringjackShepherd.java index 460d913355a..481269f78f2 100644 --- a/Mage.Sets/src/mage/sets/eventide/SpringjackShepherd.java +++ b/Mage.Sets/src/mage/sets/eventide/SpringjackShepherd.java @@ -1,116 +1,104 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.eventide; - -import java.util.UUID; -import mage.MageInt; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.CreateTokenEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.filter.FilterPermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.Token; - -/** - * - * @author jeffwadsworth - * - */ -public class SpringjackShepherd extends CardImpl { - - public SpringjackShepherd(UUID ownerId) { - super(ownerId, 15, "Springjack Shepherd", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); - this.expansionSetCode = "EVE"; - this.subtype.add("Kithkin"); - this.subtype.add("Wizard"); - - this.power = new MageInt(1); - this.toughness = new MageInt(2); - - // Chroma - When Springjack Shepherd enters the battlefield, put a 0/1 white Goat creature token onto the battlefield for each white mana symbol in the mana costs of permanents you control. - Effect effect = new CreateTokenEffect(new GoatToken(), new ChromaSpringjackShepherdCount()); - effect.setText("Chroma - When Springjack Shepherd enters the battlefield, put a 0/1 white Goat creature token onto the battlefield for each white mana symbol in the mana costs of permanents you control."); - this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false, true)); - - } - - public SpringjackShepherd(final SpringjackShepherd card) { - super(card); - } - - @Override - public SpringjackShepherd copy() { - return new SpringjackShepherd(this); - } -} - -class ChromaSpringjackShepherdCount implements DynamicValue { - - @Override - public int calculate(Game game, Ability sourceAbility, Effect effect) { - int chroma = 0; - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterPermanent(), sourceAbility.getControllerId(), game)) { - chroma += permanent.getManaCost().getMana().getWhite(); - } - return chroma; - } - - @Override - public DynamicValue copy() { - return new ChromaSpringjackShepherdCount(); - } - - @Override - public String toString() { - return "1"; - } - - @Override - public String getMessage() { - return ""; - } -} - -class GoatToken extends Token { - - public GoatToken() { - super("Goat", "a 0/1 white Goat creature token"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Goat"); - power = new MageInt(0); - toughness = new MageInt(1); - } +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.eventide; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.GoatToken; + +/** + * + * @author jeffwadsworth + * + */ +public class SpringjackShepherd extends CardImpl { + + public SpringjackShepherd(UUID ownerId) { + super(ownerId, 15, "Springjack Shepherd", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "EVE"; + this.subtype.add("Kithkin"); + this.subtype.add("Wizard"); + + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Chroma - When Springjack Shepherd enters the battlefield, put a 0/1 white Goat creature token onto the battlefield for each white mana symbol in the mana costs of permanents you control. + Effect effect = new CreateTokenEffect(new GoatToken(), new ChromaSpringjackShepherdCount()); + effect.setText("Chroma - When Springjack Shepherd enters the battlefield, put a 0/1 white Goat creature token onto the battlefield for each white mana symbol in the mana costs of permanents you control."); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false, true)); + + } + + public SpringjackShepherd(final SpringjackShepherd card) { + super(card); + } + + @Override + public SpringjackShepherd copy() { + return new SpringjackShepherd(this); + } +} + +class ChromaSpringjackShepherdCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + int chroma = 0; + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterPermanent(), sourceAbility.getControllerId(), game)) { + chroma += permanent.getManaCost().getMana().getWhite(); + } + return chroma; + } + + @Override + public DynamicValue copy() { + return new ChromaSpringjackShepherdCount(); + } + + @Override + public String toString() { + return "1"; + } + + @Override + public String getMessage() { + return ""; + } } diff --git a/Mage.Sets/src/mage/sets/eventide/TalarasBattalion.java b/Mage.Sets/src/mage/sets/eventide/TalarasBattalion.java index 3220bda751d..190a6d3f5b8 100644 --- a/Mage.Sets/src/mage/sets/eventide/TalarasBattalion.java +++ b/Mage.Sets/src/mage/sets/eventide/TalarasBattalion.java @@ -34,7 +34,6 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.Condition; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -159,7 +158,7 @@ class TalarasBattalionWatcher extends Watcher { return; } if (event.getType() == EventType.SPELL_CAST - && controllerId == event.getPlayerId()) { + && controllerId.equals(event.getPlayerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (!spell.getSourceId().equals(cardId) && filter.match(spell, game)) { condition = true; diff --git a/Mage.Sets/src/mage/sets/eventide/WoodlurkerMimic.java b/Mage.Sets/src/mage/sets/eventide/WoodlurkerMimic.java index 59bf022dde0..92a514ea7aa 100644 --- a/Mage.Sets/src/mage/sets/eventide/WoodlurkerMimic.java +++ b/Mage.Sets/src/mage/sets/eventide/WoodlurkerMimic.java @@ -39,25 +39,26 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.ColorPredicate; /** * * @author jeffwadsworth - + * */ public class WoodlurkerMimic extends CardImpl { - + private static final FilterSpell filter = new FilterSpell("a spell that's both black and green"); - + static { filter.add(new ColorPredicate(ObjectColor.BLACK)); filter.add(new ColorPredicate(ObjectColor.GREEN)); } private String rule = "Whenever you cast a spell that's both black and green, {this} has base power and toughness 4/5 until end of turn and gains wither until end of turn."; - + public WoodlurkerMimic(UUID ownerId) { super(ownerId, 130, "Woodlurker Mimic", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B/G}"); this.expansionSetCode = "EVE"; @@ -69,10 +70,10 @@ public class WoodlurkerMimic extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast a spell that's both black and green, Woodlurker Mimic has base power and toughness 4/5 until end of turn and gains wither until end of turn. - Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(4, 5, Duration.EndOfTurn), filter, false, rule); + Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(4, 5, Duration.EndOfTurn, SubLayer.SetPT_7b), filter, false, rule); ability.addEffect(new GainAbilitySourceEffect(WitherAbility.getInstance(), Duration.EndOfTurn, false, true)); this.addAbility(ability); - + } public WoodlurkerMimic(final WoodlurkerMimic card) { diff --git a/Mage.Sets/src/mage/sets/exodus/Allay.java b/Mage.Sets/src/mage/sets/exodus/Allay.java new file mode 100644 index 00000000000..f9e5abf1b14 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/Allay.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.exodus; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.BuybackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class Allay extends CardImpl { + + public Allay(UUID ownerId) { + super(ownerId, 1, "Allay", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "EXO"; + + // Buyback {3} + this.addAbility(new BuybackAbility("{3}")); + + // Destroy target enchantment. + this.getSpellAbility().addTarget(new TargetPermanent(new FilterEnchantmentPermanent())); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + } + + public Allay(final Allay card) { + super(card); + } + + @Override + public Allay copy() { + return new Allay(this); + } +} diff --git a/Mage.Sets/src/mage/sets/exodus/DauthiCutthroat.java b/Mage.Sets/src/mage/sets/exodus/DauthiCutthroat.java new file mode 100644 index 00000000000..031474abcb2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/DauthiCutthroat.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.exodus; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DauthiCutthroat extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with shadow"); + + static { + filter.add(new AbilityPredicate(ShadowAbility.class)); + } + + public DauthiCutthroat(UUID ownerId) { + super(ownerId, 57, "Dauthi Cutthroat", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "EXO"; + this.subtype.add("Dauthi"); + this.subtype.add("Minion"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // {1}{B}, {tap}: Destroy target creature with shadow. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{1}{B}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public DauthiCutthroat(final DauthiCutthroat card) { + super(card); + } + + @Override + public DauthiCutthroat copy() { + return new DauthiCutthroat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/exodus/DominatingLicid.java b/Mage.Sets/src/mage/sets/exodus/DominatingLicid.java new file mode 100644 index 00000000000..3dc6bcb736b --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/DominatingLicid.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.exodus; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LicidAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.ControlEnchantedEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author emerald000 + */ +public class DominatingLicid extends CardImpl { + + public DominatingLicid(UUID ownerId) { + super(ownerId, 30, "Dominating Licid", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "EXO"; + this.subtype.add("Licid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{U}{U}, {tap}: Dominating Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {U} to end this effect. + this.addAbility(new LicidAbility(new ManaCostsImpl<>("{1}{U}{U}"), new ColoredManaCost(ColoredManaSymbol.U))); + + // You control enchanted creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); + } + + public DominatingLicid(final DominatingLicid card) { + super(card); + } + + @Override + public DominatingLicid copy() { + return new DominatingLicid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/exodus/EntropicSpecter.java b/Mage.Sets/src/mage/sets/exodus/EntropicSpecter.java index 1e5348392f8..acbe6da3679 100644 --- a/Mage.Sets/src/mage/sets/exodus/EntropicSpecter.java +++ b/Mage.Sets/src/mage/sets/exodus/EntropicSpecter.java @@ -27,6 +27,7 @@ */ package mage.sets.exodus; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; @@ -34,18 +35,19 @@ import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseOpponentEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.game.Game; -import mage.game.permanent.Permanent; import mage.players.Player; -import mage.target.common.TargetOpponent; - -import java.util.UUID; /** * @@ -64,13 +66,13 @@ public class EntropicSpecter extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // As Entropic Specter enters the battlefield, choose an opponent. - this.addAbility(new AsEntersBattlefieldAbility(new ChooseOpponent())); - + this.addAbility(new AsEntersBattlefieldAbility(new ChooseOpponentEffect(Outcome.Detriment))); + // Entropic Specter's power and toughness are each equal to the number of cards in the chosen player's hand. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInTargetPlayerHandCount(), Duration.WhileOnBattlefield))); - + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInTargetPlayerHandCount(), Duration.WhileOnBattlefield, SubLayer.SetPT_7b))); + // Whenever Entropic Specter deals damage to a player, that player discards a card. this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1, false), false, true)); } @@ -85,47 +87,12 @@ public class EntropicSpecter extends CardImpl { } } -class ChooseOpponent extends OneShotEffect { - - public ChooseOpponent() { - super(Outcome.Neutral); - this.staticText = "choose an opponent"; - } - - public ChooseOpponent(final ChooseOpponent effect) { - super(effect); - } - - @Override - public ChooseOpponent copy() { - return new ChooseOpponent(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - TargetOpponent target = new TargetOpponent(); - target.setNotTarget(true); - if (player.choose(this.outcome, target, source.getSourceId(), game)) { - Player chosenPlayer = game.getPlayer(target.getFirstTarget()); - if (chosenPlayer != null) { - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + chosenPlayer.getLogName()); - game.getState().setValue(permanent.getId() + "_player", target.getFirstTarget()); - return true; - } - } - } - return false; - } -} - class CardsInTargetPlayerHandCount implements DynamicValue { + @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { if (sourceAbility != null) { - UUID playerId = (UUID) game.getState().getValue(sourceAbility.getSourceId() + "_player"); + UUID playerId = (UUID) game.getState().getValue(sourceAbility.getSourceId() + ChooseOpponentEffect.VALUE_KEY); Player chosenPlayer = game.getPlayer(playerId); if (chosenPlayer != null) { return chosenPlayer.getHand().size(); diff --git a/Mage.Sets/src/mage/sets/exodus/HighGround.java b/Mage.Sets/src/mage/sets/exodus/HighGround.java new file mode 100644 index 00000000000..7b5c3164f32 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/HighGround.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.exodus; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class HighGround extends CardImpl { + + public HighGround(UUID ownerId) { + super(ownerId, 7, "High Ground", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "EXO"; + + // Each creature you control can block an additional creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAdditionalCreatureAllEffect(1, new FilterControlledCreaturePermanent("Each creature you control"), Duration.WhileOnBattlefield))); + } + + public HighGround(final HighGround card) { + super(card); + } + + @Override + public HighGround copy() { + return new HighGround(this); + } +} diff --git a/Mage.Sets/src/mage/sets/exodus/KorChant.java b/Mage.Sets/src/mage/sets/exodus/KorChant.java index 0269d443edd..3aa8d9effb6 100644 --- a/Mage.Sets/src/mage/sets/exodus/KorChant.java +++ b/Mage.Sets/src/mage/sets/exodus/KorChant.java @@ -35,6 +35,8 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AnotherTargetPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.target.TargetSource; @@ -53,8 +55,15 @@ public class KorChant extends CardImpl { // All damage that would be dealt this turn to target creature you control by a source of your choice is dealt to another target creature instead. this.getSpellAbility().addEffect(new KorChantEffect()); - this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); - this.getSpellAbility().addTarget(new KorChantSecondTarget()); + TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(); + target.setTargetTag(1); + this.getSpellAbility().addTarget(target); + + FilterCreaturePermanent filter = new FilterCreaturePermanent("another target creature"); + filter.add(new AnotherTargetPredicate(2)); + TargetCreaturePermanent target2 = new TargetCreaturePermanent(filter); + target2.setTargetTag(2); + this.getSpellAbility().addTarget(target2); } public KorChant(final KorChant card) { @@ -67,33 +76,8 @@ public class KorChant extends CardImpl { } } -class KorChantSecondTarget extends TargetCreaturePermanent { - - KorChantSecondTarget() { - super(); - this.targetName = "another creature"; - } - - KorChantSecondTarget(final KorChantSecondTarget target) { - super(target); - } - - @Override - public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { - if (source.getTargets().get(0).getTargets().contains(id)) { - return false; - } - return super.canTarget(controllerId, id, source, game); - } - - @Override - public KorChantSecondTarget copy() { - return new KorChantSecondTarget(this); - } -} - class KorChantEffect extends RedirectionEffect { - + protected TargetSource target = new TargetSource(); KorChantEffect() { @@ -121,7 +105,7 @@ class KorChantEffect extends RedirectionEffect { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.DAMAGE_CREATURE; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(this.getTargetPointer().getFirst(game, source)) diff --git a/Mage.Sets/src/mage/sets/exodus/Manabond.java b/Mage.Sets/src/mage/sets/exodus/Manabond.java index 95dcbe4d6c8..b3d4487f70a 100644 --- a/Mage.Sets/src/mage/sets/exodus/Manabond.java +++ b/Mage.Sets/src/mage/sets/exodus/Manabond.java @@ -27,17 +27,19 @@ */ package mage.sets.exodus; +import java.util.LinkedHashSet; +import java.util.Set; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.cards.Cards; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -51,8 +53,7 @@ public class Manabond extends CardImpl { super(ownerId, 113, "Manabond", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G}"); this.expansionSetCode = "EXO"; - - // At the beginning of your end step, you may reveal your hand and put all land cards from it onto the battlefield. If you do, discard your hand. + // At the beginning of your end step, reveal your hand and put all land cards from it onto the battlefield. If you do, discard your hand. this.addAbility(new BeginningOfYourEndStepTriggeredAbility(new ManabondEffect(), true)); } @@ -66,12 +67,11 @@ public class Manabond extends CardImpl { } } - class ManabondEffect extends OneShotEffect { public ManabondEffect() { super(Outcome.PutCardInPlay); - staticText = "reveal your hand and put all land cards from it onto the battlefield. If you do, discard your hand"; + staticText = "you may reveal your hand and put all land cards from it onto the battlefield. If you do, discard your hand"; } public ManabondEffect(final ManabondEffect effect) { @@ -80,24 +80,22 @@ class ManabondEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.revealCards("Manabond", player.getHand(), game); - - Cards hand = player.getHand().copy(); - for(UUID uuid : hand){ + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + controller.revealCards(sourceObject.getIdName(), controller.getHand(), game); + Set toBattlefield = new LinkedHashSet<>(); + for (UUID uuid : controller.getHand()) { Card card = game.getCard(uuid); - if(card != null){ - if(card.getCardType().contains(CardType.LAND)){ - card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false); - } - else{ - player.discard(card, source, game); - } + if (card != null && card.getCardType().contains(CardType.LAND)) { + toBattlefield.add(card); } + } - - } + controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, false, true, null); + controller.discard(controller.getHand().size(), false, source, game); + return true; + } return false; } @@ -105,4 +103,4 @@ class ManabondEffect extends OneShotEffect { public ManabondEffect copy() { return new ManabondEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/exodus/MedicineBag.java b/Mage.Sets/src/mage/sets/exodus/MedicineBag.java new file mode 100644 index 00000000000..c17bd95ef57 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/MedicineBag.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.exodus; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MedicineBag extends CardImpl { + + public MedicineBag(UUID ownerId) { + super(ownerId, 133, "Medicine Bag", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "EXO"; + + // {1}, {tap}, Discard a card: Regenerate target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{1}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public MedicineBag(final MedicineBag card) { + super(card); + } + + @Override + public MedicineBag copy() { + return new MedicineBag(this); + } +} diff --git a/Mage.Sets/src/mage/sets/exodus/OathOfDruids.java b/Mage.Sets/src/mage/sets/exodus/OathOfDruids.java index e08f682393c..261c3b9185b 100644 --- a/Mage.Sets/src/mage/sets/exodus/OathOfDruids.java +++ b/Mage.Sets/src/mage/sets/exodus/OathOfDruids.java @@ -55,6 +55,7 @@ import mage.target.TargetPlayer; */ public class OathOfDruids extends CardImpl { + private final UUID originalId; private static final FilterPlayer filter = new FilterPlayer(); static { @@ -65,16 +66,16 @@ public class OathOfDruids extends CardImpl { super(ownerId, 115, "Oath of Druids", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); this.expansionSetCode = "EXO"; - // At the beginning of each player's upkeep, that player chooses target player who controls more creatures than he or she does and is his or her opponent. The first player may reveal cards from the top of his or her library until he or she reveals a creature card. If he or she does, that player puts that card onto the battlefield and all other cards revealed this way into his or her graveyard. Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfDruidsEffect(), TargetController.ANY, true); ability.addTarget(new TargetPlayer(1, 1, false, filter)); + originalId = ability.getOriginalId(); this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof BeginningOfUpkeepTriggeredAbility) { + if (ability.getOriginalId().equals(originalId)) { Player activePlayer = game.getPlayer(game.getActivePlayerId()); if (activePlayer != null) { ability.setControllerId(activePlayer.getId()); @@ -87,6 +88,7 @@ public class OathOfDruids extends CardImpl { public OathOfDruids(final OathOfDruids card) { super(card); + this.originalId = card.originalId; } @Override @@ -136,32 +138,32 @@ class OathOfDruidsEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { MageObject sourceObject = game.getObject(source.getSourceId()); - Player player = game.getPlayer(source.getControllerId()); - if (player == null || sourceObject == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null || sourceObject == null) { return false; } Cards revealed = new CardsImpl(); Card creatureCard = null; Cards nonCreatureCards = new CardsImpl(); //The first player may reveal cards from the top of his or her library - while (creatureCard == null && player.getLibrary().size() > 0) { - Card card = player.getLibrary().removeFromTop(game); + while (creatureCard == null && controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().removeFromTop(game); revealed.add(card); - // until he or she reveals a creature card. + // until he or she reveals a creature card. if (card.getCardType().contains(CardType.CREATURE)) { creatureCard = card; } else { nonCreatureCards.add(card); } } - player.revealCards(sourceObject.getName(), revealed, game); + controller.revealCards(sourceObject.getIdName(), revealed, game); //If he or she does, that player puts that card onto the battlefield if (creatureCard != null) { - player.putOntoBattlefieldWithInfo(creatureCard, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game); } // and all other cards revealed this way into his or her graveyard - player.moveCards(nonCreatureCards, Zone.LIBRARY, Zone.GRAVEYARD, source, game); + controller.moveCards(nonCreatureCards, Zone.GRAVEYARD, source, game); return true; } diff --git a/Mage.Sets/src/mage/sets/exodus/OathOfLieges.java b/Mage.Sets/src/mage/sets/exodus/OathOfLieges.java index b7a8d637588..6a2c3279357 100644 --- a/Mage.Sets/src/mage/sets/exodus/OathOfLieges.java +++ b/Mage.Sets/src/mage/sets/exodus/OathOfLieges.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayTargetPlayerEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -46,14 +46,17 @@ import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; import mage.target.common.TargetCardInLibrary; +import mage.target.targetpointer.FixedTarget; /** * * @author emerald000 */ public class OathOfLieges extends CardImpl { - - private static final FilterPlayer filter = new FilterPlayer(); + + private final UUID originalId; + private static final FilterPlayer filter = new FilterPlayer("player who controls more lands than you do and is his your opponent"); + static { filter.add(new OathOfLiegesPredicate()); } @@ -62,28 +65,34 @@ public class OathOfLieges extends CardImpl { super(ownerId, 11, "Oath of Lieges", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); this.expansionSetCode = "EXO"; - // At the beginning of each player's upkeep, that player chooses target player who controls more lands than he or she does and is his or her opponent. The first player may search his or her library for a basic land card, put that card onto the battlefield, then shuffle his or her library. - Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBasicLandCard()), false, Outcome.PutLandInPlay); + Effect effect = new SearchLibraryPutInPlayTargetPlayerEffect(new TargetCardInLibrary(new FilterBasicLandCard()), false, true, Outcome.PutLandInPlay, true); effect.setText("that player chooses target player who controls more lands than he or she does and is his or her opponent. The first player may search his or her library for a basic land card, put that card onto the battlefield, then shuffle his or her library"); Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, true); ability.addTarget(new TargetPlayer(1, 1, false, filter)); + originalId = ability.getOriginalId(); this.addAbility(ability); } public OathOfLieges(final OathOfLieges card) { super(card); + this.originalId = card.originalId; } - + @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof BeginningOfUpkeepTriggeredAbility) { + if (ability.getOriginalId().equals(originalId)) { Player activePlayer = game.getPlayer(game.getActivePlayerId()); if (activePlayer != null) { - ability.setControllerId(activePlayer.getId()); ability.getTargets().clear(); TargetPlayer target = new TargetPlayer(1, 1, false, filter); + target.setTargetController(activePlayer.getId()); ability.getTargets().add(target); + for (Effect effect : ability.getEffects()) { + if (effect instanceof SearchLibraryPutInPlayTargetPlayerEffect) { + effect.setTargetPointer(new FixedTarget(activePlayer.getId())); + } + } } } } @@ -119,4 +128,4 @@ class OathOfLiegesPredicate implements ObjectSourcePlayerPredicate choices = new HashSet<>(); + + static { + choices.add("+0/+1"); + choices.add("+1/+0"); + } + + public DwarvenArmorerEffect() { + super(Outcome.Benefit); + staticText = "Put a +0/+1 counter or a +1/+0 counter on target creature."; + } + + public DwarvenArmorerEffect(final DwarvenArmorerEffect effect) { + super(effect); + } + + @java.lang.Override + public DwarvenArmorerEffect copy() { + return new DwarvenArmorerEffect(this); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if(controller != null) { + Choice choice = new ChoiceImpl(true); + choice.setMessage("Choose type of counter to add"); + choice.setChoices(choices); + while(!controller.choose(outcome, choice, game)) { + if(controller.canRespond()) { + return false; + } + } + Counter counter = choice.getChoice().equals("+0/+1") ? CounterType.P0P1.createInstance() : CounterType.P1P0.createInstance(); + Effect effect = new AddCountersTargetEffect(counter); + effect.setTargetPointer(new FixedTarget(this.getTargetPointer().getFirst(game, source))); + return effect.apply(game, source); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/DwarvenLieutenant.java b/Mage.Sets/src/mage/sets/fallenempires/DwarvenLieutenant.java new file mode 100644 index 00000000000..2cc864b9fc7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/DwarvenLieutenant.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DwarvenLieutenant extends CardImpl { + + static FilterCreaturePermanent filter = new FilterCreaturePermanent("Dwarf creature"); + + static { + filter.add(new SubtypePredicate("Dwarf")); + } + + public DwarvenLieutenant(UUID ownerId) { + super(ownerId, 106, "Dwarven Lieutenant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{R}{R}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Dwarf"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {1}{R}: Target Dwarf creature gets +1/+0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{1}{R}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public DwarvenLieutenant(final DwarvenLieutenant card) { + super(card); + } + + @Override + public DwarvenLieutenant copy() { + return new DwarvenLieutenant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/EbonPraetor.java b/Mage.Sets/src/mage/sets/fallenempires/EbonPraetor.java new file mode 100644 index 00000000000..2f78159108d --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/EbonPraetor.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EbonPraetor extends mage.sets.masterseditionii.EbonPraetor { + + public EbonPraetor(UUID ownerId) { + super(ownerId); + this.cardNumber = 11; + this.expansionSetCode = "FEM"; + } + + public EbonPraetor(final EbonPraetor card) { + super(card); + } + + @Override + public EbonPraetor copy() { + return new EbonPraetor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/ElvenFortress1.java b/Mage.Sets/src/mage/sets/fallenempires/ElvenFortress1.java new file mode 100644 index 00000000000..2e5618016c8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/ElvenFortress1.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterBlockingCreature; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ElvenFortress1 extends CardImpl { + + public ElvenFortress1(UUID ownerId) { + super(ownerId, 67, "Elven Fortress", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); + this.expansionSetCode = "FEM"; + + // {1}{G}: Target blocking creature gets +0/+1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{1}{G}")); + ability.addTarget(new TargetCreaturePermanent(new FilterBlockingCreature())); + this.addAbility(ability); + } + + public ElvenFortress1(final ElvenFortress1 card) { + super(card); + } + + @Override + public ElvenFortress1 copy() { + return new ElvenFortress1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/ElvenFortress2.java b/Mage.Sets/src/mage/sets/fallenempires/ElvenFortress2.java new file mode 100644 index 00000000000..c454d76e92c --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/ElvenFortress2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ElvenFortress2 extends ElvenFortress1 { + + public ElvenFortress2(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + } + + public ElvenFortress2(final ElvenFortress2 card) { + super(card); + } + + @Override + public ElvenFortress2 copy() { + return new ElvenFortress2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/ElvenFortress3.java b/Mage.Sets/src/mage/sets/fallenempires/ElvenFortress3.java new file mode 100644 index 00000000000..2af6a0b26af --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/ElvenFortress3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ElvenFortress3 extends ElvenFortress1 { + + public ElvenFortress3(UUID ownerId) { + super(ownerId); + this.cardNumber = 69; + } + + public ElvenFortress3(final ElvenFortress3 card) { + super(card); + } + + @Override + public ElvenFortress3 copy() { + return new ElvenFortress3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/ElvenFortress4.java b/Mage.Sets/src/mage/sets/fallenempires/ElvenFortress4.java new file mode 100644 index 00000000000..70e5a5e6ac7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/ElvenFortress4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ElvenFortress4 extends ElvenFortress1 { + + public ElvenFortress4(UUID ownerId) { + super(ownerId); + this.cardNumber = 70; + } + + public ElvenFortress4(final ElvenFortress4 card) { + super(card); + } + + @Override + public ElvenFortress4 copy() { + return new ElvenFortress4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/ElvenLyre.java b/Mage.Sets/src/mage/sets/fallenempires/ElvenLyre.java new file mode 100644 index 00000000000..8657136f098 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/ElvenLyre.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ElvenLyre extends mage.sets.masterseditionii.ElvenLyre { + + public ElvenLyre(UUID ownerId) { + super(ownerId); + this.cardNumber = 172; + this.expansionSetCode = "FEM"; + this.rarity = Rarity.RARE; + } + + public ElvenLyre(final ElvenLyre card) { + super(card); + } + + @Override + public ElvenLyre copy() { + return new ElvenLyre(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/ElvishFarmer.java b/Mage.Sets/src/mage/sets/fallenempires/ElvishFarmer.java new file mode 100644 index 00000000000..6433c34c226 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/ElvishFarmer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ElvishFarmer extends mage.sets.masterseditionii.ElvishFarmer { + + public ElvishFarmer(UUID ownerId) { + super(ownerId); + this.cardNumber = 71; + this.expansionSetCode = "FEM"; + } + + public ElvishFarmer(final ElvishFarmer card) { + super(card); + } + + @Override + public ElvishFarmer copy() { + return new ElvishFarmer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/ElvishScout1.java b/Mage.Sets/src/mage/sets/fallenempires/ElvishScout1.java new file mode 100644 index 00000000000..c8e09605ef3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/ElvishScout1.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ElvishScout1 extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("attacking creature you control"); + + static { + filter.add(new AttackingPredicate()); + } + + public ElvishScout1(UUID ownerId) { + super(ownerId, 75, "Elvish Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Elf"); + this.subtype.add("Scout"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {G}, {tap}: Untap target attacking creature you control. Prevent all combat damage that would be dealt to and dealt by it this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ManaCostsImpl("{G}")); + ability.addCost(new TapSourceCost()); + Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true); + effect.setText("Prevent all combat damage that would be dealt to"); + ability.addEffect(effect); + effect = new PreventDamageToTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE, true); + effect.setText("and dealt by it this turn"); + ability.addEffect(effect); + ability.addTarget(new TargetControlledCreaturePermanent(filter)); + this.addAbility(ability); + } + + public ElvishScout1(final ElvishScout1 card) { + super(card); + } + + @Override + public ElvishScout1 copy() { + return new ElvishScout1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/ElvishScout2.java b/Mage.Sets/src/mage/sets/fallenempires/ElvishScout2.java new file mode 100644 index 00000000000..4f127a27cca --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/ElvishScout2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ElvishScout2 extends ElvishScout1 { + + public ElvishScout2(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + } + + public ElvishScout2(final ElvishScout2 card) { + super(card); + } + + @Override + public ElvishScout2 copy() { + return new ElvishScout2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/ElvishScout3.java b/Mage.Sets/src/mage/sets/fallenempires/ElvishScout3.java new file mode 100644 index 00000000000..061983d0f8b --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/ElvishScout3.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ElvishScout3 extends ElvishScout1 { + + public ElvishScout3(UUID ownerId) { + super(ownerId); + this.cardNumber = 77; + } + + public ElvishScout3(final ElvishScout3 card) { + super(card); + } + + @Override + public ElvishScout3 copy() { + return new ElvishScout3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot1.java b/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot1.java new file mode 100644 index 00000000000..808050be6d3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot1.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.AssignNoCombatDamageSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FarrelsZealot1 extends CardImpl { + + public FarrelsZealot1(UUID ownerId) { + super(ownerId, 139, "Farrel's Zealot", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Human"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Farrel's Zealot attacks and isn't blocked, you may have it deal 3 damage to target creature. If you do, Farrel's Zealot assigns no combat damage this turn. + Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(new DamageTargetEffect(3), true); + ability.addEffect(new AssignNoCombatDamageSourceEffect(Duration.EndOfTurn, true)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FarrelsZealot1(final FarrelsZealot1 card) { + super(card); + } + + @Override + public FarrelsZealot1 copy() { + return new FarrelsZealot1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot2.java b/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot2.java new file mode 100644 index 00000000000..f87feed1cdc --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FarrelsZealot2 extends FarrelsZealot1 { + + public FarrelsZealot2(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + } + + public FarrelsZealot2(final FarrelsZealot2 card) { + super(card); + } + + @Override + public FarrelsZealot2 copy() { + return new FarrelsZealot2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot3.java b/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot3.java new file mode 100644 index 00000000000..af5d84df989 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/FarrelsZealot3.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FarrelsZealot3 extends FarrelsZealot1 { + + public FarrelsZealot3(UUID ownerId) { + super(ownerId); + this.cardNumber = 141; + } + + public FarrelsZealot3(final FarrelsZealot3 card) { + super(card); + } + + @Override + public FarrelsZealot3 copy() { + return new FarrelsZealot3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/FungalBloom.java b/Mage.Sets/src/mage/sets/fallenempires/FungalBloom.java new file mode 100644 index 00000000000..5f7689c0988 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/FungalBloom.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class FungalBloom extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Fungus"); + + static { + filter.add(new SubtypePredicate("Fungus")); + } + + public FungalBloom(UUID ownerId) { + super(ownerId, 79, "Fungal Bloom", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G}{G}"); + this.expansionSetCode = "FEM"; + + // {G}{G}: Put a spore counter on target Fungus. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new AddCountersTargetEffect(CounterType.SPORE.createInstance()), + new ManaCostsImpl("{G}{G}")); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public FungalBloom(final FungalBloom card) { + super(card); + } + + @Override + public FungalBloom copy() { + return new FungalBloom(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/Homarid1.java b/Mage.Sets/src/mage/sets/fallenempires/Homarid1.java new file mode 100644 index 00000000000..a69771b1056 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/Homarid1.java @@ -0,0 +1,120 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.StateTriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.SourceHasCounterCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.RemoveAllCountersSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author LoneFox + */ +public class Homarid1 extends CardImpl { + + public Homarid1(UUID ownerId) { + super(ownerId, 38, "Homarid", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Homarid"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Homarid enters the battlefield with a tide counter on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIDE.createInstance()), + "with a tide counter on it.")); + // At the beginning of your upkeep, put a tide counter on Homarid. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.TIDE.createInstance()), + TargetController.YOU, false)); + // As long as there is exactly one tide counter on Homarid, it gets -1/-1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(-1, -1, Duration.WhileOnBattlefield), new SourceHasCounterCondition(CounterType.TIDE, 1, 1), + "As long as there is exactly one tide counter on {this}, it gets -1/-1."))); + // As long as there are exactly three tide counters on Homarid, it gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), new SourceHasCounterCondition(CounterType.TIDE, 3, 3), + "As long as there are exactly three tide counter on {this}, it gets +1/+1."))); + // Whenever there are four tide counters on Homarid, remove all tide counters from it. + this.addAbility(new HomaridTriggeredAbility(new RemoveAllCountersSourceEffect(CounterType.TIDE))); + } + + public Homarid1(final Homarid1 card) { + super(card); + } + + @Override + public Homarid1 copy() { + return new Homarid1(this); + } +} + +class HomaridTriggeredAbility extends StateTriggeredAbility { + + public HomaridTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + } + + public HomaridTriggeredAbility(final HomaridTriggeredAbility ability) { + super(ability); + } + + @Override + public HomaridTriggeredAbility copy() { + return new HomaridTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return new CountersCount(CounterType.TIDE).calculate(game, this, null) == 4; + } + + @Override + public String getRule() { + return "Whenever there are four tide counters on {this}, " + super.getRule(); + } + +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/Homarid2.java b/Mage.Sets/src/mage/sets/fallenempires/Homarid2.java new file mode 100644 index 00000000000..51d33e80bb5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/Homarid2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Homarid2 extends Homarid1 { + + public Homarid2(UUID ownerId) { + super(ownerId); + this.cardNumber = 39; + } + + public Homarid2(final Homarid2 card) { + super(card); + } + + @Override + public Homarid2 copy() { + return new Homarid2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/Homarid3.java b/Mage.Sets/src/mage/sets/fallenempires/Homarid3.java new file mode 100644 index 00000000000..f42970458e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/Homarid3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Homarid3 extends Homarid1 { + + public Homarid3(UUID ownerId) { + super(ownerId); + this.cardNumber = 40; + } + + public Homarid3(final Homarid3 card) { + super(card); + } + + @Override + public Homarid3 copy() { + return new Homarid3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/Homarid4.java b/Mage.Sets/src/mage/sets/fallenempires/Homarid4.java new file mode 100644 index 00000000000..4ae2066c646 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/Homarid4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Homarid4 extends Homarid1 { + + public Homarid4(UUID ownerId) { + super(ownerId); + this.cardNumber = 41; + } + + public Homarid4(final Homarid4 card) { + super(card); + } + + @Override + public Homarid4 copy() { + return new Homarid4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/HomaridShaman.java b/Mage.Sets/src/mage/sets/fallenempires/HomaridShaman.java new file mode 100644 index 00000000000..e092c8daa75 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/HomaridShaman.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class HomaridShaman extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public HomaridShaman(UUID ownerId) { + super(ownerId, 42, "Homarid Shaman", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Homarid"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // {U}: Tap target green creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{U}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public HomaridShaman(final HomaridShaman card) { + super(card); + } + + @Override + public HomaridShaman copy() { + return new HomaridShaman(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/HomaridWarrior1.java b/Mage.Sets/src/mage/sets/fallenempires/HomaridWarrior1.java new file mode 100644 index 00000000000..24114869260 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/HomaridWarrior1.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepSourceEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class HomaridWarrior1 extends CardImpl { + + public HomaridWarrior1(UUID ownerId) { + super(ownerId, 44, "Homarid Warrior", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Homarid"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {U}: Homarid Warrior gains shroud until end of turn and doesn't untap during your next untap step. Tap Homarid Warrior. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect( + ShroudAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{U}")); + Effect effect = new DontUntapInControllersNextUntapStepSourceEffect(); + effect.setText("and doesn't untap during your next untap step"); + ability.addEffect(effect); + ability.addEffect(new TapSourceEffect()); + this.addAbility(ability); + } + + public HomaridWarrior1(final HomaridWarrior1 card) { + super(card); + } + + @Override + public HomaridWarrior1 copy() { + return new HomaridWarrior1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/HomaridWarrior2.java b/Mage.Sets/src/mage/sets/fallenempires/HomaridWarrior2.java new file mode 100644 index 00000000000..f927b68c666 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/HomaridWarrior2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class HomaridWarrior2 extends HomaridWarrior1 { + + public HomaridWarrior2(UUID ownerId) { + super(ownerId); + this.cardNumber = 45; + } + + public HomaridWarrior2(final HomaridWarrior2 card) { + super(card); + } + + @Override + public HomaridWarrior2 copy() { + return new HomaridWarrior2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/HomaridWarrior3.java b/Mage.Sets/src/mage/sets/fallenempires/HomaridWarrior3.java new file mode 100644 index 00000000000..92ba080f52c --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/HomaridWarrior3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class HomaridWarrior3 extends HomaridWarrior1 { + + public HomaridWarrior3(UUID ownerId) { + super(ownerId); + this.cardNumber = 46; + } + + public HomaridWarrior3(final HomaridWarrior3 card) { + super(card); + } + + @Override + public HomaridWarrior3 copy() { + return new HomaridWarrior3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers3.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers3.java index 85649357295..bd805f28bfe 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers3.java +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers3.java @@ -25,7 +25,7 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ -package mage.sets.timeshifted; +package mage.sets.fallenempires; import java.util.UUID; import mage.constants.Rarity; diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianLieutenant.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianLieutenant.java new file mode 100644 index 00000000000..edb92cc6d97 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianLieutenant.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class IcatianLieutenant extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Soldier creature"); + + static { + filter.add(new SubtypePredicate("Soldier")); + } + + public IcatianLieutenant(UUID ownerId) { + super(ownerId, 151, "Icatian Lieutenant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{W}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {1}{W}: Target Soldier creature gets +1/+0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{1}{W}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public IcatianLieutenant(final IcatianLieutenant card) { + super(card); + } + + @Override + public IcatianLieutenant copy() { + return new IcatianLieutenant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianScout1.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout1.java new file mode 100644 index 00000000000..dbbff9b4d93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout1.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class IcatianScout1 extends mage.sets.masterseditionii.IcatianScout { + + public IcatianScout1(UUID ownerId) { + super(ownerId); + this.cardNumber = 157; + this.expansionSetCode = "FEM"; + } + + public IcatianScout1(final IcatianScout1 card) { + super(card); + } + + @Override + public IcatianScout1 copy() { + return new IcatianScout1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianScout2.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout2.java new file mode 100644 index 00000000000..325181c2609 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class IcatianScout2 extends mage.sets.masterseditionii.IcatianScout { + + public IcatianScout2(UUID ownerId) { + super(ownerId); + this.cardNumber = 158; + this.expansionSetCode = "FEM"; + } + + public IcatianScout2(final IcatianScout2 card) { + super(card); + } + + @Override + public IcatianScout2 copy() { + return new IcatianScout2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianScout3.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout3.java new file mode 100644 index 00000000000..0fe56bc4118 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout3.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class IcatianScout3 extends mage.sets.masterseditionii.IcatianScout { + + public IcatianScout3(UUID ownerId) { + super(ownerId); + this.cardNumber = 159; + this.expansionSetCode = "FEM"; + } + + public IcatianScout3(final IcatianScout3 card) { + super(card); + } + + @Override + public IcatianScout3 copy() { + return new IcatianScout3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianScout4.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout4.java new file mode 100644 index 00000000000..06810fad545 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout4.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class IcatianScout4 extends mage.sets.masterseditionii.IcatianScout { + + public IcatianScout4(UUID ownerId) { + super(ownerId); + this.cardNumber = 160; + this.expansionSetCode = "FEM"; + } + + public IcatianScout4(final IcatianScout4 card) { + super(card); + } + + @Override + public IcatianScout4 copy() { + return new IcatianScout4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/MindstabThrull1.java b/Mage.Sets/src/mage/sets/fallenempires/MindstabThrull1.java new file mode 100644 index 00000000000..aa808c7a34d --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/MindstabThrull1.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MindstabThrull1 extends mage.sets.mastersedition.MindstabThrull { + + public MindstabThrull1(UUID ownerId) { + super(ownerId); + this.cardNumber = 19; + this.expansionSetCode = "FEM"; + } + + public MindstabThrull1(final MindstabThrull1 card) { + super(card); + } + + @Override + public MindstabThrull1 copy() { + return new MindstabThrull1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/MindstabThrull2.java b/Mage.Sets/src/mage/sets/fallenempires/MindstabThrull2.java new file mode 100644 index 00000000000..73e816795d5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/MindstabThrull2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MindstabThrull2 extends mage.sets.mastersedition.MindstabThrull { + + public MindstabThrull2(UUID ownerId) { + super(ownerId); + this.cardNumber = 20; + this.expansionSetCode = "FEM"; + } + + public MindstabThrull2(final MindstabThrull2 card) { + super(card); + } + + @Override + public MindstabThrull2 copy() { + return new MindstabThrull2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/MindstabThrull3.java b/Mage.Sets/src/mage/sets/fallenempires/MindstabThrull3.java new file mode 100644 index 00000000000..b4e3420b828 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/MindstabThrull3.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MindstabThrull3 extends mage.sets.mastersedition.MindstabThrull { + + public MindstabThrull3(UUID ownerId) { + super(ownerId); + this.cardNumber = 21; + this.expansionSetCode = "FEM"; + } + + public MindstabThrull3(final MindstabThrull3 card) { + super(card); + } + + @Override + public MindstabThrull3 copy() { + return new MindstabThrull3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/NightSoil2.java b/Mage.Sets/src/mage/sets/fallenempires/NightSoil2.java index 09706ba97b5..b691888fe0a 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/NightSoil2.java +++ b/Mage.Sets/src/mage/sets/fallenempires/NightSoil2.java @@ -25,7 +25,7 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ -package mage.sets.masterseditionii; +package mage.sets.fallenempires; import java.util.UUID; import mage.constants.Rarity; diff --git a/Mage.Sets/src/mage/sets/fallenempires/NightSoil3.java b/Mage.Sets/src/mage/sets/fallenempires/NightSoil3.java index 7289331f5f6..0acc86c5305 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/NightSoil3.java +++ b/Mage.Sets/src/mage/sets/fallenempires/NightSoil3.java @@ -25,7 +25,7 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ -package mage.sets.masterseditionii; +package mage.sets.fallenempires; import java.util.UUID; import mage.constants.Rarity; diff --git a/Mage.Sets/src/mage/sets/fallenempires/RingOfRenewal.java b/Mage.Sets/src/mage/sets/fallenempires/RingOfRenewal.java new file mode 100644 index 00000000000..4d9b13c8182 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/RingOfRenewal.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class RingOfRenewal extends mage.sets.masterseditioniv.RingOfRenewal { + + public RingOfRenewal(UUID ownerId) { + super(ownerId); + this.cardNumber = 174; + this.expansionSetCode = "FEM"; + } + + public RingOfRenewal(final RingOfRenewal card) { + super(card); + } + + @Override + public RingOfRenewal copy() { + return new RingOfRenewal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/RiverMerfolk.java b/Mage.Sets/src/mage/sets/fallenempires/RiverMerfolk.java new file mode 100644 index 00000000000..8c42a0096a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/RiverMerfolk.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class RiverMerfolk extends mage.sets.mastersedition.RiverMerfolk { + + public RiverMerfolk(UUID ownerId) { + super(ownerId); + this.cardNumber = 51; + this.expansionSetCode = "FEM"; + this.rarity = Rarity.RARE; + } + + public RiverMerfolk(final RiverMerfolk card) { + super(card); + } + + @Override + public RiverMerfolk copy() { + return new RiverMerfolk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/SpiritShield.java b/Mage.Sets/src/mage/sets/fallenempires/SpiritShield.java new file mode 100644 index 00000000000..e87d4341153 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/SpiritShield.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SpiritShield extends CardImpl { + + public SpiritShield(UUID ownerId) { + super(ownerId, 175, "Spirit Shield", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "FEM"; + + // You may choose not to untap Spirit Shield during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {2}, {tap}: Target creature gets +0/+2 for as long as Spirit Shield remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostTargetEffect(0, 2, Duration.Custom), SourceTappedCondition.getInstance(), + "target creature gets +0/+2 for as long as {this} remains tapped"), new ManaCostsImpl("{2}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public SpiritShield(final SpiritShield card) { + super(card); + } + + @Override + public SpiritShield copy() { + return new SpiritShield(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/SporeFlower.java b/Mage.Sets/src/mage/sets/fallenempires/SporeFlower.java new file mode 100644 index 00000000000..adafcc64ef5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/SporeFlower.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.effects.common.PreventAllDamageByAllEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; + +/** + * + * @author fireshoes + */ +public class SporeFlower extends CardImpl { + + public SporeFlower(UUID ownerId) { + super(ownerId, 86, "Spore Flower", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}{G}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Fungus"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // At the beginning of your upkeep, put a spore counter on Spore Flower. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.SPORE.createInstance()), TargetController.YOU, false)); + + // Remove three spore counters from Spore Flower: Prevent all combat damage that would be dealt this turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new PreventAllDamageByAllEffect(Duration.EndOfTurn, true), + new RemoveCountersSourceCost(CounterType.SPORE.createInstance(3)))); + } + + public SporeFlower(final SporeFlower card) { + super(card); + } + + @Override + public SporeFlower copy() { + return new SporeFlower(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/TheloniteDruid.java b/Mage.Sets/src/mage/sets/fallenempires/TheloniteDruid.java new file mode 100644 index 00000000000..ded9f9f2cb8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/TheloniteDruid.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class TheloniteDruid extends mage.sets.masterseditionii.TheloniteDruid { + + public TheloniteDruid(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "FEM"; + this.rarity = Rarity.UNCOMMON; + } + + public TheloniteDruid(final TheloniteDruid card) { + super(card); + } + + @Override + public TheloniteDruid copy() { + return new TheloniteDruid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/TheloniteMonk.java b/Mage.Sets/src/mage/sets/fallenempires/TheloniteMonk.java new file mode 100644 index 00000000000..6c750b00896 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/TheloniteMonk.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author fireshoes + */ +public class TheloniteMonk extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("green creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public TheloniteMonk(UUID ownerId) { + super(ownerId, 93, "Thelonite Monk", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Insect"); + this.subtype.add("Monk"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {tap}, Sacrifice a green creature: Target land becomes a Forest. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.WhileOnBattlefield, "Forest"), new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + } + + public TheloniteMonk(final TheloniteMonk card) { + super(card); + } + + @Override + public TheloniteMonk copy() { + return new TheloniteMonk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/TidalInfluence.java b/Mage.Sets/src/mage/sets/fallenempires/TidalInfluence.java new file mode 100644 index 00000000000..5de52d6b938 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/TidalInfluence.java @@ -0,0 +1,167 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.StateTriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.SourceHasCounterCondition; +import mage.abilities.costs.CostImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.RemoveAllCountersSourceEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author LoneFox + */ +public class TidalInfluence extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blue creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public TidalInfluence(UUID ownerId) { + super(ownerId, 57, "Tidal Influence", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "FEM"; + + // Cast Tidal Influence only if no permanents named Tidal Influence are on the battlefield. + this.getSpellAbility().addCost(new TidalInfluenceCost()); + // Tidal Influence enters the battlefield with a tide counter on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIDE.createInstance()), + "with a tide counter on it.")); + // At the beginning of your upkeep, put a tide counter on Tidal Influence. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.TIDE.createInstance()), + TargetController.YOU, false)); + // As long as there is exactly one tide counter on Tidal Influence, all blue creatures get -2/-0. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostAllEffect(-2, -0, Duration.WhileOnBattlefield, filter, false), + new SourceHasCounterCondition(CounterType.TIDE, 1, 1), + "As long as there is exactly one tide counter on {this}, all blue creatures get -2/-0."))); + // As long as there are exactly three tide counters on Tidal Influence, all blue creatures get +2/+0. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostAllEffect(2, -0, Duration.WhileOnBattlefield, filter, false), + new SourceHasCounterCondition(CounterType.TIDE, 3, 3), + "As long as there are exactly three tide counter on {this}, all blue creatures get +2/-0."))); + // Whenever there are four tide counters on Tidal Influence, remove all tide counters from it. + this.addAbility(new TidalInfluenceTriggeredAbility(new RemoveAllCountersSourceEffect(CounterType.TIDE))); + } + + public TidalInfluence(final TidalInfluence card) { + super(card); + } + + @Override + public TidalInfluence copy() { + return new TidalInfluence(this); + } +} + + +class TidalInfluenceCost extends CostImpl { + + private static final FilterPermanent filter = new FilterPermanent(); + + static { + filter.add(new NamePredicate("Tidal Influence")); + } + + public TidalInfluenceCost() { + this.text = "Cast Tidal Influence only if no permanents named Tidal Influence are on the battlefield"; + } + + public TidalInfluenceCost(final TidalInfluenceCost cost) { + super(cost); + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + return !game.getBattlefield().contains(filter, 1, game); + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + this.paid = true; + return paid; + } + + @Override + public TidalInfluenceCost copy() { + return new TidalInfluenceCost(this); + } +} + + +class TidalInfluenceTriggeredAbility extends StateTriggeredAbility { + + public TidalInfluenceTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + } + + public TidalInfluenceTriggeredAbility(final TidalInfluenceTriggeredAbility ability) { + super(ability); + } + + @Override + public TidalInfluenceTriggeredAbility copy() { + return new TidalInfluenceTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return new CountersCount(CounterType.TIDE).calculate(game, this, null) == 4; + } + + @Override + public String getRule() { + return "Whenever there are four tide counters on {this}, " + super.getRule(); + } + +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/VodalianMage1.java b/Mage.Sets/src/mage/sets/fallenempires/VodalianMage1.java new file mode 100644 index 00000000000..ec3c12ddde3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/VodalianMage1.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + */ +public class VodalianMage1 extends CardImpl { + + public VodalianMage1(UUID ownerId) { + super(ownerId, 59, "Vodalian Mage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "FEM"; + this.subtype.add("Merfolk"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {U}, {tap}: Counter target spell unless its controller pays {1}. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new ManaCostsImpl("{1}")), + new ManaCostsImpl("{U}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetSpell()); + this.addAbility(ability); + } + + public VodalianMage1(final VodalianMage1 card) { + super(card); + } + + @Override + public VodalianMage1 copy() { + return new VodalianMage1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/VodalianMage2.java b/Mage.Sets/src/mage/sets/fallenempires/VodalianMage2.java new file mode 100644 index 00000000000..c1d98f22070 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/VodalianMage2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class VodalianMage2 extends VodalianMage1 { + + public VodalianMage2(UUID ownerId) { + super(ownerId); + this.cardNumber = 60; + } + + public VodalianMage2(final VodalianMage2 card) { + super(card); + } + + @Override + public VodalianMage2 copy() { + return new VodalianMage2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/VodalianMage3.java b/Mage.Sets/src/mage/sets/fallenempires/VodalianMage3.java new file mode 100644 index 00000000000..c7d1789e17f --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/VodalianMage3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class VodalianMage3 extends VodalianMage1 { + + public VodalianMage3(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + } + + public VodalianMage3(final VodalianMage3 card) { + super(card); + } + + @Override + public VodalianMage3 copy() { + return new VodalianMage3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/ZelyonSword.java b/Mage.Sets/src/mage/sets/fallenempires/ZelyonSword.java new file mode 100644 index 00000000000..5983121da70 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/ZelyonSword.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fallenempires; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ZelyonSword extends CardImpl { + + public ZelyonSword(UUID ownerId) { + super(ownerId, 176, "Zelyon Sword", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "FEM"; + + // You may choose not to untap Zelyon Sword during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {3}, {tap}: Target creature gets +2/+0 for as long as Zelyon Sword remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostTargetEffect(2, 0, Duration.Custom), SourceTappedCondition.getInstance(), + "target creature gets +2/+0 for as long as {this} remains tapped"), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ZelyonSword(final ZelyonSword card) { + super(card); + } + + @Override + public ZelyonSword copy() { + return new ZelyonSword(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fatereforged/AleshaWhoSmilesAtDeath.java b/Mage.Sets/src/mage/sets/fatereforged/AleshaWhoSmilesAtDeath.java index 48380d0e00c..512e63ad699 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/AleshaWhoSmilesAtDeath.java +++ b/Mage.Sets/src/mage/sets/fatereforged/AleshaWhoSmilesAtDeath.java @@ -45,7 +45,6 @@ import mage.filter.Filter; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.PowerPredicate; import mage.game.Game; -import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; @@ -72,11 +71,11 @@ public class AleshaWhoSmilesAtDeath extends CardImpl { // First strike this.addAbility(FirstStrikeAbility.getInstance()); - + // Whenever Alesha, Who Smiles at Death attacks, you may pay {W/B}{W/B}. If you do, return target creature card with power 2 or less from your graveyard to the battlefield tapped and attacking. Ability ability = new AttacksTriggeredAbility(new DoIfCostPaid(new AleshaWhoSmilesAtDeathEffect(), new ManaCostsImpl("{W/B}{W/B}")), false); ability.addTarget(new TargetCardInYourGraveyard(filter)); - this.addAbility(ability); + this.addAbility(ability); } public AleshaWhoSmilesAtDeath(final AleshaWhoSmilesAtDeath card) { @@ -107,9 +106,8 @@ class AleshaWhoSmilesAtDeathEffect extends OneShotEffect { if (controller != null) { Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null) { - if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId(), true)) { - Permanent permanent = game.getPermanent(card.getId()); - game.getCombat().addAttackingCreature(permanent.getId(), game); + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null)) { + game.getCombat().addAttackingCreature(card.getId(), game); } } return true; diff --git a/Mage.Sets/src/mage/sets/fatereforged/Arcbond.java b/Mage.Sets/src/mage/sets/fatereforged/Arcbond.java index 5b12862c707..c79cd10e84d 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/Arcbond.java +++ b/Mage.Sets/src/mage/sets/fatereforged/Arcbond.java @@ -62,7 +62,7 @@ public class Arcbond extends CardImpl { this.expansionSetCode = "FRF"; // Choose target creature. Whenever that creature is dealt damage this turn, it deals that much damage to each other creature and each player. - this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new ArcbondDelayedTriggeredAbility(), true)); + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new ArcbondDelayedTriggeredAbility(), true, true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } @@ -117,8 +117,8 @@ class ArcbondDelayedTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getTargetId().equals(targetObject.getSourceId()) && - targetObject.getPermanentOrLKIBattlefield(game) != null) { + if (event.getTargetId().equals(targetObject.getSourceId()) + && targetObject.getPermanentOrLKIBattlefield(game) != null) { for (Effect effect : this.getEffects()) { effect.setValue("damage", event.getAmount()); } @@ -139,21 +139,21 @@ class ArcbondDelayedTriggeredAbility extends DelayedTriggeredAbility { } class ArcbondEffect extends OneShotEffect { - + public ArcbondEffect() { super(Outcome.Benefit); this.staticText = "it deals that much damage to each other creature and each player"; } - + public ArcbondEffect(final ArcbondEffect effect) { super(effect); } - + @Override public ArcbondEffect copy() { return new ArcbondEffect(this); } - + @Override public boolean apply(Game game, Ability source) { int damage = (Integer) this.getValue("damage"); @@ -167,7 +167,7 @@ class ArcbondEffect extends OneShotEffect { FilterPermanent filter = new FilterCreaturePermanent("each other creature"); filter.add(Predicates.not(new PermanentIdPredicate(sourceId))); return new DamageEverythingEffect(new StaticValue(damage), filter, sourceId).apply(game, source); - } + } return false; } } diff --git a/Mage.Sets/src/mage/sets/fatereforged/CitadelSiege.java b/Mage.Sets/src/mage/sets/fatereforged/CitadelSiege.java index 8914495c7f5..01b26cd052d 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/CitadelSiege.java +++ b/Mage.Sets/src/mage/sets/fatereforged/CitadelSiege.java @@ -61,7 +61,7 @@ public class CitadelSiege extends CardImpl { this.expansionSetCode = "FRF"; // As Citadel Siege enters the battlefield, choose Khans or Dragons. - this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?","Khans", "Dragons"),null, true, + this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?","Khans", "Dragons"),null, "As {this} enters the battlefield, choose Khans or Dragons.","")); // * Khans - At the beginning of combat on your turn, put two +1/+1 counters on target creature you control. diff --git a/Mage.Sets/src/mage/sets/fatereforged/DarkDeal.java b/Mage.Sets/src/mage/sets/fatereforged/DarkDeal.java index ae2ee332e95..d9530570948 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/DarkDeal.java +++ b/Mage.Sets/src/mage/sets/fatereforged/DarkDeal.java @@ -27,6 +27,8 @@ */ package mage.sets.fatereforged; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; @@ -81,16 +83,23 @@ class DarkDealEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (UUID playerId : controller.getInRange()) { + Map cardsToDraw = new LinkedHashMap<>(); + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { int cardsInHand = player.getHand().size(); player.discard(cardsInHand, false, source, game); if (cardsInHand > 1) { - player.drawCards(cardsInHand - 1, game); + cardsToDraw.put(playerId, cardsInHand - 1); } } } + for (UUID playerId : cardsToDraw.keySet()) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.drawCards(cardsToDraw.get(playerId), game); + } + } return true; } return false; diff --git a/Mage.Sets/src/mage/sets/fatereforged/FlamerushRider.java b/Mage.Sets/src/mage/sets/fatereforged/FlamerushRider.java index 6775848ca06..784e936b901 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/FlamerushRider.java +++ b/Mage.Sets/src/mage/sets/fatereforged/FlamerushRider.java @@ -36,6 +36,7 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.keyword.DashAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -46,11 +47,9 @@ import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.AttackingPredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.players.Player; import mage.target.TargetPermanent; import mage.target.targetpointer.FixedTarget; -import mage.util.CardUtil; /** * @@ -113,12 +112,14 @@ class FlamerushRiderEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); if (controller != null && permanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), true, true); - Effect effect = new ExileTargetEffect(); - effect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect), false).apply(game, source); + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, true, 1, true, true); + effect.setTargetPointer(new FixedTarget(permanent, game)); + effect.apply(game, source); + for (Permanent addedToken : effect.getAddedPermanent()) { + Effect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(addedToken, game)); + new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect), false).apply(game, source); + } return true; } return false; diff --git a/Mage.Sets/src/mage/sets/fatereforged/FrontierMastodon.java b/Mage.Sets/src/mage/sets/fatereforged/FrontierMastodon.java index 9de1b018b1e..008f8a3c2c4 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/FrontierMastodon.java +++ b/Mage.Sets/src/mage/sets/fatereforged/FrontierMastodon.java @@ -53,7 +53,7 @@ public class FrontierMastodon extends CardImpl { // Ferocious - Frontier Mastodon enters the battlefield with a +1/+1 counter on it if you control a creature with power 4 or greater. this.addAbility(new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), - FerociousCondition.getInstance(), true, + FerociousCondition.getInstance(), "Ferocious — {this} enters the battlefield with a +1/+1 counter on it if you control a creature with power 4 or greater.","" )); } diff --git a/Mage.Sets/src/mage/sets/fatereforged/FrontierSiege.java b/Mage.Sets/src/mage/sets/fatereforged/FrontierSiege.java index f02ca1e3c0b..1a98c5c215c 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/FrontierSiege.java +++ b/Mage.Sets/src/mage/sets/fatereforged/FrontierSiege.java @@ -76,7 +76,7 @@ public class FrontierSiege extends CardImpl { this.expansionSetCode = "FRF"; // As Frontier Siege enters the battlefield, choose Khans or Dragons. - this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, true, + this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, "As {this} enters the battlefield, choose Khans or Dragons.", "")); // * Khans - At the beginning of each of your main phases, add {G}{G} to your mana pool. diff --git a/Mage.Sets/src/mage/sets/fatereforged/GhastlyConscription.java b/Mage.Sets/src/mage/sets/fatereforged/GhastlyConscription.java index 333415da47a..746d4f6fe9f 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/GhastlyConscription.java +++ b/Mage.Sets/src/mage/sets/fatereforged/GhastlyConscription.java @@ -29,6 +29,8 @@ package mage.sets.fatereforged; import java.util.ArrayList; import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.Set; import java.util.UUID; import mage.MageObjectReference; import mage.abilities.Ability; @@ -96,15 +98,18 @@ class GhastlyConscriptionEffect extends OneShotEffect { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (controller != null && targetPlayer != null) { ArrayList cardsToManifest = new ArrayList<>(); - for(Card card: targetPlayer.getGraveyard().getCards(new FilterCreatureCard(), game)) { + for (Card card : targetPlayer.getGraveyard().getCards(new FilterCreatureCard(), game)) { cardsToManifest.add(card); controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true); } + if (cardsToManifest.isEmpty()) { + return true; + } Collections.shuffle(cardsToManifest); game.informPlayers(controller.getLogName() + " shuffles the face-down pile"); Ability newSource = source.copy(); newSource.setWorksFaceDown(true); - for (Card card: cardsToManifest) { + for (Card card : cardsToManifest) { ManaCosts manaCosts = null; if (card.getCardType().contains(CardType.CREATURE)) { manaCosts = card.getSpellAbility().getManaCosts(); @@ -112,13 +117,12 @@ class GhastlyConscriptionEffect extends OneShotEffect { manaCosts = new ManaCostsImpl("{0}"); } } - MageObjectReference objectReference= new MageObjectReference(card.getId(), card.getZoneChangeCounter(game) +1, game); + MageObjectReference objectReference = new MageObjectReference(card.getId(), card.getZoneChangeCounter(game) + 1, game); game.addEffect(new BecomesFaceDownCreatureEffect(manaCosts, objectReference, Duration.Custom, FaceDownType.MANIFESTED), newSource); - if (controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId(), false, true)) { - game.informPlayers(new StringBuilder(controller.getLogName()) - .append(" puts facedown card from exile onto the battlefield").toString()); - } } + Set toBattlefield = new LinkedHashSet(); + toBattlefield.addAll(cardsToManifest); + controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, true, false, null); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/fatereforged/HewedStoneRetainers.java b/Mage.Sets/src/mage/sets/fatereforged/HewedStoneRetainers.java index 4a9df6b2789..8d2e26b6d03 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/HewedStoneRetainers.java +++ b/Mage.Sets/src/mage/sets/fatereforged/HewedStoneRetainers.java @@ -29,18 +29,12 @@ package mage.sets.fatereforged; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.common.ruleModifying.CastOnlyIfYouHaveCastAnotherSpellEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.watchers.common.CastSpellLastTurnWatcher; /** * @@ -56,7 +50,7 @@ public class HewedStoneRetainers extends CardImpl { this.toughness = new MageInt(4); // Cast Hewed Stone Retainers only if you've cast another spell this turn. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new HewedStoneRetainersEffect())); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastOnlyIfYouHaveCastAnotherSpellEffect())); } public HewedStoneRetainers(final HewedStoneRetainers card) { @@ -69,40 +63,3 @@ public class HewedStoneRetainers extends CardImpl { } } -class HewedStoneRetainersEffect extends ContinuousRuleModifyingEffectImpl { - HewedStoneRetainersEffect() { - super(Duration.EndOfGame, Outcome.Detriment); - staticText = "Cast {this} only if you've cast another spell this turn"; - } - - HewedStoneRetainersEffect(final HewedStoneRetainersEffect effect) { - super(effect); - } - - @Override - public boolean checksEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.CAST_SPELL; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getSourceId().equals(source.getSourceId())) { - CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher"); - if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId()) == 0) { - return true; - } - } - return false; - - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public HewedStoneRetainersEffect copy() { - return new HewedStoneRetainersEffect(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/fatereforged/JeskaiInfiltrator.java b/Mage.Sets/src/mage/sets/fatereforged/JeskaiInfiltrator.java index 2b64b4db950..30fc48f26c6 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/JeskaiInfiltrator.java +++ b/Mage.Sets/src/mage/sets/fatereforged/JeskaiInfiltrator.java @@ -29,7 +29,9 @@ package mage.sets.fatereforged; import java.util.ArrayList; import java.util.Collections; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.UUID; import mage.MageInt; import mage.MageObjectReference; @@ -74,7 +76,7 @@ public class JeskaiInfiltrator extends CardImpl { Effect effect = new ConditionalRestrictionEffect(new CantBeBlockedSourceEffect(), new OneControlledCreatureCondition()); effect.setText("{this} can't be blocked as long as you control no other creatures"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); - + // Whenever Jeskai Infiltrator deals combat damage to a player, exile it and the top card of your library in a face-down pile, shuffle that pile, then manifest those cards. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new JeskaiInfiltratorEffect(), false)); } @@ -90,35 +92,35 @@ public class JeskaiInfiltrator extends CardImpl { } class JeskaiInfiltratorEffect extends OneShotEffect { - + JeskaiInfiltratorEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "exile it and the top card of your library in a face-down pile, shuffle that pile, then manifest those cards"; } - + JeskaiInfiltratorEffect(final JeskaiInfiltratorEffect effect) { super(effect); } - + @Override public JeskaiInfiltratorEffect copy() { return new JeskaiInfiltratorEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { List cardsToManifest = new ArrayList<>(2); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Card sourceCard = game.getCard(source.getSourceId()); - if (sourcePermanent != null && sourceCard != null) { - player.moveCardToExileWithInfo(sourcePermanent, sourcePermanent.getId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true); + if (sourcePermanent != null && sourceCard != null) { + controller.moveCardToExileWithInfo(sourcePermanent, sourcePermanent.getId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true); cardsToManifest.add(sourceCard); } - if (sourcePermanent!= null && player.getLibrary().size() > 0) { - Card cardFromLibrary = player.getLibrary().removeFromTop(game); - player.moveCardToExileWithInfo(cardFromLibrary, sourcePermanent.getId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true); + if (sourcePermanent != null && controller.getLibrary().size() > 0) { + Card cardFromLibrary = controller.getLibrary().removeFromTop(game); + controller.moveCardToExileWithInfo(cardFromLibrary, sourcePermanent.getId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true); cardsToManifest.add(cardFromLibrary); } Collections.shuffle(cardsToManifest); @@ -133,13 +135,12 @@ class JeskaiInfiltratorEffect extends OneShotEffect { manaCosts = new ManaCostsImpl("{0}"); } } - MageObjectReference objectReference= new MageObjectReference(card.getId(), card.getZoneChangeCounter(game) +1, game); - game.addEffect(new BecomesFaceDownCreatureEffect(manaCosts, objectReference, Duration.Custom, FaceDownType.MANIFESTED), newSource); - if (player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId(), false, true)) { - game.informPlayers(new StringBuilder(player.getLogName()) - .append(" puts facedown card from exile onto the battlefield").toString()); - } + MageObjectReference objectReference = new MageObjectReference(card.getId(), card.getZoneChangeCounter(game) + 1, game); + game.addEffect(new BecomesFaceDownCreatureEffect(manaCosts, objectReference, Duration.Custom, FaceDownType.MANIFESTED), newSource); } + Set toBattlefield = new LinkedHashSet(); + toBattlefield.addAll(cardsToManifest); + controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, true, false, null); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/fatereforged/MarduWoeReaper.java b/Mage.Sets/src/mage/sets/fatereforged/MarduWoeReaper.java index 15a433d0ea6..4b594d31ca4 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/MarduWoeReaper.java +++ b/Mage.Sets/src/mage/sets/fatereforged/MarduWoeReaper.java @@ -99,7 +99,7 @@ class MarduWoeReaperTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && (permanent.getId() == this.getSourceId() || permanent.hasSubtype("Warrior"))) { + if (permanent != null && (permanent.getId().equals(this.getSourceId()) || permanent.hasSubtype("Warrior"))) { return true; } } @@ -113,21 +113,21 @@ class MarduWoeReaperTriggeredAbility extends TriggeredAbilityImpl { } class MarduWoeReaperEffect extends OneShotEffect { - + MarduWoeReaperEffect() { super(Outcome.GainLife); this.staticText = "you may exile target creature card from a graveyard. If you do, you gain 1 life"; } - + MarduWoeReaperEffect(final MarduWoeReaperEffect effect) { super(effect); } - + @Override public MarduWoeReaperEffect copy() { return new MarduWoeReaperEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/fatereforged/MonasterySiege.java b/Mage.Sets/src/mage/sets/fatereforged/MonasterySiege.java index 799cfbb802d..9753a5cf199 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/MonasterySiege.java +++ b/Mage.Sets/src/mage/sets/fatereforged/MonasterySiege.java @@ -62,7 +62,7 @@ public class MonasterySiege extends CardImpl { this.expansionSetCode = "FRF"; // As Monastery Siege enters the battlefield, choose Khans or Dragons. - this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, true, + this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, "As {this} enters the battlefield, choose Khans or Dragons.", "")); // * Khans - At the beginning of your draw step, draw an additional card, then discard a card. diff --git a/Mage.Sets/src/mage/sets/fatereforged/OutpostSiege.java b/Mage.Sets/src/mage/sets/fatereforged/OutpostSiege.java index f49e7e15cc9..4ee0f6accad 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/OutpostSiege.java +++ b/Mage.Sets/src/mage/sets/fatereforged/OutpostSiege.java @@ -50,6 +50,7 @@ import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreatureOrPlayer; import mage.target.targetpointer.FixedTarget; @@ -68,8 +69,8 @@ public class OutpostSiege extends CardImpl { this.expansionSetCode = "FRF"; // As Outpost Siege enters the battlefield, choose Khans or Dragons. - this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?","Khans", "Dragons"),null, true, - "As {this} enters the battlefield, choose Khans or Dragons.","")); + this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, + "As {this} enters the battlefield, choose Khans or Dragons.", "")); // * Khans - At the beginning of your upkeep, exile the top card of your library. Until end of turn, you may play that card. this.addAbility(new ConditionalTriggeredAbility( @@ -80,10 +81,10 @@ public class OutpostSiege extends CardImpl { // * Dragons - Whenever a creature you control leaves the battlefield, Outpost Siege deals 1 damage to target creature or player. Ability ability2 = new ConditionalTriggeredAbility( new ZoneChangeAllTriggeredAbility(Zone.BATTLEFIELD, Zone.BATTLEFIELD, null, new DamageTargetEffect(1), - new FilterControlledCreaturePermanent(), "", false), + new FilterControlledCreaturePermanent(), "", false), new ModeChoiceSourceCondition("Dragons"), ruleTrigger2); - ability2.addTarget(new TargetCreatureOrPlayer()); + ability2.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability2); } @@ -117,13 +118,15 @@ class OutpostSiegeExileEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (controller != null && sourcePermanent != null) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { - controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, true); + String exileName = sourcePermanent.getIdName() + " cards = player.getGraveyard().getCards(filter, game); + player.moveCards(cards, Zone.BATTLEFIELD, source, game); for (Card card : cards) { if (card != null) { - if (player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) { + Permanent permanent = game.getPermanent(card.getId()); + if (permanent != null) { Effect exileEffect = new ExileTargetEffect("Exile those creatures at the beginning of your next upkeep"); - exileEffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); + exileEffect.setTargetPointer(new FixedTarget(permanent, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(exileEffect); delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setControllerId(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/fatereforged/Sandblast.java b/Mage.Sets/src/mage/sets/fatereforged/Sandblast.java index d2b497ee17d..46fd1e1e28f 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/Sandblast.java +++ b/Mage.Sets/src/mage/sets/fatereforged/Sandblast.java @@ -46,7 +46,8 @@ public class Sandblast extends CardImpl { // Sandblast deals 5 damage to target attacking or blocking creature. getSpellAbility().addEffect(new DamageTargetEffect(5)); - getSpellAbility().addTarget(new TargetAttackingOrBlockingCreature()); } + getSpellAbility().addTarget(new TargetAttackingOrBlockingCreature()); + } public Sandblast(final Sandblast card) { super(card); diff --git a/Mage.Sets/src/mage/sets/fatereforged/SupplantForm.java b/Mage.Sets/src/mage/sets/fatereforged/SupplantForm.java index 13914d02aac..d71e5462ee2 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/SupplantForm.java +++ b/Mage.Sets/src/mage/sets/fatereforged/SupplantForm.java @@ -28,18 +28,13 @@ package mage.sets.fatereforged; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.target.common.TargetCreaturePermanent; -import mage.util.CardUtil; /** * @@ -54,7 +49,9 @@ public class SupplantForm extends CardImpl { // Return target creature to its owner's hand. You put a token onto the battlefield that's a copy of that creature. this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new SupplantFormEffect()); + Effect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); + effect.setText("You put a token onto the battlefield that's a copy of that creature"); + this.getSpellAbility().addEffect(effect); } public SupplantForm(final SupplantForm card) { @@ -66,32 +63,3 @@ public class SupplantForm extends CardImpl { return new SupplantForm(this); } } - -class SupplantFormEffect extends OneShotEffect { - - public SupplantFormEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "You put a token onto the battlefield that's a copy of that creature"; - } - - public SupplantFormEffect(final SupplantFormEffect effect) { - super(effect); - } - - @Override - public SupplantFormEffect copy() { - return new SupplantFormEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent targetPermanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); - if (targetPermanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(targetPermanent); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/fatereforged/TorrentElemental.java b/Mage.Sets/src/mage/sets/fatereforged/TorrentElemental.java index d9590de8ffa..662d434e6df 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/TorrentElemental.java +++ b/Mage.Sets/src/mage/sets/fatereforged/TorrentElemental.java @@ -97,6 +97,7 @@ class ReturnSourceFromExileToBattlefieldEffect extends OneShotEffect { this.tapped = tapped; setText(); } + public ReturnSourceFromExileToBattlefieldEffect(boolean tapped, boolean ownerControl) { super(Outcome.PutCreatureInPlay); this.tapped = tapped; @@ -135,7 +136,7 @@ class ReturnSourceFromExileToBattlefieldEffect extends OneShotEffect { return false; } - return player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId(), tapped); + return player.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); } private void setText() { @@ -144,7 +145,7 @@ class ReturnSourceFromExileToBattlefieldEffect extends OneShotEffect { sb.append(" tapped"); } if (ownerControl) { - sb.append(" under its owner's control"); + sb.append(" under its owner's control"); } staticText = sb.toString(); } diff --git a/Mage.Sets/src/mage/sets/fatereforged/UginTheSpiritDragon.java b/Mage.Sets/src/mage/sets/fatereforged/UginTheSpiritDragon.java index 90ffdb0ca48..a7cbbf6bc0b 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/UginTheSpiritDragon.java +++ b/Mage.Sets/src/mage/sets/fatereforged/UginTheSpiritDragon.java @@ -30,19 +30,17 @@ package mage.sets.fatereforged; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.Filter.ComparisonType; import mage.filter.FilterPermanent; import mage.filter.common.FilterPermanentCard; @@ -59,7 +57,6 @@ import mage.target.common.TargetCreatureOrPlayer; * * @author LevelX2 */ - public class UginTheSpiritDragon extends CardImpl { public UginTheSpiritDragon(UUID ownerId) { @@ -67,7 +64,7 @@ public class UginTheSpiritDragon extends CardImpl { this.expansionSetCode = "FRF"; this.subtype.add("Ugin"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(7)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(7)); // +2: Ugin, the Spirit Dragon deals 3 damage to target creature or player. LoyaltyAbility ability = new LoyaltyAbility(new DamageTargetEffect(3), 2); @@ -126,7 +123,7 @@ class UginTheSpiritDragonEffect2 extends OneShotEffect { FilterPermanent filter = new FilterPermanent("permanent with converted mana cost X or less that's one or more colors"); filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, cmc + 1)); filter.add(Predicates.not(new ColorlessPredicate())); - for(Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true); } return true; @@ -157,12 +154,7 @@ class UginTheSpiritDragonEffect3 extends OneShotEffect { controller.drawCards(7, game); TargetCardInHand target = new TargetCardInHand(0, 7, new FilterPermanentCard("permanent cards")); if (controller.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) { - for (UUID targetId: target.getTargets()) { - Card card = game.getCard(targetId); - if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getControllerId()); - } - } + controller.moveCards(new CardsImpl(target.getTargets()), Zone.BATTLEFIELD, source, game); } return true; } diff --git a/Mage.Sets/src/mage/sets/fatereforged/WardscaleDragon.java b/Mage.Sets/src/mage/sets/fatereforged/WardscaleDragon.java index fadb7c5a883..61869d47454 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/WardscaleDragon.java +++ b/Mage.Sets/src/mage/sets/fatereforged/WardscaleDragon.java @@ -58,11 +58,10 @@ public class WardscaleDragon extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // As long as Wardscale Dragon is attacking, defending player can't cast spells. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WardscaleDragonRuleEffect())); - - + } public WardscaleDragon(final WardscaleDragon card) { @@ -105,7 +104,7 @@ class WardscaleDragonRuleEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (sourcePermanent != null && sourcePermanent.isAttacking()) { - return event.getPlayerId() == game.getCombat().getDefendingPlayerId(sourcePermanent.getId(), game); + return event.getPlayerId().equals(game.getCombat().getDefendingPlayerId(sourcePermanent.getId(), game)); } return false; } diff --git a/Mage.Sets/src/mage/sets/fatereforged/WildSlash.java b/Mage.Sets/src/mage/sets/fatereforged/WildSlash.java index 054006c589f..b2e5a665275 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/WildSlash.java +++ b/Mage.Sets/src/mage/sets/fatereforged/WildSlash.java @@ -29,7 +29,6 @@ package mage.sets.fatereforged; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.LockedInCondition; import mage.abilities.condition.common.FerociousCondition; import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect; @@ -41,7 +40,6 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.target.common.TargetCreatureOrPlayer; @@ -60,12 +58,12 @@ public class WildSlash extends CardImpl { ContinuousRuleModifyingEffect effect = new DamageCantBePreventedEffect(); effect.setText("Ferocious — If you control a creature with power 4 or greater, damage can't be prevented this turn.
"); this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect(effect, - new LockedInCondition(FerociousCondition.getInstance()))); - + new LockedInCondition(FerociousCondition.getInstance()))); + // Wild Slash deals 2 damage to target creature or player. this.getSpellAbility().addEffect(new DamageTargetEffect(2)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - + } public WildSlash(final WildSlash card) { diff --git a/Mage.Sets/src/mage/sets/fifthdawn/Acquire.java b/Mage.Sets/src/mage/sets/fifthdawn/Acquire.java index 2ed36891b4a..bae08d67839 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/Acquire.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/Acquire.java @@ -1,5 +1,6 @@ package mage.sets.fifthdawn; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; @@ -15,17 +16,15 @@ import mage.players.Player; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetOpponent; -import java.util.UUID; - /** * @author andyfries */ -public class Acquire extends CardImpl{ +public class Acquire extends CardImpl { + public Acquire(UUID ownerId) { super(ownerId, 21, "Acquire", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); this.expansionSetCode = "5DN"; - // Search target opponent's library for an artifact card and put that card onto the battlefield under your control. // Then that player shuffles his or her library. this.getSpellAbility().addEffect(new AcquireEffect()); @@ -68,7 +67,7 @@ class AcquireEffect extends OneShotEffect { controller.searchLibrary(target, game, opponent.getId()); Card targetCard = game.getCard(target.getFirstTarget()); if (targetCard != null) { - controller.putOntoBattlefieldWithInfo(targetCard, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(targetCard, Zone.BATTLEFIELD, source, game); } opponent.shuffleLibrary(game); return true; @@ -81,4 +80,3 @@ class AcquireEffect extends OneShotEffect { return new AcquireEffect(this); } } - diff --git a/Mage.Sets/src/mage/sets/fifthdawn/DawnsReflection.java b/Mage.Sets/src/mage/sets/fifthdawn/DawnsReflection.java index 417381b270e..697e71390f0 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/DawnsReflection.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/DawnsReflection.java @@ -108,7 +108,7 @@ class DawnsReflectionTriggeredAbility extends TriggeredManaAbility { @Override public String getRule() { - return "Whenever enchanted land is tapped for mana, its controller adds two mana in any combination of colors to his or her mana pool (in addition to the mana the land produces)."; + return "Whenever enchanted land is tapped for mana, its controller adds two mana in any combination of colors to his or her mana pool (in addition to the mana the land produces)."; } } @@ -142,15 +142,15 @@ class DawnsReflectionManaEffect extends ManaEffect { } if (choiceColor.getColor().isBlack()) { - mana.addBlack(); + mana.increaseBlack(); } else if (choiceColor.getColor().isBlue()) { - mana.addBlue(); + mana.increaseBlue(); } else if (choiceColor.getColor().isRed()) { - mana.addRed(); + mana.increaseRed(); } else if (choiceColor.getColor().isGreen()) { - mana.addGreen(); + mana.increaseGreen(); } else if (choiceColor.getColor().isWhite()) { - mana.addWhite(); + mana.increaseWhite(); } } diff --git a/Mage.Sets/src/mage/sets/fifthdawn/EndlessWhispers.java b/Mage.Sets/src/mage/sets/fifthdawn/EndlessWhispers.java index df557686aee..2e772173bb2 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/EndlessWhispers.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/EndlessWhispers.java @@ -59,18 +59,17 @@ public class EndlessWhispers extends CardImpl { super(ownerId, 49, "Endless Whispers", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); this.expansionSetCode = "5DN"; - // Each creature has "When this creature dies, choose target opponent. That player puts this card from its owner's graveyard onto the battlefield under his or her control at the beginning of the next end step." DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnSourceToBattlefieldEffect()); Effect effect = new CreateDelayedTriggeredAbilityEffect(delayedAbility, true); effect.setText("choose target opponent. That player puts this card from its owner's graveyard onto the battlefield under his or her control at the beginning of the next end step"); Ability gainAbility = new DiesTriggeredAbility(effect); gainAbility.addTarget(new TargetOpponent()); - + effect = new GainAbilityAllEffect(gainAbility, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Each creature")); effect.setText("Each creature has \"When this creature dies, choose target opponent. That player puts this card from its owner's graveyard onto the battlefield under his or her control at the beginning of the next end step.\""); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); - + } public EndlessWhispers(final EndlessWhispers card) { @@ -85,18 +84,17 @@ public class EndlessWhispers extends CardImpl { class ReturnSourceToBattlefieldEffect extends OneShotEffect { - public ReturnSourceToBattlefieldEffect() { this(false); } public ReturnSourceToBattlefieldEffect(boolean tapped) { super(Outcome.PutCreatureInPlay); - setText(); + staticText = "That player puts this card from its owner's graveyard onto the battlefield under his or her control"; } + public ReturnSourceToBattlefieldEffect(boolean tapped, boolean ownerControl) { super(Outcome.PutCreatureInPlay); - setText(); } public ReturnSourceToBattlefieldEffect(final ReturnSourceToBattlefieldEffect effect) { @@ -112,24 +110,19 @@ class ReturnSourceToBattlefieldEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { if (!game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) { return false; - } + } Card card = game.getCard(source.getSourceId()); if (card == null) { return false; } - + Player player = game.getPlayer(source.getFirstTarget()); - - if (player == null) { + + if (player == null) { return false; - } - - return player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), false); + } + + return player.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); } - private void setText() { - StringBuilder sb = new StringBuilder("That player puts this card from its owner's graveyard onto the battlefield under his or her control"); - - } - -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/fifthdawn/Ferropede.java b/Mage.Sets/src/mage/sets/fifthdawn/Ferropede.java new file mode 100644 index 00000000000..f680e10eea1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/Ferropede.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthdawn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.common.counter.RemoveCounterTargetEffect; +import mage.abilities.keyword.CantBeBlockedSourceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class Ferropede extends CardImpl { + + public Ferropede(UUID ownerId) { + super(ownerId, 122, "Ferropede", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "5DN"; + this.subtype.add("Insect"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Ferropede is unblockable. + this.addAbility(new CantBeBlockedSourceAbility()); + // Whenever Ferropede deals combat damage to a player, you may remove a counter from target permanent. + Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new RemoveCounterTargetEffect(), true); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public Ferropede(final Ferropede card) { + super(card); + } + + @Override + public Ferropede copy() { + return new Ferropede(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthdawn/FoldIntoAEther.java b/Mage.Sets/src/mage/sets/fifthdawn/FoldIntoAEther.java index 7ddcccce951..c9022050cad 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/FoldIntoAEther.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/FoldIntoAEther.java @@ -28,14 +28,14 @@ package mage.sets.fifthdawn; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.stack.StackObject; @@ -53,7 +53,6 @@ public class FoldIntoAEther extends CardImpl { super(ownerId, 31, "Fold into AEther", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); this.expansionSetCode = "5DN"; - // Counter target spell. If that spell is countered this way, its controller may put a creature card from his or her hand onto the battlefield. this.getSpellAbility().addEffect(new FoldIntoAEtherEffect()); this.getSpellAbility().addTarget(new TargetSpell()); @@ -87,19 +86,21 @@ class FoldIntoAEtherEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); - Player player = null; + UUID targetId = getTargetPointer().getFirst(game, source); + StackObject stackObject = game.getStack().getStackObject(targetId); + Player spellController = null; if (stackObject != null) { - player = game.getPlayer(stackObject.getControllerId()); + spellController = game.getPlayer(stackObject.getControllerId()); } - if (game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) { + if (game.getStack().counter(targetId, source.getSourceId(), game)) { TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard()); - if (player != null - && player.chooseUse(Outcome.Neutral, "Put a creature card from your hand in play?", source, game) - && player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { + if (spellController != null + && target.canChoose(source.getSourceId(), source.getSourceId(), game) + && spellController.chooseUse(Outcome.Neutral, "Put a creature card from your hand in play?", source, game) + && spellController.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); + spellController.moveCards(card, Zone.BATTLEFIELD, source, game); } } return true; diff --git a/Mage.Sets/src/mage/sets/fifthdawn/GoblinBrawler.java b/Mage.Sets/src/mage/sets/fifthdawn/GoblinBrawler.java index 13b1344e3da..5851db67059 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/GoblinBrawler.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/GoblinBrawler.java @@ -31,9 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -83,12 +81,12 @@ class CantBeEquippedSourceEffect extends ContinuousRuleModifyingEffectImpl { } public CantBeEquippedSourceEffect() { - super(Duration.WhileOnBattlefield, Outcome.Neutral); - staticText = "{this} can't be equipped"; + super(Duration.WhileOnBattlefield, Outcome.Neutral); + staticText = "{this} can't be equipped"; } - + @Override - public ContinuousEffect copy() { + public CantBeEquippedSourceEffect copy() { return new CantBeEquippedSourceEffect(this); } @@ -96,14 +94,14 @@ class CantBeEquippedSourceEffect extends ContinuousRuleModifyingEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ATTACH; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getSourceId())) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if(permanent != null && permanent.getSubtype().contains("Equipment")){ - return true; - } + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent != null && permanent.getSubtype().contains("Equipment")) { + return true; + } } return false; } diff --git a/Mage.Sets/src/mage/sets/fifthdawn/HelmOfKaldra.java b/Mage.Sets/src/mage/sets/fifthdawn/HelmOfKaldra.java index 2d6382fd5b3..40ae18645a0 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/HelmOfKaldra.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/HelmOfKaldra.java @@ -60,6 +60,7 @@ import mage.game.permanent.token.Token; * @author LevelX2 */ public class HelmOfKaldra extends CardImpl { + public static final FilterControlledArtifactPermanent filterHelm = new FilterControlledArtifactPermanent(); public static final FilterControlledArtifactPermanent filterShield = new FilterControlledArtifactPermanent(); public static final FilterControlledArtifactPermanent filterSword = new FilterControlledArtifactPermanent(); @@ -82,7 +83,7 @@ public class HelmOfKaldra extends CardImpl { effect.setText(", trample"); ability.addEffect(effect); effect = new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT); - effect.setText(" and haste"); + effect.setText("and haste"); ability.addEffect(effect); this.addAbility(ability); // {1}: If you control Equipment named Helm of Kaldra, Sword of Kaldra, and Shield of Kaldra, put a legendary 4/4 colorless Avatar creature token named Kaldra onto the battlefield and attach those Equipment to it. @@ -108,7 +109,6 @@ public class HelmOfKaldra extends CardImpl { class HelmOfKaldraCondition implements Condition { - @Override public boolean apply(Game game, Ability source) { if (game.getBattlefield().count(HelmOfKaldra.filterHelm, source.getSourceId(), source.getControllerId(), game) < 1) { @@ -117,10 +117,7 @@ class HelmOfKaldraCondition implements Condition { if (game.getBattlefield().count(HelmOfKaldra.filterShield, source.getSourceId(), source.getControllerId(), game) < 1) { return false; } - if (game.getBattlefield().count(HelmOfKaldra.filterShield, source.getSourceId(), source.getControllerId(), game) < 1) { - return false; - } - return true; + return game.getBattlefield().count(HelmOfKaldra.filterShield, source.getSourceId(), source.getControllerId(), game) >= 1; } } @@ -146,25 +143,27 @@ class HelmOfKaldraEffect extends OneShotEffect { if (new HelmOfKaldraCondition().apply(game, source)) { CreateTokenEffect effect = new CreateTokenEffect(new KaldraToken()); effect.apply(game, source); - UUID kaldraId = effect.getLastAddedTokenId(); - Permanent kaldra = game.getPermanent(kaldraId); - if (kaldra != null) { - // Attach helm to the token - for (Permanent kaldrasHelm :game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterHelm, source.getControllerId(), game)) { - kaldra.addAttachment(kaldrasHelm.getId(), game); - break; - } - // Attach shield to the token - for (Permanent kaldrasShield :game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterShield, source.getControllerId(), game)) { - kaldra.addAttachment(kaldrasShield.getId(), game); - break; - } - // Attach sword to the token - for (Permanent kaldrasSword :game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterSword, source.getControllerId(), game)) { - kaldra.addAttachment(kaldrasSword.getId(), game); - break; - } + for (UUID tokenId : effect.getLastAddedTokenIds()) { + Permanent kaldra = game.getPermanent(tokenId); + if (kaldra != null) { + // Attach helm to the token + for (Permanent kaldrasHelm : game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterHelm, source.getControllerId(), game)) { + kaldra.addAttachment(kaldrasHelm.getId(), game); + break; + } + // Attach shield to the token + for (Permanent kaldrasShield : game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterShield, source.getControllerId(), game)) { + kaldra.addAttachment(kaldrasShield.getId(), game); + break; + } + // Attach sword to the token + for (Permanent kaldrasSword : game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterSword, source.getControllerId(), game)) { + kaldra.addAttachment(kaldrasSword.getId(), game); + break; + } + } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/fifthdawn/LunarAvenger.java b/Mage.Sets/src/mage/sets/fifthdawn/LunarAvenger.java new file mode 100644 index 00000000000..99f441658eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/LunarAvenger.java @@ -0,0 +1,139 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthdawn; + +import java.util.HashSet; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.SunburstAbility; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LoneFox + */ +public class LunarAvenger extends CardImpl { + + public LunarAvenger(UUID ownerId) { + super(ownerId, 136, "Lunar Avenger", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}"); + this.expansionSetCode = "5DN"; + this.subtype.add("Golem"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Sunburst + this.addAbility(new SunburstAbility(this)); + // Remove a +1/+1 counter from Lunar Avenger: Lunar Avenger gains your choice of flying, first strike, or haste until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LunarAvengerEffect(), + new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1)))); + } + + public LunarAvenger(final LunarAvenger card) { + super(card); + } + + @Override + public LunarAvenger copy() { + return new LunarAvenger(this); + } +} + + +class LunarAvengerEffect extends OneShotEffect { + + private static final HashSet choices = new HashSet<>(); + + static { + choices.add("Flying"); + choices.add("First Strike"); + choices.add("Haste"); + } + + public LunarAvengerEffect() { + super(Outcome.AddAbility); + staticText = "{this} gains your choice of flying, first strike, or haste until end of turn"; + } + + public LunarAvengerEffect(final LunarAvengerEffect effect) { + super(effect); + } + + @Override + public LunarAvengerEffect copy() { + return new LunarAvengerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if(controller != null) { + Choice choice = new ChoiceImpl(true); + choice.setMessage("Choose ability to add"); + choice.setChoices(choices); + while(!controller.choose(outcome, choice, game)) { + if(controller.canRespond()) { + return false; + } + } + + Ability gainedAbility; + String chosen = choice.getChoice(); + if(chosen.equals("Flying")) { + gainedAbility = FlyingAbility.getInstance(); + } + else if(chosen.equals("First strike")) { + gainedAbility = FirstStrikeAbility.getInstance(); + } + else { + gainedAbility = HasteAbility.getInstance(); + } + + game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.EndOfTurn), source); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/fifthdawn/MycosynthGolem.java b/Mage.Sets/src/mage/sets/fifthdawn/MycosynthGolem.java index 084fbf7fc3e..ea343a1c7cf 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/MycosynthGolem.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/MycosynthGolem.java @@ -54,14 +54,7 @@ import mage.players.Player; * @author jeffwadsworth */ public class MycosynthGolem extends CardImpl { - - private static final FilterSpell filter = new FilterSpell("Artifact creature spells you cast"); - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - filter.add(new CardTypePredicate(CardType.CREATURE)); - } - public MycosynthGolem(UUID ownerId) { super(ownerId, 137, "Mycosynth Golem", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{11}"); this.expansionSetCode = "5DN"; @@ -75,8 +68,8 @@ public class MycosynthGolem extends CardImpl { // Artifact creature spells you cast have affinity for artifacts. this.addAbility(new SimpleStaticAbility( - Zone.BATTLEFIELD, new MycosynthGolemGainAbilitySpellsEffect(new AffinityForArtifactsAbility(), filter))); - + Zone.BATTLEFIELD, new MycosynthGolemGainAbilitySpellsEffect())); + } public MycosynthGolem(final MycosynthGolem card) { @@ -91,20 +84,21 @@ public class MycosynthGolem extends CardImpl { class MycosynthGolemGainAbilitySpellsEffect extends ContinuousEffectImpl { - private final Ability ability; - private final FilterSpell filter; + private static final FilterSpell filter = new FilterSpell("Artifact creature spells you cast"); + private static final Ability ability = new AffinityForArtifactsAbility(); - public MycosynthGolemGainAbilitySpellsEffect(Ability ability, FilterSpell filter) { + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + filter.add(new CardTypePredicate(CardType.CREATURE)); + } + + public MycosynthGolemGainAbilitySpellsEffect() { super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - this.ability = ability; - this.filter = filter; - staticText = filter.getMessage() + " have " + ability.getRule(); + staticText = "Artifact creature spells you cast have affinity for artifacts"; } public MycosynthGolemGainAbilitySpellsEffect(final MycosynthGolemGainAbilitySpellsEffect effect) { super(effect); - this.ability = effect.ability; - this.filter = effect.filter; } @Override @@ -114,17 +108,15 @@ class MycosynthGolemGainAbilitySpellsEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { + if (controller != null && permanent != null) { for (StackObject stackObject : game.getStack()) { // only spells cast, so no copies of spells if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.getControllerId().equals(source.getControllerId())) { Spell spell = (Spell) stackObject; if (filter.match(spell, game)) { - if (!spell.getAbilities().contains(ability)) { - game.getState().addOtherAbility(spell.getCard(), ability); - } + game.getState().addOtherAbility(spell.getCard(), ability); } } } diff --git a/Mage.Sets/src/mage/sets/fifthdawn/MyrServitor.java b/Mage.Sets/src/mage/sets/fifthdawn/MyrServitor.java index f284a356e4c..33c27d2d941 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/MyrServitor.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/MyrServitor.java @@ -34,7 +34,6 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.condition.common.SourceOnBattlefieldCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -66,7 +65,7 @@ public class MyrServitor extends CardImpl { SourceOnBattlefieldCondition.getInstance(), "At the beginning of your upkeep, if {this} is on the battlefield, each player returns all cards named Myr Servitor from his or her graveyard to the battlefield" )); - + } public MyrServitor(final MyrServitor card) { @@ -80,39 +79,38 @@ public class MyrServitor extends CardImpl { } class MyrServitorReturnEffect extends OneShotEffect { - + private static final FilterCard filter = new FilterCard("cards named Myr Servitor"); - + static { filter.add(new NamePredicate("Myr Servitor")); } - + public MyrServitorReturnEffect() { super(Outcome.PutCardInPlay); this.staticText = "if {this} is on the battlefield, each player returns all cards named Myr Servitor from his or her graveyard to the battlefield"; } - + public MyrServitorReturnEffect(final MyrServitorReturnEffect effect) { super(effect); } - + @Override public MyrServitorReturnEffect copy() { return new MyrServitorReturnEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (UUID playerId: controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card: player.getGraveyard().getCards(filter, game)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); - } + controller.moveCards(player.getGraveyard().getCards(filter, game), Zone.BATTLEFIELD, source, game); } } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/fifthdawn/RainOfRust.java b/Mage.Sets/src/mage/sets/fifthdawn/RainOfRust.java index ad28ada69ed..83f34843cb7 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/RainOfRust.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/RainOfRust.java @@ -47,11 +47,8 @@ public class RainOfRust extends CardImpl { super(ownerId, 76, "Rain of Rust", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{R}{R}"); this.expansionSetCode = "5DN"; - - // Choose one - - this.getSpellAbility().getModes().setMinModes(1); - this.getSpellAbility().getModes().setMaxModes(1); - //Destroy target artifact; + // Choose one - + //Destroy target artifact; this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetArtifactPermanent()); //or destroy target land. diff --git a/Mage.Sets/src/mage/sets/fifthdawn/RiteOfPassage.java b/Mage.Sets/src/mage/sets/fifthdawn/RiteOfPassage.java index b0e425fdd15..8e915e6965b 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/RiteOfPassage.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/RiteOfPassage.java @@ -53,12 +53,11 @@ public class RiteOfPassage extends CardImpl { super(ownerId, 91, "Rite of Passage", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); this.expansionSetCode = "5DN"; - // Whenever a creature you control is dealt damage, put a +1/+1 counter on it. Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); effect.setText("put a +1/+1 counter on it"); this.addAbility(new RiteOfPassageTriggeredAbility(effect)); - + } public RiteOfPassage(final RiteOfPassage card) { @@ -74,7 +73,7 @@ public class RiteOfPassage extends CardImpl { class RiteOfPassageTriggeredAbility extends TriggeredAbilityImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); - + public RiteOfPassageTriggeredAbility(Effect effect) { super(Zone.BATTLEFIELD, effect); } @@ -108,6 +107,6 @@ class RiteOfPassageTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Whenever {this} is dealt damage, " + super.getRule(); + return "Whenever a creature you control is dealt damage, " + super.getRule(); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/fifthdawn/SpinalParasite.java b/Mage.Sets/src/mage/sets/fifthdawn/SpinalParasite.java new file mode 100644 index 00000000000..c80e6946367 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/SpinalParasite.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthdawn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.effects.common.counter.RemoveCounterTargetEffect; +import mage.abilities.keyword.SunburstAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class SpinalParasite extends CardImpl { + + public SpinalParasite(UUID ownerId) { + super(ownerId, 155, "Spinal Parasite", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); + this.expansionSetCode = "5DN"; + this.subtype.add("Insect"); + this.power = new MageInt(-1); + this.toughness = new MageInt(-1); + + // Sunburst + this.addAbility(new SunburstAbility(this)); + // Remove two +1/+1 counters from Spinal Parasite: Remove a counter from target permanent. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RemoveCounterTargetEffect(), + new RemoveCountersSourceCost(CounterType.P1P1.createInstance(2))); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public SpinalParasite(final SpinalParasite card) { + super(card); + } + + @Override + public SpinalParasite copy() { + return new SpinalParasite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthdawn/TangleAsp.java b/Mage.Sets/src/mage/sets/fifthdawn/TangleAsp.java index 88d2760e804..1a5e0bb53e0 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/TangleAsp.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/TangleAsp.java @@ -54,8 +54,8 @@ public class TangleAsp extends CardImpl { this.toughness = new MageInt(2); // Whenever Tangle Asp blocks or becomes blocked by a creature, destroy that creature at end of combat. - AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()); - Effect effect = new CreateDelayedTriggeredAbilityEffect(delayedAbility, true); + Effect effect = new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); effect.setText("destroy that creature at end of combat"); this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, false)); } diff --git a/Mage.Sets/src/mage/sets/fifthedition/ArmorOfFaith.java b/Mage.Sets/src/mage/sets/fifthedition/ArmorOfFaith.java new file mode 100644 index 00000000000..0cbd046b054 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/ArmorOfFaith.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ArmorOfFaith extends mage.sets.masterseditionii.ArmorOfFaith { + + public ArmorOfFaith(UUID ownerId) { + super(ownerId); + this.cardNumber = 284; + this.expansionSetCode = "5ED"; + } + + public ArmorOfFaith(final ArmorOfFaith card) { + super(card); + } + + @Override + public ArmorOfFaith copy() { + return new ArmorOfFaith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Aurochs.java b/Mage.Sets/src/mage/sets/fifthedition/Aurochs.java new file mode 100644 index 00000000000..78e90439d46 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Aurochs.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class Aurochs extends mage.sets.iceage.Aurochs { + + public Aurochs(UUID ownerId) { + super(ownerId); + this.cardNumber = 141; + this.expansionSetCode = "5ED"; + } + + public Aurochs(final Aurochs card) { + super(card); + } + + @Override + public Aurochs copy() { + return new Aurochs(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/AysenBureaucrats.java b/Mage.Sets/src/mage/sets/fifthedition/AysenBureaucrats.java new file mode 100644 index 00000000000..eb925981947 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/AysenBureaucrats.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AysenBureaucrats extends mage.sets.masterseditionii.AysenBureaucrats { + + public AysenBureaucrats(UUID ownerId) { + super(ownerId); + this.cardNumber = 285; + this.expansionSetCode = "5ED"; + } + + public AysenBureaucrats(final AysenBureaucrats card) { + super(card); + } + + @Override + public AysenBureaucrats copy() { + return new AysenBureaucrats(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/BindingGrasp.java b/Mage.Sets/src/mage/sets/fifthedition/BindingGrasp.java new file mode 100644 index 00000000000..6ac1c2e8f8e --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/BindingGrasp.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class BindingGrasp extends mage.sets.masterseditionii.BindingGrasp { + + public BindingGrasp(UUID ownerId) { + super(ownerId); + this.cardNumber = 74; + this.expansionSetCode = "5ED"; + this.rarity = Rarity.UNCOMMON; + } + + public BindingGrasp(final BindingGrasp card) { + super(card); + } + + @Override + public BindingGrasp copy() { + return new BindingGrasp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/BlessedWine.java b/Mage.Sets/src/mage/sets/fifthedition/BlessedWine.java new file mode 100644 index 00000000000..2775748e3ea --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/BlessedWine.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class BlessedWine extends CardImpl { + + public BlessedWine(UUID ownerId) { + super(ownerId, 287, "Blessed Wine", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "5ED"; + + // You gain 1 life. + this.getSpellAbility().addEffect(new GainLifeEffect(1)); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public BlessedWine(final BlessedWine card) { + super(card); + } + + @Override + public BlessedWine copy() { + return new BlessedWine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Blight.java b/Mage.Sets/src/mage/sets/fifthedition/Blight.java index dc7821b2b6a..d3058c85ebc 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Blight.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Blight.java @@ -29,23 +29,16 @@ package mage.sets.fifthedition; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.Effect; +import mage.abilities.common.BecomesTappedAttachedTriggeredAbility; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -65,9 +58,9 @@ public class Blight extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - + // When enchanted land becomes tapped, destroy it. - this.addAbility(new BlightTriggeredAbility()); + this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DestroyAttachedEffect("it"), "enchanted land")); } public Blight(final Blight card) { @@ -79,43 +72,3 @@ public class Blight extends CardImpl { return new Blight(this); } } - -class BlightTriggeredAbility extends TriggeredAbilityImpl { - BlightTriggeredAbility() { - super(Zone.BATTLEFIELD, new DestroyTargetEffect()); - } - - BlightTriggeredAbility(final BlightTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent enchantment = game.getPermanent(this.sourceId); - if (enchantment != null && enchantment.getAttachedTo().equals(event.getTargetId())) { - Permanent attached = game.getPermanent(enchantment.getAttachedTo()); - if (attached != null) { - for (Effect e : getEffects()) { - e.setTargetPointer(new FixedTarget(attached.getId())); - } - return true; - } - } - return false; - } - - @Override - public BlightTriggeredAbility copy() { - return new BlightTriggeredAbility(this); - } - - @Override - public String getRule() { - return "When enchanted land becomes tapped, destroy it."; - } -} diff --git a/Mage.Sets/src/mage/sets/fifthedition/BrothersOfFire.java b/Mage.Sets/src/mage/sets/fifthedition/BrothersOfFire.java new file mode 100644 index 00000000000..b0436a20e5b --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/BrothersOfFire.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class BrothersOfFire extends mage.sets.fourthedition.BrothersOfFire { + + public BrothersOfFire(UUID ownerId) { + super(ownerId); + this.cardNumber = 214; + this.expansionSetCode = "5ED"; + } + + public BrothersOfFire(final BrothersOfFire card) { + super(card); + } + + @Override + public BrothersOfFire copy() { + return new BrothersOfFire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/CaribouRange.java b/Mage.Sets/src/mage/sets/fifthedition/CaribouRange.java new file mode 100644 index 00000000000..d107abb2957 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/CaribouRange.java @@ -0,0 +1,114 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.permanent.token.Token; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class CaribouRange extends CardImpl { + + static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Caribou token"); + + static { + filter.add(new TokenPredicate()); + filter.add(new SubtypePredicate("Caribou")); + } + + public CaribouRange(UUID ownerId) { + super(ownerId, 290, "Caribou Range", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Aura"); + + // Enchant land you control + TargetPermanent auraTarget = new TargetControlledPermanent(new FilterControlledLandPermanent("land you control")); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted land has "{W}{W}, {T}: Put a 0/1 white Caribou creature token onto the battlefield." + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new CaribouToken()), new ManaCostsImpl("{W}{W}")); + ability.addCost(new TapSourceCost()); + Effect effect = new GainAbilityAttachedEffect(ability, AttachmentType.AURA); + effect.setText("Enchanted land has \"{W}{W}, {T}: Put a 0/1 white Caribou creature token onto the battlefield.\""); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + // Sacrifice a Caribou token: You gain 1 life. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter)))); + } + + public CaribouRange(final CaribouRange card) { + super(card); + } + + @Override + public CaribouRange copy() { + return new CaribouRange(this); + } +} + +class CaribouToken extends Token { + + public CaribouToken() { + super("Caribou", "0/1 white Caribou creature token"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Caribou"); + power = new MageInt(0); + toughness = new MageInt(1); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/CavePeople.java b/Mage.Sets/src/mage/sets/fifthedition/CavePeople.java new file mode 100644 index 00000000000..f5ffa299dc3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/CavePeople.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CavePeople extends mage.sets.thedark.CavePeople { + + public CavePeople(UUID ownerId) { + super(ownerId); + this.cardNumber = 215; + this.expansionSetCode = "5ED"; + } + + public CavePeople(final CavePeople card) { + super(card); + } + + @Override + public CavePeople copy() { + return new CavePeople(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/CoralHelm.java b/Mage.Sets/src/mage/sets/fifthedition/CoralHelm.java new file mode 100644 index 00000000000..2986ae235fa --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/CoralHelm.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author nigelzor + */ +public class CoralHelm extends mage.sets.masterseditioniv.CoralHelm { + + public CoralHelm(UUID ownerId) { + super(ownerId); + this.cardNumber = 359; + this.expansionSetCode = "5ED"; + this.rarity = Rarity.RARE; + } + + public CoralHelm(final CoralHelm card) { + super(card); + } + + @Override + public CoralHelm copy() { + return new CoralHelm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/CrawGiant.java b/Mage.Sets/src/mage/sets/fifthedition/CrawGiant.java new file mode 100644 index 00000000000..2007c7018b8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/CrawGiant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CrawGiant extends mage.sets.legends.CrawGiant { + + public CrawGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 147; + this.expansionSetCode = "5ED"; + } + + public CrawGiant(final CrawGiant card) { + super(card); + } + + @Override + public CrawGiant copy() { + return new CrawGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Crumble.java b/Mage.Sets/src/mage/sets/fifthedition/Crumble.java new file mode 100644 index 00000000000..0611ff890d0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Crumble.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Crumble extends mage.sets.masterseditioniv.Crumble { + + public Crumble(UUID ownerId) { + super(ownerId); + this.cardNumber = 149; + this.expansionSetCode = "5ED"; + this.rarity = Rarity.UNCOMMON; + } + + public Crumble(final Crumble card) { + super(card); + } + + @Override + public Crumble copy() { + return new Crumble(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/CursedLand.java b/Mage.Sets/src/mage/sets/fifthedition/CursedLand.java new file mode 100644 index 00000000000..06e21410275 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 14; + this.expansionSetCode = "5ED"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/DarkMaze.java b/Mage.Sets/src/mage/sets/fifthedition/DarkMaze.java new file mode 100644 index 00000000000..c4777eec232 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/DarkMaze.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ExileSourceEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class DarkMaze extends CardImpl { + + public DarkMaze(UUID ownerId) { + super(ownerId, 80, "Dark Maze", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Wall"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // {0}: Dark Maze can attack this turn as though it didn't have defender. Exile it at the beginning of the next end step. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), + new GenericManaCost(0)); + ability.addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ExileSourceEffect()))); + this.addAbility(ability); + } + + public DarkMaze(final DarkMaze card) { + super(card); + } + + @Override + public DarkMaze copy() { + return new DarkMaze(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/DeathSpeakers.java b/Mage.Sets/src/mage/sets/fifthedition/DeathSpeakers.java new file mode 100644 index 00000000000..b328c2fb260 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/DeathSpeakers.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class DeathSpeakers extends mage.sets.homelands.DeathSpeakers { + + public DeathSpeakers(UUID ownerId) { + super(ownerId); + this.cardNumber = 300; + this.expansionSetCode = "5ED"; + this.rarity = Rarity.COMMON; + } + + public DeathSpeakers(final DeathSpeakers card) { + super(card); + } + + @Override + public DeathSpeakers copy() { + return new DeathSpeakers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Deathgrip.java b/Mage.Sets/src/mage/sets/fifthedition/Deathgrip.java new file mode 100644 index 00000000000..19879354564 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Deathgrip.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class Deathgrip extends mage.sets.limitedbeta.Deathgrip { + + public Deathgrip(UUID ownerId) { + super(ownerId); + this.cardNumber = 16; + this.expansionSetCode = "5ED"; + } + + public Deathgrip(final Deathgrip card) { + super(card); + } + + @Override + public Deathgrip copy() { + return new Deathgrip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Detonate.java b/Mage.Sets/src/mage/sets/fifthedition/Detonate.java new file mode 100644 index 00000000000..bbd019d09da --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Detonate.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetControllerEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author LoneFox + */ +public class Detonate extends CardImpl { + + public Detonate(UUID ownerId) { + super(ownerId, 218, "Detonate", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{R}"); + this.expansionSetCode = "5ED"; + + // Destroy target artifact with converted mana cost X. It can't be regenerated. Detonate deals X damage to that artifact's controller. + this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetArtifactPermanent(new FilterArtifactPermanent("artifact with converted mana cost X"))); + Effect effect = new DamageTargetControllerEffect(new ManacostVariableValue()); + effect.setText("{this} deals X damage to that artifact's controller"); + this.getSpellAbility().addEffect(effect); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if(ability instanceof SpellAbility) { + ability.getTargets().clear(); + int xValue = ability.getManaCostsToPay().getX(); + FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact with converted mana cost X"); + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, xValue)); + ability.addTarget(new TargetArtifactPermanent(filter)); + } + } + + public Detonate(final Detonate card) { + super(card); + } + + @Override + public Detonate copy() { + return new Detonate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/DiabolicMachine.java b/Mage.Sets/src/mage/sets/fifthedition/DiabolicMachine.java new file mode 100644 index 00000000000..9472d8e8a6d --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/DiabolicMachine.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class DiabolicMachine extends mage.sets.fourthedition.DiabolicMachine { + + public DiabolicMachine(UUID ownerId) { + super(ownerId); + this.cardNumber = 363; + this.expansionSetCode = "5ED"; + } + + public DiabolicMachine(final DiabolicMachine card) { + super(card); + } + + @Override + public DiabolicMachine copy() { + return new DiabolicMachine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Enervate.java b/Mage.Sets/src/mage/sets/fifthedition/Enervate.java new file mode 100644 index 00000000000..b89b480d39f --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Enervate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Enervate extends mage.sets.masterseditionii.Enervate { + + public Enervate(UUID ownerId) { + super(ownerId); + this.cardNumber = 84; + this.expansionSetCode = "5ED"; + } + + public Enervate(final Enervate card) { + super(card); + } + + @Override + public Enervate copy() { + return new Enervate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Feedback.java b/Mage.Sets/src/mage/sets/fifthedition/Feedback.java new file mode 100644 index 00000000000..7b730ff3174 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 85; + this.expansionSetCode = "5ED"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Flare.java b/Mage.Sets/src/mage/sets/fifthedition/Flare.java new file mode 100644 index 00000000000..5531722534a --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Flare.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class Flare extends CardImpl { + + public Flare(UUID ownerId) { + super(ownerId, 230, "Flare", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); + this.expansionSetCode = "5ED"; + + // Flare deals 1 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(1)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public Flare(final Flare card) { + super(card); + } + + @Override + public Flare copy() { + return new Flare(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Flood.java b/Mage.Sets/src/mage/sets/fifthedition/Flood.java new file mode 100644 index 00000000000..cd715597cef --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Flood.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Flood extends mage.sets.fourthedition.Flood { + + public Flood(UUID ownerId) { + super(ownerId); + this.cardNumber = 87; + this.expansionSetCode = "5ED"; + } + + public Flood(final Flood card) { + super(card); + } + + @Override + public Flood copy() { + return new Flood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Heal.java b/Mage.Sets/src/mage/sets/fifthedition/Heal.java index fd8451be21e..36445dd90be 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Heal.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Heal.java @@ -37,7 +37,7 @@ public class Heal extends mage.sets.iceage.Heal { public Heal(UUID ownerId) { super(ownerId); - this.cardNumber = 309; + this.cardNumber = 308; this.expansionSetCode = "5ED"; } diff --git a/Mage.Sets/src/mage/sets/fifthedition/HomaridWarrior.java b/Mage.Sets/src/mage/sets/fifthedition/HomaridWarrior.java new file mode 100644 index 00000000000..a5498872d0b --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/HomaridWarrior.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class HomaridWarrior extends mage.sets.fallenempires.HomaridWarrior1 { + + public HomaridWarrior(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "5ED"; + } + + public HomaridWarrior(final HomaridWarrior card) { + super(card); + } + + @Override + public HomaridWarrior copy() { + return new HomaridWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/HungryMist.java b/Mage.Sets/src/mage/sets/fifthedition/HungryMist.java new file mode 100644 index 00000000000..949f5e3b7c3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/HungryMist.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class HungryMist extends CardImpl { + + public HungryMist(UUID ownerId) { + super(ownerId, 164, "Hungry Mist", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Elemental"); + this.power = new MageInt(6); + this.toughness = new MageInt(2); + + // At the beginning of your upkeep, sacrifice Hungry Mist unless you pay {G}{G}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{G}{G}")), TargetController.YOU, false)); + } + + public HungryMist(final HungryMist card) { + super(card); + } + + @Override + public HungryMist copy() { + return new HungryMist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/IcatianScout.java b/Mage.Sets/src/mage/sets/fifthedition/IcatianScout.java new file mode 100644 index 00000000000..63b53cec3fd --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/IcatianScout.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class IcatianScout extends mage.sets.masterseditionii.IcatianScout { + + public IcatianScout(UUID ownerId) { + super(ownerId); + this.cardNumber = 313; + this.expansionSetCode = "5ED"; + } + + public IcatianScout(final IcatianScout card) { + super(card); + } + + @Override + public IcatianScout copy() { + return new IcatianScout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/InstillEnergy.java b/Mage.Sets/src/mage/sets/fifthedition/InstillEnergy.java index 5c82efdeba2..9c0b8691038 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/InstillEnergy.java +++ b/Mage.Sets/src/mage/sets/fifthedition/InstillEnergy.java @@ -92,6 +92,7 @@ public class InstillEnergy extends CardImpl { } class CanAttackAsThoughItHadHasteEnchantedEffect extends AsThoughEffectImpl { + public CanAttackAsThoughItHadHasteEnchantedEffect(Duration duration) { super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); staticText = "Enchanted creature can attack as though it had haste"; @@ -114,7 +115,7 @@ class CanAttackAsThoughItHadHasteEnchantedEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { Permanent enchantment = game.getPermanent(source.getSourceId()); - return enchantment != null && enchantment.getAttachedTo() != null && enchantment.getAttachedTo() == objectId; + return enchantment != null && enchantment.getAttachedTo() != null && enchantment.getAttachedTo().equals(objectId); } } diff --git a/Mage.Sets/src/mage/sets/fifthedition/Kismet.java b/Mage.Sets/src/mage/sets/fifthedition/Kismet.java index 9e327b22775..a4319c15b6b 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Kismet.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Kismet.java @@ -38,6 +38,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -79,26 +80,25 @@ class KismetEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent target = game.getPermanent(event.getTargetId()); + Permanent target = ((EntersTheBattlefieldEvent) event).getTarget(); if (target != null) { target.setTapped(true); } return false; } - @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && (permanent.getCardType().contains(CardType.ARTIFACT) || - permanent.getCardType().contains(CardType.CREATURE) || - permanent.getCardType().contains(CardType.LAND))) { + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); + if (permanent != null && (permanent.getCardType().contains(CardType.ARTIFACT) + || permanent.getCardType().contains(CardType.CREATURE) + || permanent.getCardType().contains(CardType.LAND))) { return true; } } diff --git a/Mage.Sets/src/mage/sets/fifthedition/KrovikanFetish.java b/Mage.Sets/src/mage/sets/fifthedition/KrovikanFetish.java new file mode 100644 index 00000000000..ecf2cda9de2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/KrovikanFetish.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class KrovikanFetish extends CardImpl { + + public KrovikanFetish(UUID ownerId) { + super(ownerId, 34, "Krovikan Fetish", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // When Krovikan Fetish enters the battlefield, draw a card at the beginning of the next turn's upkeep. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse)), false)); + + // Enchanted creature gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); + } + + public KrovikanFetish(final KrovikanFetish card) { + super(card); + } + + @Override + public KrovikanFetish copy() { + return new KrovikanFetish(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/KrovikanSorcerer.java b/Mage.Sets/src/mage/sets/fifthedition/KrovikanSorcerer.java new file mode 100644 index 00000000000..eaa10d2e7ce --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/KrovikanSorcerer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class KrovikanSorcerer extends mage.sets.vintagemasters.KrovikanSorcerer { + + public KrovikanSorcerer(UUID ownerId) { + super(ownerId); + this.cardNumber = 96; + this.expansionSetCode = "5ED"; + } + + public KrovikanSorcerer(final KrovikanSorcerer card) { + super(card); + } + + @Override + public KrovikanSorcerer copy() { + return new KrovikanSorcerer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Lifeforce.java b/Mage.Sets/src/mage/sets/fifthedition/Lifeforce.java new file mode 100644 index 00000000000..530955f41a5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Lifeforce.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Lifeforce extends mage.sets.masterseditioniv.Lifeforce { + + public Lifeforce(UUID ownerId) { + super(ownerId); + this.cardNumber = 172; + this.expansionSetCode = "5ED"; + this.rarity = Rarity.UNCOMMON; + } + + public Lifeforce(final Lifeforce card) { + super(card); + } + + @Override + public Lifeforce copy() { + return new Lifeforce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Lifetap.java b/Mage.Sets/src/mage/sets/fifthedition/Lifetap.java new file mode 100644 index 00000000000..0b0f027a7b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Lifetap.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LoneFox + */ +public class Lifetap extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("a Forest an opponent controls"); + + static { + filter.add(new SubtypePredicate("Forest")); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public Lifetap(UUID ownerId) { + super(ownerId, 99, "Lifetap", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}"); + this.expansionSetCode = "5ED"; + + // Whenever a Forest an opponent controls becomes tapped, you gain 1 life. + this.addAbility(new BecomesTappedTriggeredAbility(new GainLifeEffect(1), false, filter)); + } + + public Lifetap(final Lifetap card) { + super(card); + } + + @Override + public Lifetap copy() { + return new Lifetap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/LivingArtifact.java b/Mage.Sets/src/mage/sets/fifthedition/LivingArtifact.java new file mode 100644 index 00000000000..6bf5d34c1fb --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/LivingArtifact.java @@ -0,0 +1,146 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.common.SourceHasCounterCondition; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.target.TargetPermanent; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author LoneFox + */ +public class LivingArtifact extends CardImpl { + + public LivingArtifact(UUID ownerId) { + super(ownerId, 173, "Living Artifact", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Aura"); + + // Enchant artifact + TargetPermanent auraTarget = new TargetArtifactPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Whenever you're dealt damage, put that many vitality counters on Living Artifact. + this.addAbility(new LivingArtifactTriggeredAbility()); + // At the beginning of your upkeep, you may remove a vitality counter from Living Artifact. If you do, you gain 1 life. + this.addAbility(new ConditionalTriggeredAbility(new BeginningOfUpkeepTriggeredAbility(new DoIfCostPaid(new GainLifeEffect(1), + new RemoveCountersSourceCost(CounterType.VITALITY.createInstance(1))), TargetController.YOU, false), + new SourceHasCounterCondition(CounterType.VITALITY, 1), "At the beginning of your upkeep, you may remove a vitality counter from {this}. If you do, you gain 1 life")); + } + + public LivingArtifact(final LivingArtifact card) { + super(card); + } + + @Override + public LivingArtifact copy() { + return new LivingArtifact(this); + } +} + +class LivingArtifactTriggeredAbility extends TriggeredAbilityImpl { + + public LivingArtifactTriggeredAbility() { + super(Zone.BATTLEFIELD, new LivingArtifactEffect(), false); + } + + public LivingArtifactTriggeredAbility(final LivingArtifactTriggeredAbility ability) { + super(ability); + } + + @Override + public LivingArtifactTriggeredAbility copy() { + return new LivingArtifactTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getTargetId().equals(this.getControllerId())) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you're dealt damage, put that many charge counters on {this}."; + } +} + +class LivingArtifactEffect extends OneShotEffect { + + public LivingArtifactEffect() { + super(Outcome.Benefit); + } + + public LivingArtifactEffect(final LivingArtifactEffect effect) { + super(effect); + } + + @Override + public LivingArtifactEffect copy() { + return new LivingArtifactEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return new AddCountersSourceEffect(CounterType.VITALITY.createInstance((Integer) this.getValue("damageAmount"))).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/MindRavel.java b/Mage.Sets/src/mage/sets/fifthedition/MindRavel.java new file mode 100644 index 00000000000..403a463d34b --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/MindRavel.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class MindRavel extends CardImpl { + + public MindRavel(UUID ownerId) { + super(ownerId, 38, "Mind Ravel", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}"); + this.expansionSetCode = "5ED"; + + // Target player discards a card. + this.getSpellAbility().addEffect(new DiscardTargetEffect(1)); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public MindRavel(final MindRavel card) { + super(card); + } + + @Override + public MindRavel copy() { + return new MindRavel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/MindWarp.java b/Mage.Sets/src/mage/sets/fifthedition/MindWarp.java index f42c1a10399..b0226a30880 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/MindWarp.java +++ b/Mage.Sets/src/mage/sets/fifthedition/MindWarp.java @@ -37,7 +37,7 @@ public class MindWarp extends mage.sets.iceage.MindWarp { public MindWarp(UUID ownerId) { super(ownerId); - this.cardNumber = 14; + this.cardNumber = 39; this.expansionSetCode = "5ED"; } diff --git a/Mage.Sets/src/mage/sets/fifthedition/MindstabThrull.java b/Mage.Sets/src/mage/sets/fifthedition/MindstabThrull.java new file mode 100644 index 00000000000..aa8dd718894 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/MindstabThrull.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MindstabThrull extends mage.sets.mastersedition.MindstabThrull { + + public MindstabThrull(UUID ownerId) { + super(ownerId); + this.cardNumber = 40; + this.expansionSetCode = "5ED"; + } + + public MindstabThrull(final MindstabThrull card) { + super(card); + } + + @Override + public MindstabThrull copy() { + return new MindstabThrull(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/MoleWorms.java b/Mage.Sets/src/mage/sets/fifthedition/MoleWorms.java new file mode 100644 index 00000000000..eefb06798fd --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/MoleWorms.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DontUntapAsLongAsSourceTappedEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class MoleWorms extends CardImpl { + + public MoleWorms(UUID ownerId) { + super(ownerId, 41, "Mole Worms", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Worm"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // You may choose not to untap Mole Worms during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {tap}: Tap target land. It doesn't untap during its controller's untap step for as long as Mole Worms remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetLandPermanent()); + ability.addEffect(new DontUntapAsLongAsSourceTappedEffect()); + this.addAbility(ability); + } + + public MoleWorms(final MoleWorms card) { + super(card); + } + + @Override + public MoleWorms copy() { + return new MoleWorms(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/MurkDwellers.java b/Mage.Sets/src/mage/sets/fifthedition/MurkDwellers.java new file mode 100644 index 00000000000..2ef577fec3b --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/MurkDwellers.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class MurkDwellers extends CardImpl { + + public MurkDwellers(UUID ownerId) { + super(ownerId, 42, "Murk Dwellers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Murk Dwellers attacks and isn't blocked, it gets +2/+0 until end of combat. + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfCombat))); + } + + public MurkDwellers(final MurkDwellers card) { + super(card); + } + + @Override + public MurkDwellers copy() { + return new MurkDwellers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Panic.java b/Mage.Sets/src/mage/sets/fifthedition/Panic.java new file mode 100644 index 00000000000..589256a6c08 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Panic.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Panic extends mage.sets.masterseditionii.Panic { + + public Panic(UUID ownerId) { + super(ownerId); + this.cardNumber = 260; + this.expansionSetCode = "5ED"; + } + + public Panic(final Panic card) { + super(card); + } + + @Override + public Panic copy() { + return new Panic(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/PrimalClay.java b/Mage.Sets/src/mage/sets/fifthedition/PrimalClay.java index 561def505a0..6057b91fbc4 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/PrimalClay.java +++ b/Mage.Sets/src/mage/sets/fifthedition/PrimalClay.java @@ -43,8 +43,10 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -65,7 +67,7 @@ public class PrimalClay extends CardImpl { this.toughness = new MageInt(0); // As Primal Clay enters the battlefield, it becomes your choice of a 3/3 artifact creature, a 2/2 artifact creature with flying, or a 1/6 Wall artifact creature with defender in addition to its other types. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PrimalPlasmaReplacementEffect())); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new PrimalPlasmaReplacementEffect())); } public PrimalClay(final PrimalClay card) { @@ -101,7 +103,7 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getSourceId())) { - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + Permanent sourcePermanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (sourcePermanent != null && !sourcePermanent.isFaceDown(game)) { return true; } @@ -116,7 +118,7 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null) { Choice choice = new ChoiceImpl(true); choice.setMessage("Choose what " + permanent.getIdName() + " becomes to"); @@ -150,7 +152,7 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl { game.addEffect(new GainAbilitySourceEffect(DefenderAbility.getInstance(), Duration.Custom), source); break; } - game.addEffect(new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom), source); + game.addEffect(new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom, SubLayer.SetPT_7b), source); } return false; diff --git a/Mage.Sets/src/mage/sets/fifthedition/Recall.java b/Mage.Sets/src/mage/sets/fifthedition/Recall.java index ff5e44b188d..f1af05b0fa4 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Recall.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Recall.java @@ -50,7 +50,7 @@ import mage.target.common.TargetCardInYourGraveyard; public class Recall extends CardImpl { public Recall(UUID ownerId) { - super(ownerId, 93, "Recall", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{X}{U}"); + super(ownerId, 115, "Recall", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{X}{U}"); this.expansionSetCode = "5ED"; // Discard X cards, then return a card from your graveyard to your hand for each card discarded this way. @@ -73,7 +73,7 @@ class RecallEffect extends OneShotEffect { public RecallEffect() { super(Outcome.ReturnToHand); - this.staticText = "Discard X cards, then return a card from your graveyard to your hand for each card discarded this way. "; + this.staticText = "Discard X cards, then return a card from your graveyard to your hand for each card discarded this way"; } public RecallEffect(final RecallEffect effect) { diff --git a/Mage.Sets/src/mage/sets/fifthedition/ReefPirates.java b/Mage.Sets/src/mage/sets/fifthedition/ReefPirates.java new file mode 100644 index 00000000000..9bc5b4ba2b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/ReefPirates.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ReefPirates extends mage.sets.homelands.ReefPirates1 { + + public ReefPirates(UUID ownerId) { + super(ownerId); + this.cardNumber = 116; + this.expansionSetCode = "5ED"; + } + + public ReefPirates(final ReefPirates card) { + super(card); + } + + @Override + public ReefPirates copy() { + return new ReefPirates(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/SeaSerpent.java b/Mage.Sets/src/mage/sets/fifthedition/SeaSerpent.java index 1a040174683..90620ebf689 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/SeaSerpent.java +++ b/Mage.Sets/src/mage/sets/fifthedition/SeaSerpent.java @@ -31,14 +31,14 @@ import java.util.UUID; /** * - * @author KholdFuzion - + * @author KholdFuzion + * */ public class SeaSerpent extends mage.sets.limitedalpha.SeaSerpent { public SeaSerpent(UUID ownerId) { super(ownerId); - this.cardNumber = 52; + this.cardNumber = 118; this.expansionSetCode = "5ED"; } diff --git a/Mage.Sets/src/mage/sets/fifthedition/SeaSprite.java b/Mage.Sets/src/mage/sets/fifthedition/SeaSprite.java new file mode 100644 index 00000000000..2d76b9b0a41 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/SeaSprite.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class SeaSprite extends mage.sets.homelands.SeaSprite { + + public SeaSprite(UUID ownerId) { + super(ownerId); + this.cardNumber = 120; + this.expansionSetCode = "5ED"; + } + + public SeaSprite(final SeaSprite card) { + super(card); + } + + @Override + public SeaSprite copy() { + return new SeaSprite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/ShanodinDryads.java b/Mage.Sets/src/mage/sets/fifthedition/ShanodinDryads.java index 9d7ff24671b..7d077635084 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/ShanodinDryads.java +++ b/Mage.Sets/src/mage/sets/fifthedition/ShanodinDryads.java @@ -43,6 +43,7 @@ public class ShanodinDryads extends CardImpl { public ShanodinDryads(UUID ownerId) { super(ownerId, 187, "Shanodin Dryads", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); this.expansionSetCode = "5ED"; + this.subtype.add("Nymph"); this.subtype.add("Dryad"); this.power = new MageInt(1); diff --git a/Mage.Sets/src/mage/sets/fifthedition/Shatterstorm.java b/Mage.Sets/src/mage/sets/fifthedition/Shatterstorm.java index 8b7a9885776..ef14823483b 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Shatterstorm.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Shatterstorm.java @@ -46,7 +46,7 @@ public class Shatterstorm extends CardImpl { // Destroy all artifacts. They can't be regenerated. - this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterArtifactPermanent(), true)); + this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterArtifactPermanent("artifacts"), true)); } public Shatterstorm(final Shatterstorm card) { diff --git a/Mage.Sets/src/mage/sets/fifthedition/Smoke.java b/Mage.Sets/src/mage/sets/fifthedition/Smoke.java index 84d2d546f23..c2b8f811122 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Smoke.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Smoke.java @@ -31,14 +31,14 @@ import java.util.UUID; /** * - * @author KholdFuzion - + * @author KholdFuzion + * */ public class Smoke extends mage.sets.limitedalpha.Smoke { public Smoke(UUID ownerId) { super(ownerId); - this.cardNumber = 64; + this.cardNumber = 268; this.expansionSetCode = "5ED"; } diff --git a/Mage.Sets/src/mage/sets/fifthedition/SorceressQueen.java b/Mage.Sets/src/mage/sets/fifthedition/SorceressQueen.java new file mode 100644 index 00000000000..ed72daee11f --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/SorceressQueen.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class SorceressQueen extends mage.sets.revisededition.SorceressQueen { + + public SorceressQueen(UUID ownerId) { + super(ownerId); + this.cardNumber = 56; + this.expansionSetCode = "5ED"; + } + + public SorceressQueen(final SorceressQueen card) { + super(card); + } + + @Override + public SorceressQueen copy() { + return new SorceressQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/SpiritLink.java b/Mage.Sets/src/mage/sets/fifthedition/SpiritLink.java index 43087118a1e..b69812b8efb 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/SpiritLink.java +++ b/Mage.Sets/src/mage/sets/fifthedition/SpiritLink.java @@ -37,7 +37,7 @@ public class SpiritLink extends mage.sets.seventhedition.SpiritLink { public SpiritLink(UUID ownerId) { super(ownerId); - this.cardNumber = 288; + this.cardNumber = 340; this.expansionSetCode = "5ED"; } diff --git a/Mage.Sets/src/mage/sets/fifthedition/Stampede.java b/Mage.Sets/src/mage/sets/fifthedition/Stampede.java new file mode 100644 index 00000000000..79a7b0eabd6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Stampede.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Stampede extends mage.sets.iceage.Stampede { + + public Stampede(UUID ownerId) { + super(ownerId); + this.cardNumber = 189; + this.expansionSetCode = "5ED"; + } + + public Stampede(final Stampede card) { + super(card); + } + + @Override + public Stampede copy() { + return new Stampede(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Stasis.java b/Mage.Sets/src/mage/sets/fifthedition/Stasis.java index 7d792b17ed4..4cd54133f3c 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Stasis.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Stasis.java @@ -28,8 +28,6 @@ package mage.sets.fifthedition; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -37,6 +35,12 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.players.Player; @@ -48,10 +52,9 @@ import mage.players.Player; public class Stasis extends CardImpl { public Stasis(UUID ownerId) { - super(ownerId, 28, "Stasis", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + super(ownerId, 127, "Stasis", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); this.expansionSetCode = "5ED"; - // Players skip their untap steps. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipUntapStepEffect())); @@ -89,8 +92,8 @@ class SkipUntapStepEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); - return event.getType() == GameEvent.EventType.UNTAP_STEP - && controller != null + return event.getType() == GameEvent.EventType.UNTAP_STEP + && controller != null && controller.getInRange().contains(event.getPlayerId()); } } diff --git a/Mage.Sets/src/mage/sets/fifthedition/StoneSpirit.java b/Mage.Sets/src/mage/sets/fifthedition/StoneSpirit.java new file mode 100644 index 00000000000..2c9e46dc8c8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/StoneSpirit.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class StoneSpirit extends mage.sets.iceage.StoneSpirit { + + public StoneSpirit(UUID ownerId) { + super(ownerId); + this.cardNumber = 271; + this.expansionSetCode = "5ED"; + } + + public StoneSpirit(final StoneSpirit card) { + super(card); + } + + @Override + public StoneSpirit copy() { + return new StoneSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/SylvanLibrary.java b/Mage.Sets/src/mage/sets/fifthedition/SylvanLibrary.java index e6d7c57a60e..d20b20c4158 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/SylvanLibrary.java +++ b/Mage.Sets/src/mage/sets/fifthedition/SylvanLibrary.java @@ -27,9 +27,12 @@ */ package mage.sets.fifthedition; -import java.util.HashSet; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.Map; import java.util.Set; import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.BeginningOfDrawTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -44,6 +47,7 @@ import mage.constants.TargetController; import mage.constants.WatcherScope; import mage.constants.Zone; import mage.filter.FilterCard; +import mage.filter.predicate.Predicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.players.Player; @@ -62,7 +66,8 @@ public class SylvanLibrary extends CardImpl { this.expansionSetCode = "5ED"; // At the beginning of your draw step, you may draw two additional cards. If you do, choose two cards in your hand drawn this turn. For each of those cards, pay 4 life or put the card on top of your library. - this.addAbility(new BeginningOfDrawTriggeredAbility(new SylvanLibraryEffect(), TargetController.YOU, true), new CardsDrawnThisTurnWatcher()); + this.addAbility(new BeginningOfDrawTriggeredAbility(new SylvanLibraryEffect(), TargetController.YOU, true), + new CardsDrawnThisTurnWatcher()); } @@ -97,11 +102,11 @@ class SylvanLibraryEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { controller.drawCards(2, game); - CardsDrawnThisTurnWatcher watcher = (CardsDrawnThisTurnWatcher) game.getState().getWatchers().get("CardsDrawnThisTurnWatcher", source.getControllerId()); + CardsDrawnThisTurnWatcher watcher = (CardsDrawnThisTurnWatcher) game.getState().getWatchers().get("CardsDrawnThisTurnWatcher"); if (watcher != null) { Cards cards = new CardsImpl(); for (UUID cardId : controller.getHand()) { - if (watcher.getCardsDrawnThisTurn().contains(cardId)) { + if (watcher.getCardsDrawnThisTurn(controller.getId()).contains(cardId)) { Card card = game.getCard(cardId); if (card != null) { cards.add(card); @@ -110,8 +115,10 @@ class SylvanLibraryEffect extends OneShotEffect { } int numberOfTargets = Math.min(2, cards.size()); if (numberOfTargets > 0) { - TargetCardInHand target = new TargetCardInHand(numberOfTargets, new FilterCard(numberOfTargets + " cards of cards drawn this turn")); - controller.chooseTarget(outcome, cards, target, source, game); + FilterCard filter = new FilterCard(numberOfTargets + " cards of cards drawn this turn"); + filter.add(new CardIdPredicate(cards)); + TargetCardInHand target = new TargetCardInHand(numberOfTargets, filter); + controller.choose(outcome, target, source.getSourceId(), game); Cards cardsPutBack = new CardsImpl(); for (UUID cardId : target.getTargets()) { @@ -157,26 +164,31 @@ class SylvanLibraryEffect extends OneShotEffect { class CardsDrawnThisTurnWatcher extends Watcher { - private final Set cardsDrawnThisTurn = new HashSet(); + private final Map> cardsDrawnThisTurn = new HashMap<>(); public CardsDrawnThisTurnWatcher() { - super("CardsDrawnThisTurnWatcher", WatcherScope.PLAYER); + super("CardsDrawnThisTurnWatcher", WatcherScope.GAME); } public CardsDrawnThisTurnWatcher(final CardsDrawnThisTurnWatcher watcher) { super(watcher); - this.cardsDrawnThisTurn.addAll(watcher.cardsDrawnThisTurn); + this.cardsDrawnThisTurn.putAll(watcher.cardsDrawnThisTurn); } @Override public void watch(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DREW_CARD && event.getPlayerId().equals(this.getControllerId())) { - cardsDrawnThisTurn.add(event.getTargetId()); + if (event.getType() == GameEvent.EventType.DREW_CARD) { + if (!cardsDrawnThisTurn.containsKey(event.getPlayerId())) { + Set cardsDrawn = new LinkedHashSet<>(); + cardsDrawnThisTurn.put(event.getPlayerId(), cardsDrawn); + } + Set cardsDrawn = cardsDrawnThisTurn.get(event.getPlayerId()); + cardsDrawn.add(event.getTargetId()); } } - public Set getCardsDrawnThisTurn() { - return cardsDrawnThisTurn; + public Set getCardsDrawnThisTurn(UUID playerId) { + return cardsDrawnThisTurn.get(playerId); } @Override @@ -190,3 +202,27 @@ class CardsDrawnThisTurnWatcher extends Watcher { return new CardsDrawnThisTurnWatcher(this); } } + +class CardIdPredicate implements Predicate { + + private final Cards cardsId; + + public CardIdPredicate(Cards cardsId) { + this.cardsId = cardsId; + } + + @Override + public boolean apply(MageObject input, Game game) { + for (UUID uuid : cardsId) { + if (uuid.equals(input.getId())) { + return true; + } + } + return false; + } + + @Override + public String toString() { + return "CardsId"; + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/TawnossWeaponry.java b/Mage.Sets/src/mage/sets/fifthedition/TawnossWeaponry.java new file mode 100644 index 00000000000..441cd543b49 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/TawnossWeaponry.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class TawnossWeaponry extends CardImpl { + + public TawnossWeaponry(UUID ownerId) { + super(ownerId, 401, "Tawnos's Weaponry", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "5ED"; + + // You may choose not to untap Tawnos's Weaponry during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {2}, {tap}: Target creature gets +1/+1 for as long as Tawnos's Weaponry remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostTargetEffect(1, 1, Duration.Custom), SourceTappedCondition.getInstance(), + "target creature gets +1/+1 for as long as {this} remains tapped"), new ManaCostsImpl("{2}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public TawnossWeaponry(final TawnossWeaponry card) { + super(card); + } + + @Override + public TawnossWeaponry copy() { + return new TawnossWeaponry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java b/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java index bfe1f16d8a4..32971790008 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java +++ b/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java @@ -53,10 +53,10 @@ import mage.watchers.common.BlockedAttackerWatcher; /** * * @author jeffwadsworth - * + * 5/1/2009 The ability grants you control of all creatures that are blocking it as the ability resolves. This will include * any creatures that were put onto the battlefield blocking it. -5/1/2009 Any blocking creatures that regenerated during combat will have been removed from combat. Since such creatures +5/1/2009 Any blocking creatures that regenerated during combat will have been removed from combat. Since such creatures * are no longer in combat, they cannot be blocking The Wretched, which means you won't be able to gain control of them. 5/1/2009 If The Wretched itself regenerated during combat, then it will have been removed from combat. Since it is no longer * in combat, there cannot be any creatures blocking it, which means you won't be able to gain control of any creatures. @@ -64,7 +64,7 @@ import mage.watchers.common.BlockedAttackerWatcher; * combat damage step). For example, if it's blocked by a 7/7 creature and is destroyed, its ability won't trigger at all. 10/1/2009 If The Wretched leaves the battlefield, you no longer control it, so the duration of its control-change effect ends. 10/1/2009 If you lose control of The Wretched before its ability resolves, you won't gain control of the creatures blocking it at all. -10/1/2009 Once the ability resolves, it doesn't care whether the permanents you gained control of remain creatures, only that +10/1/2009 Once the ability resolves, it doesn't care whether the permanents you gained control of remain creatures, only that * they remain on the battlefield. */ @@ -96,6 +96,7 @@ class TheWretchedEffect extends OneShotEffect { TheWretchedEffect() { super(Outcome.Benefit); + staticText = "gain control of all creatures blocking {this} for as long as you control {this}"; } TheWretchedEffect(final TheWretchedEffect effect) { @@ -114,7 +115,7 @@ class TheWretchedEffect extends OneShotEffect { if (!new SourceOnBattlefieldControlUnchangedCondition().apply(game, source)) { return false; } - + for (CombatGroup combatGroup :game.getCombat().getGroups()) { if (combatGroup.getAttackers().contains(source.getSourceId())) { for(UUID creatureId: combatGroup.getBlockers()) { @@ -123,7 +124,7 @@ class TheWretchedEffect extends OneShotEffect { ContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom, source.getControllerId()), new SourceOnBattlefieldControlUnchangedCondition(), ""); effect.setTargetPointer(new FixedTarget(blocker.getId())); game.addEffect(effect, source); - + } } } diff --git a/Mage.Sets/src/mage/sets/fifthedition/TimeBomb.java b/Mage.Sets/src/mage/sets/fifthedition/TimeBomb.java new file mode 100644 index 00000000000..02b17e3aa86 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/TimeBomb.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TimeBomb extends mage.sets.masterseditionii.TimeBomb { + + public TimeBomb(UUID ownerId) { + super(ownerId); + this.cardNumber = 404; + this.expansionSetCode = "5ED"; + } + + public TimeBomb(final TimeBomb card) { + super(card); + } + + @Override + public TimeBomb copy() { + return new TimeBomb(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/TouchOfDeath.java b/Mage.Sets/src/mage/sets/fifthedition/TouchOfDeath.java new file mode 100644 index 00000000000..7b1768d4d94 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/TouchOfDeath.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TouchOfDeath extends mage.sets.iceage.TouchOfDeath { + + public TouchOfDeath(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "5ED"; + } + + public TouchOfDeath(final TouchOfDeath card) { + super(card); + } + + @Override + public TouchOfDeath copy() { + return new TouchOfDeath(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Tsunami.java b/Mage.Sets/src/mage/sets/fifthedition/Tsunami.java index 7258385defc..935c3b513b7 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Tsunami.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Tsunami.java @@ -37,7 +37,7 @@ public class Tsunami extends mage.sets.fourthedition.Tsunami { public Tsunami(UUID ownerId) { super(ownerId); - this.cardNumber = 52; + this.cardNumber = 196; this.expansionSetCode = "5ED"; } diff --git a/Mage.Sets/src/mage/sets/fifthedition/Updraft.java b/Mage.Sets/src/mage/sets/fifthedition/Updraft.java new file mode 100644 index 00000000000..7b8982eed8d --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Updraft.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Updraft extends mage.sets.iceage.Updraft { + + public Updraft(UUID ownerId) { + super(ownerId); + this.cardNumber = 133; + this.expansionSetCode = "5ED"; + this.rarity = Rarity.COMMON; + } + + public Updraft(final Updraft card) { + super(card); + } + + @Override + public Updraft copy() { + return new Updraft(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/UrzasMine.java b/Mage.Sets/src/mage/sets/fifthedition/UrzasMine.java index b23c2be148a..9d1bb0ab1d5 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/UrzasMine.java +++ b/Mage.Sets/src/mage/sets/fifthedition/UrzasMine.java @@ -28,13 +28,13 @@ package mage.sets.fifthedition; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.Mana; import mage.abilities.Ability; import mage.abilities.dynamicvalue.common.UrzaTerrainValue; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -43,7 +43,8 @@ import mage.cards.CardImpl; public class UrzasMine extends CardImpl { public UrzasMine(UUID ownerId) { super(ownerId, 447, "Urza's Mine", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); - this.subtype.add("Urza's Mine"); + this.subtype.add("Urza's"); + this.subtype.add("Mine"); this.expansionSetCode = "5ED"; // {T}: Add {1} to your mana pool. If you control an Urza's Power-Plant and an Urza's Tower, add {2} to your mana pool instead. diff --git a/Mage.Sets/src/mage/sets/fifthedition/UrzasPowerPlant.java b/Mage.Sets/src/mage/sets/fifthedition/UrzasPowerPlant.java index dfa679c2fd5..4690665b40c 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/UrzasPowerPlant.java +++ b/Mage.Sets/src/mage/sets/fifthedition/UrzasPowerPlant.java @@ -28,13 +28,13 @@ package mage.sets.fifthedition; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.Mana; import mage.abilities.Ability; import mage.abilities.dynamicvalue.common.UrzaTerrainValue; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -43,7 +43,8 @@ import mage.cards.CardImpl; public class UrzasPowerPlant extends CardImpl { public UrzasPowerPlant(UUID ownerId) { super(ownerId, 448, "Urza's Power Plant", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); - this.subtype.add("Urza's Power-Plant"); + this.subtype.add("Urza's"); + this.subtype.add("Power-Plant"); this.expansionSetCode = "5ED"; // {T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Tower, add {2} to your mana pool instead. diff --git a/Mage.Sets/src/mage/sets/fifthedition/UrzasTower.java b/Mage.Sets/src/mage/sets/fifthedition/UrzasTower.java index 0fab9d741cb..1096b1dd5e0 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/UrzasTower.java +++ b/Mage.Sets/src/mage/sets/fifthedition/UrzasTower.java @@ -28,13 +28,13 @@ package mage.sets.fifthedition; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.Mana; import mage.abilities.Ability; import mage.abilities.dynamicvalue.common.UrzaTerrainValue; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -43,7 +43,8 @@ import mage.cards.CardImpl; public class UrzasTower extends CardImpl { public UrzasTower(UUID ownerId) { super(ownerId, 449, "Urza's Tower", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); - this.subtype.add("Urza's Tower"); + this.subtype.add("Urza's"); + this.subtype.add("Tower"); this.expansionSetCode = "5ED"; // {T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Power-Plant, add {3} to your mana pool instead. diff --git a/Mage.Sets/src/mage/sets/fifthedition/Wanderlust.java b/Mage.Sets/src/mage/sets/fifthedition/Wanderlust.java new file mode 100644 index 00000000000..206e8abeec2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 201; + this.expansionSetCode = "5ED"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/WarpArtifact.java b/Mage.Sets/src/mage/sets/fifthedition/WarpArtifact.java new file mode 100644 index 00000000000..27207beb936 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/WarpArtifact.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends CardImpl { + + public WarpArtifact(UUID ownerId) { + super(ownerId, 66, "Warp Artifact", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Aura"); + + // Enchant artifact + TargetPermanent auraTarget = new TargetArtifactPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted artifact's controller, Warp Artifact deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/WindsOfChange.java b/Mage.Sets/src/mage/sets/fifthedition/WindsOfChange.java index bcc08cf0532..c056c1ec218 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/WindsOfChange.java +++ b/Mage.Sets/src/mage/sets/fifthedition/WindsOfChange.java @@ -27,10 +27,11 @@ */ package mage.sets.fifthedition; +import java.util.HashMap; +import java.util.Map; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -49,7 +50,6 @@ public class WindsOfChange extends CardImpl { super(ownerId, 275, "Winds of Change", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{R}"); this.expansionSetCode = "5ED"; - // Each player shuffles the cards from his or her hand into his or her library, then draws that many cards. this.getSpellAbility().addEffect(new WindsOfChangeEffect()); } @@ -84,19 +84,19 @@ class WindsOfChangeEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (UUID playerId : controller.getInRange()) { + Map permanentsCount = new HashMap<>(); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - int cardsHand = player.getHand().size(); - if (cardsHand > 0){ - for (Card card: player.getHand().getCards(game)) { - player.removeFromHand(card, game); - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - game.informPlayers(player.getLogName() + " shuffles the cards from his or her hand into his or her library"); - player.shuffleLibrary(game); - player.drawCards(cardsHand, game); - } + permanentsCount.put(playerId, player.getHand().size()); + player.moveCards(player.getHand(), Zone.HAND, Zone.LIBRARY, source, game); + player.shuffleLibrary(game); + } + } + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null && permanentsCount.containsKey(playerId)) { + player.drawCards(permanentsCount.get(playerId), game); } } return true; diff --git a/Mage.Sets/src/mage/sets/fifthedition/WolverinePack.java b/Mage.Sets/src/mage/sets/fifthedition/WolverinePack.java new file mode 100644 index 00000000000..f482b988c14 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/WolverinePack.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WolverinePack extends mage.sets.legends.WolverinePack { + + public WolverinePack(UUID ownerId) { + super(ownerId); + this.cardNumber = 206; + this.expansionSetCode = "5ED"; + this.rarity = Rarity.UNCOMMON; + } + + public WolverinePack(final WolverinePack card) { + super(card); + } + + @Override + public WolverinePack copy() { + return new WolverinePack(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/WordOfBlasting.java b/Mage.Sets/src/mage/sets/fifthedition/WordOfBlasting.java new file mode 100644 index 00000000000..8c423c8867f --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/WordOfBlasting.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WordOfBlasting extends mage.sets.iceage.WordOfBlasting { + + public WordOfBlasting(UUID ownerId) { + super(ownerId); + this.cardNumber = 276; + this.expansionSetCode = "5ED"; + } + + public WordOfBlasting(final WordOfBlasting card) { + super(card); + } + + @Override + public WordOfBlasting copy() { + return new WordOfBlasting(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/AmrouKithkin.java b/Mage.Sets/src/mage/sets/fourthedition/AmrouKithkin.java new file mode 100644 index 00000000000..f7ce1b9f3ca --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/AmrouKithkin.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AmrouKithkin extends mage.sets.legends.AmrouKithkin { + + public AmrouKithkin(UUID ownerId) { + super(ownerId); + this.cardNumber = 252; + this.expansionSetCode = "4ED"; + } + + public AmrouKithkin(final AmrouKithkin card) { + super(card); + } + + @Override + public AmrouKithkin copy() { + return new AmrouKithkin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/AshnodsBattleGear.java b/Mage.Sets/src/mage/sets/fourthedition/AshnodsBattleGear.java new file mode 100644 index 00000000000..562af8a8fad --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/AshnodsBattleGear.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class AshnodsBattleGear extends mage.sets.antiquities.AshnodsBattleGear { + + public AshnodsBattleGear(UUID ownerId) { + super(ownerId); + this.cardNumber = 314; + this.expansionSetCode = "4ED"; + } + + public AshnodsBattleGear(final AshnodsBattleGear card) { + super(card); + } + + @Override + public AshnodsBattleGear copy() { + return new AshnodsBattleGear(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Blessing.java b/Mage.Sets/src/mage/sets/fourthedition/Blessing.java index 081b3a0bbfd..c05d454aa17 100644 --- a/Mage.Sets/src/mage/sets/fourthedition/Blessing.java +++ b/Mage.Sets/src/mage/sets/fourthedition/Blessing.java @@ -51,7 +51,7 @@ import mage.target.common.TargetCreaturePermanent; public class Blessing extends CardImpl { public Blessing(UUID ownerId) { - super(ownerId, 1, "Blessing", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}"); + super(ownerId, 259, "Blessing", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}"); this.expansionSetCode = "4ED"; this.subtype.add("Aura"); diff --git a/Mage.Sets/src/mage/sets/fourthedition/BrothersOfFire.java b/Mage.Sets/src/mage/sets/fourthedition/BrothersOfFire.java new file mode 100644 index 00000000000..b7b8b28f26f --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/BrothersOfFire.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class BrothersOfFire extends CardImpl { + + public BrothersOfFire(UUID ownerId) { + super(ownerId, 197, "Brothers of Fire", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "4ED"; + this.subtype.add("Human"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {1}{R}{R}: Brothers of Fire deals 1 damage to target creature or player and 1 damage to you. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}{R}{R}")); + Effect effect = new DamageControllerEffect(1); + effect.setText("and 1 damage to you"); + ability.addEffect(effect); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public BrothersOfFire(final BrothersOfFire card) { + super(card); + } + + @Override + public BrothersOfFire copy() { + return new BrothersOfFire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/CavePeople.java b/Mage.Sets/src/mage/sets/fourthedition/CavePeople.java new file mode 100644 index 00000000000..69bcfadd19b --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/CavePeople.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CavePeople extends mage.sets.thedark.CavePeople { + + public CavePeople(UUID ownerId) { + super(ownerId); + this.cardNumber = 199; + this.expansionSetCode = "4ED"; + } + + public CavePeople(final CavePeople card) { + super(card); + } + + @Override + public CavePeople copy() { + return new CavePeople(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Chaoslace.java b/Mage.Sets/src/mage/sets/fourthedition/Chaoslace.java new file mode 100644 index 00000000000..74d149d3ed6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Chaoslace.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.ObjectColor; +import mage.target.common.TargetSpellOrPermanent; + + +/** + * + * @author AlumiuN + */ +public class Chaoslace extends CardImpl { + + public Chaoslace(UUID ownerId) { + super(ownerId, 200, "Chaoslace", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "4ED"; + + // Target spell or permanent becomes red. + this.getSpellAbility().addTarget(new TargetSpellOrPermanent()); + this.getSpellAbility().addEffect(new BecomesColorTargetEffect(ObjectColor.RED, Duration.Custom)); + } + + public Chaoslace(final Chaoslace card) { + super(card); + } + + @Override + public Chaoslace copy() { + return new Chaoslace(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/fourthedition/Conversion.java b/Mage.Sets/src/mage/sets/fourthedition/Conversion.java new file mode 100644 index 00000000000..856dc943dfb --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Conversion.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 269; + this.expansionSetCode = "4ED"; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/CoralHelm.java b/Mage.Sets/src/mage/sets/fourthedition/CoralHelm.java new file mode 100644 index 00000000000..af73dce6c99 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/CoralHelm.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author nigelzor + */ +public class CoralHelm extends mage.sets.masterseditioniv.CoralHelm { + + public CoralHelm(UUID ownerId) { + super(ownerId); + this.cardNumber = 328; + this.expansionSetCode = "4ED"; + this.rarity = Rarity.RARE; + } + + public CoralHelm(final CoralHelm card) { + super(card); + } + + @Override + public CoralHelm copy() { + return new CoralHelm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/CosmicHorror.java b/Mage.Sets/src/mage/sets/fourthedition/CosmicHorror.java new file mode 100644 index 00000000000..85d57bd54d5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/CosmicHorror.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class CosmicHorror extends mage.sets.legends.CosmicHorror { + + public CosmicHorror(UUID ownerId) { + super(ownerId); + this.cardNumber = 10; + this.expansionSetCode = "4ED"; + } + + public CosmicHorror(final CosmicHorror card) { + super(card); + } + + @Override + public CosmicHorror copy() { + return new CosmicHorror(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Crumble.java b/Mage.Sets/src/mage/sets/fourthedition/Crumble.java new file mode 100644 index 00000000000..18d5931db03 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Crumble.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Crumble extends mage.sets.masterseditioniv.Crumble { + + public Crumble(UUID ownerId) { + super(ownerId); + this.cardNumber = 123; + this.expansionSetCode = "4ED"; + this.rarity = Rarity.UNCOMMON; + } + + public Crumble(final Crumble card) { + super(card); + } + + @Override + public Crumble copy() { + return new Crumble(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/CursedLand.java b/Mage.Sets/src/mage/sets/fourthedition/CursedLand.java new file mode 100644 index 00000000000..0ae7aa71922 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/CursedLand.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class CursedLand extends CardImpl { + + public CursedLand(UUID ownerId) { + super(ownerId, 11, "Cursed Land", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); + this.expansionSetCode = "4ED"; + this.subtype.add("Aura"); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted land's controller, Cursed Land deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Deathgrip.java b/Mage.Sets/src/mage/sets/fourthedition/Deathgrip.java new file mode 100644 index 00000000000..a99ff56436a --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Deathgrip.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class Deathgrip extends mage.sets.limitedbeta.Deathgrip { + + public Deathgrip(UUID ownerId) { + super(ownerId); + this.cardNumber = 14; + this.expansionSetCode = "4ED"; + } + + public Deathgrip(final Deathgrip card) { + super(card); + } + + @Override + public Deathgrip copy() { + return new Deathgrip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Deathlace.java b/Mage.Sets/src/mage/sets/fourthedition/Deathlace.java new file mode 100644 index 00000000000..a6d66e70d78 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Deathlace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Deathlace extends mage.sets.limitedbeta.Deathlace { + + public Deathlace(UUID ownerId) { + super(ownerId); + this.cardNumber = 15; + this.expansionSetCode = "4ED"; + } + + public Deathlace(final Deathlace card) { + super(card); + } + + @Override + public Deathlace copy() { + return new Deathlace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Detonate.java b/Mage.Sets/src/mage/sets/fourthedition/Detonate.java new file mode 100644 index 00000000000..e8f17c68212 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Detonate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Detonate extends mage.sets.fifthedition.Detonate { + + public Detonate(UUID ownerId) { + super(ownerId); + this.cardNumber = 202; + this.expansionSetCode = "4ED"; + } + + public Detonate(final Detonate card) { + super(card); + } + + @Override + public Detonate copy() { + return new Detonate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/DiabolicMachine.java b/Mage.Sets/src/mage/sets/fourthedition/DiabolicMachine.java new file mode 100644 index 00000000000..c739fc2a759 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/DiabolicMachine.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author nigelzor + */ +public class DiabolicMachine extends CardImpl { + + public DiabolicMachine(UUID ownerId) { + super(ownerId, 332, "Diabolic Machine", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}"); + this.expansionSetCode = "4ED"; + this.subtype.add("Construct"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {3}: Regenerate Diabolic Machine. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new GenericManaCost(3))); + } + + public DiabolicMachine(final DiabolicMachine card) { + super(card); + } + + @Override + public DiabolicMachine copy() { + return new DiabolicMachine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/EbonyHorse.java b/Mage.Sets/src/mage/sets/fourthedition/EbonyHorse.java index 943eb139161..c2601f3b37e 100644 --- a/Mage.Sets/src/mage/sets/fourthedition/EbonyHorse.java +++ b/Mage.Sets/src/mage/sets/fourthedition/EbonyHorse.java @@ -33,13 +33,19 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.*; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventCombatDamageBySourceEffect; +import mage.abilities.effects.common.PreventCombatDamageToSourceEffect; +import mage.abilities.effects.common.UntapTargetEffect; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.AttackingPredicate; import mage.filter.predicate.permanent.ControllerPredicate; -import mage.target.Target; import mage.target.common.TargetCreaturePermanent; /** @@ -61,10 +67,13 @@ public class EbonyHorse extends CardImpl { // {2}, {tap}: Untap target attacking creature you control. Prevent all combat damage that would be dealt to and dealt by that creature this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new GenericManaCost(2)); ability.addCost(new TapSourceCost()); - ability.addEffect(new PreventCombatDamageToSourceEffect(Duration.EndOfTurn)); - ability.addEffect(new PreventCombatDamageBySourceEffect(Duration.EndOfTurn)); - Target target = new TargetCreaturePermanent(filter); - ability.addTarget(target); + Effect effect = new PreventCombatDamageToSourceEffect(Duration.EndOfTurn); + effect.setText("Prevent all combat damage that would be dealt to"); + ability.addEffect(effect); + effect = new PreventCombatDamageBySourceEffect(Duration.EndOfTurn); + effect.setText("and dealt by that creature this turn"); + ability.addEffect(effect); + ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/fourthedition/Feedback.java b/Mage.Sets/src/mage/sets/fourthedition/Feedback.java new file mode 100644 index 00000000000..937483999ee --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 71; + this.expansionSetCode = "4ED"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Flood.java b/Mage.Sets/src/mage/sets/fourthedition/Flood.java new file mode 100644 index 00000000000..642a518bf89 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Flood.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Flood extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature without flying"); + + static { + filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + + public Flood(UUID ownerId) { + super(ownerId, 73, "Flood", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}"); + this.expansionSetCode = "4ED"; + + // {U}{U}: Tap target creature without flying. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{U}{U}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public Flood(final Flood card) { + super(card); + } + + @Override + public Flood copy() { + return new Flood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/IslandFishJasconius.java b/Mage.Sets/src/mage/sets/fourthedition/IslandFishJasconius.java new file mode 100644 index 00000000000..fd840a61c28 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/IslandFishJasconius.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.abilities.effects.common.combat.CantAttackUnlessDefenderControllsPermanent; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterLandPermanent; + +/** + * + * @author fireshoes + */ +public class IslandFishJasconius extends CardImpl { + + public IslandFishJasconius(UUID ownerId) { + super(ownerId, 78, "Island Fish Jasconius", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}{U}{U}"); + this.expansionSetCode = "4ED"; + this.subtype.add("Fish"); + this.power = new MageInt(6); + this.toughness = new MageInt(8); + + // Island Fish Jasconius doesn't untap during your untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepSourceEffect())); + + // At the beginning of your upkeep, you may pay {U}{U}{U}. If you do, untap Island Fish Jasconius. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + Zone.BATTLEFIELD, + new DoIfCostPaid(new UntapSourceEffect(), new ManaCostsImpl("{U}{U}{U}")), + TargetController.YOU, + false)); + + // Island Fish Jasconius can't attack unless defending player controls an Island. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackUnlessDefenderControllsPermanent(new FilterLandPermanent("Island", "an Island")))); + + // When you control no Islands, sacrifice Island Fish Jasconius. + this.addAbility(new ControlsPermanentsControllerTriggeredAbility( + new FilterLandPermanent("Island", "no Islands"), Filter.ComparisonType.Equal, 0, + new SacrificeSourceEffect())); + } + + public IslandFishJasconius(final IslandFishJasconius card) { + super(card); + } + + @Override + public IslandFishJasconius copy() { + return new IslandFishJasconius(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/JununEfreet.java b/Mage.Sets/src/mage/sets/fourthedition/JununEfreet.java new file mode 100644 index 00000000000..eb6e17f2221 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/JununEfreet.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class JununEfreet extends CardImpl { + + public JununEfreet(UUID ownerId) { + super(ownerId, 27, "Junún Efreet", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "4ED"; + this.subtype.add("Efreet"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // At the beginning of your upkeep, sacrifice Junún Efreet unless you pay {B}{B}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{B}{B}")), TargetController.YOU, false)); + } + + public JununEfreet(final JununEfreet card) { + super(card); + } + + @Override + public JununEfreet copy() { + return new JununEfreet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Lifeforce.java b/Mage.Sets/src/mage/sets/fourthedition/Lifeforce.java new file mode 100644 index 00000000000..4e4b04d2815 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Lifeforce.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Lifeforce extends mage.sets.masterseditioniv.Lifeforce { + + public Lifeforce(UUID ownerId) { + super(ownerId); + this.cardNumber = 141; + this.expansionSetCode = "4ED"; + this.rarity = Rarity.UNCOMMON; + } + + public Lifeforce(final Lifeforce card) { + super(card); + } + + @Override + public Lifeforce copy() { + return new Lifeforce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Lifelace.java b/Mage.Sets/src/mage/sets/fourthedition/Lifelace.java new file mode 100644 index 00000000000..2b9c81b10ef --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Lifelace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Lifelace extends mage.sets.limitedalpha.Lifelace { + + public Lifelace(UUID ownerId) { + super(ownerId); + this.cardNumber = 142; + this.expansionSetCode = "4ED"; + } + + public Lifelace(final Lifelace card) { + super(card); + } + + @Override + public Lifelace copy() { + return new Lifelace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Lifetap.java b/Mage.Sets/src/mage/sets/fourthedition/Lifetap.java new file mode 100644 index 00000000000..72046df5bde --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Lifetap.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Lifetap extends mage.sets.fifthedition.Lifetap { + + public Lifetap(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "4ED"; + } + + public Lifetap(final Lifetap card) { + super(card); + } + + @Override + public Lifetap copy() { + return new Lifetap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/LivingArtifact.java b/Mage.Sets/src/mage/sets/fourthedition/LivingArtifact.java new file mode 100644 index 00000000000..de94d1ea7a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/LivingArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class LivingArtifact extends mage.sets.fifthedition.LivingArtifact { + + public LivingArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 143; + this.expansionSetCode = "4ED"; + } + + public LivingArtifact(final LivingArtifact card) { + super(card); + } + + @Override + public LivingArtifact copy() { + return new LivingArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/MurkDwellers.java b/Mage.Sets/src/mage/sets/fourthedition/MurkDwellers.java new file mode 100644 index 00000000000..ce073a57889 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/MurkDwellers.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MurkDwellers extends mage.sets.fifthedition.MurkDwellers { + + public MurkDwellers(UUID ownerId) { + super(ownerId); + this.cardNumber = 32; + this.expansionSetCode = "4ED"; + } + + public MurkDwellers(final MurkDwellers card) { + super(card); + } + + @Override + public MurkDwellers copy() { + return new MurkDwellers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/OsaiVultures.java b/Mage.Sets/src/mage/sets/fourthedition/OsaiVultures.java new file mode 100644 index 00000000000..2bbcdbce66b --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/OsaiVultures.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class OsaiVultures extends mage.sets.legends.OsaiVultures { + + public OsaiVultures(UUID ownerId) { + super(ownerId); + this.cardNumber = 288; + this.expansionSetCode = "4ED"; + this.rarity = Rarity.UNCOMMON; + } + + public OsaiVultures(final OsaiVultures card) { + super(card); + } + + @Override + public OsaiVultures copy() { + return new OsaiVultures(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Purelace.java b/Mage.Sets/src/mage/sets/fourthedition/Purelace.java new file mode 100644 index 00000000000..a25d9f92c2c --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Purelace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Purelace extends mage.sets.unlimitededition.Purelace { + + public Purelace(UUID ownerId) { + super(ownerId); + this.cardNumber = 293; + this.expansionSetCode = "4ED"; + } + + public Purelace(final Purelace card) { + super(card); + } + + @Override + public Purelace copy() { + return new Purelace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/ScavengingGhoul.java b/Mage.Sets/src/mage/sets/fourthedition/ScavengingGhoul.java new file mode 100644 index 00000000000..e6c3af13f8a --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/ScavengingGhoul.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ScavengingGhoul extends mage.sets.limitedalpha.ScavengingGhoul { + + public ScavengingGhoul(UUID ownerId) { + super(ownerId); + this.cardNumber = 43; + this.expansionSetCode = "4ED"; + } + + public ScavengingGhoul(final ScavengingGhoul card) { + super(card); + } + + @Override + public ScavengingGhoul copy() { + return new ScavengingGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/SistersOfTheFlame.java b/Mage.Sets/src/mage/sets/fourthedition/SistersOfTheFlame.java new file mode 100644 index 00000000000..0f281602d82 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/SistersOfTheFlame.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SistersOfTheFlame extends CardImpl { + + public SistersOfTheFlame(UUID ownerId) { + super(ownerId, 239, "Sisters of the Flame", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "4ED"; + this.subtype.add("Human"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {tap}: Add {R} to your mana pool. + this.addAbility(new RedManaAbility()); + } + + public SistersOfTheFlame(final SistersOfTheFlame card) { + super(card); + } + + @Override + public SistersOfTheFlame copy() { + return new SistersOfTheFlame(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/SorceressQueen.java b/Mage.Sets/src/mage/sets/fourthedition/SorceressQueen.java new file mode 100644 index 00000000000..3d2619efd74 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/SorceressQueen.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class SorceressQueen extends mage.sets.revisededition.SorceressQueen { + + public SorceressQueen(UUID ownerId) { + super(ownerId); + this.cardNumber = 46; + this.expansionSetCode = "4ED"; + } + + public SorceressQueen(final SorceressQueen card) { + super(card); + } + + @Override + public SorceressQueen copy() { + return new SorceressQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/SunglassesOfUrza.java b/Mage.Sets/src/mage/sets/fourthedition/SunglassesOfUrza.java new file mode 100644 index 00000000000..c7285a4f278 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/SunglassesOfUrza.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SunglassesOfUrza extends mage.sets.limitedalpha.SunglassesOfUrza { + + public SunglassesOfUrza(UUID ownerId) { + super(ownerId); + this.cardNumber = 365; + this.expansionSetCode = "4ED"; + } + + public SunglassesOfUrza(final SunglassesOfUrza card) { + super(card); + } + + @Override + public SunglassesOfUrza copy() { + return new SunglassesOfUrza(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/SunkenCity.java b/Mage.Sets/src/mage/sets/fourthedition/SunkenCity.java new file mode 100644 index 00000000000..e5c8de8c8a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/SunkenCity.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SunkenCity extends mage.sets.mastersedition.SunkenCity { + + public SunkenCity(UUID ownerId) { + super(ownerId); + this.cardNumber = 106; + this.expansionSetCode = "4ED"; + this.rarity = Rarity.COMMON; + } + + public SunkenCity(final SunkenCity card) { + super(card); + } + + @Override + public SunkenCity copy() { + return new SunkenCity(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/TawnossWeaponry.java b/Mage.Sets/src/mage/sets/fourthedition/TawnossWeaponry.java new file mode 100644 index 00000000000..eb3b9a1d162 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/TawnossWeaponry.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class TawnossWeaponry extends mage.sets.fifthedition.TawnossWeaponry { + + public TawnossWeaponry(UUID ownerId) { + super(ownerId); + this.cardNumber = 367; + this.expansionSetCode = "4ED"; + } + + public TawnossWeaponry(final TawnossWeaponry card) { + super(card); + } + + @Override + public TawnossWeaponry copy() { + return new TawnossWeaponry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/TheRack.java b/Mage.Sets/src/mage/sets/fourthedition/TheRack.java index 98b564a6bbf..1f22f23cfad 100644 --- a/Mage.Sets/src/mage/sets/fourthedition/TheRack.java +++ b/Mage.Sets/src/mage/sets/fourthedition/TheRack.java @@ -32,6 +32,7 @@ import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseOpponentEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -40,9 +41,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.players.Player; -import mage.target.common.TargetOpponent; /** * @@ -55,7 +54,7 @@ public class TheRack extends CardImpl { this.expansionSetCode = "4ED"; // As The Rack enters the battlefield, choose an opponent. - this.addAbility(new AsEntersBattlefieldAbility(new ChooseOpponent())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseOpponentEffect(Outcome.Detriment))); // At the beginning of the chosen player's upkeep, The Rack deals X damage to that player, where X is 3 minus the number of cards in his or her hand. this.addAbility(new TheRackTriggeredAbility()); } @@ -72,7 +71,6 @@ public class TheRack extends CardImpl { class TheRackTriggeredAbility extends TriggeredAbilityImpl { - public TheRackTriggeredAbility() { super(Zone.BATTLEFIELD, new TheRackEffect(), false); } @@ -93,52 +91,16 @@ class TheRackTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getPlayerId().equals((UUID) game.getState().getValue(new StringBuilder(this.getSourceId().toString()).append("_player").toString())); + return event.getPlayerId().equals((UUID) game.getState().getValue(this.getSourceId().toString() + ChooseOpponentEffect.VALUE_KEY)); } @Override public String getRule() { - return new StringBuilder("At the beginning of the chosen player's upkeep, ").append(super.getRule()).toString(); + return "At the beginning of the chosen player's upkeep, " + super.getRule(); } } -class ChooseOpponent extends OneShotEffect { - - public ChooseOpponent() { - super(Outcome.Neutral); - this.staticText = "choose an opponent"; - } - - public ChooseOpponent(final ChooseOpponent effect) { - super(effect); - } - - @Override - public ChooseOpponent copy() { - return new ChooseOpponent(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - TargetOpponent target = new TargetOpponent(); - target.setNotTarget(true); - if (player.choose(this.outcome, target, source.getSourceId(), game)) { - Player chosenPlayer = game.getPlayer(target.getFirstTarget()); - if (chosenPlayer != null) { - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + chosenPlayer.getLogName()); - game.getState().setValue(permanent.getId() + "_player", target.getFirstTarget()); - return true; - } - } - } - return false; - } -} - class TheRackEffect extends OneShotEffect { public TheRackEffect() { @@ -157,7 +119,7 @@ class TheRackEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - UUID playerId = (UUID) game.getState().getValue(new StringBuilder(source.getSourceId().toString()).append("_player").toString()); + UUID playerId = (UUID) game.getState().getValue(source.getSourceId().toString() + ChooseOpponentEffect.VALUE_KEY); Player chosenPlayer = game.getPlayer(playerId); if (chosenPlayer != null) { int damage = 3 - chosenPlayer.getHand().size(); diff --git a/Mage.Sets/src/mage/sets/fourthedition/Thoughtlace.java b/Mage.Sets/src/mage/sets/fourthedition/Thoughtlace.java new file mode 100644 index 00000000000..19f9d3bcc34 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Thoughtlace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Thoughtlace extends mage.sets.limitedbeta.Thoughtlace { + + public Thoughtlace(UUID ownerId) { + super(ownerId); + this.cardNumber = 107; + this.expansionSetCode = "4ED"; + } + + public Thoughtlace(final Thoughtlace card) { + super(card); + } + + @Override + public Thoughtlace copy() { + return new Thoughtlace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Wanderlust.java b/Mage.Sets/src/mage/sets/fourthedition/Wanderlust.java new file mode 100644 index 00000000000..8f940308276 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 169; + this.expansionSetCode = "4ED"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/WarpArtifact.java b/Mage.Sets/src/mage/sets/fourthedition/WarpArtifact.java new file mode 100644 index 00000000000..7cac4f6ce78 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 53; + this.expansionSetCode = "4ED"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/WordOfBinding.java b/Mage.Sets/src/mage/sets/fourthedition/WordOfBinding.java new file mode 100644 index 00000000000..ecdfe11b989 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/WordOfBinding.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fourthedition; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class WordOfBinding extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures"); + + public WordOfBinding(UUID ownerId) { + super(ownerId, 56, "Word of Binding", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{X}{B}{B}"); + this.expansionSetCode = "4ED"; + + // Tap X target creatures. + this.getSpellAbility().addEffect(new TapTargetEffect("X target creatures")); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1,filter, false)); + } + + public WordOfBinding(final WordOfBinding card) { + super(card); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if (ability instanceof SpellAbility) { + ability.getTargets().clear(); + int numberToTap = ability.getManaCostsToPay().getX(); + numberToTap = Math.min(game.getBattlefield().count(filter, ability.getSourceId(), ability.getControllerId(), game), numberToTap); + ability.addTarget(new TargetCreaturePermanent(numberToTap, numberToTap, filter, false)); + } + } + + @Override + public WordOfBinding copy() { + return new WordOfBinding(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fridaynightmagic/Ophidian.java b/Mage.Sets/src/mage/sets/fridaynightmagic/Ophidian.java new file mode 100644 index 00000000000..495eb7f297b --- /dev/null +++ b/Mage.Sets/src/mage/sets/fridaynightmagic/Ophidian.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fridaynightmagic; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Ophidian extends mage.sets.vintagemasters.Ophidian { + + public Ophidian(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "FNMP"; + this.rarity = Rarity.UNCOMMON; + } + + public Ophidian(final Ophidian card) { + super(card); + } + + @Override + public Ophidian copy() { + return new Ophidian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fridaynightmagic/Roast.java b/Mage.Sets/src/mage/sets/fridaynightmagic/Roast.java new file mode 100644 index 00000000000..f3a5c42eb43 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fridaynightmagic/Roast.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fridaynightmagic; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Roast extends mage.sets.dragonsoftarkir.Roast { + + public Roast(UUID ownerId) { + super(ownerId); + this.cardNumber = 186; + this.expansionSetCode = "FNMP"; + } + + public Roast(final Roast card) { + super(card); + } + + @Override + public Roast copy() { + return new Roast(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ftvangels/AureliaTheWarleader.java b/Mage.Sets/src/mage/sets/ftvangels/AureliaTheWarleader.java new file mode 100644 index 00000000000..d52f76988dd --- /dev/null +++ b/Mage.Sets/src/mage/sets/ftvangels/AureliaTheWarleader.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ftvangels; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AureliaTheWarleader extends mage.sets.gatecrash.AureliaTheWarleader { + + public AureliaTheWarleader(UUID ownerId) { + super(ownerId); + this.cardNumber = 4; + this.expansionSetCode = "V15"; + } + + public AureliaTheWarleader(final AureliaTheWarleader card) { + super(card); + } + + @Override + public AureliaTheWarleader copy() { + return new AureliaTheWarleader(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ftvangels/BaneslayerAngel.java b/Mage.Sets/src/mage/sets/ftvangels/BaneslayerAngel.java new file mode 100644 index 00000000000..638203f7bdc --- /dev/null +++ b/Mage.Sets/src/mage/sets/ftvangels/BaneslayerAngel.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ftvangels; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BaneslayerAngel extends mage.sets.magic2010.BaneslayerAngel { + + public BaneslayerAngel(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "V15"; + } + + public BaneslayerAngel(final BaneslayerAngel card) { + super(card); + } + + @Override + public BaneslayerAngel copy() { + return new BaneslayerAngel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ftvangels/EntreatTheAngels.java b/Mage.Sets/src/mage/sets/ftvangels/EntreatTheAngels.java new file mode 100644 index 00000000000..e0551dd032b --- /dev/null +++ b/Mage.Sets/src/mage/sets/ftvangels/EntreatTheAngels.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ftvangels; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EntreatTheAngels extends mage.sets.avacynrestored.EntreatTheAngels { + + public EntreatTheAngels(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "V15"; + } + + public EntreatTheAngels(final EntreatTheAngels card) { + super(card); + } + + @Override + public EntreatTheAngels copy() { + return new EntreatTheAngels(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ftvangels/ExaltedAngel.java b/Mage.Sets/src/mage/sets/ftvangels/ExaltedAngel.java new file mode 100644 index 00000000000..c5536b6cb37 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ftvangels/ExaltedAngel.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ftvangels; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ExaltedAngel extends mage.sets.onslaught.ExaltedAngel { + + public ExaltedAngel(UUID ownerId) { + super(ownerId); + this.cardNumber = 8; + this.expansionSetCode = "V15"; + this.rarity = Rarity.MYTHIC; + } + + public ExaltedAngel(final ExaltedAngel card) { + super(card); + } + + @Override + public ExaltedAngel copy() { + return new ExaltedAngel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ftvangels/IridescentAngel.java b/Mage.Sets/src/mage/sets/ftvangels/IridescentAngel.java new file mode 100644 index 00000000000..6e1999d1cbf --- /dev/null +++ b/Mage.Sets/src/mage/sets/ftvangels/IridescentAngel.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ftvangels; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class IridescentAngel extends mage.sets.odyssey.IridescentAngel { + + public IridescentAngel(UUID ownerId) { + super(ownerId); + this.cardNumber = 10; + this.expansionSetCode = "V15"; + this.rarity = Rarity.MYTHIC; + } + + public IridescentAngel(final IridescentAngel card) { + super(card); + } + + @Override + public IridescentAngel copy() { + return new IridescentAngel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ftvangels/JenaraAsuraOfWar.java b/Mage.Sets/src/mage/sets/ftvangels/JenaraAsuraOfWar.java new file mode 100644 index 00000000000..53c80937a61 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ftvangels/JenaraAsuraOfWar.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ftvangels; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class JenaraAsuraOfWar extends mage.sets.alarareborn.JenaraAsuraOfWar { + + public JenaraAsuraOfWar(UUID ownerId) { + super(ownerId); + this.cardNumber = 11; + this.expansionSetCode = "V15"; + } + + public JenaraAsuraOfWar(final JenaraAsuraOfWar card) { + super(card); + } + + @Override + public JenaraAsuraOfWar copy() { + return new JenaraAsuraOfWar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ftvangels/LightningAngel.java b/Mage.Sets/src/mage/sets/ftvangels/LightningAngel.java new file mode 100644 index 00000000000..1b78d96256c --- /dev/null +++ b/Mage.Sets/src/mage/sets/ftvangels/LightningAngel.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ftvangels; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class LightningAngel extends mage.sets.apocalypse.LightningAngel { + + public LightningAngel(UUID ownerId) { + super(ownerId); + this.cardNumber = 12; + this.expansionSetCode = "V15"; + this.rarity = Rarity.MYTHIC; + } + + public LightningAngel(final LightningAngel card) { + super(card); + } + + @Override + public LightningAngel copy() { + return new LightningAngel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ftvangels/PlatinumAngel.java b/Mage.Sets/src/mage/sets/ftvangels/PlatinumAngel.java new file mode 100644 index 00000000000..7a4a5812c1f --- /dev/null +++ b/Mage.Sets/src/mage/sets/ftvangels/PlatinumAngel.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ftvangels; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class PlatinumAngel extends mage.sets.tenthedition.PlatinumAngel { + + public PlatinumAngel(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "V15"; + this.rarity = Rarity.MYTHIC; + } + + public PlatinumAngel(final PlatinumAngel card) { + super(card); + } + + @Override + public PlatinumAngel copy() { + return new PlatinumAngel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ftvangels/SerraAngel.java b/Mage.Sets/src/mage/sets/ftvangels/SerraAngel.java new file mode 100644 index 00000000000..f9db2c50cc4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ftvangels/SerraAngel.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ftvangels; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class SerraAngel extends mage.sets.tenthedition.SerraAngel { + + public SerraAngel(UUID ownerId) { + super(ownerId); + this.cardNumber = 14; + this.expansionSetCode = "V15"; + this.rarity = Rarity.MYTHIC; + } + + public SerraAngel(final SerraAngel card) { + super(card); + } + + @Override + public SerraAngel copy() { + return new SerraAngel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ftvangels/TarielReckonerOfSouls.java b/Mage.Sets/src/mage/sets/ftvangels/TarielReckonerOfSouls.java new file mode 100644 index 00000000000..e63b716a94e --- /dev/null +++ b/Mage.Sets/src/mage/sets/ftvangels/TarielReckonerOfSouls.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ftvangels; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TarielReckonerOfSouls extends mage.sets.commander.TarielReckonerOfSouls { + + public TarielReckonerOfSouls(UUID ownerId) { + super(ownerId); + this.cardNumber = 15; + this.expansionSetCode = "V15"; + } + + public TarielReckonerOfSouls(final TarielReckonerOfSouls card) { + super(card); + } + + @Override + public TarielReckonerOfSouls copy() { + return new TarielReckonerOfSouls(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ftvdragons/EbonDragon.java b/Mage.Sets/src/mage/sets/ftvdragons/EbonDragon.java new file mode 100644 index 00000000000..93abef13890 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ftvdragons/EbonDragon.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ftvdragons; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class EbonDragon extends CardImpl { + + public EbonDragon(UUID ownerId) { + super(ownerId, 6, "Ebon Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); + this.expansionSetCode = "FVD"; + this.subtype.add("Dragon"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Ebon Dragon enters the battlefield, you may have target opponent discard a card. + Effect effect = new DiscardTargetEffect(1, false); + effect.setText("you may have target opponent discard a card"); + Ability ability = new EntersBattlefieldTriggeredAbility(effect, true); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public EbonDragon(final EbonDragon card) { + super(card); + } + + @Override + public EbonDragon copy() { + return new EbonDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/BarrenGlory.java b/Mage.Sets/src/mage/sets/futuresight/BarrenGlory.java new file mode 100644 index 00000000000..fb6b3661c9e --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/BarrenGlory.java @@ -0,0 +1,114 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.abilities.TriggeredAbility; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.CardsInHandCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.WinGameSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; + +/** + * + * @author fireshoes + */ +public class BarrenGlory extends CardImpl { + + public BarrenGlory(UUID ownerId) { + super(ownerId, 3, "Barren Glory", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{W}{W}"); + this.expansionSetCode = "FUT"; + + // At the beginning of your upkeep, if you control no permanents other than Barren Glory and have no cards in hand, you win the game. + Condition condition = new CardsInHandCondition(CardsInHandCondition.CountType.EQUAL_TO, 0); + TriggeredAbility ability = new BarrenGloryTriggeredAbility(); + this.addAbility(new ConditionalTriggeredAbility(ability, + condition, + "At the beginning of your upkeep, if you control no permanents other than {this} and have no cards in hand, you win the game")); + } + + public BarrenGlory(final BarrenGlory card) { + super(card); + } + + @Override + public BarrenGlory copy() { + return new BarrenGlory(this); + } +} + +class BarrenGloryTriggeredAbility extends TriggeredAbilityImpl { + + private static final FilterPermanent filter = new FilterPermanent(); + static { + filter.add(new AnotherPredicate()); + } + + BarrenGloryTriggeredAbility() { + super(Zone.BATTLEFIELD, new WinGameSourceControllerEffect()); + } + + BarrenGloryTriggeredAbility(final BarrenGloryTriggeredAbility ability) { + super(ability); + } + + @Override + public BarrenGloryTriggeredAbility copy() { + return new BarrenGloryTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getPlayerId().equals(this.controllerId)) { + if (game.getBattlefield().count(filter, this.getSourceId(), this.getControllerId(), game) == 0) { + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "At the beginning of your upkeep, if you control no permanents other than {this} and have no cards in hand, you win the game"; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/futuresight/BogardanLancer.java b/Mage.Sets/src/mage/sets/futuresight/BogardanLancer.java new file mode 100644 index 00000000000..472d2de41fb --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/BogardanLancer.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.BloodthirstAbility; +import mage.abilities.keyword.FlankingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class BogardanLancer extends CardImpl { + + public BogardanLancer(UUID ownerId) { + super(ownerId, 95, "Bogardan Lancer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Bloodthirst 1 + this.addAbility(new BloodthirstAbility(1)); + // Flanking + this.addAbility(new FlankingAbility()); + } + + public BogardanLancer(final BogardanLancer card) { + super(card); + } + + @Override + public BogardanLancer copy() { + return new BogardanLancer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/BoldwyrIntimidator.java b/Mage.Sets/src/mage/sets/futuresight/BoldwyrIntimidator.java new file mode 100644 index 00000000000..68b8f684401 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/BoldwyrIntimidator.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BoldwyrIntimidator extends mage.sets.morningtide.BoldwyrIntimidator { + + public BoldwyrIntimidator(UUID ownerId) { + super(ownerId); + this.cardNumber = 111; + this.expansionSetCode = "FUT"; + } + + public BoldwyrIntimidator(final BoldwyrIntimidator card) { + super(card); + } + + @Override + public BoldwyrIntimidator copy() { + return new BoldwyrIntimidator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/CharRumbler.java b/Mage.Sets/src/mage/sets/futuresight/CharRumbler.java new file mode 100644 index 00000000000..3fa00c13b82 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/CharRumbler.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class CharRumbler extends CardImpl { + + public CharRumbler(UUID ownerId) { + super(ownerId, 96, "Char-Rumbler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Elemental"); + this.power = new MageInt(-1); + this.toughness = new MageInt(3); + + // Double strike + this.addAbility(DoubleStrikeAbility.getInstance()); + // {R}: Char-Rumbler gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public CharRumbler(final CharRumbler card) { + super(card); + } + + @Override + public CharRumbler copy() { + return new CharRumbler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/CloudKey.java b/Mage.Sets/src/mage/sets/futuresight/CloudKey.java index aa721aee04e..b357c8b83f1 100644 --- a/Mage.Sets/src/mage/sets/futuresight/CloudKey.java +++ b/Mage.Sets/src/mage/sets/futuresight/CloudKey.java @@ -23,6 +23,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.players.Player; import mage.util.CardUtil; @@ -31,50 +32,53 @@ import mage.util.CardUtil; * @author nick.myers */ public class CloudKey extends CardImpl { - + public CloudKey(UUID ownerId) { super(ownerId, 160, "Cloud Key", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); this.expansionSetCode = "FUT"; - - // As Cloud Key enters the battlefield, choose artifact, creature, + + // As Cloud Key enters the battlefield, choose artifact, creature, // enchantment, instant, or sorcery. this.addAbility(new AsEntersBattlefieldAbility(new CloudKeyChooseTypeEffect())); - + // Spells of the chosen type cost {1} less to cast this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CloudKeyCostModificationEffect())); } - + @Override public CloudKey copy() { return new CloudKey(this); } - + public CloudKey(final CloudKey card) { super(card); } } class CloudKeyChooseTypeEffect extends OneShotEffect { - + public CloudKeyChooseTypeEffect() { super(Outcome.Neutral); - this.staticText = "Choose a spell type"; + this.staticText = "choose artifact, creature, enchantment, instant, or sorcery."; } - + public CloudKeyChooseTypeEffect(final CloudKeyChooseTypeEffect effect) { super(effect); } - + @Override public CloudKeyChooseTypeEffect copy() { return new CloudKeyChooseTypeEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - MageObject sourceObject = source.getSourceObject(game); - if (sourceObject != null && controller != null) { + MageObject mageObject = game.getPermanentEntering(source.getSourceId()); + if (mageObject == null) { + mageObject = game.getObject(source.getSourceId()); + } + if (mageObject != null && controller != null) { ChoiceImpl choices = new ChoiceImpl(true); choices.setMessage("Choose a spell type"); choices.getChoices().add(CardType.ARTIFACT.toString()); @@ -82,28 +86,31 @@ class CloudKeyChooseTypeEffect extends OneShotEffect { choices.getChoices().add(CardType.ENCHANTMENT.toString()); choices.getChoices().add(CardType.INSTANT.toString()); choices.getChoices().add(CardType.SORCERY.toString()); - if(controller.choose(Outcome.Neutral, choices, game)) { - game.informPlayers(sourceObject.getLogName() + ": chosen spell type is " + choices.getChoice()); + if (controller.choose(Outcome.Neutral, choices, game)) { + game.informPlayers(mageObject.getLogName() + ": chosen spell type is " + choices.getChoice()); game.getState().setValue(source.getSourceId().toString() + "_CloudKey", choices.getChoice()); + if (mageObject instanceof Permanent) { + ((Permanent) mageObject).addInfo("chosenCardType", CardUtil.addToolTipMarkTags("Chosen card type: " + choices.getChoice()), game); + } return true; } } return false; } - + } class CloudKeyCostModificationEffect extends CostModificationEffectImpl { public CloudKeyCostModificationEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); - this.staticText = "choose artifact, creature, enchantment, instant, or sorcery. Spells of the chosen type cost {1} less to cast."; + this.staticText = "Spells of the chosen type cost {1} less to cast."; } - + public CloudKeyCostModificationEffect(final CloudKeyCostModificationEffect effect) { super(effect); } - + @Override public CloudKeyCostModificationEffect copy() { return new CloudKeyCostModificationEffect(this); @@ -118,15 +125,14 @@ class CloudKeyCostModificationEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - + if (abilityToModify instanceof SpellAbility && abilityToModify.getControllerId().equals(source.getControllerId())) { Card card = game.getCard(abilityToModify.getSourceId()); - if (card.getCardType().toString().contains((String) game.getState().getValue(source.getSourceId().toString() + "_CloudKey"))) { + if (card.getCardType().toString().contains((String) game.getState().getValue(source.getSourceId().toString() + "_CloudKey"))) { return true; } } - - return false; - } -} + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/Cloudseeder.java b/Mage.Sets/src/mage/sets/futuresight/Cloudseeder.java new file mode 100644 index 00000000000..7a6bbad56b6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/Cloudseeder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + */ +public class Cloudseeder extends CardImpl { + + public Cloudseeder(UUID ownerId) { + super(ownerId, 33, "Cloudseeder", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Faerie"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {U}, {tap}, Discard a card: Put a 1/1 blue Faerie creature token named Cloud Sprite onto the battlefield. It has flying and "Cloud Sprite can block only creatures with flying." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new CloudSpriteToken()), new ManaCostsImpl("{U}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public Cloudseeder(final Cloudseeder card) { + super(card); + } + + @Override + public Cloudseeder copy() { + return new Cloudseeder(this); + } +} + +class CloudSpriteToken extends Token { + + public CloudSpriteToken() { + super("Cloud Sprite", "1/1 blue faerie creature token named Cloud Sprite with flying and \"Cloud Sprite can block only creatures with flying.\""); + this.setOriginalExpansionSetCode("FUT"); + cardType.add(CardType.CREATURE); + color.setBlue(true); + subtype.add("Faerie"); + power = new MageInt(1); + toughness = new MageInt(1); + + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new CanBlockOnlyFlyingAbility()); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/CoalitionRelic.java b/Mage.Sets/src/mage/sets/futuresight/CoalitionRelic.java index 1c7ec71523c..3c2b480ecbe 100644 --- a/Mage.Sets/src/mage/sets/futuresight/CoalitionRelic.java +++ b/Mage.Sets/src/mage/sets/futuresight/CoalitionRelic.java @@ -109,15 +109,15 @@ class CoalitionRelicEffect extends OneShotEffect { player.choose(outcome, choice, game); } if (choice.getColor().isBlack()) { - mana.addBlack(); + mana.increaseBlack(); } else if (choice.getColor().isBlue()) { - mana.addBlue(); + mana.increaseBlue(); } else if (choice.getColor().isRed()) { - mana.addRed(); + mana.increaseRed(); } else if (choice.getColor().isGreen()) { - mana.addGreen(); + mana.increaseGreen(); } else if (choice.getColor().isWhite()) { - mana.addWhite(); + mana.increaseWhite(); } choice.clearChoice(); } diff --git a/Mage.Sets/src/mage/sets/futuresight/CrypticAnnelid.java b/Mage.Sets/src/mage/sets/futuresight/CrypticAnnelid.java new file mode 100644 index 00000000000..3fceca5542d --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/CrypticAnnelid.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.keyword.ScryEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CrypticAnnelid extends CardImpl { + + public CrypticAnnelid(UUID ownerId) { + super(ownerId, 34, "Cryptic Annelid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Worm"); + this.subtype.add("Beast"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // When Cryptic Annelid enters the battlefield, scry 1, then scry 2, then scry 3. + Ability ability = new EntersBattlefieldTriggeredAbility(new ScryEffect(1)); + Effect effect = new ScryEffect(2); + effect.setText(", then scry 2"); + ability.addEffect(effect); + effect = new ScryEffect(3); + effect.setText(", then scry 3"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public CrypticAnnelid(final CrypticAnnelid card) { + super(card); + } + + @Override + public CrypticAnnelid copy() { + return new CrypticAnnelid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/CutthroatIlDal.java b/Mage.Sets/src/mage/sets/futuresight/CutthroatIlDal.java new file mode 100644 index 00000000000..b74a7724e2b --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/CutthroatIlDal.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.HellbentCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class CutthroatIlDal extends CardImpl { + + public CutthroatIlDal(UUID ownerId) { + super(ownerId, 64, "Cutthroat il-Dal", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Human"); + this.subtype.add("Rogue"); + this.power = new MageInt(4); + this.toughness = new MageInt(1); + + // Hellbent - Cutthroat il-Dal has shadow as long as you have no cards in hand. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new GainAbilitySourceEffect(ShadowAbility.getInstance(), Duration.WhileOnBattlefield), HellbentCondition.getInstance(), + "Hellbent - {this} has shadow as long as you have no cards in hand"))); } + + public CutthroatIlDal(final CutthroatIlDal card) { + super(card); + } + + @Override + public CutthroatIlDal copy() { + return new CutthroatIlDal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/GoldmeadowLookout.java b/Mage.Sets/src/mage/sets/futuresight/GoldmeadowLookout.java index c3471c3316f..418a57608a4 100644 --- a/Mage.Sets/src/mage/sets/futuresight/GoldmeadowLookout.java +++ b/Mage.Sets/src/mage/sets/futuresight/GoldmeadowLookout.java @@ -77,7 +77,7 @@ public class GoldmeadowLookout extends CardImpl { class GoldmeadowHarrierToken extends Token { public GoldmeadowHarrierToken() { - super("Goldmeadow Harrier", "1/1 white Kithkin Soldier creature token named Goldmeadow Harrier with \"{W}, {tap}: Tap target creature.\""); + super("Goldmeadow Harrier", "1/1 white Kithkin Soldier creature token named Goldmeadow Harrier with \"{W}, {T}: Tap target creature.\""); this.setOriginalExpansionSetCode("FUT"); cardType.add(CardType.CREATURE); color.setWhite(true); @@ -91,4 +91,4 @@ class GoldmeadowHarrierToken extends Token { ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/futuresight/GravePeril.java b/Mage.Sets/src/mage/sets/futuresight/GravePeril.java new file mode 100644 index 00000000000..9b36c3b60ab --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/GravePeril.java @@ -0,0 +1,106 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author emerald000 + */ +public class GravePeril extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a nonblack creature"); + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public GravePeril(UUID ownerId) { + super(ownerId, 67, "Grave Peril", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "FUT"; + + // When a nonblack creature enters the battlefield, sacrifice Grave Peril. If you do, destroy that creature. + this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new GravePerilEffect(), filter, false, SetTargetPointer.PERMANENT, null)); + } + + public GravePeril(final GravePeril card) { + super(card); + } + + @Override + public GravePeril copy() { + return new GravePeril(this); + } +} + +class GravePerilEffect extends OneShotEffect { + + GravePerilEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "sacrifice Grave Peril. If you do, destroy that creature"; + } + + GravePerilEffect(final GravePerilEffect effect) { + super(effect); + } + + @Override + public GravePerilEffect copy() { + return new GravePerilEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game); + if (permanent != null) { + if (permanent.sacrifice(source.getSourceId(), game)) { + Effect effect = new DestroyTargetEffect(); + effect.setTargetPointer(this.getTargetPointer()); + return effect.apply(game, source); + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/GraveScrabbler.java b/Mage.Sets/src/mage/sets/futuresight/GraveScrabbler.java new file mode 100644 index 00000000000..44e7ee27ac2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/GraveScrabbler.java @@ -0,0 +1,47 @@ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.MadnessAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInGraveyard; + +public class GraveScrabbler extends CardImpl { + + public GraveScrabbler(UUID ownerId) { + super(ownerId, 86, "Grave Scrabbler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Zombie"); + + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + //Madness {1}{B} + this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{1}{B}"))); + + //When Grave Scrabbler enters the battlefield, if its madness cost was paid, + //you may return target creature card from a graveyard to its owner's hand. + EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true); + ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard"))); + this.addAbility(new ConditionalTriggeredAbility(ability, MadnessAbility.GetCondition(), + "When {this} enters the battlefield, if its madness cost was paid, you may return target creature card from a graveyard to its owner's hand.")); + } + + public GraveScrabbler(final GraveScrabbler card) { + super(card); + } + + @Override + public Card copy() { + return new GraveScrabbler(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/futuresight/HeartwoodStoryteller.java b/Mage.Sets/src/mage/sets/futuresight/HeartwoodStoryteller.java index 2ae7c2d510c..7659b8ea2fd 100644 --- a/Mage.Sets/src/mage/sets/futuresight/HeartwoodStoryteller.java +++ b/Mage.Sets/src/mage/sets/futuresight/HeartwoodStoryteller.java @@ -73,15 +73,15 @@ public class HeartwoodStoryteller extends CardImpl { } class HeartwoodStorytellerTriggeredAbility extends TriggeredAbilityImpl { - + HeartwoodStorytellerTriggeredAbility() { super(Zone.BATTLEFIELD, new HeartwoodStorytellerEffect(), false); } - + HeartwoodStorytellerTriggeredAbility(final HeartwoodStorytellerTriggeredAbility ability) { super(ability); } - + @Override public HeartwoodStorytellerTriggeredAbility copy() { return new HeartwoodStorytellerTriggeredAbility(this); @@ -91,7 +91,7 @@ class HeartwoodStorytellerTriggeredAbility extends TriggeredAbilityImpl { public boolean checkEventType(GameEvent event, Game game) { return event.getType() == EventType.SPELL_CAST; } - + @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); @@ -103,7 +103,7 @@ class HeartwoodStorytellerTriggeredAbility extends TriggeredAbilityImpl { } return false; } - + @Override public String getRule() { return "Whenever a player casts a noncreature spell, each of that player's opponents may draw a card."; @@ -111,27 +111,29 @@ class HeartwoodStorytellerTriggeredAbility extends TriggeredAbilityImpl { } class HeartwoodStorytellerEffect extends OneShotEffect { - + HeartwoodStorytellerEffect() { super(Outcome.DrawCard); this.staticText = "Each of that player's opponents may draw a card"; } - + HeartwoodStorytellerEffect(final HeartwoodStorytellerEffect effect) { super(effect); } - + @Override public HeartwoodStorytellerEffect copy() { return new HeartwoodStorytellerEffect(this); } - + @Override public boolean apply(Game game, Ability source) { for (UUID playerId : game.getOpponents(this.getTargetPointer().getFirst(game, source))) { Player player = game.getPlayer(playerId); if (player != null) { - player.drawCards(1, game); + if (player.chooseUse(outcome, "Draw a card?", source, game)) { + player.drawCards(1, game); + } } } return true; diff --git a/Mage.Sets/src/mage/sets/futuresight/InfiltratorIlKor.java b/Mage.Sets/src/mage/sets/futuresight/InfiltratorIlKor.java new file mode 100644 index 00000000000..0b402309a6d --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/InfiltratorIlKor.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.ShadowAbility; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class InfiltratorIlKor extends CardImpl { + + public InfiltratorIlKor(UUID ownerId) { + super(ownerId, 37, "Infiltrator il-Kor", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Kor"); + this.subtype.add("Rogue"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // Suspend 2-{1}{U} + this.addAbility(new SuspendAbility(2, new ManaCostsImpl("{1}{U}"), this)); + } + + public InfiltratorIlKor(final InfiltratorIlKor card) { + super(card); + } + + @Override + public InfiltratorIlKor copy() { + return new InfiltratorIlKor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/KavuPrimarch.java b/Mage.Sets/src/mage/sets/futuresight/KavuPrimarch.java index deca054ff68..c9055368a95 100644 --- a/Mage.Sets/src/mage/sets/futuresight/KavuPrimarch.java +++ b/Mage.Sets/src/mage/sets/futuresight/KavuPrimarch.java @@ -61,7 +61,7 @@ public class KavuPrimarch extends CardImpl { // If Kavu Primarch was kicked, it enters the battlefield with four +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)),KickedCondition.getInstance(), true, + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)),KickedCondition.getInstance(), "If Kavu Primarch was kicked, it enters the battlefield with four +1/+1 counters on it.", "")); } diff --git a/Mage.Sets/src/mage/sets/futuresight/KnightOfSursi.java b/Mage.Sets/src/mage/sets/futuresight/KnightOfSursi.java new file mode 100644 index 00000000000..8bb3b138f36 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/KnightOfSursi.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.FlankingAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class KnightOfSursi extends CardImpl { + + public KnightOfSursi(UUID ownerId) { + super(ownerId, 10, "Knight of Sursi", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // flanking + this.addAbility(new FlankingAbility()); + // Suspend 3-{W} + this.addAbility(new SuspendAbility(3, new ManaCostsImpl("{W}"), this)); + } + + public KnightOfSursi(final KnightOfSursi card) { + super(card); + } + + @Override + public KnightOfSursi copy() { + return new KnightOfSursi(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/LinessaZephyrMage.java b/Mage.Sets/src/mage/sets/futuresight/LinessaZephyrMage.java index 2d70219a2a8..8e3e97682c8 100644 --- a/Mage.Sets/src/mage/sets/futuresight/LinessaZephyrMage.java +++ b/Mage.Sets/src/mage/sets/futuresight/LinessaZephyrMage.java @@ -61,6 +61,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class LinessaZephyrMage extends CardImpl { + private final UUID originalId; + public LinessaZephyrMage(UUID ownerId) { super(ownerId, 51, "Linessa, Zephyr Mage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.expansionSetCode = "FUT"; @@ -75,6 +77,7 @@ public class LinessaZephyrMage extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{X}{U}{U}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); + originalId = ability.getOriginalId(); this.addAbility(ability); // Grandeur - Discard another card named Linessa, Zephyr Mage: Target player returns a creature he or she controls to its owner's hand, then repeats this process for an artifact, an enchantment, and a land. @@ -85,11 +88,12 @@ public class LinessaZephyrMage extends CardImpl { public LinessaZephyrMage(final LinessaZephyrMage card) { super(card); + this.originalId = card.originalId; } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SimpleActivatedAbility) { + if (ability.getOriginalId().equals(originalId)) { int xValue = ability.getManaCostsToPay().getX(); ability.getTargets().clear(); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost " + xValue); diff --git a/Mage.Sets/src/mage/sets/futuresight/LlanowarAugur.java b/Mage.Sets/src/mage/sets/futuresight/LlanowarAugur.java index 3ff72547630..318db51af82 100644 --- a/Mage.Sets/src/mage/sets/futuresight/LlanowarAugur.java +++ b/Mage.Sets/src/mage/sets/futuresight/LlanowarAugur.java @@ -33,7 +33,10 @@ import mage.abilities.Ability; import mage.abilities.condition.common.IsStepCondition; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -59,12 +62,16 @@ public class LlanowarAugur extends CardImpl { // Sacrifice Llanowar Augur: Target creature gets +3/+3 and gains trample until end of turn. // Activate this ability only during your upkeep. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, - new BoostTargetEffect(3, 3, Duration.EndOfTurn), - new SacrificeSourceCost(), + Effect effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn); + effect.setText("Target creature gets +3/+3"); + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + effect, + new SacrificeSourceCost(), new IsStepCondition(PhaseStep.UPKEEP), null - ); + ); + effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, "and gains trample until end of turn"); + ability.addEffect(effect); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/futuresight/LlanowarMentor.java b/Mage.Sets/src/mage/sets/futuresight/LlanowarMentor.java new file mode 100644 index 00000000000..c4a4c9e04b8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/LlanowarMentor.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + */ +public class LlanowarMentor extends CardImpl { + + public LlanowarMentor(UUID ownerId) { + super(ownerId, 131, "Llanowar Mentor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Elf"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {G}, {tap}, Discard a card: Put a 1/1 green Elf Druid creature token named Llanowar Elves onto the battlefield. It has "{tap}: Add {G} to your mana pool." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new LlanowarElvesToken()), new ManaCostsImpl("{G}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public LlanowarMentor(final LlanowarMentor card) { + super(card); + } + + @Override + public LlanowarMentor copy() { + return new LlanowarMentor(this); + } +} + +class LlanowarElvesToken extends Token { + + public LlanowarElvesToken() { + super("Llanowar Elves", "1/1 green Elf Druid creature token named Llanowar Elves with \"{T}: Add {G} to your mana pool.\""); + this.setOriginalExpansionSetCode("FUT"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Elf"); + subtype.add("Druid"); + power = new MageInt(1); + toughness = new MageInt(1); + + this.addAbility(new GreenManaAbility()); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/LymphSliver.java b/Mage.Sets/src/mage/sets/futuresight/LymphSliver.java index 3d9afb08a28..8af8bdb81d5 100644 --- a/Mage.Sets/src/mage/sets/futuresight/LymphSliver.java +++ b/Mage.Sets/src/mage/sets/futuresight/LymphSliver.java @@ -45,7 +45,7 @@ import mage.filter.common.FilterCreaturePermanent; * @author anonymous */ public class LymphSliver extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver", "All Sliver creatures"); public LymphSliver(UUID ownerId) { @@ -57,7 +57,8 @@ public class LymphSliver extends CardImpl { // All Sliver creatures have absorb 1. Ability absorb = new SimpleStaticAbility(Zone.BATTLEFIELD, new SliverAbsorbEffect()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(absorb, Duration.WhileOnBattlefield, filter, "absorb 1. (If a source would deal damage to a Sliver, prevent 1 of that damage.)"))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(absorb, + Duration.WhileOnBattlefield, filter, "All Sliver creatures have absorb 1. (If a source would deal damage to a Sliver, prevent 1 of that damage.)"))); } public LymphSliver(final LymphSliver card) { @@ -73,7 +74,7 @@ public class LymphSliver extends CardImpl { class SliverAbsorbEffect extends PreventionEffectImpl { public SliverAbsorbEffect() { super(Duration.WhileOnBattlefield, 1, false, false); - this.staticText = "If a source would deal damage to a Sliver, prevent 1 of that damage"; + this.staticText = "Absorb 1 (If a source would deal damage to this creature, prevent 1 of that damage.)"; } public SliverAbsorbEffect(SliverAbsorbEffect effect) { @@ -84,4 +85,4 @@ class SliverAbsorbEffect extends PreventionEffectImpl { public SliverAbsorbEffect copy() { return new SliverAbsorbEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/futuresight/MaelstromDjinn.java b/Mage.Sets/src/mage/sets/futuresight/MaelstromDjinn.java new file mode 100644 index 00000000000..be6656f4404 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/MaelstromDjinn.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.MorphAbility; +import mage.abilities.keyword.VanishingSacrificeAbility; +import mage.abilities.keyword.VanishingUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + */ +public class MaelstromDjinn extends CardImpl { + + public MaelstromDjinn(UUID ownerId) { + super(ownerId, 39, "Maelstrom Djinn", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{7}{U}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Djinn"); + this.power = new MageInt(5); + this.toughness = new MageInt(6); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Morph {2}{U} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{U}"))); + // When Maelstrom Djinn is turned face up, put two time counters on it and it gains vanishing. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2))); + Effect effect = new GainAbilitySourceEffect(new VanishingUpkeepAbility(0), Duration.WhileOnBattlefield); + effect.setText("and it gains vanishing"); + ability.addEffect(effect); + effect = new GainAbilitySourceEffect(new VanishingSacrificeAbility(), Duration.WhileOnBattlefield); + effect.setText(""); + ability.addEffect(effect); + this.addAbility(ability); + } + + public MaelstromDjinn(final MaelstromDjinn card) { + super(card); + } + + @Override + public MaelstromDjinn copy() { + return new MaelstromDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/MagusOfTheMoon.java b/Mage.Sets/src/mage/sets/futuresight/MagusOfTheMoon.java index d6ee678b76b..131e99c2405 100644 --- a/Mage.Sets/src/mage/sets/futuresight/MagusOfTheMoon.java +++ b/Mage.Sets/src/mage/sets/futuresight/MagusOfTheMoon.java @@ -28,19 +28,21 @@ package mage.sets.futuresight; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; +import mage.cards.repository.CardRepository; +import mage.constants.CardType; +import mage.constants.DependencyType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SupertypePredicate; @@ -53,6 +55,12 @@ import mage.game.permanent.Permanent; */ public class MagusOfTheMoon extends CardImpl { + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(Predicates.not(new SupertypePredicate("Basic"))); + } + public MagusOfTheMoon(UUID ownerId) { super(ownerId, 101, "Magus of the Moon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.expansionSetCode = "FUT"; @@ -74,53 +82,52 @@ public class MagusOfTheMoon extends CardImpl { public MagusOfTheMoon copy() { return new MagusOfTheMoon(this); } -} -class MagusOfTheMoonEffect extends ContinuousEffectImpl { + class MagusOfTheMoonEffect extends ContinuousEffectImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.add(Predicates.not(new SupertypePredicate("Basic"))); - } - - MagusOfTheMoonEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - this.staticText = "Nonbasic lands are Mountains"; - } - - MagusOfTheMoonEffect(final MagusOfTheMoonEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public MagusOfTheMoonEffect copy() { - return new MagusOfTheMoonEffect(this); - } - - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - for (Permanent land: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { - switch (layer) { - case AbilityAddingRemovingEffects_6: - land.removeAllAbilities(source.getSourceId(), game); - land.addAbility(new RedManaAbility(), source.getSourceId(), game); - break; - case TypeChangingEffects_4: - land.getSubtype().clear(); - land.getSubtype().add("Mountain"); - break; - } + MagusOfTheMoonEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + this.staticText = "Nonbasic lands are Mountains"; + dependencyTypes.add(DependencyType.BecomeMountain); + } + + MagusOfTheMoonEffect(final MagusOfTheMoonEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public MagusOfTheMoonEffect copy() { + return new MagusOfTheMoonEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + for (Permanent land : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + switch (layer) { + case TypeChangingEffects_4: + // 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects + // So the ability removing has to be done before Layer 6 + land.removeAllAbilities(source.getSourceId(), game); + land.getSubtype().removeAll(CardRepository.instance.getLandTypes()); + land.getSubtype().add("Mountain"); + break; + case AbilityAddingRemovingEffects_6: + land.addAbility(new RedManaAbility(), source.getSourceId(), game); + break; + } + } + return true; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; } - return true; } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; - } } diff --git a/Mage.Sets/src/mage/sets/futuresight/NimbusMaze.java b/Mage.Sets/src/mage/sets/futuresight/NimbusMaze.java index a5c250207e9..75026f82f29 100644 --- a/Mage.Sets/src/mage/sets/futuresight/NimbusMaze.java +++ b/Mage.Sets/src/mage/sets/futuresight/NimbusMaze.java @@ -28,20 +28,21 @@ package mage.sets.futuresight; import java.util.UUID; - +import mage.Mana; import mage.abilities.Ability; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.costs.CostImpl; -import mage.abilities.mana.BlueManaAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.mana.ActivateIfConditionManaAbility; import mage.abilities.mana.ColorlessManaAbility; -import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.FilterPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; /** @@ -50,14 +51,12 @@ import mage.game.Game; */ public class NimbusMaze extends CardImpl { - private static final FilterPermanent controlIsland = new FilterPermanent("you control an Island"); - private static final FilterPermanent controlPlains = new FilterPermanent("you control a Plains"); + private static final FilterControlledPermanent controlIsland = new FilterControlledPermanent("you control an Island"); + private static final FilterControlledPermanent controlPlains = new FilterControlledPermanent("you control a Plains"); + static { controlIsland.add(new SubtypePredicate("Island")); - controlIsland.add(new ControllerPredicate(TargetController.YOU)); - controlPlains.add(new SubtypePredicate("Plains")); - controlPlains.add(new ControllerPredicate(TargetController.YOU)); } public NimbusMaze(UUID ownerId) { @@ -67,13 +66,17 @@ public class NimbusMaze extends CardImpl { // {tap}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); // {tap}: Add {W} to your mana pool. Activate this ability only if you control an Island. - Ability addW = new WhiteManaAbility(); - addW.addCost(new FilterPermanentCost(controlIsland)); - this.addAbility(addW); + this.addAbility(new ActivateIfConditionManaAbility( + Zone.BATTLEFIELD, + new BasicManaEffect(Mana.WhiteMana), + new TapSourceCost(), + new PermanentsOnTheBattlefieldCondition(controlIsland))); // {tap}: Add {U} to your mana pool. Activate this ability only if you control a Plains. - Ability addU = new BlueManaAbility(); - addU.addCost(new FilterPermanentCost(controlPlains)); - this.addAbility(addU); + this.addAbility(new ActivateIfConditionManaAbility( + Zone.BATTLEFIELD, + new BasicManaEffect(Mana.BlueMana), + new TapSourceCost(), + new PermanentsOnTheBattlefieldCondition(controlPlains))); } public NimbusMaze(final NimbusMaze card) { diff --git a/Mage.Sets/src/mage/sets/futuresight/PoolingVenom.java b/Mage.Sets/src/mage/sets/futuresight/PoolingVenom.java new file mode 100644 index 00000000000..d383a8aefea --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/PoolingVenom.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BecomesTappedAttachedTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; +import mage.abilities.effects.common.LoseLifeControllerAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class PoolingVenom extends CardImpl { + + public PoolingVenom(UUID ownerId) { + super(ownerId, 74, "Pooling Venom", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Aura"); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Whenever enchanted land becomes tapped, its controller loses 2 life. + this.addAbility(new BecomesTappedAttachedTriggeredAbility(new LoseLifeControllerAttachedEffect(2), "enchanted land")); + // {3}{B}: Destroy enchanted land. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyAttachedEffect("enchanted land"), new ManaCostsImpl("{3}{B}"))); + } + + public PoolingVenom(final PoolingVenom card) { + super(card); + } + + @Override + public PoolingVenom copy() { + return new PoolingVenom(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/Quagnoth.java b/Mage.Sets/src/mage/sets/futuresight/Quagnoth.java index 83c191c5817..bd4fa8f57e3 100644 --- a/Mage.Sets/src/mage/sets/futuresight/Quagnoth.java +++ b/Mage.Sets/src/mage/sets/futuresight/Quagnoth.java @@ -57,10 +57,10 @@ public class Quagnoth extends CardImpl { // Split second this.addAbility(new SplitSecondAbility()); - + // Shroud this.addAbility(ShroudAbility.getInstance()); - + // When a spell or ability an opponent controls causes you to discard Quagnoth, return it to your hand. this.addAbility(new QuagnothTriggeredAbility()); } @@ -97,13 +97,17 @@ class QuagnothTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) && - StackObject.class.isInstance(game.getObject(event.getSourceId())) && - getSourceId().equals(event.getTargetId()); + if (getSourceId().equals(event.getTargetId())) { + StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); + if (stackObject != null) { + return game.getOpponents(this.getControllerId()).contains(stackObject.getControllerId()); + } + } + return false; } @Override public String getRule() { return "When a spell or ability an opponent controls causes you to discard {this}, " + super.getRule(); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/futuresight/RamosianRevivalist.java b/Mage.Sets/src/mage/sets/futuresight/RamosianRevivalist.java new file mode 100644 index 00000000000..d79662101db --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/RamosianRevivalist.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author fireshoes + */ +public class RamosianRevivalist extends CardImpl { + + private static final FilterPermanentCard filter = new FilterPermanentCard("Rebel permanent card with converted mana cost 5 or less from your graveyard"); + + static { + filter.add(new SubtypePredicate("Rebel")); + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 6)); + } + + public RamosianRevivalist(UUID ownerId) { + super(ownerId, 30, "Ramosian Revivalist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Human"); + this.subtype.add("Rebel"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {6}, {tap}: Return target Rebel permanent card with converted mana cost 5 or less from your graveyard to the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new GenericManaCost(6)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCardInYourGraveyard(filter)); + this.addAbility(ability); + } + + public RamosianRevivalist(final RamosianRevivalist card) { + super(card); + } + + @Override + public RamosianRevivalist copy() { + return new RamosianRevivalist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/RavagingRiftwurm.java b/Mage.Sets/src/mage/sets/futuresight/RavagingRiftwurm.java new file mode 100644 index 00000000000..a1f6e59f044 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/RavagingRiftwurm.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.KickerAbility; +import mage.abilities.keyword.VanishingSacrificeAbility; +import mage.abilities.keyword.VanishingUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + */ +public class RavagingRiftwurm extends CardImpl { + + public RavagingRiftwurm(UUID ownerId) { + super(ownerId, 135, "Ravaging Riftwurm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Wurm"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Kicker {4} + this.addAbility(new KickerAbility("{4}")); + // Vanishing 2 + Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2))); + ability.setRuleVisible(false); + this.addAbility(ability); + this.addAbility(new VanishingUpkeepAbility(2)); + this.addAbility(new VanishingSacrificeAbility()); + // If Ravaging Riftwurm was kicked, it enters the battlefield with three additional time counters on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)), + KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with three additional time counters on it.", "")); + } + + public RavagingRiftwurm(final RavagingRiftwurm card) { + super(card); + } + + @Override + public RavagingRiftwurm copy() { + return new RavagingRiftwurm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/SecondWind.java b/Mage.Sets/src/mage/sets/futuresight/SecondWind.java new file mode 100644 index 00000000000..136df324f57 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/SecondWind.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.TapEnchantedEffect; +import mage.abilities.effects.common.UntapEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class SecondWind extends CardImpl { + + public SecondWind(UUID ownerId) { + super(ownerId, 57, "Second Wind", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Untap)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + + // {tap}: Tap enchanted creature. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapEnchantedEffect(), new TapSourceCost())); + + // {tap}: Untap enchanted creature. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapEnchantedEffect(), new TapSourceCost())); + } + + public SecondWind(final SecondWind card) { + super(card); + } + + @Override + public SecondWind copy() { + return new SecondWind(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/SkirkRidgeExhumer.java b/Mage.Sets/src/mage/sets/futuresight/SkirkRidgeExhumer.java new file mode 100644 index 00000000000..7338981ff76 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/SkirkRidgeExhumer.java @@ -0,0 +1,96 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.Token; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SkirkRidgeExhumer extends CardImpl { + + public SkirkRidgeExhumer(UUID ownerId) { + super(ownerId, 77, "Skirk Ridge Exhumer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Zombie"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {B}, {tap}, Discard a card: Put a 1/1 black Zombie Goblin creature token named Festering Goblin onto the battlefield. It has "When Festering Goblin dies, target creature gets -1/-1 until end of turn." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new FesteringGoblinToken()), new ManaCostsImpl("{B}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public SkirkRidgeExhumer(final SkirkRidgeExhumer card) { + super(card); + } + + @Override + public SkirkRidgeExhumer copy() { + return new SkirkRidgeExhumer(this); + } +} + +class FesteringGoblinToken extends Token { + + public FesteringGoblinToken() { + super("Festering Goblin", "1/1 black Zombie Goblin creature token named Festering Goblin with \"When Festering Goblin dies, target creature gets -1/-1 until end of turn.\""); + this.setOriginalExpansionSetCode("FUT"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Zombie"); + subtype.add("Goblin"); + power = new MageInt(1); + toughness = new MageInt(1); + + Ability ability = new DiesTriggeredAbility(new BoostTargetEffect(-1, -1, Duration.EndOfTurn), false); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/SliverLegion.java b/Mage.Sets/src/mage/sets/futuresight/SliverLegion.java index 853b5983b12..094ec9968dd 100644 --- a/Mage.Sets/src/mage/sets/futuresight/SliverLegion.java +++ b/Mage.Sets/src/mage/sets/futuresight/SliverLegion.java @@ -47,9 +47,9 @@ import mage.filter.predicate.permanent.AnotherPredicate; */ public class SliverLegion extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver", "All Sliver creatures"); - private static final FilterPermanent countfilter = new FilterPermanent("Sliver","each other sliver"); + private static final FilterPermanent countfilter = new FilterPermanent("Sliver", " for each other Sliver on the battlefield"); static { countfilter.add(new AnotherPredicate()); diff --git a/Mage.Sets/src/mage/sets/futuresight/Sliversmith.java b/Mage.Sets/src/mage/sets/futuresight/Sliversmith.java index 3de55d8d333..e1c4178054a 100644 --- a/Mage.Sets/src/mage/sets/futuresight/Sliversmith.java +++ b/Mage.Sets/src/mage/sets/futuresight/Sliversmith.java @@ -43,7 +43,7 @@ import mage.game.permanent.token.Token; /** * - * @author anonymous + * @author Luna Skyrise */ public class Sliversmith extends CardImpl { @@ -55,7 +55,7 @@ public class Sliversmith extends CardImpl { this.toughness = new MageInt(1); // {1}, {tap}, Discard a card: Put a 1/1 colorless Sliver artifact creature token named Metallic Sliver onto the battlefield. - Ability ability = new SimpleActivatedAbility(Zone.HAND, new CreateTokenEffect(new MetallicSliverToken()), new ManaCostsImpl("{1}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SliversmithToken()), new ManaCostsImpl("{1}")); ability.addCost(new TapSourceCost()); ability.addCost(new DiscardCardCost()); this.addAbility(ability); @@ -71,10 +71,10 @@ public class Sliversmith extends CardImpl { } } -class MetallicSliverToken extends Token { +class SliversmithToken extends Token { - MetallicSliverToken() { - super("Metallic Sliver", "a 1/1 colorless Sliver creature token"); + SliversmithToken() { + super("Metallic Sliver", "a 1/1 colorless Sliver creature token named Metallic Sliver"); cardType.add(CardType.CREATURE); cardType.add(CardType.ARTIFACT); subtype.add("Sliver"); diff --git a/Mage.Sets/src/mage/sets/futuresight/SoultetherGolem.java b/Mage.Sets/src/mage/sets/futuresight/SoultetherGolem.java index ca9d9e48c6f..5fb3ab962c1 100644 --- a/Mage.Sets/src/mage/sets/futuresight/SoultetherGolem.java +++ b/Mage.Sets/src/mage/sets/futuresight/SoultetherGolem.java @@ -29,6 +29,7 @@ package mage.sets.futuresight; import java.util.UUID; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -49,7 +50,7 @@ import mage.filter.predicate.permanent.ControllerPredicate; * @author fireshoes */ public class SoultetherGolem extends CardImpl { - + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); static { @@ -65,10 +66,12 @@ public class SoultetherGolem extends CardImpl { this.toughness = new MageInt(3); // Vanishing 1 - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(1)))); + Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(1))); + ability.setRuleVisible(false); + this.addAbility(ability); this.addAbility(new VanishingUpkeepAbility(1)); this.addAbility(new VanishingSacrificeAbility()); - + // Whenever another creature enters the battlefield under your control, put a time counter on Soultether Golem. this.addAbility(new EntersBattlefieldAllTriggeredAbility( Zone.BATTLEFIELD, diff --git a/Mage.Sets/src/mage/sets/futuresight/Sparkspitter.java b/Mage.Sets/src/mage/sets/futuresight/Sparkspitter.java new file mode 100644 index 00000000000..83228c4f17c --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/Sparkspitter.java @@ -0,0 +1,95 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + */ +public class Sparkspitter extends CardImpl { + + public Sparkspitter(UUID ownerId) { + super(ownerId, 109, "Sparkspitter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Elemental"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // {R}, {tap}, Discard a card: Put a 3/1 red Elemental creature token named Spark Elemental onto the battlefield. It has trample, haste, and "At the beginning of the end step, sacrifice Spark Elemental." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SparkElementalToken()), new ManaCostsImpl("{R}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public Sparkspitter(final Sparkspitter card) { + super(card); + } + + @Override + public Sparkspitter copy() { + return new Sparkspitter(this); + } +} + +class SparkElementalToken extends Token { + + public SparkElementalToken() { + super("Spark Elemental", "3/1 red Elemental creature token named Spark Elemental with trample, haste, and \"At the beginning of the end step, sacrifice Spark Elemental.\""); + this.setOriginalExpansionSetCode("FUT"); + cardType.add(CardType.CREATURE); + color.setRed(true); + subtype.add("Elemental"); + power = new MageInt(3); + toughness = new MageInt(1); + + this.addAbility(TrampleAbility.getInstance()); + this.addAbility(HasteAbility.getInstance()); + this.addAbility(new BeginningOfEndStepTriggeredAbility(new SacrificeSourceEffect(), TargetController.ANY, false)); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/SwordOfTheMeek.java b/Mage.Sets/src/mage/sets/futuresight/SwordOfTheMeek.java index eaaf39e852f..737dfd0139d 100644 --- a/Mage.Sets/src/mage/sets/futuresight/SwordOfTheMeek.java +++ b/Mage.Sets/src/mage/sets/futuresight/SwordOfTheMeek.java @@ -70,7 +70,7 @@ public class SwordOfTheMeek extends CardImpl { this.subtype.add("Equipment"); // Equipped creature gets +1/+2. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1,2,Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 2, Duration.WhileOnBattlefield))); // Equip {2} this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2))); // Whenever a 1/1 creature enters the battlefield under your control, you may return Sword of the Meek from your graveyard to the battlefield, then attach it to that creature. @@ -108,7 +108,7 @@ class SwordOfTheMeekEffect extends OneShotEffect { Card equipment = game.getCard(source.getSourceId()); Player controller = game.getPlayer(source.getControllerId()); if (equipment != null && controller != null && game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) { - controller.putOntoBattlefieldWithInfo(equipment, game, Zone.GRAVEYARD, source.getSourceId()); + controller.moveCards(equipment, Zone.BATTLEFIELD, source, game); Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null) { return permanent.addAttachment(equipment.getId(), game); diff --git a/Mage.Sets/src/mage/sets/futuresight/TaroxBladewing.java b/Mage.Sets/src/mage/sets/futuresight/TaroxBladewing.java index 74812fc3110..08bcdb02e9a 100644 --- a/Mage.Sets/src/mage/sets/futuresight/TaroxBladewing.java +++ b/Mage.Sets/src/mage/sets/futuresight/TaroxBladewing.java @@ -29,20 +29,15 @@ package mage.sets.futuresight; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.abilityword.GrandeurAbility; -import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; +import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -66,7 +61,8 @@ public class TaroxBladewing extends CardImpl { this.addAbility(HasteAbility.getInstance()); // Grandeur - Discard another card named Tarox Bladewing: Tarox Bladewing gets +X/+X until end of turn, where X is its power. - this.addAbility(new GrandeurAbility(new TaroxBladewingEffect(), "Tarox Bladewing")); + SourcePermanentPowerCount x = new SourcePermanentPowerCount(); + this.addAbility(new GrandeurAbility(new BoostSourceEffect(x, x, Duration.EndOfTurn, true), "Tarox Bladewing")); } public TaroxBladewing(final TaroxBladewing card) { @@ -78,32 +74,3 @@ public class TaroxBladewing extends CardImpl { return new TaroxBladewing(this); } } - -class TaroxBladewingEffect extends ContinuousEffectImpl { - - TaroxBladewingEffect() { - super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); - staticText = "{this} gets +X/+X until end of turn, where X is its power"; - } - - TaroxBladewingEffect(final TaroxBladewingEffect effect) { - super(effect); - } - - @Override - public TaroxBladewingEffect copy() { - return new TaroxBladewingEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - int power = permanent.getPower().getValue(); - permanent.addPower(power); - permanent.addToughness(power); - return true; - } - return false; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/futuresight/UtopiaMycon.java b/Mage.Sets/src/mage/sets/futuresight/UtopiaMycon.java new file mode 100644 index 00000000000..45f3a6749af --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/UtopiaMycon.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.mana.AnyColorManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.SaprolingToken; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class UtopiaMycon extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Saproling"); + + static { + filter.add(new SubtypePredicate("Saproling")); + } + + public UtopiaMycon(UUID ownerId) { + super(ownerId, 140, "Utopia Mycon", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Fungus"); + this.power = new MageInt(0); + this.toughness = new MageInt(2); + + // At the beginning of your upkeep, put a spore counter on Utopia Mycon. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.SPORE.createInstance()), TargetController.YOU, false)); + + // Remove three spore counters from Utopia Mycon: Put a 1/1 green Saproling creature token onto the battlefield. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SaprolingToken()), new RemoveCountersSourceCost(CounterType.SPORE.createInstance(3)))); + + // Sacrifice a Saproling: Add one mana of any color to your mana pool. + Ability ability = new AnyColorManaAbility(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1, filter, false))); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public UtopiaMycon(final UtopiaMycon card) { + super(card); + } + + @Override + public UtopiaMycon copy() { + return new UtopiaMycon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/VedalkenAEthermage.java b/Mage.Sets/src/mage/sets/futuresight/VedalkenAEthermage.java new file mode 100644 index 00000000000..a62f3bf06e0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/VedalkenAEthermage.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.FilterSpell; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author anonymous + */ +public class VedalkenAEthermage extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Sliver"); + private static final FilterCard filter2 = new FilterCard("Wizard"); + + static { + filter.add(new SubtypePredicate("Sliver")); + filter2.add(new SubtypePredicate("Wizard")); + } + + public VedalkenAEthermage(UUID ownerId) { + super(ownerId, 61, "Vedalken AEthermage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Vedalken"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // When Vedalken Æthermage enters the battlefield, return target Sliver to its owner's hand. + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + + // Wizardcycling {3} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{3}"), filter2, "Wizardcycling")); + } + + public VedalkenAEthermage(final VedalkenAEthermage card) { + super(card); + } + + @Override + public VedalkenAEthermage copy() { + return new VedalkenAEthermage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/VenserShaperSavant.java b/Mage.Sets/src/mage/sets/futuresight/VenserShaperSavant.java index 1045ba09c7c..ff25793eca5 100644 --- a/Mage.Sets/src/mage/sets/futuresight/VenserShaperSavant.java +++ b/Mage.Sets/src/mage/sets/futuresight/VenserShaperSavant.java @@ -31,18 +31,11 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlashAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.stack.Spell; -import mage.players.Player; import mage.target.Target; import mage.target.common.TargetSpellOrPermanent; @@ -65,7 +58,7 @@ public class VenserShaperSavant extends CardImpl { // Flash this.addAbility(FlashAbility.getInstance()); // When Venser, Shaper Savant enters the battlefield, return target spell or permanent to its owner's hand. - Ability ability = new EntersBattlefieldTriggeredAbility(new VenserShaperSavantEffect(), false); + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(true), false); Target target = new TargetSpellOrPermanent(); ability.addTarget(target); this.addAbility(ability); @@ -80,56 +73,3 @@ public class VenserShaperSavant extends CardImpl { return new VenserShaperSavant(this); } } - -class VenserShaperSavantEffect extends OneShotEffect { - - public VenserShaperSavantEffect() { - super(Outcome.ReturnToHand); - this.staticText = "return target spell or permanent to its owner's hand"; - } - - public VenserShaperSavantEffect(final VenserShaperSavantEffect effect) { - super(effect); - } - - @Override - public VenserShaperSavantEffect copy() { - return new VenserShaperSavantEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - if (permanent != null) { - return controller.moveCards(permanent, null, Zone.HAND, source, game); - } - - /** - * 01.05.2007 If a spell is returned to its owner's hand, it's - * removed from the stack and thus will not resolve. The spell isn't - * countered; it just no longer exists. 01.05.2007 If a copy of a - * spell is returned to its owner's hand, it's moved there, then it - * will cease to exist as a state-based action. 01.05.2007 If - * Venser's enters-the-battlefield ability targets a spell cast with - * flashback, that spell will be exiled instead of returning to its - * owner's hand. - */ - Spell spell = game.getStack().getSpell(this.getTargetPointer().getFirst(game, source)); - if (spell != null) { - Card card = null; - if (!spell.isCopy()) { - card = spell.getCard(); - } - game.getStack().remove(spell); - if (card != null) { - controller.moveCards(card, null, Zone.HAND, source, game); - } - return true; - } - - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/futuresight/WhipSpineDrake.java b/Mage.Sets/src/mage/sets/futuresight/WhipSpineDrake.java new file mode 100644 index 00000000000..40d25ca0809 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/WhipSpineDrake.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WhipSpineDrake extends CardImpl { + + public WhipSpineDrake(UUID ownerId) { + super(ownerId, 62, "Whip-Spine Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Drake"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Morph {2}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{W}"))); + } + + public WhipSpineDrake(final WhipSpineDrake card) { + super(card); + } + + @Override + public WhipSpineDrake copy() { + return new WhipSpineDrake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java b/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java index 4e35a0f736c..dd701feb7e7 100644 --- a/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java +++ b/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java @@ -72,59 +72,59 @@ public class YixlidJailer extends CardImpl { public YixlidJailer copy() { return new YixlidJailer(this); } -} -class YixlidJailerEffect extends ContinuousEffectImpl { + class YixlidJailerEffect extends ContinuousEffectImpl { - YixlidJailerEffect() { - super(Duration.WhileOnBattlefield, Outcome.LoseAbility); - staticText = "Cards in graveyards lose all abilities."; - } + YixlidJailerEffect() { + super(Duration.WhileOnBattlefield, Outcome.LoseAbility); + staticText = "Cards in graveyards lose all abilities."; + } - YixlidJailerEffect(final YixlidJailerEffect effect) { - super(effect); - } + YixlidJailerEffect(final YixlidJailerEffect effect) { + super(effect); + } - @Override - public YixlidJailerEffect copy() { - return new YixlidJailerEffect(this); - } + @Override + public YixlidJailerEffect copy() { + return new YixlidJailerEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - if (layer == Layer.AbilityAddingRemovingEffects_6) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - for (UUID playerId : controller.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { - for (Card card : player.getGraveyard().getCards(game)) { - if (card != null) { - card.getAbilities(game).clear(); // Will the abilities ever come back???? - // TODO: Fix that (LevelX2) - // game.getContinuousEffects().removeGainedEffectsForSource(card.getId()); - // game.getState().resetTriggersForSourceId(card.getId()); - Abilities abilities = game.getState().getAllOtherAbilities(card.getId()); - if (abilities != null) { - abilities.clear(); + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + if (layer == Layer.AbilityAddingRemovingEffects_6) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : controller.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + for (Card card : player.getGraveyard().getCards(game)) { + if (card != null) { + card.getAbilities(game).clear(); // Will the abilities ever come back???? + // TODO: Fix that (LevelX2) + // game.getContinuousEffects().removeGainedEffectsForSource(card.getId()); + // game.getState().resetTriggersForSourceId(card.getId()); + Abilities abilities = game.getState().getAllOtherAbilities(card.getId()); + if (abilities != null) { + abilities.clear(); + } } } } } + return true; } - return true; } + return false; } - return false; - } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6; + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6; + } } } diff --git a/Mage.Sets/src/mage/sets/gameday/RadiantFlames.java b/Mage.Sets/src/mage/sets/gameday/RadiantFlames.java new file mode 100644 index 00000000000..c546687f514 --- /dev/null +++ b/Mage.Sets/src/mage/sets/gameday/RadiantFlames.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.gameday; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RadiantFlames extends mage.sets.battleforzendikar.RadiantFlames { + + public RadiantFlames(UUID ownerId) { + super(ownerId); + this.cardNumber = 48; + this.expansionSetCode = "MGDC"; + } + + public RadiantFlames(final RadiantFlames card) { + super(card); + } + + @Override + public RadiantFlames copy() { + return new RadiantFlames(this); + } +} diff --git a/Mage.Sets/src/mage/sets/gameday/ScaleguardSentinels.java b/Mage.Sets/src/mage/sets/gameday/ScaleguardSentinels.java index 5167e1c6d68..7588795fd9e 100644 --- a/Mage.Sets/src/mage/sets/gameday/ScaleguardSentinels.java +++ b/Mage.Sets/src/mage/sets/gameday/ScaleguardSentinels.java @@ -73,7 +73,7 @@ public class ScaleguardSentinels extends CardImpl { // Scaleguard Sentinels enters the battlefield with a +1/+1 counter on it if you revealed a Dragon card or controlled a Dragon as you cast Scaleguard Sentinels. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(), true), - ScaleguardSentinelsCondition.getInstance(), true, + ScaleguardSentinelsCondition.getInstance(), "{this} enters the battlefield with a +1/+1 counter on it if you revealed a Dragon card or controlled a Dragon as you cast {this}", ""), new DragonOnTheBattlefieldWhileSpellWasCastWatcher()); @@ -111,7 +111,7 @@ class ScaleguardSentinelsCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); + Permanent sourcePermanent = game.getPermanentEntering(source.getSourceId()); if (sourcePermanent != null) { DragonOnTheBattlefieldWhileSpellWasCastWatcher watcher = (DragonOnTheBattlefieldWhileSpellWasCastWatcher) game.getState().getWatchers().get("DragonOnTheBattlefieldWhileSpellWasCastWatcher"); return (watcher != null && watcher.castWithConditionTrue(sourcePermanent.getSpellAbility().getId())); diff --git a/Mage.Sets/src/mage/sets/gameday/StasisSnare.java b/Mage.Sets/src/mage/sets/gameday/StasisSnare.java new file mode 100644 index 00000000000..7cbba70bbb6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/gameday/StasisSnare.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.gameday; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class StasisSnare extends mage.sets.battleforzendikar.StasisSnare { + + public StasisSnare(UUID ownerId) { + super(ownerId); + this.cardNumber = 47; + this.expansionSetCode = "MGDC"; + } + + public StasisSnare(final StasisSnare card) { + super(card); + } + + @Override + public StasisSnare copy() { + return new StasisSnare(this); + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/AssembleTheLegion.java b/Mage.Sets/src/mage/sets/gatecrash/AssembleTheLegion.java index faac70e3640..7bbe22befb8 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/AssembleTheLegion.java +++ b/Mage.Sets/src/mage/sets/gatecrash/AssembleTheLegion.java @@ -28,20 +28,17 @@ package mage.sets.gatecrash; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.CountersCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; -import mage.counters.Counter; -import mage.game.Game; -import mage.game.permanent.Permanent; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.game.permanent.token.SoldierTokenWithHaste; /** * @@ -55,7 +52,9 @@ public class AssembleTheLegion extends CardImpl { // At the beginning of your upkeep, put a muster counter on Assemble the Legion. Then put a 1/1 red and white Soldier creature token with haste onto the battlefield for each muster counter on Assemble the Legion. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AssembleTheLegionEffect(), TargetController.YOU, false)); + Ability ability = new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.MUSTER.createInstance()), TargetController.YOU, false); + ability.addEffect(new CreateTokenEffect(new SoldierTokenWithHaste(), new CountersCount(CounterType.MUSTER))); + this.addAbility(ability); } public AssembleTheLegion(final AssembleTheLegion card) { @@ -67,46 +66,3 @@ public class AssembleTheLegion extends CardImpl { return new AssembleTheLegion(this); } } - -class AssembleTheLegionEffect extends OneShotEffect { - private static final String MUSTER_COUNTER_NAME = "Muster"; - - public AssembleTheLegionEffect() { - super(Outcome.Copy); - this.staticText = "put a muster counter on {this}. Then put a 1/1 red and white Soldier creature token with haste onto the battlefield for each muster counter on {this}"; - } - - public AssembleTheLegionEffect(final AssembleTheLegionEffect effect) { - super(effect); - } - - @Override - public AssembleTheLegionEffect copy() { - return new AssembleTheLegionEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - /* 1/24/2013: If Assemble the Legion isn’t on the battlefield when its ability resolves, - * use the number of muster counters it had when it was last on the battlefield to - * determine how many Soldier tokens to put onto the battlefield. - */ - - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - int amountCounters = 0; - if (sourcePermanent == null) { - Permanent lki = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - if (lki != null) { - amountCounters = lki.getCounters().getCount(MUSTER_COUNTER_NAME); - } - } else { - new AddCountersSourceEffect(new Counter(MUSTER_COUNTER_NAME),false).apply(game, source); - amountCounters = sourcePermanent.getCounters().getCount(MUSTER_COUNTER_NAME); - - } - if (amountCounters > 0) { - return new CreateTokenEffect(new SoldierToken(), amountCounters).apply(game, source); - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/gatecrash/BaneAlleyBroker.java b/Mage.Sets/src/mage/sets/gatecrash/BaneAlleyBroker.java index 0443afca8af..864368f97ce 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/BaneAlleyBroker.java +++ b/Mage.Sets/src/mage/sets/gatecrash/BaneAlleyBroker.java @@ -30,12 +30,6 @@ package mage.sets.gatecrash; import java.util.HashSet; import java.util.Set; import java.util.UUID; -import mage.constants.AsThoughEffectType; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -48,8 +42,12 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.ExileZone; import mage.game.Game; @@ -62,29 +60,31 @@ import mage.util.CardUtil; /** * Gatecrash FAQ (01.2013) * - * If Bane Alley Broker's first ability resolves when you have no cards in your hand, - * you'll draw a card and then exile it. You won't have the opportunity to cast that - * card (or do anything else with it) before exiling it. + * If Bane Alley Broker's first ability resolves when you have no cards in your + * hand, you'll draw a card and then exile it. You won't have the opportunity to + * cast that card (or do anything else with it) before exiling it. * - * Due to a recent rules change, once you are allowed to look at a face-down card in - * exile, you are allowed to look at that card as long as it's exiled. If you no longer - * control Bane Alley Broker when its last ability resolves, you can continue to look - * at the relevant cards in exile to choose one to return. + * Due to a recent rules change, once you are allowed to look at a face-down + * card in exile, you are allowed to look at that card as long as it's exiled. + * If you no longer control Bane Alley Broker when its last ability resolves, + * you can continue to look at the relevant cards in exile to choose one to + * return. * - * Bane Alley Broker's second and third abilities apply to cards exiled with that - * specific Bane Alley Broker, not any other creature named Bane Alley Broker. - * You should keep cards exiled by different Bane Alley Brokers separate. + * Bane Alley Broker's second and third abilities apply to cards exiled with + * that specific Bane Alley Broker, not any other creature named Bane Alley + * Broker. You should keep cards exiled by different Bane Alley Brokers + * separate. * * If Bane Alley Broker leaves the battlefield, the cards exiled with it will be * exiled indefinitely. If it later returns to the battlefield, it will be a new - * object with no connection to the cards exiled with it in its previous existence. - * You won't be able to use the "new" Bane Alley Broker to return cards exiled with - * the "old" one. + * object with no connection to the cards exiled with it in its previous + * existence. You won't be able to use the "new" Bane Alley Broker to return + * cards exiled with the "old" one. * - * Even if not all players can look at the exiled cards, each card's owner is still - * known. It is advisable to keep cards owned by different players in distinct piles - * in case another player gains control of Bane Alley Broker and exiles one or more - * cards with it. + * Even if not all players can look at the exiled cards, each card's owner is + * still known. It is advisable to keep cards owned by different players in + * distinct piles in case another player gains control of Bane Alley Broker and + * exiles one or more cards with it. * * @author LevelX2 */ @@ -99,9 +99,9 @@ public class BaneAlleyBroker extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(3); - // {tap}: Draw a card, then exile a card from your hand face down. + // {tap}: Draw a card, then exile a card from your hand face down. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BaneAlleyBrokerDrawExileEffect(), new TapSourceCost())); - + // You may look at cards exiled with Bane Alley Broker. this.addAbility(new SimpleStaticAbility(Zone.ALL, new BaneAlleyBrokerLookAtCardEffect())); @@ -126,44 +126,44 @@ public class BaneAlleyBroker extends CardImpl { class BaneAlleyBrokerDrawExileEffect extends OneShotEffect { public BaneAlleyBrokerDrawExileEffect() { - super(Outcome.DrawCard); - staticText = "Draw a card, then exile a card from your hand face down"; + super(Outcome.DrawCard); + staticText = "Draw a card, then exile a card from your hand face down"; } public BaneAlleyBrokerDrawExileEffect(final BaneAlleyBrokerDrawExileEffect effect) { - super(effect); + super(effect); } @Override public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - controller.drawCards(1, game); - Target target = new TargetCardInHand(new FilterCard("card to exile")); - if (controller.chooseTarget(outcome, target, source, game)) { - Card card = game.getCard(target.getFirstTarget()); - MageObject sourceObject = game.getObject(source.getSourceId()); - if (card != null && sourceObject != null) { - if (card.moveToExile(CardUtil.getCardExileZoneId(game, source), new StringBuilder(sourceObject.getName()).toString(), source.getSourceId(), game)) { - card.setFaceDown(true, game); - return true; - } - } - } - } - return false; + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.drawCards(1, game); + Target target = new TargetCardInHand(new FilterCard("card to exile")); + if (controller.chooseTarget(outcome, target, source, game)) { + Card card = game.getCard(target.getFirstTarget()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (card != null && sourceObject != null) { + if (card.moveToExile(CardUtil.getCardExileZoneId(game, source), new StringBuilder(sourceObject.getName()).toString(), source.getSourceId(), game)) { + card.setFaceDown(true, game); + return true; + } + } + } + } + return false; } @Override public BaneAlleyBrokerDrawExileEffect copy() { - return new BaneAlleyBrokerDrawExileEffect(this); + return new BaneAlleyBrokerDrawExileEffect(this); } } class TargetCardInBaneAlleyBrokerExile extends TargetCard { public TargetCardInBaneAlleyBrokerExile(UUID CardId) { - super(1, 1, Zone.EXILED, new FilterCard("card exiled with Bane Alley Broker")); + super(1, 1, Zone.EXILED, new FilterCard("card exiled with Bane Alley Broker")); } public TargetCardInBaneAlleyBrokerExile(final TargetCardInBaneAlleyBrokerExile target) { @@ -223,7 +223,7 @@ class TargetCardInBaneAlleyBrokerExile extends TargetCard { class BaneAlleyBrokerLookAtCardEffect extends AsThoughEffectImpl { public BaneAlleyBrokerLookAtCardEffect() { - super(AsThoughEffectType.REVEAL_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit); + super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit); staticText = "You may look at cards exiled with {this}"; } @@ -252,13 +252,7 @@ class BaneAlleyBrokerLookAtCardEffect extends AsThoughEffectImpl { } UUID exileId = CardUtil.getCardExileZoneId(game, source); ExileZone exile = game.getExile().getExileZone(exileId); - if (exile != null && exile.contains(objectId)) { - Cards cards = new CardsImpl(card); - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - controller.lookAtCards("Exiled with " + sourceObject.getName(), cards, game); - } - } + return exile != null && exile.contains(objectId); } } return false; diff --git a/Mage.Sets/src/mage/sets/gatecrash/BlindObedience.java b/Mage.Sets/src/mage/sets/gatecrash/BlindObedience.java index 3bc36d45269..9178c73592d 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/BlindObedience.java +++ b/Mage.Sets/src/mage/sets/gatecrash/BlindObedience.java @@ -28,17 +28,18 @@ package mage.sets.gatecrash; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.keyword.ExtortAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -52,7 +53,6 @@ public class BlindObedience extends CardImpl { super(ownerId, 6, "Blind Obedience", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); this.expansionSetCode = "GTC"; - // Extort (Whenever you cast a spell, you may pay {WB}. If you do, each opponent loses 1 life and you gain that much life.) this.addAbility(new ExtortAbility()); @@ -72,6 +72,7 @@ public class BlindObedience extends CardImpl { } class BlindObedienceTapEffect extends ReplacementEffectImpl { + BlindObedienceTapEffect() { super(Duration.WhileOnBattlefield, Outcome.Tap); staticText = "Artifacts and creatures your opponents control enter the battlefield tapped"; @@ -83,22 +84,22 @@ class BlindObedienceTapEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent target = game.getPermanent(event.getTargetId()); + Permanent target = ((EntersTheBattlefieldEvent) event).getTarget(); if (target != null) { target.setTapped(true); } return false; } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { - Permanent permanent = game.getPermanent(event.getTargetId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null && (permanent.getCardType().contains(CardType.CREATURE) || permanent.getCardType().contains(CardType.ARTIFACT))) { return true; } diff --git a/Mage.Sets/src/mage/sets/gatecrash/CartelAristocrat.java b/Mage.Sets/src/mage/sets/gatecrash/CartelAristocrat.java index 83086c0d761..4ff2be9d3f6 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/CartelAristocrat.java +++ b/Mage.Sets/src/mage/sets/gatecrash/CartelAristocrat.java @@ -32,7 +32,6 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.continuous.GainProtectionFromColorSourceEffect; @@ -44,19 +43,18 @@ import mage.filter.predicate.permanent.AnotherPredicate; import mage.target.common.TargetControlledPermanent; /** - * Gatecrash FAQ (01.2013) - * You choose the color when the ability resolves. + * Gatecrash FAQ (01.2013) You choose the color when the ability resolves. * * @author LevelX2 */ public class CartelAristocrat extends CardImpl { - + private static final FilterControlledPermanent filter = new FilterControlledCreaturePermanent("another creature"); static { filter.add(new AnotherPredicate()); } - + public CartelAristocrat(UUID ownerId) { super(ownerId, 150, "Cartel Aristocrat", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}{B}"); this.expansionSetCode = "GTC"; diff --git a/Mage.Sets/src/mage/sets/gatecrash/DiluvianPrimordial.java b/Mage.Sets/src/mage/sets/gatecrash/DiluvianPrimordial.java index b97e56ead71..21565e11e57 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/DiluvianPrimordial.java +++ b/Mage.Sets/src/mage/sets/gatecrash/DiluvianPrimordial.java @@ -73,20 +73,20 @@ public class DiluvianPrimordial extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // When Diluvian Primordial enters the battlefield, for each opponent, you may cast up to one target instant or sorcery card from that player's graveyard without paying its mana cost. If a card cast this way would be put into a graveyard this turn, exile it instead. - this.addAbility(new EntersBattlefieldTriggeredAbility(new DiluvianPrimordialEffect(),false)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new DiluvianPrimordialEffect(), false)); } @Override public void adjustTargets(Ability ability, Game game) { if (ability instanceof EntersBattlefieldTriggeredAbility) { ability.getTargets().clear(); - for(UUID opponentId : game.getOpponents(ability.getControllerId())) { + for (UUID opponentId : game.getOpponents(ability.getControllerId())) { Player opponent = game.getPlayer(opponentId); if (opponent != null) { FilterCard filter = new FilterCard("instant or sorcery card from " + opponent.getLogName() + "'s graveyard"); filter.add(new OwnerIdPredicate(opponentId)); - filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT),new CardTypePredicate(CardType.SORCERY))); - TargetCardInOpponentsGraveyard target = new TargetCardInOpponentsGraveyard(0,1, filter); + filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY))); + TargetCardInOpponentsGraveyard target = new TargetCardInOpponentsGraveyard(0, 1, filter); ability.addTarget(target); } } @@ -123,17 +123,16 @@ class DiluvianPrimordialEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (Target target: source.getTargets()) { + for (Target target : source.getTargets()) { if (target instanceof TargetCardInOpponentsGraveyard) { Card targetCard = game.getCard(target.getFirstTarget()); if (targetCard != null) { - if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() +"?", source, game)) { - // TODO: Handle the case if the cast is not possible, so the replacement effect shouldn't be active - ContinuousEffect effect = new DiluvianPrimordialReplacementEffect(); - effect.setTargetPointer(new FixedTarget(targetCard.getId())); - game.addEffect(effect, source); - - controller.cast(targetCard.getSpellAbility(), game, true); + if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() + "?", source, game)) { + if (controller.cast(targetCard.getSpellAbility(), game, true)) { + ContinuousEffect effect = new DiluvianPrimordialReplacementEffect(); + effect.setTargetPointer(new FixedTarget(targetCard.getId(), game.getState().getZoneChangeCounter(targetCard.getId()))); + game.addEffect(effect, source); + } } } } @@ -169,7 +168,7 @@ class DiluvianPrimordialReplacementEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Card card = game.getCard(((FixedTarget)getTargetPointer()).getTarget()); + Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null) { controller.moveCards(card, Zone.STACK, Zone.EXILED, source, game); return true; diff --git a/Mage.Sets/src/mage/sets/gatecrash/DomriRade.java b/Mage.Sets/src/mage/sets/gatecrash/DomriRade.java index 0d92cdf0bac..cf84a981cc3 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/DomriRade.java +++ b/Mage.Sets/src/mage/sets/gatecrash/DomriRade.java @@ -31,13 +31,12 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.FightTargetsEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.DoubleStrikeAbility; import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HexproofAbility; @@ -50,7 +49,6 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; @@ -70,7 +68,7 @@ public class DomriRade extends CardImpl { this.expansionSetCode = "GTC"; this.subtype.add("Domri"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +1: Look at the top card of your library. If it's a creature card, you may reveal it and put it into your hand. this.addAbility(new LoyaltyAbility(new DomriRadeEffect1(), 1)); @@ -138,7 +136,6 @@ class DomriRadeEffect1 extends OneShotEffect { class DomriRadeEmblem extends Emblem { // "Creatures you control have double strike, trample, hexproof and haste." - public DomriRadeEmblem() { this.setName("EMBLEM: Domri Rade"); FilterPermanent filter = new FilterControlledCreaturePermanent("Creatures"); diff --git a/Mage.Sets/src/mage/sets/gatecrash/EnterTheInfinite.java b/Mage.Sets/src/mage/sets/gatecrash/EnterTheInfinite.java index a53a1e0b985..b0710850a27 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/EnterTheInfinite.java +++ b/Mage.Sets/src/mage/sets/gatecrash/EnterTheInfinite.java @@ -27,6 +27,7 @@ */ package mage.sets.gatecrash; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; @@ -35,14 +36,17 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.constants.*; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.PhaseStep; +import mage.constants.Rarity; import mage.game.Game; import mage.game.turn.Step; import mage.players.Player; import mage.target.common.TargetCardInHand; -import java.util.UUID; - /** * * @author LevelX2 @@ -53,8 +57,7 @@ public class EnterTheInfinite extends CardImpl { super(ownerId, 34, "Enter the Infinite", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{8}{U}{U}{U}{U}"); this.expansionSetCode = "GTC"; - - // Draw cards equal to the number of cards in your library, + // Draw cards equal to the number of cards in your library, this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new CardsInControllerLibraryCount())); //then put a card from your hand on top of your library. this.getSpellAbility().addEffect(new PutCardOnLibraryEffect()); @@ -72,8 +75,8 @@ public class EnterTheInfinite extends CardImpl { } } - class CardsInControllerLibraryCount implements DynamicValue { + @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { if (sourceAbility != null) { @@ -119,14 +122,13 @@ class PutCardOnLibraryEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { TargetCardInHand target = new TargetCardInHand(); - player.chooseTarget(Outcome.ReturnToHand, target, source, game); - Card card = player.getHand().get(target.getFirstTarget(), game); + controller.chooseTarget(Outcome.ReturnToHand, target, source, game); + Card card = controller.getHand().get(target.getFirstTarget(), game); if (card != null) { - player.getHand().remove(card); - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + controller.putCardsOnTopOfLibrary(new CardsImpl(card), game, source, false); } return true; } @@ -134,29 +136,27 @@ class PutCardOnLibraryEffect extends OneShotEffect { } } +class MaximumHandSizeEffect extends MaximumHandSizeControllerEffect { -class MaximumHandSizeEffect extends MaximumHandSizeControllerEffect{ - - public MaximumHandSizeEffect(){ + public MaximumHandSizeEffect() { super(Integer.MAX_VALUE, Duration.Custom, MaximumHandSizeControllerEffect.HandSizeModification.SET); staticText = "You have no maximum hand size until your next turn"; } - - public MaximumHandSizeEffect(final MaximumHandSizeEffect effect) { + + public MaximumHandSizeEffect(final MaximumHandSizeEffect effect) { super(effect); } - + @Override public boolean isInactive(Ability source, Game game) { - if (game.getPhase().getStep().getType() == PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) - { + if (game.getPhase().getStep().getType() == PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) { if (game.getActivePlayerId().equals(source.getControllerId())) { return true; } } return false; } - + @Override public MaximumHandSizeEffect copy() { return new MaximumHandSizeEffect(this); diff --git a/Mage.Sets/src/mage/sets/gatecrash/FathomMage.java b/Mage.Sets/src/mage/sets/gatecrash/FathomMage.java index 67f67d0d830..5f125a6fec3 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/FathomMage.java +++ b/Mage.Sets/src/mage/sets/gatecrash/FathomMage.java @@ -1,5 +1,5 @@ /* -/* + /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are @@ -60,7 +60,7 @@ public class FathomMage extends CardImpl { // Evolve (Whenever a creature enters the battlefield under your control, if that creature // has greater power or toughness than this creature, put a +1/+1 counter on this creature.) this.addAbility(new EvolveAbility()); - + //Whenever a +1/+1 counter is placed on Fathom Mage, you may draw a card. this.addAbility(new FathomMageTriggeredAbility()); } @@ -75,11 +75,10 @@ public class FathomMage extends CardImpl { } } - class FathomMageTriggeredAbility extends TriggeredAbilityImpl { public FathomMageTriggeredAbility() { - super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), true); + super(Zone.ALL, new DrawCardSourceControllerEffect(1), true); } public FathomMageTriggeredAbility(FathomMageTriggeredAbility ability) { diff --git a/Mage.Sets/src/mage/sets/gatecrash/GiantAdephage.java b/Mage.Sets/src/mage/sets/gatecrash/GiantAdephage.java index 67b1fd6ab7c..c0d4b180daf 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/GiantAdephage.java +++ b/Mage.Sets/src/mage/sets/gatecrash/GiantAdephage.java @@ -28,22 +28,13 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.MageInt; -import mage.MageObject; -import mage.abilities.Ability; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; -import mage.util.CardUtil; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -63,7 +54,7 @@ public class GiantAdephage extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // Whenever Giant Adephage deals combat damage to a player, put a token onto the battlefield that is a copy of Giant Adephage. - this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new GiantAdephageCopyEffect(), false)); + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new PutTokenOntoBattlefieldCopySourceEffect(), false)); } @@ -76,40 +67,3 @@ public class GiantAdephage extends CardImpl { return new GiantAdephage(this); } } - -class GiantAdephageCopyEffect extends OneShotEffect { - - public GiantAdephageCopyEffect() { - super(Outcome.Copy); - this.staticText = "put a token onto the battlefield that is a copy of Giant Adephage"; - } - - public GiantAdephageCopyEffect(final GiantAdephageCopyEffect effect) { - super(effect); - } - - @Override - public GiantAdephageCopyEffect copy() { - return new GiantAdephageCopyEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - MageObject thisCard = game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - if (thisCard != null && thisCard instanceof Permanent) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from((Permanent)thisCard); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } else { // maybe it's token - Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); - if (permanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/gatecrash/GideonChampionOfJustice.java b/Mage.Sets/src/mage/sets/gatecrash/GideonChampionOfJustice.java index ddff7d83638..9467a3ccfcc 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/GideonChampionOfJustice.java +++ b/Mage.Sets/src/mage/sets/gatecrash/GideonChampionOfJustice.java @@ -27,15 +27,14 @@ */ package mage.sets.gatecrash; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CountersCount; import mage.abilities.dynamicvalue.common.PermanentsTargetOpponentControlsCount; -import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.PreventAllDamageToSourceEffect; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; @@ -43,7 +42,11 @@ import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; @@ -51,8 +54,6 @@ import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.target.common.TargetOpponent; -import java.util.UUID; - /** * * @author LevelX2 @@ -64,7 +65,7 @@ public class GideonChampionOfJustice extends CardImpl { this.expansionSetCode = "GTC"; this.subtype.add("Gideon"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Put a loyalty counter on Gideon, Champion of Justice for each creature target opponent controls. LoyaltyAbility ability1 = new LoyaltyAbility( diff --git a/Mage.Sets/src/mage/sets/gatecrash/IllusionistsBracers.java b/Mage.Sets/src/mage/sets/gatecrash/IllusionistsBracers.java index 7143298d447..ae59bc58e37 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/IllusionistsBracers.java +++ b/Mage.Sets/src/mage/sets/gatecrash/IllusionistsBracers.java @@ -1,30 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.sets.gatecrash; import java.util.UUID; @@ -48,21 +48,21 @@ import mage.game.stack.StackAbility; import mage.players.Player; /** -* -* @author LevelX2 -*/ + * + * @author LevelX2 + */ public class IllusionistsBracers extends CardImpl { public IllusionistsBracers(UUID ownerId) { - super(ownerId, 231, "Illusionist's Bracers", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "GTC"; - this.subtype.add("Equipment"); + super(ownerId, 231, "Illusionist's Bracers", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Equipment"); - // Whenever an ability of equipped creature is activated, if it isn't a mana ability, copy that ability. You may choose new targets for the copy. - this.addAbility(new AbilityActivatedTriggeredAbility()); + // Whenever an ability of equipped creature is activated, if it isn't a mana ability, copy that ability. You may choose new targets for the copy. + this.addAbility(new AbilityActivatedTriggeredAbility()); - // Equip 3 - this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(3))); + // Equip 3 + this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(3))); } public IllusionistsBracers(final IllusionistsBracers card) { @@ -76,6 +76,7 @@ public class IllusionistsBracers extends CardImpl { } class AbilityActivatedTriggeredAbility extends TriggeredAbilityImpl { + AbilityActivatedTriggeredAbility() { super(Zone.BATTLEFIELD, new CopyActivatedAbilityEffect()); } @@ -110,7 +111,7 @@ class AbilityActivatedTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Whenever an ability of equipped creature is activated, if it isn't a mana ability, copy that ability. You may choose new targets for the copy."; + return "Whenever an ability of equipped creature is activated, if it isn't a mana ability, copy that ability. You may choose new targets for the copy."; } } @@ -142,7 +143,7 @@ class CopyActivatedAbilityEffect extends OneShotEffect { if (newAbility.getTargets().size() > 0) { if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", source, game)) { newAbility.getTargets().clearChosen(); - if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) { + if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, false, game) == false) { return false; } } diff --git a/Mage.Sets/src/mage/sets/gatecrash/MasterBiomancer.java b/Mage.Sets/src/mage/sets/gatecrash/MasterBiomancer.java index eeb0b6346dd..8a7a9c32ef9 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/MasterBiomancer.java +++ b/Mage.Sets/src/mage/sets/gatecrash/MasterBiomancer.java @@ -1,30 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.sets.gatecrash; import java.util.UUID; @@ -42,37 +42,38 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; /** -* -* @author LevelX2 -*/ + * + * @author LevelX2 + */ public class MasterBiomancer extends CardImpl { public MasterBiomancer(UUID ownerId) { - super(ownerId, 176, "Master Biomancer", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}{U}"); - this.expansionSetCode = "GTC"; - this.subtype.add("Elf"); - this.subtype.add("Wizard"); + super(ownerId, 176, "Master Biomancer", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}{U}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Elf"); + this.subtype.add("Wizard"); - this.power = new MageInt(2); - this.toughness = new MageInt(4); + this.power = new MageInt(2); + this.toughness = new MageInt(4); - // Each other creature you control enters the battlefield with a number of additional +1/+1 counters on it equal to Master Biomancer's power and as a Mutant in addition to its other types. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MasterBiomancerEntersBattlefieldEffect())); + // Each other creature you control enters the battlefield with a number of additional +1/+1 counters on it equal to Master Biomancer's power and as a Mutant in addition to its other types. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MasterBiomancerEntersBattlefieldEffect())); } public MasterBiomancer(final MasterBiomancer card) { - super(card); + super(card); } @Override public MasterBiomancer copy() { - return new MasterBiomancer(this); + return new MasterBiomancer(this); } } @@ -86,16 +87,16 @@ class MasterBiomancerEntersBattlefieldEffect extends ReplacementEffectImpl { public MasterBiomancerEntersBattlefieldEffect(MasterBiomancerEntersBattlefieldEffect effect) { super(effect); } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getTargetId()); - return creature != null && creature.getControllerId().equals(source.getControllerId()) + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); + return creature != null && creature.getControllerId().equals(source.getControllerId()) && creature.getCardType().contains(CardType.CREATURE) && !event.getTargetId().equals(source.getSourceId()); } @@ -103,20 +104,19 @@ class MasterBiomancerEntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent sourceCreature = game.getPermanent(source.getSourceId()); - Permanent creature = game.getPermanent(event.getTargetId()); + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); if (sourceCreature != null && creature != null) { int power = sourceCreature.getPower().getValue(); if (power > 0) { creature.addCounters(CounterType.P1P1.createInstance(power), game); } ContinuousEffect effect = new AddCardSubTypeTargetEffect("Mutant", Duration.Custom); - effect.setTargetPointer(new FixedTarget(creature.getId())); + effect.setTargetPointer(new FixedTarget(creature.getId(), creature.getZoneChangeCounter(game) + 1)); game.addEffect(effect, source); } return false; } - @Override public MasterBiomancerEntersBattlefieldEffect copy() { return new MasterBiomancerEntersBattlefieldEffect(this); diff --git a/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java b/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java index 804d39b1250..eacb454a99b 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java +++ b/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java @@ -28,20 +28,14 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.constants.Outcome; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -60,7 +54,7 @@ public class NimbusSwimmer extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Nimbus Swimmer enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new NimbusSwimmerEffect(), true)); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); } public NimbusSwimmer(final NimbusSwimmer card) { @@ -72,37 +66,3 @@ public class NimbusSwimmer extends CardImpl { return new NimbusSwimmer(this); } } - -class NimbusSwimmerEffect extends OneShotEffect { - - public NimbusSwimmerEffect() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - public NimbusSwimmerEffect(final NimbusSwimmerEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility)obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public NimbusSwimmerEffect copy() { - return new NimbusSwimmerEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/gatecrash/ObzedatGhostCouncil.java b/Mage.Sets/src/mage/sets/gatecrash/ObzedatGhostCouncil.java index 4435598c20d..4ebfb6bdee6 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/ObzedatGhostCouncil.java +++ b/Mage.Sets/src/mage/sets/gatecrash/ObzedatGhostCouncil.java @@ -180,7 +180,7 @@ class ObzedatGhostCouncilReturnEffect extends OneShotEffect { // return it only from the own exile zone if (currentZone != null && currentZone.size() > 0) { Player owner = game.getPlayer(card.getOwnerId()); - if (owner != null && owner.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId())) { + if (owner != null && owner.moveCards(card, Zone.BATTLEFIELD, source, game)) { return true; } } diff --git a/Mage.Sets/src/mage/sets/gatecrash/RapidHybridization.java b/Mage.Sets/src/mage/sets/gatecrash/RapidHybridization.java index e78fd5d41f4..42d9aa8bbf1 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/RapidHybridization.java +++ b/Mage.Sets/src/mage/sets/gatecrash/RapidHybridization.java @@ -29,7 +29,6 @@ package mage.sets.gatecrash; import java.util.UUID; import mage.MageInt; -import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; @@ -52,7 +51,6 @@ public class RapidHybridization extends CardImpl { super(ownerId, 44, "Rapid Hybridization", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{U}"); this.expansionSetCode = "GTC"; - // Destroy target creature. It can't be regenerated. That creature's controller puts a 3/3 green Frog Lizard creature token onto the battlefield. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); @@ -87,7 +85,7 @@ class RapidHybridizationEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = (Permanent) game.getPermanentOrLKIBattlefield(targetPointer.getFirst(game, source)); + Permanent permanent = game.getPermanentOrLKIBattlefield(targetPointer.getFirst(game, source)); if (permanent != null) { RapidHybridizationToken token = new RapidHybridizationToken(); token.putOntoBattlefield(1, game, source.getSourceId(), permanent.getControllerId()); @@ -103,14 +101,14 @@ class RapidHybridizationToken extends Token { super("Frog Lizard", "3/3 green Frog Lizard creature token onto the battlefield"); this.setOriginalExpansionSetCode("GTC"); cardType.add(CardType.CREATURE); - + color.setGreen(true); - + subtype.add("Frog"); subtype.add("Lizard"); - + power = new MageInt(3); toughness = new MageInt(3); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/Realmwright.java b/Mage.Sets/src/mage/sets/gatecrash/Realmwright.java index dfb670e3dd7..f0707af005d 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/Realmwright.java +++ b/Mage.Sets/src/mage/sets/gatecrash/Realmwright.java @@ -29,6 +29,18 @@ package mage.sets.gatecrash; import java.util.List; import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.ChooseBasicLandTypeEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.abilities.mana.BlueManaAbility; +import mage.abilities.mana.GreenManaAbility; +import mage.abilities.mana.RedManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -36,15 +48,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.AsEntersBattlefieldAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.mana.*; -import mage.cards.CardImpl; -import mage.choices.ChoiceImpl; import mage.filter.common.FilterControlledLandPermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -66,7 +69,7 @@ public class Realmwright extends CardImpl { this.toughness = new MageInt(1); // As Realmwright enters the battlefield, choose a basic land type. - this.addAbility(new AsEntersBattlefieldAbility(new RealmwrightEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseBasicLandTypeEffect(Outcome.Neutral))); // Lands you control are the chosen type in addition to their other types. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new RealmwrightEffect2())); @@ -82,44 +85,6 @@ public class Realmwright extends CardImpl { } } -class RealmwrightEffect extends OneShotEffect { - - public RealmwrightEffect() { - super(Outcome.Neutral); - this.staticText = "Choose a basic land type"; - } - - public RealmwrightEffect(final RealmwrightEffect effect) { - super(effect); - } - - @Override - public RealmwrightEffect copy() { - return new RealmwrightEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { - ChoiceImpl choices = new ChoiceImpl(true); - choices.setMessage("Choose basic land type"); - choices.isRequired(); - choices.getChoices().add("Forest"); - choices.getChoices().add("Plains"); - choices.getChoices().add("Mountain"); - choices.getChoices().add("Island"); - choices.getChoices().add("Swamp"); - if (you.choose(Outcome.Neutral, choices, game)) { - game.informPlayers(new StringBuilder("Realmwright: ").append(" Chosen basic land type is ").append(choices.getChoice()).toString()); - game.getState().setValue(source.getSourceId().toString() + "_Realmwright", choices.getChoice()); - return true; - } - } - return false; - } -} - class RealmwrightEffect2 extends ContinuousEffectImpl { public RealmwrightEffect2() { @@ -140,7 +105,7 @@ class RealmwrightEffect2 extends ContinuousEffectImpl { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Player you = game.getPlayer(source.getControllerId()); List lands = game.getBattlefield().getAllActivePermanents(new FilterControlledLandPermanent(), source.getControllerId(), game); - String choice = (String) game.getState().getValue(source.getSourceId().toString() + "_Realmwright"); + String choice = (String) game.getState().getValue(source.getSourceId().toString() + ChooseBasicLandTypeEffect.VALUE_KEY); if (you != null && choice != null) { for (Permanent land : lands) { if (land != null) { diff --git a/Mage.Sets/src/mage/sets/gatecrash/StolenIdentity.java b/Mage.Sets/src/mage/sets/gatecrash/StolenIdentity.java index af874fafb0d..6ea81331c7e 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/StolenIdentity.java +++ b/Mage.Sets/src/mage/sets/gatecrash/StolenIdentity.java @@ -28,23 +28,15 @@ package mage.sets.gatecrash; import java.util.UUID; - +import mage.abilities.effects.common.CipherEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.CipherEffect; -import mage.cards.CardImpl; -import mage.constants.Outcome; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.target.TargetPermanent; -import mage.util.CardUtil; /** * @@ -53,17 +45,17 @@ import mage.util.CardUtil; public class StolenIdentity extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); + static { filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE))); } - + public StolenIdentity(UUID ownerId) { super(ownerId, 53, "Stolen Identity", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{U}{U}"); this.expansionSetCode = "GTC"; - // Put a token onto the battlefield that's a copy of target artifact or creature. - this.getSpellAbility().addEffect(new StolenIdentityEffect()); + this.getSpellAbility().addEffect(new PutTokenOntoBattlefieldCopyTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(filter)); // Cipher this.getSpellAbility().addEffect(new CipherEffect()); @@ -78,42 +70,3 @@ public class StolenIdentity extends CardImpl { return new StolenIdentity(this); } } - - -class StolenIdentityEffect extends OneShotEffect { - - - - public StolenIdentityEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "Put a token onto the battlefield that's a copy of target artifact or creature"; - } - - public StolenIdentityEffect(final StolenIdentityEffect effect) { - super(effect); - } - - @Override - public StolenIdentityEffect copy() { - return new StolenIdentityEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); - } - - if (permanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - - return true; - } - - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/gatecrash/SunhomeGuildmage.java b/Mage.Sets/src/mage/sets/gatecrash/SunhomeGuildmage.java index 0adc3c7a3a6..4930c6e8ef3 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/SunhomeGuildmage.java +++ b/Mage.Sets/src/mage/sets/gatecrash/SunhomeGuildmage.java @@ -34,13 +34,12 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; -import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SoldierTokenWithHaste; /** * @@ -54,17 +53,14 @@ public class SunhomeGuildmage extends CardImpl { this.subtype.add("Human"); this.subtype.add("Wizard"); - this.power = new MageInt(2); this.toughness = new MageInt(2); - //{1}{R}{W}: Creatures you control get +1/+0 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{1}{R}{W}"))); - + //{2}{R}{W}: Put a 1/1 red and white Soldier creature token with haste onto the battlefield. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SoldierToken()), new ManaCostsImpl("{2}{R}{W}"))); - + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SoldierTokenWithHaste()), new ManaCostsImpl("{2}{R}{W}"))); } public SunhomeGuildmage(final SunhomeGuildmage card) { @@ -76,20 +72,3 @@ public class SunhomeGuildmage extends CardImpl { return new SunhomeGuildmage(this); } } - - -class SoldierToken extends Token { - - public SoldierToken() { - super("Soldier", "1/1 red and white Soldier creature token with haste"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - color.setRed(true); - subtype.add("Soldier"); - power = new MageInt(1); - toughness = new MageInt(1); - - this.addAbility(HasteAbility.getInstance()); - } - -} diff --git a/Mage.Sets/src/mage/sets/gatecrash/ThespiansStage.java b/Mage.Sets/src/mage/sets/gatecrash/ThespiansStage.java index fa629410a65..8fc75c855c8 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/ThespiansStage.java +++ b/Mage.Sets/src/mage/sets/gatecrash/ThespiansStage.java @@ -28,10 +28,6 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; @@ -39,6 +35,9 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; @@ -80,7 +79,7 @@ class ThespiansStageCopyEffect extends OneShotEffect { public ThespiansStageCopyEffect() { super(Outcome.Benefit); - this.staticText = "Thespian's Stage becomes a copy of target land and gains this ability"; + this.staticText = "{this} becomes a copy of target land and gains this ability"; } public ThespiansStageCopyEffect(final ThespiansStageCopyEffect effect) { @@ -97,7 +96,7 @@ class ThespiansStageCopyEffect extends OneShotEffect { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Permanent copyFromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (sourcePermanent != null && copyFromPermanent != null) { - Permanent newPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent, source, new EmptyApplyToPermanent()); + Permanent newPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent.getId(), source, new EmptyApplyToPermanent()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ThespiansStageCopyEffect(), new GenericManaCost(2)); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetLandPermanent()); diff --git a/Mage.Sets/src/mage/sets/gatecrash/ThrullParasite.java b/Mage.Sets/src/mage/sets/gatecrash/ThrullParasite.java index e989bcca14d..d53ebeca491 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/ThrullParasite.java +++ b/Mage.Sets/src/mage/sets/gatecrash/ThrullParasite.java @@ -27,29 +27,18 @@ */ package mage.sets.gatecrash; -import java.util.HashSet; -import java.util.Set; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.PayLifeCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.RemoveCounterTargetEffect; import mage.abilities.keyword.ExtortAbility; import mage.cards.CardImpl; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.Counter; -import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetNonlandPermanent; /** @@ -69,7 +58,7 @@ public class ThrullParasite extends CardImpl { // Extort this.addAbility(new ExtortAbility()); // {tap}, Pay 2 life: Remove a counter from target nonland permanent. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RemoveCounterTargetEffect(),new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RemoveCounterTargetEffect(), new TapSourceCost()); ability.addTarget(new TargetNonlandPermanent()); ability.addCost(new PayLifeCost(2)); this.addAbility(ability); @@ -84,75 +73,3 @@ public class ThrullParasite extends CardImpl { return new ThrullParasite(this); } } - -class RemoveCounterTargetEffect extends OneShotEffect { - - private CounterType counterTypeToRemove; - - public RemoveCounterTargetEffect() { - super(Outcome.Detriment); - this.staticText = "Remove a counter from target nonland permanent"; - } - - public RemoveCounterTargetEffect(CounterType counterTypeToRemove) { - super(Outcome.Detriment); - this.staticText = "Remove a " + counterTypeToRemove.getName() + " counter from target nonland permanent"; - this.counterTypeToRemove = counterTypeToRemove; - } - - public RemoveCounterTargetEffect(final RemoveCounterTargetEffect effect) { - super(effect); - this.counterTypeToRemove = effect.counterTypeToRemove; - } - - @Override - public RemoveCounterTargetEffect copy() { - return new RemoveCounterTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - boolean result = false; - Player controller = game.getPlayer(source.getControllerId()); - for (UUID targetId: getTargetPointer().getTargets(game, source)) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - if (permanent.getCounters().size() > 0 && (counterTypeToRemove == null || permanent.getCounters().containsKey(counterTypeToRemove))) { - String counterName = null; - if (counterTypeToRemove != null) { - counterName = counterTypeToRemove.getName(); - } else { - if (permanent.getCounters().size() > 1 && counterTypeToRemove == null) { - Choice choice = new ChoiceImpl(true); - Set choices = new HashSet(); - for (Counter counter : permanent.getCounters().values()) { - if (permanent.getCounters().getCount(counter.getName()) > 0) { - choices.add(counter.getName()); - } - } - choice.setChoices(choices); - choice.setMessage("Choose a counter type to remove from " + permanent.getName()); - controller.choose(Outcome.Detriment, choice, game); - counterName = choice.getChoice(); - } else { - for (Counter counter : permanent.getCounters().values()) { - if (counter.getCount() > 0) { - counterName = counter.getName(); - } - } - } - } - if (counterName != null) { - permanent.removeCounters(counterName, 1, game); - if (permanent.getCounters().getCount(counterName) == 0 ){ - permanent.getCounters().removeCounter(counterName); - } - result |= true; - game.informPlayers(new StringBuilder(controller.getLogName()).append(" removes a ").append(counterName).append(" counter from ").append(permanent.getName()).toString()); - } - } - } - } - return result; - } -} diff --git a/Mage.Sets/src/mage/sets/gatecrash/UrbanEvolution.java b/Mage.Sets/src/mage/sets/gatecrash/UrbanEvolution.java index 626a9642465..087c376526c 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/UrbanEvolution.java +++ b/Mage.Sets/src/mage/sets/gatecrash/UrbanEvolution.java @@ -44,18 +44,14 @@ import mage.constants.Duration; public class UrbanEvolution extends CardImpl { public UrbanEvolution(UUID ownerId) { - super(ownerId, 204, "Urban Evolution", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{U}{G}"); + super(ownerId, 204, "Urban Evolution", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}{U}"); this.expansionSetCode = "GTC"; - this.subtype.add("Wizard"); - //Draw three cards. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3)); //You may play an additional land this turn. this.getSpellAbility().addEffect(new PlayAdditionalLandsControllerEffect(1, Duration.EndOfTurn)); - - } public UrbanEvolution(final UrbanEvolution card) { diff --git a/Mage.Sets/src/mage/sets/gatecrash/ZameckGuildmage.java b/Mage.Sets/src/mage/sets/gatecrash/ZameckGuildmage.java index 48c906b6fec..ba0208320ff 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/ZameckGuildmage.java +++ b/Mage.Sets/src/mage/sets/gatecrash/ZameckGuildmage.java @@ -28,29 +28,25 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.Mode; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveCounterCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.Effect; -import mage.abilities.effects.Effects; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -58,8 +54,6 @@ import mage.target.targetpointer.FixedTarget; */ public class ZameckGuildmage extends CardImpl { - private static final String ruleText = "This turn, each creature you control enters the battlefield with an additional +1/+1 counter on it"; - public ZameckGuildmage(UUID ownerId) { super(ownerId, 209, "Zameck Guildmage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}{U}"); this.expansionSetCode = "GTC"; @@ -69,9 +63,8 @@ public class ZameckGuildmage extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - // {G}{U}: This turn, each creature you control enters the battlefield with an additional +1/+1 counter on it. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(1)), ruleText), new ManaCostsImpl("{G}{U}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ZameckGuildmageEntersBattlefieldEffect(), new ManaCostsImpl("{G}{U}"))); // {G}{U}, Remove a +1/+1 counter from a creature you control: Draw a card. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{G}{U}")); @@ -89,25 +82,15 @@ public class ZameckGuildmage extends CardImpl { } } -class EntersBattlefieldEffect extends ReplacementEffectImpl { +class ZameckGuildmageEntersBattlefieldEffect extends ReplacementEffectImpl { - protected Effects baseEffects = new Effects(); - protected String text; - - public EntersBattlefieldEffect(Effect baseEffect, String text) { - super(Duration.EndOfTurn, baseEffect.getOutcome()); - this.baseEffects.add(baseEffect); - this.text = text; + public ZameckGuildmageEntersBattlefieldEffect() { + super(Duration.EndOfTurn, Outcome.BoostCreature); + this.staticText = "This turn, each creature you control enters the battlefield with an additional +1/+1 counter on it"; } - public EntersBattlefieldEffect(EntersBattlefieldEffect effect) { + public ZameckGuildmageEntersBattlefieldEffect(ZameckGuildmageEntersBattlefieldEffect effect) { super(effect); - this.baseEffects = effect.baseEffects.copy(); - this.text = effect.text; - } - - public void addEffect(Effect effect) { - baseEffects.add(effect); } @Override @@ -117,11 +100,8 @@ class EntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) { - return true; - } - return false; + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); + return permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE); } @Override @@ -131,23 +111,15 @@ class EntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - for (Effect effect: baseEffects) { - Permanent target = game.getPermanent(event.getTargetId()); - if (target != null) { - effect.setTargetPointer(new FixedTarget(target.getId())); - effect.apply(game, source); - } + Permanent target = ((EntersTheBattlefieldEvent) event).getTarget(); + if (target != null) { + target.addCounters(CounterType.P1P1.createInstance(), game); } return false; } @Override - public String getText(Mode mode) { - return (text == null || text.isEmpty()) ? baseEffects.getText(mode) : text; - } - - @Override - public EntersBattlefieldEffect copy() { - return new EntersBattlefieldEffect(this); + public ZameckGuildmageEntersBattlefieldEffect copy() { + return new ZameckGuildmageEntersBattlefieldEffect(this); } } diff --git a/Mage.Sets/src/mage/sets/guildpact/Borborygmos.java b/Mage.Sets/src/mage/sets/guildpact/Borborygmos.java new file mode 100644 index 00000000000..ae1d94838c8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/guildpact/Borborygmos.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.guildpact; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Borborygmos extends CardImpl { + + public Borborygmos(UUID ownerId) { + super(ownerId, 103, "Borborygmos", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}{G}{G}"); + this.expansionSetCode = "GPT"; + this.supertype.add("Legendary"); + this.subtype.add("Cyclops"); + this.power = new MageInt(6); + this.toughness = new MageInt(7); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Whenever Borborygmos deals combat damage to a player, put a +1/+1 counter on each creature you control. + this.addAbility(new DealsCombatDamageTriggeredAbility(new AddCountersAllEffect(CounterType.P1P1.createInstance(), new FilterControlledCreaturePermanent()), false)); + } + + public Borborygmos(final Borborygmos card) { + super(card); + } + + @Override + public Borborygmos copy() { + return new Borborygmos(this); + } +} diff --git a/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java b/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java index dded38dbd82..b4c5d10a83c 100644 --- a/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java +++ b/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java @@ -25,12 +25,13 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.guildpact; import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.constants.AbilityType; @@ -41,7 +42,7 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.stack.StackAbility; -import mage.target.TargetPlayer; +import mage.target.targetpointer.FixedTarget; /** * @@ -49,19 +50,20 @@ import mage.target.TargetPlayer; */ public class BurningTreeShaman extends CardImpl { - public BurningTreeShaman (UUID ownerId) { + public BurningTreeShaman(UUID ownerId) { super(ownerId, 105, "Burning-Tree Shaman", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{G}"); this.expansionSetCode = "GPT"; this.subtype.add("Centaur"); this.subtype.add("Shaman"); - this.power = new MageInt(3); this.toughness = new MageInt(4); + + // Whenever a player activates an ability that isn't a mana ability, Burning-Tree Shaman deals 1 damage to that player. this.addAbility(new BurningTreeShamanTriggeredAbility()); } - public BurningTreeShaman (final BurningTreeShaman card) { + public BurningTreeShaman(final BurningTreeShaman card) { super(card); } @@ -72,9 +74,9 @@ public class BurningTreeShaman extends CardImpl { } class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl { + BurningTreeShamanTriggeredAbility() { - super(Zone.BATTLEFIELD, new DamageTargetEffect(1)); - this.addTarget(new TargetPlayer()); + super(Zone.BATTLEFIELD, new DamageTargetEffect(new StaticValue(1), false, "that player", true)); } BurningTreeShamanTriggeredAbility(final BurningTreeShamanTriggeredAbility ability) { @@ -94,8 +96,10 @@ class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); - if (stackAbility.getAbilityType() == AbilityType.ACTIVATED) { - this.getTargets().get(0).add(event.getPlayerId(), game); + if (stackAbility != null && stackAbility.getAbilityType() == AbilityType.ACTIVATED) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); + } return true; } return false; @@ -105,4 +109,4 @@ class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl { public String getRule() { return "Whenever a player activates an ability that isn't a mana ability, {this} deals 1 damage to that player."; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/guildpact/GruulWarPlow.java b/Mage.Sets/src/mage/sets/guildpact/GruulWarPlow.java index 9b5b7d3e080..9a53f409a58 100644 --- a/Mage.Sets/src/mage/sets/guildpact/GruulWarPlow.java +++ b/Mage.Sets/src/mage/sets/guildpact/GruulWarPlow.java @@ -28,10 +28,6 @@ package mage.sets.guildpact; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; @@ -40,6 +36,9 @@ import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.permanent.token.Token; @@ -52,7 +51,11 @@ public class GruulWarPlow extends CardImpl { public GruulWarPlow(UUID ownerId) { super(ownerId, 151, "Gruul War Plow", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "GPT"; + + // Creatures you control have trample. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); + + // {1}{R}{G}: Gruul War Plow becomes a 4/4 Juggernaut artifact creature until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new GruulWarPlowToken(), "", Duration.EndOfTurn), new ManaCostsImpl("{1}{R}{G}"))); } @@ -67,6 +70,7 @@ public class GruulWarPlow extends CardImpl { } class GruulWarPlowToken extends Token { + GruulWarPlowToken() { super("Juggernaut", "4/4 Juggernaut artifact creature"); cardType.add(CardType.CREATURE); @@ -75,4 +79,4 @@ class GruulWarPlowToken extends Token { power = new MageInt(4); toughness = new MageInt(4); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/guildpact/MizziumTransreliquat.java b/Mage.Sets/src/mage/sets/guildpact/MizziumTransreliquat.java index c1c75827a9b..36802080cdc 100644 --- a/Mage.Sets/src/mage/sets/guildpact/MizziumTransreliquat.java +++ b/Mage.Sets/src/mage/sets/guildpact/MizziumTransreliquat.java @@ -57,7 +57,7 @@ public class MizziumTransreliquat extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MizziumTransreliquatCopyEffect(), new ManaCostsImpl("{3}")); ability.addTarget(new TargetArtifactPermanent()); this.addAbility(ability); - + // {1}{U}{R}: Mizzium Transreliquat becomes a copy of target artifact and gains this ability. ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MizziumTransreliquatCopyAndGainAbilityEffect(), new ManaCostsImpl("{1}{U}{R}")); ability.addTarget(new TargetArtifactPermanent()); @@ -74,12 +74,11 @@ public class MizziumTransreliquat extends CardImpl { } } - class MizziumTransreliquatCopyEffect extends OneShotEffect { public MizziumTransreliquatCopyEffect() { super(Outcome.Copy); - this.staticText = "Mizzium Transreliquat becomes a copy of target artifact until end of turn"; + this.staticText = "{this} becomes a copy of target artifact until end of turn"; } public MizziumTransreliquatCopyEffect(final MizziumTransreliquatCopyEffect effect) { @@ -96,17 +95,18 @@ class MizziumTransreliquatCopyEffect extends OneShotEffect { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Permanent copyFromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (sourcePermanent != null && copyFromPermanent != null) { - game.copyPermanent(Duration.EndOfTurn, copyFromPermanent, sourcePermanent, source, new EmptyApplyToPermanent()); + game.copyPermanent(Duration.EndOfTurn, copyFromPermanent, sourcePermanent.getId(), source, new EmptyApplyToPermanent()); return true; } return false; } } + class MizziumTransreliquatCopyAndGainAbilityEffect extends OneShotEffect { public MizziumTransreliquatCopyAndGainAbilityEffect() { super(Outcome.Benefit); - this.staticText = "Mizzium Transreliquat becomes a copy of target artifact and gains this ability"; + this.staticText = "{this} becomes a copy of target artifact and gains this ability"; } public MizziumTransreliquatCopyAndGainAbilityEffect(final MizziumTransreliquatCopyAndGainAbilityEffect effect) { @@ -123,7 +123,7 @@ class MizziumTransreliquatCopyAndGainAbilityEffect extends OneShotEffect { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); Permanent copyFromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (sourcePermanent != null && copyFromPermanent != null) { - Permanent newPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent, source, new EmptyApplyToPermanent()); + Permanent newPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent.getId(), source, new EmptyApplyToPermanent()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MizziumTransreliquatCopyAndGainAbilityEffect(), new ManaCostsImpl("{1}{U}{R}")); ability.addTarget(new TargetArtifactPermanent()); newPermanent.addAbility(ability, source.getSourceId(), game); @@ -131,4 +131,4 @@ class MizziumTransreliquatCopyAndGainAbilityEffect extends OneShotEffect { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/guildpact/RabbleRouser.java b/Mage.Sets/src/mage/sets/guildpact/RabbleRouser.java new file mode 100644 index 00000000000..fc935905f7c --- /dev/null +++ b/Mage.Sets/src/mage/sets/guildpact/RabbleRouser.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.guildpact; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.keyword.BloodthirstAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterAttackingCreature; + +/** + * + * @author BursegSardaukar + */ +public class RabbleRouser extends CardImpl { + + public RabbleRouser(UUID ownerId) { + super(ownerId, 73, "Rabble-Rouser", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "GPT"; + this.subtype.add("Goblin"); + this.subtype.add("Shaman"); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + //Bloodthirst 1 (If an opponent was dealt damage this turn, this creature enters the battlefield with a +1/+1 counter on it.) + this.addAbility(new BloodthirstAbility(1)); + + //{R}, {T}: Attacking creatures get +X/+0 until end of turn, where X is Rabble-Rouser's power. + DynamicValue amount = new SourcePermanentPowerCount(); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BoostAllEffect(amount, new StaticValue(0), Duration.EndOfTurn, new FilterAttackingCreature(), false, + "Attacking creatures get +X/+0 until end of turn, where X is {this}'s power"), + new ManaCostsImpl("{R}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public RabbleRouser(final RabbleRouser card) { + super(card); + } + + @Override + public RabbleRouser copy() { + return new RabbleRouser(this); + } +} diff --git a/Mage.Sets/src/mage/sets/guildpact/Schismotivate.java b/Mage.Sets/src/mage/sets/guildpact/Schismotivate.java new file mode 100644 index 00000000000..4a1b7ac9ecb --- /dev/null +++ b/Mage.Sets/src/mage/sets/guildpact/Schismotivate.java @@ -0,0 +1,97 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.guildpact; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Schismotivate extends CardImpl { + + public Schismotivate(UUID ownerId) { + super(ownerId, 129, "Schismotivate", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{R}"); + this.expansionSetCode = "GPT"; + + // Target creature gets +4/+0 until end of turn. Another target creature gets -4/-0 until end of turn. + this.getSpellAbility().addEffect(new SchismotivateEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2)); + } + + public Schismotivate(final Schismotivate card) { + super(card); + } + + @Override + public Schismotivate copy() { + return new Schismotivate(this); + } +} + +class SchismotivateEffect extends ContinuousEffectImpl { + + public SchismotivateEffect() { + super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); + this.staticText = "Target creature gets +4/+0 until end of turn. Another target creature gets -4/-0 until end of turn"; + } + + public SchismotivateEffect(final SchismotivateEffect effect) { + super(effect); + } + + @Override + public SchismotivateEffect copy() { + return new SchismotivateEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + permanent.addPower(4); + } + permanent = game.getPermanent(source.getTargets().get(0).getTargets().get(1)); + if (permanent != null) { + permanent.addPower(-4); + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/guildpact/StompingGround.java b/Mage.Sets/src/mage/sets/guildpact/StompingGround.java index 0bce0460177..85c8b2ce2d4 100644 --- a/Mage.Sets/src/mage/sets/guildpact/StompingGround.java +++ b/Mage.Sets/src/mage/sets/guildpact/StompingGround.java @@ -25,18 +25,17 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.guildpact; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.costs.common.PayLifeCost; import mage.abilities.effects.common.TapSourceUnlessPaysEffect; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -44,17 +43,19 @@ import mage.cards.CardImpl; */ public class StompingGround extends CardImpl { - public StompingGround (UUID ownerId) { + public StompingGround(UUID ownerId) { super(ownerId, 165, "Stomping Ground", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "GPT"; this.subtype.add("Mountain"); this.subtype.add("Forest"); + this.addAbility(new RedManaAbility()); this.addAbility(new GreenManaAbility()); - this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), "you may pay 2 life. If you don't, Stomping Ground enters the battlefield tapped")); + this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new PayLifeCost(2)), + "you may pay 2 life. If you don't, {this} enters the battlefield tapped")); } - public StompingGround (final StompingGround card) { + public StompingGround(final StompingGround card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/guildpact/StormHerd.java b/Mage.Sets/src/mage/sets/guildpact/StormHerd.java index 0e623afe8bf..82a2fe9002e 100644 --- a/Mage.Sets/src/mage/sets/guildpact/StormHerd.java +++ b/Mage.Sets/src/mage/sets/guildpact/StormHerd.java @@ -31,11 +31,10 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.dynamicvalue.common.ControllerLifeCount; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.PegasusToken; /** * @@ -60,16 +59,3 @@ public class StormHerd extends CardImpl { return new StormHerd(this); } } - -class PegasusToken extends Token { - - public PegasusToken() { - super("Pegasus", "1/1 white Pegasus creature tokens with flying"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Pegasus"); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(FlyingAbility.getInstance()); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/guildpact/Stratozeppelid.java b/Mage.Sets/src/mage/sets/guildpact/Stratozeppelid.java new file mode 100644 index 00000000000..7c860d29bb2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/guildpact/Stratozeppelid.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.guildpact; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Stratozeppelid extends CardImpl { + + public Stratozeppelid(UUID ownerId) { + super(ownerId, 36, "Stratozeppelid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "GPT"; + this.subtype.add("Beast"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Stratozeppelid can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + } + + public Stratozeppelid(final Stratozeppelid card) { + super(card); + } + + @Override + public Stratozeppelid copy() { + return new Stratozeppelid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/guildpact/Thunderheads.java b/Mage.Sets/src/mage/sets/guildpact/Thunderheads.java new file mode 100644 index 00000000000..4cca5654327 --- /dev/null +++ b/Mage.Sets/src/mage/sets/guildpact/Thunderheads.java @@ -0,0 +1,120 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.guildpact; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ReplicateAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.Token; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author nigelzor + */ +public class Thunderheads extends CardImpl { + + public Thunderheads(UUID ownerId) { + super(ownerId, 37, "Thunderheads", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); + this.expansionSetCode = "GPT"; + + // Replicate {2}{U} + this.addAbility(new ReplicateAbility(this, "{2}{U}")); + // Put a 3/3 blue Weird creature token with defender and flying onto the battlefield. Exile it at the beginning of the next end step. + this.getSpellAbility().addEffect(new ThunderheadsEffect()); + } + + public Thunderheads(final Thunderheads card) { + super(card); + } + + @Override + public Thunderheads copy() { + return new Thunderheads(this); + } +} + +class ThunderheadsEffect extends OneShotEffect { + + public ThunderheadsEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "Put a 3/3 blue Weird creature token with defender and flying onto the battlefield. Exile it at the beginning of the next end step."; + } + + public ThunderheadsEffect(ThunderheadsEffect effect) { + super(effect); + } + + @Override + public ThunderheadsEffect copy() { + return new ThunderheadsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Token token = new WeirdToken(); + if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source); + } + } + return true; + } + return false; + } +} + +class WeirdToken extends Token { + + WeirdToken() { + super("Weird", "3/3 blue Weird create token with defender and flying"); + cardType.add(CardType.CREATURE); + color.setBlue(true); + subtype.add("Weird"); + power = new MageInt(3); + toughness = new MageInt(3); + this.addAbility(DefenderAbility.getInstance()); + this.addAbility(FlyingAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/guildpact/TinStreetHooligan.java b/Mage.Sets/src/mage/sets/guildpact/TinStreetHooligan.java index bfa2c666645..7718c7e3f97 100644 --- a/Mage.Sets/src/mage/sets/guildpact/TinStreetHooligan.java +++ b/Mage.Sets/src/mage/sets/guildpact/TinStreetHooligan.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.ManaWasSpentCondition; -import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -57,9 +57,11 @@ public class TinStreetHooligan extends CardImpl { this.toughness = new MageInt(1); // When Tin Street Hooligan enters the battlefield, if {G} was spent to cast Tin Street Hooligan, destroy target artifact. - Ability ability = new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DestroyTargetEffect(), new ManaWasSpentCondition(ColoredManaSymbol.G), - "if {G} was spent to cast {this}, destroy target artifact"), false); - ability.addTarget(new TargetArtifactPermanent()); + Ability ability = new ConditionalTriggeredAbility( + new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()), + new ManaWasSpentCondition(ColoredManaSymbol.G), + "When {this} enters the battlefield, if {G} was spent to cast Tin Street Hooligan, destroy target artifact."); + ability.addTarget(new TargetArtifactPermanent()); this.addAbility(ability, new ManaSpentToCastWatcher()); } diff --git a/Mage.Sets/src/mage/sets/guildpact/UlashtTheHateSeed.java b/Mage.Sets/src/mage/sets/guildpact/UlashtTheHateSeed.java index 6d99f312a7e..7903fdc13dc 100644 --- a/Mage.Sets/src/mage/sets/guildpact/UlashtTheHateSeed.java +++ b/Mage.Sets/src/mage/sets/guildpact/UlashtTheHateSeed.java @@ -73,7 +73,7 @@ public class UlashtTheHateSeed extends CardImpl { // Ulasht, the Hate Seed enters the battlefield with a +1/+1 counter on it for each other red creature you control and a +1/+1 counter on it for each other green creature you control. this.addAbility(new EntersBattlefieldAbility(new UlashtTheHateSeedEffect(), "with a +1/+1 counter on it for each other red creature you control and a +1/+1 counter on it for each other green creature you control.")); - + // {1}, Remove a +1/+1 counter from Ulasht: Choose one - Ulasht deals 1 damage to target creature; Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new GenericManaCost(1)); ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance())); @@ -101,7 +101,7 @@ class UlashtTheHateSeedEffect extends OneShotEffect { private static final FilterControlledCreaturePermanent filterGreen = new FilterControlledCreaturePermanent(); private static final FilterControlledCreaturePermanent filterRed = new FilterControlledCreaturePermanent(); - + static { filterGreen.add(new AnotherPredicate()); filterGreen.add(new ColorPredicate(ObjectColor.GREEN)); @@ -121,7 +121,7 @@ class UlashtTheHateSeedEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (permanent != null && player != null) { int amount = game.getBattlefield().count(filterRed, source.getSourceId(), source.getControllerId(), game); amount += game.getBattlefield().count(filterGreen, source.getSourceId(), source.getControllerId(), game); @@ -138,4 +138,4 @@ class UlashtTheHateSeedEffect extends OneShotEffect { return new UlashtTheHateSeedEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/guildpact/WitchMawNephilim.java b/Mage.Sets/src/mage/sets/guildpact/WitchMawNephilim.java index 2624e57b7b1..c098f740a98 100644 --- a/Mage.Sets/src/mage/sets/guildpact/WitchMawNephilim.java +++ b/Mage.Sets/src/mage/sets/guildpact/WitchMawNephilim.java @@ -28,21 +28,22 @@ package mage.sets.guildpact; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.counters.CounterType; import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; - /** * @author Loki @@ -61,7 +62,7 @@ public class WitchMawNephilim extends CardImpl { this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), true)); // Whenever Witch-Maw Nephilim attacks, it gains trample until end of turn if its power is 10 or greater. - this.addAbility(new WitchMawNephilimTriggeredAbility()); + this.addAbility(new AttacksTriggeredAbility(new WitchMawNephilimEffect(), false)); } public WitchMawNephilim(final WitchMawNephilim card) { @@ -74,34 +75,31 @@ public class WitchMawNephilim extends CardImpl { } } -class WitchMawNephilimTriggeredAbility extends AttacksTriggeredAbility { - WitchMawNephilimTriggeredAbility() { - super(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), false); +class WitchMawNephilimEffect extends OneShotEffect { + + public WitchMawNephilimEffect() { + super(Outcome.AddAbility); + this.staticText = "it gains trample until end of turn if its power is 10 or greater"; } - WitchMawNephilimTriggeredAbility(final WitchMawNephilimTriggeredAbility ability) { - super(ability); + public WitchMawNephilimEffect(final WitchMawNephilimEffect effect) { + super(effect); } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (super.checkTrigger(event, game)) { - Permanent source = game.getPermanent(event.getSourceId()); - if (source.getPower().getValue() >= 10) { - return true; + public WitchMawNephilimEffect copy() { + return new WitchMawNephilimEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = source.getSourceObject(game); + if (sourceObject != null) { + if (sourceObject.getPower().getValue() >= 10) { + game.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), source); } + return true; } return false; } - - @Override - public AttacksTriggeredAbility copy() { - return new WitchMawNephilimTriggeredAbility(this); - } - - @Override - public String getRule() { - return "When {this} attacks, it gains trample until end of turn if its power is 10 or greater"; - } } - diff --git a/Mage.Sets/src/mage/sets/guildpact/WurmweaverCoil.java b/Mage.Sets/src/mage/sets/guildpact/WurmweaverCoil.java index da5e93aa789..afc106c50d5 100644 --- a/Mage.Sets/src/mage/sets/guildpact/WurmweaverCoil.java +++ b/Mage.Sets/src/mage/sets/guildpact/WurmweaverCoil.java @@ -28,8 +28,6 @@ package mage.sets.guildpact; import java.util.UUID; - -import mage.constants.*; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; @@ -42,9 +40,14 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.WurmToken; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -71,7 +74,7 @@ public class WurmweaverCoil extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(6, 6, Duration.WhileOnBattlefield))); - Ability activatedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new WurmweaverCoilToken(), 1), new ManaCostsImpl("{G}{G}{G}")); + Ability activatedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new WurmToken(), 1), new ManaCostsImpl("{G}{G}{G}")); activatedAbility.addCost(new SacrificeSourceCost()); this.addAbility(activatedAbility); } @@ -85,14 +88,3 @@ public class WurmweaverCoil extends CardImpl { return new WurmweaverCoil(this); } } - -class WurmweaverCoilToken extends Token { - WurmweaverCoilToken() { - super("Wurm", "6/6 green Wurm creature token"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Wurm"); - power = new MageInt(6); - toughness = new MageInt(6); - } -} \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopySource.java b/Mage.Sets/src/mage/sets/guildpact/YoreTillerNephilim.java similarity index 51% rename from Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopySource.java rename to Mage.Sets/src/mage/sets/guildpact/YoreTillerNephilim.java index 78ebf7f019c..9dae8433031 100644 --- a/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopySource.java +++ b/Mage.Sets/src/mage/sets/guildpact/YoreTillerNephilim.java @@ -1,94 +1,109 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ - -package mage.abilities.effects.common; - -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.constants.Outcome; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; -import mage.players.Player; -import mage.util.CardUtil; - -/** - * - * @author LevelX2 - */ - -public class PutTokenOntoBattlefieldCopySource extends OneShotEffect { - - public PutTokenOntoBattlefieldCopySource() { - super(Outcome.PutCreatureInPlay); - this.staticText = "put a token that's a copy of {this} onto the battlefield"; - } - - public PutTokenOntoBattlefieldCopySource(final PutTokenOntoBattlefieldCopySource effect) { - super(effect); - } - - @Override - public PutTokenOntoBattlefieldCopySource copy() { - return new PutTokenOntoBattlefieldCopySource(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - MageObject thisCard = game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - if (thisCard != null && thisCard instanceof Permanent) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from((Permanent)thisCard); - if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { - if (!game.isSimulation()) - game.informPlayers(new StringBuilder(controller.getLogName()) - .append(" puts a ").append(token.getName()).append(" token ").append("onto the Battlefield").toString()); - return true; - } - } else { // maybe it's token - Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (permanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { - if (!game.isSimulation()) - game.informPlayers(new StringBuilder(controller.getLogName()) - .append(" puts a ").append(token.getName()).append(" token ").append("onto the Battlefield").toString()); - return true; - } - } - } - } - return false; - } - -} \ No newline at end of file +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.guildpact; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author fireshoes + */ +public class YoreTillerNephilim extends CardImpl { + + public YoreTillerNephilim(UUID ownerId) { + super(ownerId, 140, "Yore-Tiller Nephilim", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{U}{B}{R}"); + this.expansionSetCode = "GPT"; + this.subtype.add("Nephilim"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Yore-Tiller Nephilim attacks, return target creature card from your graveyard to the battlefield tapped and attacking. + Ability ability = new AttacksTriggeredAbility(new YoreTillerNephilimEffect(), false); + ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); + this.addAbility(ability); + } + + public YoreTillerNephilim(final YoreTillerNephilim card) { + super(card); + } + + @Override + public YoreTillerNephilim copy() { + return new YoreTillerNephilim(this); + } +} + +class YoreTillerNephilimEffect extends OneShotEffect { + + public YoreTillerNephilimEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "return target creature card from your graveyard to the battlefield tapped and attacking"; + } + + public YoreTillerNephilimEffect(final YoreTillerNephilimEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + + if (controller != null) { + Card card = game.getCard(getTargetPointer().getFirst(game, source)); + if (card != null) { + if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId(), true)) { + Permanent permanent = game.getPermanent(card.getId()); + game.getCombat().addAttackingCreature(permanent.getId(), game); + } + } + return true; + + } + return false; + } + + @Override + public YoreTillerNephilimEffect copy() { + return new YoreTillerNephilimEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/heroesvsmonsters/OrcishLumberjack.java b/Mage.Sets/src/mage/sets/heroesvsmonsters/OrcishLumberjack.java index 93277aa22f2..3a06eafc05a 100644 --- a/Mage.Sets/src/mage/sets/heroesvsmonsters/OrcishLumberjack.java +++ b/Mage.Sets/src/mage/sets/heroesvsmonsters/OrcishLumberjack.java @@ -123,10 +123,10 @@ class OrcishLumberjackManaEffect extends ManaEffect { } switch (manaChoice.getChoice()) { case "Green": - mana.addGreen(); + mana.increaseGreen(); break; case "Red": - mana.addRed(); + mana.increaseRed(); break; } diff --git a/Mage.Sets/src/mage/sets/homelands/AlibansTower1.java b/Mage.Sets/src/mage/sets/homelands/AlibansTower1.java new file mode 100644 index 00000000000..50f072111e9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/AlibansTower1.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterBlockingCreature; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class AlibansTower1 extends CardImpl { + + public AlibansTower1(UUID ownerId) { + super(ownerId, 76, "Aliban's Tower", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "HML"; + + // Target blocking creature gets +3/+1 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(3, 1, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterBlockingCreature())); + } + + public AlibansTower1(final AlibansTower1 card) { + super(card); + } + + @Override + public AlibansTower1 copy() { + return new AlibansTower1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/AlibansTower2.java b/Mage.Sets/src/mage/sets/homelands/AlibansTower2.java new file mode 100644 index 00000000000..f9841cce182 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/AlibansTower2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class AlibansTower2 extends AlibansTower1 { + + public AlibansTower2(UUID ownerId) { + super(ownerId); + this.cardNumber = 77; + } + + public AlibansTower2(final AlibansTower2 card) { + super(card); + } + + @Override + public AlibansTower2 copy() { + return new AlibansTower2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/AysenBureaucrats1.java b/Mage.Sets/src/mage/sets/homelands/AysenBureaucrats1.java new file mode 100644 index 00000000000..41ecb5594d4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/AysenBureaucrats1.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AysenBureaucrats1 extends mage.sets.masterseditionii.AysenBureaucrats { + + public AysenBureaucrats1(UUID ownerId) { + super(ownerId); + this.cardNumber = 104; + this.expansionSetCode = "HML"; + } + + public AysenBureaucrats1(final AysenBureaucrats1 card) { + super(card); + } + + @Override + public AysenBureaucrats1 copy() { + return new AysenBureaucrats1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/AysenBureaucrats2.java b/Mage.Sets/src/mage/sets/homelands/AysenBureaucrats2.java new file mode 100644 index 00000000000..001037563db --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/AysenBureaucrats2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AysenBureaucrats2 extends mage.sets.masterseditionii.AysenBureaucrats { + + public AysenBureaucrats2(UUID ownerId) { + super(ownerId); + this.cardNumber = 105; + this.expansionSetCode = "HML"; + } + + public AysenBureaucrats2(final AysenBureaucrats2 card) { + super(card); + } + + @Override + public AysenBureaucrats2 copy() { + return new AysenBureaucrats2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/AysenHighway.java b/Mage.Sets/src/mage/sets/homelands/AysenHighway.java new file mode 100644 index 00000000000..6076d9727f7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/AysenHighway.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.PlainswalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author fireshoes + */ +public class AysenHighway extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public AysenHighway(UUID ownerId) { + super(ownerId, 107, "Aysen Highway", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{W}{W}"); + this.expansionSetCode = "HML"; + + // White creatures have plainswalk. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new GainAbilityAllEffect(new PlainswalkAbility(false), Duration.WhileOnBattlefield, filter))); + } + + public AysenHighway(final AysenHighway card) { + super(card); + } + + @Override + public AysenHighway copy() { + return new AysenHighway(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/Chandler.java b/Mage.Sets/src/mage/sets/homelands/Chandler.java new file mode 100644 index 00000000000..a14bed9ddb5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/Chandler.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Chandler extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + + public Chandler(UUID ownerId) { + super(ownerId, 88, "Chandler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "HML"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Rogue"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {R}{R}{R}, {tap}: Destroy target artifact creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{R}{R}{R}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public Chandler(final Chandler card) { + super(card); + } + + @Override + public Chandler copy() { + return new Chandler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/ClockworkGnomes.java b/Mage.Sets/src/mage/sets/homelands/ClockworkGnomes.java new file mode 100644 index 00000000000..d46a6c006b4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/ClockworkGnomes.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author hanasu + */ +public class ClockworkGnomes extends mage.sets.masterseditioniv.ClockworkGnomes { + + public ClockworkGnomes(UUID ownerId) { + super(ownerId); + this.cardNumber = 127; + this.expansionSetCode = "HML"; + this.rarity = Rarity.COMMON; + } + + public ClockworkGnomes(final ClockworkGnomes card) { + super(card); + } + + @Override + public ClockworkGnomes copy() { + return new ClockworkGnomes(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/DarkMaze1.java b/Mage.Sets/src/mage/sets/homelands/DarkMaze1.java new file mode 100644 index 00000000000..82d0978872a --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/DarkMaze1.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DarkMaze1 extends mage.sets.fifthedition.DarkMaze { + + public DarkMaze1(UUID ownerId) { + super(ownerId); + this.cardNumber = 31; + this.expansionSetCode = "HML"; + } + + public DarkMaze1(final DarkMaze1 card) { + super(card); + } + + @Override + public DarkMaze1 copy() { + return new DarkMaze1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/DarkMaze2.java b/Mage.Sets/src/mage/sets/homelands/DarkMaze2.java new file mode 100644 index 00000000000..5d5cce4955d --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/DarkMaze2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DarkMaze2 extends mage.sets.fifthedition.DarkMaze { + + public DarkMaze2(UUID ownerId) { + super(ownerId); + this.cardNumber = 31; + this.expansionSetCode = "HML"; + } + + public DarkMaze2(final DarkMaze2 card) { + super(card); + } + + @Override + public DarkMaze2 copy() { + return new DarkMaze2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/DeathSpeakers.java b/Mage.Sets/src/mage/sets/homelands/DeathSpeakers.java new file mode 100644 index 00000000000..4d5cb00eb13 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/DeathSpeakers.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class DeathSpeakers extends CardImpl { + + private static final FilterCard filter = new FilterCard("black"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public DeathSpeakers(UUID ownerId) { + super(ownerId, 109, "Death Speakers", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "HML"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Protection from black + this.addAbility(new ProtectionAbility(filter)); + } + + public DeathSpeakers(final DeathSpeakers card) { + super(card); + } + + @Override + public DeathSpeakers copy() { + return new DeathSpeakers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/DwarvenPony.java b/Mage.Sets/src/mage/sets/homelands/DwarvenPony.java new file mode 100644 index 00000000000..9c93806273e --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/DwarvenPony.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class DwarvenPony extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Dwarf creature"); + + static { + filter.add(new SubtypePredicate("Dwarf")); + } + + public DwarvenPony(UUID ownerId) { + super(ownerId, 89, "Dwarven Pony", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "HML"; + this.subtype.add("Horse"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{R}, {tap}: Target Dwarf creature gains mountainwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new MountainwalkAbility(false), Duration.EndOfTurn), new ManaCostsImpl("{1}{R}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public DwarvenPony(final DwarvenPony card) { + super(card); + } + + @Override + public DwarvenPony copy() { + return new DwarvenPony(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva1.java b/Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva1.java new file mode 100644 index 00000000000..22ad5c2d3e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva1.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FolkOfAnHavva1 extends CardImpl { + + public FolkOfAnHavva1(UUID ownerId) { + super(ownerId, 58, "Folk of An-Havva", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "HML"; + this.subtype.add("Human"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Folk of An-Havva blocks, it gets +2/+0 until end of turn. + this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn), false)); + } + + public FolkOfAnHavva1(final FolkOfAnHavva1 card) { + super(card); + } + + @Override + public FolkOfAnHavva1 copy() { + return new FolkOfAnHavva1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva2.java b/Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva2.java new file mode 100644 index 00000000000..f28dbedca24 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/FolkOfAnHavva2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class FolkOfAnHavva2 extends FolkOfAnHavva1 { + + public FolkOfAnHavva2(UUID ownerId) { + super(ownerId); + this.cardNumber = 59; + } + + public FolkOfAnHavva2(final FolkOfAnHavva2 card) { + super(card); + } + + @Override + public FolkOfAnHavva2 copy() { + return new FolkOfAnHavva2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/GrandmotherSengir.java b/Mage.Sets/src/mage/sets/homelands/GrandmotherSengir.java new file mode 100644 index 00000000000..a1b27a00df1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/GrandmotherSengir.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; + +/** + * + * @author hanasu + */ +public class GrandmotherSengir extends mage.sets.masterseditionii.GrandmotherSengir { + + public GrandmotherSengir(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "HML"; + } + + public GrandmotherSengir(final GrandmotherSengir card) { + super(card); + } + + @Override + public GrandmotherSengir copy() { + return new GrandmotherSengir(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/Headstone.java b/Mage.Sets/src/mage/sets/homelands/Headstone.java new file mode 100644 index 00000000000..789598ae7ac --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/Headstone.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCardInGraveyard; + +/** + * + * @author fireshoes + */ +public class Headstone extends CardImpl { + + public Headstone(UUID ownerId) { + super(ownerId, 15, "Headstone", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{B}"); + this.expansionSetCode = "HML"; + + // Exile target card from a graveyard. + this.getSpellAbility().addEffect(new ExileTargetEffect()); + this.getSpellAbility().addTarget(new TargetCardInGraveyard()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public Headstone(final Headstone card) { + super(card); + } + + @Override + public Headstone copy() { + return new Headstone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/HungryMist1.java b/Mage.Sets/src/mage/sets/homelands/HungryMist1.java new file mode 100644 index 00000000000..30f25a102ed --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/HungryMist1.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class HungryMist1 extends mage.sets.fifthedition.HungryMist { + + public HungryMist1(UUID ownerId) { + super(ownerId); + this.cardNumber = 60; + this.expansionSetCode = "HML"; + } + + public HungryMist1(final HungryMist1 card) { + super(card); + } + + @Override + public HungryMist1 copy() { + return new HungryMist1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/HungryMist2.java b/Mage.Sets/src/mage/sets/homelands/HungryMist2.java new file mode 100644 index 00000000000..05db8e60084 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/HungryMist2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class HungryMist2 extends mage.sets.fifthedition.HungryMist { + + public HungryMist2(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "HML"; + } + + public HungryMist2(final HungryMist2 card) { + super(card); + } + + @Override + public HungryMist2 copy() { + return new HungryMist2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/Jinx.java b/Mage.Sets/src/mage/sets/homelands/Jinx.java new file mode 100644 index 00000000000..7cadd458908 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/Jinx.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author fireshoes + */ +public class Jinx extends CardImpl { + + public Jinx(UUID ownerId) { + super(ownerId, 36, "Jinx", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "HML"; + + // Target land becomes the basic land type of your choice until end of turn. + this.getSpellAbility().addEffect(new BecomesBasicLandTargetEffect(Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public Jinx(final Jinx card) { + super(card); + } + + @Override + public Jinx copy() { + return new Jinx(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/LeapingLizard.java b/Mage.Sets/src/mage/sets/homelands/LeapingLizard.java new file mode 100644 index 00000000000..a702e236f7a --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/LeapingLizard.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class LeapingLizard extends CardImpl { + + public LeapingLizard(UUID ownerId) { + super(ownerId, 63, "Leaping Lizard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "HML"; + this.subtype.add("Lizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {1}{G}: Leaping Lizard gets -0/-1 and gains flying until end of turn. + Effect effect = new BoostSourceEffect(0, -1, Duration.EndOfTurn); + effect.setText("{this} gets -0/-1"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{G}")); + effect = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains flying until end of turn"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public LeapingLizard(final LeapingLizard card) { + super(card); + } + + @Override + public LeapingLizard copy() { + return new LeapingLizard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/MysticDecree.java b/Mage.Sets/src/mage/sets/homelands/MysticDecree.java new file mode 100644 index 00000000000..a4fb82b1e24 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/MysticDecree.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.LoseAbilityAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.IslandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class MysticDecree extends CardImpl { + + public MysticDecree(UUID ownerId) { + super(ownerId, 43, "Mystic Decree", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}"); + this.expansionSetCode = "HML"; + this.supertype.add("World"); + + // All creatures lose flying and islandwalk. + Effect effect = new LoseAbilityAllEffect(new FilterCreaturePermanent("All creatures"), FlyingAbility.getInstance(), Duration.WhileOnBattlefield); + effect.setText("All creatures lose flying"); + Effect effect2 = new LoseAbilityAllEffect(new FilterCreaturePermanent("all creatures"), new IslandwalkAbility(), Duration.WhileOnBattlefield); + effect2.setText("and islandwalk"); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); + ability.addEffect(effect2); + this.addAbility(ability); + } + + public MysticDecree(final MysticDecree card) { + super(card); + } + + @Override + public MysticDecree copy() { + return new MysticDecree(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/Narwhal.java b/Mage.Sets/src/mage/sets/homelands/Narwhal.java new file mode 100644 index 00000000000..0d1e5e3ffcb --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/Narwhal.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class Narwhal extends CardImpl { + + private static final FilterCard filter = new FilterCard("red"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public Narwhal(UUID ownerId) { + super(ownerId, 44, "Narwhal", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "HML"; + this.subtype.add("Whale"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // protection from red + this.addAbility(new ProtectionAbility(filter)); + } + + public Narwhal(final Narwhal card) { + super(card); + } + + @Override + public Narwhal copy() { + return new Narwhal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/ReefPirates1.java b/Mage.Sets/src/mage/sets/homelands/ReefPirates1.java new file mode 100644 index 00000000000..2414edbb0aa --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/ReefPirates1.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ReefPirates1 extends CardImpl { + + public ReefPirates1(UUID ownerId) { + super(ownerId, 45, "Reef Pirates", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "HML"; + this.subtype.add("Zombie"); + this.subtype.add("Pirate"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Reef Pirates deals damage to an opponent, that player puts the top card of his or her library into his or her graveyard. + Effect effect = new PutLibraryIntoGraveTargetEffect(1); + effect.setText("that player puts the top card of his or her library into his or her graveyard"); + this.addAbility(new DealsDamageToAPlayerTriggeredAbility(effect, false, true)); + } + + public ReefPirates1(final ReefPirates1 card) { + super(card); + } + + @Override + public ReefPirates1 copy() { + return new ReefPirates1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/ReefPirates2.java b/Mage.Sets/src/mage/sets/homelands/ReefPirates2.java new file mode 100644 index 00000000000..d7e484c14cc --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/ReefPirates2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ReefPirates2 extends ReefPirates1 { + + public ReefPirates2(UUID ownerId) { + super(ownerId); + this.cardNumber = 46; + } + + public ReefPirates2(final ReefPirates2 card) { + super(card); + } + + @Override + public ReefPirates2 copy() { + return new ReefPirates2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/RevekaWizardSavant.java b/Mage.Sets/src/mage/sets/homelands/RevekaWizardSavant.java new file mode 100644 index 00000000000..8a878245f28 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/RevekaWizardSavant.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author hanasu + */ +public class RevekaWizardSavant extends mage.sets.masterseditioniii.RevekaWizardSavant { + + public RevekaWizardSavant(UUID ownerId) { + super(ownerId); + this.cardNumber = 47; + this.expansionSetCode = "HML"; + this.rarity = Rarity.RARE; + } + + public RevekaWizardSavant(final RevekaWizardSavant card) { + super(card); + } + + @Override + public RevekaWizardSavant copy() { + return new RevekaWizardSavant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/Roots.java b/Mage.Sets/src/mage/sets/homelands/Roots.java new file mode 100644 index 00000000000..def12039078 --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/Roots.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect; +import mage.abilities.effects.common.TapEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Roots extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature without flying"); + + static { + filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + + public Roots(UUID ownerId) { + super(ownerId, 68, "Roots", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}"); + this.expansionSetCode = "HML"; + this.subtype.add("Aura"); + + // Enchant creature without flying + TargetPermanent auraTarget = new TargetCreaturePermanent(filter); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + + // When Roots enters the battlefield, tap enchanted creature. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TapEnchantedEffect())); + + // Enchanted creature doesn't untap during its controller's untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect())); + } + + public Roots(final Roots card) { + super(card); + } + + @Override + public Roots copy() { + return new Roots(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/Roterothopter.java b/Mage.Sets/src/mage/sets/homelands/Roterothopter.java new file mode 100644 index 00000000000..40fabe57d8d --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/Roterothopter.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class Roterothopter extends CardImpl { + + public Roterothopter(UUID ownerId) { + super(ownerId, 134, "Roterothopter", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}"); + this.expansionSetCode = "HML"; + this.subtype.add("Thopter"); + this.power = new MageInt(0); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {2}: Roterothopter gets +1/+0 until end of turn. Activate this ability no more than twice each turn. + this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{2}"), 2)); + } + + public Roterothopter(final Roterothopter card) { + super(card); + } + + @Override + public Roterothopter copy() { + return new Roterothopter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/SeaSprite.java b/Mage.Sets/src/mage/sets/homelands/SeaSprite.java new file mode 100644 index 00000000000..e69411816ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/SeaSprite.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class SeaSprite extends CardImpl { + + private static final FilterCard filter = new FilterCard("red"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public SeaSprite(UUID ownerId) { + super(ownerId, 48, "Sea Sprite", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "HML"; + this.subtype.add("Faerie"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // protection from red + this.addAbility(new ProtectionAbility(filter)); + } + + public SeaSprite(final SeaSprite card) { + super(card); + } + + @Override + public SeaSprite copy() { + return new SeaSprite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/SerratedArrows.java b/Mage.Sets/src/mage/sets/homelands/SerratedArrows.java index be8f776102a..07d6551edd7 100644 --- a/Mage.Sets/src/mage/sets/homelands/SerratedArrows.java +++ b/Mage.Sets/src/mage/sets/homelands/SerratedArrows.java @@ -59,7 +59,7 @@ public class SerratedArrows extends CardImpl { this.expansionSetCode = "HML"; // Serrated Arrows enters the battlefield with three arrowhead counters on it. - Effect effect = new AddCountersSourceEffect(CounterType.ARROWHEAD.createInstance(4)); + Effect effect = new AddCountersSourceEffect(CounterType.ARROWHEAD.createInstance(3)); effect.setText("with three arrowhead counters on it"); this.addAbility(new EntersBattlefieldAbility(effect)); // At the beginning of your upkeep, if there are no arrowhead counters on Serrated Arrows, sacrifice it. @@ -67,7 +67,7 @@ public class SerratedArrows extends CardImpl { "if there are no arrowhead counters on {this}, sacrifice it"); this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.YOU, false, false)); // {tap}, Remove an arrowhead counter from Serrated Arrows: Put a -1/-1 counter on target creature. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.M1M1.createInstance()), new TapSourceCost()); ability.addCost(new RemoveCountersSourceCost(CounterType.ARROWHEAD.createInstance())); diff --git a/Mage.Sets/src/mage/sets/homelands/VeldraneOfSengir.java b/Mage.Sets/src/mage/sets/homelands/VeldraneOfSengir.java new file mode 100644 index 00000000000..44cd78ecf5e --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/VeldraneOfSengir.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.homelands; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class VeldraneOfSengir extends CardImpl { + + public VeldraneOfSengir(UUID ownerId) { + super(ownerId, 25, "Veldrane of Sengir", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); + this.expansionSetCode = "HML"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Rogue"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // {1}{B}{B}: Veldrane of Sengir gets -3/-0 and gains forestwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-3, -0, Duration.EndOfTurn), new ManaCostsImpl("{1}{B}{B}")); + ability.addEffect(new GainAbilitySourceEffect(new ForestwalkAbility(false), Duration.EndOfTurn)); + this.addAbility(ability); + } + + public VeldraneOfSengir(final VeldraneOfSengir card) { + super(card); + } + + @Override + public VeldraneOfSengir copy() { + return new VeldraneOfSengir(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/AegisOfTheMeek.java b/Mage.Sets/src/mage/sets/iceage/AegisOfTheMeek.java new file mode 100644 index 00000000000..e6173c3bda6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/AegisOfTheMeek.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.filter.predicate.mageobject.ToughnessPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Leathios + */ +public class AegisOfTheMeek extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("1/1 creature"); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.Equal, 1)); + filter.add(new ToughnessPredicate(Filter.ComparisonType.Equal, 1)); + } + + public AegisOfTheMeek(UUID ownerId) { + super(ownerId, 282, "Aegis of the Meek", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "ICE"; + + // {1}, {T}: Target 1/1 creature gets +1/+2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, 2, Duration.EndOfTurn), new ManaCostsImpl("{1}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public AegisOfTheMeek(final AegisOfTheMeek card) { + super(card); + } + + @Override + public AegisOfTheMeek copy() { + return new AegisOfTheMeek(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/AltarOfBone.java b/Mage.Sets/src/mage/sets/iceage/AltarOfBone.java index f707874f338..f752381fbe2 100644 --- a/Mage.Sets/src/mage/sets/iceage/AltarOfBone.java +++ b/Mage.Sets/src/mage/sets/iceage/AltarOfBone.java @@ -51,7 +51,7 @@ public class AltarOfBone extends CardImpl { // As an additional cost to cast Altar of Bone, sacrifice a creature. this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); // Search your library for a creature card, reveal that card, and put it into your hand. Then shuffle your library. - this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard()))); + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard()), true)); } public AltarOfBone(final AltarOfBone card) { diff --git a/Mage.Sets/src/mage/sets/iceage/ArmorOfFaith.java b/Mage.Sets/src/mage/sets/iceage/ArmorOfFaith.java new file mode 100644 index 00000000000..5c6edff8436 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/ArmorOfFaith.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ArmorOfFaith extends mage.sets.masterseditionii.ArmorOfFaith { + + public ArmorOfFaith(UUID ownerId) { + super(ownerId); + this.cardNumber = 228; + this.expansionSetCode = "ICE"; + } + + public ArmorOfFaith(final ArmorOfFaith card) { + super(card); + } + + @Override + public ArmorOfFaith copy() { + return new ArmorOfFaith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/ArnjlotsAscent.java b/Mage.Sets/src/mage/sets/iceage/ArnjlotsAscent.java new file mode 100644 index 00000000000..91dbff9f70f --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/ArnjlotsAscent.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ArnjlotsAscent extends CardImpl { + + public ArnjlotsAscent(UUID ownerId) { + super(ownerId, 57, "Arnjlot's Ascent", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}"); + this.expansionSetCode = "ICE"; + + // Cumulative upkeep {U} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{U}"))); + // {1}: Target creature gains flying until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(FlyingAbility.getInstance(), + Duration.EndOfTurn), new ManaCostsImpl("{1}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ArnjlotsAscent(final ArnjlotsAscent card) { + super(card); + } + + @Override + public ArnjlotsAscent copy() { + return new ArnjlotsAscent(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Aurochs.java b/Mage.Sets/src/mage/sets/iceage/Aurochs.java new file mode 100644 index 00000000000..109a175ff29 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Aurochs.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author anonymous + */ +public class Aurochs extends CardImpl { + + private static final FilterAttackingCreature filter1 = new FilterAttackingCreature("other attacking Aurochs"); + + static { + filter1.add(new SubtypePredicate("Aurochs")); + filter1.add(new AnotherPredicate()); + } + + public Aurochs(UUID ownerId) { + super(ownerId, 113, "Aurochs", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Aurochs"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Whenever Aurochs attacks, it gets +1/+0 until end of turn for each other attacking Aurochs. + PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter1, 1); + this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(value, new StaticValue(0), Duration.EndOfTurn, true), false)); + } + + public Aurochs(final Aurochs card) { + super(card); + } + + @Override + public Aurochs copy() { + return new Aurochs(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/BattleFrenzy.java b/Mage.Sets/src/mage/sets/iceage/BattleFrenzy.java new file mode 100644 index 00000000000..68353e85085 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/BattleFrenzy.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class BattleFrenzy extends CardImpl { + + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("green creatures"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("nongreen creatures"); + + static { + filter1.add(new ColorPredicate(ObjectColor.GREEN)); + filter2.add(Predicates.not(new ColorPredicate(ObjectColor.GREEN))); + } + + + public BattleFrenzy(UUID ownerId) { + super(ownerId, 175, "Battle Frenzy", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); + this.expansionSetCode = "ICE"; + + // Green creatures you control get +1/+1 until end of turn. + this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, filter1)); + // Nongreen creatures you control get +1/+0 until end of turn. + this.getSpellAbility().addEffect(new BoostControlledEffect(1, 0, Duration.EndOfTurn, filter2)); + } + + public BattleFrenzy(final BattleFrenzy card) { + super(card); + } + + @Override + public BattleFrenzy copy() { + return new BattleFrenzy(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/BindingGrasp.java b/Mage.Sets/src/mage/sets/iceage/BindingGrasp.java new file mode 100644 index 00000000000..0188474a59b --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/BindingGrasp.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class BindingGrasp extends mage.sets.masterseditionii.BindingGrasp { + + public BindingGrasp(UUID ownerId) { + super(ownerId); + this.cardNumber = 60; + this.expansionSetCode = "ICE"; + this.rarity = Rarity.UNCOMMON; + } + + public BindingGrasp(final BindingGrasp card) { + super(card); + } + + @Override + public BindingGrasp copy() { + return new BindingGrasp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/BlessedWine.java b/Mage.Sets/src/mage/sets/iceage/BlessedWine.java new file mode 100644 index 00000000000..106007dcc35 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/BlessedWine.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BlessedWine extends mage.sets.fifthedition.BlessedWine { + + public BlessedWine(UUID ownerId) { + super(ownerId); + this.cardNumber = 231; + this.expansionSetCode = "ICE"; + } + + public BlessedWine(final BlessedWine card) { + super(card); + } + + @Override + public BlessedWine copy() { + return new BlessedWine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/CaribouRange.java b/Mage.Sets/src/mage/sets/iceage/CaribouRange.java new file mode 100644 index 00000000000..e9452f4c5f7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/CaribouRange.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CaribouRange extends mage.sets.fifthedition.CaribouRange { + + public CaribouRange(UUID ownerId) { + super(ownerId); + this.cardNumber = 235; + this.expansionSetCode = "ICE"; + } + + public CaribouRange(final CaribouRange card) { + super(card); + } + + @Override + public CaribouRange copy() { + return new CaribouRange(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Clairvoyance.java b/Mage.Sets/src/mage/sets/iceage/Clairvoyance.java new file mode 100644 index 00000000000..c5cf6f7d4e7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Clairvoyance.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LookAtTargetPlayerHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class Clairvoyance extends CardImpl { + + public Clairvoyance(UUID ownerId) { + super(ownerId, 63, "Clairvoyance", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "ICE"; + + // Look at target player's hand. + this.getSpellAbility().addEffect(new LookAtTargetPlayerHandEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public Clairvoyance(final Clairvoyance card) { + super(card); + } + + @Override + public Clairvoyance copy() { + return new Clairvoyance(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/CurseOfMaritLage.java b/Mage.Sets/src/mage/sets/iceage/CurseOfMaritLage.java new file mode 100644 index 00000000000..4306cce6ccb --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/CurseOfMaritLage.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; +import mage.abilities.effects.common.TapAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author fireshoes + */ +public class CurseOfMaritLage extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Islands"); + + static { + filter.add(new SubtypePredicate("Island")); + } + + public CurseOfMaritLage(UUID ownerId) { + super(ownerId, 181, "Curse of Marit Lage", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}"); + this.expansionSetCode = "ICE"; + + // When Curse of Marit Lage enters the battlefield, tap all Islands. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TapAllEffect(filter))); + + // Islands don't untap during their controllers' untap steps. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, filter))); + } + + public CurseOfMaritLage(final CurseOfMaritLage card) { + super(card); + } + + @Override + public CurseOfMaritLage copy() { + return new CurseOfMaritLage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java b/Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java index 5f308525d87..126046c1d68 100644 --- a/Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java +++ b/Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java @@ -78,13 +78,12 @@ public class DanceOfTheDead extends CardImpl { this.expansionSetCode = "ICE"; this.subtype.add("Aura"); - // Enchant creature card in a graveyard TargetCardInGraveyard auraTarget = new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard")); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new DanceOfTheDeadAttachEffect(Outcome.PutCreatureInPlay)); Ability enchantAbility = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(enchantAbility); + this.addAbility(enchantAbility); // When Dance of the Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" and gains "enchant creature put onto the battlefield with Dance of the Dead." Put enchanted creature card to the battlefield tapped under your control and attach Dance of the Dead to it. When Dance of the Dead leaves the battlefield, that creature's controller sacrifices it. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new DanceOfTheDeadReAttachEffect(), false), @@ -92,18 +91,18 @@ public class DanceOfTheDead extends CardImpl { "When {this} enters the battlefield, if it's on the battlefield, it loses \"enchant creature card in a graveyard\" and gains \"enchant creature put onto the battlefield with {this}.\" Return enchanted creature card to the battlefield under your control and attach {this} to it."); ability.addEffect(new DanceOfTheDeadChangeAbilityEffect()); this.addAbility(ability); - this.addAbility(new LeavesBattlefieldTriggeredAbility(new DanceOfTheDeadLeavesBattlefieldTriggeredEffect(), false)); - + this.addAbility(new LeavesBattlefieldTriggeredAbility(new DanceOfTheDeadLeavesBattlefieldTriggeredEffect(), false)); + // Enchanted creature gets +1/+1 and doesn't untap during its controller's untap step. ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)); Effect effect = new DontUntapInControllersUntapStepEnchantedEffect(); effect.setText("and doesn't untap during its controller's untap step"); ability.addEffect(effect); this.addAbility(ability); - + // At the beginning of the upkeep of enchanted creature's controller, that player may pay {1}{B}. If he or she does, untap that creature. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new DanceOfTheDeadDoIfCostPaidEffect(), TargetController.CONTROLLER_ATTACHED_TO, false)); - + } public DanceOfTheDead(final DanceOfTheDead card) { @@ -117,36 +116,36 @@ public class DanceOfTheDead extends CardImpl { } class DanceOfTheDeadReAttachEffect extends OneShotEffect { - + public DanceOfTheDeadReAttachEffect() { super(Outcome.Benefit); this.staticText = "Return enchanted creature card to the battlefield under your control and attach {this} to it"; } - + public DanceOfTheDeadReAttachEffect(final DanceOfTheDeadReAttachEffect effect) { super(effect); } - + @Override public DanceOfTheDeadReAttachEffect copy() { return new DanceOfTheDeadReAttachEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent enchantment = game.getPermanent(source.getSourceId()); - + if (controller != null && enchantment != null) { Card cardInGraveyard = game.getCard(enchantment.getAttachedTo()); if (cardInGraveyard == null) { return true; } - + // put card into play - controller.putOntoBattlefieldWithInfo(cardInGraveyard, game, Zone.GRAVEYARD, source.getSourceId(), true); + controller.moveCards(cardInGraveyard, Zone.BATTLEFIELD, source, game, true, false, false, null); Permanent enchantedCreature = game.getPermanent(cardInGraveyard.getId()); - + FilterCreaturePermanent filter = new FilterCreaturePermanent("enchant creature put onto the battlefield with Dance of the Dead"); filter.add(new PermanentIdPredicate(cardInGraveyard.getId())); Target target = new TargetCreaturePermanent(filter); @@ -159,27 +158,27 @@ class DanceOfTheDeadReAttachEffect extends OneShotEffect { } return true; } - + return false; } } - + class DanceOfTheDeadLeavesBattlefieldTriggeredEffect extends OneShotEffect { - + public DanceOfTheDeadLeavesBattlefieldTriggeredEffect() { super(Outcome.Benefit); this.staticText = "enchanted creature's controller sacrifices it"; } - + public DanceOfTheDeadLeavesBattlefieldTriggeredEffect(final DanceOfTheDeadLeavesBattlefieldTriggeredEffect effect) { super(effect); } - + @Override public DanceOfTheDeadLeavesBattlefieldTriggeredEffect copy() { return new DanceOfTheDeadLeavesBattlefieldTriggeredEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); @@ -236,17 +235,16 @@ class DanceOfTheDeadAttachEffect extends OneShotEffect { class DanceOfTheDeadChangeAbilityEffect extends ContinuousEffectImpl implements SourceEffect { private final static Ability newAbility = new EnchantAbility("creature put onto the battlefield with Dance of the Dead"); - + static { newAbility.setRuleAtTheTop(true); } - + public DanceOfTheDeadChangeAbilityEffect() { super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); staticText = "it loses \"enchant creature card in a graveyard\" and gains \"enchant creature put onto the battlefield with Dance of the Dead\""; } - public DanceOfTheDeadChangeAbilityEffect(final DanceOfTheDeadChangeAbilityEffect effect) { super(effect); } @@ -255,7 +253,7 @@ class DanceOfTheDeadChangeAbilityEffect extends ContinuousEffectImpl implements public DanceOfTheDeadChangeAbilityEffect copy() { return new DanceOfTheDeadChangeAbilityEffect(this); } - + @Override public void init(Ability source, Game game) { super.init(source, game); @@ -267,7 +265,7 @@ class DanceOfTheDeadChangeAbilityEffect extends ContinuousEffectImpl implements Permanent permanent = affectedObjectList.get(0).getPermanent(game);; if (permanent != null) { Ability abilityToRemove = null; - for (Ability ability: permanent.getAbilities()) { + for (Ability ability : permanent.getAbilities()) { if (ability instanceof EnchantAbility) { abilityToRemove = ability; } @@ -277,7 +275,7 @@ class DanceOfTheDeadChangeAbilityEffect extends ContinuousEffectImpl implements } permanent.addAbility(newAbility, source.getSourceId(), game); return true; - } + } return false; } } @@ -309,4 +307,4 @@ class DanceOfTheDeadDoIfCostPaidEffect extends DoIfCostPaid { return new StringBuilder("that player may ").append(getCostText()) .append(". If he or she does, ").append(executingEffects.getText(mode)).toString(); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/iceage/DespoticScepter.java b/Mage.Sets/src/mage/sets/iceage/DespoticScepter.java new file mode 100644 index 00000000000..4c30c613732 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/DespoticScepter.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DespoticScepter extends mage.sets.masterseditionii.DespoticScepter { + + public DespoticScepter(UUID ownerId) { + super(ownerId); + this.cardNumber = 291; + this.expansionSetCode = "ICE"; + } + + public DespoticScepter(final DespoticScepter card) { + super(card); + } + + @Override + public DespoticScepter copy() { + return new DespoticScepter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Enervate.java b/Mage.Sets/src/mage/sets/iceage/Enervate.java new file mode 100644 index 00000000000..fa18468d1e0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Enervate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Enervate extends mage.sets.masterseditionii.Enervate { + + public Enervate(UUID ownerId) { + super(ownerId); + this.cardNumber = 67; + this.expansionSetCode = "ICE"; + } + + public Enervate(final Enervate card) { + super(card); + } + + @Override + public Enervate copy() { + return new Enervate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/FanaticalFever.java b/Mage.Sets/src/mage/sets/iceage/FanaticalFever.java new file mode 100644 index 00000000000..c6e4ebcab53 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/FanaticalFever.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author hanasu + */ +public class FanaticalFever extends CardImpl { + + public FanaticalFever(UUID ownerId) { + super(ownerId, 122, "Fanatical Fever", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{G}{G}"); + this.expansionSetCode = "ICE"; + + // Target creature gets +3/+0 and gains trample until end of turn. + Effect effect = new BoostTargetEffect(3, 0, Duration.EndOfTurn); + effect.setText("Target creature gets +3/+0"); + this.getSpellAbility().addEffect(effect); + effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains trample until end of turn"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public FanaticalFever(final FanaticalFever card) { + super(card); + } + + @Override + public FanaticalFever copy() { + return new FanaticalFever(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Flare.java b/Mage.Sets/src/mage/sets/iceage/Flare.java new file mode 100644 index 00000000000..417b3ffdb1e --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Flare.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Flare extends mage.sets.fifthedition.Flare { + + public Flare(UUID ownerId) { + super(ownerId); + this.cardNumber = 185; + this.expansionSetCode = "ICE"; + } + + public Flare(final Flare card) { + super(card); + } + + @Override + public Flare copy() { + return new Flare(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/FlowOfMaggots.java b/Mage.Sets/src/mage/sets/iceage/FlowOfMaggots.java new file mode 100644 index 00000000000..a2141496d77 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/FlowOfMaggots.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class FlowOfMaggots extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall creatures"); + + static { + filter.add(Predicates.not(new SubtypePredicate("Wall"))); + } + + public FlowOfMaggots(UUID ownerId) { + super(ownerId, 13, "Flow of Maggots", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Insect"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Cumulative upkeep {1} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}"))); + // Flow of Maggots can't be blocked by non-Wall creatures. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + } + + public FlowOfMaggots(final FlowOfMaggots card) { + super(card); + } + + @Override + public FlowOfMaggots copy() { + return new FlowOfMaggots(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/FolkOfThePines.java b/Mage.Sets/src/mage/sets/iceage/FolkOfThePines.java new file mode 100644 index 00000000000..58da771154d --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/FolkOfThePines.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class FolkOfThePines extends mage.sets.masterseditionii.FolkOfThePines { + + public FolkOfThePines(UUID ownerId) { + super(ownerId); + this.cardNumber = 123; + this.expansionSetCode = "ICE"; + } + + public FolkOfThePines(final FolkOfThePines card) { + super(card); + } + + @Override + public FolkOfThePines copy() { + return new FolkOfThePines(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/ForbiddenLore.java b/Mage.Sets/src/mage/sets/iceage/ForbiddenLore.java new file mode 100644 index 00000000000..ee5187aeb2a --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/ForbiddenLore.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class ForbiddenLore extends CardImpl { + + public ForbiddenLore(UUID ownerId) { + super(ownerId, 124, "Forbidden Lore", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Aura"); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted land has "{tap}: Target creature gets +2/+1 until end of turn." + Ability gainAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 1, Duration.EndOfTurn), new TapSourceCost()); + gainAbility.addTarget(new TargetCreaturePermanent()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainAbility, AttachmentType.AURA, + Duration.WhileOnBattlefield, "Enchanted land has \"{T}: Target creature gets +2/+1 until end of turn.\""))); + } + + public ForbiddenLore(final ForbiddenLore card) { + super(card); + } + + @Override + public ForbiddenLore copy() { + return new ForbiddenLore(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/ForceVoid.java b/Mage.Sets/src/mage/sets/iceage/ForceVoid.java new file mode 100644 index 00000000000..5ade9bb6d79 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/ForceVoid.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.TargetSpell; + +/** + * + * @author fireshoes + */ +public class ForceVoid extends CardImpl { + + public ForceVoid(UUID ownerId) { + super(ownerId, 70, "Force Void", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); + this.expansionSetCode = "ICE"; + + // Counter target spell unless its controller pays {1}. + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(1))); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public ForceVoid(final ForceVoid card) { + super(card); + } + + @Override + public ForceVoid copy() { + return new ForceVoid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/ForgottenLore.java b/Mage.Sets/src/mage/sets/iceage/ForgottenLore.java new file mode 100644 index 00000000000..48aeebbb97b --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/ForgottenLore.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ForgottenLore extends mage.sets.masterseditionii.ForgottenLore { + + public ForgottenLore(UUID ownerId) { + super(ownerId); + this.cardNumber = 125; + this.expansionSetCode = "ICE"; + } + + public ForgottenLore(final ForgottenLore card) { + super(card); + } + + @Override + public ForgottenLore copy() { + return new ForgottenLore(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/FoulFamiliar.java b/Mage.Sets/src/mage/sets/iceage/FoulFamiliar.java new file mode 100644 index 00000000000..af7dd89d640 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/FoulFamiliar.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class FoulFamiliar extends mage.sets.masterseditionii.FoulFamiliar { + + public FoulFamiliar(UUID ownerId) { + super(ownerId); + this.cardNumber = 14; + this.expansionSetCode = "ICE"; + } + + public FoulFamiliar(final FoulFamiliar card) { + super(card); + } + + @Override + public FoulFamiliar copy() { + return new FoulFamiliar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Fumarole.java b/Mage.Sets/src/mage/sets/iceage/Fumarole.java new file mode 100644 index 00000000000..5e8f34c4639 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Fumarole.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Fumarole extends mage.sets.masterseditionii.Fumarole { + + public Fumarole(UUID ownerId) { + super(ownerId); + this.cardNumber = 369; + this.expansionSetCode = "ICE"; + } + + public Fumarole(final Fumarole card) { + super(card); + } + + @Override + public Fumarole copy() { + return new Fumarole(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/FyndhornBow.java b/Mage.Sets/src/mage/sets/iceage/FyndhornBow.java new file mode 100644 index 00000000000..6be48bc5a7e --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/FyndhornBow.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FyndhornBow extends CardImpl { + + public FyndhornBow(UUID ownerId) { + super(ownerId, 293, "Fyndhorn Bow", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "ICE"; + + // {3}, {tap}: Target creature gains first strike until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), + Duration.EndOfTurn), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FyndhornBow(final FyndhornBow card) { + super(card); + } + + @Override + public FyndhornBow copy() { + return new FyndhornBow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/GlacialCrevasses.java b/Mage.Sets/src/mage/sets/iceage/GlacialCrevasses.java new file mode 100644 index 00000000000..b394a9bbd01 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/GlacialCrevasses.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventAllDamageByAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author Quercitron + */ +public class GlacialCrevasses extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("a snow Mountain"); + + static { + filter.add(new SubtypePredicate("Mountain")); + filter.add(new SupertypePredicate("Snow")); + } + + public GlacialCrevasses(UUID ownerId) { + super(ownerId, 187, "Glacial Crevasses", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "ICE"; + + // Sacrifice a snow Mountain: Prevent all combat damage that would be dealt this turn. + Effect effect = new PreventAllDamageByAllEffect(Duration.EndOfTurn, true); + effect.setText("Prevent all combat damage that would be dealt this turn"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new SacrificeTargetCost(new TargetControlledPermanent(filter))); + this.addAbility(ability); + } + + public GlacialCrevasses(final GlacialCrevasses card) { + super(card); + } + + @Override + public GlacialCrevasses copy() { + return new GlacialCrevasses(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/GoblinMutant.java b/Mage.Sets/src/mage/sets/iceage/GoblinMutant.java new file mode 100644 index 00000000000..b1b2b822430 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/GoblinMutant.java @@ -0,0 +1,94 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CantAttackIfDefenderControlsPermanent; +import mage.abilities.effects.common.combat.CantBlockCreaturesSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.filter.predicate.permanent.TappedPredicate; + +/** + * + * @author BursegSardaukar + + */ +public class GoblinMutant extends CardImpl { + + static final private FilterCreaturePermanent filter = new FilterCreaturePermanent("untapped creature with power 3 or greater"); + static final private FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creatures with power 3 or greater"); + + static { + filter.add(Predicates.and(new PowerPredicate(Filter.ComparisonType.GreaterThan, 2), Predicates.not(new TappedPredicate()))); + filter2.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 2)); + } + + public GoblinMutant(UUID ownerId) { + super(ownerId, 188, "Goblin Mutant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Goblin"); + this.subtype.add("Mutant"); + + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + //Trample + this.addAbility(TrampleAbility.getInstance()); + + // Goblin Mutant can't attack if defending player controls an untapped creature with power 3 or greater. + Effect effect = new CantAttackIfDefenderControlsPermanent(filter); + effect.setText("{this} can't attack if defending player controls an untapped creature with power 3 or greater."); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + + //Goblin Mutant can't block creatures with power 3 or greater. + Effect effectBlock = new CantBlockCreaturesSourceEffect(filter2); + effectBlock.setText("{this} can't block creatures with power 3 or greater."); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effectBlock)); + } + + public GoblinMutant(final GoblinMutant card) { + super(card); + } + + @Override + public GoblinMutant copy() { + return new GoblinMutant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/GoblinSnowman.java b/Mage.Sets/src/mage/sets/iceage/GoblinSnowman.java new file mode 100644 index 00000000000..775512bd9a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/GoblinSnowman.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.PreventCombatDamageBySourceEffect; +import mage.abilities.effects.common.PreventCombatDamageToSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.permanent.BlockedByIdPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author BursegSardaukar + */ +public class GoblinSnowman extends CardImpl { + + public GoblinSnowman(UUID ownerId) { + super(ownerId, 191, "Goblin Snowman", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Goblin"); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + //Whenever Goblin Snowman blocks, prevent all combat damage that would be dealt to and dealt by it this turn. + Effect effect = new PreventCombatDamageBySourceEffect(Duration.EndOfTurn); + effect.setText("prevent all combat damage that would be dealt to"); + Ability ability = new BlocksTriggeredAbility(effect, false); + effect = new PreventCombatDamageToSourceEffect(Duration.EndOfTurn); + effect.setText("and dealt by it this turn"); + ability.addEffect(effect); + this.addAbility(ability); + + //{T}: Goblin Snowman deals 1 damage to target creature it's blocking. + FilterAttackingCreature filter = new FilterAttackingCreature("creature it's blocking"); + filter.add(new BlockedByIdPredicate(this.getId())); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public GoblinSnowman(final GoblinSnowman card) { + super(card); + } + + @Override + public GoblinSnowman copy() { + return new GoblinSnowman(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/HoarShade.java b/Mage.Sets/src/mage/sets/iceage/HoarShade.java new file mode 100644 index 00000000000..bd4425138da --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/HoarShade.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author hanasu + */ +public class HoarShade extends CardImpl { + + public HoarShade(UUID ownerId) { + super(ownerId, 19, "Hoar Shade", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Shade"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {B}: Hoar Shade gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.B))); + } + + public HoarShade(final HoarShade card) { + super(card); + } + + @Override + public HoarShade copy() { + return new HoarShade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/HotSprings.java b/Mage.Sets/src/mage/sets/iceage/HotSprings.java new file mode 100644 index 00000000000..c03aca60797 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/HotSprings.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class HotSprings extends CardImpl { + + public HotSprings(UUID ownerId) { + super(ownerId, 136, "Hot Springs", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Aura"); + + // Enchant land you control + TargetPermanent auraTarget = new TargetControlledPermanent(new FilterControlledLandPermanent("land you control")); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted land has "{tap}: Prevent the next 1 damage that would be dealt to target creature or player this turn." + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + Effect effect = new GainAbilityAttachedEffect(ability, AttachmentType.AURA); + effect.setText("Enchanted land has \"{T}: Prevent the next 1 damage that would be dealt to target creature or player this turn.\""); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public HotSprings(final HotSprings card) { + super(card); + } + + @Override + public HotSprings copy() { + return new HotSprings(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/HyalopterousLemure.java b/Mage.Sets/src/mage/sets/iceage/HyalopterousLemure.java new file mode 100644 index 00000000000..07ad8bc2f88 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/HyalopterousLemure.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class HyalopterousLemure extends CardImpl { + + public HyalopterousLemure(UUID ownerId) { + super(ownerId, 21, "Hyalopterous Lemure", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Spirit"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // {0}: Hyalopterous Lemure gets -1/-0 and gains flying until end of turn. + Effect effect = new BoostSourceEffect(-1, 0, Duration.EndOfTurn); + effect.setText("{this} gets -1/-0"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{0}")); + effect = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains flying until end of turn"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public HyalopterousLemure(final HyalopterousLemure card) { + super(card); + } + + @Override + public HyalopterousLemure copy() { + return new HyalopterousLemure(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/HymnOfRebirth.java b/Mage.Sets/src/mage/sets/iceage/HymnOfRebirth.java new file mode 100644 index 00000000000..c17069ce9c2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/HymnOfRebirth.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class HymnOfRebirth extends mage.sets.mastersedition.HymnOfRebirth { + + public HymnOfRebirth(UUID ownerId) { + super(ownerId); + this.cardNumber = 373; + this.expansionSetCode = "ICE"; + } + + public HymnOfRebirth(final HymnOfRebirth card) { + super(card); + } + + @Override + public HymnOfRebirth copy() { + return new HymnOfRebirth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Icequake.java b/Mage.Sets/src/mage/sets/iceage/Icequake.java index d2cfa144f78..378e27cbc21 100644 --- a/Mage.Sets/src/mage/sets/iceage/Icequake.java +++ b/Mage.Sets/src/mage/sets/iceage/Icequake.java @@ -1,103 +1,100 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.iceage; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.common.TargetLandPermanent; - - -/** - * - * @author fireshoes - */ -public class Icequake extends CardImpl { - - public Icequake(UUID ownerId) { - super(ownerId, 22, "Icequake", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); - this.expansionSetCode = "ICE"; - - // Destroy target land. - // If that land was a snow land, Icequake deals 1 damage to that land's controller. - this.getSpellAbility().addEffect(new IcequakeEffect()); - this.getSpellAbility().addTarget(new TargetLandPermanent()); - - - } - - public Icequake(final Icequake card) { - super(card); - } - - @Override - public Icequake copy() { - return new Icequake(this); - } -} - -class IcequakeEffect extends OneShotEffect { - - public IcequakeEffect() { - super(Outcome.Damage); - this.staticText = "Destroy target land.
If that land was a snow land, {this} deals 1 damage to that land's controller."; - } - - public IcequakeEffect(final IcequakeEffect effect) { - super(effect); - } - - @Override - public IcequakeEffect copy() { - return new IcequakeEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (permanent != null && controller != null) { - permanent.destroy(source.getSourceId(), game, false); - if (permanent.getSupertype().contains("Snow")) { - Player player = game.getPlayer(permanent.getControllerId()); - if (player != null) { - player.damage(1, source.getSourceId(), game, false, true); - } - } - return true; - } - return false; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetLandPermanent; + + +/** + * + * @author fireshoes + */ +public class Icequake extends CardImpl { + + public Icequake(UUID ownerId) { + super(ownerId, 22, "Icequake", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); + this.expansionSetCode = "ICE"; + + // Destroy target land. + // If that land was a snow land, Icequake deals 1 damage to that land's controller. + this.getSpellAbility().addEffect(new IcequakeEffect()); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + + + } + + public Icequake(final Icequake card) { + super(card); + } + + @Override + public Icequake copy() { + return new Icequake(this); + } +} + +class IcequakeEffect extends OneShotEffect { + + public IcequakeEffect() { + super(Outcome.Damage); + this.staticText = "Destroy target land.
If that land was a snow land, {this} deals 1 damage to that land's controller."; + } + + public IcequakeEffect(final IcequakeEffect effect) { + super(effect); + } + + @Override + public IcequakeEffect copy() { + return new IcequakeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null && controller != null) { + permanent.destroy(source.getSourceId(), game, false); + if (permanent.getSupertype().contains("Snow")) { + controller.damage(1, source.getSourceId(), game, false, true); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/IllusionaryForces.java b/Mage.Sets/src/mage/sets/iceage/IllusionaryForces.java new file mode 100644 index 00000000000..fe4bba2144d --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/IllusionaryForces.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class IllusionaryForces extends mage.sets.mastersedition.IllusionaryForces { + + public IllusionaryForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 75; + this.expansionSetCode = "ICE"; + this.rarity = Rarity.COMMON; + } + + public IllusionaryForces(final IllusionaryForces card) { + super(card); + } + + @Override + public IllusionaryForces copy() { + return new IllusionaryForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/IllusionaryWall.java b/Mage.Sets/src/mage/sets/iceage/IllusionaryWall.java new file mode 100644 index 00000000000..8ae6347dec5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/IllusionaryWall.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class IllusionaryWall extends mage.sets.mastersedition.IllusionaryWall { + + public IllusionaryWall(UUID ownerId) { + super(ownerId); + this.cardNumber = 78; + this.expansionSetCode = "ICE"; + } + + public IllusionaryWall(final IllusionaryWall card) { + super(card); + } + + @Override + public IllusionaryWall copy() { + return new IllusionaryWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Infuse.java b/Mage.Sets/src/mage/sets/iceage/Infuse.java new file mode 100644 index 00000000000..d531e6be499 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Infuse.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class Infuse extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or land"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); + } + + public Infuse(UUID ownerId) { + super(ownerId, 80, "Infuse", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); + this.expansionSetCode = "ICE"; + + // Untap target artifact, creature, or land. + this.getSpellAbility().addEffect(new UntapTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public Infuse(final Infuse card) { + super(card); + } + + @Override + public Infuse copy() { + return new Infuse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/JuniperOrderDruid.java b/Mage.Sets/src/mage/sets/iceage/JuniperOrderDruid.java new file mode 100644 index 00000000000..ee317ff7673 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/JuniperOrderDruid.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author hanasu + */ +public class JuniperOrderDruid extends CardImpl { + + public JuniperOrderDruid(UUID ownerId) { + super(ownerId, 139, "Juniper Order Druid", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.subtype.add("Druid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Untap target land. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + } + + public JuniperOrderDruid(final JuniperOrderDruid card) { + super(card); + } + + @Override + public JuniperOrderDruid copy() { + return new JuniperOrderDruid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/KrovikanFetish.java b/Mage.Sets/src/mage/sets/iceage/KrovikanFetish.java new file mode 100644 index 00000000000..88688aeb24d --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/KrovikanFetish.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class KrovikanFetish extends mage.sets.fifthedition.KrovikanFetish { + + public KrovikanFetish(UUID ownerId) { + super(ownerId); + this.cardNumber = 28; + this.expansionSetCode = "ICE"; + } + + public KrovikanFetish(final KrovikanFetish card) { + super(card); + } + + @Override + public KrovikanFetish copy() { + return new KrovikanFetish(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/KrovikanSorcerer.java b/Mage.Sets/src/mage/sets/iceage/KrovikanSorcerer.java new file mode 100644 index 00000000000..b2cedf2cc3e --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/KrovikanSorcerer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class KrovikanSorcerer extends mage.sets.vintagemasters.KrovikanSorcerer { + + public KrovikanSorcerer(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "ICE"; + } + + public KrovikanSorcerer(final KrovikanSorcerer card) { + super(card); + } + + @Override + public KrovikanSorcerer copy() { + return new KrovikanSorcerer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/LandCap.java b/Mage.Sets/src/mage/sets/iceage/LandCap.java index ebb3dcb35f5..9049711a15e 100644 --- a/Mage.Sets/src/mage/sets/iceage/LandCap.java +++ b/Mage.Sets/src/mage/sets/iceage/LandCap.java @@ -34,7 +34,6 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.SourceHasCounterCondition; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; @@ -50,24 +49,24 @@ import mage.counters.CounterType; /** * - * @author anonymous + * @author Luna Skyrise */ public class LandCap extends CardImpl { public LandCap(UUID ownerId) { - super(ownerId, 319, "Land Cap", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + super(ownerId, 338, "Land Cap", Rarity.RARE, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "ICE"; // Land Cap doesn't untap during your untap step if it has a depletion counter on it. - Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(), - new SourceHasCounterCondition(CounterType.DEPLETION, 0)); + Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(false, true), + new SourceHasCounterCondition(CounterType.DEPLETION, 1, Integer.MAX_VALUE)); effect.setText("{this} doesn't untap during your untap step if it has a depletion counter on it"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); this.addAbility(ability); // At the beginning of your upkeep, remove a depletion counter from Land Cap. Ability ability2 = new BeginningOfUpkeepTriggeredAbility(new RemoveCounterSourceEffect(CounterType.DEPLETION.createInstance()), TargetController.YOU, false); this.addAbility(ability2); - // {tap}: Add {W} or {U} to your mana pool. Put a depletion counter on Land Cap. + // {T}: Add {W} or {U} to your mana pool. Put a depletion counter on Land Cap. Ability ability3 = new SimpleManaAbility(Zone.BATTLEFIELD, Mana.WhiteMana, new TapSourceCost()); ability3.addEffect(new AddCountersSourceEffect(CounterType.DEPLETION.createInstance())); this.addAbility(ability3); diff --git a/Mage.Sets/src/mage/sets/iceage/LavaTubes.java b/Mage.Sets/src/mage/sets/iceage/LavaTubes.java index 26cd59dc92f..ba645300648 100644 --- a/Mage.Sets/src/mage/sets/iceage/LavaTubes.java +++ b/Mage.Sets/src/mage/sets/iceage/LavaTubes.java @@ -49,7 +49,7 @@ import mage.counters.CounterType; /** * - * @author anonymous + * @author Luna Skyrise */ public class LavaTubes extends CardImpl { @@ -58,8 +58,8 @@ public class LavaTubes extends CardImpl { this.expansionSetCode = "ICE"; // Lava Tubes doesn't untap during your untap step if it has a depletion counter on it. - Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(), - new SourceHasCounterCondition(CounterType.DEPLETION, 0)); + Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(false, true), + new SourceHasCounterCondition(CounterType.DEPLETION, 1, Integer.MAX_VALUE)); effect.setText("{this} doesn't untap during your untap step if it has a depletion counter on it"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/iceage/LegionsOfLimDul.java b/Mage.Sets/src/mage/sets/iceage/LegionsOfLimDul.java new file mode 100644 index 00000000000..9a721589270 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/LegionsOfLimDul.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.LandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class LegionsOfLimDul extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("snow swamp"); + + static { + filter.add(new SupertypePredicate("Snow")); + filter.add(new SubtypePredicate("Swamp")); + } + + public LegionsOfLimDul(UUID ownerId) { + super(ownerId, 30, "Legions of Lim-Dul", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Snow swampwalk + this.addAbility(new LandwalkAbility(filter)); + } + + public LegionsOfLimDul(final LegionsOfLimDul card) { + super(card); + } + + @Override + public LegionsOfLimDul copy() { + return new LegionsOfLimDul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Lhurgoyf.java b/Mage.Sets/src/mage/sets/iceage/Lhurgoyf.java index f927d789a56..7f7bcacc82a 100644 --- a/Mage.Sets/src/mage/sets/iceage/Lhurgoyf.java +++ b/Mage.Sets/src/mage/sets/iceage/Lhurgoyf.java @@ -28,17 +28,19 @@ package mage.sets.iceage; import java.util.UUID; - -import mage.constants.*; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.players.Player; @@ -71,17 +73,13 @@ public class Lhurgoyf extends CardImpl { } } - - class LhurgoyfEffect extends ContinuousEffectImpl { - public LhurgoyfEffect() { - super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); + super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.CharacteristicDefining_7a, Outcome.BoostCreature); staticText = "{this}'s power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1"; } - public LhurgoyfEffect(final LhurgoyfEffect effect) { super(effect); } diff --git a/Mage.Sets/src/mage/sets/iceage/LightningBlow.java b/Mage.Sets/src/mage/sets/iceage/LightningBlow.java new file mode 100644 index 00000000000..538d9b3a54b --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/LightningBlow.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class LightningBlow extends CardImpl { + + public LightningBlow(UUID ownerId) { + super(ownerId, 266, "Lightning Blow", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "ICE"; + + // Target creature gains first strike until end of turn. + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public LightningBlow(final LightningBlow card) { + super(card); + } + + @Override + public LightningBlow copy() { + return new LightningBlow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/MeriekeRiBerit.java b/Mage.Sets/src/mage/sets/iceage/MeriekeRiBerit.java new file mode 100644 index 00000000000..50e2a856a49 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/MeriekeRiBerit.java @@ -0,0 +1,168 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author jeffwadsworth + */ +public class MeriekeRiBerit extends CardImpl { + + public MeriekeRiBerit(UUID ownerId) { + super(ownerId, 375, "Merieke Ri Berit", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{U}{B}"); + this.expansionSetCode = "ICE"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Merieke Ri Berit doesn't untap during your untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepSourceEffect())); + + // {tap}: Gain control of target creature for as long as you control Merieke Ri Berit. When Merieke Ri Berit leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated. + ConditionalContinuousEffect MeriekeRiBeritGainControlEffect = new ConditionalContinuousEffect( + new GainControlTargetEffect(Duration.Custom), + new SourceOnBattlefieldControlUnchangedCondition(), + "Gain control of target creature for as long as you control {this}"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, MeriekeRiBeritGainControlEffect, new TapSourceCost()); + ability.addTarget(new TargetPermanent(new FilterCreaturePermanent("target creature"))); + ability.addEffect(new MeriekeRiBeritCreateDelayedTriggerEffect()); + this.addAbility(ability); + + } + + public MeriekeRiBerit(final MeriekeRiBerit card) { + super(card); + } + + @Override + public MeriekeRiBerit copy() { + return new MeriekeRiBerit(this); + } +} + +class MeriekeRiBeritCreateDelayedTriggerEffect extends OneShotEffect { + + public MeriekeRiBeritCreateDelayedTriggerEffect() { + super(Outcome.Detriment); + this.staticText = "When {this} leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated."; + } + + public MeriekeRiBeritCreateDelayedTriggerEffect(final MeriekeRiBeritCreateDelayedTriggerEffect effect) { + super(effect); + } + + @Override + public MeriekeRiBeritCreateDelayedTriggerEffect copy() { + return new MeriekeRiBeritCreateDelayedTriggerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent controlledCreature = game.getPermanent(source.getFirstTarget()); + if (controlledCreature != null) { + DelayedTriggeredAbility delayedAbility = new MeriekeRiBeritDelayedTriggeredAbility(); + delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(controlledCreature.getId())); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + delayedAbility.init(game); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + return false; + } +} + +class MeriekeRiBeritDelayedTriggeredAbility extends DelayedTriggeredAbility { + + MeriekeRiBeritDelayedTriggeredAbility() { + super(new DestroyTargetEffect(true), Duration.EndOfGame, true); + } + + MeriekeRiBeritDelayedTriggeredAbility(MeriekeRiBeritDelayedTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE + || event.getType() == EventType.UNTAPPED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getSourceId() != null) { + if (GameEvent.EventType.ZONE_CHANGE.equals(event.getType()) + && event.getTargetId().equals(getSourceId())) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + return zEvent.getFromZone().equals(Zone.BATTLEFIELD); + } + } + return GameEvent.EventType.UNTAPPED.equals(event.getType()) + && event.getTargetId() != null && event.getTargetId().equals(getSourceId()); + } + + @Override + public MeriekeRiBeritDelayedTriggeredAbility copy() { + return new MeriekeRiBeritDelayedTriggeredAbility(this); + } + + @Override + public String getRule() { + return "When {this} leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated."; + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/MesmericTrance.java b/Mage.Sets/src/mage/sets/iceage/MesmericTrance.java new file mode 100644 index 00000000000..4286d8d1733 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/MesmericTrance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MesmericTrance extends mage.sets.masterseditionii.MesmericTrance { + + public MesmericTrance(UUID ownerId) { + super(ownerId); + this.cardNumber = 83; + this.expansionSetCode = "ICE"; + } + + public MesmericTrance(final MesmericTrance card) { + super(card); + } + + @Override + public MesmericTrance copy() { + return new MesmericTrance(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/MindRavel.java b/Mage.Sets/src/mage/sets/iceage/MindRavel.java new file mode 100644 index 00000000000..2495044d096 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/MindRavel.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MindRavel extends mage.sets.fifthedition.MindRavel { + + public MindRavel(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "ICE"; + } + + public MindRavel(final MindRavel card) { + super(card); + } + + @Override + public MindRavel copy() { + return new MindRavel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/MindWarp.java b/Mage.Sets/src/mage/sets/iceage/MindWarp.java index d64c55a9dc5..0d6cbb17f83 100644 --- a/Mage.Sets/src/mage/sets/iceage/MindWarp.java +++ b/Mage.Sets/src/mage/sets/iceage/MindWarp.java @@ -43,7 +43,7 @@ import mage.target.TargetPlayer; public class MindWarp extends CardImpl { public MindWarp(UUID ownerId) { - super(ownerId, 14, "Mind Warp", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{3}{B}"); + super(ownerId, 36, "Mind Warp", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{3}{B}"); this.expansionSetCode = "ICE"; diff --git a/Mage.Sets/src/mage/sets/iceage/MoleWorms.java b/Mage.Sets/src/mage/sets/iceage/MoleWorms.java new file mode 100644 index 00000000000..b7f0081bd36 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/MoleWorms.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MoleWorms extends mage.sets.fifthedition.MoleWorms { + + public MoleWorms(UUID ownerId) { + super(ownerId); + this.cardNumber = 40; + this.expansionSetCode = "ICE"; + } + + public MoleWorms(final MoleWorms card) { + super(card); + } + + @Override + public MoleWorms copy() { + return new MoleWorms(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/MysticMight.java b/Mage.Sets/src/mage/sets/iceage/MysticMight.java new file mode 100644 index 00000000000..47ec41770ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/MysticMight.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreatureOrPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MysticMight extends CardImpl { + + public MysticMight(UUID ownerId) { + super(ownerId, 86, "Mystic Might", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{U}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Aura"); + + // Enchant land you control + TargetPermanent auraTarget = new TargetControlledPermanent(new FilterControlledLandPermanent("land you control")); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Cumulative upkeep {1}{U} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}{U}"))); + // Enchanted land has "{tap}: Target creature gets +2/+2 until end of turn." + Ability gainAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new TapSourceCost()); + gainAbility.addTarget(new TargetCreaturePermanent()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainAbility, AttachmentType.AURA, + Duration.WhileOnBattlefield, "Enchanted land has \"{T}: Target creature gets +2/+2 until end of turn.\""))); + } + + public MysticMight(final MysticMight card) { + super(card); + } + + @Override + public MysticMight copy() { + return new MysticMight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/NakedSingularity.java b/Mage.Sets/src/mage/sets/iceage/NakedSingularity.java new file mode 100644 index 00000000000..5ef0077ec27 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/NakedSingularity.java @@ -0,0 +1,168 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ManaEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author emerald000 + */ +public class NakedSingularity extends CardImpl { + + public NakedSingularity(UUID ownerId) { + super(ownerId, 305, "Naked Singularity", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "ICE"; + + // Cumulative upkeep {3} + this.addAbility(new CumulativeUpkeepAbility(new GenericManaCost(3))); + + // If tapped for mana, Plains produce {R}, Islands produce {G}, Swamps produce {W}, Mountains produce {U}, and Forests produce {B} instead of any other type. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NakedSingularityEffect())); + } + + public NakedSingularity(final NakedSingularity card) { + super(card); + } + + @Override + public NakedSingularity copy() { + return new NakedSingularity(this); + } +} + +class NakedSingularityEffect extends ReplacementEffectImpl { + + NakedSingularityEffect() { + super(Duration.WhileOnBattlefield, Outcome.Neutral); + staticText = "If tapped for mana, Plains produce {R}, Islands produce {G}, Swamps produce {W}, Mountains produce {U}, and Forests produce {B} instead of any other type"; + } + + NakedSingularityEffect(final NakedSingularityEffect effect) { + super(effect); + } + + @Override + public NakedSingularityEffect copy() { + return new NakedSingularityEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Permanent permanent = game.getPermanent(event.getSourceId()); + Choice choice = new ChoiceImpl(true); + choice.setMessage("Pick a color to produce"); + if (permanent.hasSubtype("Plains")) { + choice.getChoices().add("Red"); + } + if (permanent.hasSubtype("Island")) { + choice.getChoices().add("Green"); + } + if (permanent.hasSubtype("Swamp")) { + choice.getChoices().add("White"); + } + if (permanent.hasSubtype("Mountain")) { + choice.getChoices().add("Blue"); + } + if (permanent.hasSubtype("Forest")) { + choice.getChoices().add("Black"); + } + String chosenColor; + if (choice.getChoices().size() == 1) { + chosenColor = choice.getChoices().iterator().next(); + } + else { + controller.choose(Outcome.PutManaInPool, choice, game); + chosenColor = choice.getChoice(); + } + ManaEvent manaEvent = (ManaEvent) event; + Mana mana = manaEvent.getMana(); + int amount = mana.count(); + switch (chosenColor) { + case "White": + mana.setToMana(Mana.WhiteMana(amount)); + break; + case "Blue": + mana.setToMana(Mana.BlueMana(amount)); + break; + case "Black": + mana.setToMana(Mana.BlackMana(amount)); + break; + case "Red": + mana.setToMana(Mana.RedMana(amount)); + break; + case "Green": + mana.setToMana(Mana.GreenMana(amount)); + break; + } + } + return false; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.TAPPED_FOR_MANA; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Permanent permanent = game.getPermanent(event.getSourceId()); + return permanent != null + && (permanent.hasSubtype("Plains") + || permanent.hasSubtype("Island") + || permanent.hasSubtype("Swamp") + || permanent.hasSubtype("Mountain") + || permanent.hasSubtype("Forest")); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Necropotence.java b/Mage.Sets/src/mage/sets/iceage/Necropotence.java index 0b1bb6d547e..c4e3bfbce56 100644 --- a/Mage.Sets/src/mage/sets/iceage/Necropotence.java +++ b/Mage.Sets/src/mage/sets/iceage/Necropotence.java @@ -1,162 +1,162 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.iceage; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; -import mage.abilities.costs.common.PayLifeCost; -import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileTargetEffect; -import mage.abilities.effects.common.ReturnToHandTargetEffect; -import mage.abilities.effects.common.SkipDrawStepEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.players.Player; -import mage.target.targetpointer.FixedTarget; - -/** - * - * @author LevelX2 - */ -public class Necropotence extends CardImpl { - - public Necropotence(UUID ownerId) { - super(ownerId, 42, "Necropotence", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}{B}"); - this.expansionSetCode = "ICE"; - - // Skip your draw step. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect())); - // Whenever you discard a card, exile that card from your graveyard. - Effect effect = new ExileTargetEffect(null, "", Zone.GRAVEYARD); - effect.setText("exile that card from your graveyard"); - this.addAbility(new NecropotenceTriggeredAbility(effect)); - // Pay 1 life: Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new NecropotenceEffect(), new PayLifeCost(1))); - - } - - public Necropotence(final Necropotence card) { - super(card); - } - - @Override - public Necropotence copy() { - return new Necropotence(this); - } -} - -class NecropotenceTriggeredAbility extends TriggeredAbilityImpl { - - NecropotenceTriggeredAbility(Effect effect) { - super(Zone.BATTLEFIELD, effect, false); - } - - NecropotenceTriggeredAbility(final NecropotenceTriggeredAbility ability) { - super(ability); - } - - @Override - public NecropotenceTriggeredAbility copy() { - return new NecropotenceTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.DISCARDED_CARD; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (getControllerId().equals(event.getPlayerId())) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever you discards a card, " + super.getRule(); - } -} - -class NecropotenceEffect extends OneShotEffect { - - public NecropotenceEffect() { - super(Outcome.Benefit); - this.staticText = "Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step"; - } - - public NecropotenceEffect(final NecropotenceEffect effect) { - super(effect); - } - - @Override - public NecropotenceEffect copy() { - return new NecropotenceEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - if (controller.getLibrary().size() > 0) { - Card card = controller.getLibrary().removeFromTop(game); - if (controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, false)) { - card.setFaceDown(true, game); - Effect returnToHandeffect = new ReturnToHandTargetEffect(false); - returnToHandeffect.setText("put that face down card into your hand"); - returnToHandeffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(returnToHandeffect, TargetController.YOU); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - return false; - } - return true; - } - return false; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.common.SkipDrawStepEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class Necropotence extends CardImpl { + + public Necropotence(UUID ownerId) { + super(ownerId, 42, "Necropotence", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}{B}"); + this.expansionSetCode = "ICE"; + + // Skip your draw step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect())); + // Whenever you discard a card, exile that card from your graveyard. + Effect effect = new ExileTargetEffect(null, "", Zone.GRAVEYARD); + effect.setText("exile that card from your graveyard"); + this.addAbility(new NecropotenceTriggeredAbility(effect)); + // Pay 1 life: Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new NecropotenceEffect(), new PayLifeCost(1))); + + } + + public Necropotence(final Necropotence card) { + super(card); + } + + @Override + public Necropotence copy() { + return new Necropotence(this); + } +} + +class NecropotenceTriggeredAbility extends TriggeredAbilityImpl { + + NecropotenceTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect, false); + } + + NecropotenceTriggeredAbility(final NecropotenceTriggeredAbility ability) { + super(ability); + } + + @Override + public NecropotenceTriggeredAbility copy() { + return new NecropotenceTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (getControllerId().equals(event.getPlayerId())) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you discard a card, " + super.getRule(); + } +} + +class NecropotenceEffect extends OneShotEffect { + + public NecropotenceEffect() { + super(Outcome.Benefit); + this.staticText = "Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step"; + } + + public NecropotenceEffect(final NecropotenceEffect effect) { + super(effect); + } + + @Override + public NecropotenceEffect copy() { + return new NecropotenceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + if (controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().removeFromTop(game); + if (controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, false)) { + card.setFaceDown(true, game); + Effect returnToHandEffect = new ReturnToHandTargetEffect(false); + returnToHandEffect.setText("put that face down card into your hand"); + returnToHandEffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(returnToHandEffect, TargetController.YOU); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + return false; + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/OrcishCannoneers.java b/Mage.Sets/src/mage/sets/iceage/OrcishCannoneers.java index ef0cebf67d2..644e2eeb821 100644 --- a/Mage.Sets/src/mage/sets/iceage/OrcishCannoneers.java +++ b/Mage.Sets/src/mage/sets/iceage/OrcishCannoneers.java @@ -32,6 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageControllerEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; @@ -57,7 +58,9 @@ public class OrcishCannoneers extends CardImpl { // {tap}: Orcish Cannoneers deals 2 damage to target creature or player and 3 damage to you. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); - ability.addEffect(new DamageControllerEffect(3)); + Effect effect = new DamageControllerEffect(3); + effect.setText("and 3 damage to you"); + ability.addEffect(effect); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/iceage/Panic.java b/Mage.Sets/src/mage/sets/iceage/Panic.java new file mode 100644 index 00000000000..65e1c110b94 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Panic.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Panic extends mage.sets.masterseditionii.Panic { + + public Panic(UUID ownerId) { + super(ownerId); + this.cardNumber = 212; + this.expansionSetCode = "ICE"; + } + + public Panic(final Panic card) { + super(card); + } + + @Override + public Panic copy() { + return new Panic(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Pyknite.java b/Mage.Sets/src/mage/sets/iceage/Pyknite.java new file mode 100644 index 00000000000..bd47c40fb28 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Pyknite.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Pyknite extends CardImpl { + + public Pyknite(UUID ownerId) { + super(ownerId, 146, "Pyknite", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Ouphe"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Pyknite enters the battlefield, draw a card at the beginning of the next turn's upkeep. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse)), false)); + } + + public Pyknite(final Pyknite card) { + super(card); + } + + @Override + public Pyknite copy() { + return new Pyknite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Pyroblast.java b/Mage.Sets/src/mage/sets/iceage/Pyroblast.java index 04784cb21bf..3dc67daee7c 100644 --- a/Mage.Sets/src/mage/sets/iceage/Pyroblast.java +++ b/Mage.Sets/src/mage/sets/iceage/Pyroblast.java @@ -1,136 +1,138 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.iceage; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.target.TargetPermanent; -import mage.target.TargetSpell; - -/** - * - * @author Plopman - */ -public class Pyroblast extends CardImpl { - - public Pyroblast(UUID ownerId) { - super(ownerId, 213, "Pyroblast", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); - this.expansionSetCode = "ICE"; - - - // Choose one - Counter target spell if it's blue; or destroy target permanent if it's blue. - this.getSpellAbility().addEffect(new PyroblastCounterTargetEffect()); - this.getSpellAbility().addTarget(new TargetSpell()); - - Mode mode = new Mode(); - mode.getEffects().add(new DestroyTargetEffect()); - mode.getTargets().add(new TargetPermanent()); - - this.getSpellAbility().addMode(mode); - } - - public Pyroblast(final Pyroblast card) { - super(card); - } - - @Override - public Pyroblast copy() { - return new Pyroblast(this); - } -} - -class PyroblastCounterTargetEffect extends OneShotEffect { - - public PyroblastCounterTargetEffect() { - super(Outcome.Detriment); - } - - public PyroblastCounterTargetEffect(final PyroblastCounterTargetEffect effect) { - super(effect); - } - - @Override - public PyroblastCounterTargetEffect copy() { - return new PyroblastCounterTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - if(game.getStack().getSpell(source.getFirstTarget()).getColor(game).isBlue()){ - game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); - } - return true; - } - - @Override - public String getText(Mode mode) { - return "Counter target spell if it's blue"; - } - -} - - -class DestroyTargetEffect extends OneShotEffect { - - - public DestroyTargetEffect() { - super(Outcome.DestroyPermanent); - } - - public DestroyTargetEffect(final DestroyTargetEffect effect) { - super(effect); - } - - @Override - public DestroyTargetEffect copy() { - return new DestroyTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); - if (permanent != null && permanent.getColor(game).isBlue()) { - permanent.destroy(source.getSourceId(), game, false); - } - return true; - } - - @Override - public String getText(Mode mode) { - return "Destroy target permanent if it's blue"; - } - -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.target.TargetPermanent; +import mage.target.TargetSpell; + +/** + * + * @author Plopman + */ +public class Pyroblast extends CardImpl { + + public Pyroblast(UUID ownerId) { + super(ownerId, 213, "Pyroblast", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "ICE"; + + + // Choose one - Counter target spell if it's blue; or destroy target permanent if it's blue. + this.getSpellAbility().addEffect(new PyroblastCounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + + Mode mode = new Mode(); + mode.getEffects().add(new DestroyTargetEffect()); + mode.getTargets().add(new TargetPermanent()); + + this.getSpellAbility().addMode(mode); + } + + public Pyroblast(final Pyroblast card) { + super(card); + } + + @Override + public Pyroblast copy() { + return new Pyroblast(this); + } +} + +class PyroblastCounterTargetEffect extends OneShotEffect { + + public PyroblastCounterTargetEffect() { + super(Outcome.Detriment); + } + + public PyroblastCounterTargetEffect(final PyroblastCounterTargetEffect effect) { + super(effect); + } + + @Override + public PyroblastCounterTargetEffect copy() { + return new PyroblastCounterTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); + if(targetSpell != null && targetSpell.getColor(game).isBlue()){ + game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + } + return true; + } + + @Override + public String getText(Mode mode) { + return "Counter target spell if it's blue"; + } + +} + + +class DestroyTargetEffect extends OneShotEffect { + + + public DestroyTargetEffect() { + super(Outcome.DestroyPermanent); + } + + public DestroyTargetEffect(final DestroyTargetEffect effect) { + super(effect); + } + + @Override + public DestroyTargetEffect copy() { + return new DestroyTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); + if (permanent != null && permanent.getColor(game).isBlue()) { + permanent.destroy(source.getSourceId(), game, false); + } + return true; + } + + @Override + public String getText(Mode mode) { + return "Destroy target permanent if it's blue"; + } + +} diff --git a/Mage.Sets/src/mage/sets/iceage/Rally.java b/Mage.Sets/src/mage/sets/iceage/Rally.java new file mode 100644 index 00000000000..16bd28f1c64 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Rally.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterBlockingCreature; + +/** + * + * @author LoneFox + */ +public class Rally extends CardImpl { + + public Rally(UUID ownerId) { + super(ownerId, 272, "Rally", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}{W}"); + this.expansionSetCode = "ICE"; + + // Blocking creatures get +1/+1 until end of turn. + this.getSpellAbility().addEffect(new BoostAllEffect(1, 1, Duration.EndOfTurn, + new FilterBlockingCreature("blocking creatures"), false)); + } + + public Rally(final Rally card) { + super(card); + } + + @Override + public Rally copy() { + return new Rally(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/RayOfErasure.java b/Mage.Sets/src/mage/sets/iceage/RayOfErasure.java new file mode 100644 index 00000000000..aa530424858 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/RayOfErasure.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class RayOfErasure extends CardImpl { + + public RayOfErasure(UUID ownerId) { + super(ownerId, 93, "Ray of Erasure", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "ICE"; + + // Target player puts the top card of his or her library into his or her graveyard. + this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(1)); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public RayOfErasure(final RayOfErasure card) { + super(card); + } + + @Override + public RayOfErasure copy() { + return new RayOfErasure(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/RimeDryad.java b/Mage.Sets/src/mage/sets/iceage/RimeDryad.java new file mode 100644 index 00000000000..52c0dc56319 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/RimeDryad.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.LandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class RimeDryad extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("snow forest"); + + static { + filter.add(new SupertypePredicate("Snow")); + filter.add(new SubtypePredicate("Forest")); + } + + public RimeDryad(UUID ownerId) { + super(ownerId, 148, "Rime Dryad", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Dryad"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Snow forestwalk + this.addAbility(new LandwalkAbility(filter)); + } + + public RimeDryad(final RimeDryad card) { + super(card); + } + + @Override + public RimeDryad copy() { + return new RimeDryad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/RiverDelta.java b/Mage.Sets/src/mage/sets/iceage/RiverDelta.java index b5f91fff064..008c5d3f159 100644 --- a/Mage.Sets/src/mage/sets/iceage/RiverDelta.java +++ b/Mage.Sets/src/mage/sets/iceage/RiverDelta.java @@ -34,7 +34,6 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.SourceHasCounterCondition; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; @@ -50,7 +49,7 @@ import mage.counters.CounterType; /** * - * @author anonymous + * @author Luna Skyrise */ public class RiverDelta extends CardImpl { @@ -59,8 +58,8 @@ public class RiverDelta extends CardImpl { this.expansionSetCode = "ICE"; // River Delta doesn't untap during your untap step if it has a depletion counter on it. - Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(), - new SourceHasCounterCondition(CounterType.DEPLETION, 0)); + Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(false, true), + new SourceHasCounterCondition(CounterType.DEPLETION, 1, Integer.MAX_VALUE)); effect.setText("{this} doesn't untap during your untap step if it has a depletion counter on it"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/iceage/Seizures.java b/Mage.Sets/src/mage/sets/iceage/Seizures.java index 5fdc2881cc2..df24823b79e 100644 --- a/Mage.Sets/src/mage/sets/iceage/Seizures.java +++ b/Mage.Sets/src/mage/sets/iceage/Seizures.java @@ -63,7 +63,7 @@ public class Seizures extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever enchanted creature becomes tapped, Seizures deals 3 damage to that creature's controller unless that player pays {3}. - this.addAbility(new BecomesTappedAttachedTriggeredAbility(new SeizuresEffect(), false)); + this.addAbility(new BecomesTappedAttachedTriggeredAbility(new SeizuresEffect(), "enchanted creature")); } public Seizures(final Seizures card) { diff --git a/Mage.Sets/src/mage/sets/iceage/ShamblingStrider.java b/Mage.Sets/src/mage/sets/iceage/ShamblingStrider.java new file mode 100644 index 00000000000..7e1cd13bd8c --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/ShamblingStrider.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author hanasu + */ +public class ShamblingStrider extends mage.sets.mastersedition.ShamblingStrider { + + public ShamblingStrider(UUID ownerId) { + super(ownerId); + this.cardNumber = 151; + this.expansionSetCode = "ICE"; + } + + public ShamblingStrider(final ShamblingStrider card) { + super(card); + } + + @Override + public ShamblingStrider copy() { + return new ShamblingStrider(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/SkeletonShip.java b/Mage.Sets/src/mage/sets/iceage/SkeletonShip.java new file mode 100644 index 00000000000..78053e99136 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/SkeletonShip.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.Filter; +import mage.filter.common.FilterLandPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class SkeletonShip extends CardImpl { + + public SkeletonShip(UUID ownerId) { + super(ownerId, 379, "Skeleton Ship", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{B}"); + this.expansionSetCode = "ICE"; + this.supertype.add("Legendary"); + this.subtype.add("Skeleton"); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // When you control no Islands, sacrifice Skeleton Ship. + this.addAbility(new ControlsPermanentsControllerTriggeredAbility( + new FilterLandPermanent("Island", "no Islands"), Filter.ComparisonType.Equal, 0, + new SacrificeSourceEffect())); + + // {tap}: Put a -1/-1 counter on target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.M1M1.createInstance()), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public SkeletonShip(final SkeletonShip card) { + super(card); + } + + @Override + public SkeletonShip copy() { + return new SkeletonShip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/SnowHound.java b/Mage.Sets/src/mage/sets/iceage/SnowHound.java index fb95474fb9c..bd828411862 100644 --- a/Mage.Sets/src/mage/sets/iceage/SnowHound.java +++ b/Mage.Sets/src/mage/sets/iceage/SnowHound.java @@ -67,11 +67,11 @@ public class SnowHound extends CardImpl { // {1}, {tap}: Return Snow Hound and target green or blue creature you control to their owner's hand. Effect effect = new ReturnToHandSourceEffect(true); - effect.setText("Return Snow Hound"); + effect.setText("Return Snow Hound"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}")); ability.addCost(new TapSourceCost()); effect = new ReturnToHandTargetEffect(); - effect.setText("and green or blue creature you control to their owners' hands"); + effect.setText("and target green or blue creature you control to their owners' hands"); ability.addTarget(new TargetControlledCreaturePermanent(filter)); ability.addEffect(effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/iceage/SoldeviMachinist.java b/Mage.Sets/src/mage/sets/iceage/SoldeviMachinist.java new file mode 100644 index 00000000000..9df965ecfd5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/SoldeviMachinist.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class SoldeviMachinist extends mage.sets.masterseditioniv.SoldeviMachinist { + + public SoldeviMachinist(UUID ownerId) { + super(ownerId); + this.cardNumber = 102; + this.expansionSetCode = "ICE"; + } + + public SoldeviMachinist(final SoldeviMachinist card) { + super(card); + } + + @Override + public SoldeviMachinist copy() { + return new SoldeviMachinist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/SoulKiss.java b/Mage.Sets/src/mage/sets/iceage/SoulKiss.java new file mode 100644 index 00000000000..3dfbde1acd0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/SoulKiss.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SoulKiss extends mage.sets.masterseditionii.SoulKiss { + + public SoulKiss(UUID ownerId) { + super(ownerId); + this.cardNumber = 50; + this.expansionSetCode = "ICE"; + this.rarity = Rarity.COMMON; + } + + public SoulKiss(final SoulKiss card) { + super(card); + } + + @Override + public SoulKiss copy() { + return new SoulKiss(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/SpoilsOfEvil.java b/Mage.Sets/src/mage/sets/iceage/SpoilsOfEvil.java new file mode 100644 index 00000000000..731676b24a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/SpoilsOfEvil.java @@ -0,0 +1,105 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author Blinke + */ +public class SpoilsOfEvil extends CardImpl { + private static final FilterCard filter = new FilterCard("artifact or creature card in target opponents graveyard"); + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); + } + + public SpoilsOfEvil(UUID ownerId) { + super(ownerId, 51, "Spoils of Evil", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{B}"); + this.expansionSetCode = "ICE"; + + // For each artifact or creature card in target opponent's graveyard, add {1} to your mana pool and you gain 1 life. + this.getSpellAbility().addEffect(new SpoilsOfEvilEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public SpoilsOfEvil(final SpoilsOfEvil card) { + super(card); + } + + @Override + public SpoilsOfEvil copy() { + return new SpoilsOfEvil(this); + } + + class SpoilsOfEvilEffect extends OneShotEffect { + + public SpoilsOfEvilEffect() { + super(Outcome.GainLife); + this.staticText = "For each artifact or creature card in target opponent's graveyard, add {1} to your mana pool and you gain 1 life."; + } + + public SpoilsOfEvilEffect(final SpoilsOfEvilEffect effect) { + super(effect); + } + + @Override + public SpoilsOfEvilEffect copy() { + return new SpoilsOfEvilEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetOpponent = game.getPlayer(targetPointer.getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + + if(targetOpponent != null && controller != null) { + int cardCount = targetOpponent.getGraveyard().count(filter, game); + controller.gainLife(cardCount, game); + controller.getManaPool().addMana(Mana.ColorlessMana(cardCount), game, source); + return true; + } + return false; + } + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Stampede.java b/Mage.Sets/src/mage/sets/iceage/Stampede.java new file mode 100644 index 00000000000..0a701005d9c --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Stampede.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; + +/** + * + * @author LoneFox + */ +public class Stampede extends CardImpl { + + public Stampede(UUID ownerId) { + super(ownerId, 153, "Stampede", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{G}{G}"); + this.expansionSetCode = "ICE"; + + // Attacking creatures get +1/+0 and gain trample until end of turn. + Effect effect = new BoostAllEffect(1, 0, Duration.EndOfTurn, new FilterAttackingCreature(), false); + effect.setText("attacking creatures get +1/+0"); + this.getSpellAbility().addEffect(effect); + effect = new GainAbilityAllEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterAttackingCreature()); + effect.setText("and gain trample until end of turn"); + this.getSpellAbility().addEffect(effect); + } + + public Stampede(final Stampede card) { + super(card); + } + + @Override + public Stampede copy() { + return new Stampede(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/StoneSpirit.java b/Mage.Sets/src/mage/sets/iceage/StoneSpirit.java new file mode 100644 index 00000000000..9f7af081f96 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/StoneSpirit.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class StoneSpirit extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with flying"); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public StoneSpirit(UUID ownerId) { + super(ownerId, 218, "Stone Spirit", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Elemental"); + this.subtype.add("Spirit"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Stone Spirit can't be blocked by creatures with flying. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + } + + public StoneSpirit(final StoneSpirit card) { + super(card); + } + + @Override + public StoneSpirit copy() { + return new StoneSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Stonehands.java b/Mage.Sets/src/mage/sets/iceage/Stonehands.java new file mode 100644 index 00000000000..f95b429eb5b --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Stonehands.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Stonehands extends CardImpl { + + public Stonehands(UUID ownerId) { + super(ownerId, 219, "Stonehands", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets +0/+2. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(0,2, Duration.WhileOnBattlefield))); + + // {R}: Enchanted creature gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.R))); + } + + public Stonehands(final Stonehands card) { + super(card); + } + + @Override + public Stonehands copy() { + return new Stonehands(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/StormSpirit.java b/Mage.Sets/src/mage/sets/iceage/StormSpirit.java new file mode 100644 index 00000000000..c59492cc623 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/StormSpirit.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class StormSpirit extends mage.sets.masterseditionii.StormSpirit { + + public StormSpirit(UUID ownerId) { + super(ownerId); + this.cardNumber = 381; + this.expansionSetCode = "ICE"; + } + + public StormSpirit(final StormSpirit card) { + super(card); + } + + @Override + public StormSpirit copy() { + return new StormSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Sunstone.java b/Mage.Sets/src/mage/sets/iceage/Sunstone.java new file mode 100644 index 00000000000..1d195808294 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Sunstone.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventAllDamageByAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author Quercitron + */ +public class Sunstone extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("a snow land"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public Sunstone(UUID ownerId) { + super(ownerId, 316, "Sunstone", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "ICE"; + + // {2}, Sacrifice a snow land: Prevent all combat damage that would be dealt this turn. + Effect effect = new PreventAllDamageByAllEffect(Duration.EndOfTurn, true); + effect.setText("Prevent all combat damage that would be dealt this turn"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + this.addAbility(ability); + } + + public Sunstone(final Sunstone card) { + super(card); + } + + @Override + public Sunstone copy() { + return new Sunstone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Thermokarst.java b/Mage.Sets/src/mage/sets/iceage/Thermokarst.java new file mode 100644 index 00000000000..bfb85909f03 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Thermokarst.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Thermokarst extends mage.sets.masterseditionii.Thermokarst { + + public Thermokarst(UUID ownerId) { + super(ownerId); + this.cardNumber = 156; + this.expansionSetCode = "ICE"; + this.rarity = Rarity.UNCOMMON; + } + + public Thermokarst(final Thermokarst card) { + super(card); + } + + @Override + public Thermokarst copy() { + return new Thermokarst(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/TimberlineRidge.java b/Mage.Sets/src/mage/sets/iceage/TimberlineRidge.java index 56a826a8e0a..e10a0009454 100644 --- a/Mage.Sets/src/mage/sets/iceage/TimberlineRidge.java +++ b/Mage.Sets/src/mage/sets/iceage/TimberlineRidge.java @@ -49,7 +49,7 @@ import mage.counters.CounterType; /** * - * @author anonymous + * @author Luna Skyrise */ public class TimberlineRidge extends CardImpl { @@ -58,8 +58,8 @@ public class TimberlineRidge extends CardImpl { this.expansionSetCode = "ICE"; // Timberline Ridge doesn't untap during your untap step if it has a depletion counter on it. - Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(), - new SourceHasCounterCondition(CounterType.DEPLETION, 0)); + Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(false, true), + new SourceHasCounterCondition(CounterType.DEPLETION, 1, Integer.MAX_VALUE)); effect.setText("{this} doesn't untap during your untap step if it has a depletion counter on it"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/iceage/TimeBomb.java b/Mage.Sets/src/mage/sets/iceage/TimeBomb.java new file mode 100644 index 00000000000..a707e9dc092 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/TimeBomb.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TimeBomb extends mage.sets.masterseditionii.TimeBomb { + + public TimeBomb(UUID ownerId) { + super(ownerId); + this.cardNumber = 317; + this.expansionSetCode = "ICE"; + } + + public TimeBomb(final TimeBomb card) { + super(card); + } + + @Override + public TimeBomb copy() { + return new TimeBomb(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/TinderWall.java b/Mage.Sets/src/mage/sets/iceage/TinderWall.java index 5ee8dc535c8..048387e2942 100644 --- a/Mage.Sets/src/mage/sets/iceage/TinderWall.java +++ b/Mage.Sets/src/mage/sets/iceage/TinderWall.java @@ -43,16 +43,15 @@ import mage.cards.CardImpl; import mage.constants.WatcherScope; import mage.constants.Zone; import mage.filter.common.FilterAttackingCreature; -import mage.filter.predicate.Predicate; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; import mage.watchers.Watcher; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import mage.filter.predicate.permanent.BlockedByIdPredicate; /** * @@ -75,7 +74,7 @@ public class TinderWall extends CardImpl { this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.RedMana(2)), new SacrificeSourceCost())); // {R}, Sacrifice Tinder Wall: Tinder Wall deals 2 damage to target creature it's blocking. FilterAttackingCreature filter = new FilterAttackingCreature("creature it's blocking"); - filter.add(new BlockingByPredicate(this.getId())); + filter.add(new BlockedByIdPredicate(this.getId())); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{R}")); ability.addTarget(new TargetCreaturePermanent(filter)); ability.addCost(new SacrificeSourceCost()); @@ -92,10 +91,9 @@ public class TinderWall extends CardImpl { } } - class BlockedByWatcher extends Watcher { - public List blockedByWatcher = new ArrayList(); + public List blockedByWatcher = new ArrayList<>(); public BlockedByWatcher() { super("BlockedByWatcher", WatcherScope.CARD); @@ -127,31 +125,3 @@ class BlockedByWatcher extends Watcher { } } - -class BlockingByPredicate implements Predicate { - - private UUID source; - - public BlockingByPredicate(UUID source) { - this.source = source; - } - - @Override - public boolean apply(Permanent input, Game game) { - BlockedByWatcher watcher = (BlockedByWatcher) game.getState().getWatchers().get("BlockedByWatcher", source); - - for(UUID uuid :watcher.blockedByWatcher){ - Permanent creature = game.getPermanent(uuid); - if(creature != null && creature.getId().equals(input.getId())){ - return true; - } - } - return false; - - } - - @Override - public String toString() { - return "creature it's blocking"; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/iceage/TorGiant.java b/Mage.Sets/src/mage/sets/iceage/TorGiant.java index 406c02c838d..17f4c54c3de 100644 --- a/Mage.Sets/src/mage/sets/iceage/TorGiant.java +++ b/Mage.Sets/src/mage/sets/iceage/TorGiant.java @@ -40,7 +40,7 @@ import mage.cards.CardImpl; public class TorGiant extends CardImpl { public TorGiant(UUID ownerId) { - super(ownerId, 76, "Tor Giant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + super(ownerId, 220, "Tor Giant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.expansionSetCode = "ICE"; this.subtype.add("Giant"); diff --git a/Mage.Sets/src/mage/sets/iceage/TouchOfDeath.java b/Mage.Sets/src/mage/sets/iceage/TouchOfDeath.java new file mode 100644 index 00000000000..a10fd45d37f --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/TouchOfDeath.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class TouchOfDeath extends CardImpl { + + public TouchOfDeath(UUID ownerId) { + super(ownerId, 55, "Touch of Death", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}"); + this.expansionSetCode = "ICE"; + + // Touch of Death deals 1 damage to target player. You gain 1 life. + this.getSpellAbility().addEffect(new DamageTargetEffect(1)); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addEffect(new GainLifeEffect(1)); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public TouchOfDeath(final TouchOfDeath card) { + super(card); + } + + @Override + public TouchOfDeath copy() { + return new TouchOfDeath(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Updraft.java b/Mage.Sets/src/mage/sets/iceage/Updraft.java new file mode 100644 index 00000000000..64254f22b38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Updraft.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Updraft extends CardImpl { + + public Updraft(UUID ownerId) { + super(ownerId, 105, "Updraft", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "ICE"; + + // Target creature gains flying until end of turn. + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public Updraft(final Updraft card) { + super(card); + } + + @Override + public Updraft copy() { + return new Updraft(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Veldt.java b/Mage.Sets/src/mage/sets/iceage/Veldt.java index 437370080e8..29f1e423aa3 100644 --- a/Mage.Sets/src/mage/sets/iceage/Veldt.java +++ b/Mage.Sets/src/mage/sets/iceage/Veldt.java @@ -49,7 +49,7 @@ import mage.counters.CounterType; /** * - * @author anonymous + * @author Luna Skyrise */ public class Veldt extends CardImpl { @@ -58,8 +58,8 @@ public class Veldt extends CardImpl { this.expansionSetCode = "ICE"; // Veldt doesn't untap during your untap step if it has a depletion counter on it. - Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(), - new SourceHasCounterCondition(CounterType.DEPLETION, 0)); + Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(false, true), + new SourceHasCounterCondition(CounterType.DEPLETION, 1, Integer.MAX_VALUE)); effect.setText("{this} doesn't untap during your untap step if it has a depletion counter on it"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/iceage/WalkingWall.java b/Mage.Sets/src/mage/sets/iceage/WalkingWall.java new file mode 100644 index 00000000000..9db4cff12f2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/WalkingWall.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WalkingWall extends mage.sets.mastersedition.WalkingWall { + + public WalkingWall(UUID ownerId) { + super(ownerId); + this.cardNumber = 321; + this.expansionSetCode = "ICE"; + } + + public WalkingWall(final WalkingWall card) { + super(card); + } + + @Override + public WalkingWall copy() { + return new WalkingWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/WarChariot.java b/Mage.Sets/src/mage/sets/iceage/WarChariot.java new file mode 100644 index 00000000000..af4c6723531 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/WarChariot.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class WarChariot extends CardImpl { + + public WarChariot(UUID ownerId) { + super(ownerId, 323, "War Chariot", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "ICE"; + + // {3}, {tap}: Target creature gains trample until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(TrampleAbility.getInstance(), + Duration.EndOfTurn), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public WarChariot(final WarChariot card) { + super(card); + } + + @Override + public WarChariot copy() { + return new WarChariot(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Warning.java b/Mage.Sets/src/mage/sets/iceage/Warning.java new file mode 100644 index 00000000000..2894a43c781 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Warning.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Warning extends mage.sets.masterseditionii.Warning { + + public Warning(UUID ownerId) { + super(ownerId); + this.cardNumber = 279; + this.expansionSetCode = "ICE"; + } + + public Warning(final Warning card) { + super(card); + } + + @Override + public Warning copy() { + return new Warning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/WingsOfAesthir.java b/Mage.Sets/src/mage/sets/iceage/WingsOfAesthir.java new file mode 100644 index 00000000000..2f1e01acf75 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/WingsOfAesthir.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WingsOfAesthir extends mage.sets.masterseditionii.WingsOfAesthir { + + public WingsOfAesthir(UUID ownerId) { + super(ownerId); + this.cardNumber = 383; + this.expansionSetCode = "ICE"; + } + + public WingsOfAesthir(final WingsOfAesthir card) { + super(card); + } + + @Override + public WingsOfAesthir copy() { + return new WingsOfAesthir(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/WordOfBlasting.java b/Mage.Sets/src/mage/sets/iceage/WordOfBlasting.java new file mode 100644 index 00000000000..380dc65b44b --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/WordOfBlasting.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.TargetConvertedManaCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetControllerEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class WordOfBlasting extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Wall"); + + static { + filter.add(new SubtypePredicate("Wall")); + } + + public WordOfBlasting(UUID ownerId) { + super(ownerId, 224, "Word of Blasting", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "ICE"; + + // Destroy target Wall. It can't be regenerated. Word of Blasting deals damage equal to that Wall's converted mana cost to the Wall's controller. + this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); + Effect effect = new DamageTargetControllerEffect(new TargetConvertedManaCost()); + effect.setText("{this} deals damage equal to that Wall's converted mana cost to the Wall's controller"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + public WordOfBlasting(final WordOfBlasting card) { + super(card); + } + + @Override + public WordOfBlasting copy() { + return new WordOfBlasting(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/WrathOfMaritLage.java b/Mage.Sets/src/mage/sets/iceage/WrathOfMaritLage.java index ba13bc802ba..c190395735e 100644 --- a/Mage.Sets/src/mage/sets/iceage/WrathOfMaritLage.java +++ b/Mage.Sets/src/mage/sets/iceage/WrathOfMaritLage.java @@ -1,109 +1,77 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.iceage; - -import java.util.List; -import java.util.UUID; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; - -/** - * - * @author Plopman - */ -public class WrathOfMaritLage extends CardImpl { - - public static final FilterCreaturePermanent filter = new FilterCreaturePermanent("red creatures"); - - static { - filter.add(new ColorPredicate(ObjectColor.RED)); - } - - - public WrathOfMaritLage(UUID ownerId) { - super(ownerId, 109, "Wrath of Marit Lage", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}"); - this.expansionSetCode = "ICE"; - - - // When Wrath of Marit Lage enters the battlefield, tap all red creatures. - this.addAbility(new EntersBattlefieldTriggeredAbility(new TapAllEffect())); - // Red creatures don't untap during their controllers' untap steps. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, filter))); - } - - public WrathOfMaritLage(final WrathOfMaritLage card) { - super(card); - } - - @Override - public WrathOfMaritLage copy() { - return new WrathOfMaritLage(this); - } -} - -class TapAllEffect extends OneShotEffect { - - public TapAllEffect() { - super(Outcome.Tap); - staticText = "tap all red creatures"; - } - - public TapAllEffect(final TapAllEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - - List creatures = game.getBattlefield().getActivePermanents(WrathOfMaritLage.filter, source.getSourceId(), game); - for (Permanent creature : creatures) { - creature.tap(game); - } - return true; - } - - @Override - public TapAllEffect copy() { - return new TapAllEffect(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; +import mage.abilities.effects.common.TapAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author Plopman + */ +public class WrathOfMaritLage extends CardImpl { + + public static final FilterCreaturePermanent filter = new FilterCreaturePermanent("red creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public WrathOfMaritLage(UUID ownerId) { + super(ownerId, 109, "Wrath of Marit Lage", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}"); + this.expansionSetCode = "ICE"; + + + // When Wrath of Marit Lage enters the battlefield, tap all red creatures. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TapAllEffect(filter))); + // Red creatures don't untap during their controllers' untap steps. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, filter))); + } + + public WrathOfMaritLage(final WrathOfMaritLage card) { + super(card); + } + + @Override + public WrathOfMaritLage copy() { + return new WrathOfMaritLage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/YavimayaGnats.java b/Mage.Sets/src/mage/sets/iceage/YavimayaGnats.java new file mode 100644 index 00000000000..a2e726d4e69 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/YavimayaGnats.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author nigelzor + */ +public class YavimayaGnats extends CardImpl { + + public YavimayaGnats(UUID ownerId) { + super(ownerId, 168, "Yavimaya Gnats", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Insect"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {G}: Regenerate Yavimaya Gnats. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{G}"))); + } + + public YavimayaGnats(final YavimayaGnats card) { + super(card); + } + + @Override + public YavimayaGnats copy() { + return new YavimayaGnats(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/ZuranEnchanter.java b/Mage.Sets/src/mage/sets/iceage/ZuranEnchanter.java new file mode 100644 index 00000000000..428f191c7d5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/ZuranEnchanter.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.MyTurnCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPlayer; + +/** + * + * @author nigelzor + */ +public class ZuranEnchanter extends CardImpl { + + public ZuranEnchanter(UUID ownerId) { + super(ownerId, 110, "Zuran Enchanter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {2}{B}, {tap}: Target player discards a card. Activate this ability only during your turn. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1), new ManaCostsImpl("{2}{B}"), MyTurnCondition.getInstance()); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public ZuranEnchanter(final ZuranEnchanter card) { + super(card); + } + + @Override + public ZuranEnchanter copy() { + return new ZuranEnchanter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/ZuranSpellcaster.java b/Mage.Sets/src/mage/sets/iceage/ZuranSpellcaster.java new file mode 100644 index 00000000000..198a9ccadbe --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/ZuranSpellcaster.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +import java.util.UUID; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class ZuranSpellcaster extends CardImpl { + + public ZuranSpellcaster(UUID ownerId) { + super(ownerId, 111, "Zuran Spellcaster", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {T}: Zuran Spellcaster deals 1 damage to target creature or player. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public ZuranSpellcaster(final ZuranSpellcaster card) { + super(card); + } + + @Override + public ZuranSpellcaster copy() { + return new ZuranSpellcaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/BackFromTheBrink.java b/Mage.Sets/src/mage/sets/innistrad/BackFromTheBrink.java index d088e33c83c..4565580087f 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BackFromTheBrink.java +++ b/Mage.Sets/src/mage/sets/innistrad/BackFromTheBrink.java @@ -28,24 +28,23 @@ package mage.sets.innistrad; import java.util.UUID; - +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.CostImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.common.ActivateAsSorceryActivatedAbility; -import mage.abilities.costs.CostImpl; -import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.CardImpl; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.players.Player; -import mage.game.permanent.token.EmptyToken; +import mage.target.Target; import mage.target.common.TargetCardInYourGraveyard; import mage.target.targetpointer.FixedTarget; -import mage.util.CardUtil; /** * @@ -57,9 +56,10 @@ public class BackFromTheBrink extends CardImpl { super(ownerId, 44, "Back from the Brink", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{U}{U}"); this.expansionSetCode = "ISD"; - // Exile a creature card from your graveyard and pay its mana cost: Put a token onto the battlefield that's a copy of that card. Activate this ability only any time you could cast a sorcery. - this.addAbility(new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new BackFromTheBrinkEffect(), new BackFromTheBrinkCost())); + Effect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); + effect.setText("Put a token onto the battlefield that's a copy of that card"); + this.addAbility(new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, effect, new BackFromTheBrinkCost())); } @@ -73,40 +73,12 @@ public class BackFromTheBrink extends CardImpl { } } -class BackFromTheBrinkEffect extends OneShotEffect { - - public BackFromTheBrinkEffect () { - super(Outcome.PutCreatureInPlay); - staticText = "Put a token onto the battlefield that's a copy of that card. Activate this ability only any time you could cast a sorcery"; - } - - public BackFromTheBrinkEffect(final BackFromTheBrinkEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Card card = game.getCard(this.targetPointer.getFirst(game, source)); - if (card != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(card); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } - return false; - } - - @Override - public BackFromTheBrinkEffect copy() { - return new BackFromTheBrinkEffect(this); - } - -} - class BackFromTheBrinkCost extends CostImpl { public BackFromTheBrinkCost() { - this.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + Target target = new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")); + target.setNotTarget(true); + this.addTarget(target); this.text = "Exile a creature card from your graveyard and pay its mana cost"; } @@ -127,10 +99,10 @@ class BackFromTheBrinkCost extends CostImpl { @Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { if (targets.choose(Outcome.Exile, controllerId, sourceId, game)) { - Player player = game.getPlayer(controllerId); - if (player != null) { - Card card = player.getGraveyard().get(targets.getFirstTarget(), game); - if (card != null && card.moveToZone(Zone.EXILED, sourceId, game, false)) { + Player controller = game.getPlayer(controllerId); + if (controller != null) { + Card card = controller.getGraveyard().get(targets.getFirstTarget(), game); + if (card != null && controller.moveCards(card, null, Zone.EXILED, ability, game)) { ability.getEffects().get(0).setTargetPointer(new FixedTarget(card.getId())); paid = card.getManaCost().pay(ability, game, sourceId, controllerId, noMana); } @@ -139,4 +111,4 @@ class BackFromTheBrinkCost extends CostImpl { return paid; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java index 94a3961d9d5..90391f49bf5 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java +++ b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java @@ -1,131 +1,106 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.innistrad; - -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.CostImpl; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ColoredManaCost; -import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.TransformSourceEffect; -import mage.abilities.keyword.FlyingAbility; -import mage.abilities.keyword.TransformAbility; -import mage.cards.CardImpl; -import mage.constants.ColoredManaSymbol; -import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.game.permanent.token.Token; - -/** - * - * @author Loki - */ -public class BloodlineKeeper extends CardImpl { - - public BloodlineKeeper(UUID ownerId) { - super(ownerId, 90, "Bloodline Keeper", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Vampire"); - - this.power = new MageInt(3); - this.toughness = new MageInt(3); - - this.canTransform = true; - this.secondSideCard = new LordOfLineage(ownerId); - - this.addAbility(FlyingAbility.getInstance()); - // {T}: Put a 2/2 black Vampire creature token with flying onto the battlefield. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new VampireToken()), new TapSourceCost())); - // {B}: Transform Bloodline Keeper. Activate this ability only if you control five or more Vampires. - this.addAbility(new TransformAbility()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TransformSourceEffect(true), new ColoredManaCost(ColoredManaSymbol.B)); - ability.addCost(new ControlFiveVampiresCost()); - this.addAbility(ability); - } - - public BloodlineKeeper(final BloodlineKeeper card) { - super(card); - } - - @Override - public BloodlineKeeper copy() { - return new BloodlineKeeper(this); - } -} - -class VampireToken extends Token { - VampireToken() { - super("Vampire", "a 2/2 black Vampire creature token with flying"); - cardType.add(CardType.CREATURE); - color.setBlack(true); - subtype.add("Vampire"); - power = new MageInt(2); - toughness = new MageInt(2); - addAbility(FlyingAbility.getInstance()); - } -} - -class ControlFiveVampiresCost extends CostImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); - - static { - filter.add(new SubtypePredicate("Vampire")); - } - - public ControlFiveVampiresCost() { - this.text = "Activate this ability only if you control five or more Vampires"; - } - - public ControlFiveVampiresCost(final ControlFiveVampiresCost cost) { - super(cost); - } - - @Override - public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - return game.getBattlefield().contains(filter, controllerId, 5, game); - } - - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } - - @Override - public ControlFiveVampiresCost copy() { - return new ControlFiveVampiresCost(this); - } -} \ No newline at end of file +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.innistrad; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.TransformSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.Token; + +/** + * + * @author Loki + */ +public class BloodlineKeeper extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control five or more Vampires"); + + static { + filter.add(new SubtypePredicate("Vampire")); + } + + public BloodlineKeeper(UUID ownerId) { + super(ownerId, 90, "Bloodline Keeper", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Vampire"); + + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + this.canTransform = true; + this.secondSideCard = new LordOfLineage(ownerId); + + this.addAbility(FlyingAbility.getInstance()); + // {T}: Put a 2/2 black Vampire creature token with flying onto the battlefield. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new VampireToken()), new TapSourceCost())); + // {B}: Transform Bloodline Keeper. Activate this ability only if you control five or more Vampires. + this.addAbility(new TransformAbility()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new TransformSourceEffect(true), + new ManaCostsImpl("{B}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 4)); + this.addAbility(ability); + } + + public BloodlineKeeper(final BloodlineKeeper card) { + super(card); + } + + @Override + public BloodlineKeeper copy() { + return new BloodlineKeeper(this); + } +} + +class VampireToken extends Token { + VampireToken() { + super("Vampire", "a 2/2 black Vampire creature token with flying"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Vampire"); + power = new MageInt(2); + toughness = new MageInt(2); + addAbility(FlyingAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/CacklingCounterpart.java b/Mage.Sets/src/mage/sets/innistrad/CacklingCounterpart.java index 3d0174773d9..069e6abedf2 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CacklingCounterpart.java +++ b/Mage.Sets/src/mage/sets/innistrad/CacklingCounterpart.java @@ -28,13 +28,13 @@ package mage.sets.innistrad; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TimingRule; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TimingRule; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -46,7 +46,6 @@ public class CacklingCounterpart extends CardImpl { super(ownerId, 46, "Cackling Counterpart", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); this.expansionSetCode = "ISD"; - // Put a token onto the battlefield that's a copy of target creature you control. this.getSpellAbility().addEffect(new PutTokenOntoBattlefieldCopyTargetEffect()); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); @@ -64,5 +63,3 @@ public class CacklingCounterpart extends CardImpl { return new CacklingCounterpart(this); } } - - diff --git a/Mage.Sets/src/mage/sets/innistrad/CaravanVigil.java b/Mage.Sets/src/mage/sets/innistrad/CaravanVigil.java index 4dc4e3bd417..7bbd95e03b1 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CaravanVigil.java +++ b/Mage.Sets/src/mage/sets/innistrad/CaravanVigil.java @@ -96,13 +96,12 @@ class CaravanVigilEffect extends OneShotEffect { if (controller.searchLibrary(target, game)) { Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) { - Cards cards = new CardsImpl(); - cards.add(card); + Cards cards = new CardsImpl(card); if (MorbidCondition.getInstance().apply(game, source) && controller.chooseUse(Outcome.PutLandInPlay, "Do you wish to put the card onto the battlefield instead?", source, game)) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } else { - controller.moveCards(card, null, Zone.HAND, source, game); + controller.moveCards(card, Zone.HAND, source, game); } controller.revealCards(sourceObject.getIdName(), cards, game); } diff --git a/Mage.Sets/src/mage/sets/innistrad/DearlyDeparted.java b/Mage.Sets/src/mage/sets/innistrad/DearlyDeparted.java index 4a1345a52c9..aa0a1f54fef 100644 --- a/Mage.Sets/src/mage/sets/innistrad/DearlyDeparted.java +++ b/Mage.Sets/src/mage/sets/innistrad/DearlyDeparted.java @@ -27,39 +27,30 @@ */ package mage.sets.innistrad; - -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.Mode; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffect; -import mage.abilities.effects.Effect; -import mage.abilities.effects.Effects; import mage.abilities.effects.ReplacementEffectImpl; -import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; -import mage.game.stack.Spell; -import mage.target.targetpointer.FixedTarget; - -import java.util.UUID; import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; /** * @author nantuko */ public class DearlyDeparted extends CardImpl { - private static final String ruleText = "As long as {this} is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it"; - public DearlyDeparted(UUID ownerId) { super(ownerId, 9, "Dearly Departed", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); this.expansionSetCode = "ISD"; @@ -71,8 +62,7 @@ public class DearlyDeparted extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // As long as Dearly Departed is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it. - this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, - new EntersBattlefieldEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(1)), ruleText))); + this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, new DearlyDepartedEntersBattlefieldEffect())); } public DearlyDeparted(final DearlyDeparted card) { @@ -85,43 +75,26 @@ public class DearlyDeparted extends CardImpl { } } -class EntersBattlefieldEffect extends ReplacementEffectImpl { +class DearlyDepartedEntersBattlefieldEffect extends ReplacementEffectImpl { - protected Effects baseEffects = new Effects(); - protected String text; - - public static final String SOURCE_CAST_SPELL_ABILITY = "sourceCastSpellAbility"; - - public EntersBattlefieldEffect(Effect baseEffect) { - this(baseEffect, ""); + public DearlyDepartedEntersBattlefieldEffect() { + super(Duration.OneUse, Outcome.BoostCreature); + staticText = "As long as {this} is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it"; } - public EntersBattlefieldEffect(Effect baseEffect, String text) { - super(Duration.OneUse, baseEffect.getOutcome()); - this.baseEffects.add(baseEffect); - this.text = text; - } - - public EntersBattlefieldEffect(EntersBattlefieldEffect effect) { + public DearlyDepartedEntersBattlefieldEffect(DearlyDepartedEntersBattlefieldEffect effect) { super(effect); - this.baseEffects = effect.baseEffects.copy(); - this.text = effect.text; } - public void addEffect(Effect effect) { - baseEffects.add(effect); - } - @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(event.getTargetId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.hasSubtype("Human")) { - setValue("target", permanent); return true; } return false; @@ -129,33 +102,16 @@ class EntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Spell spell = game.getStack().getSpell(event.getSourceId()); - for (Effect effect: baseEffects) { - Object target = getValue("target"); - if (target != null && target instanceof Permanent) { - effect.setTargetPointer(new FixedTarget(((Permanent)target).getId())); - if (effect instanceof ContinuousEffect) { - game.addEffect((ContinuousEffect) effect, source); - } - else { - if (spell != null) { - effect.setValue(SOURCE_CAST_SPELL_ABILITY, spell.getSpellAbility()); - } - effect.apply(game, source); - } - } + Permanent target = ((EntersTheBattlefieldEvent) event).getTarget(); + if (target != null) { + target.addCounters(CounterType.P1P1.createInstance(), game); } return false; } @Override - public String getText(Mode mode) { - return (text == null || text.isEmpty()) ? baseEffects.getText(mode) : text; - } - - @Override - public EntersBattlefieldEffect copy() { - return new EntersBattlefieldEffect(this); + public DearlyDepartedEntersBattlefieldEffect copy() { + return new DearlyDepartedEntersBattlefieldEffect(this); } } diff --git a/Mage.Sets/src/mage/sets/innistrad/EssenceOfTheWild.java b/Mage.Sets/src/mage/sets/innistrad/EssenceOfTheWild.java index 657f77a94c3..68b0c47ceb9 100644 --- a/Mage.Sets/src/mage/sets/innistrad/EssenceOfTheWild.java +++ b/Mage.Sets/src/mage/sets/innistrad/EssenceOfTheWild.java @@ -28,20 +28,19 @@ package mage.sets.innistrad; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.CopyEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -89,21 +88,18 @@ class EssenceOfTheWildEffect extends ReplacementEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - Permanent perm = game.getPermanent(event.getTargetId()); + Permanent perm = ((EntersTheBattlefieldEvent) event).getTarget(); return perm != null && perm.getCardType().contains(CardType.CREATURE) && perm.getControllerId().equals(source.getControllerId()); } - + @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent perm = game.getPermanent(source.getSourceId()); - if (perm != null) { - perm = perm.copy(); - perm.reset(game); - perm.assignNewId(); - game.addEffect(new EssenceOfTheWildCopyEffect(perm, event.getTargetId()), source); + Permanent sourceObject = ((EntersTheBattlefieldEvent) event).getTarget(); + if (sourceObject != null) { + game.addEffect(new CopyEffect(Duration.Custom, sourceObject, event.getTargetId()), source); } return false; } @@ -114,59 +110,3 @@ class EssenceOfTheWildEffect extends ReplacementEffectImpl { } } - -class EssenceOfTheWildCopyEffect extends ContinuousEffectImpl { - - private final Permanent essence; - private final UUID targetId; - - public EssenceOfTheWildCopyEffect(Permanent essence, UUID targetId) { - super(Duration.EndOfGame, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature); - this.essence = essence; - this.targetId = targetId; - } - - public EssenceOfTheWildCopyEffect(final EssenceOfTheWildCopyEffect effect) { - super(effect); - this.essence = effect.essence.copy(); - this.targetId = effect.targetId; - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - permanent.setName(essence.getName()); - permanent.getColor(game).setColor(essence.getColor(game)); - permanent.getManaCost().clear(); - permanent.getManaCost().add(essence.getManaCost()); - permanent.getCardType().clear(); - for (CardType type: essence.getCardType()) { - permanent.getCardType().add(type); - } - permanent.getSubtype().clear(); - for (String type: essence.getSubtype()) { - permanent.getSubtype().add(type); - } - permanent.getSupertype().clear(); - for (String type: essence.getSupertype()) { - permanent.getSupertype().add(type); - } - permanent.getAbilities().clear(); - for (Ability ability: essence.getAbilities()) { - permanent.addAbility(ability, game); - } - permanent.getPower().setValue(essence.getPower().getValue()); - permanent.getToughness().setValue(essence.getToughness().getValue()); - - return true; - } - return false; - } - - @Override - public EssenceOfTheWildCopyEffect copy() { - return new EssenceOfTheWildCopyEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/innistrad/EvilTwin.java b/Mage.Sets/src/mage/sets/innistrad/EvilTwin.java index e6cb8e4ccdc..62ec36b5d7e 100644 --- a/Mage.Sets/src/mage/sets/innistrad/EvilTwin.java +++ b/Mage.Sets/src/mage/sets/innistrad/EvilTwin.java @@ -28,19 +28,20 @@ package mage.sets.innistrad; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.CopyPermanentEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.ObjectSourcePlayer; import mage.filter.predicate.ObjectSourcePlayerPredicate; @@ -55,8 +56,6 @@ import mage.util.functions.ApplyToPermanent; */ public class EvilTwin extends CardImpl { - - public EvilTwin(UUID ownerId) { super(ownerId, 212, "Evil Twin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{B}"); this.expansionSetCode = "ISD"; @@ -66,11 +65,10 @@ public class EvilTwin extends CardImpl { this.toughness = new MageInt(0); // You may have Evil Twin enter the battlefield as a copy of any creature on the battlefield except it gains "{U}{B}, {T}: Destroy target creature with the same name as this creature." - this.addAbility(new SimpleStaticAbility( - Zone.BATTLEFIELD, - new EntersBattlefieldEffect(new CopyPermanentEffect(new EvilTwinApplyToPermanent()), - "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature\"", - true))); + Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new EvilTwinApplyToPermanent()); + effect.setText("a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature.\""); + this.addAbility(new EntersBattlefieldAbility(effect, true)); + } public EvilTwin(final EvilTwin card) { @@ -99,6 +97,16 @@ class EvilTwinApplyToPermanent extends ApplyToPermanent { permanent.addAbility(ability, game); return true; } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{U}{B}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + mageObject.getAbilities().add(ability); + return true; + } + } class EvilTwinPredicate implements ObjectSourcePlayerPredicate> { diff --git a/Mage.Sets/src/mage/sets/innistrad/GarrukRelentless.java b/Mage.Sets/src/mage/sets/innistrad/GarrukRelentless.java index 3d3e258a14b..1f43014bc50 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GarrukRelentless.java +++ b/Mage.Sets/src/mage/sets/innistrad/GarrukRelentless.java @@ -31,11 +31,10 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.TransformSourceEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -60,11 +59,10 @@ public class GarrukRelentless extends CardImpl { this.expansionSetCode = "ISD"; this.subtype.add("Garruk"); - this.canTransform = true; this.secondSideCard = new GarrukTheVeilCursed(ownerId); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // When Garruk Relentless has two or fewer loyalty counters on him, transform him. this.addAbility(new TransformAbility()); @@ -160,4 +158,4 @@ class GarrukRelentlessDamageEffect extends OneShotEffect { return new GarrukRelentlessDamageEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/innistrad/GeistOfSaintTraft.java b/Mage.Sets/src/mage/sets/innistrad/GeistOfSaintTraft.java index 121a77b2705..ca4bb6e65c6 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GeistOfSaintTraft.java +++ b/Mage.Sets/src/mage/sets/innistrad/GeistOfSaintTraft.java @@ -35,14 +35,13 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; -import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; import mage.constants.Outcome; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.game.permanent.token.AngelToken; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -79,6 +78,7 @@ public class GeistOfSaintTraft extends CardImpl { } class GeistOfSaintTraftEffect extends OneShotEffect { + GeistOfSaintTraftEffect() { super(Outcome.PutCreatureInPlay); staticText = "put a 4/4 white Angel creature token with flying onto the battlefield tapped and attacking. Exile that token at end of combat"; @@ -93,10 +93,14 @@ class GeistOfSaintTraftEffect extends OneShotEffect { AngelToken token = new AngelToken(); Player controller = game.getPlayer(source.getControllerId()); if (controller != null && token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), true, true)) { - Effect effect = new ExileTargetEffect(); - effect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - CreateDelayedTriggeredAbilityEffect createEffect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect), false); - createEffect.apply(game, source); + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect), source); + } + } return true; } return false; diff --git a/Mage.Sets/src/mage/sets/innistrad/GhostQuarter.java b/Mage.Sets/src/mage/sets/innistrad/GhostQuarter.java index aeba8786b36..5d05bc28c57 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GhostQuarter.java +++ b/Mage.Sets/src/mage/sets/innistrad/GhostQuarter.java @@ -98,16 +98,16 @@ class GhostQuarterEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = (Permanent) game.getPermanentOrLKIBattlefield(source.getFirstTarget()); // if indestructible effect should work also if (permanent != null) { - Player player = game.getPlayer(permanent.getControllerId()); - if (player.chooseUse(Outcome.PutLandInPlay, "Do you wish to search for a basic land, put it onto the battlefield and then shuffle your library?", source, game)) { + Player controller = game.getPlayer(permanent.getControllerId()); + if (controller.chooseUse(Outcome.PutLandInPlay, "Do you wish to search for a basic land, put it onto the battlefield and then shuffle your library?", source, game)) { TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard()); - if (player.searchLibrary(target, game)) { - Card card = player.getLibrary().getCard(target.getFirstTarget(), game); - if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + if (controller.searchLibrary(target, game)) { + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); + if (card != null) { + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); } return true; } diff --git a/Mage.Sets/src/mage/sets/innistrad/GrimoireOfTheDead.java b/Mage.Sets/src/mage/sets/innistrad/GrimoireOfTheDead.java index 84e2bdea4ef..bf41dc6d02b 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GrimoireOfTheDead.java +++ b/Mage.Sets/src/mage/sets/innistrad/GrimoireOfTheDead.java @@ -27,14 +27,9 @@ */ package mage.sets.innistrad; +import java.util.LinkedHashSet; +import java.util.Set; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.DiscardTargetCost; @@ -47,6 +42,13 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.permanent.Permanent; @@ -101,15 +103,21 @@ class GrimoireOfTheDeadEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - for (Player player: game.getPlayers().values()) { - for (Card card: player.getGraveyard().getCards(game)) { - if (card.getCardType().contains(CardType.CREATURE)) { - card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId()); - game.addEffect(new GrimoireOfTheDeadEffect2(card.getId()), source); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Set creatureCards = new LinkedHashSet<>(); + for (Player player : game.getPlayers().values()) { + for (Card card : player.getGraveyard().getCards(game)) { + if (card.getCardType().contains(CardType.CREATURE)) { + creatureCards.add(card); + game.addEffect(new GrimoireOfTheDeadEffect2(card.getId()), source); + } } } + controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, true, null); + return true; } - return true; + return false; } @Override @@ -121,10 +129,10 @@ class GrimoireOfTheDeadEffect extends OneShotEffect { class GrimoireOfTheDeadEffect2 extends ContinuousEffectImpl { - private UUID targetId; + private final UUID targetId; public GrimoireOfTheDeadEffect2(UUID targetId) { - super(Duration.EndOfGame, Outcome.Neutral); + super(Duration.Custom, Outcome.Neutral); this.targetId = targetId; staticText = "Becomes a black Zombie in addition to its other colors and types"; } @@ -170,4 +178,4 @@ class GrimoireOfTheDeadEffect2 extends ContinuousEffectImpl { return layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/innistrad/LilianaOfTheVeil.java b/Mage.Sets/src/mage/sets/innistrad/LilianaOfTheVeil.java index d20fc714ff0..0fea92be5d7 100644 --- a/Mage.Sets/src/mage/sets/innistrad/LilianaOfTheVeil.java +++ b/Mage.Sets/src/mage/sets/innistrad/LilianaOfTheVeil.java @@ -27,18 +27,19 @@ */ package mage.sets.innistrad; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.SacrificeEffect; +import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; -import mage.abilities.effects.common.SacrificeEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.cards.CardImpl; -import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; @@ -47,10 +48,6 @@ import mage.players.Player; import mage.target.TargetPermanent; import mage.target.TargetPlayer; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - /** * * @author North @@ -62,17 +59,16 @@ public class LilianaOfTheVeil extends CardImpl { this.expansionSetCode = "ISD"; this.subtype.add("Liliana"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +1: Each player discards a card. this.addAbility(new LoyaltyAbility(new DiscardEachPlayerEffect(), 1)); - + // -2: Target player sacrifices a creature. LoyaltyAbility ability = new LoyaltyAbility(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player"), -2); ability.addTarget(new TargetPlayer()); this.addAbility(ability); - + // -6: Separate all permanents target player controls into two piles. That player sacrifices all permanents in the pile of his or her choice. ability = new LoyaltyAbility(new LilianaOfTheVeilEffect(), -6); ability.addTarget(new TargetPlayer()); @@ -124,7 +120,7 @@ class LilianaOfTheVeilEffect extends OneShotEffect { } } List pile2 = new ArrayList<>(); - for (Permanent p: game.getBattlefield().getAllActivePermanents(targetPlayer.getId())) { + for (Permanent p : game.getBattlefield().getAllActivePermanents(targetPlayer.getId())) { if (!pile1.contains(p)) { pile2.add(p); } diff --git a/Mage.Sets/src/mage/sets/innistrad/MikaeusTheLunarch.java b/Mage.Sets/src/mage/sets/innistrad/MikaeusTheLunarch.java index fe50dc84018..2eb92ada3ea 100644 --- a/Mage.Sets/src/mage/sets/innistrad/MikaeusTheLunarch.java +++ b/Mage.Sets/src/mage/sets/innistrad/MikaeusTheLunarch.java @@ -27,30 +27,24 @@ */ package mage.sets.innistrad; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.Effect; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.counter.AddCountersAllEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; -import mage.constants.Outcome; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; - -import java.util.UUID; /** * @author nantuko @@ -74,7 +68,7 @@ public class MikaeusTheLunarch extends CardImpl { this.toughness = new MageInt(0); // Mikaeus, the Lunarch enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new MikaeusTheLunarchEffect())); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // {T}: Put a +1/+1 counter on Mikaeus. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new TapSourceCost())); @@ -95,36 +89,3 @@ public class MikaeusTheLunarch extends CardImpl { return new MikaeusTheLunarch(this); } } - -class MikaeusTheLunarchEffect extends OneShotEffect { - - public MikaeusTheLunarchEffect() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - public MikaeusTheLunarchEffect(final MikaeusTheLunarchEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public MikaeusTheLunarchEffect copy() { - return new MikaeusTheLunarchEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/innistrad/Nevermore.java b/Mage.Sets/src/mage/sets/innistrad/Nevermore.java index dee67c6f07f..dee1d81fe79 100644 --- a/Mage.Sets/src/mage/sets/innistrad/Nevermore.java +++ b/Mage.Sets/src/mage/sets/innistrad/Nevermore.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -33,11 +33,8 @@ import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.NameACardEffect; import mage.cards.CardImpl; -import mage.cards.repository.CardRepository; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -46,9 +43,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.util.CardUtil; /** * @@ -60,11 +54,10 @@ public class Nevermore extends CardImpl { super(ownerId, 25, "Nevermore", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); this.expansionSetCode = "ISD"; + // As Nevermore enters the battlefield, name a nonland card. + this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME))); - //As Nevermore enters the battlefield, name a nonland card. - this.addAbility(new AsEntersBattlefieldAbility(new NevermoreEffect1())); - - //The named card can't be cast. + // The named card can't be cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NevermoreEffect2())); } @@ -80,46 +73,6 @@ public class Nevermore extends CardImpl { } -class NevermoreEffect1 extends OneShotEffect { - - public NevermoreEffect1() { - super(Outcome.Detriment); - staticText = "name a nonland card"; - } - - public NevermoreEffect1(final NevermoreEffect1 effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (controller != null && permanent != null) { - Choice cardChoice = new ChoiceImpl(); - cardChoice.setChoices(CardRepository.instance.getNonLandNames()); - cardChoice.clearChoice(); - while (!controller.choose(Outcome.Detriment, cardChoice, game)) { - if (!controller.canRespond()) { - return false; - } - } - String cardName = cardChoice.getChoice(); - game.informPlayers(permanent.getLogName() + ", named card: [" + cardName + "]"); - game.getState().setValue(source.getSourceId().toString(), cardName); - permanent.addInfo("named card", CardUtil.addToolTipMarkTags("Named card: [" + cardName +"]"), game); - return true; - } - return false; - } - - @Override - public NevermoreEffect1 copy() { - return new NevermoreEffect1(this); - } - -} - class NevermoreEffect2 extends ContinuousRuleModifyingEffectImpl { public NevermoreEffect2() { @@ -145,7 +98,7 @@ class NevermoreEffect2 extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == EventType.CAST_SPELL) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString()))) { + if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { return true; } } diff --git a/Mage.Sets/src/mage/sets/innistrad/SharpenedPitchfork.java b/Mage.Sets/src/mage/sets/innistrad/SharpenedPitchfork.java index 9f5743b3bda..69b5927d538 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SharpenedPitchfork.java +++ b/Mage.Sets/src/mage/sets/innistrad/SharpenedPitchfork.java @@ -28,11 +28,6 @@ package mage.sets.innistrad; import java.util.UUID; - -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EquippedHasSubtypeCondition; import mage.abilities.costs.mana.GenericManaCost; @@ -42,7 +37,11 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; /** * @@ -53,7 +52,7 @@ public class SharpenedPitchfork extends CardImpl { private static final String staticText = "As long as equipped creature is a Human, it gets +1/+1"; public SharpenedPitchfork(UUID ownerId) { - super(ownerId, 232, "Sharpened Pitchfork", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + super(ownerId, 232, "Sharpened Pitchfork", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "ISD"; this.subtype.add("Equipment"); diff --git a/Mage.Sets/src/mage/sets/innistrad/SilentDeparture.java b/Mage.Sets/src/mage/sets/innistrad/SilentDeparture.java index 1d0444e8c57..a567c980624 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SilentDeparture.java +++ b/Mage.Sets/src/mage/sets/innistrad/SilentDeparture.java @@ -28,13 +28,12 @@ package mage.sets.innistrad; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.TimingRule; import mage.target.common.TargetCreaturePermanent; @@ -48,7 +47,6 @@ public class SilentDeparture extends CardImpl { super(ownerId, 75, "Silent Departure", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); this.expansionSetCode = "ISD"; - // Return target creature to its owner's hand. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); diff --git a/Mage.Sets/src/mage/sets/innistrad/SkirsdagHighPriest.java b/Mage.Sets/src/mage/sets/innistrad/SkirsdagHighPriest.java index 08e333a7ef6..3f50f943347 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SkirsdagHighPriest.java +++ b/Mage.Sets/src/mage/sets/innistrad/SkirsdagHighPriest.java @@ -30,21 +30,20 @@ package mage.sets.innistrad; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.CostImpl; +import mage.abilities.condition.common.MorbidCondition; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.decorator.ConditionalActivatedAbility; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.AbilityWord; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.permanent.TappedPredicate; -import mage.game.Game; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.DemonToken; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -69,9 +68,10 @@ public class SkirsdagHighPriest extends CardImpl { this.toughness = new MageInt(2); // Morbid - {tap}, Tap two untapped creatures you control: Put a 5/5 black Demon creature token with flying onto the battlefield. Activate this ability only if a creature died this turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new DemonToken()), new TapSourceCost()); - ability.addCost(new TapTargetCost(new TargetControlledCreaturePermanent(2,2,filter, false))); - ability.addCost(new SkirsdagHighPriestCost()); + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new DemonToken()), + new TapSourceCost(), MorbidCondition.getInstance()); + ability.addCost(new TapTargetCost(new TargetControlledCreaturePermanent(2, 2, filter, false))); + ability.setAbilityWord(AbilityWord.MORBID); this.addAbility(ability); } @@ -84,45 +84,3 @@ public class SkirsdagHighPriest extends CardImpl { return new SkirsdagHighPriest(this); } } - -class SkirsdagHighPriestCost extends CostImpl { - - public SkirsdagHighPriestCost() { - this.text = "Activate this ability only if a creature died this turn"; - } - - public SkirsdagHighPriestCost(final SkirsdagHighPriestCost cost) { - super(cost); - } - - @Override - public SkirsdagHighPriestCost copy() { - return new SkirsdagHighPriestCost(this); - } - - @Override - public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - return game.getState().getWatchers().get("Morbid").conditionMet(); - } - - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } -} - -class DemonToken extends Token { - - DemonToken() { - super("Demon", "5/5 black Demon creature token with flying"); - cardType.add(CardType.CREATURE); - subtype.add("Demon"); - - color.setBlack(true); - power = new MageInt(5); - toughness = new MageInt(5); - - addAbility(FlyingAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/innistrad/SpiderSpawning.java b/Mage.Sets/src/mage/sets/innistrad/SpiderSpawning.java index af915331c45..3b5ed551c26 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SpiderSpawning.java +++ b/Mage.Sets/src/mage/sets/innistrad/SpiderSpawning.java @@ -1,82 +1,68 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.innistrad; - -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TimingRule; -import mage.MageInt; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; -import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.FlashbackAbility; -import mage.abilities.keyword.ReachAbility; -import mage.cards.CardImpl; -import mage.filter.common.FilterCreatureCard; -import mage.game.permanent.token.Token; - -/** - * - * @author North - */ -public class SpiderSpawning extends CardImpl { - - public SpiderSpawning(UUID ownerId) { - super(ownerId, 203, "Spider Spawning", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{G}"); - this.expansionSetCode = "ISD"; - - - // Put a 1/2 green Spider creature token with reach onto the battlefield for each creature card in your graveyard. - this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiderToken(), new CardsInControllerGraveyardCount(new FilterCreatureCard()))); - // Flashback {6}{B} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{6}{B}"), TimingRule.SORCERY)); - } - - public SpiderSpawning(final SpiderSpawning card) { - super(card); - } - - @Override - public SpiderSpawning copy() { - return new SpiderSpawning(this); - } -} - -class SpiderToken extends Token { - - public SpiderToken() { - super("Spider", "1/2 green Spider creature token with reach"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Spider"); - power = new MageInt(1); - toughness = new MageInt(2); - addAbility(ReachAbility.getInstance()); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.innistrad; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.FlashbackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TimingRule; +import mage.filter.common.FilterCreatureCard; +import mage.game.permanent.token.SpiderToken; + +/** + * + * @author North + */ +public class SpiderSpawning extends CardImpl { + + public SpiderSpawning(UUID ownerId) { + super(ownerId, 203, "Spider Spawning", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{G}"); + this.expansionSetCode = "ISD"; + + + // Put a 1/2 green Spider creature token with reach onto the battlefield for each creature card in your graveyard. + this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiderToken(), new CardsInControllerGraveyardCount(new FilterCreatureCard()))); + // Flashback {6}{B} + this.addAbility(new FlashbackAbility(new ManaCostsImpl("{6}{B}"), TimingRule.SORCERY)); + } + + public SpiderSpawning(final SpiderSpawning card) { + super(card); + } + + @Override + public SpiderSpawning copy() { + return new SpiderSpawning(this); + } +} + diff --git a/Mage.Sets/src/mage/sets/innistrad/TravelPreparations.java b/Mage.Sets/src/mage/sets/innistrad/TravelPreparations.java index d34f3ea38dc..24bb9763d6a 100644 --- a/Mage.Sets/src/mage/sets/innistrad/TravelPreparations.java +++ b/Mage.Sets/src/mage/sets/innistrad/TravelPreparations.java @@ -28,13 +28,14 @@ package mage.sets.innistrad; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TimingRule; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TimingRule; import mage.counters.CounterType; import mage.target.common.TargetCreaturePermanent; @@ -48,10 +49,12 @@ public class TravelPreparations extends CardImpl { super(ownerId, 206, "Travel Preparations", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); this.expansionSetCode = "ISD"; - // Put a +1/+1 counter on each of up to two target creatures. - this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance())); + Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); + effect.setText("Put a +1/+1 counter on each of up to two target creatures"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); + // Flashback {1}{W} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{W}"), TimingRule.SORCERY)); } diff --git a/Mage.Sets/src/mage/sets/innistrad/TreeOfRedemption.java b/Mage.Sets/src/mage/sets/innistrad/TreeOfRedemption.java index f5a37fb5ce7..b20abba0013 100644 --- a/Mage.Sets/src/mage/sets/innistrad/TreeOfRedemption.java +++ b/Mage.Sets/src/mage/sets/innistrad/TreeOfRedemption.java @@ -28,11 +28,6 @@ package mage.sets.innistrad; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -41,6 +36,12 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -94,14 +95,17 @@ class TreeOfRedemptionEffect extends OneShotEffect { if (perm != null) { int amount = perm.getToughness().getValue(); int life = player.getLife(); - if (life == amount) + if (life == amount) { return false; - if (life < amount && !player.isCanGainLife()) + } + if (life < amount && !player.isCanGainLife()) { return false; - if (life > amount && !player.isCanLoseLife()) + } + if (life > amount && !player.isCanLoseLife()) { return false; + } player.setLife(amount, game); - game.addEffect(new SetPowerToughnessSourceEffect(Integer.MIN_VALUE, life, Duration.WhileOnBattlefield), source); + game.addEffect(new SetPowerToughnessSourceEffect(Integer.MIN_VALUE, life, Duration.WhileOnBattlefield, SubLayer.SetPT_7b), source); return true; } } @@ -113,4 +117,4 @@ class TreeOfRedemptionEffect extends OneShotEffect { return new TreeOfRedemptionEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/innistrad/UnbreathingHorde.java b/Mage.Sets/src/mage/sets/innistrad/UnbreathingHorde.java index c51d4a005b9..75a7eed6473 100644 --- a/Mage.Sets/src/mage/sets/innistrad/UnbreathingHorde.java +++ b/Mage.Sets/src/mage/sets/innistrad/UnbreathingHorde.java @@ -102,7 +102,7 @@ class UnbreathingHordeEffect1 extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (permanent != null && player != null) { int amount = game.getBattlefield().countAll(filter1, source.getControllerId(), game) - 1; amount += player.getGraveyard().count(filter2, game); diff --git a/Mage.Sets/src/mage/sets/invasion/AlloyGolem.java b/Mage.Sets/src/mage/sets/invasion/AlloyGolem.java index 92799396ef5..db8e522dc02 100644 --- a/Mage.Sets/src/mage/sets/invasion/AlloyGolem.java +++ b/Mage.Sets/src/mage/sets/invasion/AlloyGolem.java @@ -53,7 +53,7 @@ public class AlloyGolem extends CardImpl { // As Alloy Golem enters the battlefield, choose a color. // Alloy Golem is the chosen color. this.addAbility(new EntersBattlefieldAbility(new BecomesColorSourceEffect(Duration.WhileOnBattlefield), - null, true, "As {this} enters the battlefield, choose a color.\n{this} is the chosen color.", "")); + null, "As {this} enters the battlefield, choose a color.\n{this} is the chosen color.", "")); } public AlloyGolem(final AlloyGolem card) { diff --git a/Mage.Sets/src/mage/sets/invasion/ArdentSoldier.java b/Mage.Sets/src/mage/sets/invasion/ArdentSoldier.java index 8fb23c7cc30..eee53175131 100644 --- a/Mage.Sets/src/mage/sets/invasion/ArdentSoldier.java +++ b/Mage.Sets/src/mage/sets/invasion/ArdentSoldier.java @@ -60,7 +60,7 @@ public class ArdentSoldier extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // If Ardent Soldier was kicked, it enters the battlefield with a +1/+1 counter on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), - KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", "")); + KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", "")); } public ArdentSoldier(final ArdentSoldier card) { diff --git a/Mage.Sets/src/mage/sets/invasion/BenalishLancer.java b/Mage.Sets/src/mage/sets/invasion/BenalishLancer.java index 7fc7d46ab01..cb7bb39c3d8 100644 --- a/Mage.Sets/src/mage/sets/invasion/BenalishLancer.java +++ b/Mage.Sets/src/mage/sets/invasion/BenalishLancer.java @@ -61,7 +61,7 @@ public class BenalishLancer extends CardImpl { // If Benalish Lancer was kicked, it enters the battlefield with two +1/+1 counters on it and with first strike. Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), - KickedCondition.getInstance(), true, + KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with first strike.", ""); ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/invasion/DoOrDie.java b/Mage.Sets/src/mage/sets/invasion/DoOrDie.java new file mode 100644 index 00000000000..20689f03e0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/DoOrDie.java @@ -0,0 +1,132 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.invasion; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class DoOrDie extends CardImpl { + + public DoOrDie(UUID ownerId) { + super(ownerId, 102, "Do or Die", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}"); + this.expansionSetCode = "INV"; + + // Separate all creatures target player controls into two piles. Destroy all creatures in the pile of that player's choice. They can't be regenerated. + this.getSpellAbility().addEffect(new DoOrDieEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + public DoOrDie(final DoOrDie card) { + super(card); + } + + @Override + public DoOrDie copy() { + return new DoOrDie(this); + } +} + +class DoOrDieEffect extends OneShotEffect { + + public DoOrDieEffect() { + super(Outcome.Sacrifice); + this.staticText = "Separate all creatures target player controls into two piles. Destroy all creatures in the pile of that player's choice. They can't be regenerated"; + } + + public DoOrDieEffect(final DoOrDieEffect effect) { + super(effect); + } + + @Override + public DoOrDieEffect copy() { + return new DoOrDieEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Player targetPlayer = game.getPlayer(source.getFirstTarget()); + if (player != null && targetPlayer != null) { + int count = game.getBattlefield().countAll(new FilterCreaturePermanent(), targetPlayer.getId(), game); + TargetCreaturePermanent creatures = new TargetCreaturePermanent(0, count, new FilterCreaturePermanent("creatures to put in the first pile"), true); + List pile1 = new ArrayList<>(); + creatures.setRequired(false); + if (player.choose(Outcome.Neutral, creatures, source.getSourceId(), game)) { + List targets = creatures.getTargets(); + for (UUID targetId : targets) { + Permanent p = game.getPermanent(targetId); + if (p != null) { + pile1.add(p); + } + } + } + List pile2 = new ArrayList<>(); + for (Permanent p: game.getBattlefield().getAllActivePermanents(targetPlayer.getId())) { + if (!pile1.contains(p)) { + pile2.add(p); + } + } + + boolean choice = targetPlayer.choosePile(Outcome.DestroyPermanent, "Choose a pile to destroy.", pile1, pile2, game); + + if (choice) { + destroyPermanents(pile1, game, source); + } else { + destroyPermanents(pile2, game, source); + } + + return true; + } + return false; + } + + private void destroyPermanents(List pile, Game game, Ability source) { + for (Permanent permanent : pile) { + if (permanent != null) { + permanent.destroy(source.getSourceId(), game, true); + } + } + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/Dredge.java b/Mage.Sets/src/mage/sets/invasion/Dredge.java index 9f9d27e9ced..9d0d8a0f142 100644 --- a/Mage.Sets/src/mage/sets/invasion/Dredge.java +++ b/Mage.Sets/src/mage/sets/invasion/Dredge.java @@ -30,14 +30,12 @@ package mage.sets.invasion; import java.util.UUID; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.SacrificeControllerEffect; -import mage.abilities.effects.common.SacrificeTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.target.TargetPermanent; /** * @@ -46,18 +44,18 @@ import mage.target.TargetPermanent; public class Dredge extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("a creature or land"); - + static { filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND))); } - + public Dredge(UUID ownerId) { super(ownerId, 103, "Dredge", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{B}"); this.expansionSetCode = "INV"; // Sacrifice a creature or land. this.getSpellAbility().addEffect(new SacrificeControllerEffect(filter, 1, "")); - + // Draw a card. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); } diff --git a/Mage.Sets/src/mage/sets/invasion/DromarTheBanisher.java b/Mage.Sets/src/mage/sets/invasion/DromarTheBanisher.java index e7df4a3e8c7..07808e4962c 100644 --- a/Mage.Sets/src/mage/sets/invasion/DromarTheBanisher.java +++ b/Mage.Sets/src/mage/sets/invasion/DromarTheBanisher.java @@ -41,7 +41,7 @@ import mage.choices.ChoiceColor; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.players.Player; @@ -63,7 +63,7 @@ public class DromarTheBanisher extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // Whenever Dromar, the Banisher deals combat damage to a player, you may pay {2}{U}. If you do, choose a color, then return all creatures of that color to their owners' hands. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DoIfCostPaid(new DromarTheBanisherEffect(), new ManaCostsImpl("{2}{U}")), false)); } @@ -79,30 +79,30 @@ public class DromarTheBanisher extends CardImpl { } class DromarTheBanisherEffect extends OneShotEffect { - + DromarTheBanisherEffect() { super(Outcome.ReturnToHand); this.staticText = "choose a color, then return all creatures of that color to their owners' hands."; } - + DromarTheBanisherEffect(final DromarTheBanisherEffect effect) { super(effect); } - + @Override public DromarTheBanisherEffect copy() { return new DromarTheBanisherEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player player = game.getPlayer(source.getControllerId()); if (player != null) { ChoiceColor choice = new ChoiceColor(); player.choose(outcome, choice, game); if (choice.getColor() != null) { - game.informPlayers(new StringBuilder(player.getLogName()).append(" chooses ").append(choice.getColor()).toString()); - FilterPermanent filter = new FilterPermanent(); + game.informPlayers(player.getLogName() + " chooses " + choice.getChoice()); + FilterCreaturePermanent filter = new FilterCreaturePermanent(); filter.add(new ColorPredicate(choice.getColor())); new ReturnToHandFromBattlefieldAllEffect(filter).apply(game, source); return true; diff --git a/Mage.Sets/src/mage/sets/invasion/Duskwalker.java b/Mage.Sets/src/mage/sets/invasion/Duskwalker.java index fecf398f9ba..23923ab9284 100644 --- a/Mage.Sets/src/mage/sets/invasion/Duskwalker.java +++ b/Mage.Sets/src/mage/sets/invasion/Duskwalker.java @@ -61,7 +61,7 @@ public class Duskwalker extends CardImpl { // If Duskwalker was kicked, it enters the battlefield with two +1/+1 counters on it and with fear. Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), - KickedCondition.getInstance(), true, + KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with fear.", ""); ability.addEffect(new GainAbilitySourceEffect(FearAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/invasion/FaerieSquadron.java b/Mage.Sets/src/mage/sets/invasion/FaerieSquadron.java index d463f15af2e..4d36fabfd90 100644 --- a/Mage.Sets/src/mage/sets/invasion/FaerieSquadron.java +++ b/Mage.Sets/src/mage/sets/invasion/FaerieSquadron.java @@ -61,7 +61,7 @@ public class FaerieSquadron extends CardImpl { this.addAbility(new KickerAbility("{3}{U}")); // If Faerie Squadron was kicked, it enters the battlefield with two +1/+1 counters on it and with flying. Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), - KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with flying.", ""); + KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with flying.", ""); ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/invasion/KavuAggressor.java b/Mage.Sets/src/mage/sets/invasion/KavuAggressor.java index b0ce21efa99..9b0aaa5aac9 100644 --- a/Mage.Sets/src/mage/sets/invasion/KavuAggressor.java +++ b/Mage.Sets/src/mage/sets/invasion/KavuAggressor.java @@ -59,7 +59,7 @@ public class KavuAggressor extends CardImpl { this.addAbility(new CantBlockAbility()); // If Kavu Aggressor was kicked, it enters the battlefield with a +1/+1 counter on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), - KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", "")); + KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", "")); } public KavuAggressor(final KavuAggressor card) { diff --git a/Mage.Sets/src/mage/sets/invasion/KavuTitan.java b/Mage.Sets/src/mage/sets/invasion/KavuTitan.java index 84a39593671..ed1da4b825d 100644 --- a/Mage.Sets/src/mage/sets/invasion/KavuTitan.java +++ b/Mage.Sets/src/mage/sets/invasion/KavuTitan.java @@ -60,7 +60,7 @@ public class KavuTitan extends CardImpl { this.addAbility(new KickerAbility("{2}{G}")); // If Kavu Titan was kicked, it enters the battlefield with three +1/+1 counters on it and with trample. Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), - KickedCondition.getInstance(), true, + KickedCondition.getInstance(), "If Kavu Titan was kicked, it enters the battlefield with three +1/+1 counters on it and with trample.", ""); ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/invasion/OrimsTouch.java b/Mage.Sets/src/mage/sets/invasion/OrimsTouch.java new file mode 100644 index 00000000000..bec89d9ae44 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/OrimsTouch.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.invasion; + +import java.util.UUID; +import mage.abilities.condition.LockedInCondition; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.decorator.ConditionalReplacementEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class OrimsTouch extends CardImpl { + + public OrimsTouch(UUID ownerId) { + super(ownerId, 23, "Orim's Touch", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "INV"; + + // Kicker {1} + this.addAbility(new KickerAbility("{1}")); + + // Prevent the next 2 damage that would be dealt to target creature or player this turn. If Orim's Touch was kicked, prevent the next 4 damage that would be dealt to that creature or player this turn instead. + Effect effect = new ConditionalReplacementEffect( + new PreventDamageToTargetEffect(Duration.EndOfTurn, 4), + new LockedInCondition(KickedCondition.getInstance()), + new PreventDamageToTargetEffect(Duration.EndOfTurn, 2)); + effect.setText("Prevent the next 2 damage that would be dealt to target creature or player this turn. If Orim's Touch was kicked, prevent the next 4 damage that would be dealt to that creature or player this turn instead"); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(effect); + } + + public OrimsTouch(final OrimsTouch card) { + super(card); + } + + @Override + public OrimsTouch copy() { + return new OrimsTouch(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/invasion/PhyrexianDelver.java b/Mage.Sets/src/mage/sets/invasion/PhyrexianDelver.java index eb4c4a5174d..1178f5af64c 100644 --- a/Mage.Sets/src/mage/sets/invasion/PhyrexianDelver.java +++ b/Mage.Sets/src/mage/sets/invasion/PhyrexianDelver.java @@ -98,7 +98,7 @@ class PhyrexianDelverEffect extends OneShotEffect { if (creatureCard != null && controller != null) { boolean result = false; if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) { - result = controller.putOntoBattlefieldWithInfo(creatureCard, game, Zone.GRAVEYARD, source.getSourceId()); + result = controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game);; } controller.loseLife(creatureCard.getManaCost().convertedManaCost(), game); return result; diff --git a/Mage.Sets/src/mage/sets/invasion/PlagueSpores.java b/Mage.Sets/src/mage/sets/invasion/PlagueSpores.java index db32455cf27..9d1f8fefc0e 100644 --- a/Mage.Sets/src/mage/sets/invasion/PlagueSpores.java +++ b/Mage.Sets/src/mage/sets/invasion/PlagueSpores.java @@ -43,7 +43,7 @@ import mage.target.common.TargetLandPermanent; /** * * @author LoneFox - + * */ public class PlagueSpores extends CardImpl { @@ -58,7 +58,7 @@ public class PlagueSpores extends CardImpl { this.expansionSetCode = "INV"; // Destroy target nonblack creature and target land. They can't be regenerated. - Effect effect = new DestroyTargetEffect(true); + Effect effect = new DestroyTargetEffect(true, true); effect.setText("Destroy target nonblack creature and target land. They can't be regenerated."); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); diff --git a/Mage.Sets/src/mage/sets/invasion/PouncingKavu.java b/Mage.Sets/src/mage/sets/invasion/PouncingKavu.java index 966430d562d..3793017ef35 100644 --- a/Mage.Sets/src/mage/sets/invasion/PouncingKavu.java +++ b/Mage.Sets/src/mage/sets/invasion/PouncingKavu.java @@ -64,7 +64,7 @@ public class PouncingKavu extends CardImpl { this.addAbility(FirstStrikeAbility.getInstance()); // If Pouncing Kavu was kicked, it enters the battlefield with two +1/+1 counters on it and with haste. Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), - KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with haste.", ""); + KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with haste.", ""); ability.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/invasion/PrisonBarricade.java b/Mage.Sets/src/mage/sets/invasion/PrisonBarricade.java index 308b7b9a5fa..a50a302bef4 100644 --- a/Mage.Sets/src/mage/sets/invasion/PrisonBarricade.java +++ b/Mage.Sets/src/mage/sets/invasion/PrisonBarricade.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.common.KickedCondition; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.DefenderAbility; @@ -64,8 +64,8 @@ public class PrisonBarricade extends CardImpl { this.addAbility(new KickerAbility("{1}{W}")); // If Prison Barricade was kicked, it enters the battlefield with a +1/+1 counter on it and with "Prison Barricade can attack as though it didn't have defender." Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), - KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it and with \"{this} can attack as though it didn't have defender.\"", ""); - ability.addEffect(new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield)); + KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it and with \"{this} can attack as though it didn't have defender.\"", ""); + ability.addEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/invasion/RogueKavu.java b/Mage.Sets/src/mage/sets/invasion/RogueKavu.java new file mode 100644 index 00000000000..4d428a0844c --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/RogueKavu.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.invasion; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class RogueKavu extends mage.sets.ninthedition.RogueKavu { + + public RogueKavu(UUID ownerId) { + super(ownerId); + this.cardNumber = 160; + this.expansionSetCode = "INV"; + } + + public RogueKavu(final RogueKavu card) { + super(card); + } + + @Override + public RogueKavu copy() { + return new RogueKavu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/SpiritOfResistance.java b/Mage.Sets/src/mage/sets/invasion/SpiritOfResistance.java new file mode 100644 index 00000000000..8cf66a1f33d --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/SpiritOfResistance.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.invasion; + +import java.util.HashSet; +import java.util.UUID; + +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.decorator.ConditionalReplacementEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventAllDamageToControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author Quercitron + */ +public class SpiritOfResistance extends CardImpl { + + public SpiritOfResistance(UUID ownerId) { + super(ownerId, 38, "Spirit of Resistance", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); + this.expansionSetCode = "INV"; + + // As long as you control a permanent of each color, prevent all damage that would be dealt to you. + Effect effect = new ConditionalReplacementEffect( + new PreventAllDamageToControllerEffect(Duration.WhileOnBattlefield), + SpiritOfResistanceCondition.getInstance()); + effect.setText("As long as you control a permanent of each color, prevent all damage that would be dealt to you."); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public SpiritOfResistance(final SpiritOfResistance card) { + super(card); + } + + @Override + public SpiritOfResistance copy() { + return new SpiritOfResistance(this); + } +} + +class SpiritOfResistanceCondition implements Condition { + + private static final SpiritOfResistanceCondition fInstance = new SpiritOfResistanceCondition(); + + public static SpiritOfResistanceCondition getInstance() { + return fInstance; + }; + + private SpiritOfResistanceCondition() {} + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + HashSet colors = new HashSet<>(); + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) { + if (permanent.getColor(game).isBlack()) { + colors.add(ObjectColor.BLACK); + } + if (permanent.getColor(game).isBlue()) { + colors.add(ObjectColor.BLUE); + } + if (permanent.getColor(game).isRed()) { + colors.add(ObjectColor.RED); + } + if (permanent.getColor(game).isGreen()) { + colors.add(ObjectColor.GREEN); + } + if (permanent.getColor(game).isWhite()) { + colors.add(ObjectColor.WHITE); + } + } + return colors.size() >= 5; + } + return false; + } + + @Override + public String toString() { + return "you control a permanent of each color"; + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/TeferisResponse.java b/Mage.Sets/src/mage/sets/invasion/TeferisResponse.java new file mode 100644 index 00000000000..57e5f15db4f --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/TeferisResponse.java @@ -0,0 +1,113 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.invasion; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterStackObject; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.other.TargetsPermanentPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.StackObject; +import mage.target.TargetStackObject; + +/** + * + * @author AlumiuN + */ +public class TeferisResponse extends CardImpl { + + private final static FilterStackObject filter = new FilterStackObject("spell or ability an opponent controls that targets a land you control"); + + static { + filter.add(new TargetsPermanentPredicate(new FilterControlledLandPermanent())); + } + + public TeferisResponse(UUID ownerId) { + super(ownerId, 78, "Teferi's Response", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "INV"; + + // Counter target spell or ability an opponent controls that targets a land you control. If a permanent's ability is countered this way, destroy that permanent. + this.getSpellAbility().addEffect(new TeferisResponseEffect()); + this.getSpellAbility().addTarget(new TargetStackObject(filter)); + + // Draw two cards. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2)); + } + + public TeferisResponse(final TeferisResponse card) { + super(card); + } + + @Override + public TeferisResponse copy() { + return new TeferisResponse(this); + } +} + +class TeferisResponseEffect extends OneShotEffect { + + public TeferisResponseEffect() { + super(Outcome.Detriment); + this.staticText = "Counter target spell or ability an opponent controls that targets a land you control. If a permanent's ability is countered this way, destroy that permanent"; + } + + public TeferisResponseEffect(final TeferisResponseEffect effect) { + super(effect); + } + + @Override + public TeferisResponseEffect copy() { + return new TeferisResponseEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID targetId = source.getFirstTarget(); + StackObject stackObject = game.getStack().getStackObject(targetId); + if (targetId != null && game.getStack().counter(targetId, source.getSourceId(), game)) { + UUID permanentId = stackObject.getSourceId(); + if (permanentId != null) { + Permanent usedPermanent = game.getPermanent(permanentId); + if (usedPermanent != null) { + usedPermanent.destroy(source.getSourceId(), game, false); + } + } + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/invasion/ThicketElemental.java b/Mage.Sets/src/mage/sets/invasion/ThicketElemental.java index 142a7b4fc14..e669ddd5ade 100644 --- a/Mage.Sets/src/mage/sets/invasion/ThicketElemental.java +++ b/Mage.Sets/src/mage/sets/invasion/ThicketElemental.java @@ -67,7 +67,7 @@ public class ThicketElemental extends CardImpl { // When Thicket Elemental enters the battlefield, if it was kicked, you may reveal cards from the top of your library until you reveal a creature card. If you do, put that card onto the battlefield and shuffle all other cards revealed this way into your library. TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ThicketElementalEffect()); this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), - "When {this} enters the battlefield, if it was kicked, you may reveal cards from the top of your library until you reveal a creature card. If you do, put that card onto the battlefield and shuffle all other cards revealed this way into your library.")); + "When {this} enters the battlefield, if it was kicked, you may reveal cards from the top of your library until you reveal a creature card. If you do, put that card onto the battlefield and shuffle all other cards revealed this way into your library.")); } public ThicketElemental(final ThicketElemental card) { @@ -82,8 +82,6 @@ public class ThicketElemental extends CardImpl { class ThicketElementalEffect extends OneShotEffect { - - public ThicketElementalEffect() { super(Outcome.Benefit); staticText = "if {this} was kicked, reveal cards from the top of your library until you reveal a creature card. Put that card onto the battlefield and shuffle all other cards revealed this way into your library"; @@ -102,15 +100,13 @@ class ThicketElementalEffect extends OneShotEffect { while (controller.getLibrary().size() > 0) { Card card = controller.getLibrary().removeFromTop(game); if (card.getCardType().contains(CardType.CREATURE)) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); break; } revealedCards.add(card); } - controller.revealCards("ThicketElemental", revealedCards, game); - for (Card card: revealedCards.getCards(game)) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } + controller.revealCards(sourceObject.getIdName(), revealedCards, game); + controller.moveCards(revealedCards, Zone.LIBRARY, source, game); controller.shuffleLibrary(game); return true; } @@ -121,4 +117,4 @@ class ThicketElementalEffect extends OneShotEffect { public ThicketElementalEffect copy() { return new ThicketElementalEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/invasion/TsabosDecree.java b/Mage.Sets/src/mage/sets/invasion/TsabosDecree.java new file mode 100644 index 00000000000..b18b50240a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/TsabosDecree.java @@ -0,0 +1,133 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.invasion; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.repository.CardRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class TsabosDecree extends CardImpl { + + public TsabosDecree(UUID ownerId) { + super(ownerId, 129, "Tsabo's Decree", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{5}{B}"); + this.expansionSetCode = "INV"; + + // Choose a creature type. Target player reveals his or her hand and discards all creature cards of that type. Then destroy all creatures of that type that player controls. They can't be regenerated. + this.getSpellAbility().addEffect(new TsabosDecreeEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + public TsabosDecree(final TsabosDecree card) { + super(card); + } + + @Override + public TsabosDecree copy() { + return new TsabosDecree(this); + } +} + +class TsabosDecreeEffect extends OneShotEffect { + + public TsabosDecreeEffect() { + super(Outcome.UnboostCreature); + staticText = "Choose a creature type. Target player reveals his or her hand and discards all creature cards of that type. Then destroy all creatures of that type that player controls. They can't be regenerated"; + } + + public TsabosDecreeEffect(final TsabosDecreeEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (player != null) { + Choice typeChoice = new ChoiceImpl(true); + typeChoice.setMessage("Choose a creature type:"); + typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); + while (!player.choose(outcome, typeChoice, game)) { + if (!player.canRespond()) { + return false; + } + } + if (typeChoice.getChoice() != null) { + game.informPlayers(sourceObject.getLogName() + " chosen type: " + typeChoice.getChoice()); + } + targetPlayer.revealCards("hand of " + targetPlayer.getName(), targetPlayer.getHand(), game); + FilterCard filterCard = new FilterCard(); + filterCard.add(new SubtypePredicate(typeChoice.getChoice())); + List toDiscard = new ArrayList<>(); + for (Card card : targetPlayer.getHand().getCards(game)) { + if(filterCard.match(card, game)) { + toDiscard.add(card); + } + } + for(Card card: toDiscard) { + targetPlayer.discard(card, source, game); + } + FilterCreaturePermanent filterCreaturePermanent = new FilterCreaturePermanent(); + filterCreaturePermanent.add(new SubtypePredicate(typeChoice.getChoice())); + for (Permanent creature : game.getBattlefield().getActivePermanents(filterCreaturePermanent, source.getSourceId(), game)) { + if (creature.getControllerId().equals(targetPlayer.getId())) { + creature.destroy(source.getSourceId(), game, true); + } + } + return true; + } + return false; + } + + @Override + public TsabosDecreeEffect copy() { + return new TsabosDecreeEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/UrborgSkeleton.java b/Mage.Sets/src/mage/sets/invasion/UrborgSkeleton.java index 6a5a08663fd..a729cf2c00c 100644 --- a/Mage.Sets/src/mage/sets/invasion/UrborgSkeleton.java +++ b/Mage.Sets/src/mage/sets/invasion/UrborgSkeleton.java @@ -68,7 +68,7 @@ public class UrborgSkeleton extends CardImpl { // If Urborg Skeleton was kicked, it enters the battlefield with a +1/+1 counter on it. Ability ability = new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), - KickedCondition.getInstance(),false, staticText,""); + KickedCondition.getInstance(), staticText,""); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/invasion/VodalianSerpent.java b/Mage.Sets/src/mage/sets/invasion/VodalianSerpent.java index 02703289141..44d4bd6a633 100644 --- a/Mage.Sets/src/mage/sets/invasion/VodalianSerpent.java +++ b/Mage.Sets/src/mage/sets/invasion/VodalianSerpent.java @@ -62,7 +62,7 @@ public class VodalianSerpent extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackUnlessDefenderControllsPermanent(new FilterLandPermanent("Island", "an Island")))); // If Vodalian Serpent was kicked, it enters the battlefield with four +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)), - KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with four +1/+1 counters on it.", "")); + KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with four +1/+1 counters on it.", "")); } public VodalianSerpent(final VodalianSerpent card) { diff --git a/Mage.Sets/src/mage/sets/izzetvsgolgari/Thunderheads.java b/Mage.Sets/src/mage/sets/izzetvsgolgari/Thunderheads.java new file mode 100644 index 00000000000..8e10cd639fb --- /dev/null +++ b/Mage.Sets/src/mage/sets/izzetvsgolgari/Thunderheads.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.izzetvsgolgari; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class Thunderheads extends mage.sets.guildpact.Thunderheads { + + public Thunderheads(UUID ownerId) { + super(ownerId); + this.cardNumber = 23; + this.expansionSetCode = "DDJ"; + } + + public Thunderheads(final Thunderheads card) { + super(card); + } + + @Override + public Thunderheads copy() { + return new Thunderheads(this); + } +} diff --git a/Mage.Sets/src/mage/sets/jacevschandra/FathomSeer.java b/Mage.Sets/src/mage/sets/jacevschandra/FathomSeer.java index b3b9fa11778..e322cd800d2 100644 --- a/Mage.Sets/src/mage/sets/jacevschandra/FathomSeer.java +++ b/Mage.Sets/src/mage/sets/jacevschandra/FathomSeer.java @@ -30,7 +30,7 @@ package mage.sets.jacevschandra; import java.util.UUID; import mage.MageInt; import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.keyword.MorphAbility; import mage.cards.CardImpl; @@ -60,7 +60,7 @@ public class FathomSeer extends CardImpl { this.toughness = new MageInt(3); // Morph-Return two Islands you control to their owner's hand. - this.addAbility(new MorphAbility(this, new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(2,2, filter, true)))); + this.addAbility(new MorphAbility(this, new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2,2, filter, true)))); // When Fathom Seer is turned face up, draw two cards. this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new DrawCardSourceControllerEffect(2))); } diff --git a/Mage.Sets/src/mage/sets/jacevschandra/Gush.java b/Mage.Sets/src/mage/sets/jacevschandra/Gush.java index eabcd98d8c8..ab9d0a300fa 100644 --- a/Mage.Sets/src/mage/sets/jacevschandra/Gush.java +++ b/Mage.Sets/src/mage/sets/jacevschandra/Gush.java @@ -29,7 +29,7 @@ package mage.sets.jacevschandra; import java.util.UUID; import mage.abilities.costs.AlternativeCostSourceAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -55,7 +55,7 @@ public class Gush extends CardImpl { // You may return two Islands you control to their owner's hand rather than pay Gush's mana cost. AlternativeCostSourceAbility ability; - ability = new AlternativeCostSourceAbility(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(2, 2, filter, true))); + ability = new AlternativeCostSourceAbility(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2, 2, filter, true))); this.addAbility(ability); // Draw two cards. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2)); diff --git a/Mage.Sets/src/mage/sets/jacevschandra/Hostility.java b/Mage.Sets/src/mage/sets/jacevschandra/Hostility.java new file mode 100644 index 00000000000..615e706f705 --- /dev/null +++ b/Mage.Sets/src/mage/sets/jacevschandra/Hostility.java @@ -0,0 +1,149 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.jacevschandra; + +import java.util.Arrays; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.PutIntoGraveFromAnywhereSourceTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.PreventionEffectData; +import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.ShuffleIntoLibrarySourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.token.Token; +import mage.game.stack.Spell; + +/** + * + * @author LevelX2 + */ +public class Hostility extends CardImpl { + + public Hostility(UUID ownerId) { + super(ownerId, 48, "Hostility", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}{R}"); + this.expansionSetCode = "DD2"; + this.subtype.add("Elemental"); + this.subtype.add("Incarnation"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // If a spell you control would deal damage to an opponent, prevent that damage. + // Put a 3/1 red Elemental Shaman creature token with haste onto the battlefield for each 1 damage prevented this way. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HostilityEffect())); + + // When Hostility is put into a graveyard from anywhere, shuffle it into its owner's library. + this.addAbility(new PutIntoGraveFromAnywhereSourceTriggeredAbility(new ShuffleIntoLibrarySourceEffect())); + } + + public Hostility(final Hostility card) { + super(card); + } + + @Override + public Hostility copy() { + return new Hostility(this); + } +} + +class HostilityEffect extends PreventionEffectImpl { + + public HostilityEffect() { + super(Duration.WhileOnBattlefield, Integer.MAX_VALUE, false, false); + staticText = "If a spell you control would deal damage to an opponent, prevent that damage. Put a 3/1 red Elemental Shaman creature token with haste onto the battlefield for each 1 damage prevented this way."; + } + + public HostilityEffect(final HostilityEffect effect) { + super(effect); + } + + @Override + public HostilityEffect copy() { + return new HostilityEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + switch (event.getType()) { + case DAMAGE_PLAYER: + return true; + } + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (super.applies(event, source, game)) { + if (game.getOpponents(source.getControllerId()).contains(event.getTargetId())) { + Spell spell = game.getStack().getSpell(event.getSourceId()); + if (spell != null && spell.getControllerId().equals(source.getControllerId())) { + return true; + } + } + } + return false; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + PreventionEffectData preventionEffectData = preventDamageAction(event, source, game); + if (preventionEffectData.getPreventedDamage() > 0) { + new CreateTokenEffect(new HostilityElementalToken(), preventionEffectData.getPreventedDamage()).apply(game, source); + } + return true; + } +} + +class HostilityElementalToken extends Token { + + public HostilityElementalToken() { + super("Elemental Shaman", "3/1 red Elemental Shaman creature token with haste"); + availableImageSetCodes.addAll(Arrays.asList("LRW", "DD2")); + cardType.add(CardType.CREATURE); + color.setRed(true); + subtype.add("Elemental"); + subtype.add("Shaman"); + power = new MageInt(3); + toughness = new MageInt(1); + + addAbility(HasteAbility.getInstance()); + } + +} diff --git a/Mage.Sets/src/mage/sets/jacevschandra/KeldonMegaliths.java b/Mage.Sets/src/mage/sets/jacevschandra/KeldonMegaliths.java index c1ffdf3b879..33133b6bbbd 100644 --- a/Mage.Sets/src/mage/sets/jacevschandra/KeldonMegaliths.java +++ b/Mage.Sets/src/mage/sets/jacevschandra/KeldonMegaliths.java @@ -57,7 +57,7 @@ public class KeldonMegaliths extends CardImpl { this.addAbility(new RedManaAbility()); // Hellbent - {1}{R}, {tap}: Keldon Megaliths deals 1 damage to target creature or player. Activate this ability only if you have no cards in hand. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl<>("{1}{R}"), HellbentCondition.getInstance(), - "Hellbent - {1}{R}, {tap}: {this} deals 1 damage to target creature or player. Activate this ability only if you have no cards in hand."); + "Hellbent — {1}{R}, {T}: {this} deals 1 damage to target creature or player. Activate this ability only if you have no cards in hand."); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/jacevschandra/Ophidian.java b/Mage.Sets/src/mage/sets/jacevschandra/Ophidian.java new file mode 100644 index 00000000000..2e3c2045e10 --- /dev/null +++ b/Mage.Sets/src/mage/sets/jacevschandra/Ophidian.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.jacevschandra; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Ophidian extends mage.sets.vintagemasters.Ophidian { + + public Ophidian(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "DD2"; + } + + public Ophidian(final Ophidian card) { + super(card); + } + + @Override + public Ophidian copy() { + return new Ophidian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/jacevschandra/WaterspoutDjinn.java b/Mage.Sets/src/mage/sets/jacevschandra/WaterspoutDjinn.java index ecf4bef9930..711ed79fc65 100644 --- a/Mage.Sets/src/mage/sets/jacevschandra/WaterspoutDjinn.java +++ b/Mage.Sets/src/mage/sets/jacevschandra/WaterspoutDjinn.java @@ -30,7 +30,7 @@ package mage.sets.jacevschandra; import java.util.UUID; import mage.MageInt; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -67,7 +67,7 @@ public class WaterspoutDjinn extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // At the beginning of your upkeep, sacrifice Waterspout Djinn unless you return an untapped Island you control to its owner's hand. this.addAbility(new BeginningOfUpkeepTriggeredAbility( - new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))), + new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))), TargetController.YOU, false)); } diff --git a/Mage.Sets/src/mage/sets/jacevsvraska/BodyDouble.java b/Mage.Sets/src/mage/sets/jacevsvraska/BodyDouble.java index ef7d31f7976..de36fde3e17 100644 --- a/Mage.Sets/src/mage/sets/jacevsvraska/BodyDouble.java +++ b/Mage.Sets/src/mage/sets/jacevsvraska/BodyDouble.java @@ -30,8 +30,7 @@ package mage.sets.jacevsvraska; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CopyEffect; import mage.cards.Card; @@ -40,10 +39,8 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; -import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; import mage.target.common.TargetCardInGraveyard; @@ -63,11 +60,7 @@ public class BodyDouble extends CardImpl { this.toughness = new MageInt(0); // You may have Body Double enter the battlefield as a copy of any creature card in a graveyard. - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( - new BodyDoubleCopyEffect(), - "You may have {this} enter the battlefield as a copy of any creature card in a graveyard", - true)); - this.addAbility(ability); + this.addAbility(new EntersBattlefieldAbility(new BodyDoubleCopyEffect(), true)); } @@ -85,7 +78,7 @@ class BodyDoubleCopyEffect extends OneShotEffect { public BodyDoubleCopyEffect() { super(Outcome.Copy); - this.staticText = "You may have {this} enter the battlefield as a copy of any creature card in a graveyard"; + this.staticText = "as a copy of any creature card in a graveyard"; } public BodyDoubleCopyEffect(final BodyDoubleCopyEffect effect) { @@ -95,8 +88,7 @@ class BodyDoubleCopyEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (player != null && sourcePermanent != null) { + if (player != null) { Target target = new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard")); target.setNotTarget(true); if (target.canChoose(source.getControllerId(), game)) { diff --git a/Mage.Sets/src/mage/sets/jacevsvraska/DroolingGroodion.java b/Mage.Sets/src/mage/sets/jacevsvraska/DroolingGroodion.java index b27d9824f79..dda545b51ea 100644 --- a/Mage.Sets/src/mage/sets/jacevsvraska/DroolingGroodion.java +++ b/Mage.Sets/src/mage/sets/jacevsvraska/DroolingGroodion.java @@ -44,6 +44,7 @@ import mage.constants.SubLayer; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AnotherTargetPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -66,8 +67,17 @@ public class DroolingGroodion extends CardImpl { // {2}{B}{G}, Sacrifice a creature: Target creature gets +2/+2 until end of turn. Another target creature gets -2/-2 until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DroolingGroodionEffect(), new ManaCostsImpl("{2}{B}{G}")); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent(), true))); - ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (first target)"))); - ability.addTarget(new TargetOtherCreaturePermanent(new FilterCreaturePermanent("creature (second target)"))); + + TargetCreaturePermanent target = new TargetCreaturePermanent(new FilterCreaturePermanent("creature (first target)")); + target.setTargetTag(1); + ability.addTarget(target); + + FilterCreaturePermanent filter = new FilterCreaturePermanent("another target creature (second target"); + filter.add(new AnotherTargetPredicate(2)); + target = new TargetCreaturePermanent(filter); + target.setTargetTag(2); + ability.addTarget(target); + this.addAbility(ability); } @@ -112,28 +122,3 @@ class DroolingGroodionEffect extends ContinuousEffectImpl { return true; } } - -class TargetOtherCreaturePermanent extends TargetCreaturePermanent { - - public TargetOtherCreaturePermanent(FilterCreaturePermanent filter) { - super(filter); - } - - public TargetOtherCreaturePermanent(final TargetOtherCreaturePermanent target) { - super(target); - } - - @Override - public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { - if (source.getTargets().get(0).getTargets().contains(id)) { - return false; - } - return super.canTarget(controllerId, id, source, game); - } - - @Override - public TargetOtherCreaturePermanent copy() { - return new TargetOtherCreaturePermanent(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/AjaniMentorOfHeroes.java b/Mage.Sets/src/mage/sets/journeyintonyx/AjaniMentorOfHeroes.java index 82266793698..2fce108dbb9 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/AjaniMentorOfHeroes.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/AjaniMentorOfHeroes.java @@ -30,11 +30,10 @@ package mage.sets.journeyintonyx; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -62,7 +61,7 @@ public class AjaniMentorOfHeroes extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control"); private static final FilterCard filterCard = new FilterCard("an Aura, creature, or planeswalker card"); - + static { filter.add(new ControllerPredicate(TargetController.YOU)); filterCard.add(Predicates.or( @@ -70,23 +69,22 @@ public class AjaniMentorOfHeroes extends CardImpl { new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.PLANESWALKER))); } - + public AjaniMentorOfHeroes(UUID ownerId) { super(ownerId, 145, "Ajani, Mentor of Heroes", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{G}{W}"); this.expansionSetCode = "JOU"; this.subtype.add("Ajani"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Distribute three +1/+1 counters among one, two, or three target creatures you control Ability ability = new LoyaltyAbility(new AjaniMentorOfHeroesAddCountersEffect(), 1); ability.addTarget(new TargetCreaturePermanentAmount(3, filter)); this.addAbility(ability); - + // +1: Look at the top four cards of your library. You may reveal an Aura, creature, or planeswalker card from among them and put that card into your hand. Put the rest on the bottom of your library in any order. - this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(4,1, filterCard,true, false, Zone.HAND, true), 1)); - + this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(4, 1, filterCard, true, false, Zone.HAND, true), 1)); + // -8: You gain 100 life. this.addAbility(new LoyaltyAbility(new GainLifeEffect(100), -8)); } @@ -122,7 +120,7 @@ class AjaniMentorOfHeroesAddCountersEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && source.getTargets().size() > 0) { Target multiTarget = source.getTargets().get(0); - for (UUID target: multiTarget.getTargets()) { + for (UUID target : multiTarget.getTargets()) { Permanent permanent = game.getPermanent(target); if (permanent != null) { permanent.addCounters(CounterType.P1P1.createInstance(multiTarget.getTargetAmount(target)), game); diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/BloodcrazedHoplite.java b/Mage.Sets/src/mage/sets/journeyintonyx/BloodcrazedHoplite.java index c5b745b5894..d72892f67f3 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/BloodcrazedHoplite.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/BloodcrazedHoplite.java @@ -72,7 +72,7 @@ public class BloodcrazedHoplite extends CardImpl { this.addAbility(new HeroicAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(), false))); // Whenever a +1/+1 counter is placed on Bloodcrazed Hoplite, remove a +1/+1 counter from target creature an opponent controls. Ability ability = new BloodcrazedHopliteTriggeredAbility(); - ability.addTarget(new TargetCreaturePermanent()); + ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } @@ -89,7 +89,7 @@ public class BloodcrazedHoplite extends CardImpl { class BloodcrazedHopliteTriggeredAbility extends TriggeredAbilityImpl { public BloodcrazedHopliteTriggeredAbility() { - super(Zone.BATTLEFIELD, new RemoveCounterTargetEffect(CounterType.P1P1.createInstance()), true); + super(Zone.ALL, new RemoveCounterTargetEffect(CounterType.P1P1.createInstance()), true); } public BloodcrazedHopliteTriggeredAbility(BloodcrazedHopliteTriggeredAbility ability) { diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/BrainMaggot.java b/Mage.Sets/src/mage/sets/journeyintonyx/BrainMaggot.java index 3f758c3321a..db20609309e 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/BrainMaggot.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/BrainMaggot.java @@ -192,7 +192,7 @@ class BrainMaggotReturnExiledCardEffect extends OneShotEffect { ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter)); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (exile != null && sourcePermanent != null) { - controller.moveCards(exile, null, Zone.HAND, source, game); + controller.moveCards(exile, Zone.HAND, source, game); return true; } } diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/ChariotOfVictory.java b/Mage.Sets/src/mage/sets/journeyintonyx/ChariotOfVictory.java index 747069e6406..7959491202b 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/ChariotOfVictory.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/ChariotOfVictory.java @@ -61,7 +61,7 @@ public class ChariotOfVictory extends CardImpl { effect.setText(", trample"); ability.addEffect(effect); effect = new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT); - effect.setText(" and haste"); + effect.setText("and haste"); ability.addEffect(effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/DesertersQuarters.java b/Mage.Sets/src/mage/sets/journeyintonyx/DesertersQuarters.java index 41c34c3891e..37de64705da 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/DesertersQuarters.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/DesertersQuarters.java @@ -29,21 +29,16 @@ package mage.sets.journeyintonyx; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.Mode; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SkipUntapOptionalAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.RestrictionEffect; +import mage.abilities.effects.common.DontUntapAsLongAsSourceTappedEffect; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; /** @@ -60,12 +55,11 @@ public class DesertersQuarters extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {6}, T: Tap target creature. It doesn't untap during its controller's untap step for as long as Deserter's Quarters remains tapped. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DesertersQuartersTapTargetEffect(), new GenericManaCost(6)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new GenericManaCost(6)); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); + ability.addEffect(new DontUntapAsLongAsSourceTappedEffect()); this.addAbility(ability); - - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DesertersQuartersRestrictionEffect())); } public DesertersQuarters(final DesertersQuarters card) { @@ -77,79 +71,3 @@ public class DesertersQuarters extends CardImpl { return new DesertersQuarters(this); } } - -class DesertersQuartersTapTargetEffect extends TapTargetEffect { - - public DesertersQuartersTapTargetEffect() { - super(); - staticText = "Tap target creature. It doesn't untap during its controller's untap step for as long as {this} remains tapped"; - } - - public DesertersQuartersTapTargetEffect(final DesertersQuartersTapTargetEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (sourcePermanent != null) { - sourcePermanent.clearConnectedCards("DesertersQuarters"); - } - for (UUID target : targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(target); - if (sourcePermanent != null) { - sourcePermanent.addConnectedCard("DesertersQuarters", permanent.getId()); - } - if (permanent != null) { - permanent.tap(game); - } - } - return true; - } - - @Override - public DesertersQuartersTapTargetEffect copy() { - return new DesertersQuartersTapTargetEffect(this); - } - - @Override - public String getText(Mode mode) { - return staticText; - } -} - -class DesertersQuartersRestrictionEffect extends RestrictionEffect { - - public DesertersQuartersRestrictionEffect() { - super(Duration.WhileOnBattlefield); - } - - public DesertersQuartersRestrictionEffect(final DesertersQuartersRestrictionEffect effect) { - super(effect); - } - - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - Permanent rustTick = game.getPermanent(source.getSourceId()); - if (rustTick != null && rustTick.isTapped()) { - if (rustTick.getConnectedCards("DesertersQuarters").size() > 0) { - UUID target = rustTick.getConnectedCards("DesertersQuarters").get(0); - if (target != null && target.equals(permanent.getId())) { - return true; - } - } - } - return false; - } - - @Override - public boolean canBeUntapped(Permanent permanent, Ability source, Game game) { - return false; - } - - @Override - public DesertersQuartersRestrictionEffect copy() { - return new DesertersQuartersRestrictionEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/DictateOfErebos.java b/Mage.Sets/src/mage/sets/journeyintonyx/DictateOfErebos.java index 6fd46c4aaf0..82b8bc6e849 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/DictateOfErebos.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/DictateOfErebos.java @@ -44,22 +44,21 @@ import mage.filter.predicate.permanent.ControllerPredicate; * @author LevelX2 */ public class DictateOfErebos extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you control"); - + static { filter.add(new ControllerPredicate(TargetController.YOU)); } - + public DictateOfErebos(UUID ownerId) { super(ownerId, 65, "Dictate of Erebos", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}"); this.expansionSetCode = "JOU"; - // Flash this.addAbility(FlashAbility.getInstance()); // Whenever a creature you control dies, each opponent sacrifices a creature. - this.addAbility(new DiesCreatureTriggeredAbility(new SacrificeOpponentsEffect(new FilterControlledCreaturePermanent("a creature")), false, filter)); + this.addAbility(new DiesCreatureTriggeredAbility(new SacrificeOpponentsEffect(new FilterControlledCreaturePermanent("a creature")), false, filter)); } public DictateOfErebos(final DictateOfErebos card) { diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/HallOfTriumph.java b/Mage.Sets/src/mage/sets/journeyintonyx/HallOfTriumph.java index 6fb34b789b2..6423e7622b4 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/HallOfTriumph.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/HallOfTriumph.java @@ -33,9 +33,8 @@ import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseColorEffect; import mage.cards.CardImpl; -import mage.choices.ChoiceColor; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -46,8 +45,6 @@ import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.players.Player; - /** * @@ -61,7 +58,7 @@ public class HallOfTriumph extends CardImpl { this.supertype.add("Legendary"); // As Hall of Triumph enters the battlefield choose a color. - this.addAbility(new AsEntersBattlefieldAbility(new HallOfTriumphEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral))); // Creatures you control of the chosen color get +1/+1. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HallOfTriumphBoostControlledEffect())); } @@ -76,45 +73,6 @@ public class HallOfTriumph extends CardImpl { } } -class HallOfTriumphEffect extends OneShotEffect { - - public HallOfTriumphEffect() { - super(Outcome.BoostCreature); - staticText = "choose a color"; - } - - public HallOfTriumphEffect(final HallOfTriumphEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - ChoiceColor colorChoice = new ChoiceColor(); - colorChoice.setMessage("Choose color"); - while (!player.choose(Outcome.BoostCreature, colorChoice, game)) { - if (!player.canRespond()) { - return false; - } - } - if (colorChoice.getChoice() != null) { - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + colorChoice.getChoice()); - game.getState().setValue(permanent.getId() + "_color", colorChoice.getColor()); - permanent.addInfo("chosen color", "Chosen color: " + colorChoice.getColor().getDescription() + "", game); - } - } - return false; - } - - @Override - public HallOfTriumphEffect copy() { - return new HallOfTriumphEffect(this); - } - -} - class HallOfTriumphBoostControlledEffect extends ContinuousEffectImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); @@ -137,7 +95,7 @@ class HallOfTriumphBoostControlledEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); if (color != null) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { if (perm.getColor(game).shares(color)) { perm.addPower(1); perm.addToughness(1); diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/MarketFestival.java b/Mage.Sets/src/mage/sets/journeyintonyx/MarketFestival.java index affa7e15e95..6f4c011d920 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/MarketFestival.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/MarketFestival.java @@ -111,7 +111,7 @@ class MarketFestivalTriggeredAbility extends TriggeredManaAbility { @Override public String getRule() { - return "Whenever enchanted land is tapped for mana, its controller adds two mana in any combination of colors to his or her mana pool (in addition to the mana the land produces)."; + return "Whenever enchanted land is tapped for mana, its controller adds two mana in any combination of colors to his or her mana pool (in addition to the mana the land produces)."; } } @@ -154,15 +154,15 @@ class MarketFestivalManaEffect extends ManaEffect { } if (choiceColor.getColor().isBlack()) { - mana.addBlack(); + mana.increaseBlack(); } else if (choiceColor.getColor().isBlue()) { - mana.addBlue(); + mana.increaseBlue(); } else if (choiceColor.getColor().isRed()) { - mana.addRed(); + mana.increaseRed(); } else if (choiceColor.getColor().isGreen()) { - mana.addGreen(); + mana.increaseGreen(); } else if (choiceColor.getColor().isWhite()) { - mana.addWhite(); + mana.increaseWhite(); } } checkToFirePossibleEvents(mana, game, source); diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/PensiveMinotaur.java b/Mage.Sets/src/mage/sets/journeyintonyx/PensiveMinotaur.java index 81c49ed6e25..6fcac8eda9a 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/PensiveMinotaur.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/PensiveMinotaur.java @@ -43,6 +43,7 @@ public class PensiveMinotaur extends CardImpl { super(ownerId, 105, "Pensive Minotaur", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.expansionSetCode = "JOU"; this.subtype.add("Minotaur"); + this.subtype.add("Warrior"); this.power = new MageInt(2); this.toughness = new MageInt(3); diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/PolymorphousRush.java b/Mage.Sets/src/mage/sets/journeyintonyx/PolymorphousRush.java index fe4506ed668..333cbdde27e 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/PolymorphousRush.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/PolymorphousRush.java @@ -64,7 +64,7 @@ public class PolymorphousRush extends CardImpl { // Strive - Polymorphous Rush costs {1}{U} more to cast for each target beyond the first. this.addAbility(new StriveAbility("{1}{U}")); - + // Choose a creature on the battlefield. Any number of target creatures you control each become a copy of that creature until end of turn. this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, filter, false)); this.getSpellAbility().addEffect(new PolymorphousRushCopyEffect()); @@ -82,21 +82,21 @@ public class PolymorphousRush extends CardImpl { } class PolymorphousRushCopyEffect extends OneShotEffect { - + public PolymorphousRushCopyEffect() { super(Outcome.Copy); this.staticText = "Choose a creature on the battlefield. Any number of target creatures you control each become a copy of that creature until end of turn"; } - + public PolymorphousRushCopyEffect(final PolymorphousRushCopyEffect effect) { super(effect); } - + @Override public PolymorphousRushCopyEffect copy() { return new PolymorphousRushCopyEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); @@ -107,10 +107,10 @@ class PolymorphousRushCopyEffect extends OneShotEffect { if (target.canChoose(source.getId(), controller.getId(), game) && controller.chooseTarget(outcome, target, source, game)) { Permanent copyFromCreature = game.getPermanent(target.getFirstTarget()); if (copyFromCreature != null) { - for (UUID copyToId: getTargetPointer().getTargets(game, source)) { + for (UUID copyToId : getTargetPointer().getTargets(game, source)) { Permanent copyToCreature = game.getPermanent(copyToId); if (copyToCreature != null) { - game.copyPermanent(Duration.EndOfTurn, copyFromCreature, copyToCreature, source, new EmptyApplyToPermanent()); + game.copyPermanent(Duration.EndOfTurn, copyFromCreature, copyToId, source, new EmptyApplyToPermanent()); } } } @@ -119,4 +119,5 @@ class PolymorphousRushCopyEffect extends OneShotEffect { } return false; } + } diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/QuarryColossus.java b/Mage.Sets/src/mage/sets/journeyintonyx/QuarryColossus.java index bc3084b4b15..b906849775c 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/QuarryColossus.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/QuarryColossus.java @@ -30,7 +30,6 @@ package mage.sets.journeyintonyx; import java.util.Deque; import java.util.LinkedList; import java.util.UUID; -import java.util.logging.Logger; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/SpitefulBlow.java b/Mage.Sets/src/mage/sets/journeyintonyx/SpitefulBlow.java index 48dbb0da2ce..578166c9807 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/SpitefulBlow.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/SpitefulBlow.java @@ -33,10 +33,8 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.target.Target; import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetLandPermanent; -import mage.target.targetpointer.SecondTargetPointer; /** * @@ -48,16 +46,12 @@ public class SpitefulBlow extends CardImpl { super(ownerId, 83, "Spiteful Blow", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{B}{B}"); this.expansionSetCode = "JOU"; - // Destroy target creature and target land. - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - Effect effect = new DestroyTargetEffect(); - effect.setText("and target land"); - effect.setTargetPointer(new SecondTargetPointer()); + Effect effect = new DestroyTargetEffect(false, true); + effect.setText("Destroy target creature and target land"); this.getSpellAbility().addEffect(effect); - Target target = new TargetLandPermanent(); - this.getSpellAbility().addTarget(target); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addTarget(new TargetLandPermanent()); } public SpitefulBlow(final SpitefulBlow card) { diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/Twinflame.java b/Mage.Sets/src/mage/sets/journeyintonyx/Twinflame.java index ae132b9f1a8..da065db84d5 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/Twinflame.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/Twinflame.java @@ -34,7 +34,7 @@ import mage.abilities.abilityword.StriveAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileTargetEffect; -import mage.abilities.keyword.HasteAbility; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -42,11 +42,9 @@ import mage.constants.Rarity; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.targetpointer.FixedTarget; -import mage.util.CardUtil; /** * @@ -58,13 +56,12 @@ public class Twinflame extends CardImpl { super(ownerId, 115, "Twinflame", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{R}"); this.expansionSetCode = "JOU"; - // Strive - Twinflame costs 2R more to cast for each target beyond the first. this.addAbility(new StriveAbility("{2}{R}")); // Choose any number of target creatures you control. For each of them, put a token that's a copy of that creature onto the battlefield. Those tokens have haste. Exile them at the beginning of the next end step. this.getSpellAbility().addEffect(new TwinflameCopyEffect()); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent(0, Integer.MAX_VALUE, new FilterControlledCreaturePermanent(), false)); - + } public Twinflame(final Twinflame card) { @@ -78,44 +75,43 @@ public class Twinflame extends CardImpl { } class TwinflameCopyEffect extends OneShotEffect { - + public TwinflameCopyEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "Choose any number of target creatures you control. For each of them, put a token that's a copy of that creature onto the battlefield. Those tokens have haste. Exile them at the beginning of the next end step"; } - + public TwinflameCopyEffect(final TwinflameCopyEffect effect) { super(effect); } - + @Override public TwinflameCopyEffect copy() { return new TwinflameCopyEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for(UUID creatureId: this.getTargetPointer().getTargets(game, source)) { + for (UUID creatureId : this.getTargetPointer().getTargets(game, source)) { Permanent creature = game.getPermanentOrLKIBattlefield(creatureId); if (creature != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(creature); - - token.addAbility(HasteAbility.getInstance()); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - } + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, true); + effect.setTargetPointer(new FixedTarget(creature, game)); + effect.apply(game, source); + for (Permanent addedToken : effect.getAddedPermanent()) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(addedToken, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } + } } - return true; + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/judgepromo/RishadanPort.java b/Mage.Sets/src/mage/sets/judgepromo/RishadanPort.java new file mode 100644 index 00000000000..5ff68095f0f --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgepromo/RishadanPort.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgepromo; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RishadanPort extends mage.sets.mercadianmasques.RishadanPort { + + public RishadanPort(UUID ownerId) { + super(ownerId); + this.cardNumber = 98; + this.expansionSetCode = "JR"; + } + + public RishadanPort(final RishadanPort card) { + super(card); + } + + @Override + public RishadanPort copy() { + return new RishadanPort(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/BalthorTheDefiled.java b/Mage.Sets/src/mage/sets/judgment/BalthorTheDefiled.java index f832cbe3df9..c95149465dd 100644 --- a/Mage.Sets/src/mage/sets/judgment/BalthorTheDefiled.java +++ b/Mage.Sets/src/mage/sets/judgment/BalthorTheDefiled.java @@ -37,8 +37,9 @@ import mage.abilities.costs.common.ExileSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.BoostAllEffect; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -51,7 +52,6 @@ import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.players.Player; - /** * * @author LevelX2 @@ -75,7 +75,7 @@ public class BalthorTheDefiled extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BalthorTheDefiledEffect(), new ManaCostsImpl("{B}{B}{B}")); ability.addCost(new ExileSourceCost()); this.addAbility(ability); - + } public BalthorTheDefiled(final BalthorTheDefiled card) { @@ -98,32 +98,32 @@ class BalthorTheDefiledEffect extends OneShotEffect { new ColorPredicate(ObjectColor.RED))); } - public BalthorTheDefiledEffect() { + public BalthorTheDefiledEffect() { super(Outcome.Detriment); this.staticText = "Each player returns all black and all red creature cards from his or her graveyard to the battlefield"; } - public BalthorTheDefiledEffect(final BalthorTheDefiledEffect effect) { + public BalthorTheDefiledEffect(final BalthorTheDefiledEffect effect) { super(effect); } @Override - public BalthorTheDefiledEffect copy() { - return new BalthorTheDefiledEffect(this); + public BalthorTheDefiledEffect copy() { + return new BalthorTheDefiledEffect(this); } @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (UUID playerId: controller.getInRange()) { + Cards cardsToReturn = new CardsImpl(); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card: player.getGraveyard().getCards(filter, source.getSourceId(), source.getControllerId(), game)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); - } + cardsToReturn.addAll(player.getGraveyard().getCards(filter, source.getSourceId(), source.getControllerId(), game)); } } + controller.moveCards(cardsToReturn.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/judgment/BattleScreech.java b/Mage.Sets/src/mage/sets/judgment/BattleScreech.java index 316c620ae76..f78dc5a7389 100644 --- a/Mage.Sets/src/mage/sets/judgment/BattleScreech.java +++ b/Mage.Sets/src/mage/sets/judgment/BattleScreech.java @@ -28,12 +28,10 @@ package mage.sets.judgment; import java.util.UUID; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlashbackAbility; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; @@ -42,7 +40,7 @@ import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.permanent.TappedPredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.BirdToken; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -79,20 +77,3 @@ public class BattleScreech extends CardImpl { return new BattleScreech(this); } } - -class BirdToken extends Token { - - public BirdToken() { - super("Bird", "1/1 white Bird creature tokens with flying"); - this.setOriginalExpansionSetCode("BNG"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Bird"); - power = new MageInt(1); - toughness = new MageInt(1); - - this.addAbility(FlyingAbility.getInstance()); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/judgment/BattlewiseAven.java b/Mage.Sets/src/mage/sets/judgment/BattlewiseAven.java new file mode 100644 index 00000000000..c446713b153 --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/BattlewiseAven.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class BattlewiseAven extends CardImpl { + + public BattlewiseAven(UUID ownerId) { + super(ownerId, 4, "Battlewise Aven", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Threshold - As long as seven or more cards are in your graveyard, Battlewise Aven gets +1/+1 and has first strike. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), + "As long as seven or more cards are in your graveyard, {this} gets +1/+1")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()), + new CardsInControllerGraveCondition(7), "and has first strike")); + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public BattlewiseAven(final BattlewiseAven card) { + super(card); + } + + @Override + public BattlewiseAven copy() { + return new BattlewiseAven(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/BookBurning.java b/Mage.Sets/src/mage/sets/judgment/BookBurning.java new file mode 100644 index 00000000000..c6ff0c160f7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/BookBurning.java @@ -0,0 +1,107 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author tomd1990 + */ +public class BookBurning extends CardImpl { + + public BookBurning(UUID ownerId) { + super(ownerId, 80, "Book Burning", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); + this.expansionSetCode = "JUD"; + + // Any player may have Book Burning deal 6 damage to him or her. If no one does, target player puts the top six cards of his or her library into his or her graveyard. + this.getSpellAbility().addEffect(new BookBurningMillEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + public BookBurning(final BookBurning card) { + super(card); + } + + @Override + public BookBurning copy() { + return new BookBurning(this); + } +} + +class BookBurningMillEffect extends OneShotEffect { + + public BookBurningMillEffect() { + super(Outcome.Detriment); + staticText = "Any player may have {source} deal 6 damage to him or her. If no one does, target player puts the top six cards of his or her library into his or her graveyard"; + } + + public BookBurningMillEffect(final BookBurningMillEffect effect) { + super(effect); + } + + @Override + public BookBurningMillEffect copy() { + return new BookBurningMillEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = source.getSourceObject(game); + if (sourceObject != null) { + boolean millCards = true; + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null && player.chooseUse(Outcome.Detriment, "Have " + sourceObject.getLogName() + " deal 6 damage to you?", source, game)) { + millCards = false; + player.damage(6, source.getSourceId(), game, false, true); + game.informPlayers(player.getLogName() + " has " + sourceObject.getLogName() + " deal 6 damage to him or her"); + } + } + if (millCards) { + Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (targetPlayer != null) { + targetPlayer.moveCards(targetPlayer.getLibrary().getTopCards(game, 6), Zone.LIBRARY, Zone.GRAVEYARD, source, game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/CabalTrainee.java b/Mage.Sets/src/mage/sets/judgment/CabalTrainee.java new file mode 100644 index 00000000000..fb0817a70c9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/CabalTrainee.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class CabalTrainee extends CardImpl { + + public CabalTrainee(UUID ownerId) { + super(ownerId, 63, "Cabal Trainee", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Human"); + this.subtype.add("Minion"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Sacrifice Cabal Trainee: Target creature gets -2/-0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, 0, Duration.EndOfTurn), new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public CabalTrainee(final CabalTrainee card) { + super(card); + } + + @Override + public CabalTrainee copy() { + return new CabalTrainee(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/DeathWish.java b/Mage.Sets/src/mage/sets/judgment/DeathWish.java index f6129647953..a753d3032ee 100644 --- a/Mage.Sets/src/mage/sets/judgment/DeathWish.java +++ b/Mage.Sets/src/mage/sets/judgment/DeathWish.java @@ -27,12 +27,13 @@ */ package mage.sets.judgment; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; -import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -42,9 +43,6 @@ import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; -import java.util.Set; -import java.util.UUID; - /** * * @author Plopman @@ -55,9 +53,9 @@ public class DeathWish extends CardImpl { super(ownerId, 64, "Death Wish", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); this.expansionSetCode = "JUD"; - // You may choose a card you own from outside the game and put it into your hand. You lose half your life, rounded up. Exile Death Wish. this.getSpellAbility().addEffect(new DeathWishEffect()); + this.getSpellAbility().addEffect(new ExileSourceEffect()); } public DeathWish(final DeathWish card) { @@ -74,12 +72,9 @@ class DeathWishEffect extends OneShotEffect { private static final String choiceText = "Choose a card you own from outside the game, and put it into your hand"; - private static final FilterCard filter = new FilterCard("card"); - - public DeathWishEffect() { super(Outcome.Benefit); - this.staticText = "You may choose a card you own from outside the game, reveal that card, and put it into your hand. Exile Death Wish"; + this.staticText = "You may choose a card you own from outside the game, reveal that card, and put it into your hand. You lose half your life, rounded up"; } public DeathWishEffect(final DeathWishEffect effect) { @@ -93,48 +88,30 @@ class DeathWishEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - while (player.chooseUse(Outcome.Benefit, choiceText, source, game)) { - Cards cards = player.getSideboard(); - if(cards.isEmpty()) { - game.informPlayer(player, "You have no cards outside the game."); - break; - } - - Set filtered = cards.getCards(filter, game); - if (filtered.isEmpty()) { - game.informPlayer(player, "You have no " + filter.getMessage() + " outside the game."); - break; - } - - Cards filteredCards = new CardsImpl(); - for (Card card : filtered) { - filteredCards.add(card.getId()); - } - - TargetCard target = new TargetCard(Zone.PICK, filter); - if (player.choose(Outcome.Benefit, filteredCards, target, game)) { - Card card = player.getSideboard().get(target.getFirstTarget(), game); - if (card != null) { - card.moveToZone(Zone.HAND, source.getSourceId(), game, false); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + if (controller.chooseUse(Outcome.Benefit, choiceText, source, game)) { + Cards cards = controller.getSideboard(); + if (cards.isEmpty()) { + game.informPlayer(controller, "You have no cards outside the game."); + } else { + TargetCard target = new TargetCard(Zone.OUTSIDE, new FilterCard()); + if (controller.choose(Outcome.Benefit, cards, target, game)) { + Card card = controller.getSideboard().get(target.getFirstTarget(), game); + if (card != null) { + controller.moveCards(card, null, Zone.HAND, source, game); + } } } } - - int amount = (player.getLife() + 1)/2; - if(amount > 0) - { - player.loseLife(amount, game); - } - - Card cardToExile = game.getCard(source.getSourceId()); - if(cardToExile != null) - { - cardToExile.moveToExile(null, "", source.getSourceId(), game); + + int amount = (controller.getLife() + 1) / 2; + if (amount > 0) { + controller.loseLife(amount, game); } + return true; } - return true; + return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/judgment/ErhnamDjinn.java b/Mage.Sets/src/mage/sets/judgment/ErhnamDjinn.java index 29da0bee89b..722ad3248c0 100644 --- a/Mage.Sets/src/mage/sets/judgment/ErhnamDjinn.java +++ b/Mage.Sets/src/mage/sets/judgment/ErhnamDjinn.java @@ -1,86 +1,86 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.judgment; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.keyword.ForestwalkAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.PhaseStep; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; -import mage.target.common.TargetCreaturePermanent; - -/** - * - * @author LevelX2 - */ -public class ErhnamDjinn extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall creature an opponent controls"); - - static { - filter.add(Predicates.not(new SubtypePredicate("Wall"))); - filter.add(new ControllerPredicate(TargetController.OPPONENT)); - } - - public ErhnamDjinn(UUID ownerId) { - super(ownerId, 113, "Erhnam Djinn", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); - this.expansionSetCode = "JUD"; - this.subtype.add("Djinn"); - - this.power = new MageInt(4); - this.toughness = new MageInt(5); - - // At the beginning of your upkeep, target non-Wall creature an opponent controls gains forestwalk until your next upkeep. - GainAbilityTargetEffect effect = new GainAbilityTargetEffect(new ForestwalkAbility(), Duration.Custom, - "target non-Wall creature an opponent controls gains forestwalk until your next upkeep"); - effect.setDurationToPhase(PhaseStep.UPKEEP); - Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false); - ability.addTarget(new TargetCreaturePermanent(filter)); - this.addAbility(ability); - } - - public ErhnamDjinn(final ErhnamDjinn card) { - super(card); - } - - @Override - public ErhnamDjinn copy() { - return new ErhnamDjinn(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ErhnamDjinn extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall creature an opponent controls"); + + static { + filter.add(Predicates.not(new SubtypePredicate("Wall"))); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public ErhnamDjinn(UUID ownerId) { + super(ownerId, 113, "Erhnam Djinn", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Djinn"); + + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // At the beginning of your upkeep, target non-Wall creature an opponent controls gains forestwalk until your next upkeep. + GainAbilityTargetEffect effect = new GainAbilityTargetEffect(new ForestwalkAbility(false), Duration.Custom, + "target non-Wall creature an opponent controls gains forestwalk until your next upkeep"); + effect.setDurationToPhase(PhaseStep.UPKEEP); + Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public ErhnamDjinn(final ErhnamDjinn card) { + super(card); + } + + @Override + public ErhnamDjinn copy() { + return new ErhnamDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/Guiltfeeder.java b/Mage.Sets/src/mage/sets/judgment/Guiltfeeder.java new file mode 100644 index 00000000000..eb17e664de5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/Guiltfeeder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.dynamicvalue.common.CardsInTargetPlayersGraveyardCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.keyword.FearAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Guiltfeeder extends CardImpl { + + public Guiltfeeder(UUID ownerId) { + super(ownerId, 68, "Guiltfeeder", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Horror"); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Fear + this.addAbility(FearAbility.getInstance()); + // Whenever Guiltfeeder attacks and isn't blocked, defending player loses 1 life for each card in his or her graveyard. + Effect effect = new LoseLifeTargetEffect(new CardsInTargetPlayersGraveyardCount()); + effect.setText("defending player loses 1 life for each card in his or her graveyard"); + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(effect, false, true)); + } + + public Guiltfeeder(final Guiltfeeder card) { + super(card); + } + + @Override + public Guiltfeeder copy() { + return new Guiltfeeder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/IronshellBeetle.java b/Mage.Sets/src/mage/sets/judgment/IronshellBeetle.java new file mode 100644 index 00000000000..b914f9ad59c --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/IronshellBeetle.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class IronshellBeetle extends CardImpl { + + public IronshellBeetle(UUID ownerId) { + super(ownerId, 121, "Ironshell Beetle", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Insect"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Ironshell Beetle enters the battlefield, put a +1/+1 counter on target creature. + Ability ability = new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance())); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public IronshellBeetle(final IronshellBeetle card) { + super(card); + } + + @Override + public IronshellBeetle copy() { + return new IronshellBeetle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/JeskaWarriorAdept.java b/Mage.Sets/src/mage/sets/judgment/JeskaWarriorAdept.java new file mode 100644 index 00000000000..7d12fb0dd3a --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/JeskaWarriorAdept.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class JeskaWarriorAdept extends CardImpl { + + public JeskaWarriorAdept(UUID ownerId) { + super(ownerId, 93, "Jeska, Warrior Adept", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "JUD"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Barbarian"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // Haste + this.addAbility(HasteAbility.getInstance()); + // {tap}: Jeska, Warrior Adept deals 1 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public JeskaWarriorAdept(final JeskaWarriorAdept card) { + super(card); + } + + @Override + public JeskaWarriorAdept copy() { + return new JeskaWarriorAdept(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/KrosanReclamation.java b/Mage.Sets/src/mage/sets/judgment/KrosanReclamation.java new file mode 100644 index 00000000000..70ba3409027 --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/KrosanReclamation.java @@ -0,0 +1,145 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlashbackAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TimingRule; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class KrosanReclamation extends CardImpl { + + public KrosanReclamation(UUID ownerId) { + super(ownerId, 122, "Krosan Reclamation", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "JUD"; + + // Target player shuffles up to two target cards from his or her graveyard into his or her library. + this.getSpellAbility().addEffect(new KrosanReclamationEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addTarget(new KrosanReclamationTarget()); + + // Flashback {1}{G} + this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{G}"), TimingRule.INSTANT)); + } + + public KrosanReclamation(final KrosanReclamation card) { + super(card); + } + + @Override + public KrosanReclamation copy() { + return new KrosanReclamation(this); + } +} + +class KrosanReclamationEffect extends OneShotEffect { + + public KrosanReclamationEffect() { + super(Outcome.Neutral); + this.staticText = "Target player shuffles up to two target cards from his or her graveyard into his or her library"; + } + + public KrosanReclamationEffect(final KrosanReclamationEffect effect) { + super(effect); + } + + @Override + public KrosanReclamationEffect copy() { + return new KrosanReclamationEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + List targets = source.getTargets().get(1).getTargets(); + boolean shuffle = false; + for (UUID targetId : targets) { + Card card = game.getCard(targetId); + if (card != null) { + if (player.getGraveyard().contains(card.getId())) { + player.getGraveyard().remove(card); + card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + shuffle = true; + } + } + } + if (shuffle) { + player.shuffleLibrary(game); + } + return true; + } + return false; + } +} + +class KrosanReclamationTarget extends TargetCard { + + public KrosanReclamationTarget() { + super(0, 2, Zone.GRAVEYARD, new FilterCard()); + } + + public KrosanReclamationTarget(final KrosanReclamationTarget target) { + super(target); + } + + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Card card = game.getCard(id); + if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { + UUID firstTarget = source.getFirstTarget(); + if (firstTarget != null && game.getPlayer(firstTarget).getGraveyard().contains(id)) { + return filter.match(card, game); + } + } + return false; + } + + @Override + public KrosanReclamationTarget copy() { + return new KrosanReclamationTarget(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/MirarisWake.java b/Mage.Sets/src/mage/sets/judgment/MirarisWake.java index c59f9b7f1bf..f040d301d57 100644 --- a/Mage.Sets/src/mage/sets/judgment/MirarisWake.java +++ b/Mage.Sets/src/mage/sets/judgment/MirarisWake.java @@ -50,9 +50,9 @@ public class MirarisWake extends CardImpl { super(ownerId, 139, "Mirari's Wake", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{W}"); this.expansionSetCode = "JUD"; - // Creatures you control get +1/+1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1,1,Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield))); + // Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced. AddManaOfAnyTypeProducedEffect effect = new AddManaOfAnyTypeProducedEffect(); effect.setText("add one mana to your mana pool of any type that land produced"); diff --git a/Mage.Sets/src/mage/sets/judgment/MirrorWall.java b/Mage.Sets/src/mage/sets/judgment/MirrorWall.java new file mode 100644 index 00000000000..49e4b023fe5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/MirrorWall.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class MirrorWall extends CardImpl { + + public MirrorWall(UUID ownerId) { + super(ownerId, 47, "Mirror Wall", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Wall"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // {W}: Mirror Wall can attack this turn as though it didn't have defender. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), + new ManaCostsImpl("{W}"))); + } + + public MirrorWall(final MirrorWall card) { + super(card); + } + + @Override + public MirrorWall copy() { + return new MirrorWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/NantukoTracer.java b/Mage.Sets/src/mage/sets/judgment/NantukoTracer.java new file mode 100644 index 00000000000..e0752b818d2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/NantukoTracer.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCardInGraveyard; + +/** + * + * @author fireshoes + */ +public class NantukoTracer extends CardImpl { + + public NantukoTracer(UUID ownerId) { + super(ownerId, 125, "Nantuko Tracer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "JUD"; + this.subtype.add("Insect"); + this.subtype.add("Druid"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // When Nantuko Tracer enters the battlefield, you may put target card from a graveyard on the bottom of its owner's library. + Ability ability = new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(false), true); + ability.addTarget(new TargetCardInGraveyard()); + this.addAbility(ability); + } + + public NantukoTracer(final NantukoTracer card) { + super(card); + } + + @Override + public NantukoTracer copy() { + return new NantukoTracer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/RiftstonePortal.java b/Mage.Sets/src/mage/sets/judgment/RiftstonePortal.java index bc4b28dbd96..34e77f78dfb 100644 --- a/Mage.Sets/src/mage/sets/judgment/RiftstonePortal.java +++ b/Mage.Sets/src/mage/sets/judgment/RiftstonePortal.java @@ -55,10 +55,10 @@ public class RiftstonePortal extends CardImpl { // {tap}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); - // As long as Riftstone Portal is in your graveyard, lands you control have "{tap}: Add {G} or {W} to your mana pool." + // As long as Riftstone Portal is in your graveyard, lands you control have "{T}: Add {G} or {W} to your mana pool." ContinuousEffect effect = new GainAbilityControlledEffect(new GreenManaAbility(), Duration.WhileOnBattlefield, new FilterControlledLandPermanent()); - effect.setText("As long as Riftstone Portal is in your graveyard, lands you control have \"{tap}: Add {G} or {W} to your mana pool.\""); + effect.setText("As long as Riftstone Portal is in your graveyard, lands you control have \"{T}: Add {G} or {W} to your mana pool.\""); Ability ability = new SimpleStaticAbility(Zone.GRAVEYARD, effect); effect = new GainAbilityControlledEffect(new WhiteManaAbility(), Duration.WhileOnBattlefield, new FilterControlledLandPermanent()); diff --git a/Mage.Sets/src/mage/sets/judgment/SolitaryConfinement.java b/Mage.Sets/src/mage/sets/judgment/SolitaryConfinement.java index c7435e2543d..893686b35e9 100644 --- a/Mage.Sets/src/mage/sets/judgment/SolitaryConfinement.java +++ b/Mage.Sets/src/mage/sets/judgment/SolitaryConfinement.java @@ -54,16 +54,15 @@ public class SolitaryConfinement extends CardImpl { super(ownerId, 24, "Solitary Confinement", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); this.expansionSetCode = "JUD"; - // At the beginning of your upkeep, sacrifice Solitary Confinement unless you discard a card. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceUnlessPaysEffect(new DiscardTargetCost(new TargetCardInHand())), TargetController.YOU, false)); - + // Skip your draw step. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipDrawStepEffect())); - + // You have shroud. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControllerEffect(ShroudAbility.getInstance()))); - + // Prevent all damage that would be dealt to you. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventAllDamageToControllerEffect(Duration.WhileOnBattlefield))); } diff --git a/Mage.Sets/src/mage/sets/judgment/Spelljack.java b/Mage.Sets/src/mage/sets/judgment/Spelljack.java index 4c5f862cbe5..f6961e96834 100644 --- a/Mage.Sets/src/mage/sets/judgment/Spelljack.java +++ b/Mage.Sets/src/mage/sets/judgment/Spelljack.java @@ -28,7 +28,6 @@ package mage.sets.judgment; import java.util.UUID; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.ContinuousEffect; @@ -42,7 +41,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; -import mage.game.events.GameEvent; import mage.game.stack.Spell; import mage.game.stack.StackObject; import mage.players.Player; @@ -75,40 +73,35 @@ public class Spelljack extends CardImpl { } class SpelljackEffect extends OneShotEffect { - + SpelljackEffect() { super(Outcome.PlayForFree); this.staticText = "Counter target spell. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. You may play it without paying its mana cost for as long as it remains exiled"; } - + SpelljackEffect(final SpelljackEffect effect) { super(effect); } - + @Override public SpelljackEffect copy() { return new SpelljackEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - UUID objectId = targetPointer.getFirst(game, source); - UUID sourceId = source.getSourceId(); - - StackObject stackObject = game.getStack().getStackObject(objectId); - if (stackObject != null && !game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) { - game.rememberLKI(objectId, Zone.STACK, stackObject); - game.getStack().remove(stackObject); - if (!((Spell) stackObject).isCopiedSpell()) { - MageObject card = game.getObject(stackObject.getSourceId()); - if (card instanceof Card) { - ((Card) card).moveToZone(Zone.EXILED, sourceId, game, true); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + UUID targetId = targetPointer.getFirst(game, source); + StackObject stackObject = game.getStack().getStackObject(targetId); + if (stackObject != null && game.getStack().counter(targetId, source.getSourceId(), game, Zone.EXILED, false, false)) { + Card card = ((Spell) stackObject).getCard(); + if (card != null) { ContinuousEffect effect = new SpelljackCastFromExileEffect(); - effect.setTargetPointer(new FixedTarget(card.getId())); + effect.setTargetPointer(new FixedTarget(card.getId(), game.getState().getZoneChangeCounter(card.getId()))); game.addEffect(effect, source); } } - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId())); return true; } return false; @@ -148,10 +141,9 @@ class SpelljackCastFromExileEffect extends AsThoughEffectImpl { if (card != null) { if (game.getState().getZone(sourceId) == Zone.EXILED) { Player player = game.getPlayer(affectedControllerId); - player.setCastSourceIdWithAlternateMana(sourceId, null); + player.setCastSourceIdWithAlternateMana(sourceId, null, null); return true; - } - else { + } else { this.discard(); } } @@ -159,4 +151,4 @@ class SpelljackCastFromExileEffect extends AsThoughEffectImpl { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/judgment/SwirlingSandstorm.java b/Mage.Sets/src/mage/sets/judgment/SwirlingSandstorm.java new file mode 100644 index 00000000000..4de542ed49e --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/SwirlingSandstorm.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; + +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author Quercitron + */ +public class SwirlingSandstorm extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature without flying"); + + static { + filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + + public SwirlingSandstorm(UUID ownerId) { + super(ownerId, 102, "Swirling Sandstorm", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); + this.expansionSetCode = "JUD"; + + // Threshold - Swirling Sandstorm deals 5 damage to each creature without flying if seven or more cards are in your graveyard. + Effect effect = new ConditionalOneShotEffect( + new DamageAllEffect(5, filter), + new CardsInControllerGraveCondition(7), + "Threshold - {this} deals 5 damage to each creature without flying if seven or more cards are in your graveyard."); + this.getSpellAbility().addEffect(effect); + } + + public SwirlingSandstorm(final SwirlingSandstorm card) { + super(card); + } + + @Override + public SwirlingSandstorm copy() { + return new SwirlingSandstorm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/TestOfEndurance.java b/Mage.Sets/src/mage/sets/judgment/TestOfEndurance.java new file mode 100644 index 00000000000..ca29245261e --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/TestOfEndurance.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.judgment; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.WinGameSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.Game; + +/** + * + * @author fireshoes + */ +public class TestOfEndurance extends CardImpl { + + public TestOfEndurance(UUID ownerId) { + super(ownerId, 29, "Test of Endurance", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); + this.expansionSetCode = "JUD"; + + // At the beginning of your upkeep, if you have 50 or more life, you win the game. + TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect(), TargetController.YOU, false); + this.addAbility(new ConditionalTriggeredAbility(ability, new FiftyOrMoreLifeCondition(), "At the beginning of your upkeep, if you have 50 or more life, you win the game.")); + } + + public TestOfEndurance(final TestOfEndurance card) { + super(card); + } + + @Override + public TestOfEndurance copy() { + return new TestOfEndurance(this); + } +} + + +class FiftyOrMoreLifeCondition implements Condition { + + @Override + public boolean apply(Game game, Ability source) { + return game.getPlayer(source.getControllerId()).getLife() >= 50; + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/WorldgorgerDragon.java b/Mage.Sets/src/mage/sets/judgment/WorldgorgerDragon.java index 03ba405c9dd..692fc29a17e 100644 --- a/Mage.Sets/src/mage/sets/judgment/WorldgorgerDragon.java +++ b/Mage.Sets/src/mage/sets/judgment/WorldgorgerDragon.java @@ -27,6 +27,8 @@ */ package mage.sets.judgment; +import java.util.LinkedHashSet; +import java.util.Set; import java.util.UUID; import mage.MageInt; import mage.MageObject; @@ -44,10 +46,10 @@ import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterPermanent; +import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.ExileZone; import mage.game.Game; -import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; import mage.players.Player; import mage.util.CardUtil; @@ -94,6 +96,7 @@ class WorldgorgerDragonEntersEffect extends OneShotEffect { static { filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(new AnotherPredicate()); } public WorldgorgerDragonEntersEffect() { @@ -110,13 +113,11 @@ class WorldgorgerDragonEntersEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null) { - UUID exileId = CardUtil.getObjectExileZoneId(game, sourceObject); + UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); if (exileId != null) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { - if (!permanent.getId().equals(source.getSourceId())) { // Another - controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true); - } - } + Set cardsToExile = new LinkedHashSet<>(); + cardsToExile.addAll(game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)); + controller.moveCardsToExile(cardsToExile, source, game, true, exileId, sourceObject.getIdName()); return true; } } @@ -145,17 +146,10 @@ class WorldgorgerDragonLeavesEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { - int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() -1; + int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() - 1; ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter)); if (exile != null) { - exile = exile.copy(); - for (UUID cardId : exile) { - Card card = game.getCard(cardId); - if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); - } - } - return true; + return controller.moveCards(exile.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null); } } return false; diff --git a/Mage.Sets/src/mage/sets/judgment/WormfangDrake.java b/Mage.Sets/src/mage/sets/judgment/WormfangDrake.java index f9c5f47a426..15d030afde7 100644 --- a/Mage.Sets/src/mage/sets/judgment/WormfangDrake.java +++ b/Mage.Sets/src/mage/sets/judgment/WormfangDrake.java @@ -32,9 +32,8 @@ import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.common.ZoneChangeTriggeredAbility; +import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.costs.CostImpl; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.ReturnFromExileForSourceEffect; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.keyword.FlyingAbility; @@ -56,9 +55,7 @@ import mage.util.CardUtil; * @author Temba21 */ public class WormfangDrake extends CardImpl { - - public WormfangDrake(UUID ownerId) { super(ownerId, 57, "Wormfang Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); this.expansionSetCode = "JUD"; @@ -66,7 +63,7 @@ public class WormfangDrake extends CardImpl { this.subtype.add("Drake"); this.power = new MageInt(3); this.toughness = new MageInt(4); - + // Flying this.addAbility(FlyingAbility.getInstance()); @@ -74,8 +71,8 @@ public class WormfangDrake extends CardImpl { this.addAbility(new EntersBattlefieldTriggeredAbility( new SacrificeSourceUnlessPaysEffect(new WormfangDrakeExileCost()), false)); - // When Wormfang Drake leaves the battlefield, return the exiled card to the battlefield under its owner's control. - this.addAbility(new WormfangDrakeTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD), false)); + // When Wormfang Drake leaves the battlefield, return the exiled card to the battlefield under its owner's control. + this.addAbility(new LeavesBattlefieldTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD), false)); } public WormfangDrake(final WormfangDrake card) { @@ -88,23 +85,6 @@ public class WormfangDrake extends CardImpl { } } -class WormfangDrakeTriggeredAbility extends ZoneChangeTriggeredAbility { - - public WormfangDrakeTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, null, effect, "When {this} leaves the battlefield, ", optional); - } - - public WormfangDrakeTriggeredAbility(WormfangDrakeTriggeredAbility ability) { - super(ability); - } - - @Override - public WormfangDrakeTriggeredAbility copy() { - return new WormfangDrakeTriggeredAbility(this); - } - -} - class WormfangDrakeExileCost extends CostImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); @@ -114,7 +94,7 @@ class WormfangDrakeExileCost extends CostImpl { } public WormfangDrakeExileCost() { - this.addTarget(new TargetControlledCreaturePermanent(1,1,filter, true)); + this.addTarget(new TargetControlledCreaturePermanent(1, 1, filter, true)); this.text = "Exile a creature you control other than {this}"; } @@ -125,11 +105,11 @@ class WormfangDrakeExileCost extends CostImpl { @Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { Player controller = game.getPlayer(controllerId); - MageObject sourceObject = ability.getSourceObject(game); + MageObject sourceObject = ability.getSourceObject(game); if (controller != null && sourceObject != null) { if (targets.choose(Outcome.Exile, controllerId, sourceId, game)) { UUID exileId = CardUtil.getExileZoneId(game, ability.getSourceId(), ability.getSourceObjectZoneChangeCounter()); - for (UUID targetId: targets.get(0).getTargets()) { + for (UUID targetId : targets.get(0).getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent == null) { return false; diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/AnafenzaTheForemost.java b/Mage.Sets/src/mage/sets/khansoftarkir/AnafenzaTheForemost.java index f43b44cac72..232964e4733 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/AnafenzaTheForemost.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/AnafenzaTheForemost.java @@ -81,7 +81,7 @@ public class AnafenzaTheForemost extends CardImpl { this.addAbility(ability); // If a creature card would be put into an opponent's graveyard from anywhere, exile it instead. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AnafenzaTheForemostEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AnafenzaTheForemostEffect())); } public AnafenzaTheForemost(final AnafenzaTheForemost card) { @@ -119,16 +119,15 @@ class AnafenzaTheForemostEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - if (((ZoneChangeEvent)event).getFromZone().equals(Zone.BATTLEFIELD)) { - Permanent permanent = ((ZoneChangeEvent)event).getTarget(); + if (((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)) { + Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent != null) { return controller.moveCardToExileWithInfo(permanent, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true); } - } - else { + } else { Card card = game.getCard(event.getTargetId()); if (card != null) { - return controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, ((ZoneChangeEvent)event).getFromZone(), true); + return controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, ((ZoneChangeEvent) event).getFromZone(), true); } } } @@ -142,11 +141,17 @@ class AnafenzaTheForemostEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); - if (card != null && card.getCardType().contains(CardType.CREATURE) && - game.getOpponents(source.getControllerId()).contains(card.getOwnerId())) { - return true; + if (card != null && game.getOpponents(source.getControllerId()).contains(card.getOwnerId())) { // Anafenza only cares about cards + if (zEvent.getTarget() != null) { // if it comes from permanent, check if it was a creature on the battlefield + if (zEvent.getTarget().getCardType().contains(CardType.CREATURE)) { + return true; + } + } else if (card.getCardType().contains(CardType.CREATURE)) { + return true; + } } } return false; diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/AshcloudPhoenix.java b/Mage.Sets/src/mage/sets/khansoftarkir/AshcloudPhoenix.java index 115370c7f92..4a11b9fbfdc 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/AshcloudPhoenix.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/AshcloudPhoenix.java @@ -64,13 +64,13 @@ public class AshcloudPhoenix extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // When Ashcloud Phoenix dies, return it to the battlefield face down under your control. this.addAbility(new DiesTriggeredAbility(new AshcloudPhoenixEffect())); - + // Morph {4}{R}{R} this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{4}{R}{R}"))); - + // When Ashcloud Phoenix is turned face up, it deals 2 damage to each player. Effect effect = new DamagePlayersEffect(2, TargetController.ANY); effect.setText("it deals 2 damage to each player"); @@ -88,30 +88,30 @@ public class AshcloudPhoenix extends CardImpl { } class AshcloudPhoenixEffect extends OneShotEffect { - + AshcloudPhoenixEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "return it to the battlefield face down under your control"; } - + AshcloudPhoenixEffect(final AshcloudPhoenixEffect effect) { super(effect); } - + @Override public AshcloudPhoenixEffect copy() { return new AshcloudPhoenixEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { Card card = game.getCard(source.getSourceId()); if (card != null) { Player owner = game.getPlayer(card.getOwnerId()); if (owner != null && owner.getGraveyard().contains(card.getId())) { - player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), false, true); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, false, true, false, null); } } return true; diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/BribersPurse.java b/Mage.Sets/src/mage/sets/khansoftarkir/BribersPurse.java index c52299b48d6..4e539b0a845 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/BribersPurse.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/BribersPurse.java @@ -29,26 +29,19 @@ package mage.sets.khansoftarkir; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.Effect; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.combat.CantAttackBlockTargetEffect; -import mage.abilities.effects.common.combat.CantAttackTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.Counter; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; /** @@ -62,7 +55,7 @@ public class BribersPurse extends CardImpl { this.expansionSetCode = "KTK"; // Briber's Purse enters the battlefield with X gem counters on it. - this.addAbility(new EntersBattlefieldAbility(new BribersPurseEffect(), "{this} enters the battlefield with X gem counters on it")); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(new Counter("gem")))); // {1}, {T}, Remove a gem counter from Briber's Purse: Target creature can't attack or block this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantAttackBlockTargetEffect(Duration.EndOfTurn), new GenericManaCost(1)); @@ -81,33 +74,3 @@ public class BribersPurse extends CardImpl { return new BribersPurse(this); } } - -class BribersPurseEffect extends OneShotEffect { - public BribersPurseEffect() { - super(Outcome.Benefit); - } - - public BribersPurseEffect(final BribersPurseEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(new Counter("gem", amount), game); - } - } - } - return true; - } - - @Override - public BribersPurseEffect copy() { - return new BribersPurseEffect(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/CleverImpersonator.java b/Mage.Sets/src/mage/sets/khansoftarkir/CleverImpersonator.java index 87503dfe207..2a058c4e4bf 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/CleverImpersonator.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/CleverImpersonator.java @@ -29,13 +29,11 @@ package mage.sets.khansoftarkir; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.common.FilterNonlandPermanent; /** @@ -53,10 +51,7 @@ public class CleverImpersonator extends CardImpl { this.toughness = new MageInt(0); // You may have Clever Impersonator enter the battlefield as a copy of any nonland permanent on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new EntersBattlefieldEffect(new CopyPermanentEffect(new FilterNonlandPermanent()), - "You may have {this} enter the battlefield as a copy of any nonland permanent on the battlefield", - true))); + this.addAbility(new EntersBattlefieldAbility(new CopyPermanentEffect(new FilterNonlandPermanent()), true)); } public CleverImpersonator(final CleverImpersonator card) { diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/Duneblast.java b/Mage.Sets/src/mage/sets/khansoftarkir/Duneblast.java index 34d4495c712..c0424b1594c 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/Duneblast.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/Duneblast.java @@ -48,7 +48,7 @@ import mage.target.common.TargetCreaturePermanent; public class Duneblast extends CardImpl { public Duneblast(UUID ownerId) { - super(ownerId, 174, "Duneblast", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{W}{G}{B}"); + super(ownerId, 174, "Duneblast", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{W}{B}{G}"); this.expansionSetCode = "KTK"; diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/Goblinslide.java b/Mage.Sets/src/mage/sets/khansoftarkir/Goblinslide.java index 1effee12c3a..75db169ba20 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/Goblinslide.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/Goblinslide.java @@ -28,7 +28,6 @@ package mage.sets.khansoftarkir; import java.util.UUID; -import mage.MageInt; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CreateTokenEffect; @@ -40,7 +39,7 @@ import mage.constants.Rarity; import mage.filter.FilterSpell; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinTokenWithHaste; /** * @@ -58,9 +57,8 @@ public class Goblinslide extends CardImpl { super(ownerId, 109, "Goblinslide", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); this.expansionSetCode = "KTK"; - // Whenever you cast a noncreature spell, you may pay {1}. If you do, put a 1/1 red Goblin creature token with haste onto the battlefield. - this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid(new CreateTokenEffect(new GoblinslideGoblinToken()), new GenericManaCost(1)), filter, false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid(new CreateTokenEffect(new GoblinTokenWithHaste()), new GenericManaCost(1)), filter, false)); } public Goblinslide(final Goblinslide card) { @@ -72,17 +70,3 @@ public class Goblinslide extends CardImpl { return new Goblinslide(this); } } - -class GoblinslideGoblinToken extends Token { - - GoblinslideGoblinToken() { - super("Goblin", "1/1 red Goblin creature token with haste"); - this.setOriginalExpansionSetCode("KTK"); - cardType.add(CardType.CREATURE); - subtype.add("Goblin"); - color.setRed(true); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(HasteAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/HardenedScales.java b/Mage.Sets/src/mage/sets/khansoftarkir/HardenedScales.java index 3ecbf0b73e9..a83fa7b78be 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/HardenedScales.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/HardenedScales.java @@ -53,7 +53,6 @@ public class HardenedScales extends CardImpl { super(ownerId, 133, "Hardened Scales", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G}"); this.expansionSetCode = "KTK"; - // If one or more +1/+1 counters would be placed on a creature you control, that many plus one +1/+1 counters are placed on it instead. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HardenedScalesEffect())); @@ -70,6 +69,7 @@ public class HardenedScales extends CardImpl { } class HardenedScalesEffect extends ReplacementEffectImpl { + HardenedScalesEffect() { super(Duration.WhileOnBattlefield, Outcome.BoostCreature, false); staticText = "If one or more +1/+1 counters would be placed on a creature you control, that many plus one +1/+1 counters are placed on it instead"; @@ -86,17 +86,20 @@ class HardenedScalesEffect extends ReplacementEffectImpl { return false; } - @Override + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ADD_COUNTERS; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getData().equals(CounterType.P1P1.getName())) { - Permanent target = game.getPermanent(event.getTargetId()); - if (target != null && target.getControllerId().equals(source.getControllerId()) - && target.getCardType().contains(CardType.CREATURE)) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent == null) { + permanent = game.getPermanentEntering(event.getTargetId()); + } + if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) + && permanent.getCardType().contains(CardType.CREATURE)) { return true; } } diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/HeraldOfAnafenza.java b/Mage.Sets/src/mage/sets/khansoftarkir/HeraldOfAnafenza.java index d1383261c6f..09e806e8bab 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/HeraldOfAnafenza.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/HeraldOfAnafenza.java @@ -40,7 +40,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.WarriorToken; import mage.game.stack.StackAbility; /** @@ -79,7 +79,7 @@ public class HeraldOfAnafenza extends CardImpl { class HeraldOfAnafenzaTriggeredAbility extends TriggeredAbilityImpl { public HeraldOfAnafenzaTriggeredAbility() { - super(Zone.BATTLEFIELD, new CreateTokenEffect(new HeraldOfAnafenzaWarriorToken()), false); + super(Zone.BATTLEFIELD, new CreateTokenEffect(new WarriorToken()), false); } public HeraldOfAnafenzaTriggeredAbility(final HeraldOfAnafenzaTriggeredAbility ability) { @@ -90,7 +90,7 @@ class HeraldOfAnafenzaTriggeredAbility extends TriggeredAbilityImpl { public HeraldOfAnafenzaTriggeredAbility copy() { return new HeraldOfAnafenzaTriggeredAbility(this); } - + @Override public boolean checkEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ACTIVATED_ABILITY; @@ -112,18 +112,3 @@ class HeraldOfAnafenzaTriggeredAbility extends TriggeredAbilityImpl { return "Whenever you activate {this}'s outlast ability, " + super.getRule(); } } - -class HeraldOfAnafenzaWarriorToken extends Token { - - public HeraldOfAnafenzaWarriorToken() { - super("Warrior", "1/1 white Warrior creature token"); - this.setOriginalExpansionSetCode("KTK"); - this.setTokenType(1); - cardType.add(CardType.CREATURE); - subtype.add("Warrior"); - - color.setWhite(true); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java b/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java index 227068991af..00f8710f667 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java @@ -30,7 +30,6 @@ package mage.sets.khansoftarkir; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; @@ -38,19 +37,15 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.CountersCount; import mage.abilities.effects.AsTurnedFaceUpEffect; import mage.abilities.effects.Effect; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.MorphAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.game.permanent.token.SnakeToken; /** @@ -69,14 +64,14 @@ public class HoodedHydra extends CardImpl { this.toughness = new MageInt(0); // Hooded Hydra enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new HoodedHydraEffect1(), "with X +1/+1 counters on it")); - + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); + // When Hooded Hydra dies, put a 1/1 green Snake creature token onto the battlefield for each +1/+1 counter on it. this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SnakeToken("KTK"), new CountersCount(CounterType.P1P1)), false)); - + // Morph {3}{G}{G} this.addAbility(new MorphAbility(this, new ManaCostsImpl("{3}{G}{G}"))); - + // As Hooded Hydra is turned face up, put five +1/+1 counters on it. Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(5)); effect.setText("put five +1/+1 counters on it"); @@ -95,36 +90,3 @@ public class HoodedHydra extends CardImpl { return new HoodedHydra(this); } } - -class HoodedHydraEffect1 extends OneShotEffect { - - public HoodedHydraEffect1() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - public HoodedHydraEffect1(final HoodedHydraEffect1 effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && !permanent.isFaceDown(game)) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public HoodedHydraEffect1 copy() { - return new HoodedHydraEffect1(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/KheruLichLord.java b/Mage.Sets/src/mage/sets/khansoftarkir/KheruLichLord.java index fa93f72f934..048f1d84fc0 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/KheruLichLord.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/KheruLichLord.java @@ -112,45 +112,41 @@ class KheruLichLordEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Cards cards = new CardsImpl(); - for (Card card : controller.getGraveyard().getCards(new FilterCreatureCard(), source.getSourceId(), source.getControllerId(), game)) { - cards.add(card.getId()); - } - - if (cards.size() > 0) { - Card card = cards.getRandom(game); - controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + cards.addAll(controller.getGraveyard().getCards(new FilterCreatureCard(), source.getSourceId(), source.getControllerId(), game)); + Card card = cards.getRandom(game); + if (card != null) { + controller.moveCards(card, Zone.BATTLEFIELD, source, game); Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { + FixedTarget fixedTarget = new FixedTarget(permanent, game); ContinuousEffect effect = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(permanent.getId())); + effect.setTargetPointer(fixedTarget); game.addEffect(effect, source); effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(permanent.getId())); + effect.setTargetPointer(fixedTarget); game.addEffect(effect, source); effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(permanent.getId())); + effect.setTargetPointer(fixedTarget); game.addEffect(effect, source); ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(permanent.getId())); + exileEffect.setTargetPointer(fixedTarget); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setControllerId(source.getControllerId()); delayedAbility.setSourceObject(source.getSourceObject(game), game); game.addDelayedTriggeredAbility(delayedAbility); - KheruLichLordReplacementEffect replacementEffect = new KheruLichLordReplacementEffect(); - replacementEffect.setTargetPointer(new FixedTarget(permanent.getId())); + KheruLichLordReplacementEffect replacementEffect = new KheruLichLordReplacementEffect(); + replacementEffect.setTargetPointer(fixedTarget); game.addEffect(replacementEffect, source); - } } return true; } - return false; } } @@ -183,11 +179,11 @@ class KheruLichLordReplacementEffect extends ReplacementEffectImpl { return true; } - @Override + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ZONE_CHANGE; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/KheruSpellsnatcher.java b/Mage.Sets/src/mage/sets/khansoftarkir/KheruSpellsnatcher.java index 19cced0b3a5..2ce29a65aa3 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/KheruSpellsnatcher.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/KheruSpellsnatcher.java @@ -46,7 +46,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; -import mage.game.events.GameEvent; import mage.game.stack.Spell; import mage.game.stack.StackObject; import mage.players.Player; @@ -70,7 +69,7 @@ public class KheruSpellsnatcher extends CardImpl { // Morph {4}{U}{U} this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{4}{U}{U}"))); - + // When Kheru Spellthief is turned face up, counter target spell. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. You may cast that card without paying its mana cost as long as it remains exiled. Ability ability = new TurnedFaceUpSourceTriggeredAbility(new KheruSpellsnatcherEffect()); ability.addTarget(new TargetSpell()); @@ -88,30 +87,29 @@ public class KheruSpellsnatcher extends CardImpl { } class KheruSpellsnatcherEffect extends OneShotEffect { - + KheruSpellsnatcherEffect() { super(Outcome.Benefit); this.staticText = "counter target spell. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. You may cast that card without paying its mana cost as long as it remains exiled"; } - + KheruSpellsnatcherEffect(final KheruSpellsnatcherEffect effect) { super(effect); } - + @Override public KheruSpellsnatcherEffect copy() { return new KheruSpellsnatcherEffect(this); } - + @Override public boolean apply(Game game, Ability source) { UUID objectId = targetPointer.getFirst(game, source); UUID sourceId = source.getSourceId(); StackObject stackObject = game.getStack().getStackObject(objectId); - if (stackObject != null && !game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) { - game.rememberLKI(objectId, Zone.STACK, stackObject); - game.getStack().remove(stackObject); + if (stackObject != null + && game.getStack().counter(targetPointer.getFirst(game, source), source.getSourceId(), game, Zone.EXILED, false, false)) { if (!((Spell) stackObject).isCopiedSpell()) { MageObject card = game.getObject(stackObject.getSourceId()); if (card instanceof Card) { @@ -121,7 +119,6 @@ class KheruSpellsnatcherEffect extends OneShotEffect { game.addEffect(effect, source); } } - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId())); return true; } return false; @@ -161,10 +158,9 @@ class KheruSpellsnatcherCastFromExileEffect extends AsThoughEffectImpl { if (card != null) { if (game.getState().getZone(sourceId) == Zone.EXILED) { Player player = game.getPlayer(affectedControllerId); - player.setCastSourceIdWithAlternateMana(sourceId, null); + player.setCastSourceIdWithAlternateMana(sourceId, null, null); return true; - } - else { + } else { this.discard(); } } @@ -172,4 +168,4 @@ class KheruSpellsnatcherCastFromExileEffect extends AsThoughEffectImpl { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/MarduCharm.java b/Mage.Sets/src/mage/sets/khansoftarkir/MarduCharm.java index 44b4423042d..2153f4e42dd 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/MarduCharm.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/MarduCharm.java @@ -28,7 +28,6 @@ package mage.sets.khansoftarkir; import java.util.UUID; -import mage.MageInt; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.ContinuousEffect; @@ -48,7 +47,7 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.WarriorToken; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetOpponent; @@ -61,12 +60,12 @@ import mage.target.targetpointer.FixedTarget; public class MarduCharm extends CardImpl { private static final FilterCard filter = new FilterCard("a noncreature, nonland card"); - + static { filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); } - + public MarduCharm(UUID ownerId) { super(ownerId, 186, "Mardu Charm", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{R}{W}{B}"); this.expansionSetCode = "KTK"; @@ -76,18 +75,18 @@ public class MarduCharm extends CardImpl { // * Mardu Charm deals 4 damage to target creature. this.getSpellAbility().addEffect(new DamageTargetEffect(4)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - + // * Put two 1/1 white Warrior creature tokens onto the battlefield. They gain first strike until end of turn. Mode mode = new Mode(); mode.getEffects().add(new MarduCharmCreateTokenEffect()); this.getSpellAbility().addMode(mode); - + // * Target opponent reveals his or her hand. You choose a noncreature, nonland card from it. That player discards that card. mode = new Mode(); mode.getEffects().add(new DiscardCardYouChooseTargetEffect(filter)); mode.getTargets().add(new TargetOpponent()); this.getSpellAbility().addMode(mode); - + } public MarduCharm(final MarduCharm card) { @@ -101,26 +100,26 @@ public class MarduCharm extends CardImpl { } class MarduCharmCreateTokenEffect extends OneShotEffect { - + public MarduCharmCreateTokenEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "Put two 1/1 white Warrior creature tokens onto the battlefield. They gain first strike until end of turn"; } - + public MarduCharmCreateTokenEffect(final MarduCharmCreateTokenEffect effect) { super(effect); } - + @Override public MarduCharmCreateTokenEffect copy() { return new MarduCharmCreateTokenEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - CreateTokenEffect effect = new CreateTokenEffect(new MarduCharmWarriorToken(), 2); + CreateTokenEffect effect = new CreateTokenEffect(new WarriorToken(), 2); effect.apply(game, source); for (UUID tokenId :effect.getLastAddedTokenIds()) { Permanent token = game.getPermanent(tokenId); @@ -135,16 +134,3 @@ class MarduCharmCreateTokenEffect extends OneShotEffect { return false; } } -class MarduCharmWarriorToken extends Token { - - public MarduCharmWarriorToken() { - super("Warrior", "1/1 white Warrior creature token"); - this.setOriginalExpansionSetCode("KTK"); - this.setTokenType(2); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Warrior"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/MarduHordechief.java b/Mage.Sets/src/mage/sets/khansoftarkir/MarduHordechief.java index 4452b0dd55b..5338301b668 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/MarduHordechief.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/MarduHordechief.java @@ -36,7 +36,7 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.WarriorToken; import mage.watchers.common.PlayerAttackedWatcher; /** @@ -55,7 +55,7 @@ public class MarduHordechief extends CardImpl { this.toughness = new MageInt(3); // Raid - When Mardu Hordechief enters the battlefield, if you attacked with a creature this turn, put a 1/1 white Warrior creature token onto the battlefield - this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new MarduHordechiefToken())), RaidCondition.getInstance(), + this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WarriorToken())), RaidCondition.getInstance(), "Raid - When {this} enters the battlefield, if you attacked with a creature this turn, put a 1/1 white Warrior creature token onto the battlefield."), new PlayerAttackedWatcher()); } @@ -69,17 +69,3 @@ public class MarduHordechief extends CardImpl { return new MarduHordechief(this); } } - -class MarduHordechiefToken extends Token { - - MarduHordechiefToken() { - super("Warrior", "1/1 white Warrior creature token"); - this.setOriginalExpansionSetCode("KTK"); - cardType.add(CardType.CREATURE); - subtype.add("Warrior"); - - color.setWhite(true); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/MeanderingTowershell.java b/Mage.Sets/src/mage/sets/khansoftarkir/MeanderingTowershell.java index 87bcfe85461..a51b22e36a8 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/MeanderingTowershell.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/MeanderingTowershell.java @@ -46,19 +46,21 @@ import mage.game.permanent.Permanent; import mage.players.Player; /** - * As Meandering Towershell returns to the battlefield because of the delayed triggered ability, - * you choose which opponent or opposing planeswalker it’s attacking. It doesn’t have to attack - * the same opponent or opposing planeswalker that it was when it was exiled. + * As Meandering Towershell returns to the battlefield because of the delayed + * triggered ability, you choose which opponent or opposing planeswalker it’s + * attacking. It doesn’t have to attack the same opponent or opposing + * planeswalker that it was when it was exiled. * - * If Meandering Towershell enters the battlefield attacking, it wasn’t declared as an attacking - * creature that turn. Abilities that trigger when a creature attacks, including its own triggered - * ability, won’t trigger. + * If Meandering Towershell enters the battlefield attacking, it wasn’t declared + * as an attacking creature that turn. Abilities that trigger when a creature + * attacks, including its own triggered ability, won’t trigger. * - * On the turn Meandering Towershell attacks and is exiled, raid abilities will see it as a creature - * that attacked. Conversely, on the turn Meandering Towershell enters the battlefield attacking, - * raid abilities will not. + * On the turn Meandering Towershell attacks and is exiled, raid abilities will + * see it as a creature that attacked. Conversely, on the turn Meandering + * Towershell enters the battlefield attacking, raid abilities will not. * - * If you attack with a Meandering Towershell that you don’t own, you’ll control it when it returns to the battlefield. + * If you attack with a Meandering Towershell that you don’t own, you’ll control + * it when it returns to the battlefield. * * @author LevelX2 */ @@ -75,7 +77,7 @@ public class MeanderingTowershell extends CardImpl { // Islandwalk this.addAbility(new IslandwalkAbility()); - // Whenever Meandering Towershell attacks, exile it. + // Whenever Meandering Towershell attacks, exile it. // Return it to the battlefield under your control tapped and attacking // at the beginning of the next declare attackers step on your next turn. this.addAbility(new AttacksTriggeredAbility(new MeanderingTowershellEffect(), false)); @@ -191,7 +193,7 @@ class MeanderingTowershellReturnEffect extends OneShotEffect { if (controller != null) { Card card = game.getCard(source.getSourceId()); if (card != null && game.getState().getZone(source.getSourceId()).equals(Zone.EXILED)) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId(), true); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); game.getCombat().addAttackingCreature(card.getId(), game); return true; } diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/NarsetEnlightenedMaster.java b/Mage.Sets/src/mage/sets/khansoftarkir/NarsetEnlightenedMaster.java index a5093dcec42..f97744e57b6 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/NarsetEnlightenedMaster.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/NarsetEnlightenedMaster.java @@ -151,7 +151,7 @@ class NarsetEnlightenedMasterCastFromExileEffect extends AsThoughEffectImpl { if (card != null) { Player player = game.getPlayer(affectedControllerId); if (player != null) { - player.setCastSourceIdWithAlternateMana(objectId, null); + player.setCastSourceIdWithAlternateMana(objectId, null, null); return true; } } diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/PearlLakeAncient.java b/Mage.Sets/src/mage/sets/khansoftarkir/PearlLakeAncient.java index a2b8784709f..9681a0d2bc6 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/PearlLakeAncient.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/PearlLakeAncient.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.CantBeCounteredAbility; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.ProwessAbility; @@ -67,7 +67,7 @@ public class PearlLakeAncient extends CardImpl { // Return three lands you control to their owner's hand: Return Pearl Lake Ancient to its owner's hand. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), - new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(3, 3, new FilterControlledLandPermanent("lands"), true)))); + new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(3, 3, new FilterControlledLandPermanent("lands"), true)))); } public PearlLakeAncient(final PearlLakeAncient card) { diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/SarkhanTheDragonspeaker.java b/Mage.Sets/src/mage/sets/khansoftarkir/SarkhanTheDragonspeaker.java index cb84a4e3e85..c6d95ccf67b 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/SarkhanTheDragonspeaker.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/SarkhanTheDragonspeaker.java @@ -34,13 +34,12 @@ import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.BeginningOfDrawTriggeredAbility; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GetEmblemEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.discard.DiscardHandControllerEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.HasteAbility; @@ -54,7 +53,6 @@ import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.TargetController; import mage.constants.Zone; -import mage.counters.CounterType; import mage.game.Game; import mage.game.command.Emblem; import mage.game.permanent.Permanent; @@ -71,16 +69,16 @@ public class SarkhanTheDragonspeaker extends CardImpl { this.expansionSetCode = "KTK"; this.subtype.add("Sarkhan"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Until end of turn, Sarkhan, the Dragonspeaker becomes a legendary 4/4 red Dragon creature with flying, indestructible, and haste. this.addAbility(new LoyaltyAbility(new SarkhanTheDragonspeakerEffect(), 1)); - + // -3: Sarkhan, the Dragonspeaker deals 4 damage to target creature. LoyaltyAbility ability = new LoyaltyAbility(new DamageTargetEffect(4), -3); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); - + // -6: You get an emblem with "At the beginning of your draw step, draw two additional cards" and "At the beginning of your end step, discard your hand." Effect effect = new GetEmblemEffect(new SarkhanTheDragonspeakerEmblem()); effect.setText("You get an emblem with \"At the beginning of your draw step, draw two additional cards\" and \"At the beginning of your end step, discard your hand.\""); @@ -98,7 +96,7 @@ public class SarkhanTheDragonspeaker extends CardImpl { } class SarkhanTheDragonspeakerEffect extends ContinuousEffectImpl { - + SarkhanTheDragonspeakerEffect() { super(Duration.EndOfTurn, Outcome.BecomeCreature); staticText = "Until end of turn, {this} becomes a legendary 4/4 red Dragon creature with flying, indestructible, and haste."; @@ -112,7 +110,7 @@ class SarkhanTheDragonspeakerEffect extends ContinuousEffectImpl { public SarkhanTheDragonspeakerEffect copy() { return new SarkhanTheDragonspeakerEffect(this); } - + @Override public void init(Ability source, Game game) { super.init(source, game); diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/SeeTheUnwritten.java b/Mage.Sets/src/mage/sets/khansoftarkir/SeeTheUnwritten.java index bf66ae2db31..75c2c3dc55b 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/SeeTheUnwritten.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/SeeTheUnwritten.java @@ -47,8 +47,6 @@ import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; - - /** * * @author LevelX2 @@ -59,15 +57,14 @@ public class SeeTheUnwritten extends CardImpl { super(ownerId, 149, "See the Unwritten", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{4}{G}{G}"); this.expansionSetCode = "KTK"; - // Reveal the top eight cards of your library. You may put a creature card from among them onto the battlefield. Put the rest into your graveyard. // Ferocious - If you control a creature with power 4 or greater, you may put two creature cards onto the battlefield instead of one. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SeeTheUnwrittenEffect(1), - new SeeTheUnwrittenEffect(2), + new SeeTheUnwrittenEffect(2), new InvertCondition(FerociousCondition.getInstance()), - "Reveal the top eight cards of your library. You may put a creature card from among them onto the battlefield. Put the rest into your graveyard." + - "
Ferocious — If you control a creature with power 4 or greater, you may put two creature cards onto the battlefield instead of one" )); + "Reveal the top eight cards of your library. You may put a creature card from among them onto the battlefield. Put the rest into your graveyard." + + "
Ferocious — If you control a creature with power 4 or greater, you may put two creature cards onto the battlefield instead of one")); } public SeeTheUnwritten(final SeeTheUnwritten card) { @@ -89,9 +86,9 @@ class SeeTheUnwrittenEffect extends OneShotEffect { public SeeTheUnwrittenEffect(int numberOfCardsToPutIntoPlay) { super(Outcome.DrawCard); this.numberOfCardsToPutIntoPlay = numberOfCardsToPutIntoPlay; - this.staticText = "Reveal the top eight cards of your library. You may put " + - (numberOfCardsToPutIntoPlay == 1 ? "a creature card":"two creature cards") + - " from among them onto the battlefield. Put the rest into your graveyard"; + this.staticText = "Reveal the top eight cards of your library. You may put " + + (numberOfCardsToPutIntoPlay == 1 ? "a creature card" : "two creature cards") + + " from among them onto the battlefield. Put the rest into your graveyard"; } public SeeTheUnwrittenEffect(final SeeTheUnwrittenEffect effect) { @@ -126,24 +123,24 @@ class SeeTheUnwrittenEffect extends OneShotEffect { if (!cards.isEmpty()) { controller.revealCards(sourceObject.getName(), cards, game); if (creatureCardsFound > 0 && controller.chooseUse(outcome, "Put creature(s) into play?", source, game)) { - int cardsToChoose = Math.min(numberOfCardsToPutIntoPlay, creatureCardsFound); + int cardsToChoose = Math.min(numberOfCardsToPutIntoPlay, creatureCardsFound); TargetCard target = new TargetCard(cardsToChoose, cardsToChoose, Zone.LIBRARY, filter); if (controller.choose(Outcome.PutCreatureInPlay, cards, target, game)) { - for(UUID creatureId: target.getTargets()) { + for (UUID creatureId : target.getTargets()) { Card card = game.getCard(creatureId); if (card != null) { cards.remove(card); - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } } } - controller.moveCards(cards, Zone.LIBRARY, Zone.GRAVEYARD, source, game); + controller.moveCards(cards, Zone.GRAVEYARD, source, game); } return true; } return false; } - + } diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/SorinSolemnVisitor.java b/Mage.Sets/src/mage/sets/khansoftarkir/SorinSolemnVisitor.java index 835039e8420..c12ea7c75ef 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/SorinSolemnVisitor.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/SorinSolemnVisitor.java @@ -32,14 +32,13 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.SacrificeEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; @@ -48,12 +47,10 @@ import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.game.command.Emblem; import mage.game.permanent.token.Token; - /** * * @author LevelX2 @@ -65,8 +62,7 @@ public class SorinSolemnVisitor extends CardImpl { this.expansionSetCode = "KTK"; this.subtype.add("Sorin"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Until your next turn, creatures you control get +1/+0 and gain lifelink. Effect effect = new BoostControlledEffect(1, 0, Duration.UntilYourNextTurn, new FilterCreaturePermanent()); @@ -94,18 +90,22 @@ public class SorinSolemnVisitor extends CardImpl { return new SorinSolemnVisitor(this); } } + /** - * Emblem: "At the beginning of each opponent's upkeep, that player sacrifices a creature." + * Emblem: "At the beginning of each opponent's upkeep, that player sacrifices a + * creature." */ class SorinEmblem extends Emblem { + public SorinEmblem() { this.setName("EMBLEM: Sorin, Solemn Visitor"); - Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.COMMAND, new SacrificeEffect(new FilterCreaturePermanent(),1 ,"that player"), TargetController.OPPONENT, false, true); + Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.COMMAND, new SacrificeEffect(new FilterCreaturePermanent(), 1, "that player"), TargetController.OPPONENT, false, true); this.getAbilities().add(ability); } } class SorinSolemnVisitorVampireToken extends Token { + SorinSolemnVisitorVampireToken() { super("Vampire", "a 2/2 black Vampire creature token with flying"); setOriginalExpansionSetCode("KTK"); diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/SultaiAscendancy.java b/Mage.Sets/src/mage/sets/khansoftarkir/SultaiAscendancy.java index ab1050c0e4b..b0cf690da77 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/SultaiAscendancy.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/SultaiAscendancy.java @@ -46,7 +46,7 @@ import mage.filter.FilterCard; public class SultaiAscendancy extends CardImpl { public SultaiAscendancy(UUID ownerId) { - super(ownerId, 203, "Sultai Ascendancy", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G}{B}{U}"); + super(ownerId, 203, "Sultai Ascendancy", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{G}{U}"); this.expansionSetCode = "KTK"; diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/TakeUpArms.java b/Mage.Sets/src/mage/sets/khansoftarkir/TakeUpArms.java index 2d448508bb2..6aaf4499cac 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/TakeUpArms.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/TakeUpArms.java @@ -28,12 +28,11 @@ package mage.sets.khansoftarkir; import java.util.UUID; -import mage.MageInt; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.WarriorToken; /** * @@ -47,7 +46,7 @@ public class TakeUpArms extends CardImpl { // Put three 1/1 white Warrior creature tokens onto the battlefield. - this.getSpellAbility().addEffect(new CreateTokenEffect(new TakeUpArmsToken(), 3)); + this.getSpellAbility().addEffect(new CreateTokenEffect(new WarriorToken(), 3)); } public TakeUpArms(final TakeUpArms card) { @@ -59,17 +58,3 @@ public class TakeUpArms extends CardImpl { return new TakeUpArms(this); } } - -class TakeUpArmsToken extends Token { - - TakeUpArmsToken() { - super("Warrior", "1/1 white Warrior creature token"); - this.setOriginalExpansionSetCode("KTK"); - cardType.add(CardType.CREATURE); - subtype.add("Warrior"); - - color.setWhite(true); - power = new MageInt(1); - toughness = new MageInt(1); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/VillainousWealth.java b/Mage.Sets/src/mage/sets/khansoftarkir/VillainousWealth.java index 05f841c7266..cf5fa4b68a7 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/VillainousWealth.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/VillainousWealth.java @@ -33,6 +33,8 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -41,7 +43,6 @@ import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.common.FilterNonlandCard; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; -import mage.game.ExileZone; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInExile; @@ -58,7 +59,6 @@ public class VillainousWealth extends CardImpl { super(ownerId, 211, "Villainous Wealth", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{B}{G}{U}"); this.expansionSetCode = "KTK"; - // Target opponent exiles the top X cards of his or her library. You may cast any number of nonland cards with converted mana cost X or less from among them without paying their mana cost. this.getSpellAbility().addTarget(new TargetOpponent()); this.getSpellAbility().addEffect(new VillainousWealthEffect()); @@ -101,30 +101,27 @@ class VillainousWealthEffect extends OneShotEffect { filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, source.getManaCostsToPay().getX() + 1)); UUID exileId = CardUtil.getCardExileZoneId(game, source); if (player != null) { - - // putting cards to exile shouldn't end the game, so getting minimun available - int cardsCount = Math.min(source.getManaCostsToPay().getX(), player.getLibrary().size()); - for (int i = 0; i < cardsCount; i++) { - Card card = player.getLibrary().getFromTop(game); - if (card != null) { - controller.moveCardToExileWithInfo(card, exileId, mageObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true); + Cards cardsToExile = new CardsImpl(); + cardsToExile.addAll(player.getLibrary().getTopCards(game, source.getManaCostsToPay().getX())); + controller.moveCards(cardsToExile, null, Zone.EXILED, source, game); + if (controller.chooseUse(Outcome.PlayForFree, "Cast cards exiled with " + mageObject.getLogName() + " without paying its mana cost?", source, game)) { + OuterLoop: + while (cardsToExile.count(filter, game) > 0) { + TargetCardInExile target = new TargetCardInExile(0, 1, filter, exileId, false); + target.setNotTarget(true); + while (cardsToExile.count(filter, game) > 0 && controller.choose(Outcome.PlayForFree, cardsToExile, target, game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + controller.cast(card.getSpellAbility(), game, true); + cardsToExile.remove(card); + } else { + break OuterLoop; + } + target.clearChosen(); + } } } } - ExileZone exileZone = game.getExile().getExileZone(exileId); - while (exileZone != null && exileZone.count(filter, game) > 0 - && controller.chooseUse(Outcome.PlayForFree, "Cast cards exiled with " + mageObject.getLogName() +" without paying its mana cost?", source, game)) { - TargetCardInExile target = new TargetCardInExile(0,1, filter, exileId, false); - while (exileZone.count(filter, game) > 0 && controller.choose(Outcome.PlayForFree, exileZone, target, game)) { - Card card = game.getCard(target.getFirstTarget()); - if (card != null) { - controller.cast(card.getSpellAbility(), game, true); - } else { - break; - } - target.clearChosen(); - } - } return true; } diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/WarNameAspirant.java b/Mage.Sets/src/mage/sets/khansoftarkir/WarNameAspirant.java index d319410e590..cc33f764fd9 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/WarNameAspirant.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/WarNameAspirant.java @@ -68,7 +68,6 @@ public class WarNameAspirant extends CardImpl { // Raid - War-Name Aspirant enters the battlefield with a +1/+1 counter on it if you attacked with a creature this turn. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1), false), RaidCondition.getInstance(), - true, "Raid - {this} enters the battlefield with a +1/+1 counter on it if you attacked with a creature this turn", "{this} enters the battlefield with a +1/+1 counter"), new PlayerAttackedWatcher()); diff --git a/Mage.Sets/src/mage/sets/knightsvsdragons/Ghostfire.java b/Mage.Sets/src/mage/sets/knightsvsdragons/Ghostfire.java index d9afd38ba45..fbe9406fa1f 100644 --- a/Mage.Sets/src/mage/sets/knightsvsdragons/Ghostfire.java +++ b/Mage.Sets/src/mage/sets/knightsvsdragons/Ghostfire.java @@ -28,8 +28,9 @@ package mage.sets.knightsvsdragons; import java.util.UUID; - +import mage.ObjectColor; import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.InfoEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; @@ -46,6 +47,9 @@ public class Ghostfire extends CardImpl { this.expansionSetCode = "DDG"; // Ghostfire is colorless. + this.color = new ObjectColor(); + this.getSpellAbility().addEffect(new InfoEffect("{this} is colorless")); + // Ghostfire deals 3 damage to target creature or player. this.getSpellAbility().addEffect(new DamageTargetEffect(3)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); diff --git a/Mage.Sets/src/mage/sets/launchparty/BlightHerder.java b/Mage.Sets/src/mage/sets/launchparty/BlightHerder.java new file mode 100644 index 00000000000..01bebfd8478 --- /dev/null +++ b/Mage.Sets/src/mage/sets/launchparty/BlightHerder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.launchparty; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BlightHerder extends mage.sets.battleforzendikar.BlightHerder { + + public BlightHerder(UUID ownerId) { + super(ownerId); + this.cardNumber = 32; + this.expansionSetCode = "MLP"; + } + + public BlightHerder(final BlightHerder card) { + super(card); + } + + @Override + public BlightHerder copy() { + return new BlightHerder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/AErathiBerserker.java b/Mage.Sets/src/mage/sets/legends/AErathiBerserker.java new file mode 100644 index 00000000000..92fd344f643 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/AErathiBerserker.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class AErathiBerserker extends CardImpl { + + public AErathiBerserker(UUID ownerId) { + super(ownerId, 131, "AErathi Berserker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}{R}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Human"); + this.subtype.add("Berserker"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Rampage 3 + this.addAbility(new RampageAbility(3)); + } + + public AErathiBerserker(final AErathiBerserker card) { + super(card); + } + + @Override + public AErathiBerserker copy() { + return new AErathiBerserker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/Abomination.java b/Mage.Sets/src/mage/sets/legends/Abomination.java index 5bf815d95f1..179e0541ff5 100644 --- a/Mage.Sets/src/mage/sets/legends/Abomination.java +++ b/Mage.Sets/src/mage/sets/legends/Abomination.java @@ -29,22 +29,18 @@ package mage.sets.legends; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.ObjectColor; +import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.target.targetpointer.FixedTarget; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -52,6 +48,12 @@ import mage.target.targetpointer.FixedTarget; */ public class Abomination extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green or white creature"); + + static { + filter.add(Predicates.or(new ColorPredicate(ObjectColor.GREEN), new ColorPredicate(ObjectColor.WHITE))); + } + public Abomination(UUID ownerId) { super(ownerId, 1, "Abomination", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.expansionSetCode = "LEG"; @@ -61,7 +63,10 @@ public class Abomination extends CardImpl { this.toughness = new MageInt(6); // Whenever Abomination blocks or becomes blocked by a green or white creature, destroy that creature at end of combat. - this.addAbility(new AbominationTriggeredAbility()); + Effect effect = new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); + effect.setText("destroy that creature at end of combat"); + this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false)); } public Abomination(final Abomination card) { @@ -73,99 +78,3 @@ public class Abomination extends CardImpl { return new Abomination(this); } } - -class AbominationTriggeredAbility extends TriggeredAbilityImpl { - - AbominationTriggeredAbility() { - super(Zone.BATTLEFIELD, new AbominationEffect()); - } - - AbominationTriggeredAbility(final AbominationTriggeredAbility ability) { - super(ability); - } - - @Override - public AbominationTriggeredAbility copy() { - return new AbominationTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.BLOCKER_DECLARED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent blocker = game.getPermanent(event.getSourceId()); - Permanent blocked = game.getPermanent(event.getTargetId()); - Permanent abomination = game.getPermanent(sourceId); - if (blocker != null && blocker != abomination - && blocker.getColor(game).isWhite() - && blocked == abomination) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getSourceId())); - return true; - } - } - if (blocker != null && blocker == abomination - && game.getPermanent(event.getTargetId()).getColor(game).isWhite()) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - return true; - } - } - if (blocker != null && blocker != abomination - && blocker.getColor(game).isGreen() - && blocked == abomination) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getSourceId())); - return true; - } - } - if (blocker != null && blocker == abomination - && game.getPermanent(event.getTargetId()).getColor(game).isGreen()) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - return true; - } - } - return false; - } - - @Override - public String getRule() { - return "Whenever {this} blocks or becomes blocked by a green or white creature, destroy that creature at end of combat."; - } -} - -class AbominationEffect extends OneShotEffect { - - AbominationEffect() { - super(Outcome.Detriment); - staticText = "Destroy that creature at the end of combat"; - } - - AbominationEffect(final AbominationEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability event) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, event)); - if (permanent != null) { - AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()); - delayedAbility.setSourceId(permanent.getId()); - delayedAbility.setControllerId(event.getControllerId()); - delayedAbility.setSourceObject(event.getSourceObject(game), game); - delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - return false; - } - - @Override - public AbominationEffect copy() { - return new AbominationEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/legends/ActiveVolcano.java b/Mage.Sets/src/mage/sets/legends/ActiveVolcano.java index 553776ba1de..8acab9a6337 100644 --- a/Mage.Sets/src/mage/sets/legends/ActiveVolcano.java +++ b/Mage.Sets/src/mage/sets/legends/ActiveVolcano.java @@ -36,7 +36,6 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.filter.FilterPermanent; -import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; @@ -46,9 +45,9 @@ import mage.target.TargetPermanent; * @author emerald000 */ public class ActiveVolcano extends CardImpl { - + private static final FilterPermanent filterBlue = new FilterPermanent("blue permanent"); - private static final FilterLandPermanent filterIsland = new FilterLandPermanent("Island"); + private static final FilterPermanent filterIsland = new FilterPermanent("Island"); static { filterBlue.add(new ColorPredicate(ObjectColor.BLUE)); filterIsland.add(new SubtypePredicate("Island")); @@ -62,7 +61,7 @@ public class ActiveVolcano extends CardImpl { // Choose one - Destroy target blue permanent; this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(filterBlue)); - + // or return target Island to its owner's hand. Mode mode = new Mode(); mode.getEffects().add(new ReturnToHandTargetEffect()); diff --git a/Mage.Sets/src/mage/sets/legends/AmrouKithkin.java b/Mage.Sets/src/mage/sets/legends/AmrouKithkin.java new file mode 100644 index 00000000000..9f57ddf6218 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/AmrouKithkin.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; + +/** + * + * @author fireshoes + */ +public class AmrouKithkin extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with power 3 or greater"); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 2)); + } + + public AmrouKithkin(UUID ownerId) { + super(ownerId, 172, "Amrou Kithkin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}{W}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Kithkin"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Amrou Kithkin can't be blocked by creatures with power 3 or greater. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + } + + public AmrouKithkin(final AmrouKithkin card) { + super(card); + } + + @Override + public AmrouKithkin copy() { + return new AmrouKithkin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/ArcadesSabboth.java b/Mage.Sets/src/mage/sets/legends/ArcadesSabboth.java new file mode 100644 index 00000000000..0fe40090c40 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/ArcadesSabboth.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ArcadesSabboth extends mage.sets.masterseditioniii.ArcadesSabboth { + + public ArcadesSabboth(UUID ownerId) { + super(ownerId); + this.cardNumber = 258; + this.expansionSetCode = "LEG"; + } + + public ArcadesSabboth(final ArcadesSabboth card) { + super(card); + } + + @Override + public ArcadesSabboth copy() { + return new ArcadesSabboth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/ArenaOfTheAncients.java b/Mage.Sets/src/mage/sets/legends/ArenaOfTheAncients.java index c5564f03ead..c8d98544ed1 100644 --- a/Mage.Sets/src/mage/sets/legends/ArenaOfTheAncients.java +++ b/Mage.Sets/src/mage/sets/legends/ArenaOfTheAncients.java @@ -32,7 +32,7 @@ public class ArenaOfTheAncients extends CardImpl { } public ArenaOfTheAncients(UUID ownerId) { - super(ownerId, 215, "Arena Of The Ancients", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + super(ownerId, 215, "Arena of the Ancients", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); this.expansionSetCode = "LEG"; // When Arena of the Ancients enters the battlefield, tap all Legendary creatures diff --git a/Mage.Sets/src/mage/sets/legends/AvoidFate.java b/Mage.Sets/src/mage/sets/legends/AvoidFate.java new file mode 100644 index 00000000000..457ace9b738 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/AvoidFate.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.other.TargetsPermanentPredicate; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + */ +public class AvoidFate extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("instant or Aura spell that targets a permanent you control"); + + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new SubtypePredicate("Aura"))); + filter.add(new TargetsPermanentPredicate(new FilterControlledPermanent())); + } + + public AvoidFate(UUID ownerId) { + super(ownerId, 89, "Avoid Fate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "LEG"; + + // Counter target instant or Aura spell that targets a permanent you control. + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + } + + public AvoidFate(final AvoidFate card) { + super(card); + } + + @Override + public AvoidFate copy() { + return new AvoidFate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/BorisDevilboon.java b/Mage.Sets/src/mage/sets/legends/BorisDevilboon.java new file mode 100644 index 00000000000..cda9278c4cb --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/BorisDevilboon.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + */ +public class BorisDevilboon extends CardImpl { + + public BorisDevilboon(UUID ownerId) { + super(ownerId, 263, "Boris Devilboon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{R}"); + this.expansionSetCode = "LEG"; + this.supertype.add("Legendary"); + this.subtype.add("Zombie"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {2}{B}{R}, {tap}: Put a 1/1 black and red Demon creature token named Minor Demon onto the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new MinorDemonToken()), new ManaCostsImpl("{2}{B}{R}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public BorisDevilboon(final BorisDevilboon card) { + super(card); + } + + @Override + public BorisDevilboon copy() { + return new BorisDevilboon(this); + } +} + +class MinorDemonToken extends Token { + + public MinorDemonToken() { + super("Minor Demon", "1/1 black and red Demon creature token named Minor Demon"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + color.setRed(true); + subtype.add("Demon"); + power = new MageInt(1); + toughness = new MageInt(1); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/Chromium.java b/Mage.Sets/src/mage/sets/legends/Chromium.java new file mode 100644 index 00000000000..e051d10c0a6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/Chromium.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Chromium extends mage.sets.masterseditioniii.Chromium { + + public Chromium(UUID ownerId) { + super(ownerId); + this.cardNumber = 264; + this.expansionSetCode = "LEG"; + } + + public Chromium(final Chromium card) { + super(card); + } + + @Override + public Chromium copy() { + return new Chromium(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/Cleanse.java b/Mage.Sets/src/mage/sets/legends/Cleanse.java new file mode 100644 index 00000000000..bd851bdec0a --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/Cleanse.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class Cleanse extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("black creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public Cleanse(UUID ownerId) { + super(ownerId, 174, "Cleanse", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}{W}"); + this.expansionSetCode = "LEG"; + + // Destroy all black creatures. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); + } + + public Cleanse(final Cleanse card) { + super(card); + } + + @Override + public Cleanse copy() { + return new Cleanse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/CosmicHorror.java b/Mage.Sets/src/mage/sets/legends/CosmicHorror.java new file mode 100644 index 00000000000..0f0e6273f24 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/CosmicHorror.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author jeffwadsworth + */ +public class CosmicHorror extends CardImpl { + + public CosmicHorror(UUID ownerId) { + super(ownerId, 6, "Cosmic Horror", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Horror"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // At the beginning of your upkeep, destroy Cosmic Horror unless you pay {3}{B}{B}{B}. If Cosmic Horror is destroyed this way, it deals 7 damage to you. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CosmicHorrorEffect(new ManaCostsImpl("{3}{B}{B}{B}")), TargetController.YOU, false)); + } + + public CosmicHorror(final CosmicHorror card) { + super(card); + } + + @Override + public CosmicHorror copy() { + return new CosmicHorror(this); + } +} + +class CosmicHorrorEffect extends OneShotEffect { + + protected Cost cost; + + public CosmicHorrorEffect(Cost cost) { + super(Outcome.DestroyPermanent); + this.cost = cost; + staticText = "destroy {this} unless you pay {3}{B}{B}{B}. If {this} is destroyed this way it deals 7 damage to you"; + } + + public CosmicHorrorEffect(final CosmicHorrorEffect effect) { + super(effect); + this.cost = effect.cost.copy(); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent cosmicHorror = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (controller != null && cosmicHorror != null) { + StringBuilder sb = new StringBuilder(cost.getText()).append("?"); + if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) { + sb.insert(0, "Pay "); + } + if (controller.chooseUse(Outcome.Benefit, sb.toString(), source, game)) { + cost.clearPaid(); + if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { + return true; + } + } + if (cosmicHorror.destroy(source.getSourceId(), game, false)) { + controller.damage(7, source.getSourceId(), game, false, true); + return true; + } + } + return false; + } + + @Override + public CosmicHorrorEffect copy() { + return new CosmicHorrorEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/CrawGiant.java b/Mage.Sets/src/mage/sets/legends/CrawGiant.java new file mode 100644 index 00000000000..93af4402d66 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/CrawGiant.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CrawGiant extends CardImpl { + + public CrawGiant(UUID ownerId) { + super(ownerId, 94, "Craw Giant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}{G}{G}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Giant"); + this.power = new MageInt(6); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Rampage 2 + this.addAbility(new RampageAbility(2)); + } + + public CrawGiant(final CrawGiant card) { + super(card); + } + + @Override + public CrawGiant copy() { + return new CrawGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/FieldOfDreams.java b/Mage.Sets/src/mage/sets/legends/FieldOfDreams.java new file mode 100644 index 00000000000..5b44a48f7ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/FieldOfDreams.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.PlayWithTheTopCardRevealedEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FieldOfDreams extends CardImpl { + + public FieldOfDreams(UUID ownerId) { + super(ownerId, 55, "Field of Dreams", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{U}"); + this.expansionSetCode = "LEG"; + this.supertype.add("World"); + + // Players play with the top card of their libraries revealed. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect(true))); + } + + public FieldOfDreams(final FieldOfDreams card) { + super(card); + } + + @Override + public FieldOfDreams copy() { + return new FieldOfDreams(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/FlashFlood.java b/Mage.Sets/src/mage/sets/legends/FlashFlood.java new file mode 100644 index 00000000000..b9ea6449152 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/FlashFlood.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Mode; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class FlashFlood extends CardImpl { + + private static final FilterPermanent filter1 = new FilterPermanent("red permanent"); + private static final FilterPermanent filter2 = new FilterPermanent("Mountain"); + + static { + filter1.add(new ColorPredicate(ObjectColor.RED)); + filter2.add(new SubtypePredicate("Mountain")); + } + + public FlashFlood(UUID ownerId) { + super(ownerId, 57, "Flash Flood", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "LEG"; + + // Choose one - Destroy target red permanent; + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter1)); + // or return target Mountain to its owner's hand. + Mode mode = new Mode(); + mode.getEffects().add(new ReturnToHandTargetEffect()); + mode.getTargets().add(new TargetPermanent(filter2)); + this.getSpellAbility().addMode(mode); + } + + public FlashFlood(final FlashFlood card) { + super(card); + } + + @Override + public FlashFlood copy() { + return new FlashFlood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/FrostGiant.java b/Mage.Sets/src/mage/sets/legends/FrostGiant.java new file mode 100644 index 00000000000..a4d8b1a1be2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/FrostGiant.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FrostGiant extends CardImpl { + + public FrostGiant(UUID ownerId) { + super(ownerId, 146, "Frost Giant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}{R}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Giant"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Rampage 2 + this.addAbility(new RampageAbility(2)); + } + + public FrostGiant(final FrostGiant card) { + super(card); + } + + @Override + public FrostGiant copy() { + return new FrostGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/GhostsOfTheDamned.java b/Mage.Sets/src/mage/sets/legends/GhostsOfTheDamned.java new file mode 100644 index 00000000000..3f713ceaa40 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/GhostsOfTheDamned.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; + +/** + * + * @author hanasu + */ +public class GhostsOfTheDamned extends mage.sets.masterseditioniii.GhostsOfTheDamned { + + public GhostsOfTheDamned(UUID ownerId) { + super(ownerId); + this.cardNumber = 12; + this.expansionSetCode = "LEG"; + } + + public GhostsOfTheDamned(final GhostsOfTheDamned card) { + super(card); + } + + @Override + public GhostsOfTheDamned copy() { + return new GhostsOfTheDamned(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/GravitySphere.java b/Mage.Sets/src/mage/sets/legends/GravitySphere.java new file mode 100644 index 00000000000..64d010fca18 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/GravitySphere.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.LoseAbilityAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class GravitySphere extends CardImpl { + + public GravitySphere(UUID ownerId) { + super(ownerId, 149, "Gravity Sphere", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "LEG"; + this.supertype.add("World"); + + // All creatures lose flying. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LoseAbilityAllEffect(new FilterCreaturePermanent("All creatures"), FlyingAbility.getInstance(), Duration.WhileOnBattlefield))); + } + + public GravitySphere(final GravitySphere card) { + super(card); + } + + @Override + public GravitySphere copy() { + return new GravitySphere(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/HazezonTamar.java b/Mage.Sets/src/mage/sets/legends/HazezonTamar.java index 21eca703027..19ca690ac55 100644 --- a/Mage.Sets/src/mage/sets/legends/HazezonTamar.java +++ b/Mage.Sets/src/mage/sets/legends/HazezonTamar.java @@ -33,7 +33,7 @@ import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.LeavesBattlefieldTriggeredAbility; -import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -111,7 +111,7 @@ class HazezonTamarEntersEffect extends OneShotEffect { if (controller != null) { Effect effect = new CreateTokenEffect(new HazezonTamarSandWarrior(), new PermanentsOnBattlefieldCount(new FilterControlledLandPermanent())); effect.setText("put X 1/1 Sand Warrior creature tokens that are red, green, and white onto the battlefield, where X is the number of lands you control at that time"); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(effect); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect); delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setControllerId(source.getControllerId()); delayedAbility.setSourceObject(source.getSourceObject(game), game); diff --git a/Mage.Sets/src/mage/sets/legends/HellsCaretaker.java b/Mage.Sets/src/mage/sets/legends/HellsCaretaker.java new file mode 100644 index 00000000000..1c12ff1dc20 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/HellsCaretaker.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class HellsCaretaker extends mage.sets.ninthedition.HellsCaretaker { + + public HellsCaretaker(UUID ownerId) { + super(ownerId); + this.cardNumber = 19; + this.expansionSetCode = "LEG"; + } + + public HellsCaretaker(final HellsCaretaker card) { + super(card); + } + + @Override + public HellsCaretaker copy() { + return new HellsCaretaker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/HorrorOfHorrors.java b/Mage.Sets/src/mage/sets/legends/HorrorOfHorrors.java new file mode 100644 index 00000000000..99db10a8060 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/HorrorOfHorrors.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class HorrorOfHorrors extends CardImpl { + + private static final FilterControlledPermanent filter1 = new FilterControlledPermanent("a Swamp"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("black creature"); + + static { + filter1.add(new SubtypePredicate("Swamp")); + filter2.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public HorrorOfHorrors(UUID ownerId) { + super(ownerId, 20, "Horror of Horrors", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}"); + this.expansionSetCode = "LEG"; + + // Sacrifice a Swamp: Regenerate target black creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), + new SacrificeTargetCost(new TargetControlledPermanent(filter1))); + ability.addTarget(new TargetCreaturePermanent(filter2)); + this.addAbility(ability); + } + + public HorrorOfHorrors(final HorrorOfHorrors card) { + super(card); + } + + @Override + public HorrorOfHorrors copy() { + return new HorrorOfHorrors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/HundingGjornersen.java b/Mage.Sets/src/mage/sets/legends/HundingGjornersen.java new file mode 100644 index 00000000000..e08fbc96149 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/HundingGjornersen.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class HundingGjornersen extends CardImpl { + + public HundingGjornersen(UUID ownerId) { + super(ownerId, 271, "Hunding Gjornersen", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}{U}{U}"); + this.expansionSetCode = "LEG"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Rampage 1 + this.addAbility(new RampageAbility(1)); + } + + public HundingGjornersen(final HundingGjornersen card) { + super(card); + } + + @Override + public HundingGjornersen copy() { + return new HundingGjornersen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/HyperionBlacksmith.java b/Mage.Sets/src/mage/sets/legends/HyperionBlacksmith.java new file mode 100644 index 00000000000..6eca10aafc0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/HyperionBlacksmith.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author fireshoes + */ +public class HyperionBlacksmith extends CardImpl { + + private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public HyperionBlacksmith(UUID ownerId) { + super(ownerId, 150, "Hyperion Blacksmith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Human"); + this.subtype.add("Artificer"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {tap}: You may tap or untap target artifact an opponent controls. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MayTapOrUntapTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetArtifactPermanent(filter)); + this.addAbility(ability); + } + + public HyperionBlacksmith(final HyperionBlacksmith card) { + super(card); + } + + @Override + public HyperionBlacksmith copy() { + return new HyperionBlacksmith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/IvoryGuardians.java b/Mage.Sets/src/mage/sets/legends/IvoryGuardians.java index 2e3b6a2615a..81e37f4aebb 100644 --- a/Mage.Sets/src/mage/sets/legends/IvoryGuardians.java +++ b/Mage.Sets/src/mage/sets/legends/IvoryGuardians.java @@ -54,13 +54,13 @@ import mage.game.Game; * @author jeffwadsworth */ public class IvoryGuardians extends CardImpl { - - private static final FilterCard filter = new FilterCard(); - + + private static final FilterCard filter = new FilterCard("red"); + static { filter.add(new ColorPredicate(ObjectColor.RED)); } - + private static final String rule = "Creatures named {this} get +1/+1 as long as an opponent controls a nontoken red permanent"; public IvoryGuardians(UUID ownerId) { @@ -73,10 +73,10 @@ public class IvoryGuardians extends CardImpl { // Protection from red this.addAbility(new ProtectionAbility(filter)); - + // Creatures named Ivory Guardians get +1/+1 as long as an opponent controls a nontoken red permanent. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostAllEffect(1, 1, Duration.WhileOnBattlefield), new IvoryGuardiansCondition(), rule))); - + } public IvoryGuardians(final IvoryGuardians card) { @@ -103,4 +103,4 @@ class IvoryGuardiansCondition implements Condition { } return conditionApplies; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/legends/KeiTakahashi.java b/Mage.Sets/src/mage/sets/legends/KeiTakahashi.java new file mode 100644 index 00000000000..ebc26302d2c --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/KeiTakahashi.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class KeiTakahashi extends mage.sets.masterseditioniii.KeiTakahashi { + + public KeiTakahashi(UUID ownerId) { + super(ownerId); + this.cardNumber = 278; + this.expansionSetCode = "LEG"; + this.rarity = Rarity.RARE; + } + + public KeiTakahashi(final KeiTakahashi card) { + super(card); + } + + @Override + public KeiTakahashi copy() { + return new KeiTakahashi(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/LadyCaleria.java b/Mage.Sets/src/mage/sets/legends/LadyCaleria.java new file mode 100644 index 00000000000..0ae9d96bc85 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/LadyCaleria.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LadyCaleria extends mage.sets.masterseditioniii.LadyCaleria { + + public LadyCaleria(UUID ownerId) { + super(ownerId); + this.cardNumber = 279; + this.expansionSetCode = "LEG"; + this.rarity = Rarity.RARE; + } + + public LadyCaleria(final LadyCaleria card) { + super(card); + } + + @Override + public LadyCaleria copy() { + return new LadyCaleria(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/LadyEvangela.java b/Mage.Sets/src/mage/sets/legends/LadyEvangela.java index c317c54c82b..30743d13b59 100644 --- a/Mage.Sets/src/mage/sets/legends/LadyEvangela.java +++ b/Mage.Sets/src/mage/sets/legends/LadyEvangela.java @@ -61,7 +61,6 @@ public class LadyEvangela extends CardImpl { Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true); effect.setText("Prevent all combat damage that would be dealt by target creature this turn."); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{W}{B}")); - ability.addEffect(effect); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/legends/LandTax.java b/Mage.Sets/src/mage/sets/legends/LandTax.java index ffd80349b0c..823758648df 100644 --- a/Mage.Sets/src/mage/sets/legends/LandTax.java +++ b/Mage.Sets/src/mage/sets/legends/LandTax.java @@ -29,7 +29,7 @@ package mage.sets.legends; import java.util.UUID; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.condition.common.OpponentControllsMoreCondition; +import mage.abilities.condition.common.OpponentControlsMoreCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; @@ -53,7 +53,7 @@ public class LandTax extends CardImpl { // At the beginning of your upkeep, if an opponent controls more lands than you, you may search your library for up to three basic land cards, reveal them, and put them into your hand. If you do, shuffle your library. this.addAbility(new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 3, new FilterBasicLandCard()), true), TargetController.YOU, true), - new OpponentControllsMoreCondition(new FilterLandPermanent("lands")), + new OpponentControlsMoreCondition(new FilterLandPermanent("lands")), "At the beginning of your upkeep, if an opponent controls more lands than you, you may search your library for up to three basic land cards, reveal them, and put them into your hand. If you do, shuffle your library" )); diff --git a/Mage.Sets/src/mage/sets/legends/Lifeblood.java b/Mage.Sets/src/mage/sets/legends/Lifeblood.java new file mode 100644 index 00000000000..9bca8d2d6ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/Lifeblood.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LoneFox + */ +public class Lifeblood extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("a Mountain an opponent controls"); + + static { + filter.add(new SubtypePredicate("Mountain")); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public Lifeblood(UUID ownerId) { + super(ownerId, 196, "Lifeblood", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); + this.expansionSetCode = "LEG"; + + // Whenever a Mountain an opponent controls becomes tapped, you gain 1 life. + this.addAbility(new BecomesTappedTriggeredAbility(new GainLifeEffect(1), false, filter)); + } + + public Lifeblood(final Lifeblood card) { + super(card); + } + + @Override + public Lifeblood copy() { + return new Lifeblood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/LivonyaSilone.java b/Mage.Sets/src/mage/sets/legends/LivonyaSilone.java new file mode 100644 index 00000000000..b6fece6b2e9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/LivonyaSilone.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LivonyaSilone extends mage.sets.masterseditioniii.LivonyaSilone { + + public LivonyaSilone(UUID ownerId) { + super(ownerId); + this.cardNumber = 282; + this.expansionSetCode = "LEG"; + this.rarity = Rarity.RARE; + } + + public LivonyaSilone(final LivonyaSilone card) { + super(card); + } + + @Override + public LivonyaSilone copy() { + return new LivonyaSilone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/MarhaultElsdragon.java b/Mage.Sets/src/mage/sets/legends/MarhaultElsdragon.java new file mode 100644 index 00000000000..8cd84f424e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/MarhaultElsdragon.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class MarhaultElsdragon extends CardImpl { + + public MarhaultElsdragon(UUID ownerId) { + super(ownerId, 284, "Marhault Elsdragon", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}{G}"); + this.expansionSetCode = "LEG"; + this.supertype.add("Legendary"); + this.subtype.add("Elf"); + this.subtype.add("Warrior"); + this.power = new MageInt(4); + this.toughness = new MageInt(6); + + // Rampage 1 + this.addAbility(new RampageAbility(1)); + } + + public MarhaultElsdragon(final MarhaultElsdragon card) { + super(card); + } + + @Override + public MarhaultElsdragon copy() { + return new MarhaultElsdragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/NicolBolas.java b/Mage.Sets/src/mage/sets/legends/NicolBolas.java index 8bf534631e0..b53d6463817 100644 --- a/Mage.Sets/src/mage/sets/legends/NicolBolas.java +++ b/Mage.Sets/src/mage/sets/legends/NicolBolas.java @@ -62,7 +62,7 @@ public class NicolBolas extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{U}{B}{R}")), TargetController.YOU, false)); // Whenever Nicol Bolas deals damage to an opponent, that player discards his or her hand. - this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardHandTargetEffect("that player"), false)); + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardHandTargetEffect("that player"), false, false, true)); } public NicolBolas(final NicolBolas card) { diff --git a/Mage.Sets/src/mage/sets/legends/OsaiVultures.java b/Mage.Sets/src/mage/sets/legends/OsaiVultures.java new file mode 100644 index 00000000000..1aa3c739ff8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/OsaiVultures.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.common.MorbidCondition; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + */ +public class OsaiVultures extends CardImpl { + + public OsaiVultures(UUID ownerId) { + super(ownerId, 198, "Osai Vultures", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Bird"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // At the beginning of each end step, if a creature died this turn, put a carrion counter on Osai Vultures. + this.addAbility(new ConditionalTriggeredAbility(new BeginningOfEndStepTriggeredAbility( + new AddCountersSourceEffect(CounterType.CARRION.createInstance()), TargetController.ANY, false), MorbidCondition.getInstance(), + "At the beginning of each end step, if a creature died this turn, put a carrion counter on {this}.")); + // Remove two carrion counters from Osai Vultures: Osai Vultures gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), + new RemoveCountersSourceCost(CounterType.CARRION.createInstance(2)))); + } + + public OsaiVultures(final OsaiVultures card) { + super(card); + } + + @Override + public OsaiVultures copy() { + return new OsaiVultures(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/PalladiaMors.java b/Mage.Sets/src/mage/sets/legends/PalladiaMors.java new file mode 100644 index 00000000000..80dd2a58f3b --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/PalladiaMors.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class PalladiaMors extends mage.sets.masterseditioniii.PalladiaMors { + + public PalladiaMors(UUID ownerId) { + super(ownerId); + this.cardNumber = 287; + this.expansionSetCode = "LEG"; + } + + public PalladiaMors(final PalladiaMors card) { + super(card); + } + + @Override + public PalladiaMors copy() { + return new PalladiaMors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/PartWater.java b/Mage.Sets/src/mage/sets/legends/PartWater.java new file mode 100644 index 00000000000..6c9b191df2d --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/PartWater.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.IslandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class PartWater extends CardImpl { + + public PartWater(UUID ownerId) { + super(ownerId, 66, "Part Water", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{X}{U}"); + this.expansionSetCode = "LEG"; + + // X target creatures gain islandwalk until end of turn. + Effect effect = new GainAbilityTargetEffect(new IslandwalkAbility(false), Duration.EndOfTurn); + effect.setText("X target creatures gain islandwalk until end of turn"); + this.getSpellAbility().getEffects().add(effect); + this.getSpellAbility().getTargets().add(new TargetCreaturePermanent(1,1)); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if (ability instanceof SpellAbility) { + ability.getTargets().clear(); + int xValue = ability.getManaCostsToPay().getX(); + FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures gain islandwalk until end of turn"); + ability.getTargets().add(new TargetCreaturePermanent(0, xValue, filter, false)); + } + } + + public PartWater(final PartWater card) { + super(card); + } + + @Override + public PartWater copy() { + return new PartWater(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/PavelMaliki.java b/Mage.Sets/src/mage/sets/legends/PavelMaliki.java new file mode 100644 index 00000000000..7b918d9fec6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/PavelMaliki.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author nigelzor + */ +public class PavelMaliki extends CardImpl { + + public PavelMaliki(UUID ownerId) { + super(ownerId, 288, "Pavel Maliki", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}{R}"); + this.expansionSetCode = "LEG"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + // {B}{R}: Pavel Maliki gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{B}{R}"))); + } + + public PavelMaliki(final PavelMaliki card) { + super(card); + } + + @Override + public PavelMaliki copy() { + return new PavelMaliki(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/PixieQueen.java b/Mage.Sets/src/mage/sets/legends/PixieQueen.java new file mode 100644 index 00000000000..1bfe612f28b --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/PixieQueen.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author hanasu + */ +public class PixieQueen extends CardImpl { + + public PixieQueen(UUID ownerId) { + super(ownerId, 110, "Pixie Queen", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Faerie"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // {G}{G}{G}, {tap}: Target creature gains flying until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{G}{G}{G}")); + ability.addTarget(new TargetCreaturePermanent()); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public PixieQueen(final PixieQueen card) { + super(card); + } + + @Override + public PixieQueen copy() { + return new PixieQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/PresenceOfTheMaster.java b/Mage.Sets/src/mage/sets/legends/PresenceOfTheMaster.java new file mode 100644 index 00000000000..d09c89d9de4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/PresenceOfTheMaster.java @@ -0,0 +1,130 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class PresenceOfTheMaster extends CardImpl { + + public PresenceOfTheMaster(UUID ownerId) { + super(ownerId, 200, "Presence of the Master", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "LEG"; + + // Whenever a player casts an enchantment spell, counter it. + this.addAbility(new PresenceOfTheMasterTriggeredAbility()); + } + + public PresenceOfTheMaster(final PresenceOfTheMaster card) { + super(card); + } + + @Override + public PresenceOfTheMaster copy() { + return new PresenceOfTheMaster(this); + } +} + +class PresenceOfTheMasterTriggeredAbility extends TriggeredAbilityImpl { + + + public PresenceOfTheMasterTriggeredAbility() { + super(Zone.BATTLEFIELD, new CounterEffect()); + } + + + public PresenceOfTheMasterTriggeredAbility(final PresenceOfTheMasterTriggeredAbility abiltity) { + super(abiltity); + } + + @java.lang.Override + public PresenceOfTheMasterTriggeredAbility copy() { + return new PresenceOfTheMasterTriggeredAbility(this); + } + + @java.lang.Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST; + } + + @java.lang.Override + public boolean checkTrigger(GameEvent event, Game game) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && (spell.getCardType().contains(CardType.ENCHANTMENT))){ + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + } + return true; + } + return false; + } + + @java.lang.Override + public String getRule() { + return "Whenever a player casts an enchantment spell, counter it"; + } +} + + +class CounterEffect extends OneShotEffect { + + public CounterEffect() { + super(Outcome.Detriment); + } + + public CounterEffect(final CounterEffect effect) { + super(effect); + } + + @java.lang.Override + public CounterEffect copy() { + return new CounterEffect(this); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + return game.getStack().counter(this.getTargetPointer().getFirst(game, source), source.getSourceId(), game); + } + +} diff --git a/Mage.Sets/src/mage/sets/legends/PrincessLucrezia.java b/Mage.Sets/src/mage/sets/legends/PrincessLucrezia.java new file mode 100644 index 00000000000..db585a0ed1b --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/PrincessLucrezia.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class PrincessLucrezia extends mage.sets.masterseditioniii.PrincessLucrezia { + + public PrincessLucrezia(UUID ownerId) { + super(ownerId); + this.cardNumber = 289; + this.expansionSetCode = "LEG"; + } + + public PrincessLucrezia(final PrincessLucrezia card) { + super(card); + } + + @Override + public PrincessLucrezia copy() { + return new PrincessLucrezia(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/RamsesOverdark.java b/Mage.Sets/src/mage/sets/legends/RamsesOverdark.java new file mode 100644 index 00000000000..c1fab094807 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/RamsesOverdark.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class RamsesOverdark extends mage.sets.masterseditioniii.RamsesOverdark { + + public RamsesOverdark(UUID ownerId) { + super(ownerId); + this.cardNumber = 292; + this.expansionSetCode = "LEG"; + this.rarity = Rarity.RARE; + } + + public RamsesOverdark(final RamsesOverdark card) { + super(card); + } + + @Override + public RamsesOverdark copy() { + return new RamsesOverdark(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/RingOfImmortals.java b/Mage.Sets/src/mage/sets/legends/RingOfImmortals.java new file mode 100644 index 00000000000..4679b275d39 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/RingOfImmortals.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.other.TargetsPermanentPredicate; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + */ +public class RingOfImmortals extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("instant or Aura spell that targets a permanent you control"); + + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new SubtypePredicate("Aura"))); + filter.add(new TargetsPermanentPredicate(new FilterControlledPermanent())); + } + + public RingOfImmortals(UUID ownerId) { + super(ownerId, 238, "Ring of Immortals", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "LEG"; + + // {3}, {tap}: Counter target instant or Aura spell that targets a permanent you control. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetSpell(filter)); + this.addAbility(ability); + } + + public RingOfImmortals(final RingOfImmortals card) { + super(card); + } + + @Override + public RingOfImmortals copy() { + return new RingOfImmortals(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/RivenTurnbull.java b/Mage.Sets/src/mage/sets/legends/RivenTurnbull.java new file mode 100644 index 00000000000..53077b746ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/RivenTurnbull.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.mana.BlackManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class RivenTurnbull extends CardImpl { + + public RivenTurnbull(UUID ownerId) { + super(ownerId, 294, "Riven Turnbull", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{U}{B}"); + this.expansionSetCode = "LEG"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Advisor"); + this.power = new MageInt(5); + this.toughness = new MageInt(7); + + // {tap}: Add {B} to your mana pool. + this.addAbility(new BlackManaAbility()); + } + + public RivenTurnbull(final RivenTurnbull card) { + super(card); + } + + @Override + public RivenTurnbull copy() { + return new RivenTurnbull(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/SpinalVillain.java b/Mage.Sets/src/mage/sets/legends/SpinalVillain.java new file mode 100644 index 00000000000..f5ed15de098 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/SpinalVillain.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SpinalVillain extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blue creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public SpinalVillain(UUID ownerId) { + super(ownerId, 161, "Spinal Villain", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Beast"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {tap}: Destroy target blue creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public SpinalVillain(final SpinalVillain card) { + super(card); + } + + @Override + public SpinalVillain copy() { + return new SpinalVillain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/StormSeeker.java b/Mage.Sets/src/mage/sets/legends/StormSeeker.java new file mode 100644 index 00000000000..53dd9ddc226 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/StormSeeker.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; + +/** + * + * @author hanasu + */ +public class StormSeeker extends mage.sets.mastersedition.StormSeeker { + + public StormSeeker(UUID ownerId) { + super(ownerId); + this.cardNumber = 119; + this.expansionSetCode = "LEG"; + } + + public StormSeeker(final StormSeeker card) { + super(card); + } + + @Override + public StormSeeker copy() { + return new StormSeeker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/SunastianFalconer.java b/Mage.Sets/src/mage/sets/legends/SunastianFalconer.java new file mode 100644 index 00000000000..3bd67e12fb0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/SunastianFalconer.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class SunastianFalconer extends CardImpl { + + public SunastianFalconer(UUID ownerId) { + super(ownerId, 301, "Sunastian Falconer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{G}"); + this.expansionSetCode = "LEG"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Shaman"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {tap}: Add {2} to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), new TapSourceCost())); + } + + public SunastianFalconer(final SunastianFalconer card) { + super(card); + } + + @Override + public SunastianFalconer copy() { + return new SunastianFalconer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/TorWauki.java b/Mage.Sets/src/mage/sets/legends/TorWauki.java new file mode 100644 index 00000000000..43ace604e8f --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/TorWauki.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetAttackingOrBlockingCreature; + +/** + * + * @author LoneFox + */ +public class TorWauki extends CardImpl { + + public TorWauki(UUID ownerId) { + super(ownerId, 305, "Tor Wauki", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}{R}"); + this.expansionSetCode = "LEG"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Archer"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {T}: Tor Wauki deals 2 damage to target attacking or blocking creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); + ability.addTarget(new TargetAttackingOrBlockingCreature()); + this.addAbility(ability); + } + + public TorWauki(final TorWauki card) { + super(card); + } + + @Override + public TorWauki copy() { + return new TorWauki(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/Transmutation.java b/Mage.Sets/src/mage/sets/legends/Transmutation.java new file mode 100644 index 00000000000..cd32941e71d --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/Transmutation.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.SwitchPowerToughnessTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Transmutation extends CardImpl { + + public Transmutation(UUID ownerId) { + super(ownerId, 37, "Transmutation", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{B}"); + this.expansionSetCode = "LEG"; + + // Switch target creature's power and toughness until end of turn. + this.getSpellAbility().addEffect(new SwitchPowerToughnessTargetEffect(Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public Transmutation(final Transmutation card) { + super(card); + } + + @Override + public Transmutation copy() { + return new Transmutation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/TriassicEgg.java b/Mage.Sets/src/mage/sets/legends/TriassicEgg.java new file mode 100644 index 00000000000..f7c9714cc40 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/TriassicEgg.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.common.SourceHasCounterCondition; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreatureCard; +import mage.target.Target; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author fireshoes + */ +public class TriassicEgg extends CardImpl { + + public TriassicEgg(UUID ownerId) { + super(ownerId, 242, "Triassic Egg", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "LEG"; + + // {3}, {tap}: Put a hatchling counter on Triassic Egg. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new AddCountersSourceEffect(CounterType.HATCHLING.createInstance(), true), + new GenericManaCost(3)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // Sacrifice Triassic Egg: Choose one - You may put a creature card from your hand onto the battlefield; + ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + new PutPermanentOnBattlefieldEffect(new FilterCreatureCard("a creature card")), + new SacrificeSourceCost(), + new SourceHasCounterCondition(CounterType.HATCHLING, 2, Integer.MAX_VALUE), + "Sacrifice Triassic Egg: Choose one - You may put a creature card from your hand onto the battlefield; or return target creature card from your graveyard to the battlefield. Activate this ability only if two or more hatchling counters are on {this}."); + + // or return target creature card from your graveyard to the battlefield. Activate this ability only if two or more hatchling counters are on Triassic Egg. + Mode mode = new Mode(); + mode.getEffects().add(new ReturnFromGraveyardToBattlefieldTargetEffect()); + Target target = new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")); + mode.getTargets().add(target); + ability.addMode(mode); + + this.addAbility(ability); + } + + public TriassicEgg(final TriassicEgg card) { + super(card); + } + + @Override + public TriassicEgg copy() { + return new TriassicEgg(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/legends/TuknirDeathlock.java b/Mage.Sets/src/mage/sets/legends/TuknirDeathlock.java new file mode 100644 index 00000000000..15e6d2c4c04 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/TuknirDeathlock.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TuknirDeathlock extends mage.sets.masterseditioniii.TuknirDeathlock { + + public TuknirDeathlock(UUID ownerId) { + super(ownerId); + this.cardNumber = 307; + this.expansionSetCode = "LEG"; + this.rarity = Rarity.RARE; + } + + public TuknirDeathlock(final TuknirDeathlock card) { + super(card); + } + + @Override + public TuknirDeathlock copy() { + return new TuknirDeathlock(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/VaevictisAsmadi.java b/Mage.Sets/src/mage/sets/legends/VaevictisAsmadi.java new file mode 100644 index 00000000000..30f957b194c --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/VaevictisAsmadi.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class VaevictisAsmadi extends mage.sets.masterseditioniii.VaevictisAsmadi { + + public VaevictisAsmadi(UUID ownerId) { + super(ownerId); + this.cardNumber = 309; + this.expansionSetCode = "LEG"; + } + + public VaevictisAsmadi(final VaevictisAsmadi card) { + super(card); + } + + @Override + public VaevictisAsmadi copy() { + return new VaevictisAsmadi(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/WallOfLight.java b/Mage.Sets/src/mage/sets/legends/WallOfLight.java new file mode 100644 index 00000000000..e156d702217 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/WallOfLight.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WallOfLight extends mage.sets.masterseditioniii.WallOfLight { + + public WallOfLight(UUID ownerId) { + super(ownerId); + this.cardNumber = 212; + this.expansionSetCode = "LEG"; + this.rarity = Rarity.UNCOMMON; + } + + public WallOfLight(final WallOfLight card) { + super(card); + } + + @Override + public WallOfLight copy() { + return new WallOfLight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/WolverinePack.java b/Mage.Sets/src/mage/sets/legends/WolverinePack.java new file mode 100644 index 00000000000..843ba42bbba --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/WolverinePack.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WolverinePack extends CardImpl { + + public WolverinePack(UUID ownerId) { + super(ownerId, 128, "Wolverine Pack", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Wolverine"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Rampage 2 + this.addAbility(new RampageAbility(2)); + } + + public WolverinePack(final WolverinePack card) { + super(card); + } + + @Override + public WolverinePack copy() { + return new WolverinePack(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/AkromasDevoted.java b/Mage.Sets/src/mage/sets/legions/AkromasDevoted.java new file mode 100644 index 00000000000..daffd0c13ba --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/AkromasDevoted.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class AkromasDevoted extends CardImpl { + + public AkromasDevoted(UUID ownerId) { + super(ownerId, 2, "Akroma's Devoted", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Cleric creatures have vigilance. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(VigilanceAbility.getInstance(), + Duration.WhileOnBattlefield, new FilterCreaturePermanent("Cleric", "Cleric creatures")))); + } + + public AkromasDevoted(final AkromasDevoted card) { + super(card); + } + + @Override + public AkromasDevoted copy() { + return new AkromasDevoted(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/AvenRedeemer.java b/Mage.Sets/src/mage/sets/legions/AvenRedeemer.java new file mode 100644 index 00000000000..e8cfc75f388 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/AvenRedeemer.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class AvenRedeemer extends CardImpl { + + public AvenRedeemer(UUID ownerId) { + super(ownerId, 3, "Aven Redeemer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Bird"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // {tap}: Prevent the next 2 damage that would be dealt to target creature or player this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 2), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public AvenRedeemer(final AvenRedeemer card) { + super(card); + } + + @Override + public AvenRedeemer copy() { + return new AvenRedeemer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/AvenWarhawk.java b/Mage.Sets/src/mage/sets/legions/AvenWarhawk.java new file mode 100644 index 00000000000..84d5ccfb93c --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/AvenWarhawk.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.effects.common.AmplifyEffect; +import mage.abilities.keyword.AmplifyAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class AvenWarhawk extends CardImpl { + + public AvenWarhawk(UUID ownerId) { + super(ownerId, 4, "Aven Warhawk", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Amplify 1 + this.addAbility(new AmplifyAbility(AmplifyEffect.AmplifyFactor.Amplify1)); + // Flying + this.addAbility(FlyingAbility.getInstance()); + } + + public AvenWarhawk(final AvenWarhawk card) { + super(card); + } + + @Override + public AvenWarhawk copy() { + return new AvenWarhawk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/BranchsnapLorian.java b/Mage.Sets/src/mage/sets/legions/BranchsnapLorian.java new file mode 100644 index 00000000000..c3083b95bce --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/BranchsnapLorian.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class BranchsnapLorian extends CardImpl { + + public BranchsnapLorian(UUID ownerId) { + super(ownerId, 118, "Branchsnap Lorian", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Beast"); + this.power = new MageInt(4); + this.toughness = new MageInt(1); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Morph {G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{G}"))); + } + + public BranchsnapLorian(final BranchsnapLorian card) { + super(card); + } + + @Override + public BranchsnapLorian copy() { + return new BranchsnapLorian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/BroodSliver.java b/Mage.Sets/src/mage/sets/legions/BroodSliver.java index 48e856b3b72..86ea9e7ec7b 100644 --- a/Mage.Sets/src/mage/sets/legions/BroodSliver.java +++ b/Mage.Sets/src/mage/sets/legions/BroodSliver.java @@ -37,7 +37,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.SetTargetPointer; import mage.filter.common.FilterCreaturePermanent; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SliverToken; /** * @@ -53,12 +53,11 @@ public class BroodSliver extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(3); - // Whenever a Sliver deals combat damage to a player, its controller may put a 1/1 colorless Sliver creature token onto the battlefield. + // Whenever a Sliver deals combat damage to a player, its controller may put a 1/1 colorless Sliver creature token onto the battlefield. Effect effect = new CreateTokenTargetEffect(new SliverToken()); effect.setText("its controller may put a 1/1 colorless Sliver creature token onto the battlefield"); - this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(effect, - new FilterCreaturePermanent("Sliver", "a Sliver"), - true, SetTargetPointer.PLAYER, true)); + this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(effect, + new FilterCreaturePermanent("Sliver", "a Sliver"), true, SetTargetPointer.PLAYER, true)); } public BroodSliver(final BroodSliver card) { @@ -70,14 +69,3 @@ public class BroodSliver extends CardImpl { return new BroodSliver(this); } } - -class SliverToken extends Token { - - public SliverToken() { - super("Sliver", "1/1 colorless Sliver creature token"); - cardType.add(CardType.CREATURE); - subtype.add("Sliver"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/legions/CloudreachCavalry.java b/Mage.Sets/src/mage/sets/legions/CloudreachCavalry.java new file mode 100644 index 00000000000..67f5da43517 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/CloudreachCavalry.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class CloudreachCavalry extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Bird"); + + static { + filter.add(new SubtypePredicate("Bird")); + } + + public CloudreachCavalry(UUID ownerId) { + super(ownerId, 7, "Cloudreach Cavalry", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // As long as you control a Bird, Cloudreach Cavalry gets +2/+2 and has flying. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), + new PermanentsOnTheBattlefieldCondition(filter), + "As long as you control a Bird, {this} gets +2/+2")); + ability.addEffect(new ConditionalContinuousEffect( + new GainAbilitySourceEffect(FlyingAbility.getInstance()), + new PermanentsOnTheBattlefieldCondition(filter), + "and has flying")); + this.addAbility(ability); + } + + public CloudreachCavalry(final CloudreachCavalry card) { + super(card); + } + + @Override + public CloudreachCavalry copy() { + return new CloudreachCavalry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/CovertOperative.java b/Mage.Sets/src/mage/sets/legions/CovertOperative.java new file mode 100644 index 00000000000..304ed117dc6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/CovertOperative.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.CantBeBlockedSourceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CovertOperative extends CardImpl { + + public CovertOperative(UUID ownerId) { + super(ownerId, 33, "Covert Operative", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Covert Operative can't be blocked. + this.addAbility(new CantBeBlockedSourceAbility()); + } + + public CovertOperative(final CovertOperative card) { + super(card); + } + + @Override + public CovertOperative copy() { + return new CovertOperative(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/CrestedCraghorn.java b/Mage.Sets/src/mage/sets/legions/CrestedCraghorn.java new file mode 100644 index 00000000000..aed2e22cc9d --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/CrestedCraghorn.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.ProvokeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CrestedCraghorn extends CardImpl { + + public CrestedCraghorn(UUID ownerId) { + super(ownerId, 91, "Crested Craghorn", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Goat"); + this.subtype.add("Beast"); + this.power = new MageInt(4); + this.toughness = new MageInt(1); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // Provoke + this.addAbility(new ProvokeAbility()); + } + + public CrestedCraghorn(final CrestedCraghorn card) { + super(card); + } + + @Override + public CrestedCraghorn copy() { + return new CrestedCraghorn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/DaruSanctifier.java b/Mage.Sets/src/mage/sets/legions/DaruSanctifier.java new file mode 100644 index 00000000000..060f45dc675 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/DaruSanctifier.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author LoneFox + */ +public class DaruSanctifier extends CardImpl { + + public DaruSanctifier(UUID ownerId) { + super(ownerId, 9, "Daru Sanctifier", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Morph {1}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{1}{W}"))); + // When Daru Sanctifier is turned face up, destroy target enchantment. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new DestroyTargetEffect()); + ability.addTarget(new TargetEnchantmentPermanent()); + this.addAbility(ability); + } + + public DaruSanctifier(final DaruSanctifier card) { + super(card); + } + + @Override + public DaruSanctifier copy() { + return new DaruSanctifier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/DefenderOfTheOrder.java b/Mage.Sets/src/mage/sets/legions/DefenderOfTheOrder.java new file mode 100644 index 00000000000..9a179436446 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/DefenderOfTheOrder.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class DefenderOfTheOrder extends CardImpl { + + public DefenderOfTheOrder(UUID ownerId) { + super(ownerId, 11, "Defender of the Order", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Morph {W}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{W}{W}"))); + // When Defender of the Order is turned face up, creatures you control get +0/+2 until end of turn. + this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new BoostControlledEffect(0, 2, Duration.EndOfTurn))); + } + + public DefenderOfTheOrder(final DefenderOfTheOrder card) { + super(card); + } + + @Override + public DefenderOfTheOrder copy() { + return new DefenderOfTheOrder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/EmbalmedBrawler.java b/Mage.Sets/src/mage/sets/legions/EmbalmedBrawler.java new file mode 100644 index 00000000000..4038cfe0b18 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/EmbalmedBrawler.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksOrBlocksTriggeredAbility; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.common.AmplifyEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.abilities.keyword.AmplifyAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + */ +public class EmbalmedBrawler extends CardImpl { + + public EmbalmedBrawler(UUID ownerId) { + super(ownerId, 69, "Embalmed Brawler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Amplify 1 + this.addAbility(new AmplifyAbility(AmplifyEffect.AmplifyFactor.Amplify1)); + // Whenever Embalmed Brawler attacks or blocks, you lose 1 life for each +1/+1 counter on it. + this.addAbility(new AttacksOrBlocksTriggeredAbility(new LoseLifeSourceControllerEffect(new CountersCount(CounterType.P1P1)), false)); + } + + public EmbalmedBrawler(final EmbalmedBrawler card) { + super(card); + } + + @Override + public EmbalmedBrawler copy() { + return new EmbalmedBrawler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/GempalmPolluter.java b/Mage.Sets/src/mage/sets/legions/GempalmPolluter.java new file mode 100644 index 00000000000..65f53df4512 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/GempalmPolluter.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.CycleTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class GempalmPolluter extends CardImpl { + + static final private FilterPermanent filter = new FilterPermanent("Zombie"); + + static { + filter.add(new SubtypePredicate("Zombie")); + } + + public GempalmPolluter(UUID ownerId) { + super(ownerId, 70, "Gempalm Polluter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Zombie"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Cycling {B}{B} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{B}{B}"))); + + // When you cycle Gempalm Polluter, you may have target player lose life equal to the number of Zombies on the battlefield. + Effect effect = new LoseLifeTargetEffect(new PermanentsOnBattlefieldCount(filter)); + effect.setText("you may have target player lose life equal to the number of Zombies on the battlefield"); + Ability ability = new CycleTriggeredAbility(effect, true); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public GempalmPolluter(final GempalmPolluter card) { + super(card); + } + + @Override + public GempalmPolluter copy() { + return new GempalmPolluter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/GlintwingInvoker.java b/Mage.Sets/src/mage/sets/legions/GlintwingInvoker.java new file mode 100644 index 00000000000..2c753d85752 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/GlintwingInvoker.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class GlintwingInvoker extends CardImpl { + + public GlintwingInvoker(UUID ownerId) { + super(ownerId, 40, "Glintwing Invoker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.subtype.add("Mutant"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {7}{U}: Glintwing Invoker gets +3/+3 and gains flying until end of turn. + Effect effect = new BoostSourceEffect(3, 3, Duration.EndOfTurn); + effect.setText("{this} gets +3/+3"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{7}{U}")); + effect = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains flying until end of turn"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public GlintwingInvoker(final GlintwingInvoker card) { + super(card); + } + + @Override + public GlintwingInvoker copy() { + return new GlintwingInvoker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/Glowrider.java b/Mage.Sets/src/mage/sets/legions/Glowrider.java new file mode 100644 index 00000000000..15dbdef8c44 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/Glowrider.java @@ -0,0 +1,109 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.keyword.FlashbackAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.CostModificationType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.util.CardUtil; + +/** + * + * @author fireshoes + */ +public class Glowrider extends CardImpl { + + public Glowrider(UUID ownerId) { + super(ownerId, 15, "Glowrider", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Noncreature spells cost {1} more to cast. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GlowriderCostReductionEffect())); + } + + public Glowrider(final Glowrider card) { + super(card); + } + + @Override + public Glowrider copy() { + return new Glowrider(this); + } +} + +class GlowriderCostReductionEffect extends CostModificationEffectImpl { + + GlowriderCostReductionEffect ( ) { + super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); + staticText = "Noncreature spells cost {1} more to cast"; + } + + GlowriderCostReductionEffect(GlowriderCostReductionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + CardUtil.increaseCost(abilityToModify, 1); + return true; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) { + Card card = game.getCard(abilityToModify.getSourceId()); + if (card != null && !card.getCardType().contains(CardType.CREATURE)) { + return true; + } + } + return false; + } + + @Override + public GlowriderCostReductionEffect copy() { + return new GlowriderCostReductionEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/legions/GoblinAssassin.java b/Mage.Sets/src/mage/sets/legions/GoblinAssassin.java new file mode 100644 index 00000000000..308da29ac93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/GoblinAssassin.java @@ -0,0 +1,152 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * @author BursegSardaukar + */ +public class GoblinAssassin extends CardImpl { + + public GoblinAssassin(UUID ownerId) { + super(ownerId, 95, "Goblin Assassin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Goblin"); + this.subtype.add("Assassin"); + + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Goblin Assassin or another Goblin enters the battlefield, each player flips a coin. Each player whose coin comes up tails sacrifices a creature. + this.addAbility(new GoblinAssassinTriggeredAbiliy()); + } + + public GoblinAssassin(final GoblinAssassin card) { + super(card); + } + + @Override + public GoblinAssassin copy() { + return new GoblinAssassin(this); + } +} + +class GoblinAssassinTriggeredAbiliy extends TriggeredAbilityImpl { + GoblinAssassinTriggeredAbiliy() { + super(Zone.BATTLEFIELD, new GoblinAssassinTriggeredEffect(), false); + } + + GoblinAssassinTriggeredAbiliy(final GoblinAssassinTriggeredAbiliy ability) { + super(ability); + } + + @Override + public GoblinAssassinTriggeredAbiliy copy() { + return new GoblinAssassinTriggeredAbiliy(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + UUID targetId = event.getTargetId(); + Permanent permanent = game.getPermanent(targetId); + if ((targetId.equals(this.getSourceId())) || (permanent.hasSubtype("Goblin") && !targetId.equals(this.getSourceId()))) { + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} or another Goblin enters battlefield, each player flips a coin. Each player whose coin comes up tails sacrifices a creature."; + } +} + +class GoblinAssassinTriggeredEffect extends OneShotEffect { + GoblinAssassinTriggeredEffect() { + super(Outcome.Sacrifice); + } + + GoblinAssassinTriggeredEffect(final GoblinAssassinTriggeredEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + List perms = new ArrayList<>(); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : controller.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && !player.flipCoin(game)) { + TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(); + target.setNotTarget(true); + if (target.canChoose(player.getId(), game)) { + player.chooseTarget(Outcome.Sacrifice, target, source, game); + perms.addAll(target.getTargets()); + } + } + } + for (UUID permID : perms) { + Permanent permanent = game.getPermanent(permID); + if (permanent != null) { + permanent.sacrifice(source.getSourceId(), game); + } + } + return true; + } + return false; + } + + @Override + public GoblinAssassinTriggeredEffect copy() { + return new GoblinAssassinTriggeredEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/legions/GoblinClearcutter.java b/Mage.Sets/src/mage/sets/legions/GoblinClearcutter.java new file mode 100644 index 00000000000..bce8de73085 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/GoblinClearcutter.java @@ -0,0 +1,140 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetControlledPermanent; + +/** + * @author BursegSardaukar + */ +public class GoblinClearcutter extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Forest"); + + static { + filter.add(new SubtypePredicate("Forest")); + } + + public GoblinClearcutter(UUID ownerId) { + super(ownerId, 96, "Goblin Clearcutter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Goblin"); + + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {T}, Sacrifice a Forest: Add three mana in any combination of {R} and/or {G} to your mana pool. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GoblinClearCutterEffect(), new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + this.addAbility(ability); + } + + public GoblinClearcutter(final GoblinClearcutter card) { + super(card); + } + + @Override + public GoblinClearcutter copy() { + return new GoblinClearcutter(this); + } +} + + +class GoblinClearCutterEffect extends OneShotEffect { + + public GoblinClearCutterEffect() { + super(Outcome.PutManaInPool); + this.staticText = "Add 3 mana in any combination of {R} and/or {G} to your mana pool"; + } + + public GoblinClearCutterEffect(final GoblinClearCutterEffect effect) { + super(effect); + } + + @Override + public GoblinClearCutterEffect copy() { + return new GoblinClearCutterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null){ + Choice manaChoice = new ChoiceImpl(); + Set choices = new LinkedHashSet<>(); + choices.add("Red"); + choices.add("Green"); + manaChoice.setChoices(choices); + manaChoice.setMessage("Select color of mana to add"); + + for (int i = 0; i < 3; i++){ + Mana mana = new Mana(); + while (!player.choose(Outcome.Benefit, manaChoice, game)) { + if (!player.canRespond()) { + return false; + } + } + if (manaChoice.getChoice() == null) { // can happen if player leaves game + return false; + } + switch (manaChoice.getChoice()) { + case "Green": + mana.increaseGreen(); + break; + case "Red": + mana.increaseRed(); + break; + } + player.getManaPool().addMana(mana, game, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/legions/GoblinDynamo.java b/Mage.Sets/src/mage/sets/legions/GoblinDynamo.java new file mode 100644 index 00000000000..53ad2996a72 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/GoblinDynamo.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * @author BursegSardaukar + */ +public class GoblinDynamo extends CardImpl { + + public GoblinDynamo(UUID ownerId) { + super(ownerId, 97, "Goblin Dynamo", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{R}{R}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Goblin"); + this.subtype.add("Mutant"); + + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {T}: Goblin Dynamo deals 1 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + + //{X}{R}, {T}, Sacrifice Goblin Dynamo: Goblin Dynamo deals X damage to target creature or player. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public GoblinDynamo(final GoblinDynamo card) { + super(card); + } + + @Override + public GoblinDynamo copy() { + return new GoblinDynamo(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/legions/GoblinFirebug.java b/Mage.Sets/src/mage/sets/legions/GoblinFirebug.java index 907f6577eb9..67a12a03a7c 100644 --- a/Mage.Sets/src/mage/sets/legions/GoblinFirebug.java +++ b/Mage.Sets/src/mage/sets/legions/GoblinFirebug.java @@ -29,15 +29,12 @@ package mage.sets.legions; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.LeavesBattlefieldTriggeredAbility; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.filter.common.FilterControlledLandPermanent; -import mage.target.common.TargetControlledPermanent; +import mage.filter.common.FilterLandPermanent; /** * @@ -53,11 +50,7 @@ public class GoblinFirebug extends CardImpl { this.toughness = new MageInt(2); // When Goblin Firebug leaves the battlefield, sacrifice a land. - Effect effect = new SacrificeTargetEffect(); - effect.setText("sacrifice a land"); - Ability ability = new LeavesBattlefieldTriggeredAbility(effect, false); - ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent())); - this.addAbility(ability); + this.addAbility(new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false)); } public GoblinFirebug(final GoblinFirebug card) { diff --git a/Mage.Sets/src/mage/sets/legions/GoblinGoon.java b/Mage.Sets/src/mage/sets/legions/GoblinGoon.java new file mode 100644 index 00000000000..452fd426dbd --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/GoblinGoon.java @@ -0,0 +1,151 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author emerald000 + */ +public class GoblinGoon extends CardImpl { + + public GoblinGoon(UUID ownerId) { + super(ownerId, 99, "Goblin Goon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Goblin"); + this.subtype.add("Mutant"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Goblin Goon can't attack unless you control more creatures than defending player. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GoblinGoonCantAttackEffect())); + + // Goblin Goon can't block unless you control more creatures than attacking player. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GoblinGoonCantBlockEffect())); + } + + public GoblinGoon(final GoblinGoon card) { + super(card); + } + + @Override + public GoblinGoon copy() { + return new GoblinGoon(this); + } +} + +class GoblinGoonCantAttackEffect extends RestrictionEffect { + + GoblinGoonCantAttackEffect() { + super(Duration.WhileOnBattlefield); + staticText = "{this} can't attack unless you control more creatures than defending player"; + } + + GoblinGoonCantAttackEffect(final GoblinGoonCantAttackEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.getId().equals(source.getSourceId()); + } + + @Override + public boolean canAttack(UUID defenderId, Ability source, Game game) { + UUID defendingPlayerId; + Player defender = game.getPlayer(defenderId); + if (defender == null) { + Permanent permanent = game.getPermanent(defenderId); + if (permanent != null) { + defendingPlayerId = permanent.getControllerId(); + } + else { + return false; + } + } + else { + defendingPlayerId = defenderId; + } + if (defendingPlayerId != null) { + return game.getBattlefield().countAll(new FilterControlledCreaturePermanent(), source.getControllerId(), game) > game.getBattlefield().countAll(new FilterControlledCreaturePermanent(), defendingPlayerId, game); + } + else { + return true; + } + } + + @Override + public GoblinGoonCantAttackEffect copy() { + return new GoblinGoonCantAttackEffect(this); + } +} + +class GoblinGoonCantBlockEffect extends RestrictionEffect { + + GoblinGoonCantBlockEffect() { + super(Duration.WhileOnBattlefield); + staticText = "{this} can't block unless you control more creatures than attacking player"; + } + + GoblinGoonCantBlockEffect(final GoblinGoonCantBlockEffect effect) { + super(effect); + } + + @Override + public GoblinGoonCantBlockEffect copy() { + return new GoblinGoonCantBlockEffect(this); + } + + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + UUID attackingPlayerId = attacker.getControllerId(); + if (attackingPlayerId != null) { + return game.getBattlefield().countAll(new FilterControlledCreaturePermanent(), source.getControllerId(), game) > game.getBattlefield().countAll(new FilterControlledCreaturePermanent(), attackingPlayerId, game); + } + return true; + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.getId().equals(source.getSourceId()); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/GoblinGrappler.java b/Mage.Sets/src/mage/sets/legions/GoblinGrappler.java new file mode 100644 index 00000000000..445dffe7832 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/GoblinGrappler.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.ProvokeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class GoblinGrappler extends CardImpl { + + public GoblinGrappler(UUID ownerId) { + super(ownerId, 100, "Goblin Grappler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Goblin"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Provoke + this.addAbility(new ProvokeAbility()); + } + + public GoblinGrappler(final GoblinGrappler card) { + super(card); + } + + @Override + public GoblinGrappler copy() { + return new GoblinGrappler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/HavocDemon.java b/Mage.Sets/src/mage/sets/legions/HavocDemon.java new file mode 100644 index 00000000000..71f5ecd394c --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/HavocDemon.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class HavocDemon extends CardImpl { + + public HavocDemon(UUID ownerId) { + super(ownerId, 74, "Havoc Demon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Demon"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Havoc Demon dies, all creatures get -5/-5 until end of turn. + this.addAbility(new DiesTriggeredAbility(new BoostAllEffect(-5, -5, Duration.EndOfTurn), false)); + } + + public HavocDemon(final HavocDemon card) { + super(card); + } + + @Override + public HavocDemon copy() { + return new HavocDemon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/KeeperOfTheNineGales.java b/Mage.Sets/src/mage/sets/legions/KeeperOfTheNineGales.java new file mode 100644 index 00000000000..220ed6699a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/KeeperOfTheNineGales.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class KeeperOfTheNineGales extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Birds you control"); + + static { + filter.add(Predicates.not(new TappedPredicate())); + filter.add(new SubtypePredicate("Bird")); + } + + public KeeperOfTheNineGales(UUID ownerId) { + super(ownerId, 42, "Keeper of the Nine Gales", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Bird"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {tap}, Tap two untapped Birds you control: Return target permanent to its owner's hand. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new TapSourceCost()); + ability.addCost(new TapTargetCost(new TargetControlledPermanent(2, 2, filter, false))); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public KeeperOfTheNineGales(final KeeperOfTheNineGales card) { + super(card); + } + + @Override + public KeeperOfTheNineGales copy() { + return new KeeperOfTheNineGales(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/LiegeOfTheAxe.java b/Mage.Sets/src/mage/sets/legions/LiegeOfTheAxe.java new file mode 100644 index 00000000000..908ac75e6ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/LiegeOfTheAxe.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.abilities.keyword.MorphAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LiegeOfTheAxe extends CardImpl { + + public LiegeOfTheAxe(UUID ownerId) { + super(ownerId, 16, "Liege of the Axe", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // Morph {1}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{1}{W}"))); + // When Liege of the Axe is turned face up, untap it. + this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new UntapSourceEffect())); + } + + public LiegeOfTheAxe(final LiegeOfTheAxe card) { + super(card); + } + + @Override + public LiegeOfTheAxe copy() { + return new LiegeOfTheAxe(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/PatronOfTheWild.java b/Mage.Sets/src/mage/sets/legions/PatronOfTheWild.java new file mode 100644 index 00000000000..5d0f7300698 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/PatronOfTheWild.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class PatronOfTheWild extends CardImpl { + + public PatronOfTheWild(UUID ownerId) { + super(ownerId, 134, "Patron of the Wild", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Elf"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Morph {2}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{G}"))); + // When Patron of the Wild is turned face up, target creature gets +3/+3 until end of turn. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new BoostTargetEffect(3, 3, Duration.EndOfTurn)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public PatronOfTheWild(final PatronOfTheWild card) { + super(card); + } + + @Override + public PatronOfTheWild copy() { + return new PatronOfTheWild(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/PrimalWhisperer.java b/Mage.Sets/src/mage/sets/legions/PrimalWhisperer.java new file mode 100644 index 00000000000..bd748955f12 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/PrimalWhisperer.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.other.FaceDownPredicate; + +/** + * + * @author LoneFox + */ +public class PrimalWhisperer extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("face-down creature"); + + static { + filter.add(new FaceDownPredicate()); + } + + public PrimalWhisperer(UUID ownerId) { + super(ownerId, 135, "Primal Whisperer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Elf"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Primal Whisperer gets +2/+2 for each face-down creature on the battlefield. + PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(filter, 2); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield))); + // Morph {3}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{3}{G}"))); + } + + public PrimalWhisperer(final PrimalWhisperer card) { + super(card); + } + + @Override + public PrimalWhisperer copy() { + return new PrimalWhisperer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/RockshardElemental.java b/Mage.Sets/src/mage/sets/legions/RockshardElemental.java new file mode 100644 index 00000000000..18c71730a23 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/RockshardElemental.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class RockshardElemental extends CardImpl { + + public RockshardElemental(UUID ownerId) { + super(ownerId, 109, "Rockshard Elemental", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}{R}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Elemental"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Double strike + this.addAbility(DoubleStrikeAbility.getInstance()); + // Morph {4}{R}{R} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{4}{R}{R}"))); + } + + public RockshardElemental(final RockshardElemental card) { + super(card); + } + + @Override + public RockshardElemental copy() { + return new RockshardElemental(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/ShiftingSliver.java b/Mage.Sets/src/mage/sets/legions/ShiftingSliver.java index 656caafaa53..98d27b84b80 100644 --- a/Mage.Sets/src/mage/sets/legions/ShiftingSliver.java +++ b/Mage.Sets/src/mage/sets/legions/ShiftingSliver.java @@ -29,10 +29,8 @@ package mage.sets.legions; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesAllEffect; -import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -47,12 +45,12 @@ import mage.filter.predicate.mageobject.SubtypePredicate; * @author cbt33 */ public class ShiftingSliver extends CardImpl { - + private static final FilterCreaturePermanent filterCreatures = new FilterCreaturePermanent("Slivers"); private static final FilterCreaturePermanent filterBlockedBy = new FilterCreaturePermanent("except by Slivers"); - + static { - filterCreatures.add(Predicates.not(new SubtypePredicate("Sliver"))); + filterCreatures.add(new SubtypePredicate("Sliver")); filterBlockedBy.add(Predicates.not(new SubtypePredicate("Sliver"))); } diff --git a/Mage.Sets/src/mage/sets/legions/Skinthinner.java b/Mage.Sets/src/mage/sets/legions/Skinthinner.java new file mode 100644 index 00000000000..5ce6863d4cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/Skinthinner.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Skinthinner extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public Skinthinner(UUID ownerId) { + super(ownerId, 80, "Skinthinner", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Morph {3}{B}{B} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{3}{B}{B}"))); + // When Skinthinner is turned face up, destroy target nonblack creature. It can't be regenerated. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new DestroyTargetEffect(true)); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public Skinthinner(final Skinthinner card) { + super(card); + } + + @Override + public Skinthinner copy() { + return new Skinthinner(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/SmokespewInvoker.java b/Mage.Sets/src/mage/sets/legions/SmokespewInvoker.java new file mode 100644 index 00000000000..e7e9bef6f1a --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/SmokespewInvoker.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SmokespewInvoker extends CardImpl { + + public SmokespewInvoker(UUID ownerId) { + super(ownerId, 81, "Smokespew Invoker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Zombie"); + this.subtype.add("Mutant"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // {7}{B}: Target creature gets -3/-3 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-3, -3, Duration.EndOfTurn), + new ManaCostsImpl("{7}{B}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public SmokespewInvoker(final SmokespewInvoker card) { + super(card); + } + + @Override + public SmokespewInvoker copy() { + return new SmokespewInvoker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/SootfeatherFlock.java b/Mage.Sets/src/mage/sets/legions/SootfeatherFlock.java new file mode 100644 index 00000000000..04fb010baab --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/SootfeatherFlock.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SootfeatherFlock extends CardImpl { + + public SootfeatherFlock(UUID ownerId) { + super(ownerId, 82, "Sootfeather Flock", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Bird"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Morph {3}{B} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{3}{B}"))); + } + + public SootfeatherFlock(final SootfeatherFlock card) { + super(card); + } + + @Override + public SootfeatherFlock copy() { + return new SootfeatherFlock(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/SunstrikeLegionnaire.java b/Mage.Sets/src/mage/sets/legions/SunstrikeLegionnaire.java new file mode 100644 index 00000000000..5b2637ee78a --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/SunstrikeLegionnaire.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SunstrikeLegionnaire extends CardImpl { + + private static final FilterCreaturePermanent untapFilter = new FilterCreaturePermanent("another creature"); + private static final FilterCreaturePermanent tapFilter = new FilterCreaturePermanent("creature with converted mana cost 3 or less"); + + static { + untapFilter.add(new AnotherPredicate()); + tapFilter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 4)); + } + + public SunstrikeLegionnaire(UUID ownerId) { + super(ownerId, 22, "Sunstrike Legionnaire", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Sunstrike Legionnaire doesn't untap during your untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepSourceEffect())); + // Whenever another creature enters the battlefield, untap Sunstrike Legionnaire. + this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), untapFilter, false, null)); + // {tap}: Tap target creature with converted mana cost 3 or less. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(tapFilter)); + this.addAbility(ability); + } + + public SunstrikeLegionnaire(final SunstrikeLegionnaire card) { + super(card); + } + + @Override + public SunstrikeLegionnaire copy() { + return new SunstrikeLegionnaire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/UnstableHulk.java b/Mage.Sets/src/mage/sets/legions/UnstableHulk.java new file mode 100644 index 00000000000..233196a128e --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/UnstableHulk.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; + +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.turn.SkipNextTurnSourceEffect; +import mage.abilities.keyword.MorphAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.Duration; + +/** + * + * @author BursegSardaukar + */ +public class UnstableHulk extends CardImpl { + + public UnstableHulk(UUID ownerId) { + super(ownerId, 115, "Unstable Hulk", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Goblin"); + this.subtype.add("Mutant"); + + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Morph {3}{R}{R} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{R}{R}"))); + + //When Unstable Hulk is turned face up, it gets +6/+6 and gains trample until end of turn. You skip your next turn. + Effect effect = new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); + Ability ability = new TurnedFaceUpSourceTriggeredAbility(effect); + effect = new BoostSourceEffect(6,6,Duration.EndOfTurn); + ability.addEffect(effect); + effect = new SkipNextTurnSourceEffect(); + ability.addEffect(effect); + this.addAbility(ability); + + } + + public UnstableHulk(final UnstableHulk card) { + super(card); + } + + @Override + public UnstableHulk copy() { + return new UnstableHulk(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/legions/VileDeacon.java b/Mage.Sets/src/mage/sets/legions/VileDeacon.java new file mode 100644 index 00000000000..ee55e4a80f4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/VileDeacon.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class VileDeacon extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Clerics"); + + static { + filter.add(new SubtypePredicate("Cleric")); + } + + public VileDeacon(UUID ownerId) { + super(ownerId, 85, "Vile Deacon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Vile Deacon attacks, it gets +X/+X until end of turn, where X is the number of Clerics on the battlefield. + PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(filter); + Effect effect = new BoostSourceEffect(amount, amount, Duration.EndOfTurn); + effect.setText("it gets +X/+X until end of turn, where X is the number of Clerics on the battlefield"); + this.addAbility(new AttacksTriggeredAbility(effect, false)); + } + + public VileDeacon(final VileDeacon card) { + super(card); + } + + @Override + public VileDeacon copy() { + return new VileDeacon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/WingbeatWarrior.java b/Mage.Sets/src/mage/sets/legions/WingbeatWarrior.java new file mode 100644 index 00000000000..69cf7136757 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/WingbeatWarrior.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class WingbeatWarrior extends CardImpl { + + public WingbeatWarrior(UUID ownerId) { + super(ownerId, 29, "Wingbeat Warrior", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Morph {2}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{W}"))); + // When Wingbeat Warrior is turned face up, target creature gains first strike until end of turn. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public WingbeatWarrior(final WingbeatWarrior card) { + super(card); + } + + @Override + public WingbeatWarrior copy() { + return new WingbeatWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/ZombieBrute.java b/Mage.Sets/src/mage/sets/legions/ZombieBrute.java new file mode 100644 index 00000000000..c550b504244 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/ZombieBrute.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.effects.common.AmplifyEffect; +import mage.abilities.keyword.AmplifyAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZombieBrute extends CardImpl { + + public ZombieBrute(UUID ownerId) { + super(ownerId, 87, "Zombie Brute", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{6}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Zombie"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Amplify 1 + this.addAbility(new AmplifyAbility(AmplifyEffect.AmplifyFactor.Amplify1)); + // Trample + this.addAbility(TrampleAbility.getInstance()); + } + + public ZombieBrute(final ZombieBrute card) { + super(card); + } + + @Override + public ZombieBrute copy() { + return new ZombieBrute(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/AnimateDead.java b/Mage.Sets/src/mage/sets/limitedalpha/AnimateDead.java index 3ab1fcca736..2852b95626f 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/AnimateDead.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/AnimateDead.java @@ -70,15 +70,14 @@ public class AnimateDead extends CardImpl { this.expansionSetCode = "LEA"; this.subtype.add("Aura"); - // Enchant creature card in a graveyard TargetCardInGraveyard auraTarget = new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard")); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AnimateDeadAttachEffect(Outcome.PutCreatureInPlay)); Ability enchantAbility = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(enchantAbility); - // When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" - // and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield + this.addAbility(enchantAbility); + // When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" + // and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield // under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new AnimateDeadReAttachEffect(), false), @@ -86,11 +85,11 @@ public class AnimateDead extends CardImpl { "When {this} enters the battlefield, if it's on the battlefield, it loses \"enchant creature card in a graveyard\" and gains \"enchant creature put onto the battlefield with {this}.\" Return enchanted creature card to the battlefield under your control and attach {this} to it."); ability.addEffect(new AnimateDeadChangeAbilityEffect()); this.addAbility(ability); - this.addAbility(new LeavesBattlefieldTriggeredAbility(new AnimateDeadLeavesBattlefieldTriggeredEffect(), false)); - + this.addAbility(new LeavesBattlefieldTriggeredAbility(new AnimateDeadLeavesBattlefieldTriggeredEffect(), false)); + // Enchanted creature gets -1/-0. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(-1, 0, Duration.WhileOnBattlefield))); - + } public AnimateDead(final AnimateDead card) { @@ -104,36 +103,36 @@ public class AnimateDead extends CardImpl { } class AnimateDeadReAttachEffect extends OneShotEffect { - + public AnimateDeadReAttachEffect() { super(Outcome.Benefit); this.staticText = "Return enchanted creature card to the battlefield under your control and attach {this} to it"; } - + public AnimateDeadReAttachEffect(final AnimateDeadReAttachEffect effect) { super(effect); } - + @Override public AnimateDeadReAttachEffect copy() { return new AnimateDeadReAttachEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent enchantment = game.getPermanent(source.getSourceId()); - + if (controller != null && enchantment != null) { Card cardInGraveyard = game.getCard(enchantment.getAttachedTo()); if (cardInGraveyard == null) { return true; } - + // put card into play - controller.putOntoBattlefieldWithInfo(cardInGraveyard, game, Zone.GRAVEYARD, source.getSourceId()); + controller.moveCards(cardInGraveyard, Zone.BATTLEFIELD, source, game); Permanent enchantedCreature = game.getPermanent(cardInGraveyard.getId()); - + FilterCreaturePermanent filter = new FilterCreaturePermanent("enchant creature put onto the battlefield with Animate Dead"); filter.add(new PermanentIdPredicate(cardInGraveyard.getId())); Target target = new TargetCreaturePermanent(filter); @@ -146,27 +145,27 @@ class AnimateDeadReAttachEffect extends OneShotEffect { } return true; } - + return false; } } - + class AnimateDeadLeavesBattlefieldTriggeredEffect extends OneShotEffect { - + public AnimateDeadLeavesBattlefieldTriggeredEffect() { super(Outcome.Benefit); this.staticText = "enchanted creature's controller sacrifices it"; } - + public AnimateDeadLeavesBattlefieldTriggeredEffect(final AnimateDeadLeavesBattlefieldTriggeredEffect effect) { super(effect); } - + @Override public AnimateDeadLeavesBattlefieldTriggeredEffect copy() { return new AnimateDeadLeavesBattlefieldTriggeredEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); @@ -223,17 +222,16 @@ class AnimateDeadAttachEffect extends OneShotEffect { class AnimateDeadChangeAbilityEffect extends ContinuousEffectImpl implements SourceEffect { private final static Ability newAbility = new EnchantAbility("creature put onto the battlefield with Animate Dead"); - + static { newAbility.setRuleAtTheTop(true); } - + public AnimateDeadChangeAbilityEffect() { super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); staticText = "it loses \"enchant creature card in a graveyard\" and gains \"enchant creature put onto the battlefield with Animate Dead\""; } - public AnimateDeadChangeAbilityEffect(final AnimateDeadChangeAbilityEffect effect) { super(effect); } @@ -242,7 +240,7 @@ class AnimateDeadChangeAbilityEffect extends ContinuousEffectImpl implements Sou public AnimateDeadChangeAbilityEffect copy() { return new AnimateDeadChangeAbilityEffect(this); } - + @Override public void init(Ability source, Game game) { super.init(source, game); @@ -254,7 +252,7 @@ class AnimateDeadChangeAbilityEffect extends ContinuousEffectImpl implements Sou Permanent permanent = affectedObjectList.get(0).getPermanent(game); if (permanent != null) { Ability abilityToRemove = null; - for (Ability ability: permanent.getAbilities()) { + for (Ability ability : permanent.getAbilities()) { if (ability instanceof EnchantAbility) { abilityToRemove = ability; } @@ -264,7 +262,7 @@ class AnimateDeadChangeAbilityEffect extends ContinuousEffectImpl implements Sou } permanent.addAbility(newAbility, source.getSourceId(), game); return true; - } + } return false; } } diff --git a/Mage.Sets/src/mage/sets/limitedalpha/AnimateWall.java b/Mage.Sets/src/mage/sets/limitedalpha/AnimateWall.java index 6e15de5467d..61e59beef98 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/AnimateWall.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/AnimateWall.java @@ -32,7 +32,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; @@ -73,7 +73,7 @@ public class AnimateWall extends CardImpl { this.addAbility(ability); // Enchanted Wall can attack as though it didn't have defender. - Ability canAttackAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield)); + Ability canAttackAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield)); Effect enchantEffect = new GainAbilityAttachedEffect(canAttackAbility, AttachmentType.AURA, Duration.WhileOnBattlefield); enchantEffect.setText("Enchanted Wall can attack as though it didn't have defender"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, enchantEffect)); diff --git a/Mage.Sets/src/mage/sets/limitedalpha/BlackVise.java b/Mage.Sets/src/mage/sets/limitedalpha/BlackVise.java index 057ebaa541b..82e9d7e9b09 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/BlackVise.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/BlackVise.java @@ -32,6 +32,7 @@ import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseOpponentEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -40,9 +41,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.players.Player; -import mage.target.common.TargetOpponent; /** * @@ -55,7 +54,7 @@ public class BlackVise extends CardImpl { this.expansionSetCode = "LEA"; // As Black Vise enters the battlefield, choose an opponent. - this.addAbility(new AsEntersBattlefieldAbility(new BlackViseChooseOpponent())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseOpponentEffect(Outcome.Detriment))); // At the beginning of the chosen player's upkeep, Black Vise deals X damage to that player, where X is the number of cards in his or her hand minus 4. this.addAbility(new BlackViseTriggeredAbility()); } @@ -70,42 +69,6 @@ public class BlackVise extends CardImpl { } } -class BlackViseChooseOpponent extends OneShotEffect { - - public BlackViseChooseOpponent() { - super(Outcome.Neutral); - this.staticText = "choose an opponent"; - } - - public BlackViseChooseOpponent(final BlackViseChooseOpponent effect) { - super(effect); - } - - @Override - public BlackViseChooseOpponent copy() { - return new BlackViseChooseOpponent(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - TargetOpponent target = new TargetOpponent(); - target.setNotTarget(true); - if (player.choose(this.outcome, target, source.getSourceId(), game)) { - Player chosenPlayer = game.getPlayer(target.getFirstTarget()); - if (chosenPlayer != null) { - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + chosenPlayer.getLogName()); - game.getState().setValue(permanent.getId() + "_player", target.getFirstTarget()); - return true; - } - } - } - return false; - } -} - class BlackViseTriggeredAbility extends TriggeredAbilityImpl { public BlackViseTriggeredAbility() { @@ -128,19 +91,19 @@ class BlackViseTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getPlayerId().equals(game.getState().getValue(getSourceId().toString() + "_player")); + return event.getPlayerId().equals(game.getState().getValue(getSourceId().toString() + ChooseOpponentEffect.VALUE_KEY)); } @Override public String getRule() { - return new StringBuilder("At the beginning of the chosen player's upkeep, ").append(super.getRule()).toString(); + return "At the beginning of the chosen player's upkeep, " + super.getRule(); } } class BlackViseEffect extends OneShotEffect { public BlackViseEffect() { - super(Outcome.Benefit); + super(Outcome.Detriment); this.staticText = "{this} deals X damage to that player, where X is the number of cards in his or her hand minus 4"; } @@ -155,7 +118,7 @@ class BlackViseEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - UUID playerId = (UUID) game.getState().getValue(source.getSourceId().toString() + "_player"); + UUID playerId = (UUID) game.getState().getValue(source.getSourceId().toString() + ChooseOpponentEffect.VALUE_KEY); Player chosenPlayer = game.getPlayer(playerId); if (chosenPlayer != null) { int damage = chosenPlayer.getHand().size() - 4; diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Chaoslace.java b/Mage.Sets/src/mage/sets/limitedalpha/Chaoslace.java new file mode 100644 index 00000000000..0c9258bab69 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Chaoslace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Chaoslace extends mage.sets.fourthedition.Chaoslace { + + public Chaoslace(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + this.expansionSetCode = "LEA"; + } + + public Chaoslace(final Chaoslace card) { + super(card); + } + + @Override + public Chaoslace copy() { + return new Chaoslace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Cockatrice.java b/Mage.Sets/src/mage/sets/limitedalpha/Cockatrice.java index eb9712905e9..e6896635fad 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/Cockatrice.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/Cockatrice.java @@ -29,22 +29,18 @@ package mage.sets.limitedalpha; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.target.targetpointer.FixedTarget; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,6 +48,12 @@ import mage.target.targetpointer.FixedTarget; */ public class Cockatrice extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall creature"); + + static { + filter.add(Predicates.not(new SubtypePredicate("Wall"))); + } + public Cockatrice(UUID ownerId) { super(ownerId, 98, "Cockatrice", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); this.expansionSetCode = "LEA"; @@ -60,10 +62,13 @@ public class Cockatrice extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(4); - // Flying - this.addAbility(FlyingAbility.getInstance()); + // Flying + this.addAbility(FlyingAbility.getInstance()); // Whenever Cockatrice blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat. - this.addAbility(new CockatriceTriggeredAbility()); + Effect effect = new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); + effect.setText("destroy that creature at end of combat"); + this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false)); } public Cockatrice(final Cockatrice card) { @@ -75,80 +80,3 @@ public class Cockatrice extends CardImpl { return new Cockatrice(this); } } - -class CockatriceTriggeredAbility extends TriggeredAbilityImpl { - - CockatriceTriggeredAbility() { - super(Zone.BATTLEFIELD, new CockatriceEffect()); - } - - CockatriceTriggeredAbility(final CockatriceTriggeredAbility ability) { - super(ability); - } - - @Override - public CockatriceTriggeredAbility copy() { - return new CockatriceTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.BLOCKER_DECLARED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent blocker = game.getPermanent(event.getSourceId()); - Permanent blocked = game.getPermanent(event.getTargetId()); - Permanent cockatrice = game.getPermanent(sourceId); - if (blocker != null && blocker != cockatrice - && !blocker.getSubtype().contains("Wall") - && blocked == cockatrice) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId())); - return true; - } - if (blocker != null && blocker == cockatrice - && !blocked.getSubtype().contains("Wall")) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId())); - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever {this} blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat."; - } -} - -class CockatriceEffect extends OneShotEffect { - - CockatriceEffect() { - super(Outcome.DestroyPermanent); - staticText = "destroy that creature at end of combat"; - } - - CockatriceEffect(final CockatriceEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - if (targetCreature != null) { - AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId())); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - return false; - } - - @Override - public CockatriceEffect copy() { - return new CockatriceEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Conversion.java b/Mage.Sets/src/mage/sets/limitedalpha/Conversion.java new file mode 100644 index 00000000000..30cd11eedd8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Conversion.java @@ -0,0 +1,148 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.DependencyType; +import mage.constants.Duration; +import mage.constants.Layer; +import static mage.constants.Layer.AbilityAddingRemovingEffects_6; +import static mage.constants.Layer.TypeChangingEffects_4; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class Conversion extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain", "Mountains"); + + public Conversion(UUID ownerId) { + super(ownerId, 199, "Conversion", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); + this.expansionSetCode = "LEA"; + + // At the beginning of your upkeep, sacrifice Conversion unless you pay {W}{W}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{W}{W}")), TargetController.YOU, false)); + + // All Mountains are Plains. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConversionEffect())); + + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } + + class ConversionEffect extends ContinuousEffectImpl { + + ConversionEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + this.staticText = "All Mountains are Plains"; + } + + ConversionEffect(final ConversionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public ConversionEffect copy() { + return new ConversionEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + for (Permanent land : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + land.removeAllAbilities(source.getSourceId(), game); + land.addAbility(new WhiteManaAbility(), source.getSourceId(), game); + break; + case TypeChangingEffects_4: + land.getSubtype().clear(); + land.getSubtype().add("Plains"); + break; + } + } + return true; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; + } + + @Override + public Set isDependentTo(List allEffectsInLayer) { + // the dependent classes needs to be an enclosed class for dependent check of continuous effects + Set dependentTo = null; + for (ContinuousEffect effect : allEffectsInLayer) { + // http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/286046-conversion-magus-of-the-moon + if (effect.getDependencyTypes().contains(DependencyType.BecomeMountain)) { + if (dependentTo == null) { + dependentTo = new HashSet<>(); + } + dependentTo.add(effect.getId()); + } + } + return dependentTo; + } + + } + +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/CopyArtifact.java b/Mage.Sets/src/mage/sets/limitedalpha/CopyArtifact.java index 2018a4e7f69..d783513396a 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/CopyArtifact.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/CopyArtifact.java @@ -28,29 +28,19 @@ package mage.sets.limitedalpha; import java.util.UUID; - -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.FilterPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.Target; -import mage.target.TargetPermanent; -import mage.util.functions.ApplyToPermanent; +import mage.filter.common.FilterArtifactPermanent; +import mage.util.functions.CardTypeApplier; /** * * @author KholdFuzion - + * */ public class CopyArtifact extends CardImpl { @@ -58,13 +48,10 @@ public class CopyArtifact extends CardImpl { super(ownerId, 54, "Copy Artifact", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); this.expansionSetCode = "LEA"; - // You may have Copy Artifact enter the battlefield as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types. - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( - new CopyArtifactEffect(), - "You may have {this} enter the battlefield as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types", - true)); - this.addAbility(ability); + Effect effect = new CopyPermanentEffect(new FilterArtifactPermanent(), new CardTypeApplier(CardType.ENCHANTMENT)); + effect.setText("as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types"); + this.addAbility(new EntersBattlefieldAbility(effect, true)); } public CopyArtifact(final CopyArtifact card) { @@ -76,54 +63,3 @@ public class CopyArtifact extends CardImpl { return new CopyArtifact(this); } } - -class CopyArtifactEffect extends OneShotEffect { - - private static final FilterPermanent filter = new FilterPermanent("artifact"); - - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - - public CopyArtifactEffect() { - super(Outcome.Copy); - } - - public CopyArtifactEffect(final CopyArtifactEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (player != null && sourcePermanent != null) { - Target target = new TargetPermanent(filter); - target.setNotTarget(true); - if (target.canChoose(source.getControllerId(), game)) { - player.choose(Outcome.Copy, target, source.getSourceId(), game); - Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget()); - if (copyFromPermanent != null) { - game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() { - @Override - public Boolean apply(Game game, Permanent permanent) { - if (!permanent.getCardType().contains(CardType.ENCHANTMENT)) { - permanent.getCardType().add(CardType.ENCHANTMENT); - } - return true; - } - }); - - return true; - } - } - } - return false; - } - - @Override - public CopyArtifactEffect copy() { - return new CopyArtifactEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/CursedLand.java b/Mage.Sets/src/mage/sets/limitedalpha/CursedLand.java new file mode 100644 index 00000000000..d6e94cef77c --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "LEA"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Deathgrip.java b/Mage.Sets/src/mage/sets/limitedalpha/Deathgrip.java new file mode 100644 index 00000000000..021a7712be6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Deathgrip.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class Deathgrip extends mage.sets.limitedbeta.Deathgrip { + + public Deathgrip(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "LEA"; + } + + public Deathgrip(final Deathgrip card) { + super(card); + } + + @Override + public Deathgrip copy() { + return new Deathgrip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Deathlace.java b/Mage.Sets/src/mage/sets/limitedalpha/Deathlace.java new file mode 100644 index 00000000000..15a9f297430 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Deathlace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Deathlace extends mage.sets.limitedbeta.Deathlace { + + public Deathlace(UUID ownerId) { + super(ownerId); + this.cardNumber = 10; + this.expansionSetCode = "LEA"; + } + + public Deathlace(final Deathlace card) { + super(card); + } + + @Override + public Deathlace copy() { + return new Deathlace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Fastbond.java b/Mage.Sets/src/mage/sets/limitedalpha/Fastbond.java index 3be02bbc3d2..ddcdabe0e99 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/Fastbond.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/Fastbond.java @@ -52,13 +52,11 @@ public class Fastbond extends CardImpl { super(ownerId, 101, "Fastbond", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G}"); this.expansionSetCode = "LEA"; - // You may play any number of additional lands on each of your turns. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayAdditionalLandsControllerEffect(Integer.MAX_VALUE, Duration.WhileOnBattlefield))); // Whenever you play a land, if it wasn't the first land you played this turn, Fastbond deals 1 damage to you. this.addAbility(new PlayALandTriggeredAbility()); } - public Fastbond(final Fastbond card) { super(card); @@ -70,7 +68,6 @@ public class Fastbond extends CardImpl { } } - class PlayALandTriggeredAbility extends TriggeredAbilityImpl { public PlayALandTriggeredAbility() { @@ -88,14 +85,14 @@ class PlayALandTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getPlayerId() == this.getControllerId(); + return event.getPlayerId().equals(this.getControllerId()); } @Override public boolean checkInterveningIfClause(Game game) { Player player = game.getPlayer(this.getControllerId()); - if (player != null){ - if (player.getLandsPlayed() != 1){ + if (player != null) { + if (player.getLandsPlayed() != 1) { return true; } } @@ -111,8 +108,5 @@ class PlayALandTriggeredAbility extends TriggeredAbilityImpl { public String getRule() { return "Whenever you play a land, if it wasn't the first land you played this turn, {source} deals 1 damage to you"; } - - + } - - diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Feedback.java b/Mage.Sets/src/mage/sets/limitedalpha/Feedback.java new file mode 100644 index 00000000000..083eb5edfaa --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Feedback.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author LoneFox + */ +public class Feedback extends CardImpl { + + public Feedback(UUID ownerId) { + super(ownerId, 58, "Feedback", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "LEA"; + this.subtype.add("Aura"); + + // Enchant enchantment + TargetPermanent auraTarget = new TargetEnchantmentPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted enchantment's controller, Feedback deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/GraniteGargoyle.java b/Mage.Sets/src/mage/sets/limitedalpha/GraniteGargoyle.java new file mode 100644 index 00000000000..44e51b615b4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/GraniteGargoyle.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class GraniteGargoyle extends mage.sets.revisededition.GraniteGargoyle { + + public GraniteGargoyle(UUID ownerId) { + super(ownerId); + this.cardNumber = 156; + this.expansionSetCode = "LEA"; + } + + public GraniteGargoyle(final GraniteGargoyle card) { + super(card); + } + + @Override + public GraniteGargoyle copy() { + return new GraniteGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/KormusBell.java b/Mage.Sets/src/mage/sets/limitedalpha/KormusBell.java index f4c50b2b2b8..ddc142d6a5b 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/KormusBell.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/KormusBell.java @@ -29,24 +29,22 @@ package mage.sets.limitedalpha; import java.util.UUID; import mage.MageInt; -import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterPermanent; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.permanent.token.Token; /** * * @author KholdFuzion - + * */ public class KormusBell extends CardImpl { @@ -55,7 +53,9 @@ public class KormusBell extends CardImpl { this.expansionSetCode = "LEA"; // All Swamps are 1/1 black creatures that are still lands. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new KormusBellToken(), "lands", new FilterPermanent("Swamp", "Swamps"), Duration.WhileOnBattlefield))); + ContinuousEffect effect = new BecomesCreatureAllEffect(new KormusBellToken(), "lands", new FilterPermanent("Swamp", "Swamps"), Duration.WhileOnBattlefield); + effect.getDependencyTypes().add(DependencyType.BecomeSwamp); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } public KormusBell(final KormusBell card) { @@ -69,6 +69,7 @@ public class KormusBell extends CardImpl { } class KormusBellToken extends Token { + public KormusBellToken() { super("", "1/1 creature"); cardType.add(CardType.CREATURE); @@ -77,4 +78,4 @@ class KormusBellToken extends Token { color.setBlack(true); //Check Oracle, yes they are black } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Lifeforce.java b/Mage.Sets/src/mage/sets/limitedalpha/Lifeforce.java new file mode 100644 index 00000000000..681dcf589ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Lifeforce.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Lifeforce extends mage.sets.masterseditioniv.Lifeforce { + + public Lifeforce(UUID ownerId) { + super(ownerId); + this.cardNumber = 115; + this.expansionSetCode = "LEA"; + this.rarity = Rarity.UNCOMMON; + } + + public Lifeforce(final Lifeforce card) { + super(card); + } + + @Override + public Lifeforce copy() { + return new Lifeforce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Lifelace.java b/Mage.Sets/src/mage/sets/limitedalpha/Lifelace.java new file mode 100644 index 00000000000..f01f6e6ae90 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Lifelace.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetSpellOrPermanent; + +/** + * + * @author AlumiuN + */ +public class Lifelace extends CardImpl { + + public Lifelace(UUID ownerId) { + super(ownerId, 116, "Lifelace", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "LEA"; + + // Target spell or permanent becomes green. + this.getSpellAbility().addTarget(new TargetSpellOrPermanent()); + this.getSpellAbility().addEffect(new BecomesColorTargetEffect(ObjectColor.GREEN, Duration.Custom)); + } + + public Lifelace(final Lifelace card) { + super(card); + } + + @Override + public Lifelace copy() { + return new Lifelace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Lifetap.java b/Mage.Sets/src/mage/sets/limitedalpha/Lifetap.java new file mode 100644 index 00000000000..23838ead6b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Lifetap.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Lifetap extends mage.sets.fifthedition.Lifetap { + + public Lifetap(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "LEA"; + } + + public Lifetap(final Lifetap card) { + super(card); + } + + @Override + public Lifetap copy() { + return new Lifetap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/LivingArtifact.java b/Mage.Sets/src/mage/sets/limitedalpha/LivingArtifact.java new file mode 100644 index 00000000000..12961075cd6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/LivingArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class LivingArtifact extends mage.sets.fifthedition.LivingArtifact { + + public LivingArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 117; + this.expansionSetCode = "LEA"; + } + + public LivingArtifact(final LivingArtifact card) { + super(card); + } + + @Override + public LivingArtifact copy() { + return new LivingArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/LivingLands.java b/Mage.Sets/src/mage/sets/limitedalpha/LivingLands.java index 930379988c5..cd4923f3e07 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/LivingLands.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/LivingLands.java @@ -30,9 +30,11 @@ package mage.sets.limitedalpha; import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; @@ -51,14 +53,15 @@ public class LivingLands extends CardImpl { static { filter.add(new SubtypePredicate("Forest")); } - + public LivingLands(UUID ownerId) { super(ownerId, 118, "Living Lands", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}"); this.expansionSetCode = "LEA"; - // All Forests are 1/1 creatures that are still lands. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAllEffect(new LivingLandsToken(), "lands", filter, Duration.WhileOnBattlefield))); + ContinuousEffect effect = new BecomesCreatureAllEffect(new LivingLandsToken(), "lands", filter, Duration.WhileOnBattlefield); + effect.getDependencyTypes().add(DependencyType.BecomeForest); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } public LivingLands(final LivingLands card) { diff --git a/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalTerrain.java b/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalTerrain.java index f38d3ea0f7d..d7de486907b 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalTerrain.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalTerrain.java @@ -28,13 +28,12 @@ package mage.sets.limitedalpha; import java.util.UUID; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ChooseBasicLandTypeEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlueManaAbility; @@ -42,7 +41,6 @@ import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.choices.ChoiceImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -52,7 +50,6 @@ import mage.constants.SubLayer; import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -72,10 +69,10 @@ public class PhantasmalTerrain extends CardImpl { this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); this.addAbility(new EnchantAbility(auraTarget.getTargetName())); - + // As Phantasmal Terrain enters the battlefield, choose a basic land type. - this.addAbility(new AsEntersBattlefieldAbility(new PhantasmalTerrainChooseEffect())); - + this.addAbility(new AsEntersBattlefieldAbility(new ChooseBasicLandTypeEffect(Outcome.Neutral))); + // Enchanted land is the chosen type. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhantasmalTerrainContinuousEffect())); } @@ -90,52 +87,13 @@ public class PhantasmalTerrain extends CardImpl { } } -class PhantasmalTerrainChooseEffect extends OneShotEffect { - - public PhantasmalTerrainChooseEffect() { - super(Outcome.Neutral); - this.staticText = "choose a basic land type"; - } - - public PhantasmalTerrainChooseEffect(final PhantasmalTerrainChooseEffect effect) { - super(effect); - } - - @Override - public PhantasmalTerrainChooseEffect copy() { - return new PhantasmalTerrainChooseEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - MageObject sourceObject = source.getSourceObject(game); - if (sourceObject != null && controller != null) { - ChoiceImpl choices = new ChoiceImpl(true); - choices.setMessage("Choose basic land type"); - choices.getChoices().add("Forest"); - choices.getChoices().add("Plains"); - choices.getChoices().add("Mountain"); - choices.getChoices().add("Island"); - choices.getChoices().add("Swamp"); - if (controller.choose(Outcome.Neutral, choices, game)) { - game.informPlayers(sourceObject.getLogName() + ": chosen basic land type is " + choices.getChoice()); - game.getState().setValue(source.getSourceId().toString() + "_PhantasmalTerrain", choices.getChoice()); - return true; - } - } - return false; - } - -} - class PhantasmalTerrainContinuousEffect extends ContinuousEffectImpl { - public PhantasmalTerrainContinuousEffect(){ + public PhantasmalTerrainContinuousEffect() { super(Duration.WhileOnBattlefield, Outcome.Neutral); this.staticText = "enchanted land is the chosen type"; } - + public PhantasmalTerrainContinuousEffect(final PhantasmalTerrainContinuousEffect effect) { super(effect); } @@ -148,7 +106,7 @@ class PhantasmalTerrainContinuousEffect extends ContinuousEffectImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Permanent enchantment = game.getPermanent(source.getSourceId()); - String choice = (String) game.getState().getValue(source.getSourceId().toString() + "_PhantasmalTerrain"); + String choice = (String) game.getState().getValue(source.getSourceId().toString() + ChooseBasicLandTypeEffect.VALUE_KEY); if (enchantment != null && enchantment.getAttachedTo() != null && choice != null) { Permanent land = game.getPermanent(enchantment.getAttachedTo()); if (land != null) { @@ -195,5 +153,5 @@ class PhantasmalTerrainContinuousEffect extends ContinuousEffectImpl { public boolean hasLayer(Layer layer) { return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; } - + } diff --git a/Mage.Sets/src/mage/sets/limitedalpha/PsychicVenom.java b/Mage.Sets/src/mage/sets/limitedalpha/PsychicVenom.java index 20f2a5d9b91..d0322dc1c74 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/PsychicVenom.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/PsychicVenom.java @@ -30,22 +30,17 @@ package mage.sets.limitedalpha; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BecomesTappedAttachedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DamageAttachedControllerEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -67,7 +62,9 @@ public class PsychicVenom extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever enchanted land becomes tapped, Psychic Venom deals 2 damage to that land's controller. - this.addAbility(new PsychicVenomAbility()); + Effect effect = new DamageAttachedControllerEffect(2); + effect.setText("{this} deals 2 damage to that land's controller"); + this.addAbility(new BecomesTappedAttachedTriggeredAbility(effect, "enchanted land")); } public PsychicVenom(final PsychicVenom card) { @@ -79,43 +76,3 @@ public class PsychicVenom extends CardImpl { return new PsychicVenom(this); } } - -class PsychicVenomAbility extends TriggeredAbilityImpl { - PsychicVenomAbility() { - super(Zone.BATTLEFIELD, new DamageTargetEffect(2, true, "that land's controller")); - } - - PsychicVenomAbility(final PsychicVenomAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent source = game.getPermanent(this.sourceId); - if (source != null && source.getAttachedTo().equals(event.getTargetId())) { - Permanent attached = game.getPermanent(source.getAttachedTo()); - if (attached != null) { - for (Effect e : getEffects()) { - e.setTargetPointer(new FixedTarget(attached.getControllerId())); - } - return true; - } - } - return false; - } - - @Override - public PsychicVenomAbility copy() { - return new PsychicVenomAbility(this); - } - - @Override - public String getRule() { - return "Whenever enchanted land becomes tapped, " + super.getRule(); - } -} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Purelace.java b/Mage.Sets/src/mage/sets/limitedalpha/Purelace.java new file mode 100644 index 00000000000..3651a9766cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Purelace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Purelace extends mage.sets.unlimitededition.Purelace { + + public Purelace(UUID ownerId) { + super(ownerId); + this.cardNumber = 216; + this.expansionSetCode = "LEA"; + } + + public Purelace(final Purelace card) { + super(card); + } + + @Override + public Purelace copy() { + return new Purelace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Sacrifice.java b/Mage.Sets/src/mage/sets/limitedalpha/Sacrifice.java new file mode 100644 index 00000000000..678d76f7bc0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Sacrifice.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Sacrifice extends mage.sets.unlimitededition.Sacrifice { + + public Sacrifice(UUID ownerId) { + super(ownerId); + this.cardNumber = 33; + this.expansionSetCode = "LEA"; + } + + public Sacrifice(final Sacrifice card) { + super(card); + } + + @Override + public Sacrifice copy() { + return new Sacrifice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/ScavengingGhoul.java b/Mage.Sets/src/mage/sets/limitedalpha/ScavengingGhoul.java new file mode 100644 index 00000000000..d69bbee0f1d --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/ScavengingGhoul.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.dynamicvalue.common.CreaturesDiedThisTurnCount; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.watchers.common.CreaturesDiedWatcher; + +/** + * + * @author LoneFox + */ +public class ScavengingGhoul extends CardImpl { + + public ScavengingGhoul(UUID ownerId) { + super(ownerId, 35, "Scavenging Ghoul", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "LEA"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // At the beginning of each end step, put a corpse counter on Scavenging Ghoul for each creature that died this turn. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new AddCountersSourceEffect(CounterType.CORPSE.createInstance(), + new CreaturesDiedThisTurnCount(), true), TargetController.ANY, false), new CreaturesDiedWatcher()); + // Remove a corpse counter from Scavenging Ghoul: Regenerate Scavenging Ghoul. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), + new RemoveCountersSourceCost(CounterType.CORPSE.createInstance()))); + } + + public ScavengingGhoul(final ScavengingGhoul card) { + super(card); + } + + @Override + public ScavengingGhoul copy() { + return new ScavengingGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/SunglassesOfUrza.java b/Mage.Sets/src/mage/sets/limitedalpha/SunglassesOfUrza.java new file mode 100644 index 00000000000..36adde1b27c --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/SunglassesOfUrza.java @@ -0,0 +1,103 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.AsThoughManaEffect; +import mage.cards.CardImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.ManaType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.ManaPoolItem; + +/** + * + * @author LevelX2 + */ +public class SunglassesOfUrza extends CardImpl { + + public SunglassesOfUrza(UUID ownerId) { + super(ownerId, 271, "Sunglasses of Urza", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "LEA"; + + // You may spend white mana as though it were red mana. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SunglassesOfUrzaManaAsThoughtEffect())); + } + + public SunglassesOfUrza(final SunglassesOfUrza card) { + super(card); + } + + @Override + public SunglassesOfUrza copy() { + return new SunglassesOfUrza(this); + } +} + +class SunglassesOfUrzaManaAsThoughtEffect extends AsThoughEffectImpl implements AsThoughManaEffect { + + public SunglassesOfUrzaManaAsThoughtEffect() { + super(AsThoughEffectType.SPEND_OTHER_MANA, Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "You may spend white mana as though it were red mana"; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + return affectedControllerId.equals(source.getControllerId()); + } + + @Override + public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) { + if (mana.getWhite() > 0 && ManaType.RED.equals(manaType)) { + return ManaType.WHITE; + } + return manaType; + } + + @Override + public SunglassesOfUrzaManaAsThoughtEffect copy() { + return new SunglassesOfUrzaManaAsThoughtEffect(this); + } + + private SunglassesOfUrzaManaAsThoughtEffect(SunglassesOfUrzaManaAsThoughtEffect effect) { + super(effect); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/ThicketBasilisk.java b/Mage.Sets/src/mage/sets/limitedalpha/ThicketBasilisk.java index 1c8dfda7ce2..329272766b5 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/ThicketBasilisk.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/ThicketBasilisk.java @@ -29,21 +29,17 @@ package mage.sets.limitedalpha; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.target.targetpointer.FixedTarget; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -51,6 +47,12 @@ import mage.target.targetpointer.FixedTarget; */ public class ThicketBasilisk extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall creature"); + + static { + filter.add(Predicates.not(new SubtypePredicate("Wall"))); + } + public ThicketBasilisk(UUID ownerId) { super(ownerId, 127, "Thicket Basilisk", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); this.expansionSetCode = "LEA"; @@ -60,7 +62,10 @@ public class ThicketBasilisk extends CardImpl { this.toughness = new MageInt(4); // Whenever Thicket Basilisk blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat. - this.addAbility(new ThicketBasiliskTriggeredAbility()); + Effect effect = new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); + effect.setText("destroy that creature at end of combat"); + this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false)); } public ThicketBasilisk(final ThicketBasilisk card) { @@ -72,80 +77,3 @@ public class ThicketBasilisk extends CardImpl { return new ThicketBasilisk(this); } } - -class ThicketBasiliskTriggeredAbility extends TriggeredAbilityImpl { - - ThicketBasiliskTriggeredAbility() { - super(Zone.BATTLEFIELD, new ThicketBasiliskEffect()); - } - - ThicketBasiliskTriggeredAbility(final ThicketBasiliskTriggeredAbility ability) { - super(ability); - } - - @Override - public ThicketBasiliskTriggeredAbility copy() { - return new ThicketBasiliskTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.BLOCKER_DECLARED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent blocker = game.getPermanent(event.getSourceId()); - Permanent blocked = game.getPermanent(event.getTargetId()); - Permanent thicketBasilisk = game.getPermanent(sourceId); - if (blocker != null && blocker != thicketBasilisk - && !blocker.getSubtype().contains("Wall") - && blocked == thicketBasilisk) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId())); - return true; - } - if (blocker != null && blocker == thicketBasilisk - && !blocked.getSubtype().contains("Wall")) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId())); - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever {this} blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat."; - } -} - -class ThicketBasiliskEffect extends OneShotEffect { - - ThicketBasiliskEffect() { - super(Outcome.DestroyPermanent); - staticText = "destroy that creature at end of combat"; - } - - ThicketBasiliskEffect(final ThicketBasiliskEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - if (targetCreature != null) { - AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId())); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - return false; - } - - @Override - public ThicketBasiliskEffect copy() { - return new ThicketBasiliskEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Thoughtlace.java b/Mage.Sets/src/mage/sets/limitedalpha/Thoughtlace.java new file mode 100644 index 00000000000..e426d3ec9fb --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Thoughtlace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Thoughtlace extends mage.sets.limitedbeta.Thoughtlace { + + public Thoughtlace(UUID ownerId) { + super(ownerId); + this.cardNumber = 83; + this.expansionSetCode = "LEA"; + } + + public Thoughtlace(final Thoughtlace card) { + super(card); + } + + @Override + public Thoughtlace copy() { + return new Thoughtlace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Timetwister.java b/Mage.Sets/src/mage/sets/limitedalpha/Timetwister.java index c35a2e31b6a..b515aba3a58 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/Timetwister.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/Timetwister.java @@ -29,8 +29,9 @@ package mage.sets.limitedalpha; import java.util.UUID; import mage.abilities.Ability; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; +import mage.abilities.effects.common.DrawCardAllEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -49,9 +50,11 @@ public class Timetwister extends CardImpl { super(ownerId, 85, "Timetwister", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{U}"); this.expansionSetCode = "LEA"; - // Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards. this.getSpellAbility().addEffect(new TimetwisterEffect()); + Effect effect = new DrawCardAllEffect(7); + effect.setText(", then draws seven cards"); + this.getSpellAbility().addEffect(effect); } @@ -69,7 +72,7 @@ class TimetwisterEffect extends OneShotEffect { public TimetwisterEffect() { super(Outcome.Neutral); - staticText = "Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards"; + staticText = "Each player shuffles his or her hand and graveyard into his or her library"; } public TimetwisterEffect(final TimetwisterEffect effect) { @@ -78,27 +81,14 @@ class TimetwisterEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player sourcePlayer = game.getPlayer(source.getControllerId()); - for (UUID playerId: sourcePlayer.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card: player.getHand().getCards(game)) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - for (Card card: player.getGraveyard().getCards(game)) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } + player.moveCards(player.getHand(), Zone.HAND, Zone.LIBRARY, source, game); + player.moveCards(player.getGraveyard(), Zone.GRAVEYARD, Zone.LIBRARY, source, game); player.shuffleLibrary(game); - } } - game.getState().handleSimultaneousEvent(game); // needed here so state based triggered effects - for (UUID playerId: sourcePlayer.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { - player.drawCards(7, game); - } - } return true; } diff --git a/Mage.Sets/src/mage/sets/limitedalpha/TwoHeadedGiantOfForiys.java b/Mage.Sets/src/mage/sets/limitedalpha/TwoHeadedGiantOfForiys.java new file mode 100644 index 00000000000..827c9c8a62d --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/TwoHeadedGiantOfForiys.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TwoHeadedGiantOfForiys extends mage.sets.masterseditioniv.TwoHeadedGiantOfForiys { + + public TwoHeadedGiantOfForiys(UUID ownerId) { + super(ownerId); + this.cardNumber = 180; + this.expansionSetCode = "LEA"; + this.rarity = Rarity.RARE; + } + + public TwoHeadedGiantOfForiys(final TwoHeadedGiantOfForiys card) { + super(card); + } + + @Override + public TwoHeadedGiantOfForiys copy() { + return new TwoHeadedGiantOfForiys(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/limitedalpha/VesuvanDoppelganger.java new file mode 100644 index 00000000000..af28ac5b006 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/VesuvanDoppelganger.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class VesuvanDoppelganger extends mage.sets.unlimitededition.VesuvanDoppelganger { + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "LEA"; + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Wanderlust.java b/Mage.Sets/src/mage/sets/limitedalpha/Wanderlust.java new file mode 100644 index 00000000000..0945cecfaa0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 135; + this.expansionSetCode = "LEA"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/WarpArtifact.java b/Mage.Sets/src/mage/sets/limitedalpha/WarpArtifact.java new file mode 100644 index 00000000000..758a2d582b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "LEA"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/ZombieMaster.java b/Mage.Sets/src/mage/sets/limitedalpha/ZombieMaster.java index f5cd33ec398..92b181a680f 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/ZombieMaster.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/ZombieMaster.java @@ -51,7 +51,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class ZombieMaster extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("Zombies"); + private static final FilterPermanent filter = new FilterPermanent("Zombie creatures"); static { filter.add(new SubtypePredicate("Zombie")); @@ -66,9 +66,11 @@ public class ZombieMaster extends CardImpl { this.toughness = new MageInt(3); // Other Zombie creatures have swampwalk. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new SwampwalkAbility(), Duration.WhileOnBattlefield, filter, true))); + Effect effect = new GainAbilityAllEffect(new SwampwalkAbility(), Duration.WhileOnBattlefield, filter, true); + effect.setText("Other Zombie creatures have swampwalk. (They can't be blocked as long as defending player controls a Swamp.)"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // Other Zombies have "{B}: Regenerate this permanent." - Effect effect = new GainAbilityAllEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")), Duration.WhileOnBattlefield, filter, true); + effect = new GainAbilityAllEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")), Duration.WhileOnBattlefield, filter, true); effect.setText("Other Zombies have \"{B}: Regenerate this permanent.\""); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Chaoslace.java b/Mage.Sets/src/mage/sets/limitedbeta/Chaoslace.java new file mode 100644 index 00000000000..5dd7ab9c797 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Chaoslace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Chaoslace extends mage.sets.fourthedition.Chaoslace { + + public Chaoslace(UUID ownerId) { + super(ownerId); + this.cardNumber = 141; + this.expansionSetCode = "LEB"; + } + + public Chaoslace(final Chaoslace card) { + super(card); + } + + @Override + public Chaoslace copy() { + return new Chaoslace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Conversion.java b/Mage.Sets/src/mage/sets/limitedbeta/Conversion.java new file mode 100644 index 00000000000..ea00db87fc2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Conversion.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 201; + this.expansionSetCode = "LEB"; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/CursedLand.java b/Mage.Sets/src/mage/sets/limitedbeta/CursedLand.java new file mode 100644 index 00000000000..69f25a35977 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "LEB"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Deathgrip.java b/Mage.Sets/src/mage/sets/limitedbeta/Deathgrip.java new file mode 100644 index 00000000000..725a31bd530 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Deathgrip.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.TargetSpell; + +/** + * + * @author markedagain + */ +public class Deathgrip extends CardImpl { + private static final FilterSpell filter = new FilterSpell("green spell"); + static{ + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public Deathgrip(UUID ownerId) { + super(ownerId, 9, "Deathgrip", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}"); + this.expansionSetCode = "LEB"; + + // {B}{B}: Counter target green spell. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{B}{B}")); + ability.addTarget(new TargetSpell(filter)); + this.addAbility(ability); + } + + public Deathgrip(final Deathgrip card) { + super(card); + } + + @Override + public Deathgrip copy() { + return new Deathgrip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Deathlace.java b/Mage.Sets/src/mage/sets/limitedbeta/Deathlace.java new file mode 100644 index 00000000000..568c4641561 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Deathlace.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetSpellOrPermanent; + +/** + * + * @author AlumiuN + */ +public class Deathlace extends CardImpl { + + public Deathlace(UUID ownerId) { + super(ownerId, 10, "Deathlace", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "LEB"; + + // Target spell or permanent becomes black. + this.getSpellAbility().addTarget(new TargetSpellOrPermanent()); + this.getSpellAbility().addEffect(new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.Custom)); + } + + public Deathlace(final Deathlace card) { + super(card); + } + + @Override + public Deathlace copy() { + return new Deathlace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Feedback.java b/Mage.Sets/src/mage/sets/limitedbeta/Feedback.java new file mode 100644 index 00000000000..61edab0c87a --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "LEB"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/GraniteGargoyle.java b/Mage.Sets/src/mage/sets/limitedbeta/GraniteGargoyle.java new file mode 100644 index 00000000000..821fa3fb5cd --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/GraniteGargoyle.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class GraniteGargoyle extends mage.sets.revisededition.GraniteGargoyle { + + public GraniteGargoyle(UUID ownerId) { + super(ownerId); + this.cardNumber = 157; + this.expansionSetCode = "LEB"; + } + + public GraniteGargoyle(final GraniteGargoyle card) { + super(card); + } + + @Override + public GraniteGargoyle copy() { + return new GraniteGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Lifeforce.java b/Mage.Sets/src/mage/sets/limitedbeta/Lifeforce.java new file mode 100644 index 00000000000..6d61a4df792 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Lifeforce.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Lifeforce extends mage.sets.masterseditioniv.Lifeforce { + + public Lifeforce(UUID ownerId) { + super(ownerId); + this.cardNumber = 115; + this.expansionSetCode = "LEB"; + this.rarity = Rarity.UNCOMMON; + } + + public Lifeforce(final Lifeforce card) { + super(card); + } + + @Override + public Lifeforce copy() { + return new Lifeforce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Lifelace.java b/Mage.Sets/src/mage/sets/limitedbeta/Lifelace.java new file mode 100644 index 00000000000..e19cd0970da --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Lifelace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Lifelace extends mage.sets.limitedalpha.Lifelace { + + public Lifelace(UUID ownerId) { + super(ownerId); + this.cardNumber = 116; + this.expansionSetCode = "LEB"; + } + + public Lifelace(final Lifelace card) { + super(card); + } + + @Override + public Lifelace copy() { + return new Lifelace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Lifetap.java b/Mage.Sets/src/mage/sets/limitedbeta/Lifetap.java new file mode 100644 index 00000000000..effd512e823 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Lifetap.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Lifetap extends mage.sets.fifthedition.Lifetap { + + public Lifetap(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "LEB"; + } + + public Lifetap(final Lifetap card) { + super(card); + } + + @Override + public Lifetap copy() { + return new Lifetap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/LivingArtifact.java b/Mage.Sets/src/mage/sets/limitedbeta/LivingArtifact.java new file mode 100644 index 00000000000..df82b676745 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/LivingArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class LivingArtifact extends mage.sets.fifthedition.LivingArtifact { + + public LivingArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 117; + this.expansionSetCode = "LEB"; + } + + public LivingArtifact(final LivingArtifact card) { + super(card); + } + + @Override + public LivingArtifact copy() { + return new LivingArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Purelace.java b/Mage.Sets/src/mage/sets/limitedbeta/Purelace.java new file mode 100644 index 00000000000..bc81190443e --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Purelace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Purelace extends mage.sets.unlimitededition.Purelace { + + public Purelace(UUID ownerId) { + super(ownerId); + this.cardNumber = 218; + this.expansionSetCode = "LEB"; + } + + public Purelace(final Purelace card) { + super(card); + } + + @Override + public Purelace copy() { + return new Purelace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Sacrifice.java b/Mage.Sets/src/mage/sets/limitedbeta/Sacrifice.java new file mode 100644 index 00000000000..e218a2307dc --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Sacrifice.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Sacrifice extends mage.sets.unlimitededition.Sacrifice { + + public Sacrifice(UUID ownerId) { + super(ownerId); + this.cardNumber = 33; + this.expansionSetCode = "LEB"; + } + + public Sacrifice(final Sacrifice card) { + super(card); + } + + @Override + public Sacrifice copy() { + return new Sacrifice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/ScavengingGhoul.java b/Mage.Sets/src/mage/sets/limitedbeta/ScavengingGhoul.java new file mode 100644 index 00000000000..b3c4bb3cc12 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/ScavengingGhoul.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ScavengingGhoul extends mage.sets.limitedalpha.ScavengingGhoul { + + public ScavengingGhoul(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "LEB"; + } + + public ScavengingGhoul(final ScavengingGhoul card) { + super(card); + } + + @Override + public ScavengingGhoul copy() { + return new ScavengingGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/SunglassesOfUrza.java b/Mage.Sets/src/mage/sets/limitedbeta/SunglassesOfUrza.java new file mode 100644 index 00000000000..ac7d7fb2671 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/SunglassesOfUrza.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SunglassesOfUrza extends mage.sets.limitedalpha.SunglassesOfUrza { + + public SunglassesOfUrza(UUID ownerId) { + super(ownerId); + this.cardNumber = 273; + this.expansionSetCode = "LEB"; + } + + public SunglassesOfUrza(final SunglassesOfUrza card) { + super(card); + } + + @Override + public SunglassesOfUrza copy() { + return new SunglassesOfUrza(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Thoughtlace.java b/Mage.Sets/src/mage/sets/limitedbeta/Thoughtlace.java new file mode 100644 index 00000000000..0b91774b4df --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Thoughtlace.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetSpellOrPermanent; + +/** + * + * @author AlumiuN + */ +public class Thoughtlace extends CardImpl { + + public Thoughtlace(UUID ownerId) { + super(ownerId, 83, "Thoughtlace", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "LEB"; + + // Target spell or permanent becomes blue. + this.getSpellAbility().addTarget(new TargetSpellOrPermanent()); + this.getSpellAbility().addEffect(new BecomesColorTargetEffect(ObjectColor.BLUE, Duration.Custom)); + } + + public Thoughtlace(final Thoughtlace card) { + super(card); + } + + @Override + public Thoughtlace copy() { + return new Thoughtlace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/TwoHeadedGiantOfForiys.java b/Mage.Sets/src/mage/sets/limitedbeta/TwoHeadedGiantOfForiys.java new file mode 100644 index 00000000000..721a37aa934 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/TwoHeadedGiantOfForiys.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TwoHeadedGiantOfForiys extends mage.sets.masterseditioniv.TwoHeadedGiantOfForiys { + + public TwoHeadedGiantOfForiys(UUID ownerId) { + super(ownerId); + this.cardNumber = 181; + this.expansionSetCode = "LEB"; + this.rarity = Rarity.RARE; + } + + public TwoHeadedGiantOfForiys(final TwoHeadedGiantOfForiys card) { + super(card); + } + + @Override + public TwoHeadedGiantOfForiys copy() { + return new TwoHeadedGiantOfForiys(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/limitedbeta/VesuvanDoppelganger.java new file mode 100644 index 00000000000..774d3949b69 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/VesuvanDoppelganger.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class VesuvanDoppelganger extends mage.sets.unlimitededition.VesuvanDoppelganger { + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "LEB"; + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Wanderlust.java b/Mage.Sets/src/mage/sets/limitedbeta/Wanderlust.java new file mode 100644 index 00000000000..037a3591fcb --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 135; + this.expansionSetCode = "LEB"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/WarpArtifact.java b/Mage.Sets/src/mage/sets/limitedbeta/WarpArtifact.java new file mode 100644 index 00000000000..50673ecf58e --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "LEB"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/BoggartLoggers.java b/Mage.Sets/src/mage/sets/lorwyn/BoggartLoggers.java new file mode 100644 index 00000000000..77a14666bda --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/BoggartLoggers.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class BoggartLoggers extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Treefolk or Forest"); + + static { + filter.add(Predicates.or( + new SubtypePredicate("Treefolk"), + new SubtypePredicate("Forest"))); + } + + public BoggartLoggers(UUID ownerId) { + super(ownerId, 103, "Boggart Loggers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Goblin"); + this.subtype.add("Rogue"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Forestwalk + this.addAbility(new ForestwalkAbility()); + + // {2}{B}, Sacrifice Boggart Loggers: Destroy target Treefolk or Forest. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{2}{B}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public BoggartLoggers(final BoggartLoggers card) { + super(card); + } + + @Override + public BoggartLoggers copy() { + return new BoggartLoggers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/BoggartMob.java b/Mage.Sets/src/mage/sets/lorwyn/BoggartMob.java index 0bfee0cd162..e80f8e9d8f4 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/BoggartMob.java +++ b/Mage.Sets/src/mage/sets/lorwyn/BoggartMob.java @@ -38,14 +38,14 @@ import mage.constants.Rarity; import mage.constants.SetTargetPointer; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinRogueToken; /** * * @author fireshoes */ public class BoggartMob extends CardImpl { - + private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Goblin you control"); static { @@ -62,10 +62,10 @@ public class BoggartMob extends CardImpl { // Champion a Goblin this.addAbility(new ChampionAbility(this, "Goblin")); - + // Whenever a Goblin you control deals combat damage to a player, you may put a 1/1 black Goblin Rogue creature token onto the battlefield. this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility( - new CreateTokenEffect(new BlackGoblinRogueToken()), + new CreateTokenEffect(new GoblinRogueToken()), filter, true, SetTargetPointer.NONE, true)); } @@ -78,15 +78,3 @@ public class BoggartMob extends CardImpl { return new BoggartMob(this); } } - -class BlackGoblinRogueToken extends Token { - BlackGoblinRogueToken() { - super("Goblin Rogue", "1/1 black Goblin Rogue creature token"); - cardType.add(CardType.CREATURE); - color.setBlack(true); - subtype.add("Goblin"); - subtype.add("Rogue"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/lorwyn/BoggartSpriteChaser.java b/Mage.Sets/src/mage/sets/lorwyn/BoggartSpriteChaser.java new file mode 100644 index 00000000000..22c0d5a9e62 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/BoggartSpriteChaser.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceWhileControlsEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; + +/** + * + * @author BursegSardaukar + */ +public class BoggartSpriteChaser extends CardImpl { + + public BoggartSpriteChaser(UUID ownerId) { + super(ownerId, 156, "Boggart Sprite-Chaser", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // As long as you control a Faerie, Boggart Sprite-Chaser gets +1/+1 and has flying. + FilterPermanent filter = new FilterPermanent("Faerie", "Faerie"); + Effect effect = new BoostSourceWhileControlsEffect(filter, 1, 1); + effect.setText("As long as you control a Faerie, {this} gets +1/+1"); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); + ability.addEffect(new ConditionalContinuousEffect( + new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield), + new PermanentsOnTheBattlefieldCondition(filter), "and has flying")); + this.addAbility(ability); + + } + + public BoggartSpriteChaser(final BoggartSpriteChaser card) { + super(card); + } + + @Override + public BoggartSpriteChaser copy() { + return new BoggartSpriteChaser(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/BrigidHeroOfKinsbaile.java b/Mage.Sets/src/mage/sets/lorwyn/BrigidHeroOfKinsbaile.java index bdc1a5e46ca..cf17a7d815c 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/BrigidHeroOfKinsbaile.java +++ b/Mage.Sets/src/mage/sets/lorwyn/BrigidHeroOfKinsbaile.java @@ -39,11 +39,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.FilterPermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.filter.predicate.permanent.AttackingPredicate; -import mage.filter.predicate.permanent.BlockingPredicate; +import mage.filter.common.FilterAttackingOrBlockingCreature; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -68,7 +64,7 @@ public class BrigidHeroOfKinsbaile extends CardImpl { // First strike this.addAbility(FirstStrikeAbility.getInstance()); - // {t}: Brigid, Hero of Kinsbaile deals 2 damage to each attacking or blocking creature target player controls. + // {T}: Brigid, Hero of Kinsbaile deals 2 damage to each attacking or blocking creature target player controls. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BrigidHeroOfKinsbaileEffect(), new TapSourceCost()); ability.addTarget(new TargetPlayer()); this.addAbility(ability); @@ -87,16 +83,6 @@ public class BrigidHeroOfKinsbaile extends CardImpl { class BrigidHeroOfKinsbaileEffect extends OneShotEffect { - private static final FilterPermanent filter = new FilterPermanent("each attacking or blocking creature target player controls"); - - static { - filter.add(new CardTypePredicate(CardType.CREATURE)); - filter.add(Predicates.or( - new AttackingPredicate(), - new BlockingPredicate())); - - } - public BrigidHeroOfKinsbaileEffect() { super(Outcome.Damage); staticText = "{this} deals 2 damage to each attacking or blocking creature target player controls"; @@ -108,12 +94,10 @@ class BrigidHeroOfKinsbaileEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (targetPlayer != null) { - for (Permanent creature : game.getBattlefield().getActivePermanents(filter, targetPlayer.getId(), game)) { - if (creature != null) { - creature.damage(2, source.getSourceId(), game, false, true); - } + for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterAttackingOrBlockingCreature(), targetPlayer.getId(), game)) { + creature.damage(2, source.getSourceId(), game, false, true); } return true; } diff --git a/Mage.Sets/src/mage/sets/lorwyn/BrokenAmbitions.java b/Mage.Sets/src/mage/sets/lorwyn/BrokenAmbitions.java new file mode 100644 index 00000000000..b4168bb6136 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/BrokenAmbitions.java @@ -0,0 +1,133 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ClashEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author fireshoes + */ +public class BrokenAmbitions extends CardImpl { + + public BrokenAmbitions(UUID ownerId) { + super(ownerId, 54, "Broken Ambitions", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{X}{U}"); + this.expansionSetCode = "LRW"; + + // Counter target spell unless its controller pays {X}. Clash with an opponent. If you win, that spell's controller puts the top four cards of his or her library into his or her graveyard. + this.getSpellAbility().addEffect(new BrokenAmbitionsEffect(new ManacostVariableValue())); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + public BrokenAmbitions(final BrokenAmbitions card) { + super(card); + } + + @Override + public BrokenAmbitions copy() { + return new BrokenAmbitions(this); + } +} + +class BrokenAmbitionsEffect extends OneShotEffect { + + protected Cost cost; + protected DynamicValue genericMana; + + public BrokenAmbitionsEffect(Cost cost) { + super(Outcome.Benefit); + this.cost = cost; + this.staticText = "Counter target spell unless its controller pays {X}. Clash with an opponent. If you win, that spell's controller puts the top four cards of his or her library into his or her graveyard"; + } + + public BrokenAmbitionsEffect(DynamicValue genericMana) { + super(Outcome.Detriment); + this.genericMana = genericMana; + } + + public BrokenAmbitionsEffect(final BrokenAmbitionsEffect effect) { + super(effect); + if (effect.cost != null) { + this.cost = effect.cost.copy(); + } + if (effect.genericMana != null) { + this.genericMana = effect.genericMana.copy(); + } + } + + @Override + public BrokenAmbitionsEffect copy() { + return new BrokenAmbitionsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = (Spell) game.getStack().getStackObject(getTargetPointer().getFirst(game, source)); + Player controller = game.getPlayer(spell.getControllerId()); + if (controller != null) { + Cost costToPay; + if (cost != null) { + costToPay = cost.copy(); + } else { + costToPay = new GenericManaCost(genericMana.calculate(game, source, this)); + } + String message; + if (costToPay instanceof ManaCost) { + message = "Would you like to pay " + costToPay.getText() + " to prevent counter effect?"; + } else { + message = costToPay.getText() + " to prevent counter effect?"; + } + costToPay.clearPaid(); + if (!(controller.chooseUse(Outcome.Benefit, message, source, game) && costToPay.pay(source, game, spell.getSourceId(), spell.getControllerId(), false))) { + game.getStack().counter(spell.getId(), source.getSourceId(), game); + } + if (ClashEffect.getInstance().apply(game, source)) { + controller.moveCards(controller.getLibrary().getTopCards(game, 4), Zone.LIBRARY, Zone.GRAVEYARD, source, game); + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/lorwyn/CennsHeir.java b/Mage.Sets/src/mage/sets/lorwyn/CennsHeir.java new file mode 100644 index 00000000000..558b973c1ab --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/CennsHeir.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LoneFox + */ +public class CennsHeir extends CardImpl { + + private static final FilterAttackingCreature filter = new FilterAttackingCreature("other attacking Kithkin"); + + static { + filter.add(new SubtypePredicate("Kithkin")); + filter.add(new AnotherPredicate()); + } + + public CennsHeir(UUID ownerId) { + super(ownerId, 8, "Cenn's Heir", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Kithkin"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Cenn's Heir attacks, it gets +1/+1 until end of turn for each other attacking Kithkin. + PermanentsOnBattlefieldCount count = new PermanentsOnBattlefieldCount(filter); + this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(count, count, Duration.EndOfTurn, true), false)); + } + + public CennsHeir(final CennsHeir card) { + super(card); + } + + @Override + public CennsHeir copy() { + return new CennsHeir(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/ChangelingHero.java b/Mage.Sets/src/mage/sets/lorwyn/ChangelingHero.java new file mode 100644 index 00000000000..02cb5eb2aab --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/ChangelingHero.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.ChampionAbility; +import mage.abilities.keyword.ChangelingAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ChangelingHero extends CardImpl { + + public ChangelingHero(UUID ownerId) { + super(ownerId, 9, "Changeling Hero", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Shapeshifter"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Changeling + this.addAbility(ChangelingAbility.getInstance()); + + // Champion a creature + this.addAbility(new ChampionAbility(this, "")); + + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + } + + public ChangelingHero(final ChangelingHero card) { + super(card); + } + + @Override + public ChangelingHero copy() { + return new ChangelingHero(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/CloudgoatRanger.java b/Mage.Sets/src/mage/sets/lorwyn/CloudgoatRanger.java index a33dbc35d97..ed5a7bd9363 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/CloudgoatRanger.java +++ b/Mage.Sets/src/mage/sets/lorwyn/CloudgoatRanger.java @@ -27,19 +27,21 @@ */ package mage.sets.lorwyn; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.Predicates; @@ -48,8 +50,6 @@ import mage.filter.predicate.permanent.TappedPredicate; import mage.game.permanent.token.KithkinToken; import mage.target.common.TargetControlledPermanent; -import java.util.UUID; - /** * * @author Loki @@ -71,9 +71,16 @@ public class CloudgoatRanger extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(3); + + // When Cloudgoat Ranger enters the battlefield, put three 1/1 white Kithkin Soldier creature tokens onto the battlefield. this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new KithkinToken(), 3), false)); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Duration.EndOfTurn), new TapTargetCost(new TargetControlledPermanent(3, 3, filter, false))); - ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); + //Tap three untapped Kithkin you control: Cloudgoat Ranger gets +2/+0 and gains flying until end of turn. + Effect effect = new BoostSourceEffect(2, 0, Duration.EndOfTurn); + effect.setText("{this} gets +2/+0"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapTargetCost(new TargetControlledPermanent(3, 3, filter, false))); + effect = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains flying until end of turn"); + ability.addEffect(effect); this.addAbility(ability); } @@ -85,4 +92,4 @@ public class CloudgoatRanger extends CardImpl { public CloudgoatRanger copy() { return new CloudgoatRanger(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/EyesOfTheWisent.java b/Mage.Sets/src/mage/sets/lorwyn/EyesOfTheWisent.java index 643ea3ea7b2..d8be2507cc4 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/EyesOfTheWisent.java +++ b/Mage.Sets/src/mage/sets/lorwyn/EyesOfTheWisent.java @@ -86,6 +86,7 @@ class EyesOfTheWisentElementalToken extends Token { subtype.add("Elemental"); power = new MageInt(4); toughness = new MageInt(4); + setTokenType(1); } } diff --git a/Mage.Sets/src/mage/sets/lorwyn/FaerieHarbinger.java b/Mage.Sets/src/mage/sets/lorwyn/FaerieHarbinger.java new file mode 100644 index 00000000000..6ea0535395f --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/FaerieHarbinger.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; +import mage.abilities.keyword.FlashAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author fireshoes + */ +public class FaerieHarbinger extends CardImpl { + + public static final FilterCard filter = new FilterCard("Faerie card"); + static { + filter.add(new SubtypePredicate("Faerie")); + } + + public FaerieHarbinger(UUID ownerId) { + super(ownerId, 61, "Faerie Harbinger", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Faerie"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Faerie Harbinger enters the battlefield, you may search your library for a Faerie card, reveal it, then shuffle your library and put that card on top of it. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true), true)); + } + + public FaerieHarbinger(final FaerieHarbinger card) { + super(card); + } + + @Override + public FaerieHarbinger copy() { + return new FaerieHarbinger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/Fallowsage.java b/Mage.Sets/src/mage/sets/lorwyn/Fallowsage.java index 81387b1efed..94e15d4b70c 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/Fallowsage.java +++ b/Mage.Sets/src/mage/sets/lorwyn/Fallowsage.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; import mage.MageInt; -import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; @@ -51,7 +51,7 @@ public class Fallowsage extends CardImpl { this.toughness = new MageInt(2); // Whenever Fallowsage becomes tapped, you may draw a card. - this.addAbility(new BecomesTappedTriggeredAbility(new DrawCardSourceControllerEffect(1))); + this.addAbility(new BecomesTappedSourceTriggeredAbility(new DrawCardSourceControllerEffect(1))); } public Fallowsage(final Fallowsage card) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/FamiliarsRuse.java b/Mage.Sets/src/mage/sets/lorwyn/FamiliarsRuse.java index ba12a2e3612..4bf7c42fe6b 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/FamiliarsRuse.java +++ b/Mage.Sets/src/mage/sets/lorwyn/FamiliarsRuse.java @@ -27,17 +27,16 @@ */ package mage.sets.lorwyn; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import java.util.UUID; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.TargetSpell; import mage.target.common.TargetControlledCreaturePermanent; -import java.util.UUID; -import mage.filter.common.FilterControlledCreaturePermanent; - /** * * @author Loki @@ -48,7 +47,10 @@ public class FamiliarsRuse extends CardImpl { super(ownerId, 64, "Familiar's Ruse", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{U}{U}"); this.expansionSetCode = "LRW"; - this.getSpellAbility().addCost(new ReturnToHandTargetPermanentCost(new TargetControlledCreaturePermanent(1,1, new FilterControlledCreaturePermanent("creature"),false))); + // As an additional cost to cast Familiar's Ruse, return a creature you control to its owner's hand. + this.getSpellAbility().addCost(new ReturnToHandChosenControlledPermanentCost( + new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("creature"), true))); + // Counter target spell. this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addTarget(new TargetSpell()); } diff --git a/Mage.Sets/src/mage/sets/lorwyn/FodderLaunch.java b/Mage.Sets/src/mage/sets/lorwyn/FodderLaunch.java new file mode 100644 index 00000000000..8ebbf2b0b79 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/FodderLaunch.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; + +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.DamageTargetControllerEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.Duration; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * @author BursegSardaukar + */ +public class FodderLaunch extends CardImpl { + + public FodderLaunch(UUID ownerId) { + super(ownerId, 114, "Fodder Launch", Rarity.UNCOMMON, new CardType[]{CardType.TRIBAL, CardType.SORCERY}, "{3}{B}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Goblin"); + + //As an additional cost to cast Fodder Launch, sacrifice a Goblin. + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("Goblin", "a Goblin"), true))); + + //Target creature gets -5/-5 until end of turn. Fodder Launch deals 5 damage to that creature's controller. + this.getSpellAbility().addEffect(new BoostTargetEffect(-5, -5, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new DamageTargetControllerEffect(5)); + } + + public FodderLaunch(final FodderLaunch card) { + super(card); + } + + @Override + public FodderLaunch copy() { + return new FodderLaunch(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/GiantHarbinger.java b/Mage.Sets/src/mage/sets/lorwyn/GiantHarbinger.java new file mode 100644 index 00000000000..545403a4bff --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/GiantHarbinger.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author fireshoes + */ +public class GiantHarbinger extends CardImpl { + + public static final FilterCard filter = new FilterCard("Giant card"); + static { + filter.add(new SubtypePredicate("Giant")); + } + + public GiantHarbinger(UUID ownerId) { + super(ownerId, 169, "Giant Harbinger", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Giant"); + this.subtype.add("Shaman"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // When Giant Harbinger enters the battlefield, you may search your library for a Giant card, reveal it, then shuffle your library and put that card on top of it. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true), true)); + } + + public GiantHarbinger(final GiantHarbinger card) { + super(card); + } + + @Override + public GiantHarbinger copy() { + return new GiantHarbinger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/GiantsIre.java b/Mage.Sets/src/mage/sets/lorwyn/GiantsIre.java new file mode 100644 index 00000000000..82e62f769a0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/GiantsIre.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class GiantsIre extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Giant"); + + static { + filter.add(new SubtypePredicate("Giant")); + } + + public GiantsIre(UUID ownerId) { + super(ownerId, 170, "Giant's Ire", Rarity.COMMON, new CardType[]{CardType.TRIBAL, CardType.SORCERY}, "{3}{R}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Giant"); + + // Giant's Ire deals 4 damage to target player. + this.getSpellAbility().addEffect(new DamageTargetEffect(4)); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // If you control a Giant, draw a card. + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DrawCardSourceControllerEffect(1), + new PermanentsOnTheBattlefieldCondition(filter),"If you control a Giant, draw a card")); + } + + public GiantsIre(final GiantsIre card) { + super(card); + } + + @Override + public GiantsIre copy() { + return new GiantsIre(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/Guile.java b/Mage.Sets/src/mage/sets/lorwyn/Guile.java index 4e9977188f4..f420c52eefa 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/Guile.java +++ b/Mage.Sets/src/mage/sets/lorwyn/Guile.java @@ -65,10 +65,10 @@ public class Guile extends CardImpl { // Guile can't be blocked except by three or more creatures. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(3))); - + // If a spell or ability you control would counter a spell, instead exile that spell and you may play that card without paying its mana cost. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GuileReplacementEffect())); - + // When Guile is put into a graveyard from anywhere, shuffle it into its owner's library. this.addAbility(new PutIntoGraveFromAnywhereSourceTriggeredAbility(new ShuffleIntoLibrarySourceEffect())); } @@ -107,28 +107,30 @@ class GuileReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - Player guileController = game.getPlayer(source.getControllerId()); - if (spell != null && guileController != null) { - Card spellCard = spell.getCard(); - guileController.moveCardToExileWithInfo(spellCard, null, "", source.getSourceId(), game, Zone.STACK, true); - if (guileController.chooseUse(Outcome.PlayForFree, "Cast that card for free?", source, game)) { - guileController.cast(spellCard.getSpellAbility(), game, true); + Player controller = game.getPlayer(source.getControllerId()); + if (spell != null && controller != null) { + controller.moveCards(spell, Zone.EXILED, source, game); + if (!spell.isCopy()) { + Card spellCard = spell.getCard(); + if (spellCard != null && controller.chooseUse(Outcome.PlayForFree, "Cast " + spellCard.getIdName() + " for free?", source, game)) { + controller.playCard(spellCard, game, true, true); + } + return true; } - return true; } return false; } - - @Override + + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.COUNTER; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { Spell counteredSpell = game.getStack().getSpell(event.getTargetId()); StackObject counteringObject = game.getStack().getStackObject(event.getSourceId()); - return counteredSpell != null + return counteredSpell != null && counteringObject != null && counteringObject.getControllerId().equals(source.getControllerId()); } diff --git a/Mage.Sets/src/mage/sets/lorwyn/HoofprintsOfTheStag.java b/Mage.Sets/src/mage/sets/lorwyn/HoofprintsOfTheStag.java index 4782e11826f..4c6226e8636 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/HoofprintsOfTheStag.java +++ b/Mage.Sets/src/mage/sets/lorwyn/HoofprintsOfTheStag.java @@ -27,25 +27,24 @@ */ package mage.sets.lorwyn; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.common.DrawCardControllerTriggeredAbility; +import mage.abilities.condition.common.MyTurnCondition; import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.permanent.token.Token; -import java.util.UUID; -import mage.abilities.common.ActivateIfConditionActivatedAbility; -import mage.abilities.condition.common.MyTurnCondition; - /** * * @author Loki @@ -57,7 +56,9 @@ public class HoofprintsOfTheStag extends CardImpl { this.expansionSetCode = "LRW"; this.subtype.add("Elemental"); + // Whenever you draw a card, you may put a hoofprint counter on Hoofprints of the Stag. this.addAbility(new DrawCardControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.HOOFPRINT.createInstance(1)), true)); + // {2}{w}, Remove four hoofprint counters from Hoofprints of the Stag: Put a 4/4 white Elemental creature token with flying onto the battlefield. Activate this ability only during your turn. Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new WhiteElementalToken(), 1), new ManaCostsImpl("{2}{W}"), MyTurnCondition.getInstance()); ability.addCost(new RemoveCountersSourceCost(CounterType.HOOFPRINT.createInstance(4))); this.addAbility(ability); @@ -74,6 +75,7 @@ public class HoofprintsOfTheStag extends CardImpl { } class WhiteElementalToken extends Token { + WhiteElementalToken() { super("Elemental", "4/4 white Elemental creature token with flying"); cardType.add(CardType.CREATURE); @@ -81,6 +83,7 @@ class WhiteElementalToken extends Token { subtype.add("Elemental"); power = new MageInt(4); toughness = new MageInt(4); + setTokenType(2); this.addAbility(FlyingAbility.getInstance()); } } diff --git a/Mage.Sets/src/mage/sets/lorwyn/HordeOfNotions.java b/Mage.Sets/src/mage/sets/lorwyn/HordeOfNotions.java index ab05c32d1e8..976cff926fd 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/HordeOfNotions.java +++ b/Mage.Sets/src/mage/sets/lorwyn/HordeOfNotions.java @@ -33,9 +33,9 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; -import mage.abilities.keyword.VigilanceAbility; -import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.VigilanceAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; @@ -55,11 +55,11 @@ import mage.target.common.TargetCardInYourGraveyard; public class HordeOfNotions extends CardImpl { private final static FilterCard filter = new FilterCard("Elemental card from your graveyard"); - + static { filter.add(new SubtypePredicate("Elemental")); } - + public HordeOfNotions(UUID ownerId) { super(ownerId, 249, "Horde of Notions", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{U}{B}{R}{G}"); this.expansionSetCode = "LRW"; @@ -74,8 +74,8 @@ public class HordeOfNotions extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // Haste this.addAbility(HasteAbility.getInstance()); - - // {W}{U}{B}{R}{G}: You may play target Elemental card from your graveyard without paying its mana cost. + + // {W}{U}{B}{R}{G}: You may play target Elemental card from your graveyard without paying its mana cost. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new HordeOfNotionsEffect(), new ManaCostsImpl<>("{W}{U}{B}{R}{G}")); ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); @@ -92,37 +92,28 @@ public class HordeOfNotions extends CardImpl { } class HordeOfNotionsEffect extends OneShotEffect { - + public HordeOfNotionsEffect() { super(Outcome.PlayForFree); this.staticText = "You may play target Elemental card from your graveyard without paying its mana cost"; } - + public HordeOfNotionsEffect(final HordeOfNotionsEffect effect) { super(effect); } - + @Override public HordeOfNotionsEffect copy() { return new HordeOfNotionsEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = game.getCard(getTargetPointer().getFirst(game, source)); - if (card != null ) { - // Probably there is no Elemental land, but who knows - if (card.getCardType().contains(CardType.LAND) && controller.canPlayLand() && - controller.chooseUse(outcome, "Play " + card.getName() + " from your graveyard for free?", source, game)) { - controller.playLand(card, game); - } else { - if (card.getSpellAbility().canChooseTarget(game) && - controller.chooseUse(outcome, "Play " + card.getName() + " from your graveyard for free?", source, game)) { - controller.cast(card.getSpellAbility(), game, true); - } - } + if (card != null && controller.chooseUse(outcome, "Play " + card.getName() + " from your graveyard for free?", source, game)) { + controller.playCard(card, game, true, true); } return true; } diff --git a/Mage.Sets/src/mage/sets/lorwyn/Hostility.java b/Mage.Sets/src/mage/sets/lorwyn/Hostility.java new file mode 100644 index 00000000000..b309e8f73ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/Hostility.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Hostility extends mage.sets.jacevschandra.Hostility { + + public Hostility(UUID ownerId) { + super(ownerId); + this.cardNumber = 176; + this.expansionSetCode = "LRW"; + } + + public Hostility(final Hostility card) { + super(card); + } + + @Override + public Hostility copy() { + return new Hostility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/IncandescentSoulstoke.java b/Mage.Sets/src/mage/sets/lorwyn/IncandescentSoulstoke.java index 1d2c1474769..719016c9804 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/IncandescentSoulstoke.java +++ b/Mage.Sets/src/mage/sets/lorwyn/IncandescentSoulstoke.java @@ -70,7 +70,7 @@ public class IncandescentSoulstoke extends CardImpl { static { filter.add(new SubtypePredicate("Elemental")); } - + public IncandescentSoulstoke(UUID ownerId) { super(ownerId, 178, "Incandescent Soulstoke", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.expansionSetCode = "LRW"; @@ -81,13 +81,12 @@ public class IncandescentSoulstoke extends CardImpl { // Other Elemental creatures you control get +1/+1. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); - - + // {1}{R}, {T}: You may put an Elemental creature card from your hand onto the battlefield. That creature gains haste until end of turn. Sacrifice it at the beginning of the next end step. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new IncandescentSoulstokeEffect(), new ManaCostsImpl<>("{1}{R}")); ability.addCost(new TapSourceCost()); this.addAbility(ability); - + } public IncandescentSoulstoke(final IncandescentSoulstoke card) { @@ -101,7 +100,7 @@ public class IncandescentSoulstoke extends CardImpl { } class IncandescentSoulstokeEffect extends OneShotEffect { - + private static final String choiceText = "Put an Elemental creature card from your hand onto the battlefield?"; public IncandescentSoulstokeEffect() { @@ -129,14 +128,14 @@ class IncandescentSoulstokeEffect extends OneShotEffect { if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - if (controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId())) { + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); - effect.setTargetPointer(new FixedTarget(permanent.getId())); + effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); - SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName()); - sacrificeEffect.setTargetPointer(new FixedTarget(card.getId())); + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName(), source.getControllerId()); + sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setControllerId(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/lorwyn/JudgeOfCurrents.java b/Mage.Sets/src/mage/sets/lorwyn/JudgeOfCurrents.java index 09bd019a922..b030484768d 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/JudgeOfCurrents.java +++ b/Mage.Sets/src/mage/sets/lorwyn/JudgeOfCurrents.java @@ -29,7 +29,7 @@ package mage.sets.lorwyn; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BecomesTappedCreatureControlledTriggeredAbility; +import mage.abilities.common.BecomesTappedTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -51,7 +51,7 @@ public class JudgeOfCurrents extends CardImpl { this.toughness = new MageInt(1); // Whenever a Merfolk you control becomes tapped, you may gain 1 life. - this.addAbility(new BecomesTappedCreatureControlledTriggeredAbility(new GainLifeEffect(1), true, new FilterControlledCreaturePermanent("Merfolk", "a Merfolk you control"))); + this.addAbility(new BecomesTappedTriggeredAbility(new GainLifeEffect(1), true, new FilterControlledCreaturePermanent("Merfolk", "a Merfolk you control"))); } public JudgeOfCurrents(final JudgeOfCurrents card) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/KithkinHarbinger.java b/Mage.Sets/src/mage/sets/lorwyn/KithkinHarbinger.java new file mode 100644 index 00000000000..3ff7e1a031f --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/KithkinHarbinger.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LoneFox + */ +public class KithkinHarbinger extends CardImpl { + + public static final FilterCard filter = new FilterCard("Kithkin card"); + + static { + filter.add(new SubtypePredicate("Kithkin")); + } + + public KithkinHarbinger(UUID ownerId) { + super(ownerId, 26, "Kithkin Harbinger", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Kithkin"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // When Kithkin Harbinger enters the battlefield, you may search your library for a Kithkin card, reveal it, then shuffle your library and put that card on top of it. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true), true)); + } + + public KithkinHarbinger(final KithkinHarbinger card) { + super(card); + } + + @Override + public KithkinHarbinger copy() { + return new KithkinHarbinger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/KithkinMourncaller.java b/Mage.Sets/src/mage/sets/lorwyn/KithkinMourncaller.java new file mode 100644 index 00000000000..76267304715 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/KithkinMourncaller.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class KithkinMourncaller extends CardImpl { + + private static final FilterAttackingCreature filter = new FilterAttackingCreature("an attacking Kithkin or Elf"); + + static { + filter.add(Predicates.or(new SubtypePredicate("Kithkin"), new SubtypePredicate("Elf"))); + } + + public KithkinMourncaller(UUID ownerId) { + super(ownerId, 224, "Kithkin Mourncaller", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Kithkin"); + this.subtype.add("Scout"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever an attacking Kithkin or Elf is put into your graveyard from the battlefield, you may draw a card. + this.addAbility(new PutIntoGraveFromBattlefieldAllTriggeredAbility(new DrawCardSourceControllerEffect(1), + true, filter, false, true)); + } + + public KithkinMourncaller(final KithkinMourncaller card) { + super(card); + } + + @Override + public KithkinMourncaller copy() { + return new KithkinMourncaller(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/LysAlanaScarblade.java b/Mage.Sets/src/mage/sets/lorwyn/LysAlanaScarblade.java new file mode 100644 index 00000000000..5cdc7019042 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/LysAlanaScarblade.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class LysAlanaScarblade extends CardImpl { + + private static final FilterControlledPermanent filter1 = new FilterControlledPermanent(); + private static final FilterCard filter2 = new FilterCard("an Elf card"); + + static { + filter1.add(new SubtypePredicate("Elf")); + filter2.add(new SubtypePredicate("Elf")); + } + + public LysAlanaScarblade(UUID ownerId) { + super(ownerId, 122, "Lys Alana Scarblade", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Elf"); + this.subtype.add("Assassin"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}, Discard an Elf card: Target creature gets -X/-X until end of turn, where X is the number of Elves you control. + SignInversionDynamicValue count = new SignInversionDynamicValue(new PermanentsOnBattlefieldCount(filter1)); + Effect effect = new BoostTargetEffect(count, count, Duration.EndOfTurn); + effect.setText("target creature gets -X/-X until end of turn, where X is the number of Elves you control"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); + ability.addCost(new DiscardCardCost(filter2)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public LysAlanaScarblade(final LysAlanaScarblade card) { + super(card); + } + + @Override + public LysAlanaScarblade copy() { + return new LysAlanaScarblade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/MistbindClique.java b/Mage.Sets/src/mage/sets/lorwyn/MistbindClique.java index b2efb5c1b1c..9c5c7b0efa3 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/MistbindClique.java +++ b/Mage.Sets/src/mage/sets/lorwyn/MistbindClique.java @@ -68,7 +68,6 @@ public class MistbindClique extends CardImpl { // When a Faerie is championed with Mistbind Clique, tap all lands target player controls. this.addAbility(new MistbindCliqueAbility()); - } public MistbindClique(final MistbindClique card) { @@ -105,8 +104,10 @@ class MistbindCliqueAbility extends ZoneChangeTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getSourceId() != null && event.getSourceId().equals(getSourceId())) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + if (event.getSourceId() != null + && event.getSourceId().equals(getSourceId()) + && !event.getSourceId().equals(event.getTargetId())) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getTarget() != null && zEvent.getTarget().hasSubtype("Faerie")) { return true; } diff --git a/Mage.Sets/src/mage/sets/lorwyn/NathsBuffoon.java b/Mage.Sets/src/mage/sets/lorwyn/NathsBuffoon.java new file mode 100644 index 00000000000..9e9c619e27a --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/NathsBuffoon.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class NathsBuffoon extends CardImpl { + + private static final FilterCard filter = new FilterCard("Elves"); + + static { + filter.add(new SubtypePredicate("Elf")); + } + + public NathsBuffoon(UUID ownerId) { + super(ownerId, 129, "Nath's Buffoon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Goblin"); + this.subtype.add("Rogue"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Protection from Elves + this.addAbility(new ProtectionAbility(filter)); + } + + public NathsBuffoon(final NathsBuffoon card) { + super(card); + } + + @Override + public NathsBuffoon copy() { + return new NathsBuffoon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/ProwessOfTheFair.java b/Mage.Sets/src/mage/sets/lorwyn/ProwessOfTheFair.java new file mode 100644 index 00000000000..09eb350a4b8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/ProwessOfTheFair.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.permanent.token.ElfToken; + +/** + * + * @author LoneFox + */ +public class ProwessOfTheFair extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("another nontoken Elf"); + + static { + filter.add(new SubtypePredicate("Elf")); + filter.add(new AnotherPredicate()); + filter.add(Predicates.not(new TokenPredicate())); + } + + public ProwessOfTheFair(UUID ownerId) { + super(ownerId, 136, "Prowess of the Fair", Rarity.UNCOMMON, new CardType[]{CardType.TRIBAL, CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Elf"); + + // Whenever another nontoken Elf is put into your graveyard from the battlefield, you may put a 1/1 green Elf Warrior creature token onto the battlefield. + this.addAbility(new PutIntoGraveFromBattlefieldAllTriggeredAbility(new CreateTokenEffect(new ElfToken()), + true, filter, false, true)); + } + + public ProwessOfTheFair(final ProwessOfTheFair card) { + super(card); + } + + @Override + public ProwessOfTheFair copy() { + return new ProwessOfTheFair(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/QuillSlingerBoggart.java b/Mage.Sets/src/mage/sets/lorwyn/QuillSlingerBoggart.java new file mode 100644 index 00000000000..cdb736215b6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/QuillSlingerBoggart.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastAllTriggeredAbility; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPlayer; + +/** + * + * @author BursegSardaukar + */ +public class QuillSlingerBoggart extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a Kithkin spell"); + + static { + filter.add(new SubtypePredicate("Kithkin")); + } + + public QuillSlingerBoggart(UUID ownerId) { + super(ownerId, 137, "Quill-Slinger Boggart", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever a player casts a Kithkin spell, you may have target player lose 1 life. + Ability ability = new SpellCastAllTriggeredAbility(new LoseLifeTargetEffect(1), filter, true); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public QuillSlingerBoggart(final QuillSlingerBoggart card) { + super(card); + } + + @Override + public QuillSlingerBoggart copy() { + return new QuillSlingerBoggart(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java b/Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java index e591c15973e..8793c91e928 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java +++ b/Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java @@ -57,7 +57,7 @@ public class RingsOfBrighthearth extends CardImpl { this.expansionSetCode = "LRW"; // Whenever you activate an ability, if it isn't a mana ability, you may pay {2}. If you do, copy that ability. You may choose new targets for the copy. - this.addAbility(new RingsOfBrighthearthTriggeredAbility()); + this.addAbility(new RingsOfBrighthearthTriggeredAbility()); } public RingsOfBrighthearth(final RingsOfBrighthearth card) { @@ -71,15 +71,15 @@ public class RingsOfBrighthearth extends CardImpl { } class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl { - + RingsOfBrighthearthTriggeredAbility() { super(Zone.BATTLEFIELD, new RingsOfBrighthearthEffect(), false); } - + RingsOfBrighthearthTriggeredAbility(final RingsOfBrighthearthTriggeredAbility ability) { super(ability); } - + @Override public RingsOfBrighthearthTriggeredAbility copy() { return new RingsOfBrighthearthTriggeredAbility(this); @@ -89,12 +89,12 @@ class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl { public boolean checkEventType(GameEvent event, Game game) { return event.getType() == EventType.ACTIVATED_ABILITY; } - + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(getControllerId())) { StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); - if (!(stackAbility.getStackAbility() instanceof ManaAbility)) { + if (stackAbility != null && !(stackAbility.getStackAbility() instanceof ManaAbility)) { Effect effect = this.getEffects().get(0); effect.setValue("stackAbility", stackAbility.getStackAbility()); return true; @@ -102,7 +102,7 @@ class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl { } return false; } - + @Override public String getRule() { return "Whenever you activate an ability, if it isn't a mana ability, you may pay {2}. If you do, copy that ability. You may choose new targets for the copy."; @@ -110,21 +110,21 @@ class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl { } class RingsOfBrighthearthEffect extends OneShotEffect { - + RingsOfBrighthearthEffect() { super(Outcome.Benefit); this.staticText = ", you may pay {2}. If you do, copy that ability. You may choose new targets for the copy."; } - + RingsOfBrighthearthEffect(final RingsOfBrighthearthEffect effect) { super(effect); } - + @Override public RingsOfBrighthearthEffect copy() { return new RingsOfBrighthearthEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); @@ -142,7 +142,7 @@ class RingsOfBrighthearthEffect extends OneShotEffect { if (newAbility.getTargets().size() > 0) { if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", source, game)) { newAbility.getTargets().clearChosen(); - if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) { + if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, false, game) == false) { return false; } } diff --git a/Mage.Sets/src/mage/sets/lorwyn/Shapesharer.java b/Mage.Sets/src/mage/sets/lorwyn/Shapesharer.java index 8cd1d570573..8f49981b4a3 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/Shapesharer.java +++ b/Mage.Sets/src/mage/sets/lorwyn/Shapesharer.java @@ -48,7 +48,6 @@ import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; import mage.util.functions.EmptyApplyToPermanent; - /** * @author duncant */ @@ -68,11 +67,11 @@ public class Shapesharer extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(ChangelingAbility.getInstance()); - + // {2}{U}: Target Shapeshifter becomes a copy of target creature until your next turn. Ability copyAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new ShapesharerEffect(), - new ManaCostsImpl("{2}{U}")); + new ShapesharerEffect(), + new ManaCostsImpl("{2}{U}")); copyAbility.addTarget(new TargetPermanent(filterShapeshifter)); copyAbility.addTarget(new TargetCreaturePermanent()); this.addAbility(copyAbility); @@ -89,6 +88,7 @@ public class Shapesharer extends CardImpl { } class ShapesharerEffect extends OneShotEffect { + public ShapesharerEffect() { super(Outcome.Copy); this.staticText = "Target Shapeshifter becomes a copy of target creature until your next turn."; @@ -105,10 +105,12 @@ class ShapesharerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability ability) { - Permanent copyTo = game.getPermanent(ability.getFirstTarget()); + Permanent copyTo = game.getPermanent(getTargetPointer().getFirst(game, ability)); if (copyTo != null) { Permanent copyFrom = game.getPermanentOrLKIBattlefield(ability.getTargets().get(1).getFirstTarget()); - game.copyPermanent(Duration.EndOfTurn, copyFrom, copyTo, ability, new EmptyApplyToPermanent()); + if (copyFrom != null) { + game.copyPermanent(Duration.EndOfTurn, copyFrom, copyTo.getId(), ability, new EmptyApplyToPermanent()); + } } return true; } diff --git a/Mage.Sets/src/mage/sets/lorwyn/StreambedAquitects.java b/Mage.Sets/src/mage/sets/lorwyn/StreambedAquitects.java index 0f9fedacea2..c479997933f 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/StreambedAquitects.java +++ b/Mage.Sets/src/mage/sets/lorwyn/StreambedAquitects.java @@ -1,92 +1,92 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.lorwyn; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; -import mage.abilities.effects.common.continuous.BoostTargetEffect; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.keyword.IslandwalkAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.target.Target; -import mage.target.common.TargetCreaturePermanent; -import mage.target.common.TargetLandPermanent; - -/** - * - * @author LevelX2 - */ -public class StreambedAquitects extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Merfolk creature"); - static { - filter.add(new SubtypePredicate("Merfolk")); - } - - public StreambedAquitects(UUID ownerId) { - super(ownerId, 91, "Streambed Aquitects", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); - this.expansionSetCode = "LRW"; - this.subtype.add("Merfolk"); - this.subtype.add("Scout"); - - this.power = new MageInt(2); - this.toughness = new MageInt(3); - - // {tap}: Target Merfolk creature gets +1/+1 and gains islandwalk until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1,1, Duration.EndOfTurn), new TapSourceCost()); - ability.addEffect(new GainAbilityTargetEffect(new IslandwalkAbility(), Duration.EndOfTurn)); - Target target = new TargetCreaturePermanent(filter); - ability.addTarget(target); - this.addAbility(ability); - - // {tap}: Target land becomes an Island until end of turn. - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.EndOfTurn, "Island"), new TapSourceCost()); - target = new TargetLandPermanent(); - ability.addTarget(target); - this.addAbility(ability); - } - - public StreambedAquitects(final StreambedAquitects card) { - super(card); - } - - @Override - public StreambedAquitects copy() { - return new StreambedAquitects(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.IslandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LevelX2 + */ +public class StreambedAquitects extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Merfolk creature"); + static { + filter.add(new SubtypePredicate("Merfolk")); + } + + public StreambedAquitects(UUID ownerId) { + super(ownerId, 91, "Streambed Aquitects", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Merfolk"); + this.subtype.add("Scout"); + + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {tap}: Target Merfolk creature gets +1/+1 and gains islandwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1,1, Duration.EndOfTurn), new TapSourceCost()); + ability.addEffect(new GainAbilityTargetEffect(new IslandwalkAbility(false), Duration.EndOfTurn)); + Target target = new TargetCreaturePermanent(filter); + ability.addTarget(target); + this.addAbility(ability); + + // {tap}: Target land becomes an Island until end of turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.EndOfTurn, "Island"), new TapSourceCost()); + target = new TargetLandPermanent(); + ability.addTarget(target); + this.addAbility(ability); + } + + public StreambedAquitects(final StreambedAquitects card) { + super(card); + } + + @Override + public StreambedAquitects copy() { + return new StreambedAquitects(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/SurgeOfThoughtweft.java b/Mage.Sets/src/mage/sets/lorwyn/SurgeOfThoughtweft.java new file mode 100644 index 00000000000..371828e4318 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/SurgeOfThoughtweft.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author fireshoes + */ +public class SurgeOfThoughtweft extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Kithkin"); + + static { + filter.add(new SubtypePredicate("Kithkin")); + } + + public SurgeOfThoughtweft(UUID ownerId) { + super(ownerId, 43, "Surge of Thoughtweft", Rarity.COMMON, new CardType[]{CardType.TRIBAL, CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Kithkin"); + + // Creatures you control get +1/+1 until end of turn. + this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); + + // If you control a Kithkin, draw a card. + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DrawCardSourceControllerEffect(1), + new PermanentsOnTheBattlefieldCondition(filter),"If you control a Kithkin, draw a card")); + } + + public SurgeOfThoughtweft(final SurgeOfThoughtweft card) { + super(card); + } + + @Override + public SurgeOfThoughtweft copy() { + return new SurgeOfThoughtweft(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/Surgespanner.java b/Mage.Sets/src/mage/sets/lorwyn/Surgespanner.java index d7ded0f1762..2d915af972d 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/Surgespanner.java +++ b/Mage.Sets/src/mage/sets/lorwyn/Surgespanner.java @@ -32,7 +32,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.ReturnToHandTargetEffect; @@ -55,7 +55,7 @@ public class Surgespanner extends CardImpl { this.toughness = new MageInt(2); // Whenever Surgespanner becomes tapped, you may pay {1}{U}. If you do, return target permanent to its owner's hand. - Ability ability = new BecomesTappedTriggeredAbility(new DoIfCostPaid(new ReturnToHandTargetEffect(), new ManaCostsImpl("{1}{U}"))); + Ability ability = new BecomesTappedSourceTriggeredAbility(new DoIfCostPaid(new ReturnToHandTargetEffect(), new ManaCostsImpl("{1}{U}"))); ability.addTarget(new TargetPermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/lorwyn/TideshaperMystic.java b/Mage.Sets/src/mage/sets/lorwyn/TideshaperMystic.java new file mode 100644 index 00000000000..38dfda46dfe --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/TideshaperMystic.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.MyTurnCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author fireshoes + */ +public class TideshaperMystic extends CardImpl { + + public TideshaperMystic(UUID ownerId) { + super(ownerId, 93, "Tideshaper Mystic", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Merfolk"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Target land becomes the basic land type of your choice until end of turn. Activate this ability only during your turn. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new BecomesBasicLandTargetEffect(Duration.EndOfTurn), new TapSourceCost(), MyTurnCondition.getInstance()); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + } + + public TideshaperMystic(final TideshaperMystic card) { + super(card); + } + + @Override + public TideshaperMystic copy() { + return new TideshaperMystic(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/VividCrag.java b/Mage.Sets/src/mage/sets/lorwyn/VividCrag.java index db911ac24fa..a2a1f9af187 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/VividCrag.java +++ b/Mage.Sets/src/mage/sets/lorwyn/VividCrag.java @@ -27,22 +27,19 @@ */ package mage.sets.lorwyn; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; -import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; -import mage.constants.Zone; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.counters.CounterType; -import java.util.UUID; - /** * * @author Loki @@ -53,13 +50,13 @@ public class VividCrag extends CardImpl { super(ownerId, 275, "Vivid Crag", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "LRW"; // Vivid Crag enters the battlefield tapped with two charge counters on it. - EntersBattlefieldEffect effect = new EntersBattlefieldEffect(new TapSourceEffect(true), "{this} enters the battlefield tapped with two charge counters on it"); - effect.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(2))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + Ability ability = new EntersBattlefieldAbility(new TapSourceEffect(true), false, null, "{this} enters the battlefield tapped with two charge counters on it", null); + ability.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(2))); + this.addAbility(ability); // {tap}: Add {R} to your mana pool. this.addAbility(new RedManaAbility()); // {tap}, Remove a charge counter from Vivid Crag: Add one mana of any color to your mana pool. - Ability ability = new AnyColorManaAbility(); + ability = new AnyColorManaAbility(); ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(1))); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/lorwyn/VividCreek.java b/Mage.Sets/src/mage/sets/lorwyn/VividCreek.java index d81545b95fc..308795ad88a 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/VividCreek.java +++ b/Mage.Sets/src/mage/sets/lorwyn/VividCreek.java @@ -27,22 +27,19 @@ */ package mage.sets.lorwyn; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; -import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.abilities.mana.BlueManaAbility; import mage.cards.CardImpl; -import mage.constants.Zone; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.counters.CounterType; -import java.util.UUID; - /** * * @author Loki @@ -53,13 +50,13 @@ public class VividCreek extends CardImpl { super(ownerId, 276, "Vivid Creek", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "LRW"; // Vivid Creek enters the battlefield tapped with two charge counters on it. - EntersBattlefieldEffect effect = new EntersBattlefieldEffect(new TapSourceEffect(true), "{this} enters the battlefield tapped with two charge counters on it"); - effect.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(2))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + Ability ability = new EntersBattlefieldAbility(new TapSourceEffect(true), false, null, "{this} enters the battlefield tapped with two charge counters on it", null); + ability.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(2))); + this.addAbility(ability); // {tap}: Add {U} to your mana pool. this.addAbility(new BlueManaAbility()); // {tap}, Remove a charge counter from Vivid Creek: Add one mana of any color to your mana pool. - Ability ability = new AnyColorManaAbility(); + ability = new AnyColorManaAbility(); ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(1))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/lorwyn/VividGrove.java b/Mage.Sets/src/mage/sets/lorwyn/VividGrove.java index 69edf5be55d..07ba8af8c82 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/VividGrove.java +++ b/Mage.Sets/src/mage/sets/lorwyn/VividGrove.java @@ -27,22 +27,19 @@ */ package mage.sets.lorwyn; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; -import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.abilities.mana.GreenManaAbility; import mage.cards.CardImpl; -import mage.constants.Zone; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.counters.CounterType; -import java.util.UUID; - /** * * @author Loki @@ -53,13 +50,13 @@ public class VividGrove extends CardImpl { super(ownerId, 277, "Vivid Grove", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "LRW"; // Vivid Grove enters the battlefield tapped with two charge counters on it. - EntersBattlefieldEffect effect = new EntersBattlefieldEffect(new TapSourceEffect(true), "{this} enters the battlefield tapped with two charge counters on it"); - effect.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(2))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + Ability ability = new EntersBattlefieldAbility(new TapSourceEffect(true), false, null, "{this} enters the battlefield tapped with two charge counters on it", null); + ability.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(2))); + this.addAbility(ability); // {tap}: Add {G} to your mana pool. this.addAbility(new GreenManaAbility()); // {tap}, Remove a charge counter from Vivid Grove: Add one mana of any color to your mana pool. - Ability ability = new AnyColorManaAbility(); + ability = new AnyColorManaAbility(); ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(1))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/lorwyn/VividMarsh.java b/Mage.Sets/src/mage/sets/lorwyn/VividMarsh.java index ad6e4d8435c..85748e6f602 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/VividMarsh.java +++ b/Mage.Sets/src/mage/sets/lorwyn/VividMarsh.java @@ -27,22 +27,19 @@ */ package mage.sets.lorwyn; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; -import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.abilities.mana.BlackManaAbility; import mage.cards.CardImpl; -import mage.constants.Zone; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.counters.CounterType; -import java.util.UUID; - /** * * @author Loki @@ -54,13 +51,13 @@ public class VividMarsh extends CardImpl { this.expansionSetCode = "LRW"; // Vivid Marsh enters the battlefield tapped with two charge counters on it. - EntersBattlefieldEffect effect = new EntersBattlefieldEffect(new TapSourceEffect(true), "{this} enters the battlefield tapped with two charge counters on it"); - effect.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(2))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + Ability ability = new EntersBattlefieldAbility(new TapSourceEffect(true), false, null, "{this} enters the battlefield tapped with two charge counters on it", null); + ability.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(2))); + this.addAbility(ability); // {tap}: Add {B} to your mana pool. this.addAbility(new BlackManaAbility()); // {tap}, Remove a charge counter from Vivid Marsh: Add one mana of any color to your mana pool. - Ability ability = new AnyColorManaAbility(); + ability = new AnyColorManaAbility(); ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(1))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/lorwyn/VividMeadow.java b/Mage.Sets/src/mage/sets/lorwyn/VividMeadow.java index 432d65ef859..a5998b765f8 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/VividMeadow.java +++ b/Mage.Sets/src/mage/sets/lorwyn/VividMeadow.java @@ -27,22 +27,19 @@ */ package mage.sets.lorwyn; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; -import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.constants.Zone; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.counters.CounterType; -import java.util.UUID; - /** * * @author Loki @@ -53,13 +50,13 @@ public class VividMeadow extends CardImpl { super(ownerId, 279, "Vivid Meadow", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "LRW"; // Vivid Meadow enters the battlefield tapped with two charge counters on it. - EntersBattlefieldEffect effect = new EntersBattlefieldEffect(new TapSourceEffect(true), "{this} enters the battlefield tapped with two charge counters on it"); - effect.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(2))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + Ability ability = new EntersBattlefieldAbility(new TapSourceEffect(true), false, null, "{this} enters the battlefield tapped with two charge counters on it", null); + ability.addEffect(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(2))); + this.addAbility(ability); // {tap}: Add {W} to your mana pool. this.addAbility(new WhiteManaAbility()); // {tap}, Remove a charge counter from Vivid Meadow: Add one mana of any color to your mana pool. - Ability ability = new AnyColorManaAbility(); + ability = new AnyColorManaAbility(); ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(1))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/magic2010/AjaniGoldmane.java b/Mage.Sets/src/mage/sets/magic2010/AjaniGoldmane.java index f53660bf0f0..f123146b6a8 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AjaniGoldmane.java +++ b/Mage.Sets/src/mage/sets/magic2010/AjaniGoldmane.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,15 +20,26 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2010; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.Effects; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -36,19 +47,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.Effects; -import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.GainLifeEffect; -import mage.abilities.effects.common.counter.AddCountersAllEffect; -import mage.abilities.keyword.VigilanceAbility; -import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; @@ -68,7 +66,7 @@ public class AjaniGoldmane extends CardImpl { this.expansionSetCode = "M10"; this.subtype.add("Ajani"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: You gain 2 life. this.addAbility(new LoyaltyAbility(new GainLifeEffect(2), 1)); @@ -136,4 +134,4 @@ class AvatarTokenEffect extends ContinuousEffectImpl { return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2010/ChandraNalaar.java b/Mage.Sets/src/mage/sets/magic2010/ChandraNalaar.java index e795ef55dc2..b1ced672549 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ChandraNalaar.java +++ b/Mage.Sets/src/mage/sets/magic2010/ChandraNalaar.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,17 +20,17 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2010; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.dynamicvalue.DynamicValue; @@ -38,18 +38,14 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.Effects; import mage.abilities.effects.common.DamageAllControlledTargetEffect; import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.target.TargetPlayer; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * * @author BetaSteward_at_googlemail.com, nantuko @@ -61,8 +57,7 @@ public class ChandraNalaar extends CardImpl { this.expansionSetCode = "M10"; this.subtype.add("Chandra"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), false)); - + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6)); LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(1), 1); ability1.addTarget(new TargetPlayer()); @@ -98,7 +93,7 @@ class ChandraNalaarXValue implements DynamicValue { public int calculate(Game game, Ability sourceAbility, Effect effect) { for (Cost cost : sourceAbility.getCosts()) { if (cost instanceof PayVariableLoyaltyCost) { - return ((PayVariableLoyaltyCost)cost).getAmount(); + return ((PayVariableLoyaltyCost) cost).getAmount(); } } return 0; @@ -123,4 +118,3 @@ class ChandraNalaarXValue implements DynamicValue { return defaultValue; } } - diff --git a/Mage.Sets/src/mage/sets/magic2010/ConvincingMirage.java b/Mage.Sets/src/mage/sets/magic2010/ConvincingMirage.java index 5ee4db516fb..9049656edd4 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ConvincingMirage.java +++ b/Mage.Sets/src/mage/sets/magic2010/ConvincingMirage.java @@ -27,21 +27,13 @@ */ package mage.sets.magic2010; -import java.util.Set; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ChooseBasicLandTypeEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlueManaAbility; @@ -49,10 +41,15 @@ import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -67,13 +64,12 @@ public class ConvincingMirage extends CardImpl { this.expansionSetCode = "M10"; this.subtype.add("Aura"); - // Enchant land TargetPermanent auraTarget = new TargetLandPermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); // As Convincing Mirage enters the battlefield, choose a basic land type. - this.addAbility(new AsEntersBattlefieldAbility(new ConvincingMirageEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseBasicLandTypeEffect(Outcome.Neutral))); // Enchanted land is the chosen type. Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); @@ -90,42 +86,6 @@ public class ConvincingMirage extends CardImpl { } } -class ConvincingMirageEffect extends OneShotEffect { - - public ConvincingMirageEffect() { - super(Outcome.Neutral); - this.staticText = "choose a basic land type"; - } - - public ConvincingMirageEffect(final ConvincingMirageEffect effect) { - super(effect); - } - - @Override - public ConvincingMirageEffect copy() { - return new ConvincingMirageEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - ChoiceImpl choices = new ChoiceImpl(true); - Set choicesSet = choices.getChoices(); - choicesSet.add("Forest"); - choicesSet.add("Plains"); - choicesSet.add("Mountain"); - choicesSet.add("Island"); - choicesSet.add("Swamp"); - if (player.choose(Outcome.Neutral, choices, game)) { - game.getState().setValue(source.getSourceId().toString() + "_ConvincingMirage", choices.getChoice()); - return true; - } - } - return false; - } -} - class ConvincingMirageContinousEffect extends ContinuousEffectImpl { public ConvincingMirageContinousEffect() { @@ -145,7 +105,7 @@ class ConvincingMirageContinousEffect extends ContinuousEffectImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Permanent enchantment = game.getPermanent(source.getSourceId()); - String choice = (String) game.getState().getValue(source.getSourceId().toString() + "_ConvincingMirage"); + String choice = (String) game.getState().getValue(source.getSourceId().toString() + ChooseBasicLandTypeEffect.VALUE_KEY); if (enchantment != null && enchantment.getAttachedTo() != null && choice != null) { Permanent land = game.getPermanent(enchantment.getAttachedTo()); if (land != null) { @@ -160,19 +120,19 @@ class ConvincingMirageContinousEffect extends ContinuousEffectImpl { if (sublayer == SubLayer.NA) { land.getAbilities().clear(); if (choice.equals("Forest")) { - land.addAbility(new GreenManaAbility(), game); + land.addAbility(new GreenManaAbility(), source.getSourceId(), game); } if (choice.equals("Plains")) { - land.addAbility(new WhiteManaAbility(), game); + land.addAbility(new WhiteManaAbility(), source.getSourceId(), game); } if (choice.equals("Mountain")) { - land.addAbility(new RedManaAbility(), game); + land.addAbility(new RedManaAbility(), source.getSourceId(), game); } if (choice.equals("Island")) { - land.addAbility(new BlueManaAbility(), game); + land.addAbility(new BlueManaAbility(), source.getSourceId(), game); } if (choice.equals("Swamp")) { - land.addAbility(new BlackManaAbility(), game); + land.addAbility(new BlackManaAbility(), source.getSourceId(), game); } } break; @@ -192,4 +152,4 @@ class ConvincingMirageContinousEffect extends ContinuousEffectImpl { public boolean hasLayer(Layer layer) { return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2010/DjinnOfWishes.java b/Mage.Sets/src/mage/sets/magic2010/DjinnOfWishes.java index 1ad585e45f5..b42be2535a1 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DjinnOfWishes.java +++ b/Mage.Sets/src/mage/sets/magic2010/DjinnOfWishes.java @@ -28,12 +28,8 @@ package mage.sets.magic2010; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -46,6 +42,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.players.Player; @@ -100,33 +100,16 @@ class DjinnOfWishesEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null && player.getLibrary().size() > 0) { - Card card = player.getLibrary().getFromTop(game); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards("Djinn Of Wishes", cards, game); - - player.getLibrary().removeFromTop(game); - - boolean used = false; - if (player.chooseUse(Outcome.PlayForFree, "Play " + card.getName() + " without paying its mana cost?", source, game)) { - if (card.getCardType().contains(CardType.LAND)) { - // If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn. - if (game.getActivePlayerId().equals(player.getId()) && player.canPlayLand()) { - used = true; - player.playLand(card, game); - } - } else { - used = true; - player.cast(card.getSpellAbility(), game, true); - } - } - - if (!used) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null && controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().getFromTop(game); + Cards cards = new CardsImpl(card); + controller.revealCards(sourceObject.getIdName(), cards, game); + if (!controller.chooseUse(Outcome.PlayForFree, "Play " + card.getName() + " without paying its mana cost?", source, game) + || !controller.playCard(card, game, true, true)) { card.moveToZone(Zone.EXILED, source.getSourceId(), game, false); } - return true; } return false; diff --git a/Mage.Sets/src/mage/sets/magic2010/Earthquake.java b/Mage.Sets/src/mage/sets/magic2010/Earthquake.java index b49cd07434b..632d7fc6116 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Earthquake.java +++ b/Mage.Sets/src/mage/sets/magic2010/Earthquake.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -29,19 +29,15 @@ package mage.sets.magic2010; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DamageEverythingEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.AbilityPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; /** * @@ -49,11 +45,18 @@ import mage.players.Player; */ public class Earthquake extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature without flying"); + + static { + filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + public Earthquake(UUID ownerId) { super(ownerId, 134, "Earthquake", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{R}"); this.expansionSetCode = "M10"; - this.getSpellAbility().addEffect(new EarthquakeEffect()); + // Hurricane deals X damage to each creature with flying and each player. + this.getSpellAbility().addEffect(new DamageEverythingEffect(new ManacostVariableValue(), filter)); } public Earthquake(final Earthquake card) { @@ -65,41 +68,3 @@ public class Earthquake extends CardImpl { return new Earthquake(this); } } - -class EarthquakeEffect extends OneShotEffect { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - - static { - filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); - } - - public EarthquakeEffect() { - super(Outcome.Damage); - staticText = "{this} deals X damage to each creature without flying and each player"; - } - - public EarthquakeEffect(final EarthquakeEffect effect) { - super(effect); - } - - @Override - public EarthquakeEffect copy() { - return new EarthquakeEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - int amount = source.getManaCostsToPay().getX(); - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { - permanent.damage(amount, source.getSourceId(), game, false, true); - } - for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) - player.damage(amount, source.getSourceId(), game, false, true); - } - return true; - } - -} diff --git a/Mage.Sets/src/mage/sets/magic2010/GarrukWildspeaker.java b/Mage.Sets/src/mage/sets/magic2010/GarrukWildspeaker.java index 7c35ee12a38..9a3ddef6c26 100644 --- a/Mage.Sets/src/mage/sets/magic2010/GarrukWildspeaker.java +++ b/Mage.Sets/src/mage/sets/magic2010/GarrukWildspeaker.java @@ -1,49 +1,46 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.sets.magic2010; import java.util.UUID; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.Effects; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.game.permanent.token.BeastToken; import mage.target.common.TargetLandPermanent; @@ -61,8 +58,7 @@ public class GarrukWildspeaker extends CardImpl { this.expansionSetCode = "M10"; this.subtype.add("Garruk"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +1: Untap two target lands. LoyaltyAbility ability1 = new LoyaltyAbility(new UntapTargetEffect(), 1); diff --git a/Mage.Sets/src/mage/sets/magic2010/HarmsWay.java b/Mage.Sets/src/mage/sets/magic2010/HarmsWay.java index 12a58405a48..11cf5c7c68a 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HarmsWay.java +++ b/Mage.Sets/src/mage/sets/magic2010/HarmsWay.java @@ -30,8 +30,7 @@ package mage.sets.magic2010; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; -import mage.abilities.effects.PreventionEffectData; -import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.RedirectionEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -69,91 +68,65 @@ public class HarmsWay extends CardImpl { } } -class HarmsWayPreventDamageTargetEffect extends PreventionEffectImpl { - - private final TargetSource target; - +class HarmsWayPreventDamageTargetEffect extends RedirectionEffect { + + private final TargetSource damageSource; + public HarmsWayPreventDamageTargetEffect() { - super(Duration.EndOfTurn, 2, false, true); + super(Duration.EndOfTurn, 2, true); staticText = "The next 2 damage that a source of your choice would deal to you and/or permanents you control this turn is dealt to target creature or player instead"; - this.target = new TargetSource(); + this.damageSource = new TargetSource(); } public HarmsWayPreventDamageTargetEffect(final HarmsWayPreventDamageTargetEffect effect) { super(effect); - this.target = effect.target.copy(); + this.damageSource = effect.damageSource.copy(); } @Override public HarmsWayPreventDamageTargetEffect copy() { return new HarmsWayPreventDamageTargetEffect(this); } - + @Override public void init(Ability source, Game game) { - this.target.choose(Outcome.PreventDamage, source.getControllerId(), source.getSourceId(), game); + this.damageSource.choose(Outcome.PreventDamage, source.getControllerId(), source.getSourceId(), game); super.init(source, game); } @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - PreventionEffectData preventionData = preventDamageAction(event, source, game); - // deal damage now - if (preventionData.getPreventedDamage() > 0) { - UUID redirectTo = source.getFirstTarget(); - Permanent permanent = game.getPermanent(redirectTo); - if (permanent != null) { - game.informPlayers("Dealing " + preventionData.getPreventedDamage() + " to " + permanent.getLogName() + " instead"); - // keep the original source id as it is redirecting - permanent.damage(preventionData.getPreventedDamage(), event.getSourceId(), game, false, true); - discard(); - } - Player player = game.getPlayer(redirectTo); - if (player != null) { - game.informPlayers("Dealing " + preventionData.getPreventedDamage() + " to " + player.getLogName() + " instead"); - // keep the original source id as it is redirecting - player.damage(preventionData.getPreventedDamage(), event.getSourceId(), game, false, true); - discard(); + public boolean applies(GameEvent event, Ability source, Game game) { + // check source + MageObject object = game.getObject(event.getSourceId()); + if (object == null) { + game.informPlayers("Couldn't find source of damage"); + return false; + } + + if (!object.getId().equals(damageSource.getFirstTarget()) + && (!(object instanceof Spell) || !((Spell) object).getSourceId().equals(damageSource.getFirstTarget()))) { + return false; + } + this.redirectTarget = source.getTargets().get(0); + + // check target + // check permanent first + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null) { + if (permanent.getControllerId().equals(source.getControllerId())) { + // it's your permanent + return true; } } - return false; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (super.applies(event, source, game)) { - // check source - MageObject object = game.getObject(event.getSourceId()); - if (object == null) { - game.informPlayers("Couldn't find source of damage"); - return false; - } - - if (!object.getId().equals(target.getFirstTarget()) - && (!(object instanceof Spell) || !((Spell) object).getSourceId().equals(target.getFirstTarget()))) { - return false; - } - - // check target - // check permanent first - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null) { - if (permanent.getControllerId().equals(source.getControllerId())) { - // it's your permanent - return true; - } - } - // check player - Player player = game.getPlayer(event.getTargetId()); - if (player != null) { - if (player.getId().equals(source.getControllerId())) { - // it is you - return true; - } + // check player + Player player = game.getPlayer(event.getTargetId()); + if (player != null) { + if (player.getId().equals(source.getControllerId())) { + // it is you + return true; } } return false; } } - diff --git a/Mage.Sets/src/mage/sets/magic2010/HiveMind.java b/Mage.Sets/src/mage/sets/magic2010/HiveMind.java index b33a3c8e8a2..36d56343ed8 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HiveMind.java +++ b/Mage.Sets/src/mage/sets/magic2010/HiveMind.java @@ -27,9 +27,7 @@ */ package mage.sets.magic2010; -import java.util.Set; import java.util.UUID; - import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -130,13 +128,12 @@ class HiveMindEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Spell spell; spell = game.getStack().getSpell(((FixedTarget) getTargetPointer()).getTarget()); - if (spell == null) { // if spell e.g. was countered + if (spell == null) { // if spell e.g. was countered spell = (Spell) game.getLastKnownInformation(((FixedTarget) getTargetPointer()).getTarget(), Zone.STACK); } Player player = game.getPlayer(source.getControllerId()); if (spell != null && player != null) { - Set players = player.getInRange(); - for (UUID playerId : players) { + for (UUID playerId : game.getState().getPlayersInRange(player.getId(), game)) { if (!playerId.equals(spell.getControllerId())) { Spell copy = spell.copySpell(); copy.setControllerId(playerId); diff --git a/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java b/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java index 5ec15b0a5a3..2499010036b 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java +++ b/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2010; import java.util.UUID; @@ -38,6 +37,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; /** @@ -90,7 +90,8 @@ class HowlingMineAbility extends TriggeredAbilityImpl { @Override public boolean checkInterveningIfClause(Game game) { - return !game.getPermanent(this.sourceId).isTapped(); + Permanent source = game.getPermanentOrLKIBattlefield(this.sourceId); + return source != null && !source.isTapped(); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2010/HypnoticSpecter.java b/Mage.Sets/src/mage/sets/magic2010/HypnoticSpecter.java index e120011e380..7dcc9eda4ec 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HypnoticSpecter.java +++ b/Mage.Sets/src/mage/sets/magic2010/HypnoticSpecter.java @@ -54,7 +54,7 @@ public class HypnoticSpecter extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever Hypnotic Specter deals damage to an opponent, that player discards a card at random. - this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1, true))); + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1, true), false, false, true)); } public HypnoticSpecter(final HypnoticSpecter card) { diff --git a/Mage.Sets/src/mage/sets/magic2010/JaceBeleren.java b/Mage.Sets/src/mage/sets/magic2010/JaceBeleren.java index fcd4938b0e1..b5566671786 100644 --- a/Mage.Sets/src/mage/sets/magic2010/JaceBeleren.java +++ b/Mage.Sets/src/mage/sets/magic2010/JaceBeleren.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,25 +20,22 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2010; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.common.DrawCardAllEffect; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; -import mage.counters.CounterType; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.target.TargetPlayer; /** @@ -52,9 +49,9 @@ public class JaceBeleren extends CardImpl { this.expansionSetCode = "M10"; this.subtype.add("Jace"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); - // +2: Each player draws a card. + // +2: Each player draws a card. this.addAbility(new LoyaltyAbility(new DrawCardAllEffect(1), 2)); // -1: Target player draws a card. diff --git a/Mage.Sets/src/mage/sets/magic2010/Lifelink.java b/Mage.Sets/src/mage/sets/magic2010/Lifelink.java index b74e6c36ab6..b46a46d7013 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Lifelink.java +++ b/Mage.Sets/src/mage/sets/magic2010/Lifelink.java @@ -40,10 +40,6 @@ public class Lifelink extends mage.sets.magic2012.Lifelink { super(ownerId); this.cardNumber = 18; this.expansionSetCode = "M10"; - this.subtype.add("Aura"); - - this.color.setWhite(true); - } public Lifelink (final Lifelink card) { diff --git a/Mage.Sets/src/mage/sets/magic2010/LilianaVess.java b/Mage.Sets/src/mage/sets/magic2010/LilianaVess.java index d03f79e665a..7ab2a913ae9 100644 --- a/Mage.Sets/src/mage/sets/magic2010/LilianaVess.java +++ b/Mage.Sets/src/mage/sets/magic2010/LilianaVess.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,29 +20,28 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2010; +import java.util.LinkedHashSet; +import java.util.Set; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; +import mage.cards.Card; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.discard.DiscardTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.counters.CounterType; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; @@ -59,7 +58,7 @@ public class LilianaVess extends CardImpl { this.expansionSetCode = "M10"; this.subtype.add("Liliana"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); // +1: Target player discards a card. LoyaltyAbility ability1 = new LoyaltyAbility(new DiscardTargetEffect(1), 1); ability1.addTarget(new TargetPlayer()); @@ -98,14 +97,16 @@ class LilianaVessEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - for (UUID playerId: controller.getInRange()) { + for (UUID playerId : controller.getInRange()) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card: player.getGraveyard().getCards(game)) { + Set creatureCards = new LinkedHashSet<>(); + for (Card card : player.getGraveyard().getCards(game)) { if (card.getCardType().contains(CardType.CREATURE)) { - card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId()); + creatureCards.add(card); } } + controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, false, null); } } return true; diff --git a/Mage.Sets/src/mage/sets/magic2010/LurkingPredators.java b/Mage.Sets/src/mage/sets/magic2010/LurkingPredators.java index 9a1a0795565..2e53c0c49e1 100644 --- a/Mage.Sets/src/mage/sets/magic2010/LurkingPredators.java +++ b/Mage.Sets/src/mage/sets/magic2010/LurkingPredators.java @@ -28,10 +28,7 @@ package mage.sets.magic2010; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SpellCastOpponentTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -39,6 +36,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -52,7 +53,6 @@ public class LurkingPredators extends CardImpl { super(ownerId, 190, "Lurking Predators", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{G}{G}"); this.expansionSetCode = "M10"; - // Whenever an opponent casts a spell, reveal the top card of your library. If it's a creature card, put it onto the battlefield. Otherwise, you may put that card on the bottom of your library. this.addAbility(new SpellCastOpponentTriggeredAbility(new LurkingPredatorsEffect(), false)); } @@ -85,26 +85,25 @@ class LurkingPredatorsEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller == null || sourceObject == null) { return false; } - if (player.getLibrary().size() > 0) { - Card card = player.getLibrary().getFromTop(game); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards("Lurking Predators", cards, game); + if (controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().getFromTop(game); + Cards cards = new CardsImpl(card); + controller.revealCards(sourceObject.getIdName(), cards, game); if (card != null) { if (card.getCardType().contains(CardType.CREATURE)) { - card = player.getLibrary().removeFromTop(game); - card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId()); - } else if (player.chooseUse(Outcome.Neutral, "Put " + card.getName() + " on the bottom of your library?", source, game)) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); + } else if (controller.chooseUse(Outcome.Neutral, "Put " + card.getIdName() + " on the bottom of your library?", source, game)) { + controller.putCardsOnBottomOfLibrary(cards, game, source, false); } } } - return false; + return true; } } diff --git a/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java b/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java index 3d0c31b8d20..1e626c76a5d 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java +++ b/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java @@ -1,37 +1,35 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.sets.magic2010; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.OnEventTriggeredAbility; @@ -40,6 +38,10 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -51,10 +53,6 @@ import mage.game.permanent.token.WolfToken; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - /** * * @author BetaSteward_at_googlemail.com @@ -72,7 +70,10 @@ public class MasterOfTheWildHunt extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(3); + // At the beginning of your upkeep, put a 2/2 green Wolf creature token onto the battlefield. this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new CreateTokenEffect(wolfToken))); + + // {T}: Tap all untapped Wolf creatures you control. Each Wolf tapped this way deals damage equal to its power to target creature. That creature deals damage equal to its power divided as its controller chooses among any number of those Wolves. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MasterOfTheWildHuntEffect(), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); @@ -116,7 +117,7 @@ class MasterOfTheWildHuntEffect extends OneShotEffect { List wolves = new ArrayList<>(); Permanent target = game.getPermanent(source.getFirstTarget()); if (target != null && game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) { - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { permanent.tap(game); target.damage(permanent.getToughness().getValue(), permanent.getId(), game, false, true); wolves.add(permanent.getId()); @@ -128,4 +129,4 @@ class MasterOfTheWildHuntEffect extends OneShotEffect { return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2010/MindSpring.java b/Mage.Sets/src/mage/sets/magic2010/MindSpring.java index 72955a428fb..db84d2644b3 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MindSpring.java +++ b/Mage.Sets/src/mage/sets/magic2010/MindSpring.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -29,14 +29,11 @@ package mage.sets.magic2010; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; -import mage.game.Game; -import mage.players.Player; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -48,7 +45,7 @@ public class MindSpring extends CardImpl { super(ownerId, 64, "Mind Spring", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{U}{U}"); this.expansionSetCode = "M10"; - this.getSpellAbility().addEffect(new MindSpringEffect()); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new ManacostVariableValue())); } public MindSpring(final MindSpring card) { @@ -61,32 +58,3 @@ public class MindSpring extends CardImpl { } } - -class MindSpringEffect extends OneShotEffect { - - public MindSpringEffect() { - super(Outcome.DrawCard); - staticText = "Draw X cards"; - } - - public MindSpringEffect(final MindSpringEffect effect) { - super(effect); - } - - @Override - public MindSpringEffect copy() { - return new MindSpringEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - int amount = source.getManaCostsToPay().getX(); - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.drawCards(amount, game); - return true; - } - return false; - } - -} diff --git a/Mage.Sets/src/mage/sets/magic2010/OpenTheVaults.java b/Mage.Sets/src/mage/sets/magic2010/OpenTheVaults.java index 7b44f6e0f01..192c5d22db8 100644 --- a/Mage.Sets/src/mage/sets/magic2010/OpenTheVaults.java +++ b/Mage.Sets/src/mage/sets/magic2010/OpenTheVaults.java @@ -27,18 +27,17 @@ */ package mage.sets.magic2010; -import java.util.LinkedList; -import java.util.Set; +import java.util.LinkedHashSet; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -52,7 +51,6 @@ public class OpenTheVaults extends CardImpl { super(ownerId, 21, "Open the Vaults", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{W}{W}"); this.expansionSetCode = "M10"; - // Return all artifact and enchantment cards from all graveyards to the battlefield under their owners' control. this.getSpellAbility().addEffect(new OpenTheVaultsEffect()); } @@ -85,33 +83,21 @@ class OpenTheVaultsEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - LinkedList enchantments = new LinkedList(); - LinkedList artifacts = new LinkedList(); - - Set playerIds = player.getInRange(); - playerIds.add(player.getId()); - - for (UUID playerId : playerIds) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + LinkedHashSet cardsToReturn = new LinkedHashSet<>(); + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Cards graveyard = game.getPlayer(playerId).getGraveyard(); for (UUID cardId : graveyard) { Card card = game.getCard(cardId); - if (card != null && card.getCardType().contains(CardType.ENCHANTMENT)) { - enchantments.add(card); - } - if (card != null && card.getCardType().contains(CardType.ARTIFACT)) { - artifacts.add(card); + if (card != null + && (card.getCardType().contains(CardType.ENCHANTMENT) || card.getCardType().contains(CardType.ARTIFACT))) { + cardsToReturn.add(card); } } } - - for (Card card : enchantments) { - card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), card.getOwnerId()); - } - for (Card card : artifacts) { - card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), card.getOwnerId()); - } + controller.moveCards(cardsToReturn, Zone.BATTLEFIELD, source, game, false, false, true, null); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java index 9ca788f1489..c036b45ee5d 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java +++ b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,37 +20,36 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2010; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; -import mage.abilities.SpellAbility; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.PreventionEffectData; import mage.abilities.effects.PreventionEffectImpl; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; -import java.util.UUID; -import mage.abilities.effects.PreventionEffectData; - /** * * @author BetaSteward_at_googlemail.com @@ -65,10 +64,9 @@ public class ProteanHydra extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - // Protean Hydra enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new ProteanHydraEffect1(), "with X +1/+1 counters on it")); - + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); + // If damage would be dealt to Protean Hydra, prevent that damage and remove that many +1/+1 counters from it. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ProteanHydraEffect2())); @@ -86,39 +84,6 @@ public class ProteanHydra extends CardImpl { return new ProteanHydra(this); } - class ProteanHydraEffect1 extends OneShotEffect { - - public ProteanHydraEffect1() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - public ProteanHydraEffect1(final ProteanHydraEffect1 effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - int amount = ((SpellAbility)obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public ProteanHydraEffect1 copy() { - return new ProteanHydraEffect1(this); - } - - } - class ProteanHydraEffect2 extends PreventionEffectImpl { public ProteanHydraEffect2() { @@ -127,7 +92,7 @@ public class ProteanHydra extends CardImpl { } public ProteanHydraEffect2(final ProteanHydraEffect2 effect) { - super(effect); + super(effect); } @Override @@ -142,12 +107,12 @@ public class ProteanHydra extends CardImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - PreventionEffectData preventionEffectData = preventDamageAction(event, source, game); + PreventionEffectData preventionEffectData = preventDamageAction(event, source, game); if (preventionEffectData.getPreventedDamage() > 0) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { permanent.removeCounters(CounterType.P1P1.createInstance(preventionEffectData.getPreventedDamage()), game); - } + } } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2010/Silence.java b/Mage.Sets/src/mage/sets/magic2010/Silence.java index 4637cd9f97e..4d801a75d47 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Silence.java +++ b/Mage.Sets/src/mage/sets/magic2010/Silence.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2010; import java.util.UUID; @@ -90,7 +89,7 @@ class SilenceEffect extends ContinuousRuleModifyingEffectImpl { public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't cast spells this turn (" + mageObject.getLogName() + ")."; + return "You can't cast spells this turn (" + mageObject.getIdName() + ")."; } return null; } diff --git a/Mage.Sets/src/mage/sets/magic2010/SoulWarden.java b/Mage.Sets/src/mage/sets/magic2010/SoulWarden.java index 5310991e3c3..a84fcd66d1f 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SoulWarden.java +++ b/Mage.Sets/src/mage/sets/magic2010/SoulWarden.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,26 +20,24 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2010; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; - /** * * @author BetaSteward_at_googlemail.com @@ -47,6 +45,7 @@ import mage.filter.predicate.permanent.AnotherPredicate; public class SoulWarden extends CardImpl { private static final FilterPermanent filter = new FilterCreaturePermanent("another creature"); + static { filter.add(new AnotherPredicate()); } @@ -60,6 +59,7 @@ public class SoulWarden extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); + // Whenever another creature enters the battlefield, you gain 1 life. this.addAbility(new EntersBattlefieldAllTriggeredAbility(new GainLifeEffect(1), filter)); } diff --git a/Mage.Sets/src/mage/sets/magic2010/SphinxAmbassador.java b/Mage.Sets/src/mage/sets/magic2010/SphinxAmbassador.java index 595a34013f8..c76befa295f 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SphinxAmbassador.java +++ b/Mage.Sets/src/mage/sets/magic2010/SphinxAmbassador.java @@ -95,16 +95,16 @@ class SphinxAmbassadorEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (player != null && targetPlayer != null && sourcePermanent != null) { + if (controller != null && targetPlayer != null && sourcePermanent != null) { TargetCardInLibrary target = new TargetCardInLibrary(); - player.searchLibrary(target, game, targetPlayer.getId()); + controller.searchLibrary(target, game, targetPlayer.getId()); Card card = game.getCard(target.getFirstTarget()); if (card != null) { - TreeSet choices = new TreeSet(); + TreeSet choices = new TreeSet<>(); Collection cards = game.getCards(); for (Card gameCard : cards) { if (gameCard.getOwnerId().equals(targetPlayer.getId())) { @@ -124,8 +124,8 @@ class SphinxAmbassadorEffect extends OneShotEffect { game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(", named card: [").append(cardName).append("]").toString()); if (!card.getName().equals(cardName) && card.getCardType().contains(CardType.CREATURE)) { - if (player.chooseUse(outcome, new StringBuilder("Put ").append(card.getName()).append(" onto the battlefield?").toString(), source, game)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + if (controller.chooseUse(outcome, new StringBuilder("Put ").append(card.getName()).append(" onto the battlefield?").toString(), source, game)) { + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } } diff --git a/Mage.Sets/src/mage/sets/magic2010/StoneGiant.java b/Mage.Sets/src/mage/sets/magic2010/StoneGiant.java index c43cc027e97..f377e69b981 100644 --- a/Mage.Sets/src/mage/sets/magic2010/StoneGiant.java +++ b/Mage.Sets/src/mage/sets/magic2010/StoneGiant.java @@ -28,26 +28,22 @@ package mage.sets.magic2010; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.DestroyTargetAtBeginningOfNextEndStepEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -68,7 +64,7 @@ public class StoneGiant extends CardImpl { new TapSourceCost()); ability.addTarget(new StoneGiantTarget()); // Destroy that creature at the beginning of the next end step. - ability.addEffect(new StoneGiantEffect()); + ability.addEffect(new DestroyTargetAtBeginningOfNextEndStepEffect()); this.addAbility(ability); } @@ -109,32 +105,3 @@ class StoneGiantTarget extends TargetPermanent { return false; } } - -class StoneGiantEffect extends OneShotEffect { - - public StoneGiantEffect() { - super(Outcome.Detriment); - this.staticText = "Destroy that creature at the beginning of the next end step"; - } - - public StoneGiantEffect(final StoneGiantEffect effect) { - super(effect); - } - - @Override - public StoneGiantEffect copy() { - return new StoneGiantEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - DestroyTargetEffect effect = new DestroyTargetEffect(); - effect.setTargetPointer(new FixedTarget(source.getFirstTarget())); - AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } -} diff --git a/Mage.Sets/src/mage/sets/magic2010/WarpWorld.java b/Mage.Sets/src/mage/sets/magic2010/WarpWorld.java index ef4217d5967..71a2986efa0 100644 --- a/Mage.Sets/src/mage/sets/magic2010/WarpWorld.java +++ b/Mage.Sets/src/mage/sets/magic2010/WarpWorld.java @@ -27,25 +27,25 @@ */ package mage.sets.magic2010; -import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.List; +import java.util.LinkedHashSet; import java.util.Map; +import java.util.Set; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; -import mage.players.PlayerList; /** * @@ -57,7 +57,6 @@ public class WarpWorld extends CardImpl { super(ownerId, 163, "Warp World", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{R}{R}{R}"); this.expansionSetCode = "M10"; - // Each player shuffles all permanents he or she owns into his or her library, then reveals that many cards from the top of his or her library. Each player puts all artifact, creature, and land cards revealed this way onto the battlefield, then does the same for enchantment cards, then puts all cards revealed this way that weren't put onto the battlefield on the bottom of his or her library. this.getSpellAbility().addEffect(new WarpWorldEffect()); } @@ -90,105 +89,99 @@ class WarpWorldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Map> permanentsOwned = new HashMap<>(); - - Collection permanents = game.getBattlefield().getAllPermanents(); + MageObject sourceObject = source.getSourceObject(game); + if (sourceObject == null) { + return false; + } + Map> permanentsOwned = new HashMap<>(); + Collection permanents = game.getBattlefield().getAllActivePermanents(); for (Permanent permanent : permanents) { - List list = permanentsOwned.get(permanent.getOwnerId()); - if (list == null) { - list = new ArrayList<>(); + Set set = permanentsOwned.get(permanent.getOwnerId()); + if (set == null) { + set = new LinkedHashSet<>(); } - list.add(permanent); - permanentsOwned.put(permanent.getOwnerId(), list); + set.add(permanent); + permanentsOwned.put(permanent.getOwnerId(), set); } // shuffle permanents into owner's library Map permanentsCount = new HashMap<>(); - PlayerList playerList = game.getPlayerList(); - playerList.setCurrent(game.getActivePlayerId()); - Player player = game.getPlayer(game.getActivePlayerId()); - do { - List list = permanentsOwned.remove(player.getId()); - Integer count = 0; - if (list != null) { - count = list.size(); - for (Permanent permanent : list) { - permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + Set set = permanentsOwned.remove(playerId); + Integer count = 0; + if (set != null) { + count = set.size(); + player.moveCards(set, Zone.BATTLEFIELD, Zone.LIBRARY, source, game); } + + if (count > 0) { + player.shuffleLibrary(game); + } + permanentsCount.put(playerId, count); } + } - if (count > 0) { - player.shuffleLibrary(game); - } - - permanentsCount.put(player.getId(), count); - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw or later put into play Map cardsRevealed = new HashMap<>(); // draw cards and reveal them - playerList.setCurrent(game.getActivePlayerId()); - player = game.getPlayer(game.getActivePlayerId()); - do { - Integer count = Math.min(permanentsCount.get(player.getId()), player.getLibrary().size()); - CardsImpl cards = new CardsImpl(); - for (int i = 0; i < count; i++) { - Card card = player.getLibrary().removeFromTop(game); - if (card != null) { - cards.add(card); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + Integer count = Math.min(permanentsCount.get(player.getId()), player.getLibrary().size()); + CardsImpl cards = new CardsImpl(); + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + cards.add(card); + } } + player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ")", cards, game); + cardsRevealed.put(player.getId(), cards); } - player.revealCards("Warp World " + player.getName(), cards, game); - - cardsRevealed.put(player.getId(), cards); - - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + } // put artifacts, creaturs and lands onto the battlefield - playerList.setCurrent(game.getActivePlayerId()); - player = game.getPlayer(game.getActivePlayerId()); - do { - CardsImpl cards = cardsRevealed.get(player.getId()); - for (Card card : cards.getCards(game)) { - if (card != null && (card.getCardType().contains(CardType.ARTIFACT) - || card.getCardType().contains(CardType.CREATURE) - || card.getCardType().contains(CardType.LAND))) { - card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); - cards.remove(card); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + CardsImpl cards = cardsRevealed.get(player.getId()); + for (Card card : cards.getCards(game)) { + if (card != null && (card.getCardType().contains(CardType.ARTIFACT) + || card.getCardType().contains(CardType.CREATURE) + || card.getCardType().contains(CardType.LAND))) { + card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); + cards.remove(card); + } } + } - - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + } // put enchantments onto the battlefield - playerList.setCurrent(game.getActivePlayerId()); - player = game.getPlayer(game.getActivePlayerId()); - do { - CardsImpl cards = cardsRevealed.get(player.getId()); - for (Card card : cards.getCards(game)) { - if (card != null && card.getCardType().contains(CardType.ENCHANTMENT)) { - card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); - cards.remove(card); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + CardsImpl cards = cardsRevealed.get(player.getId()); + for (Card card : cards.getCards(game)) { + if (card != null && card.getCardType().contains(CardType.ENCHANTMENT)) { + card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); + cards.remove(card); + } } + } - - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + } // put the rest of the cards on buttom of the library - playerList.setCurrent(game.getActivePlayerId()); - player = game.getPlayer(game.getActivePlayerId()); - do { - CardsImpl cards = cardsRevealed.get(player.getId()); - player.putCardsOnBottomOfLibrary(cards, game, source, false); - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + CardsImpl cards = cardsRevealed.get(player.getId()); + player.putCardsOnBottomOfLibrary(cards, game, source, false); + } + } return true; } } diff --git a/Mage.Sets/src/mage/sets/magic2010/Weakness.java b/Mage.Sets/src/mage/sets/magic2010/Weakness.java index 2047968193f..a30710683af 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Weakness.java +++ b/Mage.Sets/src/mage/sets/magic2010/Weakness.java @@ -29,21 +29,17 @@ package mage.sets.magic2010; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -56,14 +52,16 @@ public class Weakness extends CardImpl { public Weakness(UUID ownerId) { super(ownerId, 121, "Weakness", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); this.expansionSetCode = "M10"; - this.subtype.add("Aura"); + + // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature)); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WeaknessEffect())); + this.addAbility(ability); + // Enchanted creature gets -2/-1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(-2, -1, Duration.WhileOnBattlefield))); } public Weakness(final Weakness card) { @@ -75,51 +73,3 @@ public class Weakness extends CardImpl { return new Weakness(this); } } - -class WeaknessEffect extends ContinuousEffectImpl { - - public WeaknessEffect() { - super(Duration.WhileOnBattlefield, Outcome.UnboostCreature); - staticText = "Enchanted creature gets -2/-1"; - } - - public WeaknessEffect(final WeaknessEffect effect) { - super(effect); - } - - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - switch (layer) { - case PTChangingEffects_7: - if (sublayer == SubLayer.ModifyPT_7c) { - creature.addPower(-2); - creature.addToughness(-1); - } - break; - } - return true; - } - } - return false; - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.PTChangingEffects_7; - } - - @Override - public WeaknessEffect copy() { - return new WeaknessEffect(this); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java b/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java index 57e2e4dd192..4272c6c4093 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java +++ b/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java @@ -48,7 +48,7 @@ import mage.game.events.GameEvent.EventType; public class AjanisPridemate extends CardImpl { public AjanisPridemate(UUID ownerId) { - super(ownerId, 3, "Ajani's Pridemate", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "1}{W}"); + super(ownerId, 3, "Ajani's Pridemate", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.expansionSetCode = "M11"; this.subtype.add("Cat"); this.subtype.add("Soldier"); diff --git a/Mage.Sets/src/mage/sets/magic2011/Cultivate.java b/Mage.Sets/src/mage/sets/magic2011/Cultivate.java index b68d4a6bdeb..d8b36c43345 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Cultivate.java +++ b/Mage.Sets/src/mage/sets/magic2011/Cultivate.java @@ -111,17 +111,17 @@ class CultivateEffect extends OneShotEffect { controller.choose(Outcome.Benefit, revealed, target2, game); Card card = revealed.get(target2.getFirstTarget(), game); if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); revealed.remove(card); } card = revealed.getCards(game).iterator().next(); if (card != null) { - controller.moveCards(card, null, Zone.HAND, source, game); + controller.moveCards(card, Zone.HAND, source, game); } } else if (target.getTargets().size() == 1) { Card card = revealed.getCards(game).iterator().next(); if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); } } diff --git a/Mage.Sets/src/mage/sets/magic2011/GaeasRevenge.java b/Mage.Sets/src/mage/sets/magic2011/GaeasRevenge.java index d09fae31897..1c174e38e8e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GaeasRevenge.java +++ b/Mage.Sets/src/mage/sets/magic2011/GaeasRevenge.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,19 +20,14 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2011; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; @@ -40,6 +35,11 @@ import mage.abilities.effects.common.CantBeCounteredSourceEffect; import mage.abilities.effects.common.CantBeTargetedSourceEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterObject; import mage.filter.FilterStackObject; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; @@ -50,7 +50,7 @@ import mage.filter.predicate.mageobject.ColorPredicate; */ public class GaeasRevenge extends CardImpl { - private static final FilterStackObject filter = new FilterStackObject("nongreen spells or abilities from nongreen sources"); + private static final FilterObject filter = new FilterStackObject("nongreen spells or abilities from nongreen sources"); static { filter.add(Predicates.not(new ColorPredicate(ObjectColor.GREEN))); diff --git a/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java b/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java index 484242f65d6..8e61bb1817f 100644 --- a/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2011; import java.util.UUID; @@ -100,10 +99,7 @@ class InfernoTitanAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { return true; } - if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(this.getSourceId()) ) { - return true; - } - return false; + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2011/LilianasSpecter.java b/Mage.Sets/src/mage/sets/magic2011/LilianasSpecter.java index 1e2498235d5..01e01604528 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LilianasSpecter.java +++ b/Mage.Sets/src/mage/sets/magic2011/LilianasSpecter.java @@ -30,18 +30,13 @@ package mage.sets.magic2011; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; -import mage.game.Game; -import mage.players.Player; /** * diff --git a/Mage.Sets/src/mage/sets/magic2011/MassPolymorph.java b/Mage.Sets/src/mage/sets/magic2011/MassPolymorph.java index 9e159d7af75..cd3743fde26 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MassPolymorph.java +++ b/Mage.Sets/src/mage/sets/magic2011/MassPolymorph.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,32 +20,34 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2011; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; -import java.util.List; -import java.util.UUID; - /** * * @author BetaSteward_at_googlemail.com @@ -56,6 +58,8 @@ public class MassPolymorph extends CardImpl { super(ownerId, 64, "Mass Polymorph", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{U}"); this.expansionSetCode = "M11"; + // Exile all creatures you control, then reveal cards from the top of your library until you reveal that many creature cards. + // Put all creature cards revealed this way onto the battlefield, then shuffle the rest of the revealed cards into your library. this.getSpellAbility().addEffect(new MassPolymorphEffect()); } @@ -82,34 +86,36 @@ class MassPolymorphEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int count; - List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); - count = creatures.size(); - for (Permanent creature: creatures) { - creature.moveToExile(null, null, source.getSourceId(), game); - } - Cards revealed = new CardsImpl(); - Cards creatureCards = new CardsImpl(); - Cards nonCreatureCards = new CardsImpl(); - Player player = game.getPlayer(source.getControllerId()); - while (creatureCards.size() < count && player.getLibrary().size() > 0) { - Card card = player.getLibrary().removeFromTop(game); - revealed.add(card); - if (card.getCardType().contains(CardType.CREATURE)) { - creatureCards.add(card); - } else { - nonCreatureCards.add(card); + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + int count; + // Cards creatures = new CardsImpl(); + List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); + Set creaturesToExile = new HashSet<>(); + creaturesToExile.addAll(creatures); + count = creatures.size(); + controller.moveCards(creaturesToExile, Zone.HAND, source, game); + + Cards revealed = new CardsImpl(); + Set creatureCards = new LinkedHashSet<>(); + Cards nonCreatureCards = new CardsImpl(); + while (creatureCards.size() < count && controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().removeFromTop(game); + revealed.add(card); + if (card.getCardType().contains(CardType.CREATURE)) { + creatureCards.add(card); + } else { + nonCreatureCards.add(card); + } } + controller.revealCards(sourceObject.getIdName(), revealed, game); + controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, true, null); + controller.putCardsOnTopOfLibrary(nonCreatureCards, game, source, false); + controller.shuffleLibrary(game); + return true; } - player.revealCards("Mass Polymorph", revealed, game); - for (Card creatureCard: creatureCards.getCards(game)) { - creatureCard.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId()); - } - for (Card card: nonCreatureCards.getCards(game)) { - player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true); - } - player.shuffleLibrary(game); - return true; + return false; } @Override @@ -117,4 +123,4 @@ class MassPolymorphEffect extends OneShotEffect { return new MassPolymorphEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java b/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java index 58a741397a3..d9cdc57cb98 100644 --- a/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java +++ b/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2011; import java.util.UUID; @@ -86,7 +85,7 @@ public class NecroticPlague extends CardImpl { Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield); effect.setText("Enchanted creature has \"At the beginning of your upkeep, sacrifice this creature.\""); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); - this.addAbility(new DiesAttachedTriggeredAbility(new NecroticPlagueEffect(),"enchanted creature", false)); + this.addAbility(new DiesAttachedTriggeredAbility(new NecroticPlagueEffect(), "enchanted creature", false)); } @@ -94,7 +93,7 @@ public class NecroticPlague extends CardImpl { public void adjustTargets(Ability ability, Game game) { if (ability instanceof DiesAttachedTriggeredAbility) { Permanent attachedTo = null; - for (Effect effect :ability.getEffects()) { + for (Effect effect : ability.getEffects()) { attachedTo = (Permanent) effect.getValue("attachedTo"); } if (attachedTo != null) { @@ -122,8 +121,6 @@ public class NecroticPlague extends CardImpl { class NecroticPlagueEffect extends OneShotEffect { - - public NecroticPlagueEffect() { super(Outcome.PutCardInPlay); staticText = "its controller chooses target creature one of his or her opponents controls. Return {this} from its owner's graveyard to the battlefield attached to that creature"; @@ -143,7 +140,7 @@ class NecroticPlagueEffect extends OneShotEffect { Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); if (sourceEnchantmentCard != null && creature != null) { game.getState().setValue("attachTo:" + sourceEnchantmentCard.getId(), creature); - creatureController.putOntoBattlefieldWithInfo(sourceEnchantmentCard, game, Zone.GRAVEYARD, source.getSourceId()); + creatureController.moveCards(sourceEnchantmentCard, Zone.BATTLEFIELD, source, game); return creature.addAttachment(sourceEnchantmentCard.getId(), game); } } diff --git a/Mage.Sets/src/mage/sets/magic2011/PhylacteryLich.java b/Mage.Sets/src/mage/sets/magic2011/PhylacteryLich.java index a42e28768db..6cf3a7c7243 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PhylacteryLich.java +++ b/Mage.Sets/src/mage/sets/magic2011/PhylacteryLich.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,19 +20,14 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2011; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.StateTriggeredAbility; @@ -41,6 +36,10 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.SacrificeSourceEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.Counter; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -64,8 +63,13 @@ public class PhylacteryLich extends CardImpl { this.power = new MageInt(5); this.toughness = new MageInt(5); - this.addAbility(new AsEntersBattlefieldAbility(new PhylacteryLichEffect(), "put a phylactery counter on an artifact you control")); + // Indestructible this.addAbility(IndestructibleAbility.getInstance()); + + // As Phylactery Lich enters the battlefield, put a phylactery counter on an artifact you control. + this.addAbility(new AsEntersBattlefieldAbility(new PhylacteryLichEffect(), "put a phylactery counter on an artifact you control")); + + // When you control no permanents with phylactery counters on them, sacrifice Phylactery Lich. this.addAbility(new PhylacteryLichAbility()); } @@ -95,7 +99,7 @@ public class PhylacteryLich extends CardImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(controllerId)) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(controllerId)) { if (perm.getCounters().getCount("phylactery") > 0) { return false; } @@ -133,7 +137,7 @@ class PhylacteryLichEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - TargetControlledPermanent target = new TargetControlledPermanent(filter); + TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, true); if (target.canChoose(source.getControllerId(), game)) { if (player.choose(Outcome.Neutral, target, source.getSourceId(), game)) { Permanent permanent = game.getPermanent(target.getFirstTarget()); @@ -151,4 +155,4 @@ class PhylacteryLichEffect extends OneShotEffect { return new PhylacteryLichEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java b/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java index 60e79d7a2f1..71c58ed51f3 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/PrimevalTitan.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,24 +20,23 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2011; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterLandCard; import mage.game.Game; import mage.game.events.GameEvent; @@ -58,7 +57,10 @@ public class PrimevalTitan extends CardImpl { this.power = new MageInt(6); this.toughness = new MageInt(6); + // Trample this.addAbility(TrampleAbility.getInstance()); + + // Whenever Primeval Titan enters the battlefield or attacks, you may search your library for up to two land cards, put them onto the battlefield tapped, then shuffle your library. this.addAbility(new PrimevalTitanAbility()); } diff --git a/Mage.Sets/src/mage/sets/magic2011/ShivsEmbrace.java b/Mage.Sets/src/mage/sets/magic2011/ShivsEmbrace.java index ce1bddb944c..95304846b7b 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ShivsEmbrace.java +++ b/Mage.Sets/src/mage/sets/magic2011/ShivsEmbrace.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -29,25 +29,23 @@ package mage.sets.magic2011; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -65,13 +63,15 @@ public class ShivsEmbrace extends CardImpl { // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - // Enchanted creature gets +2/+2 and has flying. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ShivsEmbraceEffect())); - + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2)); + Effect effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has flying"); + ability.addEffect(effect); + this.addAbility(ability); // {R}: Enchanted creature gets +1/+0 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); @@ -86,56 +86,3 @@ public class ShivsEmbrace extends CardImpl { return new ShivsEmbrace(this); } } - -class ShivsEmbraceEffect extends ContinuousEffectImpl { - - public ShivsEmbraceEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Enchanted creature gets +2/+2 and has flying"; - } - - public ShivsEmbraceEffect(final ShivsEmbraceEffect effect) { - super(effect); - } - - @Override - public ShivsEmbraceEffect copy() { - return new ShivsEmbraceEffect(this); - } - - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - switch (layer) { - case PTChangingEffects_7: - if (sublayer == SubLayer.ModifyPT_7c) { - creature.addPower(2); - creature.addToughness(2); - } - break; - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - creature.addAbility(FlyingAbility.getInstance(), source.getSourceId(), game); - } - break; - } - return true; - } - } - return false; - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.PTChangingEffects_7; - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2011/SunTitan.java b/Mage.Sets/src/mage/sets/magic2011/SunTitan.java index 03f7d21a769..0b5c5660dc7 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SunTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/SunTitan.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2011; import java.util.UUID; @@ -117,10 +116,7 @@ class SunTitanAbility extends TriggeredAbilityImpl { if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { return true; } - if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(this.getSourceId()) ) { - return true; - } - return false; + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2011/TimeReversal.java b/Mage.Sets/src/mage/sets/magic2011/TimeReversal.java index 6762ceeef9a..adf004f62a1 100644 --- a/Mage.Sets/src/mage/sets/magic2011/TimeReversal.java +++ b/Mage.Sets/src/mage/sets/magic2011/TimeReversal.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,23 +20,23 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2011; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.abilities.effects.common.ExileSpellEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileSpellEffect; -import mage.cards.Card; -import mage.cards.CardImpl; import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -51,7 +51,11 @@ public class TimeReversal extends CardImpl { super(ownerId, 75, "Time Reversal", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{3}{U}{U}"); this.expansionSetCode = "M11"; + // Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards this.getSpellAbility().addEffect(new TimeReversalEffect()); + Effect effect = new DrawCardAllEffect(7); + effect.setText(", then draws seven cards"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); } @@ -78,18 +82,13 @@ class TimeReversalEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player sourcePlayer = game.getPlayer(source.getControllerId()); - for (UUID playerId: sourcePlayer.getInRange()) { + Player controller = game.getPlayer(source.getControllerId()); + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card: player.getHand().getCards(game)) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - for (Card card: player.getGraveyard().getCards(game)) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } + player.moveCards(player.getHand(), Zone.HAND, Zone.LIBRARY, source, game); + player.moveCards(player.getGraveyard(), Zone.GRAVEYARD, Zone.LIBRARY, source, game); player.shuffleLibrary(game); - player.drawCards(7, game); } } return true; @@ -100,4 +99,4 @@ class TimeReversalEffect extends OneShotEffect { return new TimeReversalEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2011/Triskelion.java b/Mage.Sets/src/mage/sets/magic2011/Triskelion.java index ee0d37abde0..2ecf10dba0f 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Triskelion.java +++ b/Mage.Sets/src/mage/sets/magic2011/Triskelion.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,26 +20,25 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2011; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.target.common.TargetCreatureOrPlayer; @@ -56,7 +55,10 @@ public class Triskelion extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); + // Triskelion enters the battlefield with three +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it")); + + // Remove a +1/+1 counter from Triskelion: Triskelion deals 1 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new RemoveCountersSourceCost(CounterType.P1P1.createInstance())); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java b/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java index 3677a7b9cc7..1fd2d3f98a1 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java +++ b/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java @@ -25,23 +25,20 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2012; import java.util.UUID; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -55,22 +52,21 @@ import mage.target.targetpointer.FixedTarget; */ public class ChandraTheFirebrand extends CardImpl { - public ChandraTheFirebrand (UUID ownerId) { + public ChandraTheFirebrand(UUID ownerId) { super(ownerId, 124, "Chandra, the Firebrand", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{R}"); this.expansionSetCode = "M12"; this.subtype.add("Chandra"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +1: Chandra, the Firebrand deals 1 damage to target creature or player. - LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(1), 1); ability1.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability1); // -2: When you cast your next instant or sorcery spell this turn, copy that spell. You may choose new targets for the copy. - Effect effect = new CreateDelayedTriggeredAbilityEffect(new ChandraTheFirebrandAbility()); - effect .setText("When you cast your next instant or sorcery spell this turn, copy that spell. You may choose new targets for the copy"); + Effect effect = new CreateDelayedTriggeredAbilityEffect(new ChandraTheFirebrandAbility()); + effect.setText("When you cast your next instant or sorcery spell this turn, copy that spell. You may choose new targets for the copy"); this.addAbility(new LoyaltyAbility(effect, -2)); // -6: Chandra, the Firebrand deals 6 damage to each of up to six target creatures and/or players @@ -79,7 +75,7 @@ public class ChandraTheFirebrand extends CardImpl { this.addAbility(ability2); } - public ChandraTheFirebrand (final ChandraTheFirebrand card) { + public ChandraTheFirebrand(final ChandraTheFirebrand card) { super(card); } @@ -91,6 +87,7 @@ public class ChandraTheFirebrand extends CardImpl { } class ChandraTheFirebrandAbility extends DelayedTriggeredAbility { + ChandraTheFirebrandAbility() { super(new CopyTargetSpellEffect(), Duration.EndOfTurn); } @@ -111,11 +108,11 @@ class ChandraTheFirebrandAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getPlayerId().equals(this.getControllerId())) { + if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) { for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); + effect.setTargetPointer(new FixedTarget(event.getTargetId())); } return true; } @@ -127,4 +124,4 @@ class ChandraTheFirebrandAbility extends DelayedTriggeredAbility { public String getRule() { return "When you cast your next instant or sorcery spell this turn, copy that spell. You may choose new targets for the copy."; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2012/Firebreathing.java b/Mage.Sets/src/mage/sets/magic2012/Firebreathing.java index 6cd00148230..e7d349cee9f 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Firebreathing.java +++ b/Mage.Sets/src/mage/sets/magic2012/Firebreathing.java @@ -25,12 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2012; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ColoredManaCost; @@ -38,6 +35,12 @@ import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -47,20 +50,23 @@ import mage.target.common.TargetCreaturePermanent; */ public class Firebreathing extends CardImpl { - public Firebreathing (UUID ownerId) { + public Firebreathing(UUID ownerId) { super(ownerId, 132, "Firebreathing", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{R}"); this.expansionSetCode = "M12"; this.subtype.add("Aura"); + // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); + + // {R}: Enchanted creature gets +1/+0 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.R))); } - public Firebreathing (final Firebreathing card) { + public Firebreathing(final Firebreathing card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/magic2012/Flight.java b/Mage.Sets/src/mage/sets/magic2012/Flight.java index 198a3e6a8a5..0848e527c9c 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Flight.java +++ b/Mage.Sets/src/mage/sets/magic2012/Flight.java @@ -25,12 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2012; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; @@ -38,6 +35,11 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -47,20 +49,23 @@ import mage.target.common.TargetCreaturePermanent; */ public class Flight extends CardImpl { - public Flight (UUID ownerId) { + public Flight(UUID ownerId) { super(ownerId, 53, "Flight", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}"); this.expansionSetCode = "M12"; this.subtype.add("Aura"); + // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); + + // Enchanted creature has flying. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA))); } - public Flight (final Flight card) { + public Flight(final Flight card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java b/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java index 17c8316eca0..935f24def0f 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java +++ b/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java @@ -25,23 +25,19 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2012; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; -import mage.counters.CounterType; +import mage.constants.Rarity; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterControlledPermanent; @@ -56,20 +52,19 @@ import mage.players.Player; * @author Loki */ public class GarrukPrimalHunter extends CardImpl { - + private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); - public GarrukPrimalHunter (UUID ownerId) { + public GarrukPrimalHunter(UUID ownerId) { super(ownerId, 174, "Garruk, Primal Hunter", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{G}{G}{G}"); this.expansionSetCode = "M12"; this.subtype.add("Garruk"); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); - // +1: Put a 3/3 green Beast creature token onto the battlefield. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new BeastToken()), 1)); - + // -3: Draw cards equal to the greatest power among creatures you control. this.addAbility(new LoyaltyAbility(new GarrukPrimalHunterEffect(), -3)); @@ -77,7 +72,7 @@ public class GarrukPrimalHunter extends CardImpl { this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new WurmToken(), new PermanentsOnBattlefieldCount(filter)), -6)); } - public GarrukPrimalHunter (final GarrukPrimalHunter card) { + public GarrukPrimalHunter(final GarrukPrimalHunter card) { super(card); } @@ -89,6 +84,7 @@ public class GarrukPrimalHunter extends CardImpl { } class GarrukPrimalHunterEffect extends OneShotEffect { + GarrukPrimalHunterEffect() { super(Outcome.DrawCard); staticText = "Draw cards equal to the greatest power among creatures you control"; diff --git a/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java b/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java index be7f26d1122..5d147f63c4e 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java +++ b/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java @@ -29,17 +29,15 @@ package mage.sets.magic2012; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BecomesTappedTriggeredAbility; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; +import mage.constants.TargetController; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -47,6 +45,12 @@ import mage.game.permanent.Permanent; */ public class GideonsAvenger extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + public GideonsAvenger(UUID ownerId) { super(ownerId, 17, "Gideon's Avenger", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); this.expansionSetCode = "M12"; @@ -56,7 +60,8 @@ public class GideonsAvenger extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new GideonsAvengerTriggeredAbility()); + // Whenever a creature an opponent controls becomes tapped, put a +1/+1 counter on Gideon's Avenger. + this.addAbility(new BecomesTappedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, filter)); } public GideonsAvenger(final GideonsAvenger card) { @@ -68,38 +73,3 @@ public class GideonsAvenger extends CardImpl { return new GideonsAvenger(this); } } - -class GideonsAvengerTriggeredAbility extends TriggeredAbilityImpl { - GideonsAvengerTriggeredAbility() { - super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance())); - } - - GideonsAvengerTriggeredAbility(final GideonsAvengerTriggeredAbility ability) { - super(ability); - } - - @Override - public GideonsAvengerTriggeredAbility copy() { - return new GideonsAvengerTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent p = game.getPermanent(event.getTargetId()); - if (p != null && p.getCardType().contains(CardType.CREATURE)) { - if (game.getOpponents(this.controllerId).contains(p.getControllerId())) - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever a creature an opponent controls becomes tapped, " + modes.getText(); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2012/GoblinBangchuckers.java b/Mage.Sets/src/mage/sets/magic2012/GoblinBangchuckers.java index 7f9a5487524..70f31afeeab 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GoblinBangchuckers.java +++ b/Mage.Sets/src/mage/sets/magic2012/GoblinBangchuckers.java @@ -59,7 +59,7 @@ public class GoblinBangchuckers extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - // {t}: Flip a coin. If you win the flip, Goblin Bangchuckers deals 2 damage to target creature or player. If you lose the flip, Goblin Bangchuckers deals 2 damage to itself. + // {T}: Flip a coin. If you win the flip, Goblin Bangchuckers deals 2 damage to target creature or player. If you lose the flip, Goblin Bangchuckers deals 2 damage to itself. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GoblinBangchuckersEffect(), new TapSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); @@ -79,7 +79,7 @@ class GoblinBangchuckersEffect extends OneShotEffect { public GoblinBangchuckersEffect() { super(Outcome.Damage); - staticText = "{tap}: Flip a coin. If you win the flip, Goblin Bangchuckers deals 2 damage to target creature or player. If you lose the flip, Goblin Bangchuckers deals 2 damage to itself"; + staticText = "Flip a coin. If you win the flip, Goblin Bangchuckers deals 2 damage to target creature or player. If you lose the flip, Goblin Bangchuckers deals 2 damage to itself"; } public GoblinBangchuckersEffect(GoblinBangchuckersEffect effect) { diff --git a/Mage.Sets/src/mage/sets/magic2012/JaceMemoryAdept.java b/Mage.Sets/src/mage/sets/magic2012/JaceMemoryAdept.java index 58b5b0f98c3..2e687f4f8cb 100644 --- a/Mage.Sets/src/mage/sets/magic2012/JaceMemoryAdept.java +++ b/Mage.Sets/src/mage/sets/magic2012/JaceMemoryAdept.java @@ -27,24 +27,21 @@ */ package mage.sets.magic2012; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.Mode; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; -import mage.counters.CounterType; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; -import java.util.UUID; - /** * @author nantuko */ @@ -55,8 +52,7 @@ public class JaceMemoryAdept extends CardImpl { this.expansionSetCode = "M12"; this.subtype.add("Jace"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Draw a card. Target player puts the top card of his or her library into his or her graveyard. LoyaltyAbility ability1 = new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1); @@ -116,5 +112,3 @@ class JaceMemoryAdeptEffect extends DrawCardTargetEffect { return new JaceMemoryAdeptEffect(this); } } - - diff --git a/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java b/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java index 3fef0ff88fb..23ede410e11 100644 --- a/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java +++ b/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java @@ -29,23 +29,18 @@ package mage.sets.magic2012; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; +import mage.MageObject; import mage.abilities.common.BecomesTargetTriggeredAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CopyPermanentEffect; import mage.abilities.effects.common.SacrificeSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.Target; -import mage.target.TargetPermanent; import mage.util.functions.ApplyToPermanent; /** @@ -54,7 +49,31 @@ import mage.util.functions.ApplyToPermanent; */ public class PhantasmalImage extends CardImpl { - private static final String abilityText = "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains \"When this creature becomes the target of a spell or ability, sacrifice it.\""; + private static final String effectText = "a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains \"When this creature becomes the target of a spell or ability, sacrifice it.\""; + + ApplyToPermanent phantasmalImageApplier = new ApplyToPermanent() { + @Override + public Boolean apply(Game game, Permanent permanent) { + if (!permanent.getSubtype().contains("Illusion")) { + permanent.getSubtype().add("Illusion"); + } + // Add directly because the created permanent is only used to copy from, so there is no need to add the ability to e.g. TriggeredAbilities + permanent.getAbilities().add(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect())); + //permanent.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect()), game); + return true; + } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + if (!mageObject.getSubtype().contains("Illusion")) { + mageObject.getSubtype().add("Illusion"); + } + // Add directly because the created permanent is only used to copy from, so there is no need to add the ability to e.g. TriggeredAbilities + mageObject.getAbilities().add(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect())); + //permanent.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect()), game); + return true; + } + }; public PhantasmalImage(UUID ownerId) { super(ownerId, 72, "Phantasmal Image", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}"); @@ -68,9 +87,9 @@ public class PhantasmalImage extends CardImpl { // You may have Phantasmal Image enter the battlefield as a copy of any creature // on the battlefield, except it's an Illusion in addition to its other types and // it gains "When this creature becomes the target of a spell or ability, sacrifice it." - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( - new PhantasmalImageCopyEffect(), abilityText, true)); - this.addAbility(ability); + Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), phantasmalImageApplier); + effect.setText(effectText); + this.addAbility(new EntersBattlefieldAbility(effect, true)); } public PhantasmalImage(final PhantasmalImage card) { @@ -82,50 +101,3 @@ public class PhantasmalImage extends CardImpl { return new PhantasmalImage(this); } } - -class PhantasmalImageCopyEffect extends OneShotEffect { - - public PhantasmalImageCopyEffect() { - super(Outcome.Copy); - } - - public PhantasmalImageCopyEffect(final PhantasmalImageCopyEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (player != null && sourcePermanent != null) { - Target target = new TargetPermanent(new FilterCreaturePermanent("creature (you copy from)")); - target.setNotTarget(true); - if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { - player.choose(Outcome.Copy, target, source.getSourceId(), game); - Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget()); - if (copyFromPermanent != null) { - game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() { - @Override - public Boolean apply(Game game, Permanent permanent) { - if (!permanent.getSubtype().contains("Illusion")) { - permanent.getSubtype().add("Illusion"); - } - // Add directly because the created permanent is only used to copy from, so there is no need to add the ability to e.g. TriggeredAbilities - permanent.getAbilities().add(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect())); - //permanent.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect()), game); - return true; - } - }); - - return true; - } - } - } - return false; - } - - @Override - public PhantasmalImageCopyEffect copy() { - return new PhantasmalImageCopyEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java b/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java index 150a0266558..5030d6044f3 100644 --- a/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java +++ b/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java @@ -27,27 +27,28 @@ */ package mage.sets.magic2012; - -import mage.constants.*; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.SourceHasCounterCondition; import mage.abilities.decorator.ConditionalContinuousEffect; -import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.permanent.Permanent; -import java.util.UUID; - /** * * @author Loki @@ -65,8 +66,13 @@ public class PrimordialHydra extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - this.addAbility(new EntersBattlefieldAbility(new PrimordialHydraEntersEffect(), "{this} enters the battlefield with X +1/+1 counters on it")); + // Primordial Hydra enters the battlefield with X +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); + + // At the beginning of your upkeep, double the number of +1/+1 counters on Primordial Hydra. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new PrimordialHydraDoubleEffect(), TargetController.YOU, false)); + + // Primordial Hydra has trample as long as it has ten or more +1/+1 counters on it. ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), new SourceHasCounterCondition(CounterType.P1P1, 10), staticText); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); @@ -82,37 +88,8 @@ public class PrimordialHydra extends CardImpl { } } -class PrimordialHydraEntersEffect extends OneShotEffect { - public PrimordialHydraEntersEffect() { - super(Outcome.BoostCreature); - } - - public PrimordialHydraEntersEffect(final PrimordialHydraEntersEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public PrimordialHydraEntersEffect copy() { - return new PrimordialHydraEntersEffect(this); - } -} - class PrimordialHydraDoubleEffect extends OneShotEffect { + PrimordialHydraDoubleEffect() { super(Outcome.BoostCreature); staticText = "double the number of +1/+1 counters on {this}"; @@ -139,4 +116,4 @@ class PrimordialHydraDoubleEffect extends OneShotEffect { public PrimordialHydraDoubleEffect copy() { return new PrimordialHydraDoubleEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2012/Scrambleverse.java b/Mage.Sets/src/mage/sets/magic2012/Scrambleverse.java index 27b559d840f..e6b670804fc 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Scrambleverse.java +++ b/Mage.Sets/src/mage/sets/magic2012/Scrambleverse.java @@ -27,27 +27,23 @@ */ package mage.sets.magic2012; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.Random; +import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.Mode; import mage.abilities.effects.ContinuousEffect; -import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Layer; import mage.constants.Outcome; -import mage.constants.SubLayer; +import mage.constants.Rarity; import mage.filter.common.FilterNonlandPermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.PlayerList; import mage.target.targetpointer.FixedTarget; -import java.util.Random; -import java.util.UUID; - /** * * @author nantuko @@ -58,7 +54,6 @@ public class Scrambleverse extends CardImpl { super(ownerId, 153, "Scrambleverse", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{6}{R}{R}"); this.expansionSetCode = "M12"; - // For each nonland permanent, choose a player at random. Then each player gains control of each permanent for which he or she was chosen. Untap those permanents. this.getSpellAbility().addEffect(new ScrambleverseEffect()); } @@ -87,15 +82,13 @@ class ScrambleverseEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Random random = new Random(); - PlayerList players = game.getPlayerList(); + PlayerList players = game.getState().getPlayersInRange(source.getControllerId(), game); int count = players.size(); - if (count > 1) { - FilterNonlandPermanent nonLand = new FilterNonlandPermanent(); - for (Permanent permanent : game.getBattlefield().getActivePermanents(nonLand, source.getControllerId(), source.getSourceId(), game)) { - ContinuousEffect effect = new ScrambleverseControlEffect(players.get(random.nextInt(count))); - effect.setTargetPointer(new FixedTarget(permanent.getId())); - game.addEffect(effect, source); - } + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterNonlandPermanent(), source.getControllerId(), source.getSourceId(), game)) { + ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, true, players.get(random.nextInt(count))); + effect.setTargetPointer(new FixedTarget(permanent.getId())); + game.addEffect(effect, source); + permanent.untap(game); } return true; } @@ -105,37 +98,3 @@ class ScrambleverseEffect extends OneShotEffect { return new ScrambleverseEffect(this); } } - -class ScrambleverseControlEffect extends ContinuousEffectImpl { - - private UUID controllerId; - - public ScrambleverseControlEffect(UUID controllerId) { - super(Duration.EndOfGame, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); - this.controllerId = controllerId; - } - - public ScrambleverseControlEffect(final ScrambleverseControlEffect effect) { - super(effect); - this.controllerId = effect.controllerId; - } - - @Override - public ScrambleverseControlEffect copy() { - return new ScrambleverseControlEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); - if (permanent != null && controllerId != null) { - return permanent.changeControllerId(controllerId, game); - } - return false; - } - - @Override - public String getText(Mode mode) { - return "Gain control of {this}"; - } -} diff --git a/Mage.Sets/src/mage/sets/magic2012/SuturedGhoul.java b/Mage.Sets/src/mage/sets/magic2012/SuturedGhoul.java index 42a2b16593f..6f651062b5e 100644 --- a/Mage.Sets/src/mage/sets/magic2012/SuturedGhoul.java +++ b/Mage.Sets/src/mage/sets/magic2012/SuturedGhoul.java @@ -27,6 +27,7 @@ */ package mage.sets.magic2012; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; @@ -38,15 +39,19 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.constants.*; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; -import java.util.UUID; - /** * @author nantuko */ @@ -97,30 +102,32 @@ class SuturedGhoulEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player.getGraveyard().size() > 0) { - + Player controller = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); + if (permanent == null) { + return false; + } + if (controller.getGraveyard().size() > 0) { TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard")); - if (player.chooseTarget(Outcome.Benefit, target, source, game)) { + if (controller.chooseTarget(Outcome.Benefit, target, source, game)) { int count = 0; for (UUID uuid : target.getTargets()) { - Card card = player.getGraveyard().get(uuid, game); + Card card = controller.getGraveyard().get(uuid, game); if (card != null) { - card.moveToExile(getId(), "Sutured Ghoul", source.getSourceId(), game); - if (permanent != null) { - permanent.imprint(card.getId(), game); - count++; - } + card.moveToExile(getId(), permanent.getIdName(), source.getSourceId(), game); + permanent.imprint(card.getId(), game); + count++; } } + Cards cardsToExile = new CardsImpl(target.getTargets()); + controller.moveCards(cardsToExile, null, Zone.EXILED, source, game); String msg = count == 1 ? "1 card" : count + "cards"; - game.informPlayers("Sutured Ghoul: " + player.getLogName() + " exiled " + msg); + game.informPlayers(permanent.getLogName() + ": " + controller.getLogName() + " exiled " + msg); } } else { - game.informPlayers("Sutured Ghoul: No cards in graveyard."); + game.informPlayers(permanent.getLogName() + ": No cards in graveyard."); } return true; } @@ -147,7 +154,7 @@ class SuturedGhoulPowerCount implements DynamicValue { int amount = 0; Permanent permanent = game.getPermanent(sourceAbility.getSourceId()); if (permanent != null) { - for (UUID uuid: permanent.getImprinted()) { + for (UUID uuid : permanent.getImprinted()) { Card card = game.getCard(uuid); if (card != null) { amount += card.getPower().getValue(); @@ -189,7 +196,7 @@ class SuturedGhoulToughnessCount implements DynamicValue { int amount = 0; Permanent permanent = game.getPermanent(sourceAbility.getSourceId()); if (permanent != null) { - for (UUID uuid: permanent.getImprinted()) { + for (UUID uuid : permanent.getImprinted()) { Card card = game.getCard(uuid); if (card != null) { amount += card.getToughness().getValue(); @@ -214,5 +221,3 @@ class SuturedGhoulToughnessCount implements DynamicValue { return "the total toughness of the exiled cards"; } } - - diff --git a/Mage.Sets/src/mage/sets/magic2012/SwiftfootBoots.java b/Mage.Sets/src/mage/sets/magic2012/SwiftfootBoots.java index e47fb8f405e..ba46bfa6aec 100644 --- a/Mage.Sets/src/mage/sets/magic2012/SwiftfootBoots.java +++ b/Mage.Sets/src/mage/sets/magic2012/SwiftfootBoots.java @@ -25,19 +25,23 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.magic2012; import java.util.UUID; - -import mage.constants.*; +import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; /** * @@ -45,17 +49,24 @@ import mage.cards.CardImpl; */ public class SwiftfootBoots extends CardImpl { - public SwiftfootBoots (UUID ownerId) { + public SwiftfootBoots(UUID ownerId) { super(ownerId, 219, "Swiftfoot Boots", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "M12"; this.subtype.add("Equipment"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT))); + + // Equipped creature has hexproof and haste. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT)); + Effect effect = new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT); + effect.setText("and haste"); + ability.addEffect(effect); + this.addAbility(ability); + + // Equip {1} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1))); } - public SwiftfootBoots (final SwiftfootBoots card) { + public SwiftfootBoots(final SwiftfootBoots card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/magic2012/ThranGolem.java b/Mage.Sets/src/mage/sets/magic2012/ThranGolem.java index eb4d72649fe..b8e679ff356 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ThranGolem.java +++ b/Mage.Sets/src/mage/sets/magic2012/ThranGolem.java @@ -28,13 +28,9 @@ package mage.sets.magic2012; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.Condition; import mage.abilities.condition.common.EnchantedCondition; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; @@ -43,6 +39,10 @@ import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; /** * @@ -50,11 +50,6 @@ import mage.cards.CardImpl; */ public class ThranGolem extends CardImpl { - private static final String rule1 = "As long as {this} is enchanted, it gets +2/+2 "; - private static final String rule2 = "As long as {this} is enchanted, it has flying"; - private static final String rule3 = "As long as {this} is enchanted, it has first strike"; - private static final String rule4 = "As long as {this} is enchanted, it has flying trample"; - public ThranGolem(UUID ownerId) { super(ownerId, 220, "Thran Golem", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); this.expansionSetCode = "M12"; @@ -63,15 +58,18 @@ public class ThranGolem extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(3); - Condition enchanted = new EnchantedCondition(); - ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), enchanted, rule1); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect1)); - ConditionalContinuousEffect effect2 = new ConditionalContinuousEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance()), enchanted, rule2); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect2)); - ConditionalContinuousEffect effect3 = new ConditionalContinuousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()), enchanted, rule3); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect3)); - ConditionalContinuousEffect effect4 = new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), enchanted, rule4); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect4)); + // As long as Thran Golem is enchanted, it gets +2/+2 and has flying, first strike, and trample. + EnchantedCondition enchanted = new EnchantedCondition(); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), enchanted, + "As long as {this} is enchanted, it gets +2/+2")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance()), + enchanted, "and has flying")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()), + enchanted, ", first strike")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), + enchanted, ", and trample.")); + this.addAbility(ability); } public ThranGolem(final ThranGolem card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/Trollhide.java b/Mage.Sets/src/mage/sets/magic2012/Trollhide.java index 47337163b65..a62c43d19e5 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Trollhide.java +++ b/Mage.Sets/src/mage/sets/magic2012/Trollhide.java @@ -29,18 +29,23 @@ package mage.sets.magic2012; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -55,13 +60,20 @@ public class Trollhide extends CardImpl { this.expansionSetCode = "M12"; this.subtype.add("Aura"); + // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}")), AttachmentType.AURA))); + + // Enchanted creature gets +2/+2 and has "{1}{G}: Regenerate this creature." + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield)); + Effect effect = new GainAbilityAttachedEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}")), AttachmentType.AURA); + effect.setText("and has \"{1}{G}: Regenerate this creature.\""); + ability.addEffect(effect); + this.addAbility(ability); } public Trollhide (final Trollhide card) { diff --git a/Mage.Sets/src/mage/sets/magic2013/AjaniCallerOfThePride.java b/Mage.Sets/src/mage/sets/magic2013/AjaniCallerOfThePride.java index 9c4305c3bef..43b20bce5ec 100644 --- a/Mage.Sets/src/mage/sets/magic2013/AjaniCallerOfThePride.java +++ b/Mage.Sets/src/mage/sets/magic2013/AjaniCallerOfThePride.java @@ -28,16 +28,14 @@ package mage.sets.magic2013; import java.util.UUID; -import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.dynamicvalue.common.ControllerLifeCount; import mage.abilities.effects.Effect; import mage.abilities.effects.Effects; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.DoubleStrikeAbility; import mage.abilities.keyword.FlyingAbility; @@ -46,7 +44,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.counters.CounterType; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.CatToken; import mage.target.common.TargetCreaturePermanent; /** @@ -64,12 +62,12 @@ public class AjaniCallerOfThePride extends CardImpl { @Override public void build() { - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Put a +1/+1 counter on up to one target creature. Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); effect.setText("Put a +1/+1 counter on up to one target creature"); Ability ability = new LoyaltyAbility(effect, 1); - ability.addTarget(new TargetCreaturePermanent(0,1)); + ability.addTarget(new TargetCreaturePermanent(0, 1)); this.addAbility(ability); // -3: Target creature gains flying and double strike until end of turn. Effects effects = new Effects(); @@ -91,15 +89,3 @@ public class AjaniCallerOfThePride extends CardImpl { return new AjaniCallerOfThePride(this); } } - -class CatToken extends Token { - - public CatToken() { - super("Cat", "2/2 white Cat creature tokens"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Cat"); - power = new MageInt(2); - toughness = new MageInt(2); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2013/AugurOfBolas.java b/Mage.Sets/src/mage/sets/magic2013/AugurOfBolas.java index dd963cf2758..7f1084a1331 100644 --- a/Mage.Sets/src/mage/sets/magic2013/AugurOfBolas.java +++ b/Mage.Sets/src/mage/sets/magic2013/AugurOfBolas.java @@ -28,16 +28,27 @@ package mage.sets.magic2013; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.dynamicvalue.common.StaticValue; -import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; +import mage.filter.common.FilterInstantOrSorceryCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetCard; /** * @@ -46,6 +57,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate; public class AugurOfBolas extends CardImpl { private static final FilterCard filter = new FilterCard("an instant or sorcery card"); + static { filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY))); } @@ -60,7 +72,7 @@ public class AugurOfBolas extends CardImpl { this.toughness = new MageInt(3); // When Augur of Bolas enters the battlefield, look at the top three cards of your library. You may reveal an instant or sorcery card from among them and put it into your hand. Put the rest on the bottom of your library in any order. - this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect(new StaticValue(3), false, new StaticValue(1), filter, false, true))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new AugurOfBolasEffect())); } public AugurOfBolas(final AugurOfBolas card) { @@ -72,3 +84,54 @@ public class AugurOfBolas extends CardImpl { return new AugurOfBolas(this); } } + +class AugurOfBolasEffect extends OneShotEffect { + + public AugurOfBolasEffect() { + super(Outcome.DrawCard); + this.staticText = "look at the top three cards of your library. You may reveal an instant or sorcery card from among them and put it into your hand. Put the rest on the bottom of your library in any order"; + } + + public AugurOfBolasEffect(final AugurOfBolasEffect effect) { + super(effect); + } + + @Override + public AugurOfBolasEffect copy() { + return new AugurOfBolasEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + Cards topCards = new CardsImpl(); + topCards.addAll(controller.getLibrary().getTopCards(game, 3)); + if (!topCards.isEmpty()) { + controller.lookAtCards(sourceObject.getIdName(), topCards, game); + int number = topCards.count(new FilterInstantOrSorceryCard(), source.getSourceId(), source.getControllerId(), game); + if (number > 0) { + if (controller.chooseUse(outcome, "Reveal an instant or sorcery card from the looked at cards and put it into your hand?", source, game)) { + Card card = null; + if (number == 1) { + card = topCards.getCards(new FilterInstantOrSorceryCard(), source.getSourceId(), source.getControllerId(), game).iterator().next(); + } else { + Target target = new TargetCard(Zone.LIBRARY, new FilterInstantOrSorceryCard()); + controller.chooseTarget(outcome, target, source, game); + card = topCards.get(target.getFirstTarget(), game); + } + if (card != null) { + controller.moveCards(card, null, Zone.HAND, source, game); + controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); + topCards.remove(card); + } + } + controller.putCardsOnBottomOfLibrary(topCards, game, source, true); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/magic2013/BoundlessRealms.java b/Mage.Sets/src/mage/sets/magic2013/BoundlessRealms.java index 9896e6a5422..922f1e1f5fa 100644 --- a/Mage.Sets/src/mage/sets/magic2013/BoundlessRealms.java +++ b/Mage.Sets/src/mage/sets/magic2013/BoundlessRealms.java @@ -28,21 +28,20 @@ package mage.sets.magic2013; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; -import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCardInLibrary; @@ -56,7 +55,6 @@ public class BoundlessRealms extends CardImpl { super(ownerId, 162, "Boundless Realms", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{6}{G}"); this.expansionSetCode = "M13"; - // Search your library for up to X basic land cards, where X is the number of lands you control, and put them onto the battlefield tapped. Then shuffle your library. this.getSpellAbility().addEffect(new BoundlessRealmsEffect()); } @@ -89,32 +87,19 @@ class BoundlessRealmsEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } FilterLandPermanent filter = new FilterLandPermanent(); filter.add(new ControllerPredicate(TargetController.YOU)); int amount = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this); TargetCardInLibrary target = new TargetCardInLibrary(0, amount, new FilterBasicLandCard()); - - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { - return false; + if (controller.searchLibrary(target, game)) { + controller.moveCards(new CardsImpl(target.getTargets()).getCards(game), Zone.BATTLEFIELD, source, game, true, false, false, null); } - - if (player.searchLibrary(target, game)) { - for (UUID cardId : target.getTargets()) { - Card card = player.getLibrary().getCard(cardId, game); - if (card != null) { - if (card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId())) { - Permanent permanent = game.getPermanent(card.getId()); - if (permanent != null) { - permanent.setTapped(true); - } - } - } - } - } - - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return true; } } diff --git a/Mage.Sets/src/mage/sets/magic2013/Encrust.java b/Mage.Sets/src/mage/sets/magic2013/Encrust.java index 42e2c085d83..8eb28f4fb20 100644 --- a/Mage.Sets/src/mage/sets/magic2013/Encrust.java +++ b/Mage.Sets/src/mage/sets/magic2013/Encrust.java @@ -50,9 +50,9 @@ import mage.target.TargetPermanent; * @author jeffwadsworth */ public class Encrust extends CardImpl { - + private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); - + static { filter.add(Predicates.or( new CardTypePredicate(CardType.CREATURE), @@ -71,9 +71,9 @@ public class Encrust extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - + // Enchanted permanent doesn't untap during its controller's untap step and its activated abilities can't be activated. - ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect()); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect("permanent")); Effect effect = new CantActivateAbilitiesAttachedEffect(); effect.setText("and its activated abilities can't be activated"); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/sets/magic2013/LilianaOfTheDarkRealms.java b/Mage.Sets/src/mage/sets/magic2013/LilianaOfTheDarkRealms.java index b706cc764c0..2ae1156c849 100644 --- a/Mage.Sets/src/mage/sets/magic2013/LilianaOfTheDarkRealms.java +++ b/Mage.Sets/src/mage/sets/magic2013/LilianaOfTheDarkRealms.java @@ -28,6 +28,18 @@ package mage.sets.magic2013; import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.GetEmblemEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -36,20 +48,6 @@ import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.TargetController; import mage.constants.Zone; -import mage.Mana; -import mage.abilities.Ability; -import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.common.GetEmblemEffect; -import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; -import mage.abilities.mana.SimpleManaAbility; -import mage.cards.CardImpl; -import mage.counters.CounterType; import mage.filter.common.FilterLandCard; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -78,8 +76,7 @@ public class LilianaOfTheDarkRealms extends CardImpl { this.expansionSetCode = "M13"; this.subtype.add("Liliana"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +1: Search your library for a Swamp card, reveal it, and put it into your hand. Then shuffle your library. this.addAbility(new LoyaltyAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true), 1)); diff --git a/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java b/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java index a6f7b79e94e..ef64887d860 100644 --- a/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java +++ b/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java @@ -29,7 +29,7 @@ package mage.sets.magic2013; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.AttacksAloneTriggeredAbility; import mage.abilities.effects.common.SacrificeEffect; import mage.abilities.keyword.ExaltedAbility; import mage.abilities.keyword.FlyingAbility; @@ -37,12 +37,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.target.targetpointer.FixedTarget; +import mage.filter.common.FilterControlledCreaturePermanent; /** * @@ -64,7 +59,8 @@ public class NefaroxOverlordOfGrixis extends CardImpl { // Exalted this.addAbility(new ExaltedAbility()); // Whenever Nefarox, Overlord of Grixis attacks alone, defending player sacrifices a creature. - this.addAbility(new NefaroxOverlordOfGrixisTriggeredAbility()); + this.addAbility(new AttacksAloneTriggeredAbility(new SacrificeEffect( + new FilterControlledCreaturePermanent("a creature"), 1, "defending player"))); } public NefaroxOverlordOfGrixis(final NefaroxOverlordOfGrixis card) { @@ -76,52 +72,3 @@ public class NefaroxOverlordOfGrixis extends CardImpl { return new NefaroxOverlordOfGrixis(this); } } - -class NefaroxOverlordOfGrixisTriggeredAbility extends TriggeredAbilityImpl { - - private static final FilterControlledPermanent filter; - - static { - filter = new FilterControlledPermanent(" a creature"); - filter.add(new CardTypePredicate(CardType.CREATURE)); - } - - public NefaroxOverlordOfGrixisTriggeredAbility() { - super(Zone.BATTLEFIELD, new SacrificeEffect(filter, 1, "defending player")); - } - - public NefaroxOverlordOfGrixisTriggeredAbility(final NefaroxOverlordOfGrixisTriggeredAbility ability) { - super(ability); - } - - @Override - public NefaroxOverlordOfGrixisTriggeredAbility copy() { - return new NefaroxOverlordOfGrixisTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.DECLARED_ATTACKERS; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (game.getActivePlayerId().equals(this.controllerId) ) { - UUID nefarox = this.getSourceId(); - if (nefarox != null) { - if (game.getCombat().attacksAlone() && nefarox == game.getCombat().getAttackers().get(0)) { - UUID defender = game.getCombat().getDefenderId(nefarox); - this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); - return true; - } - } - } - return false; - } - - @Override - public String getRule() { - return "Whenever {this} attacks alone, defending player sacrifices a creature."; - } - -} diff --git a/Mage.Sets/src/mage/sets/magic2013/RoaringPrimadox.java b/Mage.Sets/src/mage/sets/magic2013/RoaringPrimadox.java index f2a2062eb01..5ed8a2f9894 100644 --- a/Mage.Sets/src/mage/sets/magic2013/RoaringPrimadox.java +++ b/Mage.Sets/src/mage/sets/magic2013/RoaringPrimadox.java @@ -28,22 +28,14 @@ package mage.sets.magic2013; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.OnEventTriggeredAbility; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.common.FilterControlledCreaturePermanent; -import mage.game.Game; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.common.TargetControlledCreaturePermanent; /** * diff --git a/Mage.Sets/src/mage/sets/magic2013/Spelltwine.java b/Mage.Sets/src/mage/sets/magic2013/Spelltwine.java index b37080dda6b..a0cb37881f4 100644 --- a/Mage.Sets/src/mage/sets/magic2013/Spelltwine.java +++ b/Mage.Sets/src/mage/sets/magic2013/Spelltwine.java @@ -28,14 +28,14 @@ package mage.sets.magic2013; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileSpellEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; @@ -68,7 +68,6 @@ public class Spelltwine extends CardImpl { super(ownerId, 68, "Spelltwine", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{U}"); this.expansionSetCode = "M13"; - // Exile target instant or sorcery card from your graveyard and target instant or sorcery card from an opponent's graveyard. Copy those cards. Cast the copies if able without paying their mana costs. Exile Spelltwine. this.getSpellAbility().addEffect(new SpelltwineEffect()); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); @@ -105,10 +104,10 @@ class SpelltwineEffect extends OneShotEffect { Card cardTwo = game.getCard(source.getTargets().get(1).getFirstTarget()); if (controller != null) { if (cardOne != null) { - controller.moveCardToExileWithInfo(cardOne, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true); + controller.moveCards(cardOne, Zone.EXILED, source, game); } if (cardTwo != null) { - controller.moveCardToExileWithInfo(cardTwo, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true); + controller.moveCards(cardTwo, Zone.EXILED, source, game); } boolean castCardOne = true; if (cardOne != null && controller.chooseUse(Outcome.Neutral, "Cast the copy of " + cardOne.getName() + " first?", source, game)) { diff --git a/Mage.Sets/src/mage/sets/magic2013/TradingPost.java b/Mage.Sets/src/mage/sets/magic2013/TradingPost.java index 2b933e21b2d..07f0f0fab5a 100644 --- a/Mage.Sets/src/mage/sets/magic2013/TradingPost.java +++ b/Mage.Sets/src/mage/sets/magic2013/TradingPost.java @@ -28,11 +28,6 @@ package mage.sets.magic2013; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; -import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.DiscardTargetCost; @@ -45,11 +40,13 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterArtifactCard; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.permanent.token.Token; +import mage.filter.common.FilterControlledArtifactPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.permanent.token.GoatToken; import mage.target.common.TargetCardInGraveyard; import mage.target.common.TargetCardInHand; import mage.target.common.TargetControlledPermanent; @@ -59,14 +56,6 @@ import mage.target.common.TargetControlledPermanent; * @author jeffwadsworth */ public class TradingPost extends CardImpl { - - final static FilterControlledPermanent filter = new FilterControlledPermanent("creature"); - final static FilterControlledPermanent filter2 = new FilterControlledPermanent("artifact"); - - static { - filter.add(new CardTypePredicate(CardType.CREATURE)); - filter2.add(new CardTypePredicate(CardType.ARTIFACT)); - } public TradingPost(UUID ownerId) { super(ownerId, 220, "Trading Post", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); @@ -77,26 +66,26 @@ public class TradingPost extends CardImpl { ability1.addCost(new TapSourceCost()); ability1.addCost(new DiscardTargetCost(new TargetCardInHand())); this.addAbility(ability1); - + // {1}, {tap}, Pay 1 life: Put a 0/1 white Goat creature token onto the battlefield. Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new GoatToken()), new GenericManaCost(1)); ability2.addCost(new TapSourceCost()); ability2.addCost(new PayLifeCost(1)); this.addAbility(ability2); - + // {1}, {tap}, Sacrifice a creature: Return target artifact card from your graveyard to your hand. Ability ability3 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToHandTargetEffect(), new GenericManaCost(1)); - ability3.addTarget(new TargetCardInGraveyard(new FilterArtifactCard("artifact card in your graveyard"))); + ability3.addTarget(new TargetCardInGraveyard(new FilterArtifactCard("an artifact card in your graveyard"))); ability3.addCost(new TapSourceCost()); - ability3.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + ability3.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledCreaturePermanent("a creature")))); this.addAbility(ability3); - + // {1}, {tap}, Sacrifice an artifact: Draw a card. Ability ability4 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(1)); ability4.addCost(new TapSourceCost()); - ability4.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter2))); + ability4.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact")))); this.addAbility(ability4); - + } public TradingPost(final TradingPost card) { @@ -108,15 +97,3 @@ public class TradingPost extends CardImpl { return new TradingPost(this); } } - -class GoatToken extends Token { - public GoatToken() { - super("Goat", "a 0/1 white Goat creature token"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Goat"); - power = new MageInt(0); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/magic2014/AjanisChosen.java b/Mage.Sets/src/mage/sets/magic2014/AjanisChosen.java index 62e2921c40a..fbf9d88f792 100644 --- a/Mage.Sets/src/mage/sets/magic2014/AjanisChosen.java +++ b/Mage.Sets/src/mage/sets/magic2014/AjanisChosen.java @@ -29,7 +29,6 @@ package mage.sets.magic2014; import java.util.UUID; import mage.MageInt; -import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -39,10 +38,10 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SetTargetPointer; import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterControlledEnchantmentPermanent; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.game.permanent.token.CatToken; import mage.game.permanent.token.Token; import mage.players.Player; @@ -52,11 +51,6 @@ import mage.players.Player; */ public class AjanisChosen extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent(); - static { - filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); - } - public AjanisChosen(UUID ownerId) { super(ownerId, 2, "Ajani's Chosen", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); this.expansionSetCode = "M14"; @@ -68,7 +62,7 @@ public class AjanisChosen extends CardImpl { // Whenever an enchantment enters the battlefield under your control, put a 2/2 white Cat creature token onto the battlefield. If that enchantment is an Aura, you may attach it to the token. this.addAbility(new EntersBattlefieldAllTriggeredAbility( - Zone.BATTLEFIELD, new AjanisChosenEffect(), filter, false, SetTargetPointer.PERMANENT, + Zone.BATTLEFIELD, new AjanisChosenEffect(), new FilterControlledEnchantmentPermanent(), false, SetTargetPointer.PERMANENT, "Whenever an enchantment enters the battlefield under your control, put a 2/2 white Cat creature token onto the battlefield. If that enchantment is an Aura, you may attach it to the token")); } @@ -84,7 +78,6 @@ public class AjanisChosen extends CardImpl { class AjanisChosenEffect extends OneShotEffect { - public AjanisChosenEffect() { super(Outcome.PutCreatureInPlay); staticText = "put a 2/2 white Cat creature token onto the battlefield. If that enchantment is an Aura, you may attach it to the token"; @@ -101,19 +94,22 @@ class AjanisChosenEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Token token = new CatToken(); - if(token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())){ - Player player = game.getPlayer(source.getControllerId()); - Permanent enchantement = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - Permanent tokenPermanent = game.getPermanent(token.getLastAddedToken()); - if(player != null && enchantement != null && tokenPermanent != null && enchantement.getSubtype().contains("Aura")) - { - Permanent oldCreature = game.getPermanent(enchantement.getAttachedTo()); - - if(oldCreature != null && enchantement.getSpellAbility().getTargets().get(0).canTarget(tokenPermanent.getId(), game) && player.chooseUse(Outcome.Neutral, "Attach " + enchantement.getName() + " to the token ?", source, game)) - { - if(oldCreature.removeAttachment(enchantement.getId(), game)){ - tokenPermanent.addAttachment(enchantement.getId(), game); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Token token = new CatToken(); + if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { + Permanent enchantment = game.getPermanent(this.getTargetPointer().getFirst(game, source)); + if (enchantment != null && enchantment.getSubtype().contains("Aura")) { + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + Permanent oldCreature = game.getPermanent(enchantment.getAttachedTo()); + if (oldCreature != null && enchantment.getSpellAbility().getTargets().get(0).canTarget(tokenPermanent.getId(), game) && controller.chooseUse(Outcome.Neutral, "Attach " + enchantment.getName() + " to the token ?", source, game)) { + if (oldCreature.removeAttachment(enchantment.getId(), game)) { + tokenPermanent.addAttachment(enchantment.getId(), game); + } + } + } } } } @@ -123,16 +119,3 @@ class AjanisChosenEffect extends OneShotEffect { } } - - -class CatToken extends Token { - public CatToken() { - super("Cat", "2/2 white Cat creature token"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Cat"); - power = new MageInt(2); - toughness = new MageInt(2); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2014/ChandraPyromaster.java b/Mage.Sets/src/mage/sets/magic2014/ChandraPyromaster.java index 1ce15ed3de0..25de8f9d80e 100644 --- a/Mage.Sets/src/mage/sets/magic2014/ChandraPyromaster.java +++ b/Mage.Sets/src/mage/sets/magic2014/ChandraPyromaster.java @@ -33,12 +33,11 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.combat.CantBlockTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; @@ -49,7 +48,6 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterInstantOrSorceryCard; import mage.game.Game; @@ -74,8 +72,7 @@ public class ChandraPyromaster extends CardImpl { this.expansionSetCode = "M14"; this.subtype.add("Chandra"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Chandra, Pyromaster deals 1 damage to target player and 1 damage to up to one target creature that player controls. That creature can't block this turn. LoyaltyAbility ability1 = new LoyaltyAbility(new ChandraPyromasterEffect1(), 1); @@ -215,7 +212,7 @@ class ChandraPyromasterEffect2 extends OneShotEffect { Card card = library.removeFromTop(game); if (card != null) { controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName() + " ", source.getSourceId(), game, Zone.LIBRARY, true); - ContinuousEffect effect = new ChandraPyromasterCastFromExileEffect(); + ContinuousEffect effect = new ChandraPyromasterCastFromExileEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); } @@ -273,36 +270,31 @@ class ChandraPyromasterEffect3 extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player you = game.getPlayer(source.getControllerId()); - if (you == null) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller == null || sourceObject == null) { return false; } Cards cards = new CardsImpl(); - int max = Math.min(you.getLibrary().size(), 10); - for (int i = 0; i < max; i++) { - Card card = you.getLibrary().removeFromTop(game); - if (card != null) { - card.moveToExile(source.getSourceId(), "Chandra Pyromaster", source.getSourceId(), game); - cards.add(card); - } - } + cards.addAll(controller.getLibrary().getTopCards(game, 10)); + controller.moveCardsToExile(cards.getCards(game), source, game, true, source.getSourceId(), sourceObject.getIdName()); if (cards.getCards(new FilterInstantOrSorceryCard(), game).size() > 0) { TargetCard target = new TargetCard(Zone.EXILED, new FilterInstantOrSorceryCard()); - if (you.chooseTarget(Outcome.PlayForFree, cards, target, source, game)) { + if (controller.chooseTarget(Outcome.PlayForFree, cards, target, source, game)) { Card card = cards.get(target.getFirstTarget(), game); if (card != null) { - Card copy1 = card.copy(); - Card copy2 = card.copy(); - Card copy3 = card.copy(); - if (copy1 != null && you.chooseUse(outcome, "Do you wish to cast copy 1 of " + card.getName(), source, game)) { - you.cast(copy1.getSpellAbility(), game, true); + if (controller.chooseUse(outcome, "Do you wish to cast copy 1 of " + card.getName(), source, game)) { + Card copy1 = card.copy(); + controller.cast(copy1.getSpellAbility(), game, true); } - if (copy2 != null && you.chooseUse(outcome, "Do you wish to cast copy 2 of " + card.getName(), source, game)) { - you.cast(copy2.getSpellAbility(), game, true); + if (controller.chooseUse(outcome, "Do you wish to cast copy 2 of " + card.getName(), source, game)) { + Card copy2 = card.copy(); + controller.cast(copy2.getSpellAbility(), game, true); } - if (copy3 != null && you.chooseUse(outcome, "Do you wish to cast copy 3 of " + card.getName(), source, game)) { - you.cast(copy3.getSpellAbility(), game, true); + if (controller.chooseUse(outcome, "Do you wish to cast copy 3 of " + card.getName(), source, game)) { + Card copy3 = card.copy(); + controller.cast(copy3.getSpellAbility(), game, true); } return true; } diff --git a/Mage.Sets/src/mage/sets/magic2014/DevoutInvocation.java b/Mage.Sets/src/mage/sets/magic2014/DevoutInvocation.java index 3f71b0c0a72..9dc699f772c 100644 --- a/Mage.Sets/src/mage/sets/magic2014/DevoutInvocation.java +++ b/Mage.Sets/src/mage/sets/magic2014/DevoutInvocation.java @@ -55,10 +55,9 @@ public class DevoutInvocation extends CardImpl { super(ownerId, 16, "Devout Invocation", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{6}{W}"); this.expansionSetCode = "M14"; - // Tap any number of untapped creatures you control. Put a 4/4 white Angel creature token with flying onto the battlefield for each creature tapped this way. this.getSpellAbility().addEffect(new DevoutInvocationEffect()); - + } public DevoutInvocation(final DevoutInvocation card) { @@ -72,9 +71,9 @@ public class DevoutInvocation extends CardImpl { } class DevoutInvocationEffect extends OneShotEffect { - + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creatures you control"); - + static { filter.add(Predicates.not(new TappedPredicate())); } @@ -93,7 +92,7 @@ class DevoutInvocationEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int tappedAmount = 0; - TargetPermanent target = new TargetPermanent(0,1,filter, false); + TargetPermanent target = new TargetPermanent(0, 1, filter, false); while (true && controller.canRespond()) { target.clearChosen(); if (target.canChoose(source.getControllerId(), game)) { @@ -109,15 +108,13 @@ class DevoutInvocationEffect extends OneShotEffect { } else { break; } - } - else { + } else { break; } } if (tappedAmount > 0) { AngelToken angelToken = new AngelToken(); angelToken.putOntoBattlefield(tappedAmount, game, source.getSourceId(), source.getControllerId()); - game.informPlayers(new StringBuilder(controller.getLogName()).append(" puts ").append(tappedAmount).append(" token").append(tappedAmount != 1 ?"s":"").append(" onto the battlefield").toString()); } return true; } diff --git a/Mage.Sets/src/mage/sets/magic2014/DoorOfDestinies.java b/Mage.Sets/src/mage/sets/magic2014/DoorOfDestinies.java index 5bc3c1c2891..d1aab901884 100644 --- a/Mage.Sets/src/mage/sets/magic2014/DoorOfDestinies.java +++ b/Mage.Sets/src/mage/sets/magic2014/DoorOfDestinies.java @@ -33,12 +33,9 @@ import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseCreatureTypeEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; -import mage.cards.repository.CardRepository; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -57,7 +54,6 @@ import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; -import mage.players.Player; /** * @@ -70,7 +66,8 @@ public class DoorOfDestinies extends CardImpl { this.expansionSetCode = "M14"; // As Door of Destinies enters the battlefield, choose a creature type. - this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.BoostCreature))); + // Whenever you cast a spell of the chosen type, put a charge counter on Door of Destinies. this.addAbility(new AddCounterAbility()); // Creatures you control of the chosen type get +1/+1 for each charge counter on Door of Destinies. @@ -87,44 +84,6 @@ public class DoorOfDestinies extends CardImpl { } } -class ChooseCreatureTypeEffect extends OneShotEffect { - - public ChooseCreatureTypeEffect() { - super(Outcome.BoostCreature); - staticText = "choose a creature type"; - } - - public ChooseCreatureTypeEffect(final ChooseCreatureTypeEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose creature type"); - typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); - while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { - if (!player.canRespond()) { - return false; - } - } - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice()); - game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice()); - permanent.addInfo("chosen type", "Chosen type: " + typeChoice.getChoice().toString() + "", game); - } - return false; - } - - @Override - public ChooseCreatureTypeEffect copy() { - return new ChooseCreatureTypeEffect(this); - } - -} - class AddCounterAbility extends TriggeredAbilityImpl { public AddCounterAbility() { @@ -155,7 +114,7 @@ class AddCounterAbility extends TriggeredAbilityImpl { filter.add(new ControllerPredicate(TargetController.YOU)); filter.add(new SubtypePredicate(subtype)); Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && filter.match(spell, controllerId, game)) { + if (spell != null && filter.match(spell, getSourceId(), getControllerId(), game)) { return true; } } @@ -169,7 +128,6 @@ class AddCounterAbility extends TriggeredAbilityImpl { } } - class BoostCreatureEffectEffect extends ContinuousEffectImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); @@ -194,7 +152,7 @@ class BoostCreatureEffectEffect extends ContinuousEffectImpl { if (permanent != null) { String subtype = (String) game.getState().getValue(permanent.getId() + "_type"); if (subtype != null) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { if (perm.hasSubtype(subtype)) { int boost = permanent.getCounters().getCount(CounterType.CHARGE); perm.addPower(boost); diff --git a/Mage.Sets/src/mage/sets/magic2014/GarrukCallerOfBeasts.java b/Mage.Sets/src/mage/sets/magic2014/GarrukCallerOfBeasts.java index 6cf8ee79c45..4784c9168fa 100644 --- a/Mage.Sets/src/mage/sets/magic2014/GarrukCallerOfBeasts.java +++ b/Mage.Sets/src/mage/sets/magic2014/GarrukCallerOfBeasts.java @@ -31,20 +31,18 @@ import java.util.UUID; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect; import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterSpell; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -69,11 +67,10 @@ public class GarrukCallerOfBeasts extends CardImpl { this.expansionSetCode = "M14"; this.subtype.add("Garruk"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Reveal the top 5 cards of your library. Put all creature cards revealed this way into your hand and the rest on the bottom of your library in any order. - this.addAbility(new LoyaltyAbility(new RevealLibraryPutIntoHandEffect(5, new FilterCreatureCard("all creature cards"),true), 1)); + this.addAbility(new LoyaltyAbility(new RevealLibraryPutIntoHandEffect(5, new FilterCreatureCard("all creature cards"), true), 1)); // -3: You may put a green creature card from your hand onto the battlefield. this.addAbility(new LoyaltyAbility(new PutPermanentOnBattlefieldEffect(filterGreenCreature), -3)); @@ -94,18 +91,20 @@ public class GarrukCallerOfBeasts extends CardImpl { } /** - * Emblem: "Whenever you cast a creature spell, you may search your library for a creature card, put it onto the battlefield, then shuffle your library." + * Emblem: "Whenever you cast a creature spell, you may search your library for + * a creature card, put it onto the battlefield, then shuffle your library." */ class GarrukCallerOfBeastsEmblem extends Emblem { private static final FilterSpell filter = new FilterSpell("a creature spell"); + static { filter.add(new CardTypePredicate(CardType.CREATURE)); } public GarrukCallerOfBeastsEmblem() { this.setName("EMBLEM: Garruk, Caller of Beasts"); - Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterCreatureCard("creature card")),false, true, Outcome.PutCreatureInPlay); + Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterCreatureCard("creature card")), false, true, Outcome.PutCreatureInPlay); Ability ability = new SpellCastControllerTriggeredAbility(Zone.COMMAND, effect, filter, true, false); this.getAbilities().add(ability); } diff --git a/Mage.Sets/src/mage/sets/magic2014/HiveStirrings.java b/Mage.Sets/src/mage/sets/magic2014/HiveStirrings.java index 2d378cc5167..9f9a6a6f027 100644 --- a/Mage.Sets/src/mage/sets/magic2014/HiveStirrings.java +++ b/Mage.Sets/src/mage/sets/magic2014/HiveStirrings.java @@ -28,12 +28,11 @@ package mage.sets.magic2014; import java.util.UUID; -import mage.MageInt; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SliverToken; /** * @@ -45,10 +44,8 @@ public class HiveStirrings extends CardImpl { super(ownerId, 21, "Hive Stirrings", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); this.expansionSetCode = "M14"; - // Put two 1/1 colorless Sliver creature tokens onto the battlefield. this.getSpellAbility().addEffect(new CreateTokenEffect(new SliverToken(), 2)); - } public HiveStirrings(final HiveStirrings card) { @@ -60,13 +57,3 @@ public class HiveStirrings extends CardImpl { return new HiveStirrings(this); } } - -class SliverToken extends Token { - SliverToken() { - super("Sliver", "a 1/1 colorless Sliver creature token"); - cardType.add(CardType.CREATURE); - subtype.add("Sliver"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2014/ImposingSovereign.java b/Mage.Sets/src/mage/sets/magic2014/ImposingSovereign.java index 0a7c07a1299..fc3aca583e9 100644 --- a/Mage.Sets/src/mage/sets/magic2014/ImposingSovereign.java +++ b/Mage.Sets/src/mage/sets/magic2014/ImposingSovereign.java @@ -39,6 +39,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -58,7 +59,7 @@ public class ImposingSovereign extends CardImpl { // Creatures your opponents control enter the battlefield tapped. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ImposingSovereignEffect())); - + } public ImposingSovereign(final ImposingSovereign card) { @@ -72,7 +73,7 @@ public class ImposingSovereign extends CardImpl { } class ImposingSovereignEffect extends ReplacementEffectImpl { - + ImposingSovereignEffect() { super(Duration.WhileOnBattlefield, Outcome.Tap); staticText = "Creatures your opponents control enter the battlefield tapped"; @@ -84,7 +85,7 @@ class ImposingSovereignEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent target = game.getPermanent(event.getTargetId()); + Permanent target = ((EntersTheBattlefieldEvent) event).getTarget(); if (target != null) { target.tap(game); } @@ -95,11 +96,11 @@ class ImposingSovereignEffect extends ReplacementEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { - Permanent permanent = game.getPermanent(event.getTargetId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { return true; } diff --git a/Mage.Sets/src/mage/sets/magic2014/MaraudingMaulhorn.java b/Mage.Sets/src/mage/sets/magic2014/MaraudingMaulhorn.java index a43e8d31670..7a36230e0cb 100644 --- a/Mage.Sets/src/mage/sets/magic2014/MaraudingMaulhorn.java +++ b/Mage.Sets/src/mage/sets/magic2014/MaraudingMaulhorn.java @@ -29,7 +29,6 @@ package mage.sets.magic2014; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalRequirementEffect; import mage.abilities.effects.Effect; @@ -38,7 +37,6 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.NamePredicate; @@ -47,8 +45,9 @@ import mage.filter.predicate.mageobject.NamePredicate; * @author jeffwadsworth */ public class MaraudingMaulhorn extends CardImpl { - - private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature named Advocate of the Beast"); + + private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature named Advocate of the Beast"); + static { filter.add(new NamePredicate("Advocate of the Beast")); } @@ -66,9 +65,6 @@ public class MaraudingMaulhorn extends CardImpl { new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield, true), new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 1)); effect.setText("{this} attacks each combat if able unless you control a creature named Advocate of the Beast"); - - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); - } public MaraudingMaulhorn(final MaraudingMaulhorn card) { diff --git a/Mage.Sets/src/mage/sets/magic2014/MasterOfDiversion.java b/Mage.Sets/src/mage/sets/magic2014/MasterOfDiversion.java index 3c7072088f9..2503b681a8f 100644 --- a/Mage.Sets/src/mage/sets/magic2014/MasterOfDiversion.java +++ b/Mage.Sets/src/mage/sets/magic2014/MasterOfDiversion.java @@ -33,7 +33,6 @@ import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; -import mage.constants.AbilityType; import mage.constants.CardType; import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; @@ -47,6 +46,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class MasterOfDiversion extends CardImpl { + private final UUID originalId; + public MasterOfDiversion(UUID ownerId) { super(ownerId, 24, "Master of Diversion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.expansionSetCode = "M14"; @@ -59,17 +60,19 @@ public class MasterOfDiversion extends CardImpl { // Whenever Master of Diversion attacks, tap target creature defending player controls. Ability ability = new AttacksTriggeredAbility(new TapTargetEffect(), false); ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls"))); + originalId = ability.getOriginalId(); this.addAbility(ability); } public MasterOfDiversion(final MasterOfDiversion card) { super(card); + this.originalId = card.originalId; } @Override public void adjustTargets(Ability ability, Game game) { - if (ability.getAbilityType().equals(AbilityType.TRIGGERED)) { + if (ability.getOriginalId().equals(originalId)) { ability.getTargets().clear(); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId()); diff --git a/Mage.Sets/src/mage/sets/magic2014/RiseOfTheDarkRealms.java b/Mage.Sets/src/mage/sets/magic2014/RiseOfTheDarkRealms.java index 8b84ffb6124..4fbe776a8c5 100644 --- a/Mage.Sets/src/mage/sets/magic2014/RiseOfTheDarkRealms.java +++ b/Mage.Sets/src/mage/sets/magic2014/RiseOfTheDarkRealms.java @@ -27,6 +27,8 @@ */ package mage.sets.magic2014; +import java.util.LinkedHashSet; +import java.util.Set; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; @@ -49,7 +51,6 @@ public class RiseOfTheDarkRealms extends CardImpl { super(ownerId, 111, "Rise of the Dark Realms", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{7}{B}{B}"); this.expansionSetCode = "M14"; - // Put all creature cards from all graveyards onto the battlefield under your control. this.getSpellAbility().addEffect(new RiseOfTheDarkRealmsEffect()); } @@ -78,17 +79,23 @@ class RiseOfTheDarkRealmsEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - for (UUID playerId: controller.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { - for (Card card: player.getGraveyard().getCards(game)) { - if (card.getCardType().contains(CardType.CREATURE)) { - card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId()); + if (controller != null) { + + Set creatureCards = new LinkedHashSet<>(); + for (UUID playerId : controller.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + for (Card card : player.getGraveyard().getCards(game)) { + if (card.getCardType().contains(CardType.CREATURE)) { + creatureCards.add(card); + } } } } + controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, true, null); + return true; } - return true; + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/magic2014/SavageSummoning.java b/Mage.Sets/src/mage/sets/magic2014/SavageSummoning.java index fc7db630f25..3f129598184 100644 --- a/Mage.Sets/src/mage/sets/magic2014/SavageSummoning.java +++ b/Mage.Sets/src/mage/sets/magic2014/SavageSummoning.java @@ -50,6 +50,7 @@ import mage.constants.WatcherScope; import mage.counters.CounterType; import mage.game.Game; import mage.game.command.Commander; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -314,7 +315,7 @@ class SavageSummoningEntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getTargetId()); + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); if (creature != null) { creature.addCounters(CounterType.P1P1.createInstance(), game); } diff --git a/Mage.Sets/src/mage/sets/magic2014/ShadowbornDemon.java b/Mage.Sets/src/mage/sets/magic2014/ShadowbornDemon.java index 08eda6473f3..c81ad6839b1 100644 --- a/Mage.Sets/src/mage/sets/magic2014/ShadowbornDemon.java +++ b/Mage.Sets/src/mage/sets/magic2014/ShadowbornDemon.java @@ -30,14 +30,13 @@ package mage.sets.magic2014; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.TriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.InvertCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; -import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -50,7 +49,6 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.Target; -import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; /** @@ -60,6 +58,7 @@ import mage.target.common.TargetCreaturePermanent; public class ShadowbornDemon extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Demon creature"); + static { filter.add(Predicates.not(new SubtypePredicate("Demon"))); } @@ -75,17 +74,14 @@ public class ShadowbornDemon extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // When Shadowborn Demon enters the battlefield, destroy target non-Demon creature. - Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(),false); + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); Target target = new TargetCreaturePermanent(filter); ability.addTarget(target); this.addAbility(ability); + // At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature. - TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(new SacrificeTargetEffect(), TargetController.YOU, false); - target = new TargetControlledCreaturePermanent(); - target.setNotTarget(false); - triggeredAbility.addTarget(target); this.addAbility(new ConditionalTriggeredAbility( - triggeredAbility, + new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, ""), TargetController.YOU, false), new InvertCondition(new CreatureCardsInControllerGraveCondition(6)), "At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature")); @@ -102,6 +98,7 @@ public class ShadowbornDemon extends CardImpl { } class CreatureCardsInControllerGraveCondition implements Condition { + private int value; public CreatureCardsInControllerGraveCondition(int value) { @@ -111,10 +108,9 @@ class CreatureCardsInControllerGraveCondition implements Condition { @Override public boolean apply(Game game, Ability source) { Player p = game.getPlayer(source.getControllerId()); - if (p != null && p.getGraveyard().count(new FilterCreatureCard(), game) >= value) - { - return true; + if (p != null && p.getGraveyard().count(new FilterCreatureCard(), game) >= value) { + return true; } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2014/StrionicResonator.java b/Mage.Sets/src/mage/sets/magic2014/StrionicResonator.java index c05126f8ba0..63a97aa79b4 100644 --- a/Mage.Sets/src/mage/sets/magic2014/StrionicResonator.java +++ b/Mage.Sets/src/mage/sets/magic2014/StrionicResonator.java @@ -57,8 +57,6 @@ import mage.target.TargetObject; */ public class StrionicResonator extends CardImpl { - - public StrionicResonator(UUID ownerId) { super(ownerId, 224, "Strionic Resonator", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "M14"; @@ -92,8 +90,8 @@ class StrionicResonatorEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - StackAbility stackAbility = (StackAbility)game.getStack().getStackObject(targetPointer.getFirst(game, source)); - if(stackAbility != null){ + StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(targetPointer.getFirst(game, source)); + if (stackAbility != null) { Ability ability = (Ability) stackAbility.getStackAbility(); Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); @@ -104,7 +102,7 @@ class StrionicResonatorEffect extends OneShotEffect { if (newAbility.getTargets().size() > 0) { if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", source, game)) { newAbility.getTargets().clearChosen(); - if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) { + if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, false, game) == false) { return false; } } @@ -114,7 +112,7 @@ class StrionicResonatorEffect extends OneShotEffect { } } return false; - + } @Override @@ -122,10 +120,10 @@ class StrionicResonatorEffect extends OneShotEffect { return new StrionicResonatorEffect(this); } - @Override + @Override public String getText(Mode mode) { StringBuilder sb = new StringBuilder(); - sb.append("Copy target ").append(mode.getTargets().get(0).getTargetName()).append(". You may choose new targets for the copy"); + sb.append("Copy ").append(mode.getTargets().get(0).getTargetName()).append(". You may choose new targets for the copy"); return sb.toString(); } } @@ -136,14 +134,13 @@ class TargetTriggeredAbility extends TargetObject { this.minNumberOfTargets = 1; this.maxNumberOfTargets = 1; this.zone = Zone.STACK; - this.targetName = "target triggered ability"; + this.targetName = "target triggered ability you control"; } public TargetTriggeredAbility(final TargetTriggeredAbility target) { super(target); } - @Override public boolean canTarget(UUID id, Ability source, Game game) { if (source != null && source.getSourceId().equals(id)) { @@ -151,10 +148,10 @@ class TargetTriggeredAbility extends TargetObject { } StackObject stackObject = game.getStack().getStackObject(id); - if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility) { - return true; - } - return false; + return stackObject.getStackAbility() != null + && (stackObject.getStackAbility() instanceof TriggeredAbility) + && source != null + && stackObject.getStackAbility().getControllerId().equals(source.getControllerId()); } @Override @@ -164,11 +161,13 @@ class TargetTriggeredAbility extends TargetObject { @Override public boolean canChoose(UUID sourceControllerId, Game game) { - for (StackObject stackObject : game.getStack()) { - if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) { - return true; - } + for (StackObject stackObject : game.getStack()) { + if (stackObject.getStackAbility() != null + && stackObject.getStackAbility() instanceof TriggeredAbility + && stackObject.getStackAbility().getControllerId().equals(sourceControllerId)) { + return true; } + } return false; } @@ -179,9 +178,11 @@ class TargetTriggeredAbility extends TargetObject { @Override public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (StackObject stackObject : game.getStack()) { - if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) { + Set possibleTargets = new HashSet<>(); + for (StackObject stackObject : game.getStack()) { + if (stackObject.getStackAbility() != null + && stackObject.getStackAbility() instanceof TriggeredAbility + && stackObject.getStackAbility().getControllerId().equals(sourceControllerId)) { possibleTargets.add(stackObject.getStackAbility().getId()); } } diff --git a/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java b/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java index e23e2f01239..9ac69ece96e 100644 --- a/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java +++ b/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java @@ -30,19 +30,17 @@ package mage.sets.magic2014; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.dynamicvalue.common.CountersCount; -import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.counters.CounterType; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; @@ -57,6 +55,7 @@ import mage.target.common.TargetCreaturePermanentAmount; public class VastwoodHydra extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control"); + static { filter.add(new ControllerPredicate(TargetController.YOU)); } @@ -70,7 +69,8 @@ public class VastwoodHydra extends CardImpl { this.toughness = new MageInt(0); // Vastwood Hydra enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new VastwoodHydraEffect())); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); + // When Vastwood Hydra dies, you may distribute a number of +1/+1 counters equal to the number of +1/+1 counters on Vastwood Hydra among any number of creatures you control. Ability ability = new DiesTriggeredAbility(new VastwoodHydraDistributeEffect(), true); ability.addTarget(new TargetCreaturePermanentAmount(new CountersCount(CounterType.P1P1), filter)); @@ -87,46 +87,11 @@ public class VastwoodHydra extends CardImpl { } } -class VastwoodHydraEffect extends OneShotEffect { - - public VastwoodHydraEffect() { - super(Outcome.BoostCreature); - staticText = "with X +1/+1 counters on it"; - } - - public VastwoodHydraEffect(final VastwoodHydraEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public VastwoodHydraEffect copy() { - return new VastwoodHydraEffect(this); - } - -} - class VastwoodHydraDistributeEffect extends OneShotEffect { public VastwoodHydraDistributeEffect() { super(Outcome.BoostCreature); - this.staticText = "distribute a number of +1/+1 counters equal to the number of +1/+1 counters on {this} among any number of creatures you control"; + this.staticText = "distribute a number of +1/+1 counters equal to the number of +1/+1 counters on {this} among any number of creatures you control"; } public VastwoodHydraDistributeEffect(final VastwoodHydraDistributeEffect effect) { @@ -142,7 +107,7 @@ class VastwoodHydraDistributeEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { if (source.getTargets().size() > 0) { Target multiTarget = source.getTargets().get(0); - for (UUID target: multiTarget.getTargets()) { + for (UUID target : multiTarget.getTargets()) { Permanent permanent = game.getPermanent(target); if (permanent != null) { permanent.addCounters(CounterType.P1P1.createInstance(multiTarget.getTargetAmount(target)), game); diff --git a/Mage.Sets/src/mage/sets/magic2015/AjaniSteadfast.java b/Mage.Sets/src/mage/sets/magic2015/AjaniSteadfast.java index b9283d50ea6..aee04861911 100644 --- a/Mage.Sets/src/mage/sets/magic2015/AjaniSteadfast.java +++ b/Mage.Sets/src/mage/sets/magic2015/AjaniSteadfast.java @@ -30,7 +30,7 @@ package mage.sets.magic2015; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.PreventionEffectImpl; @@ -38,7 +38,6 @@ import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.counter.AddCountersAllEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.LifelinkAbility; import mage.abilities.keyword.VigilanceAbility; @@ -66,22 +65,21 @@ import mage.target.common.TargetCreaturePermanent; public class AjaniSteadfast extends CardImpl { private static final FilterPlaneswalkerPermanent filter = new FilterPlaneswalkerPermanent("other planeswalker you control"); - + static { filter.add(new AnotherPredicate()); filter.add(new ControllerPredicate(TargetController.YOU)); } - + public AjaniSteadfast(UUID ownerId) { super(ownerId, 1, "Ajani Steadfast", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{W}"); this.expansionSetCode = "M15"; this.subtype.add("Ajani"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Until end of turn, up to one target creature gets +1/+1 and gains first strike, vigilance, and lifelink. - Effect effect = new BoostTargetEffect(1,1, Duration.EndOfTurn); + Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn); effect.setText("Until end of turn, up to one target creature gets +1/+1"); LoyaltyAbility ability = new LoyaltyAbility(effect, 1); effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn); @@ -93,16 +91,16 @@ public class AjaniSteadfast extends CardImpl { effect = new GainAbilityTargetEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn); effect.setText(", and lifelink"); ability.addEffect(effect); - ability.addTarget(new TargetCreaturePermanent(0,1)); + ability.addTarget(new TargetCreaturePermanent(0, 1)); this.addAbility(ability); - + // -2: Put a +1/+1 counter on each creature you control and a loyalty counter on each other planeswalker you control. ability = new LoyaltyAbility(new AddCountersAllEffect(CounterType.P1P1.createInstance(), new FilterControlledCreaturePermanent()), -2); effect = new AddCountersAllEffect(CounterType.LOYALTY.createInstance(), filter); effect.setText("and a loyalty counter on each other planeswalker you control"); ability.addEffect(effect); this.addAbility(ability); - + // -7: You get an emblem with "If a source would deal damage to you or a planeswalker you control, prevent all but 1 of that damage." this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new AjaniSteadfastEmblem()), -7)); } @@ -121,7 +119,7 @@ class AjaniSteadfastEmblem extends Emblem { public AjaniSteadfastEmblem() { setName("EMBLEM: Ajani Steadfast"); - this.getAbilities().add(new SimpleStaticAbility(Zone.COMMAND, new AjaniSteadfastPreventEffect())); + this.getAbilities().add(new SimpleStaticAbility(Zone.COMMAND, new AjaniSteadfastPreventEffect())); this.setExpansionSetCodeForImage("M15"); } } @@ -143,7 +141,7 @@ class AjaniSteadfastPreventEffect extends PreventionEffectImpl { int damage = event.getAmount(); if (damage > 1) { amountToPrevent = damage - 1; - preventDamageAction(event, source, game); + preventDamageAction(event, source, game); } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2015/BoonweaverGiant.java b/Mage.Sets/src/mage/sets/magic2015/BoonweaverGiant.java index 12075176452..d5f432ff10e 100644 --- a/Mage.Sets/src/mage/sets/magic2015/BoonweaverGiant.java +++ b/Mage.Sets/src/mage/sets/magic2015/BoonweaverGiant.java @@ -97,8 +97,8 @@ class BoonweaverGiantEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } @@ -108,18 +108,18 @@ class BoonweaverGiantEffect extends OneShotEffect { Card card = null; Zone zone = null; - if (player.chooseUse(Outcome.Neutral, "Search your graveyard for an Aura card?", source, game)) { + if (controller.chooseUse(Outcome.Neutral, "Search your graveyard for an Aura card?", source, game)) { TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter); - if (player.choose(Outcome.PutCardInPlay, player.getGraveyard(), target, game)) { + if (controller.choose(Outcome.PutCardInPlay, controller.getGraveyard(), target, game)) { card = game.getCard(target.getFirstTarget()); if (card != null) { zone = Zone.GRAVEYARD; } } } - if (card == null && player.chooseUse(Outcome.Neutral, "Search your Hand for an Aura card?", source, game)) { + if (card == null && controller.chooseUse(Outcome.Neutral, "Search your Hand for an Aura card?", source, game)) { TargetCardInHand target = new TargetCardInHand(filter); - if (player.choose(Outcome.PutCardInPlay, player.getHand(), target, game)) { + if (controller.choose(Outcome.PutCardInPlay, controller.getHand(), target, game)) { card = game.getCard(target.getFirstTarget()); if (card != null) { zone = Zone.HAND; @@ -128,13 +128,13 @@ class BoonweaverGiantEffect extends OneShotEffect { } if (card == null) { TargetCardInLibrary target = new TargetCardInLibrary(filter); - if (player.searchLibrary(target, game)) { + if (controller.searchLibrary(target, game)) { card = game.getCard(target.getFirstTarget()); if (card != null) { zone = Zone.LIBRARY; } } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); } // aura card found - attach it if (card != null) { @@ -142,7 +142,7 @@ class BoonweaverGiantEffect extends OneShotEffect { if (permanent != null) { game.getState().setValue("attachTo:" + card.getId(), permanent); } - player.putOntoBattlefieldWithInfo(card, game, zone, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); if (permanent != null) { return permanent.addAttachment(card.getId(), game); } diff --git a/Mage.Sets/src/mage/sets/magic2015/ChasmSkulker.java b/Mage.Sets/src/mage/sets/magic2015/ChasmSkulker.java index 874f933c5a9..b8af72b4240 100644 --- a/Mage.Sets/src/mage/sets/magic2015/ChasmSkulker.java +++ b/Mage.Sets/src/mage/sets/magic2015/ChasmSkulker.java @@ -29,7 +29,6 @@ package mage.sets.magic2015; import java.util.UUID; import mage.MageInt; -import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.common.DrawCardControllerTriggeredAbility; @@ -65,7 +64,7 @@ public class ChasmSkulker extends CardImpl { // Whenever you draw a card, put a +1/+1 counter on Chasm Skulker. this.addAbility(new DrawCardControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); - + // When Chasm Skulker dies, put X 1/1 blue Squid creature tokens with islandwalk onto the battlefield, where X is the number of +1/+1 counters on Chasm Skulker. this.addAbility(new DiesTriggeredAbility(new ChasmSkulkerEffect(), false)); } @@ -127,4 +126,4 @@ class ChasmSkulkerSquidToken extends Token { this.addAbility(new IslandwalkAbility()); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2015/GarrukApexPredator.java b/Mage.Sets/src/mage/sets/magic2015/GarrukApexPredator.java index 955c9019f01..dd839d19569 100644 --- a/Mage.Sets/src/mage/sets/magic2015/GarrukApexPredator.java +++ b/Mage.Sets/src/mage/sets/magic2015/GarrukApexPredator.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.AttackedByCreatureTriggeredAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; @@ -40,7 +40,6 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.GetEmblemTargetPlayerEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; @@ -50,7 +49,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SetTargetPointer; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.permanent.AnotherPredicate; @@ -81,7 +79,7 @@ public class GarrukApexPredator extends CardImpl { this.expansionSetCode = "M15"; this.subtype.add("Garruk"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); // +1: Destroy another target planeswalker. LoyaltyAbility ability = new LoyaltyAbility(new DestroyTargetEffect(), 1); diff --git a/Mage.Sets/src/mage/sets/magic2015/GeneratorServant.java b/Mage.Sets/src/mage/sets/magic2015/GeneratorServant.java index 1bda0be0091..898e79c6943 100644 --- a/Mage.Sets/src/mage/sets/magic2015/GeneratorServant.java +++ b/Mage.Sets/src/mage/sets/magic2015/GeneratorServant.java @@ -77,7 +77,7 @@ public class GeneratorServant extends CardImpl { ability.addCost(new SacrificeSourceCost()); ability.getEffects().get(0).setText("Add {2} to your mana pool. If that mana is spent on a creature spell, it gains haste until end of turn."); this.addAbility(ability); - + this.addAbility(new SimpleStaticAbility(Zone.ALL, new GeneratorServantHasteEffect()), new GeneratorServantWatcher()); } @@ -94,11 +94,11 @@ public class GeneratorServant extends CardImpl { class GeneratorServantWatcher extends Watcher { public List creatures = new ArrayList<>(); - + public GeneratorServantWatcher() { super("GeneratorServantWatcher", WatcherScope.CARD); } - + public GeneratorServantWatcher(final GeneratorServantWatcher watcher) { super(watcher); this.creatures.addAll(watcher.creatures); @@ -108,13 +108,13 @@ class GeneratorServantWatcher extends Watcher { public GeneratorServantWatcher copy() { return new GeneratorServantWatcher(this); } - + @Override public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.MANA_PAYED) { MageObject target = game.getObject(event.getTargetId()); - MageObject source = game.getObject(this.getSourceId()); - if (event.getSourceId() == this.getSourceId() && target != null && target.getCardType().contains(CardType.CREATURE) && event.getFlag()) { + if (event.getSourceId() != null + && event.getSourceId().equals(this.getSourceId()) && target != null && target.getCardType().contains(CardType.CREATURE) && event.getFlag()) { if (target instanceof Spell) { this.creatures.add(((Spell) target).getCard().getId()); } @@ -127,7 +127,7 @@ class GeneratorServantWatcher extends Watcher { super.reset(); creatures.clear(); } - + } class GeneratorServantHasteEffect extends ContinuousEffectImpl { @@ -135,7 +135,7 @@ class GeneratorServantHasteEffect extends ContinuousEffectImpl { public GeneratorServantHasteEffect() { super(Duration.EndOfGame, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); } - + public GeneratorServantHasteEffect(final GeneratorServantHasteEffect effect) { super(effect); } @@ -144,7 +144,7 @@ class GeneratorServantHasteEffect extends ContinuousEffectImpl { public ContinuousEffect copy() { return new GeneratorServantHasteEffect(this); } - + @Override public boolean apply(Game game, Ability source) { GeneratorServantWatcher watcher = (GeneratorServantWatcher) game.getState().getWatchers().get("GeneratorServantWatcher", source.getSourceId()); @@ -158,5 +158,5 @@ class GeneratorServantHasteEffect extends ContinuousEffectImpl { } return false; } - + } diff --git a/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java b/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java index b6ff9b77b9f..03eda36b2ff 100644 --- a/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java +++ b/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java @@ -27,13 +27,14 @@ */ package mage.sets.magic2015; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.SpellAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; @@ -50,14 +51,9 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.game.Game; -import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetCard; -import java.util.UUID; - - - /** * * @author LevelX2 @@ -73,11 +69,11 @@ public class GenesisHydra extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - // When you cast Genesis Hydra, reveal the top X cards of your library. You may put a nonland permanent card with converted mana cost X or less from among them onto the battlefield. Then shuffle the rest into your library. this.addAbility(new CastSourceTriggeredAbility(new GenesisHydraPutOntoBattlefieldEffect(), false)); + // Genesis Hydra enters the battlefield with X +1/+1 counters on it. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new GenesisHydraEntersBattlefieldEffect()))); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); } public GenesisHydra(final GenesisHydra card) { @@ -90,44 +86,6 @@ public class GenesisHydra extends CardImpl { } } -class GenesisHydraEntersBattlefieldEffect extends OneShotEffect { - - public GenesisHydraEntersBattlefieldEffect() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - public GenesisHydraEntersBattlefieldEffect(final GenesisHydraEntersBattlefieldEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - SpellAbility spellAbility = (SpellAbility) obj; - if (spellAbility.getSourceId().equals(source.getSourceId())) { // put into play by normal cast - int amount = spellAbility.getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - } - return true; - } - - @Override - public GenesisHydraEntersBattlefieldEffect copy() { - return new GenesisHydraEntersBattlefieldEffect(this); - } - -} - class GenesisHydraPutOntoBattlefieldEffect extends OneShotEffect { public GenesisHydraPutOntoBattlefieldEffect() { @@ -173,7 +131,7 @@ class GenesisHydraPutOntoBattlefieldEffect extends OneShotEffect { Card card = cards.get(target1.getFirstTarget(), game); if (card != null) { cards.remove(card); - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } target1.clearChosen(); } else { @@ -182,11 +140,7 @@ class GenesisHydraPutOntoBattlefieldEffect extends OneShotEffect { } else { game.informPlayers("No nonland permanent card with converted mana cost " + count + " or less to choose."); } - while (cards.size() > 0) { - Card card = cards.get(cards.iterator().next(), game); - cards.remove(card); - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } + controller.moveCards(cards, Zone.LIBRARY, source, game); controller.shuffleLibrary(game); return true; } diff --git a/Mage.Sets/src/mage/sets/magic2015/GoblinRabblemaster.java b/Mage.Sets/src/mage/sets/magic2015/GoblinRabblemaster.java index 9d23e6719af..44d241e5285 100644 --- a/Mage.Sets/src/mage/sets/magic2015/GoblinRabblemaster.java +++ b/Mage.Sets/src/mage/sets/magic2015/GoblinRabblemaster.java @@ -38,7 +38,6 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -49,7 +48,8 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.AttackingPredicate; import mage.filter.predicate.permanent.ControllerPredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinTokenWithHaste; +import mage.watchers.common.AttackedThisTurnWatcher; /** * @@ -59,15 +59,15 @@ public class GoblinRabblemaster extends CardImpl { private static final FilterCreaturePermanent otherGoblinFilter = new FilterCreaturePermanent("Goblin", "Other Goblin creatures you control"); private static final FilterCreaturePermanent attackingFilter = new FilterCreaturePermanent("Goblin", "other attacking Goblin"); - + static { otherGoblinFilter.add(new AnotherPredicate()); otherGoblinFilter.add(new ControllerPredicate(TargetController.YOU)); - + attackingFilter.add(new AttackingPredicate()); attackingFilter.add(new AnotherPredicate()); } - + public GoblinRabblemaster(UUID ownerId) { super(ownerId, 145, "Goblin Rabblemaster", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.expansionSetCode = "M15"; @@ -79,11 +79,11 @@ public class GoblinRabblemaster extends CardImpl { // Other Goblin creatures you control attack each turn if able. Effect effect = new AttacksIfAbleAllEffect(otherGoblinFilter); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); - + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect), new AttackedThisTurnWatcher()); + // At the beginning of combat on your turn, put a 1/1 red Goblin creature token with haste onto the battlefield. - this.addAbility(new BeginningOfCombatTriggeredAbility(new CreateTokenEffect(new GoblinToken()), TargetController.YOU, false)); - + this.addAbility(new BeginningOfCombatTriggeredAbility(new CreateTokenEffect(new GoblinTokenWithHaste()), TargetController.YOU, false)); + // When Goblin Rabblemaster attacks, it gets +1/+0 until end of turn for each other attacking Goblin. this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(new PermanentsOnBattlefieldCount(attackingFilter), new StaticValue(0), Duration.EndOfTurn, true), false)); } @@ -97,18 +97,3 @@ public class GoblinRabblemaster extends CardImpl { return new GoblinRabblemaster(this); } } - -class GoblinToken extends Token { - - public GoblinToken() { - super("Goblin", "1/1 red Goblin creature token with haste"); - this.setOriginalExpansionSetCode("M15"); - cardType.add(CardType.CREATURE); - subtype.add("Goblin"); - color.setRed(true); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(HasteAbility.getInstance()); - } - -} diff --git a/Mage.Sets/src/mage/sets/magic2015/HushwingGryff.java b/Mage.Sets/src/mage/sets/magic2015/HushwingGryff.java index c644c080918..2938b8d6ca6 100644 --- a/Mage.Sets/src/mage/sets/magic2015/HushwingGryff.java +++ b/Mage.Sets/src/mage/sets/magic2015/HushwingGryff.java @@ -43,6 +43,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -108,7 +109,7 @@ class HushwingGryffEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { Ability ability = (Ability) getValue("targetAbility"); if (ability != null && AbilityType.TRIGGERED.equals(ability.getAbilityType())) { - Permanent permanent = game.getPermanent(event.getTargetId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { return true; } diff --git a/Mage.Sets/src/mage/sets/magic2015/JaceTheLivingGuildpact.java b/Mage.Sets/src/mage/sets/magic2015/JaceTheLivingGuildpact.java index 964c2310133..7d4c32fbbaa 100644 --- a/Mage.Sets/src/mage/sets/magic2015/JaceTheLivingGuildpact.java +++ b/Mage.Sets/src/mage/sets/magic2015/JaceTheLivingGuildpact.java @@ -30,20 +30,18 @@ package mage.sets.magic2015; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.FilterPermanent; import mage.filter.common.FilterNonlandPermanent; @@ -69,8 +67,7 @@ public class JaceTheLivingGuildpact extends CardImpl { this.expansionSetCode = "M15"; this.subtype.add("Jace"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); // +1: Look at the top two cards of your library. Put one of them into your graveyard. Effect effect = new LookLibraryAndPickControllerEffect( @@ -78,7 +75,7 @@ public class JaceTheLivingGuildpact extends CardImpl { effect.setText("Look at the top two cards of your library. Put one of them into your graveyard"); this.addAbility(new LoyaltyAbility(effect, 1)); - // -3: Return another target nonland permanent to its owner's hand. + // -3: Return another target nonland permanent to its owner's hand. LoyaltyAbility ability = new LoyaltyAbility(new ReturnToHandTargetEffect(), -3); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); @@ -113,15 +110,15 @@ class JaceTheLivingGuildpactEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (UUID playerId: controller.getInRange()) { + for (UUID playerId : controller.getInRange()) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card: player.getHand().getCards(game)) { + for (Card card : player.getHand().getCards(game)) { card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - for (Card card: player.getGraveyard().getCards(game)) { + } + for (Card card : player.getGraveyard().getCards(game)) { card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } + } player.shuffleLibrary(game); } } diff --git a/Mage.Sets/src/mage/sets/magic2015/JaliraMasterPolymorphist.java b/Mage.Sets/src/mage/sets/magic2015/JaliraMasterPolymorphist.java index a9cd3d3260d..cc21944e5c5 100644 --- a/Mage.Sets/src/mage/sets/magic2015/JaliraMasterPolymorphist.java +++ b/Mage.Sets/src/mage/sets/magic2015/JaliraMasterPolymorphist.java @@ -132,10 +132,10 @@ class JaliraMasterPolymorphistEffect extends OneShotEffect { } while (library.size() > 0 && card != null && !filter.match(card, game)); // reveal cards if (!cards.isEmpty()) { - controller.revealCards(sourceObject.getName(), cards, game); + controller.revealCards(sourceObject.getIdName(), cards, game); } // put nonlegendary creature card to battlefield - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); // remove it from revealed card list cards.remove(card); // Put the rest on the bottom of your library in a random order diff --git a/Mage.Sets/src/mage/sets/magic2015/KurkeshOnakkeAncient.java b/Mage.Sets/src/mage/sets/magic2015/KurkeshOnakkeAncient.java index 91c880acb42..c76ad2d95b4 100644 --- a/Mage.Sets/src/mage/sets/magic2015/KurkeshOnakkeAncient.java +++ b/Mage.Sets/src/mage/sets/magic2015/KurkeshOnakkeAncient.java @@ -80,15 +80,15 @@ public class KurkeshOnakkeAncient extends CardImpl { } class KurkeshOnakkeAncientTriggeredAbility extends TriggeredAbilityImpl { - + KurkeshOnakkeAncientTriggeredAbility() { super(Zone.BATTLEFIELD, new KurkeshOnakkeAncientEffect(), false); } - + KurkeshOnakkeAncientTriggeredAbility(final KurkeshOnakkeAncientTriggeredAbility ability) { super(ability); } - + @Override public KurkeshOnakkeAncientTriggeredAbility copy() { return new KurkeshOnakkeAncientTriggeredAbility(this); @@ -98,43 +98,45 @@ class KurkeshOnakkeAncientTriggeredAbility extends TriggeredAbilityImpl { public boolean checkEventType(GameEvent event, Game game) { return event.getType() == EventType.ACTIVATED_ABILITY; } - + @Override public boolean checkTrigger(GameEvent event, Game game) { - Card source = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (source.getCardType().contains(CardType.ARTIFACT)) { - StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); - if (!(stackAbility.getStackAbility() instanceof ManaAbility)) { - Effect effect = this.getEffects().get(0); - effect.setValue("stackAbility", stackAbility.getStackAbility()); - return true; + if (event.getPlayerId().equals(getControllerId())) { + Card source = game.getPermanentOrLKIBattlefield(event.getSourceId()); + if (source != null && source.getCardType().contains(CardType.ARTIFACT)) { + StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); + if (!(stackAbility.getStackAbility() instanceof ManaAbility)) { + Effect effect = this.getEffects().get(0); + effect.setValue("stackAbility", stackAbility.getStackAbility()); + return true; + } } } return false; } - + @Override public String getRule() { - return "Whenever you activate an ability of an artifact, if it isn't a mana ability, you may pay {R}. If you do, copy that ability. You may choose new targets for the copy."; + return "Whenever you activate an ability of an artifact, if it isn't a mana ability" + super.getRule(); } } class KurkeshOnakkeAncientEffect extends OneShotEffect { - + KurkeshOnakkeAncientEffect() { super(Outcome.Benefit); - this.staticText = ", you may pay {R}. If you do, copy that ability. You may choose new targets for the copy."; + this.staticText = ", you may pay {R}. If you do, copy that ability. You may choose new targets for the copy"; } - + KurkeshOnakkeAncientEffect(final KurkeshOnakkeAncientEffect effect) { super(effect); } - + @Override public KurkeshOnakkeAncientEffect copy() { return new KurkeshOnakkeAncientEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); @@ -152,7 +154,7 @@ class KurkeshOnakkeAncientEffect extends OneShotEffect { if (newAbility.getTargets().size() > 0) { if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", source, game)) { newAbility.getTargets().clearChosen(); - if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) { + if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, false, game) == false) { return false; } } diff --git a/Mage.Sets/src/mage/sets/magic2015/MercurialPretender.java b/Mage.Sets/src/mage/sets/magic2015/MercurialPretender.java index c1e14cdf255..2152b28b88a 100644 --- a/Mage.Sets/src/mage/sets/magic2015/MercurialPretender.java +++ b/Mage.Sets/src/mage/sets/magic2015/MercurialPretender.java @@ -1,127 +1,78 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.magic2015; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ReturnToHandSourceEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.Target; -import mage.target.TargetPermanent; -import mage.util.functions.ApplyToPermanent; - -/** - * - * @author LevelX2 - */ -public class MercurialPretender extends CardImpl { - - private static final String abilityText = "You may have {this} enter the battlefield as a copy of any creature you control except it gains \"{2}{U}{U}: Return this creature to its owner's hand.\""; - - public MercurialPretender(UUID ownerId) { - super(ownerId, 68, "Mercurial Pretender", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}"); - this.expansionSetCode = "M15"; - this.subtype.add("Shapeshifter"); - - this.color.setBlue(true); - this.power = new MageInt(0); - this.toughness = new MageInt(0); - - // You may have Mercurial Pretender enter the battlefield as a copy of any creature you control - // except it gains "{2}{U}{U}: Return this creature to its owner's hand." - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( - new MercurialPretenderCopyEffect(), abilityText, true)); - this.addAbility(ability); - } - - public MercurialPretender(final MercurialPretender card) { - super(card); - } - - @Override - public MercurialPretender copy() { - return new MercurialPretender(this); - } -} -class MercurialPretenderCopyEffect extends OneShotEffect { - - public MercurialPretenderCopyEffect() { - super(Outcome.Copy); - } - - public MercurialPretenderCopyEffect(final MercurialPretenderCopyEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (player != null && sourcePermanent != null) { - Target target = new TargetPermanent(new FilterControlledCreaturePermanent()); - target.setNotTarget(true); - if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { - player.choose(Outcome.Copy, target, source.getSourceId(), game); - Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget()); - if (copyFromPermanent != null) { - game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() { - @Override - public Boolean apply(Game game, Permanent permanent) { - // {2}{U}{U}: Return this creature to its owner's hand. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{2}{U}{U}")); - permanent.addAbility(ability, game); - return true; - } - }); - - return true; - } - } - } - return false; - } - - @Override - public MercurialPretenderCopyEffect copy() { - return new MercurialPretenderCopyEffect(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.magic2015; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CopyPermanentEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.util.functions.AbilityApplier; + +/** + * + * @author LevelX2 + */ +public class MercurialPretender extends CardImpl { + + private static final String effectText = "as a copy of any creature you control except it gains \"{2}{U}{U}: Return this creature to its owner's hand.\""; + + public MercurialPretender(UUID ownerId) { + super(ownerId, 68, "Mercurial Pretender", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "M15"; + this.subtype.add("Shapeshifter"); + + this.color.setBlue(true); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // You may have Mercurial Pretender enter the battlefield as a copy of any creature you control + // except it gains "{2}{U}{U}: Return this creature to its owner's hand." + Effect effect = new CopyPermanentEffect(new FilterControlledCreaturePermanent(), + new AbilityApplier(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{2}{U}{U}")))); + effect.setText(effectText); + this.addAbility(new EntersBattlefieldAbility(effect, true)); + } + + public MercurialPretender(final MercurialPretender card) { + super(card); + } + + @Override + public MercurialPretender copy() { + return new MercurialPretender(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2015/NissaWorldwaker.java b/Mage.Sets/src/mage/sets/magic2015/NissaWorldwaker.java index 3c5177de393..c1fc0b51a84 100644 --- a/Mage.Sets/src/mage/sets/magic2015/NissaWorldwaker.java +++ b/Mage.Sets/src/mage/sets/magic2015/NissaWorldwaker.java @@ -31,12 +31,11 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.Card; import mage.cards.CardImpl; @@ -46,13 +45,13 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.common.FilterBasicLandCard; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.TargetPermanent; @@ -79,9 +78,8 @@ public class NissaWorldwaker extends CardImpl { this.expansionSetCode = "M15"; this.subtype.add("Nissa"); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); - // +1: Target land you control becomes a 4/4 Elemental creature with trample. It's still a land. LoyaltyAbility ability = new LoyaltyAbility(new BecomesCreatureTargetEffect(new NissaWorldwakerToken(), false, true, Duration.Custom), 1); ability.addTarget(new TargetLandPermanent(filter)); @@ -89,11 +87,11 @@ public class NissaWorldwaker extends CardImpl { // +1: Untap up to four target Forests. ability = new LoyaltyAbility(new UntapTargetEffect(), 1); - ability.addTarget(new TargetPermanent(0,4,filterForest, false)); + ability.addTarget(new TargetPermanent(0, 4, filterForest, false)); this.addAbility(ability); // -7: Search your library for any number of basic land cards, put them onto the battlefield, then shuffle your library. Those lands become 4/4 Elemental creatures with trample. They're still lands. - this.addAbility(new LoyaltyAbility(new NissaWorldwakerSearchEffect(), -7)); + this.addAbility(new LoyaltyAbility(new NissaWorldwakerSearchEffect(), -7)); } public NissaWorldwaker(final NissaWorldwaker card) { @@ -124,26 +122,30 @@ class NissaWorldwakerSearchEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } - TargetCardInLibrary target = new TargetCardInLibrary(0,Integer.MAX_VALUE, new FilterBasicLandCard()); - if (player.searchLibrary(target, game)) { + TargetCardInLibrary target = new TargetCardInLibrary(0, Integer.MAX_VALUE, new FilterBasicLandCard()); + if (controller.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { - for (UUID cardId: target.getTargets()) { - Card card = player.getLibrary().getCard(cardId, game); + for (UUID cardId : target.getTargets()) { + Card card = controller.getLibrary().getCard(cardId, game); if (card != null) { - if (player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId())) { - ContinuousEffect effect = new BecomesCreatureTargetEffect(new NissaWorldwakerToken(), false, true, Duration.Custom); - effect.setTargetPointer(new FixedTarget(card.getId())); - game.addEffect(effect, source); - } + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { + Permanent land = game.getPermanent(card.getId()); + if (land != null) { + ContinuousEffect effect = new BecomesCreatureTargetEffect(new NissaWorldwakerToken(), false, true, Duration.Custom); + effect.setTargetPointer(new FixedTarget(land, game)); + game.addEffect(effect, source); + + } + } } } } } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return true; } } @@ -159,4 +161,4 @@ class NissaWorldwakerToken extends Token { this.toughness = new MageInt(4); this.addAbility(TrampleAbility.getInstance()); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magic2015/ObeliskOfUrd.java b/Mage.Sets/src/mage/sets/magic2015/ObeliskOfUrd.java index d4a6c4f3a15..7a20f8d5867 100644 --- a/Mage.Sets/src/mage/sets/magic2015/ObeliskOfUrd.java +++ b/Mage.Sets/src/mage/sets/magic2015/ObeliskOfUrd.java @@ -32,12 +32,9 @@ import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseCreatureTypeEffect; import mage.abilities.keyword.ConvokeAbility; import mage.cards.CardImpl; -import mage.cards.repository.CardRepository; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -48,8 +45,6 @@ import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.util.CardUtil; /** * @@ -63,10 +58,10 @@ public class ObeliskOfUrd extends CardImpl { // Convoke this.addAbility(new ConvokeAbility()); - + // As Obelisk of Urd enters the battlefield, choose a creature type. - this.addAbility(new AsEntersBattlefieldAbility(new ObeliskOfUrdEnterBattlefieldEffect())); - + this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.BoostCreature))); + // Creatures you control of the chosen type get +2/+2. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ObeliskOfUrdBoostEffect())); } @@ -81,43 +76,6 @@ public class ObeliskOfUrd extends CardImpl { } } -class ObeliskOfUrdEnterBattlefieldEffect extends OneShotEffect { - - ObeliskOfUrdEnterBattlefieldEffect() { - super(Outcome.BoostCreature); - staticText = "choose a creature type"; - } - - ObeliskOfUrdEnterBattlefieldEffect(final ObeliskOfUrdEnterBattlefieldEffect effect) { - super(effect); - } - - @Override - public ObeliskOfUrdEnterBattlefieldEffect copy() { - return new ObeliskOfUrdEnterBattlefieldEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose a creature type:"); - typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); - while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { - if (!player.canRespond()) { - return false; - } - } - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice()); - game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice()); - permanent.addInfo("chosen type", CardUtil.addToolTipMarkTags("Chosen type: " + typeChoice.getChoice()), game); - } - return false; - } -} - class ObeliskOfUrdBoostEffect extends ContinuousEffectImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); @@ -142,7 +100,7 @@ class ObeliskOfUrdBoostEffect extends ContinuousEffectImpl { if (permanent != null) { String subtype = (String) game.getState().getValue(permanent.getId() + "_type"); if (subtype != null) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { if (perm.hasSubtype(subtype)) { perm.addPower(2); perm.addToughness(2); diff --git a/Mage.Sets/src/mage/sets/magic2015/SliverHive.java b/Mage.Sets/src/mage/sets/magic2015/SliverHive.java index 3bcd1d26d85..cfba0c94491 100644 --- a/Mage.Sets/src/mage/sets/magic2015/SliverHive.java +++ b/Mage.Sets/src/mage/sets/magic2015/SliverHive.java @@ -41,15 +41,17 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.abilities.mana.ConditionalAnyColorManaAbility; import mage.abilities.mana.builder.ConditionalManaBuilder; +import mage.abilities.mana.conditional.ConditionalSpellManaBuilder; import mage.abilities.mana.conditional.CreatureCastManaCondition; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; +import mage.filter.FilterSpell; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SliverToken; /** * @@ -58,9 +60,14 @@ import mage.game.permanent.token.Token; public class SliverHive extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Sliver"); + private static final FilterSpell filterSpell = new FilterSpell("a Sliver spell"); + + static { + } static { filter.add(new SubtypePredicate("Sliver")); + filterSpell.add(new SubtypePredicate("Sliver")); } public SliverHive(UUID ownerId) { @@ -71,7 +78,7 @@ public class SliverHive extends CardImpl { this.addAbility(new ColorlessManaAbility()); // {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a Sliver spell. - this.addAbility(new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new SliverHiveManaBuilder(), true)); + this.addAbility(new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new ConditionalSpellManaBuilder(filterSpell), true)); // {5}, {T}: Put a 1/1 colorless Sliver creature token onto the battlefield. Activate this ability only if you control a Sliver. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SliverToken()), new TapSourceCost(), @@ -127,15 +134,3 @@ class SliverHiveManaCondition extends CreatureCastManaCondition { return false; } } - -class SliverToken extends Token { - - SliverToken() { - super("Sliver", "1/1 colorless Sliver creature token"); - setOriginalExpansionSetCode("M15"); - cardType.add(CardType.CREATURE); - subtype.add("Sliver"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/magic2015/SoulOfShandalar.java b/Mage.Sets/src/mage/sets/magic2015/SoulOfShandalar.java index 7c26bd21618..98de37ffeab 100644 --- a/Mage.Sets/src/mage/sets/magic2015/SoulOfShandalar.java +++ b/Mage.Sets/src/mage/sets/magic2015/SoulOfShandalar.java @@ -27,6 +27,9 @@ */ package mage.sets.magic2015; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -48,10 +51,6 @@ import mage.players.Player; import mage.target.TargetPermanent; import mage.target.TargetPlayer; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; - /** * @author noxx */ @@ -145,7 +144,7 @@ class SoulOfShandalarTarget extends TargetPermanent { @Override public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set availablePossibleTargets = super.possibleTargets(sourceId, sourceControllerId, game); - Set possibleTargets = new HashSet(); + Set possibleTargets = new HashSet<>(); MageObject object = game.getObject(sourceId); for (StackObject item : game.getState().getStack()) { diff --git a/Mage.Sets/src/mage/sets/magic2015/YisanTheWandererBard.java b/Mage.Sets/src/mage/sets/magic2015/YisanTheWandererBard.java index c5c6d4568e9..978e17f81dd 100644 --- a/Mage.Sets/src/mage/sets/magic2015/YisanTheWandererBard.java +++ b/Mage.Sets/src/mage/sets/magic2015/YisanTheWandererBard.java @@ -35,7 +35,6 @@ import mage.abilities.costs.common.PutCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; @@ -86,40 +85,36 @@ public class YisanTheWandererBard extends CardImpl { } class YisanTheWandererBardEffect extends OneShotEffect { - + public YisanTheWandererBardEffect() { super(Outcome.Benefit); this.staticText = "Search your library for a creature card with converted mana cost equal to the number of verse counters on {this}, put it onto the battlefield, then shuffle your library"; } - + public YisanTheWandererBardEffect(final YisanTheWandererBardEffect effect) { super(effect); } - + @Override public YisanTheWandererBardEffect copy() { return new YisanTheWandererBardEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (sourcePermanent != null && player != null) { + if (sourcePermanent != null && controller != null) { int newConvertedCost = sourcePermanent.getCounters().getCount("verse"); FilterCard filter = new FilterCard("creature card with converted mana cost " + newConvertedCost); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, newConvertedCost)); filter.add(new CardTypePredicate(CardType.CREATURE)); TargetCardInLibrary target = new TargetCardInLibrary(filter); - if (player.searchLibrary(target, game)) { - for (UUID cardId : target.getTargets()) { - Card card = player.getLibrary().getCard(cardId, game); - if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); - } - } + if (controller.searchLibrary(target, game)) { + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/magicorigins/AbbotOfKeralKeep.java b/Mage.Sets/src/mage/sets/magicorigins/AbbotOfKeralKeep.java index 9fa4c1512ce..4ffba2d3539 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/AbbotOfKeralKeep.java +++ b/Mage.Sets/src/mage/sets/magicorigins/AbbotOfKeralKeep.java @@ -42,7 +42,6 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Library; @@ -65,7 +64,7 @@ public class AbbotOfKeralKeep extends CardImpl { // Prowess this.addAbility(new ProwessAbility()); - + // When Abbot of Keral Keep enters the battlefield, exile the top card of your library. Until end of turn, you may play that card. this.addAbility(new EntersBattlefieldTriggeredAbility(new AbbotOfKeralKeepExileEffect())); } @@ -104,10 +103,10 @@ class AbbotOfKeralKeepExileEffect extends OneShotEffect { Library library = controller.getLibrary(); Card card = library.removeFromTop(game); if (card != null) { - String exileName = new StringBuilder(sourcePermanent.getIdName()).append(" ").toString(); - controller.moveCardToExileWithInfo(card, source.getSourceId(), exileName, source.getSourceId(), game, Zone.LIBRARY, true); + String exileName = sourcePermanent.getIdName() + " "; + controller.moveCardsToExile(card, source, game, true, source.getSourceId(), exileName); ContinuousEffect effect = new AbbotOfKeralKeepCastFromExileEffect(); - effect.setTargetPointer(new FixedTarget(card.getId())); + effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); game.addEffect(effect, source); } return true; @@ -139,7 +138,7 @@ class AbbotOfKeralKeepCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return source.getControllerId().equals(affectedControllerId) && - objectId.equals(getTargetPointer().getFirst(game, source)); + return source.getControllerId().equals(affectedControllerId) + && objectId.equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/sets/magicorigins/AlhammarretHighArbiter.java b/Mage.Sets/src/mage/sets/magicorigins/AlhammarretHighArbiter.java index a3ffd5c8fb0..3ae24d013b9 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/AlhammarretHighArbiter.java +++ b/Mage.Sets/src/mage/sets/magicorigins/AlhammarretHighArbiter.java @@ -166,7 +166,7 @@ class AlhammarretHighArbiterCantCastEffect extends ContinuousRuleModifyingEffect public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You may not cast a card named " + cardName + " (" + mageObject.getLogName() + ")."; + return "You may not cast a card named " + cardName + " (" + mageObject.getIdName() + ")."; } return null; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/AnimistsAwakening.java b/Mage.Sets/src/mage/sets/magicorigins/AnimistsAwakening.java index 4cbe0168fc4..4ccfccda7a6 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/AnimistsAwakening.java +++ b/Mage.Sets/src/mage/sets/magicorigins/AnimistsAwakening.java @@ -27,8 +27,8 @@ */ package mage.sets.magicorigins; -import java.util.ArrayList; -import java.util.List; +import java.util.LinkedHashSet; +import java.util.Set; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; @@ -94,23 +94,22 @@ class AnimistsAwakeningEffect extends OneShotEffect { Cards cards = new CardsImpl(Zone.LIBRARY); int xValue = source.getManaCostsToPay().getX(); cards.addAll(controller.getLibrary().getTopCards(game, xValue)); - List lands = new ArrayList<>(); if (cards.size() > 0) { controller.revealCards(sourceObject.getIdName(), cards, game); + Set toBattlefield = new LinkedHashSet<>(); for (Card card : cards.getCards(new FilterLandCard(), source.getSourceId(), source.getControllerId(), game)) { cards.remove(card); - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true); - Permanent land = game.getPermanent(card.getId()); - if (land != null) { - lands.add(land); - } - + toBattlefield.add(card); } + controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, true, false, true, null); controller.putCardsOnBottomOfLibrary(cards, game, source, true); if (SpellMasteryCondition.getInstance().apply(game, source)) { - for (Permanent land : lands) { - land.untap(game); + for (Card card : toBattlefield) { + Permanent land = game.getPermanent(card.getId()); + if (land != null) { + land.untap(game); + } } } } diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChandraRoaringFlame.java b/Mage.Sets/src/mage/sets/magicorigins/ChandraRoaringFlame.java index 45882a2ddcf..fe48e846fa9 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/ChandraRoaringFlame.java +++ b/Mage.Sets/src/mage/sets/magicorigins/ChandraRoaringFlame.java @@ -33,18 +33,16 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.counters.CounterType; import mage.game.Game; import mage.game.command.Emblem; import mage.players.Player; @@ -62,25 +60,24 @@ public class ChandraRoaringFlame extends CardImpl { this.expansionSetCode = "ORI"; this.subtype.add("Chandra"); this.color.setRed(true); - + this.nightCard = true; this.canTransform = true; - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); - + + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); + // +1: Chandra, Roaring Flame deals 2 damage to target player. LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new DamageTargetEffect(2), 1); loyaltyAbility.addTarget(new TargetPlayer()); - this.addAbility(loyaltyAbility); - + this.addAbility(loyaltyAbility); + //-2: Chandra, Roaring Flame deals 2 damage to target creature. loyaltyAbility = new LoyaltyAbility(new DamageTargetEffect(2), -2); loyaltyAbility.addTarget(new TargetCreaturePermanent()); - this.addAbility(loyaltyAbility); - + this.addAbility(loyaltyAbility); + //-7: Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you." this.addAbility(new LoyaltyAbility(new ChandraRoaringFlameEmblemEffect(), -7)); - } @@ -95,27 +92,27 @@ public class ChandraRoaringFlame extends CardImpl { } class ChandraRoaringFlameEmblemEffect extends OneShotEffect { - + public ChandraRoaringFlameEmblemEffect() { super(Outcome.Damage); this.staticText = "{this} deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with \"At the beginning of your upkeep, this emblem deals 3 damage to you.\""; } - + public ChandraRoaringFlameEmblemEffect(final ChandraRoaringFlameEmblemEffect effect) { super(effect); } - + @Override public ChandraRoaringFlameEmblemEffect copy() { return new ChandraRoaringFlameEmblemEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { List opponentsEmblem = new ArrayList<>(); - for(UUID playerId: game.getOpponents(controller.getId())) { + for (UUID playerId : game.getOpponents(controller.getId())) { Player opponent = game.getPlayer(playerId); if (opponent != null) { if (opponent.damage(6, source.getSourceId(), game, false, true) > 0) { @@ -132,7 +129,8 @@ class ChandraRoaringFlameEmblemEffect extends OneShotEffect { } /** - * Emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you." + * Emblem with "At the beginning of your upkeep, this emblem deals 3 damage to + * you." */ class ChandraRoaringFlameEmblem extends Emblem { @@ -142,4 +140,4 @@ class ChandraRoaringFlameEmblem extends Emblem { effect.setText("this emblem deals 3 damage to you"); this.getAbilities().add(new BeginningOfUpkeepTriggeredAbility(Zone.COMMAND, effect, TargetController.YOU, false, true)); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/ConsecratedByBlood.java b/Mage.Sets/src/mage/sets/magicorigins/ConsecratedByBlood.java index db3331a17ff..48fed631acf 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/ConsecratedByBlood.java +++ b/Mage.Sets/src/mage/sets/magicorigins/ConsecratedByBlood.java @@ -66,7 +66,7 @@ public class ConsecratedByBlood extends CardImpl { } public ConsecratedByBlood(UUID ownerId) { - super(ownerId, 87, "Consecrated By Blood", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); + super(ownerId, 87, "Consecrated by Blood", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); this.expansionSetCode = "ORI"; this.subtype.add("Aura"); diff --git a/Mage.Sets/src/mage/sets/magicorigins/DaysUndoing.java b/Mage.Sets/src/mage/sets/magicorigins/DaysUndoing.java index a77cbe2b199..9e68ba3fd71 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/DaysUndoing.java +++ b/Mage.Sets/src/mage/sets/magicorigins/DaysUndoing.java @@ -31,9 +31,10 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.condition.common.MyTurnCondition; import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardAllEffect; import mage.abilities.effects.common.EndTurnEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -54,6 +55,9 @@ public class DaysUndoing extends CardImpl { // Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards. If it's your turn, end the turn. this.getSpellAbility().addEffect(new DaysUndoingEffect()); + Effect effect = new DrawCardAllEffect(7); + effect.setText(", then draws seven cards"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new EndTurnEffect(), MyTurnCondition.getInstance(), "If it's your turn, end the turn")); } @@ -71,7 +75,7 @@ class DaysUndoingEffect extends OneShotEffect { public DaysUndoingEffect() { super(Outcome.Neutral); - staticText = "Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards"; + staticText = "Each player shuffles his or her hand and graveyard into his or her library"; } public DaysUndoingEffect(final DaysUndoingEffect effect) { @@ -80,28 +84,16 @@ class DaysUndoingEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player sourcePlayer = game.getPlayer(source.getControllerId()); - for (UUID playerId : sourcePlayer.getInRange()) { + Player controller = game.getPlayer(source.getControllerId()); + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card : player.getHand().getCards(game)) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - for (Card card : player.getGraveyard().getCards(game)) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - game.informPlayers(player.getLogName() + " puts his or her hand and graveyard into his or her library"); + player.moveCards(player.getHand(), Zone.HAND, Zone.LIBRARY, source, game); + player.moveCards(player.getGraveyard(), Zone.GRAVEYARD, Zone.LIBRARY, source, game); player.shuffleLibrary(game); } } - game.getState().handleSimultaneousEvent(game); // needed here so state based triggered effects - for (UUID playerId : sourcePlayer.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { - player.drawCards(7, game); - } - } return true; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/DwynensElite.java b/Mage.Sets/src/mage/sets/magicorigins/DwynensElite.java index d13a3b9fcf0..6ad3180ae6c 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/DwynensElite.java +++ b/Mage.Sets/src/mage/sets/magicorigins/DwynensElite.java @@ -48,7 +48,7 @@ import mage.game.permanent.token.ElfToken; * @author fireshoes */ public class DwynensElite extends CardImpl { - + private static final FilterControlledPermanent filter = new FilterControlledPermanent("another Elf"); static { @@ -69,7 +69,7 @@ public class DwynensElite extends CardImpl { this.addAbility(new ConditionalTriggeredAbility( triggeredAbility, new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0), - "When {this} enters the battlefield, if you control another Elf, put a 1/1 green Elf Warrior creature token onto the battlefield")); + "When {this} enters the battlefield, if you control another Elf, put a 1/1 green Elf Warrior creature token onto the battlefield.")); } public DwynensElite(final DwynensElite card) { diff --git a/Mage.Sets/src/mage/sets/magicorigins/EvolutionaryLeap.java b/Mage.Sets/src/mage/sets/magicorigins/EvolutionaryLeap.java index 60209bb3d7c..29b4b9dc852 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/EvolutionaryLeap.java +++ b/Mage.Sets/src/mage/sets/magicorigins/EvolutionaryLeap.java @@ -42,6 +42,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.players.Library; @@ -60,7 +61,7 @@ public class EvolutionaryLeap extends CardImpl { // {G}, Sacrifice a creature: Reveal cards from the top of your library until you reveal a creature card. Put that card into your hand and the rest on the bottom of your library in a random order. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new EvolutionaryLeapEffect(), new ManaCostsImpl("{G}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); this.addAbility(ability); } @@ -96,7 +97,7 @@ class EvolutionaryLeapEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); - if (controller != null && controller.getLibrary().size() > 0) { + if (controller != null && controller.getLibrary().size() > 0) { Cards cards = new CardsImpl(); Library library = controller.getLibrary(); Card card = null; @@ -108,22 +109,27 @@ class EvolutionaryLeapEffect extends OneShotEffect { } while (library.size() > 0 && card != null && !filter.match(card, game)); // reveal cards if (!cards.isEmpty()) { - controller.revealCards(sourceObject.getName(), cards, game); - } - // put creature card in hand - controller.moveCards(card, Zone.LIBRARY, Zone.HAND, source, game); - // remove it from revealed card list - cards.remove(card); - // Put the rest on the bottom of your library in a random order - while (cards.size() > 0) { - card = cards.getRandom(game); - if (card != null) { + controller.revealCards(sourceObject.getIdName(), cards, game); + if (filter.match(card, game)) { + // put creature card in hand + controller.moveCards(card, Zone.LIBRARY, Zone.HAND, source, game); + // remove it from revealed card list cards.remove(card); - controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, false, false); } + // Put the rest on the bottom of your library in a random order + Cards randomOrder = new CardsImpl(); + while (cards.size() > 0) { + card = cards.getRandom(game); + if (card != null) { + cards.remove(card); + randomOrder.add(card); + controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, false, false); + } + } + controller.putCardsOnBottomOfLibrary(randomOrder, game, source, false); } return true; } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/FlameshadowConjuring.java b/Mage.Sets/src/mage/sets/magicorigins/FlameshadowConjuring.java index 6e3492eb4ef..d8fa46e9902 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/FlameshadowConjuring.java +++ b/Mage.Sets/src/mage/sets/magicorigins/FlameshadowConjuring.java @@ -54,9 +54,9 @@ import mage.target.targetpointer.FixedTarget; * @author fireshoes */ public class FlameshadowConjuring extends CardImpl { - + private static final FilterControlledCreaturePermanent filterNontoken = new FilterControlledCreaturePermanent("nontoken creature"); - + static { filterNontoken.add(Predicates.not(new TokenPredicate())); } @@ -66,8 +66,8 @@ public class FlameshadowConjuring extends CardImpl { this.expansionSetCode = "ORI"; // Whenever a nontoken creature enters the battlefield under your control, you may pay {R}. If you do, put a token onto the battlefield that's a copy of that creature. That token gains haste. Exile it at the beginning of the next end step. - Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new FlameshadowConjuringEffect(), filterNontoken, false, SetTargetPointer.PERMANENT, - "Whenever a nontoken creature enters the battlefield under your control, you may pay {R}. If you do, put a token onto the battlefield that's a copy of that creature. That token gains haste. Exile it at the beginning of the next end step"); + Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new FlameshadowConjuringEffect(), filterNontoken, false, SetTargetPointer.PERMANENT, + "Whenever a nontoken creature enters the battlefield under your control, you may pay {R}. If you do, put a token onto the battlefield that's a copy of that creature. That token gains haste. Exile it at the beginning of the next end step"); ability.addCost(new ManaCostsImpl("{R}")); this.addAbility(ability); } @@ -104,19 +104,20 @@ class FlameshadowConjuringEffect extends OneShotEffect { if (permanent != null) { PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(null, null, true); effect.setTargetPointer(getTargetPointer()); - if (effect.apply(game, source) && effect.getAddedPermanent() != null) { - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(effect.getAddedPermanent().getId())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - + if (effect.apply(game, source)) { + for (Permanent tokenPermanent : effect.getAddedPermanent()) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } return true; } } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/GatherThePack.java b/Mage.Sets/src/mage/sets/magicorigins/GatherThePack.java index c6087d29b07..2d02e4ee35b 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/GatherThePack.java +++ b/Mage.Sets/src/mage/sets/magicorigins/GatherThePack.java @@ -28,6 +28,7 @@ package mage.sets.magicorigins; import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.condition.common.SpellMasteryCondition; import mage.abilities.effects.OneShotEffect; @@ -83,12 +84,14 @@ class GatherThePackEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { + MageObject sourceObject = source.getSourceObject(game); + if (controller == null || sourceObject == null) { return false; } Cards cards = new CardsImpl(Zone.LIBRARY); cards.addAll(controller.getLibrary().getTopCards(game, 5)); if (!cards.isEmpty()) { + controller.revealCards(sourceObject.getIdName(), cards, game); int creatures = cards.count(new FilterCreatureCard(), source.getSourceId(), source.getControllerId(), game); if (creatures > 0) { int max = 1; diff --git a/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java b/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java index 67c718987ce..70692bfa083 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java +++ b/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java @@ -32,14 +32,13 @@ import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.RequirementEffect; import mage.abilities.effects.common.PreventAllDamageToSourceEffect; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -47,7 +46,6 @@ import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.TurnPhase; -import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; @@ -62,27 +60,27 @@ import mage.target.common.TargetCreaturePermanent; public class GideonBattleForged extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent(); - + static { filter.add(new ControllerPredicate(TargetController.OPPONENT)); } - + public GideonBattleForged(UUID ownerId) { super(ownerId, 23, "Gideon, Battle-Forged", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, ""); this.expansionSetCode = "ORI"; this.subtype.add("Gideon"); - + this.color.setWhite(true); - + this.nightCard = true; this.canTransform = true; - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); - - // +2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able. + + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); + + // +2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able. LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new GideonBattleForgedAttacksIfAbleTargetEffect(Duration.Custom), 2); - loyaltyAbility.addTarget(new TargetCreaturePermanent(0,1,filter, false)); - this.addAbility(loyaltyAbility); + loyaltyAbility.addTarget(new TargetCreaturePermanent(0, 1, filter, false)); + this.addAbility(loyaltyAbility); // +1: Until your next turn, target creature gains indestructible. Untap that creature. Effect effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.UntilYourNextTurn); @@ -92,14 +90,14 @@ public class GideonBattleForged extends CardImpl { effect = new UntapTargetEffect(); effect.setText("Untap that creature"); loyaltyAbility.addEffect(effect); - this.addAbility(loyaltyAbility); + this.addAbility(loyaltyAbility); // 0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn. LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonBattleForgedToken(), "planeswalker", Duration.EndOfTurn), 0); effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn); effect.setText("Prevent all damage that would be dealt to him this turn"); ability3.addEffect(effect); - this.addAbility(ability3); + this.addAbility(ability3); } @@ -131,7 +129,7 @@ class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { int nextTurnTargetController = 0; protected MageObjectReference targetPermanentReference; - + public GideonBattleForgedAttacksIfAbleTargetEffect(Duration duration) { super(duration); staticText = "Up to one target creature an opponent controls attacks {this} during its controller's next turn if able"; @@ -147,7 +145,7 @@ class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { public GideonBattleForgedAttacksIfAbleTargetEffect copy() { return new GideonBattleForgedAttacksIfAbleTargetEffect(this); } - + @Override public boolean isInactive(Ability source, Game game) { if (targetPermanentReference == null) { @@ -160,10 +158,7 @@ class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { if (nextTurnTargetController == 0 && startingTurn != game.getTurnNum() && game.getActivePlayerId().equals(targetPermanent.getControllerId())) { nextTurnTargetController = game.getTurnNum(); } - if (game.getPhase().getType() == TurnPhase.END && nextTurnTargetController > 0 && game.getTurnNum() > nextTurnTargetController) { - return true; - } - return false; + return game.getPhase().getType() == TurnPhase.END && nextTurnTargetController > 0 && game.getTurnNum() > nextTurnTargetController; } @Override @@ -175,7 +170,7 @@ class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { targetPermanentReference = new MageObjectReference(getTargetPointer().getFirst(game, source), game); } } - + @Override public boolean applies(Permanent permanent, Ability source, Game game) { if (permanent.getId().equals(getTargetPointer().getFirst(game, source))) { diff --git a/Mage.Sets/src/mage/sets/magicorigins/GideonsPhalanx.java b/Mage.Sets/src/mage/sets/magicorigins/GideonsPhalanx.java index 58afd8bc82e..d091b330b4e 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/GideonsPhalanx.java +++ b/Mage.Sets/src/mage/sets/magicorigins/GideonsPhalanx.java @@ -28,7 +28,6 @@ package mage.sets.magicorigins; import java.util.UUID; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.condition.common.SpellMasteryCondition; import mage.abilities.decorator.ConditionalOneShotEffect; @@ -37,13 +36,12 @@ import mage.abilities.effects.common.AddContinuousEffectToGame; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.keyword.IndestructibleAbility; -import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.filter.common.FilterControlledCreaturePermanent; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.KnightToken; /** * @@ -56,7 +54,7 @@ public class GideonsPhalanx extends CardImpl { this.expansionSetCode = "ORI"; // Put four 2/2 white Knight creature tokens with vigilance onto the battlefield. - this.getSpellAbility().addEffect(new CreateTokenEffect(new GideonsPhalanxKnightToken(), 4)); + this.getSpellAbility().addEffect(new CreateTokenEffect(new KnightToken(), 4)); // Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, creatures you control gain indestructible until end of turn. Effect effect = new ConditionalOneShotEffect( @@ -75,17 +73,3 @@ public class GideonsPhalanx extends CardImpl { return new GideonsPhalanx(this); } } - -class GideonsPhalanxKnightToken extends Token { - - public GideonsPhalanxKnightToken() { - super("Knight", "2/2 white Knight creature tokens with vigilance"); - this.setOriginalExpansionSetCode("ORI"); - cardType.add(CardType.CREATURE); - color.setColor(ObjectColor.WHITE); - subtype.add("Knight"); - power = new MageInt(2); - toughness = new MageInt(2); - addAbility(VigilanceAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/magicorigins/HallowedMoonlight.java b/Mage.Sets/src/mage/sets/magicorigins/HallowedMoonlight.java index 069802820e9..c4cb42fc138 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/HallowedMoonlight.java +++ b/Mage.Sets/src/mage/sets/magicorigins/HallowedMoonlight.java @@ -36,6 +36,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; @@ -90,8 +91,7 @@ class HallowedMoonlightEffect extends ReplacementEffectImpl { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { EntersTheBattlefieldEvent entersTheBattlefieldEvent = (EntersTheBattlefieldEvent) event; - controller.moveCardToExileWithInfo(entersTheBattlefieldEvent.getTarget(), null, "", - source.getSourceId(), game, entersTheBattlefieldEvent.getFromZone(), true); + controller.moveCards(entersTheBattlefieldEvent.getTarget(), Zone.EXILED, source, game, false, false, false, null); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java b/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java index 6a1aa70c7c5..652cbf4a8c0 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java +++ b/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java @@ -30,25 +30,20 @@ package mage.sets.magicorigins; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.CountersCount; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.game.permanent.token.ThopterColorlessToken; /** @@ -65,7 +60,7 @@ public class HangarbackWalker extends CardImpl { this.toughness = new MageInt(0); // Hangarback Walker enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new HangarbackWalkerEffect(), "with X +1/+1 counters on it")); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // When Hangarback Walker dies, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield for each +1/+1 counter on Hangarback Walker. this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken(), new CountersCount(CounterType.P1P1)), false)); @@ -85,36 +80,3 @@ public class HangarbackWalker extends CardImpl { return new HangarbackWalker(this); } } - -class HangarbackWalkerEffect extends OneShotEffect { - - public HangarbackWalkerEffect() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - public HangarbackWalkerEffect(final HangarbackWalkerEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public HangarbackWalkerEffect copy() { - return new HangarbackWalkerEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/magicorigins/InfiniteObliteration.java b/Mage.Sets/src/mage/sets/magicorigins/InfiniteObliteration.java index 030db436a14..9b85d3cdf94 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/InfiniteObliteration.java +++ b/Mage.Sets/src/mage/sets/magicorigins/InfiniteObliteration.java @@ -113,10 +113,7 @@ class InfiniteObliterationEffect extends SearchTargetGraveyardHandLibraryForCard @Override public String getText(Mode mode) { - StringBuilder sb = new StringBuilder(); - sb.append("Name a creature card. "); - sb.append(super.getText(mode)); - return sb.toString(); + return "Name a creature card. " + super.getText(mode); } } diff --git a/Mage.Sets/src/mage/sets/magicorigins/JaceTelepathUnbound.java b/Mage.Sets/src/mage/sets/magicorigins/JaceTelepathUnbound.java index 32b4489ce85..3e55cfbfbd3 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/JaceTelepathUnbound.java +++ b/Mage.Sets/src/mage/sets/magicorigins/JaceTelepathUnbound.java @@ -30,7 +30,7 @@ package mage.sets.magicorigins; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.ContinuousEffect; @@ -40,7 +40,6 @@ import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.AsThoughEffectType; @@ -49,7 +48,6 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterSpell; import mage.filter.common.FilterInstantOrSorceryCard; import mage.game.Game; @@ -57,7 +55,7 @@ import mage.game.command.Emblem; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; import mage.players.Player; -import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetOpponent; import mage.target.targetpointer.FixedTarget; @@ -77,7 +75,7 @@ public class JaceTelepathUnbound extends CardImpl { this.nightCard = true; this.canTransform = true; - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); // +1: Up to one target creature gets -2/-0 until your next turn. Effect effect = new BoostTargetEffect(-2, 0, Duration.UntilYourNextTurn); @@ -88,7 +86,7 @@ public class JaceTelepathUnbound extends CardImpl { // -3: You may cast target instant or sorcery card from your graveyard this turn. If that card would be put into your graveyard this turn, exile it instead. ability = new LoyaltyAbility(new JaceTelepathUnboundEffect(), -3); - ability.addTarget(new TargetCardInGraveyard(new FilterInstantOrSorceryCard())); + ability.addTarget(new TargetCardInYourGraveyard(new FilterInstantOrSorceryCard())); this.addAbility(ability); // -9: You get an emblem with "Whenever you cast a spell, target opponent puts the top five cards of his or her library into his or her graveyard". @@ -126,7 +124,7 @@ class JaceTelepathUnboundEffect extends OneShotEffect { Card card = game.getCard(this.getTargetPointer().getFirst(game, source)); if (card != null) { ContinuousEffect effect = new JaceTelepathUnboundCastFromGraveyardEffect(); - effect.setTargetPointer(new FixedTarget(card.getId())); + effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); game.addEffect(effect, source); effect = new JaceTelepathUnboundReplacementEffect(card.getId()); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/sets/magicorigins/LilianaDefiantNecromancer.java b/Mage.Sets/src/mage/sets/magicorigins/LilianaDefiantNecromancer.java index 68e4320e8b6..67cdc1e5242 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/LilianaDefiantNecromancer.java +++ b/Mage.Sets/src/mage/sets/magicorigins/LilianaDefiantNecromancer.java @@ -32,7 +32,7 @@ import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; import mage.abilities.common.DiesCreatureTriggeredAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; @@ -40,7 +40,6 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; import mage.cards.Card; import mage.cards.CardImpl; @@ -49,7 +48,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.common.FilterCreatureCard; @@ -57,7 +55,6 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.filter.predicate.mageobject.SupertypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.command.Emblem; import mage.target.common.TargetCardInYourGraveyard; @@ -84,9 +81,8 @@ public class LilianaDefiantNecromancer extends CardImpl { this.color.setBlack(true); this.nightCard = true; - // this.canTransform = true; - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +2: Each player discards a card. this.addAbility(new LoyaltyAbility(new DiscardEachPlayerEffect(1, false), 2)); @@ -97,7 +93,7 @@ public class LilianaDefiantNecromancer extends CardImpl { ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); - //-8: You get an emblem with "Whenever a creature you control dies, return it to the battlefield under your control at the beginning of the next end step."; + //-8: You get an emblem with "Whenever a creature dies, return it to the battlefield under your control at the beginning of the next end step."; this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new LilianaDefiantNecromancerEmblem()), -8)); } @@ -130,11 +126,7 @@ public class LilianaDefiantNecromancer extends CardImpl { class LilianaDefiantNecromancerEmblem extends Emblem { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature you control"); - - static { - filter.add(new ControllerPredicate(TargetController.YOU)); - } + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature"); // You get an emblem with "Whenever a creature you control dies, return it to the battlefield under your control at the beginning of the next end step." public LilianaDefiantNecromancerEmblem() { diff --git a/Mage.Sets/src/mage/sets/magicorigins/MizziumMeddler.java b/Mage.Sets/src/mage/sets/magicorigins/MizziumMeddler.java index c0a7dc19aec..a59cd456d34 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/MizziumMeddler.java +++ b/Mage.Sets/src/mage/sets/magicorigins/MizziumMeddler.java @@ -29,23 +29,14 @@ package mage.sets.magicorigins; import java.util.UUID; import mage.MageInt; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChangeATargetOfTargetSpellAbilityToSourceEffect; import mage.abilities.keyword.FlashAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.game.Game; -import mage.game.stack.Spell; -import mage.game.stack.StackAbility; -import mage.game.stack.StackObject; -import mage.players.Player; -import mage.target.Target; import mage.target.TargetStackObject; -import mage.target.Targets; /** * @@ -63,9 +54,9 @@ public class MizziumMeddler extends CardImpl { // Flash this.addAbility(FlashAbility.getInstance()); - - // When Mizzium Meddler enters the battlefield, change a target of target spell or ability to Mizzium Meddler. - Ability ability = new EntersBattlefieldTriggeredAbility(new MizziumMeddlerEffect()); + + // When Mizzium Meddler enters the battlefield, you may change a target of target spell or ability to Mizzium Meddler. + Ability ability = new EntersBattlefieldTriggeredAbility(new ChangeATargetOfTargetSpellAbilityToSourceEffect(), true); ability.addTarget(new TargetStackObject()); this.addAbility(ability); } @@ -79,92 +70,3 @@ public class MizziumMeddler extends CardImpl { return new MizziumMeddler(this); } } - -class MizziumMeddlerEffect extends OneShotEffect { - - public MizziumMeddlerEffect() { - super(Outcome.Neutral); - staticText = "Change a target of target spell or ability to {this}"; - } - - public MizziumMeddlerEffect(final MizziumMeddlerEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); - MageObject sourceObject = game.getObject(source.getSourceId()); - if (stackObject != null && sourceObject != null) { - Targets targets; - Ability sourceAbility; - MageObject oldTarget = null; - if (stackObject instanceof Spell) { - Spell spell = (Spell)stackObject; - sourceAbility = spell.getSpellAbility(); - targets = spell.getSpellAbility().getTargets(); - } else if (stackObject instanceof StackAbility) { - StackAbility stackAbility = (StackAbility)stackObject; - sourceAbility = stackAbility; - targets = stackAbility.getTargets(); - } else { - return false; - } - boolean twoTimesTarget = false; - if (targets.size() == 1 && targets.get(0).getTargets().size() == 1) { - Target target = targets.get(0); - if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) { - oldTarget = game.getObject(targets.getFirstTarget()); - target.clearChosen(); - // The source is still the spell on the stack - target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); - } - } else { - Player player = game.getPlayer(source.getControllerId()); - for (Target target: targets) { - for (UUID targetId: target.getTargets()) { - MageObject object = game.getObject(targetId); - String name; - if (object == null) { - Player targetPlayer = game.getPlayer(targetId); - name = targetPlayer.getLogName(); - } else { - name = object.getName(); - } - if (!targetId.equals(source.getSourceId()) && target.getTargets().contains(source.getSourceId())) { - // you can't change this target to MizziumMeddler because MizziumMeddler is already another targetId of that target. - twoTimesTarget = true; - continue; - } - if (name != null && player.chooseUse(Outcome.Neutral, new StringBuilder("Change target from ").append(name).append(" to ").append(sourceObject.getName()).append("?").toString(), source, game)) { - if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) { - oldTarget = game.getObject(targets.getFirstTarget()); - target.remove(targetId); - // The source is still the spell on the stack - target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); - break; - } - } - } - } - } - if (oldTarget != null) { - game.informPlayers(sourceObject.getLogName() + ": Changed target of " +stackObject.getLogName() + " from " + oldTarget.getLogName() + " to " + sourceObject.getLogName()); - } else { - if (twoTimesTarget) { - game.informPlayers(sourceObject.getLogName() + ": Target not changed to " + sourceObject.getLogName() + " because its not valid to target it twice for " + stackObject.getName()); - } else { - game.informPlayers(sourceObject.getLogName() + ": Target not changed to " + sourceObject.getLogName() + " because its no valid target for " + stackObject.getName()); - } - } - return true; - } - return false; - } - - @Override - public MizziumMeddlerEffect copy() { - return new MizziumMeddlerEffect(this); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magicorigins/NissaSageAnimist.java b/Mage.Sets/src/mage/sets/magicorigins/NissaSageAnimist.java index 7959cf7f6b3..c1e5a65d797 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/NissaSageAnimist.java +++ b/Mage.Sets/src/mage/sets/magicorigins/NissaSageAnimist.java @@ -28,14 +28,14 @@ package mage.sets.magicorigins; import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.UntapTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardsImpl; @@ -46,7 +46,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -68,7 +67,7 @@ public class NissaSageAnimist extends CardImpl { this.nightCard = true; - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand. this.addAbility(new LoyaltyAbility(new NissaSageAnimistPlusOneEffect(), 1)); @@ -112,19 +111,18 @@ class NissaSageAnimistPlusOneEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null && controller.getLibrary().size() > 0) { + MageObject sourceObject = game.getObject(source.getSourceId()); + if (sourceObject != null && controller != null && controller.getLibrary().size() > 0) { Card card = controller.getLibrary().getFromTop(game); if (card == null) { return false; } - CardsImpl cards = new CardsImpl(); - cards.add(card); - controller.revealCards("Nissa, Sage Animist", cards, game); + controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); + Zone targetZone = Zone.HAND; if (card.getCardType().contains(CardType.LAND)) { - return controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); - } else { - return controller.moveCards(card, Zone.LIBRARY, Zone.HAND, source, game); + targetZone = Zone.BATTLEFIELD; } + return controller.moveCards(card, null, targetZone, source, game); } return true; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/NissasPilgrimage.java b/Mage.Sets/src/mage/sets/magicorigins/NissasPilgrimage.java index 7fd632cb301..d6023fed3fa 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/NissasPilgrimage.java +++ b/Mage.Sets/src/mage/sets/magicorigins/NissasPilgrimage.java @@ -1,125 +1,126 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.magicorigins; - -import java.util.UUID; -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.condition.common.SpellMasteryCondition; -import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.FilterCard; -import mage.filter.common.FilterBasicLandCard; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.players.Player; -import mage.target.common.TargetCardInLibrary; - -/** - * - * @author LevelX2 - */ -public class NissasPilgrimage extends CardImpl { - - public NissasPilgrimage(UUID ownerId) { - super(ownerId, 190, "Nissa's Pilgrimage", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}"); - this.expansionSetCode = "ORI"; - - // Search your library for up to two basic Forest cards, reveal those cards, and put one onto the battlefield tapped and the rest into your hand. Then shuffle your library. - // Spell Mastery — If there are two or more instant and/or sorcery cards in your graveyard, search your library for up to three basic Forest cards instead of two. - this.getSpellAbility().addEffect(new NissasPilgrimageEffect()); - } - - public NissasPilgrimage(final NissasPilgrimage card) { - super(card); - } - - @Override - public NissasPilgrimage copy() { - return new NissasPilgrimage(this); - } -} - -class NissasPilgrimageEffect extends OneShotEffect { - - private static final FilterCard filter = new FilterBasicLandCard("basic Forest"); - - static { - filter.add(new SubtypePredicate("Forest")); - } - - public NissasPilgrimageEffect() { - super(Outcome.Benefit); - this.staticText = "Search your library for up to two basic Forest cards, reveal those cards, and put one onto the battlefield tapped and the rest into your hand. Then shuffle your library." - + "
Spell Mastery — If there are two or more instant and/or sorcery cards in your graveyard, search your library for up to three basic Forest cards instead of two."; - } - - public NissasPilgrimageEffect(final NissasPilgrimageEffect effect) { - super(effect); - } - - @Override - public NissasPilgrimageEffect copy() { - return new NissasPilgrimageEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - MageObject sourceObject = source.getSourceObject(game); - if (controller != null && sourceObject != null) { - int number = 2; - if (SpellMasteryCondition.getInstance().apply(game, source)) { - number++; - } - TargetCardInLibrary target = new TargetCardInLibrary(0, number, filter); - controller.searchLibrary(target, game); - if (!target.getTargets().isEmpty()) { - Cards cards = new CardsImpl(target.getTargets()); - controller.revealCards(sourceObject.getIdName(), cards, game); - if (!cards.isEmpty()) { - Card card = cards.getRandom(game); - if (card != null) { - cards.remove(card); - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true); - controller.moveCards(cards, Zone.LIBRARY, Zone.HAND, source, game); - } - } - } - return true; - } - return false; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.magicorigins; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.condition.common.SpellMasteryCondition; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterBasicLandCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LevelX2 + */ +public class NissasPilgrimage extends CardImpl { + + public NissasPilgrimage(UUID ownerId) { + super(ownerId, 190, "Nissa's Pilgrimage", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}"); + this.expansionSetCode = "ORI"; + + // Search your library for up to two basic Forest cards, reveal those cards, and put one onto the battlefield tapped and the rest into your hand. Then shuffle your library. + // Spell Mastery — If there are two or more instant and/or sorcery cards in your graveyard, search your library for up to three basic Forest cards instead of two. + this.getSpellAbility().addEffect(new NissasPilgrimageEffect()); + } + + public NissasPilgrimage(final NissasPilgrimage card) { + super(card); + } + + @Override + public NissasPilgrimage copy() { + return new NissasPilgrimage(this); + } +} + +class NissasPilgrimageEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterBasicLandCard("basic Forest"); + + static { + filter.add(new SubtypePredicate("Forest")); + } + + public NissasPilgrimageEffect() { + super(Outcome.Benefit); + this.staticText = "Search your library for up to two basic Forest cards, reveal those cards, and put one onto the battlefield tapped and the rest into your hand. Then shuffle your library." + + "
Spell Mastery — If there are two or more instant and/or sorcery cards in your graveyard, search your library for up to three basic Forest cards instead of two."; + } + + public NissasPilgrimageEffect(final NissasPilgrimageEffect effect) { + super(effect); + } + + @Override + public NissasPilgrimageEffect copy() { + return new NissasPilgrimageEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + int number = 2; + if (SpellMasteryCondition.getInstance().apply(game, source)) { + number++; + } + TargetCardInLibrary target = new TargetCardInLibrary(0, number, filter); + controller.searchLibrary(target, game); + if (!target.getTargets().isEmpty()) { + Cards cards = new CardsImpl(target.getTargets()); + controller.revealCards(sourceObject.getIdName(), cards, game); + if (!cards.isEmpty()) { + Card card = cards.getRandom(game); + if (card != null) { + cards.remove(card); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); + controller.moveCards(cards, Zone.HAND, source, game); + } + } + } + controller.shuffleLibrary(game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/PiaAndKiranNalaar.java b/Mage.Sets/src/mage/sets/magicorigins/PiaAndKiranNalaar.java index a0d055231c0..da04c314ed9 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/PiaAndKiranNalaar.java +++ b/Mage.Sets/src/mage/sets/magicorigins/PiaAndKiranNalaar.java @@ -34,6 +34,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; @@ -60,8 +61,10 @@ public class PiaAndKiranNalaar extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - // When Pia and Kiran Nalaar enters the battlefield put 2 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield. - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken(), 2))); + // When Pia and Kiran Nalaar enters the battlefield, put two 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield. + Effect effect = new CreateTokenEffect(new ThopterColorlessToken(), 2); + effect.setText("put two 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield"); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); // {2}{R}, Sacrifice an artifact: Pia and Kiran Nalaar deals 2 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{2}{R}")); diff --git a/Mage.Sets/src/mage/sets/magicorigins/PriestOfTheBloodRite.java b/Mage.Sets/src/mage/sets/magicorigins/PriestOfTheBloodRite.java index 6eed42819e2..ad780413154 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/PriestOfTheBloodRite.java +++ b/Mage.Sets/src/mage/sets/magicorigins/PriestOfTheBloodRite.java @@ -38,7 +38,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.TargetController; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.DemonToken; /** * @@ -70,19 +70,3 @@ public class PriestOfTheBloodRite extends CardImpl { return new PriestOfTheBloodRite(this); } } - -class DemonToken extends Token { - - DemonToken() { - super("Demon", "5/5 black Demon creature token with flying"); - cardType.add(CardType.CREATURE); - subtype.add("Demon"); - setOriginalExpansionSetCode("ORI"); - - color.setBlack(true); - power = new MageInt(5); - toughness = new MageInt(5); - - addAbility(FlyingAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/magicorigins/PsychicRebuttal.java b/Mage.Sets/src/mage/sets/magicorigins/PsychicRebuttal.java index cdc1ecbfb18..84aca36df0f 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/PsychicRebuttal.java +++ b/Mage.Sets/src/mage/sets/magicorigins/PsychicRebuttal.java @@ -29,6 +29,7 @@ package mage.sets.magicorigins; import java.util.UUID; import mage.abilities.Ability; +import mage.abilities.Mode; import mage.abilities.condition.common.SpellMasteryCondition; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -137,9 +138,8 @@ class PsychicRebuttalPredicate implements ObjectPlayerPredicate isDependentTo(List allEffectsInLayer) { + Set dependentTo = null; + for (ContinuousEffect effect : allEffectsInLayer) { + // http://www.slightlymagic.net/forum/viewtopic.php?f=70&t=17664&start=30#p185513 + if (effect.getDependencyTypes().contains(DependencyType.AuraAddingRemoving)) { + if (dependentTo == null) { + dependentTo = new HashSet<>(); + } + dependentTo.add(effect.getId()); + } + } + return dependentTo; + } } diff --git a/Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java b/Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java index dd5b0b2a6ca..82e8cf76365 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java +++ b/Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java @@ -36,8 +36,9 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileSpellEffect; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -92,61 +93,62 @@ class TheGreatAuroraEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { - Map> permanentsOwned = new HashMap<>(); - Collection permanents = game.getBattlefield().getAllPermanents(); - for (Permanent permanent : permanents) { - List list = permanentsOwned.get(permanent.getOwnerId()); - if (list == null) { - list = new ArrayList<>(); - permanentsOwned.put(permanent.getOwnerId(), list); - } - list.add(permanent); - } - - // shuffle permanents and hand cards into owner's library - Map permanentsCount = new HashMap<>(); - - for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { - Player player = game.getPlayer(playerId); - if (player != null) { - int handCards = player.getHand().size(); - player.moveCards(player.getHand(), Zone.HAND, Zone.LIBRARY, source, game); - List list = permanentsOwned.remove(player.getId()); - permanentsCount.put(playerId, handCards + (list != null ? list.size() : 0)); - for (Permanent permanent : list) { - player.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true); + Map> permanentsOwned = new HashMap<>(); + Collection permanents = game.getBattlefield().getActivePermanents(source.getControllerId(), game); + for (Permanent permanent : permanents) { + List list = permanentsOwned.get(permanent.getOwnerId()); + if (list == null) { + list = new ArrayList<>(); + permanentsOwned.put(permanent.getOwnerId(), list); } - player.getLibrary().shuffle(); + list.add(permanent); } - } - // Draw cards - for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { - Player player = game.getPlayer(playerId); - if (player != null) { - int count = permanentsCount.get(playerId); - if (count > 0) { - player.drawCards(count, game); + // shuffle permanents and hand cards into owner's library + Map permanentsCount = new HashMap<>(); + + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + int handCards = player.getHand().size(); + player.moveCards(player.getHand(), Zone.HAND, Zone.LIBRARY, source, game); + List list = permanentsOwned.remove(player.getId()); + permanentsCount.put(playerId, handCards + (list != null ? list.size() : 0)); + for (Permanent permanent : list) { + player.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true); + } + player.shuffleLibrary(game); } } - } - // put lands onto the battlefield - for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { - Player player = game.getPlayer(playerId); - if (player != null) { - TargetCard target = new TargetCardInHand(0, Integer.MAX_VALUE, new FilterLandCard("put any number of land cards from your hand onto the battlefield")); - player.chooseTarget(Outcome.PutLandInPlay, player.getHand(), target, source, game); - for (UUID cardId : target.getTargets()) { - Card card = game.getCard(cardId); - if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId(), false); + game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw or put into play + + // Draw cards + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + int count = permanentsCount.get(playerId); + if (count > 0) { + player.drawCards(count, game); } } - } + + // put lands onto the battlefield + Cards toBattlefield = new CardsImpl(); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + TargetCard target = new TargetCardInHand(0, Integer.MAX_VALUE, new FilterLandCard("put any number of land cards from your hand onto the battlefield")); + player.chooseTarget(Outcome.PutLandInPlay, player.getHand(), target, source, game); + toBattlefield.addAll(target.getTargets()); + } + } + return controller.moveCards(toBattlefield.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null); } - return true; + return false; } } diff --git a/Mage.Sets/src/mage/sets/magicorigins/ThopterEngineer.java b/Mage.Sets/src/mage/sets/magicorigins/ThopterEngineer.java index dd0a4a1c202..a0cd37ed550 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/ThopterEngineer.java +++ b/Mage.Sets/src/mage/sets/magicorigins/ThopterEngineer.java @@ -42,7 +42,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.ThopterColorlessToken; /** * @@ -55,7 +55,7 @@ public class ThopterEngineer extends CardImpl { static { filter.add(new CardTypePredicate(CardType.ARTIFACT)); } - + public ThopterEngineer(UUID ownerId) { super(ownerId, 165, "Thopter Engineer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.expansionSetCode = "ORI"; @@ -65,8 +65,8 @@ public class ThopterEngineer extends CardImpl { this.toughness = new MageInt(3); // When Thopter Engineer enters the battlefield, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield. - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ThopterEngineerThopterToken(), 1))); - + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken(), 1))); + // Artifact creatures you control have haste. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, false))); } @@ -80,15 +80,3 @@ public class ThopterEngineer extends CardImpl { return new ThopterEngineer(this); } } - -class ThopterEngineerThopterToken extends Token { - ThopterEngineerThopterToken() { - super("Thopter", "a 1/1 colorless Thopter artifact creature token with flying"); - cardType.add(CardType.CREATURE); - cardType.add(CardType.ARTIFACT); - subtype.add("Thopter"); - power = new MageInt(1); - toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/magicorigins/TouchOfMoonglove.java b/Mage.Sets/src/mage/sets/magicorigins/TouchOfMoonglove.java index 07c52503d96..9edcf4a82fd 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/TouchOfMoonglove.java +++ b/Mage.Sets/src/mage/sets/magicorigins/TouchOfMoonglove.java @@ -33,7 +33,7 @@ import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.DeathtouchAbility; @@ -86,7 +86,7 @@ public class TouchOfMoonglove extends CardImpl { class TouchOfMoongloveAddTriggerEffect extends OneShotEffect { public TouchOfMoongloveAddTriggerEffect() { - super(Outcome.Damage); + super(Outcome.LoseLife); this.staticText = "Whenever a creature dealt damage by that creature this turn dies, its controller loses 2 life"; } @@ -118,7 +118,7 @@ class TouchOfMoongloveDelayedTriggeredAbility extends DelayedTriggeredAbility { private final MageObjectReference creatureToCheck; public TouchOfMoongloveDelayedTriggeredAbility(MageObjectReference creatureToCheck) { - super(new DamageTargetEffect(2), Duration.EndOfTurn, false); + super(new LoseLifeTargetEffect(2), Duration.EndOfTurn, false); this.creatureToCheck = creatureToCheck; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/WhirlerRogue.java b/Mage.Sets/src/mage/sets/magicorigins/WhirlerRogue.java index 076b8314087..6595068189c 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/WhirlerRogue.java +++ b/Mage.Sets/src/mage/sets/magicorigins/WhirlerRogue.java @@ -33,6 +33,7 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; import mage.cards.CardImpl; @@ -50,7 +51,7 @@ import mage.target.common.TargetCreaturePermanent; * @author fireshoes */ public class WhirlerRogue extends CardImpl { - + private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifacts"); static { @@ -67,8 +68,10 @@ public class WhirlerRogue extends CardImpl { this.toughness = new MageInt(2); // When Whirler Rogue enters the battlefield, put two 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield. - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken(), 2))); - + Effect effect = new CreateTokenEffect(new ThopterColorlessToken(), 2); + effect.setText("put two 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield"); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); + // Tap two untapped artifacts you control: Target creature can't be blocked this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedTargetEffect(), new TapTargetCost(new TargetControlledPermanent(2, 2, filter, true))); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/magicorigins/WoodlandBellower.java b/Mage.Sets/src/mage/sets/magicorigins/WoodlandBellower.java index adfa437ce62..3df2f8848c2 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/WoodlandBellower.java +++ b/Mage.Sets/src/mage/sets/magicorigins/WoodlandBellower.java @@ -78,6 +78,7 @@ public class WoodlandBellower extends CardImpl { } class WoodlandBellowerEffect extends OneShotEffect { + WoodlandBellowerEffect() { super(Outcome.PutCreatureInPlay); staticText = "Search your library for a nonlegendary green creature card with converted mana cost 3 or less, put it onto the battlefield, then shuffle your library"; @@ -89,27 +90,25 @@ class WoodlandBellowerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } FilterCard filter = new FilterCard("nonlegendary green creature card with converted mana cost 3 or less"); filter.add(new ColorPredicate(ObjectColor.GREEN)); - filter.add(new CardTypePredicate(CardType.CREATURE)); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(Predicates.not(new SupertypePredicate("Legendary"))); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 4)); TargetCardInLibrary target = new TargetCardInLibrary(filter); - if (player.searchLibrary(target, game)) { + if (controller.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { - Card card = player.getLibrary().getCard(target.getFirstTarget(), game); - if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); - } + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return true; } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return false; } @@ -118,4 +117,4 @@ class WoodlandBellowerEffect extends OneShotEffect { return new WoodlandBellowerEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/Amnesia.java b/Mage.Sets/src/mage/sets/mastersedition/Amnesia.java new file mode 100644 index 00000000000..9e288751551 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/Amnesia.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Amnesia extends mage.sets.thedark.Amnesia { + + public Amnesia(UUID ownerId) { + super(ownerId); + this.cardNumber = 29; + this.expansionSetCode = "MED"; + this.rarity = Rarity.RARE; + } + + public Amnesia(final Amnesia card) { + super(card); + } + + @Override + public Amnesia copy() { + return new Amnesia(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/BasalThrull.java b/Mage.Sets/src/mage/sets/mastersedition/BasalThrull.java new file mode 100644 index 00000000000..a2cc39602c0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/BasalThrull.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class BasalThrull extends mage.sets.fallenempires.BasalThrull1 { + + public BasalThrull(UUID ownerId) { + super(ownerId); + this.cardNumber = 59; + this.expansionSetCode = "MED"; + } + + public BasalThrull(final BasalThrull card) { + super(card); + } + + @Override + public BasalThrull copy() { + return new BasalThrull(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/BrothersOfFire.java b/Mage.Sets/src/mage/sets/mastersedition/BrothersOfFire.java new file mode 100644 index 00000000000..2d485e3c98b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/BrothersOfFire.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class BrothersOfFire extends mage.sets.fourthedition.BrothersOfFire { + + public BrothersOfFire(UUID ownerId) { + super(ownerId); + this.cardNumber = 89; + this.expansionSetCode = "MED"; + } + + public BrothersOfFire(final BrothersOfFire card) { + super(card); + } + + @Override + public BrothersOfFire copy() { + return new BrothersOfFire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/DeathSpeakers.java b/Mage.Sets/src/mage/sets/mastersedition/DeathSpeakers.java new file mode 100644 index 00000000000..cb159362323 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/DeathSpeakers.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class DeathSpeakers extends mage.sets.homelands.DeathSpeakers { + + public DeathSpeakers(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "MED"; + this.rarity = Rarity.COMMON; + } + + public DeathSpeakers(final DeathSpeakers card) { + super(card); + } + + @Override + public DeathSpeakers copy() { + return new DeathSpeakers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/GoblinMutant.java b/Mage.Sets/src/mage/sets/mastersedition/GoblinMutant.java new file mode 100644 index 00000000000..1fe41f0eb98 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/GoblinMutant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; + +/** + * + * @author BursegSardaukar + */ +public class GoblinMutant extends mage.sets.iceage.GoblinMutant { + + public GoblinMutant(UUID ownerId) { + super(ownerId); + this.expansionSetCode = "MED"; + this.cardNumber = 96; + } + + public GoblinMutant(final GoblinMutant card) { + super(card); + } + + @Override + public GoblinMutant copy() { + return new GoblinMutant(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mastersedition/GoblinWizard.java b/Mage.Sets/src/mage/sets/mastersedition/GoblinWizard.java new file mode 100644 index 00000000000..47465f6d88b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/GoblinWizard.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; + +/** + * + * @author BursegSardaukar + */ +public class GoblinWizard extends mage.sets.thedark.GoblinWizard { + + public GoblinWizard(UUID ownerId) { + super(ownerId); + this.cardNumber = 97; + this.expansionSetCode = "MED"; + } + + public GoblinWizard(final GoblinWizard card) { + super(card); + } + + @Override + public GoblinWizard copy() { + return new GoblinWizard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/GoblinsOfTheFlarg.java b/Mage.Sets/src/mage/sets/mastersedition/GoblinsOfTheFlarg.java new file mode 100644 index 00000000000..0fa43306c59 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/GoblinsOfTheFlarg.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GoblinsOfTheFlarg extends mage.sets.thedark.GoblinsOfTheFlarg { + + public GoblinsOfTheFlarg(UUID ownerId) { + super(ownerId); + this.cardNumber = 98; + this.expansionSetCode = "MED"; + } + + public GoblinsOfTheFlarg(final GoblinsOfTheFlarg card) { + super(card); + } + + @Override + public GoblinsOfTheFlarg copy() { + return new GoblinsOfTheFlarg(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/GraniteGargoyle.java b/Mage.Sets/src/mage/sets/mastersedition/GraniteGargoyle.java new file mode 100644 index 00000000000..c0b301e1e18 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/GraniteGargoyle.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class GraniteGargoyle extends mage.sets.revisededition.GraniteGargoyle { + + public GraniteGargoyle(UUID ownerId) { + super(ownerId); + this.cardNumber = 99; + this.expansionSetCode = "MED"; + this.rarity = Rarity.UNCOMMON; + } + + public GraniteGargoyle(final GraniteGargoyle card) { + super(card); + } + + @Override + public GraniteGargoyle copy() { + return new GraniteGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/HungryMist.java b/Mage.Sets/src/mage/sets/mastersedition/HungryMist.java new file mode 100644 index 00000000000..88df432a47e --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/HungryMist.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class HungryMist extends mage.sets.fifthedition.HungryMist { + + public HungryMist(UUID ownerId) { + super(ownerId); + this.cardNumber = 121; + this.expansionSetCode = "MED"; + } + + public HungryMist(final HungryMist card) { + super(card); + } + + @Override + public HungryMist copy() { + return new HungryMist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/HyalopterousLemure.java b/Mage.Sets/src/mage/sets/mastersedition/HyalopterousLemure.java new file mode 100644 index 00000000000..1cc28a6e665 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/HyalopterousLemure.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class HyalopterousLemure extends mage.sets.iceage.HyalopterousLemure { + + public HyalopterousLemure(UUID ownerId) { + super(ownerId); + this.cardNumber = 72; + this.expansionSetCode = "MED"; + this.rarity = Rarity.COMMON; + } + + public HyalopterousLemure(final HyalopterousLemure card) { + super(card); + } + + @Override + public HyalopterousLemure copy() { + return new HyalopterousLemure(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/HymnOfRebirth.java b/Mage.Sets/src/mage/sets/mastersedition/HymnOfRebirth.java new file mode 100644 index 00000000000..7e5342d83e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/HymnOfRebirth.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInGraveyard; + +/** + * + * @author LoneFox + */ +public class HymnOfRebirth extends CardImpl { + + public HymnOfRebirth(UUID ownerId) { + super(ownerId, 146, "Hymn of Rebirth", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}{W}"); + this.expansionSetCode = "MED"; + + // Put target creature card from a graveyard onto the battlefield under your control. + this.getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard"))); + this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); + } + + public HymnOfRebirth(final HymnOfRebirth card) { + super(card); + } + + @Override + public HymnOfRebirth copy() { + return new HymnOfRebirth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/IcatianLieutenant.java b/Mage.Sets/src/mage/sets/mastersedition/IcatianLieutenant.java new file mode 100644 index 00000000000..474452b7b3b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/IcatianLieutenant.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class IcatianLieutenant extends mage.sets.fallenempires.IcatianLieutenant { + + public IcatianLieutenant(UUID ownerId) { + super(ownerId); + this.cardNumber = 17; + this.expansionSetCode = "MED"; + this.rarity = Rarity.COMMON; + } + + public IcatianLieutenant(final IcatianLieutenant card) { + super(card); + } + + @Override + public IcatianLieutenant copy() { + return new IcatianLieutenant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/IllusionaryForces.java b/Mage.Sets/src/mage/sets/mastersedition/IllusionaryForces.java new file mode 100644 index 00000000000..30ad0dd52e5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/IllusionaryForces.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class IllusionaryForces extends CardImpl { + + public IllusionaryForces(UUID ownerId) { + super(ownerId, 38, "Illusionary Forces", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "MED"; + this.subtype.add("Illusion"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Cumulative upkeep {U} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{U}"))); + } + + public IllusionaryForces(final IllusionaryForces card) { + super(card); + } + + @Override + public IllusionaryForces copy() { + return new IllusionaryForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/IllusionaryWall.java b/Mage.Sets/src/mage/sets/mastersedition/IllusionaryWall.java new file mode 100644 index 00000000000..91fb06dff77 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/IllusionaryWall.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class IllusionaryWall extends CardImpl { + + public IllusionaryWall(UUID ownerId) { + super(ownerId, 39, "Illusionary Wall", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "MED"; + this.subtype.add("Illusion"); + this.subtype.add("Wall"); + this.power = new MageInt(7); + this.toughness = new MageInt(4); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // Cumulative upkeep {U} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{U}"))); + } + + public IllusionaryWall(final IllusionaryWall card) { + super(card); + } + + @Override + public IllusionaryWall copy() { + return new IllusionaryWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/KhabalGhoul.java b/Mage.Sets/src/mage/sets/mastersedition/KhabalGhoul.java new file mode 100644 index 00000000000..b8e28ac2e5e --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/KhabalGhoul.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.dynamicvalue.common.CreaturesDiedThisTurnCount; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.watchers.common.CreaturesDiedWatcher; + +/** + * + * @author LoneFox + */ +public class KhabalGhoul extends CardImpl { + + public KhabalGhoul(UUID ownerId) { + super(ownerId, 75, "Khabal Ghoul", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "MED"; + this.subtype.add("Zombie"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // At the beginning of each end step, put a +1/+1 counter on Khabal Ghoul for each creature that died this turn. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(), + new CreaturesDiedThisTurnCount(), true), TargetController.ANY, false), new CreaturesDiedWatcher()); + } + + public KhabalGhoul(final KhabalGhoul card) { + super(card); + } + + @Override + public KhabalGhoul copy() { + return new KhabalGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/MindstabThrull.java b/Mage.Sets/src/mage/sets/mastersedition/MindstabThrull.java new file mode 100644 index 00000000000..2d36d067a28 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/MindstabThrull.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class MindstabThrull extends CardImpl { + + public MindstabThrull(UUID ownerId) { + super(ownerId, 76, "Mindstab Thrull", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "MED"; + this.subtype.add("Thrull"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Mindstab Thrull attacks and isn't blocked, you may sacrifice it. If you do, defending player discards three cards. + Effect effect = new DiscardTargetEffect(3); + effect.setText("defending player discards three cards"); + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(new DoIfCostPaid(effect, new SacrificeSourceCost()), false, true)); + } + + public MindstabThrull(final MindstabThrull card) { + super(card); + } + + @Override + public MindstabThrull copy() { + return new MindstabThrull(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/OrcishMechanics.java b/Mage.Sets/src/mage/sets/mastersedition/OrcishMechanics.java new file mode 100644 index 00000000000..e3f0311be5e --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/OrcishMechanics.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class OrcishMechanics extends mage.sets.antiquities.OrcishMechanics { + + public OrcishMechanics(UUID ownerId) { + super(ownerId); + this.cardNumber = 106; + this.expansionSetCode = "MED"; + this.rarity = Rarity.UNCOMMON; + } + + public OrcishMechanics(final OrcishMechanics card) { + super(card); + } + + @Override + public OrcishMechanics copy() { + return new OrcishMechanics(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/RiverMerfolk.java b/Mage.Sets/src/mage/sets/mastersedition/RiverMerfolk.java new file mode 100644 index 00000000000..4c82f59b695 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/RiverMerfolk.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class RiverMerfolk extends CardImpl { + + public RiverMerfolk(UUID ownerId) { + super(ownerId, 47, "River Merfolk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}{U}"); + this.expansionSetCode = "MED"; + this.subtype.add("Merfolk"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // {U}: River Merfolk gains mountainwalk until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new MountainwalkAbility(false), Duration.EndOfTurn), + new ManaCostsImpl("{U}"))); + } + + public RiverMerfolk(final RiverMerfolk card) { + super(card); + } + + @Override + public RiverMerfolk copy() { + return new RiverMerfolk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/Roots.java b/Mage.Sets/src/mage/sets/mastersedition/Roots.java new file mode 100644 index 00000000000..d94b49d3159 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/Roots.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Roots extends mage.sets.homelands.Roots { + + public Roots(UUID ownerId) { + super(ownerId); + this.cardNumber = 127; + this.expansionSetCode = "MED"; + this.rarity = Rarity.COMMON; + } + + public Roots(final Roots card) { + super(card); + } + + @Override + public Roots copy() { + return new Roots(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/SeaSprite.java b/Mage.Sets/src/mage/sets/mastersedition/SeaSprite.java new file mode 100644 index 00000000000..503b55f1b47 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/SeaSprite.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SeaSprite extends mage.sets.homelands.SeaSprite { + + public SeaSprite(UUID ownerId) { + super(ownerId); + this.cardNumber = 48; + this.expansionSetCode = "MED"; + this.rarity = Rarity.COMMON; + } + + public SeaSprite(final SeaSprite card) { + super(card); + } + + @Override + public SeaSprite copy() { + return new SeaSprite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/ShamblingStrider.java b/Mage.Sets/src/mage/sets/mastersedition/ShamblingStrider.java new file mode 100644 index 00000000000..e4751e59105 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/ShamblingStrider.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author hanasu + */ +public class ShamblingStrider extends CardImpl { + + public ShamblingStrider(UUID ownerId) { + super(ownerId, 129, "Shambling Strider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "MED"; + this.subtype.add("Yeti"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // {R}{G}: Shambling Strider gets +1/-1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{R}{G}"))); + } + + public ShamblingStrider(final ShamblingStrider card) { + super(card); + } + + @Override + public ShamblingStrider copy() { + return new ShamblingStrider(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/SpectralBears.java b/Mage.Sets/src/mage/sets/mastersedition/SpectralBears.java index e364e177ea7..28ee345cc88 100644 --- a/Mage.Sets/src/mage/sets/mastersedition/SpectralBears.java +++ b/Mage.Sets/src/mage/sets/mastersedition/SpectralBears.java @@ -52,7 +52,7 @@ public class SpectralBears extends CardImpl { public SpectralBears(UUID ownerId) { super(ownerId, 131, "Spectral Bears", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); - this.expansionSetCode = "HML"; + this.expansionSetCode = "MED"; this.subtype.add("Bear"); this.subtype.add("Spirit"); this.power = new MageInt(3); @@ -114,4 +114,4 @@ class SpectralBearsTriggeredAbility extends TriggeredAbilityImpl { public String getRule() { return "Whenever {this} attacks, if defending player controls no black nontoken permanents, it doesn't untap during your next untap step."; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/SpinalVillain.java b/Mage.Sets/src/mage/sets/mastersedition/SpinalVillain.java new file mode 100644 index 00000000000..38b8905645b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/SpinalVillain.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SpinalVillain extends mage.sets.legends.SpinalVillain { + + public SpinalVillain(UUID ownerId) { + super(ownerId); + this.cardNumber = 108; + this.expansionSetCode = "MED"; + this.rarity = Rarity.UNCOMMON; + } + + public SpinalVillain(final SpinalVillain card) { + super(card); + } + + @Override + public SpinalVillain copy() { + return new SpinalVillain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/StormSeeker.java b/Mage.Sets/src/mage/sets/mastersedition/StormSeeker.java new file mode 100644 index 00000000000..d2aca3cc6b1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/StormSeeker.java @@ -0,0 +1,95 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author hanasu + */ +public class StormSeeker extends CardImpl { + + public StormSeeker(UUID ownerId) { + super(ownerId, 132, "Storm Seeker", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{G}"); + this.expansionSetCode = "MED"; + + // Storm Seeker deals damage to target player equal to the number of cards in that player's hand. + Effect effect = new DamageTargetEffect(new TargetPlayerCardsInHandCount()); + effect.setText("{this} deals damage to target player equal to the number of cards in that player's hand."); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + public StormSeeker(final StormSeeker card) { + super(card); + } + + @Override + public StormSeeker copy() { + return new StormSeeker(this); + } +} + +class TargetPlayerCardsInHandCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Player targetPlayer = game.getPlayer(sourceAbility.getFirstTarget()); + if (targetPlayer != null) { + return targetPlayer.getHand().size(); + } + + return 0; + } + + @Override + public DynamicValue copy() { + return new TargetPlayerCardsInHandCount(); + } + + @Override + public String toString() { + return "1"; + } + + @Override + public String getMessage() { + return "target player's cards in hand"; + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/SunkenCity.java b/Mage.Sets/src/mage/sets/mastersedition/SunkenCity.java new file mode 100644 index 00000000000..566daa28c39 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/SunkenCity.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class SunkenCity extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blue creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public SunkenCity(UUID ownerId) { + super(ownerId, 51, "Sunken City", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}"); + this.expansionSetCode = "MED"; + + // At the beginning of your upkeep, sacrifice Sunken City unless you pay {U}{U}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{U}{U}")), TargetController.YOU, false)); + // Blue creatures get +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false))); + } + + public SunkenCity(final SunkenCity card) { + super(card); + } + + @Override + public SunkenCity copy() { + return new SunkenCity(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/mastersedition/VesuvanDoppelganger.java new file mode 100644 index 00000000000..ed540f33231 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/VesuvanDoppelganger.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class VesuvanDoppelganger extends mage.sets.unlimitededition.VesuvanDoppelganger { + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId); + this.cardNumber = 54; + this.expansionSetCode = "MED"; + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/WalkingWall.java b/Mage.Sets/src/mage/sets/mastersedition/WalkingWall.java new file mode 100644 index 00000000000..d920da69c38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/WalkingWall.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class WalkingWall extends CardImpl { + + public WalkingWall(UUID ownerId) { + super(ownerId, 172, "Walking Wall", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "MED"; + this.subtype.add("Wall"); + this.power = new MageInt(0); + this.toughness = new MageInt(6); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // {3}: Walking Wall gets +3/-1 until end of turn and can attack this turn as though it didn't have defender. Activate this ability only once each turn. + Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, -1, Duration.EndOfTurn), new GenericManaCost(3)); + ability.addEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn)); + this.addAbility(ability); + } + + public WalkingWall(final WalkingWall card) { + super(card); + } + + @Override + public WalkingWall copy() { + return new WalkingWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/Wanderlust.java b/Mage.Sets/src/mage/sets/mastersedition/Wanderlust.java new file mode 100644 index 00000000000..06e9dbc2523 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/Wanderlust.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 137; + this.expansionSetCode = "MED"; + this.rarity = Rarity.COMMON; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/AngelOfFury.java b/Mage.Sets/src/mage/sets/masterseditionii/AngelOfFury.java new file mode 100644 index 00000000000..e72554ff411 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/AngelOfFury.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class AngelOfFury extends mage.sets.portalsecondage.AngelOfFury { + + public AngelOfFury(UUID ownerId) { + super(ownerId); + this.cardNumber = 2; + this.expansionSetCode = "ME2"; + } + + public AngelOfFury(final AngelOfFury card) { + super(card); + } + + @Override + public AngelOfFury copy() { + return new AngelOfFury(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/ArmorOfFaith.java b/Mage.Sets/src/mage/sets/masterseditionii/ArmorOfFaith.java new file mode 100644 index 00000000000..942b18d94f7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/ArmorOfFaith.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ArmorOfFaith extends CardImpl { + + public ArmorOfFaith(UUID ownerId) { + super(ownerId, 4, "Armor of Faith", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); + // {W}: Enchanted creature gets +0/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{W}"))); + } + + public ArmorOfFaith(final ArmorOfFaith card) { + super(card); + } + + @Override + public ArmorOfFaith copy() { + return new ArmorOfFaith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/ArmorThrull.java b/Mage.Sets/src/mage/sets/masterseditionii/ArmorThrull.java new file mode 100644 index 00000000000..dbd058685b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/ArmorThrull.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ArmorThrull extends CardImpl { + + public ArmorThrull(UUID ownerId) { + super(ownerId, 77, "Armor Thrull", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Thrull"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // {T}, Sacrifice Armor Thrull: Put a +1/+2 counter on target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P2.createInstance()), new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ArmorThrull(final ArmorThrull card) { + super(card); + } + + @Override + public ArmorThrull copy() { + return new ArmorThrull(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Aurochs.java b/Mage.Sets/src/mage/sets/masterseditionii/Aurochs.java new file mode 100644 index 00000000000..56ff3077b2a --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Aurochs.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class Aurochs extends mage.sets.iceage.Aurochs { + + public Aurochs(UUID ownerId) { + super(ownerId); + this.cardNumber = 153; + this.expansionSetCode = "ME2"; + } + + public Aurochs(final Aurochs card) { + super(card); + } + + @Override + public Aurochs copy() { + return new Aurochs(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/AysenBureaucrats.java b/Mage.Sets/src/mage/sets/masterseditionii/AysenBureaucrats.java new file mode 100644 index 00000000000..3e991dafcad --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/AysenBureaucrats.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class AysenBureaucrats extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 2 or less"); + static { + filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, 3)); + } + + public AysenBureaucrats(UUID ownerId) { + super(ownerId, 6, "Aysen Bureaucrats", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Human"); + this.subtype.add("Advisor"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Tap target creature with power 2 or less. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); + Target target = new TargetCreaturePermanent(filter); + ability.addTarget(target); + this.addAbility(ability); + } + + public AysenBureaucrats(final AysenBureaucrats card) { + super(card); + } + + @Override + public AysenBureaucrats copy() { + return new AysenBureaucrats(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/BindingGrasp.java b/Mage.Sets/src/mage/sets/masterseditionii/BindingGrasp.java new file mode 100644 index 00000000000..860203cdf76 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/BindingGrasp.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.ControlEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class BindingGrasp extends CardImpl { + + public BindingGrasp(UUID ownerId) { + super(ownerId, 41, "Binding Grasp", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // At the beginning of your upkeep, sacrifice Binding Grasp unless you pay {1}{U}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{1}{U}")), TargetController.YOU, false)); + // You control enchanted creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); + // Enchanted creature gets +0/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(0, 1, Duration.WhileOnBattlefield))); + } + + public BindingGrasp(final BindingGrasp card) { + super(card); + } + + @Override + public BindingGrasp copy() { + return new BindingGrasp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Burnout.java b/Mage.Sets/src/mage/sets/masterseditionii/Burnout.java new file mode 100644 index 00000000000..523442c030b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Burnout.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Burnout extends mage.sets.alliances.Burnout { + + public Burnout(UUID ownerId) { + super(ownerId); + this.cardNumber = 121; + this.expansionSetCode = "ME2"; + } + + public Burnout(final Burnout card) { + super(card); + } + + @Override + public Burnout copy() { + return new Burnout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/CaribouRange.java b/Mage.Sets/src/mage/sets/masterseditionii/CaribouRange.java new file mode 100644 index 00000000000..e5099cbf06a --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/CaribouRange.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CaribouRange extends mage.sets.fifthedition.CaribouRange { + + public CaribouRange(UUID ownerId) { + super(ownerId); + this.cardNumber = 8; + this.expansionSetCode = "ME2"; + } + + public CaribouRange(final CaribouRange card) { + super(card); + } + + @Override + public CaribouRange copy() { + return new CaribouRange(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/CombatMedic.java b/Mage.Sets/src/mage/sets/masterseditionii/CombatMedic.java new file mode 100644 index 00000000000..6708aa9d2c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/CombatMedic.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class CombatMedic extends CardImpl { + + public CombatMedic(UUID ownerId) { + super(ownerId, 9, "Combat Medic", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.subtype.add("Soldier"); + this.power = new MageInt(0); + this.toughness = new MageInt(2); + + // {1}{W}: Prevent the next 1 damage that would be dealt to target creature or player this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new ManaCostsImpl("{1}{W}")); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public CombatMedic(final CombatMedic card) { + super(card); + } + + @Override + public CombatMedic copy() { + return new CombatMedic(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/DeepSpawn.java b/Mage.Sets/src/mage/sets/masterseditionii/DeepSpawn.java new file mode 100644 index 00000000000..f990a1afa13 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/DeepSpawn.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class DeepSpawn extends mage.sets.fallenempires.DeepSpawn { + + public DeepSpawn(UUID ownerId) { + super(ownerId); + this.cardNumber = 45; + this.expansionSetCode = "ME2"; + this.rarity = Rarity.RARE; + } + + public DeepSpawn(final DeepSpawn card) { + super(card); + } + + @Override + public DeepSpawn copy() { + return new DeepSpawn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/DespoticScepter.java b/Mage.Sets/src/mage/sets/masterseditionii/DespoticScepter.java new file mode 100644 index 00000000000..b02d2310093 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/DespoticScepter.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.other.OwnerPredicate; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class DespoticScepter extends CardImpl { + + private final static FilterPermanent filter = new FilterPermanent(); + + static { + filter.add(new OwnerPredicate(TargetController.YOU)); + } + + public DespoticScepter(UUID ownerId) { + super(ownerId, 206, "Despotic Scepter", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "ME2"; + + // {tap}: Destroy target permanent you own. It can't be regenerated. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(true), new TapSourceCost()); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public DespoticScepter(final DespoticScepter card) { + super(card); + } + + @Override + public DespoticScepter copy() { + return new DespoticScepter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java b/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java new file mode 100644 index 00000000000..9b7905996ea --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/EbonPraetor.java @@ -0,0 +1,156 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.counter.RemoveCounterSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class EbonPraetor extends CardImpl { + + public EbonPraetor(UUID ownerId) { + super(ownerId, 89, "Ebon Praetor", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Avatar"); + this.subtype.add("Praetor"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // At the beginning of your upkeep, put a -2/-2 counter on Ebon Praetor. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.M2M2.createInstance()), TargetController.YOU, false)); + + // Sacrifice a creature: Remove a -2/-2 counter from Ebon Praetor. If the sacrificed creature was a Thrull, put a +1/+0 counter on Ebon Praetor. Activate this ability only during your upkeep and only once each turn. + Ability ability = new EbonPraetorAbility(new RemoveCounterSourceEffect(CounterType.M2M2.createInstance()), + new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addEffect(new EbonPraetorEffect()); + this.addAbility(ability); + } + + public EbonPraetor(final EbonPraetor card) { + super(card); + } + + @Override + public EbonPraetor copy() { + return new EbonPraetor(this); + } +} + +class EbonPraetorAbility extends LimitedTimesPerTurnActivatedAbility { + + public EbonPraetorAbility(Effect effect, Cost cost) { + super(Zone.BATTLEFIELD, effect, cost); + } + + public EbonPraetorAbility(final EbonPraetorAbility ability) { + super(ability); + } + + @Override + public EbonPraetorAbility copy() { + return new EbonPraetorAbility(this); + } + + @Override + public boolean canActivate(UUID playerId, Game game) { + if (!game.getActivePlayerId().equals(controllerId) || !PhaseStep.UPKEEP.equals(game.getStep().getType())) { + return false; + } + return super.canActivate(playerId, game); + } + + @Override + public String getRule() { + StringBuilder sb = new StringBuilder(""); + sb.append(super.getRule()).append(" Activate this ability only during your upkeep."); + return sb.toString(); + } +} + +class EbonPraetorEffect extends OneShotEffect { + + public EbonPraetorEffect() { + super(Outcome.BoostCreature); + this.staticText = "If the sacrificed creature was a Thrull, put a +1/+0 counter on {this}"; + } + + public EbonPraetorEffect(final EbonPraetorEffect effect) { + super(effect); + } + + @Override + public EbonPraetorEffect copy() { + return new EbonPraetorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Cost cost : source.getCosts()) { + if (cost instanceof SacrificeTargetCost) { + Permanent sacrificedCreature = ((SacrificeTargetCost) cost).getPermanents().get(0); + Permanent sourceCreature = game.getPermanent(source.getSourceId()); + if (sacrificedCreature.hasSubtype("Thrull") && sourceCreature != null) { + sourceCreature.addCounters(CounterType.P1P0.createInstance(), game); + return true; + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/ElvenLyre.java b/Mage.Sets/src/mage/sets/masterseditionii/ElvenLyre.java new file mode 100644 index 00000000000..5fd78b1f651 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/ElvenLyre.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ElvenLyre extends CardImpl { + + public ElvenLyre(UUID ownerId) { + super(ownerId, 208, "Elven Lyre", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "ME2"; + + // {1}, {tap}, Sacrifice Elven Lyre: Target creature gets +2/+2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new ManaCostsImpl("{1}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + } + + public ElvenLyre(final ElvenLyre card) { + super(card); + } + + @Override + public ElvenLyre copy() { + return new ElvenLyre(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/ElvishFarmer.java b/Mage.Sets/src/mage/sets/masterseditionii/ElvishFarmer.java new file mode 100644 index 00000000000..3d06c738ece --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/ElvishFarmer.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.SaprolingToken; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class ElvishFarmer extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Saproling"); + + static { + filter.add(new SubtypePredicate("Saproling")); + } + + public ElvishFarmer(UUID ownerId) { + super(ownerId, 156, "Elvish Farmer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Elf"); + this.power = new MageInt(0); + this.toughness = new MageInt(2); + + // At the beginning of your upkeep, put a spore counter on Elvish Farmer. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.SPORE.createInstance()), TargetController.YOU, false)); + // Remove three spore counters from Elvish Farmer: Put a 1/1 green Saproling creature token onto the battlefield. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SaprolingToken()), new RemoveCountersSourceCost(CounterType.SPORE.createInstance(3)))); + // Sacrifice a Saproling: You gain 2 life. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), + new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, false)))); + } + + public ElvishFarmer(final ElvishFarmer card) { + super(card); + } + + @Override + public ElvishFarmer copy() { + return new ElvishFarmer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Enervate.java b/Mage.Sets/src/mage/sets/masterseditionii/Enervate.java new file mode 100644 index 00000000000..a0cb61ea422 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Enervate.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class Enervate extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or land"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); + } + + public Enervate(UUID ownerId) { + super(ownerId, 47, "Enervate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "ME2"; + + // Tap target artifact, creature, or land. + this.getSpellAbility().addEffect(new TapTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public Enervate(final Enervate card) { + super(card); + } + + @Override + public Enervate copy() { + return new Enervate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/FarrelsZealot.java b/Mage.Sets/src/mage/sets/masterseditionii/FarrelsZealot.java new file mode 100644 index 00000000000..f3dbcb9a019 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/FarrelsZealot.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FarrelsZealot extends mage.sets.fallenempires.FarrelsZealot1 { + + public FarrelsZealot(UUID ownerId) { + super(ownerId); + this.cardNumber = 14; + this.expansionSetCode = "ME2"; + this.rarity = Rarity.UNCOMMON; + } + + public FarrelsZealot(final FarrelsZealot card) { + super(card); + } + + @Override + public FarrelsZealot copy() { + return new FarrelsZealot(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/FireDragon.java b/Mage.Sets/src/mage/sets/masterseditionii/FireDragon.java new file mode 100644 index 00000000000..520c2fe590b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/FireDragon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FireDragon extends mage.sets.portal.FireDragon { + + public FireDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 125; + this.expansionSetCode = "ME2"; + } + + public FireDragon(final FireDragon card) { + super(card); + } + + @Override + public FireDragon copy() { + return new FireDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/FolkOfThePines.java b/Mage.Sets/src/mage/sets/masterseditionii/FolkOfThePines.java new file mode 100644 index 00000000000..c769ee7d288 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/FolkOfThePines.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author hanasu + */ +public class FolkOfThePines extends CardImpl { + + public FolkOfThePines(UUID ownerId) { + super(ownerId, 162, "Folk of the Pines", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Dryad"); + this.power = new MageInt(2); + this.toughness = new MageInt(5); + + // {1}{G}: Folk of the Pines gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{1}{G}"))); + } + + public FolkOfThePines(final FolkOfThePines card) { + super(card); + } + + @Override + public FolkOfThePines copy() { + return new FolkOfThePines(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/ForbiddenLore.java b/Mage.Sets/src/mage/sets/masterseditionii/ForbiddenLore.java new file mode 100644 index 00000000000..abc07d83bed --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/ForbiddenLore.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ForbiddenLore extends mage.sets.iceage.ForbiddenLore { + + public ForbiddenLore(UUID ownerId) { + super(ownerId); + this.cardNumber = 163; + this.expansionSetCode = "ME2"; + this.rarity = Rarity.UNCOMMON; + } + + public ForbiddenLore(final ForbiddenLore card) { + super(card); + } + + @Override + public ForbiddenLore copy() { + return new ForbiddenLore(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/ForgottenLore.java b/Mage.Sets/src/mage/sets/masterseditionii/ForgottenLore.java new file mode 100644 index 00000000000..3fc2f88f87e --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/ForgottenLore.java @@ -0,0 +1,140 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardIdPredicate; +import mage.filter.predicate.other.OwnerIdPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetOpponent; +/** + * + * @author LoneFox + */ +public class ForgottenLore extends CardImpl { + + public ForgottenLore(UUID ownerId) { + super(ownerId, 164, "Forgotten Lore", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{G}"); + this.expansionSetCode = "ME2"; + + // Target opponent chooses a card in your graveyard. You may pay {G}. If you do, repeat this process except that opponent can't choose a card already chosen for Forgotten Lore. Then put the last chosen card into your hand. + this.getSpellAbility().addEffect(new ForgottenLoreEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public ForgottenLore(final ForgottenLore card) { + super(card); + } + + @Override + public ForgottenLore copy() { + return new ForgottenLore(this); + } +} + +class ForgottenLoreEffect extends OneShotEffect { + + public ForgottenLoreEffect() { + super(Outcome.Benefit); + staticText = "Target opponent chooses a card in your graveyard. You may pay {G}. If you do, repeat this process except that opponent can't choose a card already chosen for {this}. Then put the last chosen card into your hand."; + } + + public ForgottenLoreEffect(final ForgottenLoreEffect effect) { + super(effect); + } + + @Override + public ForgottenLoreEffect copy() { + return new ForgottenLoreEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player you = game.getPlayer(source.getControllerId()); + Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); + if(you != null && opponent != null) + { + FilterCard filter = new FilterCard(); + filter.add(new OwnerIdPredicate(you.getId())); + Cost cost = new ManaCostsImpl("{G}"); + TargetCardInGraveyard chosenCard; + Card card = null; + boolean done = false; + do { + chosenCard = new TargetCardInGraveyard(filter); + chosenCard.setNotTarget(true); + if(chosenCard.canChoose(opponent.getId(), game)) { + opponent.chooseTarget(Outcome.ReturnToHand, chosenCard, source, game); + card = game.getCard(chosenCard.getFirstTarget()); + filter.add(Predicates.not(new CardIdPredicate(card.getId()))); + game.informPlayers("Forgotten Lore: " + opponent.getLogName() + " has chosen " + card.getLogName()); + } + else { + done = true; + } + + if(!done) { + if(cost.canPay(source, source.getSourceId(), you.getId(), game) && you.chooseUse(Outcome.Benefit, "Pay {G} to choose a different card ?", source, game)) { + cost.clearPaid(); + if(!cost.pay(source, game, source.getSourceId(), you.getId(), false)) { + done = true; + } + } + else { + done = true; + } + } + + } while(!done); + + if(card != null) { + Cards cardsToHand = new CardsImpl(); + cardsToHand.add(card); + you.moveCards(cardsToHand, Zone.GRAVEYARD, Zone.HAND, source, game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/FoulFamiliar.java b/Mage.Sets/src/mage/sets/masterseditionii/FoulFamiliar.java new file mode 100644 index 00000000000..9053dbafbb8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/FoulFamiliar.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.CantBlockAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FoulFamiliar extends CardImpl { + + public FoulFamiliar(UUID ownerId) { + super(ownerId, 90, "Foul Familiar", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Spirit"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Foul Familiar can't block. + this.addAbility(new CantBlockAbility()); + // {B}, Pay 1 life: Return Foul Familiar to its owner's hand. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{B}")); + ability.addCost(new PayLifeCost(1)); + this.addAbility(ability); + } + + public FoulFamiliar(final FoulFamiliar card) { + super(card); + } + + @Override + public FoulFamiliar copy() { + return new FoulFamiliar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Fumarole.java b/Mage.Sets/src/mage/sets/masterseditionii/Fumarole.java new file mode 100644 index 00000000000..aa9f29c54db --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Fumarole.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class Fumarole extends CardImpl { + + public Fumarole(UUID ownerId) { + super(ownerId, 194, "Fumarole", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}{R}"); + this.expansionSetCode = "ME2"; + + // As an additional cost to cast Fumarole, pay 3 life. + this.getSpellAbility().addCost(new PayLifeCost(3)); + // Destroy target creature and target land. + Effect effect = new DestroyTargetEffect(false, true); + effect.setText("Destroy target creature and target land"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + } + + public Fumarole(final Fumarole card) { + super(card); + } + + @Override + public Fumarole copy() { + return new Fumarole(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/FungalBloom.java b/Mage.Sets/src/mage/sets/masterseditionii/FungalBloom.java new file mode 100644 index 00000000000..9bde0a88d34 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/FungalBloom.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FungalBloom extends mage.sets.fallenempires.FungalBloom { + + public FungalBloom(UUID ownerId) { + super(ownerId); + this.cardNumber = 165; + this.expansionSetCode = "ME2"; + } + + public FungalBloom(final FungalBloom card) { + super(card); + } + + @Override + public FungalBloom copy() { + return new FungalBloom(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/GlacialCrevasses.java b/Mage.Sets/src/mage/sets/masterseditionii/GlacialCrevasses.java new file mode 100644 index 00000000000..466f568328f --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/GlacialCrevasses.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author Quercitron + */ +public class GlacialCrevasses extends mage.sets.iceage.GlacialCrevasses { + + public GlacialCrevasses(UUID ownerId) { + super(ownerId); + this.cardNumber = 127; + this.expansionSetCode = "ME2"; + } + + public GlacialCrevasses(final GlacialCrevasses card) { + super(card); + } + + @Override + public GlacialCrevasses copy() { + return new GlacialCrevasses(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/GrandmotherSengir.java b/Mage.Sets/src/mage/sets/masterseditionii/GrandmotherSengir.java new file mode 100644 index 00000000000..5a1ea84a567 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/GrandmotherSengir.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author hanasu + */ +public class GrandmotherSengir extends CardImpl { + + public GrandmotherSengir(UUID ownerId) { + super(ownerId, 93, "Grandmother Sengir", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "ME2"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {1}{B}, {tap}: Target creature gets -1/-1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-1, -1, Duration.EndOfTurn), new ManaCostsImpl("{1}{B}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public GrandmotherSengir(final GrandmotherSengir card) { + super(card); + } + + @Override + public GrandmotherSengir copy() { + return new GrandmotherSengir(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/IcatianScout.java b/Mage.Sets/src/mage/sets/masterseditionii/IcatianScout.java new file mode 100644 index 00000000000..bc644954181 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/IcatianScout.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class IcatianScout extends CardImpl { + + public IcatianScout(UUID ownerId) { + super(ownerId, 17, "Icatian Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Scout"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}, {tap}: Target creature gains first strike until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect( + FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{1}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public IcatianScout(final IcatianScout card) { + super(card); + } + + @Override + public IcatianScout copy() { + return new IcatianScout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/JuniperOrderAdvocate.java b/Mage.Sets/src/mage/sets/masterseditionii/JuniperOrderAdvocate.java new file mode 100644 index 00000000000..16f458ecba6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/JuniperOrderAdvocate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class JuniperOrderAdvocate extends mage.sets.alliances.JuniperOrderAdvocate { + + public JuniperOrderAdvocate(UUID ownerId) { + super(ownerId); + this.cardNumber = 20; + this.expansionSetCode = "ME2"; + } + + public JuniperOrderAdvocate(final JuniperOrderAdvocate card) { + super(card); + } + + @Override + public JuniperOrderAdvocate copy() { + return new JuniperOrderAdvocate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/KrovikanFetish.java b/Mage.Sets/src/mage/sets/masterseditionii/KrovikanFetish.java new file mode 100644 index 00000000000..dd4f06c1a9b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/KrovikanFetish.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class KrovikanFetish extends mage.sets.fifthedition.KrovikanFetish { + + public KrovikanFetish(UUID ownerId) { + super(ownerId); + this.cardNumber = 100; + this.expansionSetCode = "ME2"; + } + + public KrovikanFetish(final KrovikanFetish card) { + super(card); + } + + @Override + public KrovikanFetish copy() { + return new KrovikanFetish(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/KrovikanSorcerer.java b/Mage.Sets/src/mage/sets/masterseditionii/KrovikanSorcerer.java new file mode 100644 index 00000000000..82b5a5abc23 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/KrovikanSorcerer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class KrovikanSorcerer extends mage.sets.vintagemasters.KrovikanSorcerer { + + public KrovikanSorcerer(UUID ownerId) { + super(ownerId); + this.cardNumber = 51; + this.expansionSetCode = "ME2"; + } + + public KrovikanSorcerer(final KrovikanSorcerer card) { + super(card); + } + + @Override + public KrovikanSorcerer copy() { + return new KrovikanSorcerer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/LeapingLizard.java b/Mage.Sets/src/mage/sets/masterseditionii/LeapingLizard.java new file mode 100644 index 00000000000..c0115ebbe56 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/LeapingLizard.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class LeapingLizard extends mage.sets.homelands.LeapingLizard { + + public LeapingLizard(UUID ownerId) { + super(ownerId); + this.cardNumber = 171; + this.expansionSetCode = "ME2"; + } + + public LeapingLizard(final LeapingLizard card) { + super(card); + } + + @Override + public LeapingLizard copy() { + return new LeapingLizard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/LimDulsHighGuard.java b/Mage.Sets/src/mage/sets/masterseditionii/LimDulsHighGuard.java new file mode 100644 index 00000000000..5fa1e9b10f3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/LimDulsHighGuard.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LimDulsHighGuard extends mage.sets.alliances.LimDulsHighGuard1 { + + public LimDulsHighGuard(UUID ownerId) { + super(ownerId); + this.cardNumber = 103; + this.expansionSetCode = "ME2"; + this.rarity = Rarity.UNCOMMON; + } + + public LimDulsHighGuard(final LimDulsHighGuard card) { + super(card); + } + + @Override + public LimDulsHighGuard copy() { + return new LimDulsHighGuard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/MesmericTrance.java b/Mage.Sets/src/mage/sets/masterseditionii/MesmericTrance.java new file mode 100644 index 00000000000..2d1e63ac2f5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/MesmericTrance.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class MesmericTrance extends CardImpl { + + public MesmericTrance(UUID ownerId) { + super(ownerId, 55, "Mesmeric Trance", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}"); + this.expansionSetCode = "ME2"; + + // Cumulative upkeep {1} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}"))); + // {U}, Discard a card: Draw a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{U}")); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public MesmericTrance(final MesmericTrance card) { + super(card); + } + + @Override + public MesmericTrance copy() { + return new MesmericTrance(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Narwhal.java b/Mage.Sets/src/mage/sets/masterseditionii/Narwhal.java new file mode 100644 index 00000000000..762fd0dfc81 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Narwhal.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Narwhal extends mage.sets.homelands.Narwhal { + + public Narwhal(UUID ownerId) { + super(ownerId); + this.cardNumber = 57; + this.expansionSetCode = "ME2"; + this.rarity = Rarity.UNCOMMON; + } + + public Narwhal(final Narwhal card) { + super(card); + } + + @Override + public Narwhal copy() { + return new Narwhal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Panic.java b/Mage.Sets/src/mage/sets/masterseditionii/Panic.java new file mode 100644 index 00000000000..16b034a6316 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Panic.java @@ -0,0 +1,120 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.combat.CantBlockTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.TurnPhase; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Panic extends CardImpl { + + public Panic(UUID ownerId) { + super(ownerId, 145, "Panic", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "ME2"; + + // Cast Panic only during combat before blockers are declared. + Ability ability = new SimpleStaticAbility(Zone.ALL, new PanicRuleModifyingEffect()); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + + // Target creature can't block this turn. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new CantBlockTargetEffect(Duration.EndOfTurn)); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public Panic(final Panic card) { + super(card); + } + + @Override + public Panic copy() { + return new Panic(this); + } +} + +class PanicRuleModifyingEffect extends ContinuousRuleModifyingEffectImpl { + + PanicRuleModifyingEffect() { + super(Duration.EndOfGame, Outcome.Detriment); + staticText = "Cast {this} only during combat before blockers are declared"; + } + + PanicRuleModifyingEffect(final PanicRuleModifyingEffect effect) { + super(effect); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType().equals(GameEvent.EventType.CAST_SPELL); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getSourceId().equals(source.getSourceId())) { + return !TurnPhase.COMBAT.equals(game.getTurn().getPhaseType()) || + game.getStep().getType().equals(PhaseStep.DECLARE_BLOCKERS) || + game.getStep().getType().equals(PhaseStep.FIRST_COMBAT_DAMAGE) || + game.getStep().getType().equals(PhaseStep.COMBAT_DAMAGE) || + game.getStep().getType().equals(PhaseStep.END_COMBAT); + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public PanicRuleModifyingEffect copy() { + return new PanicRuleModifyingEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Reinforcements.java b/Mage.Sets/src/mage/sets/masterseditionii/Reinforcements.java new file mode 100644 index 00000000000..b348961ba26 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Reinforcements.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author fireshoes + */ +public class Reinforcements extends CardImpl { + + public Reinforcements(UUID ownerId) { + super(ownerId, 28, "Reinforcements", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "ME2"; + + // Put up to three target creature cards from your graveyard on top of your library. + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 3, new FilterCreatureCard("creature cards from your graveyard"))); + } + + public Reinforcements(final Reinforcements card) { + super(card); + } + + @Override + public Reinforcements copy() { + return new Reinforcements(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/RitualOfTheMachine.java b/Mage.Sets/src/mage/sets/masterseditionii/RitualOfTheMachine.java new file mode 100644 index 00000000000..82c21f61ecf --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/RitualOfTheMachine.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class RitualOfTheMachine extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonartifact, nonblack creature"); + + static { + filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT))); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public RitualOfTheMachine(UUID ownerId) { + super(ownerId, 109, "Ritual of the Machine", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); + this.expansionSetCode = "ME2"; + + // As an additional cost to cast Ritual of the Machine, sacrifice a creature. + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + // Gain control of target nonartifact, nonblack creature. + this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfGame)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + } + + public RitualOfTheMachine(final RitualOfTheMachine card) { + super(card); + } + + @Override + public RitualOfTheMachine copy() { + return new RitualOfTheMachine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Roterothopter.java b/Mage.Sets/src/mage/sets/masterseditionii/Roterothopter.java new file mode 100644 index 00000000000..1f9a63dd49f --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Roterothopter.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Roterothopter extends mage.sets.homelands.Roterothopter { + + public Roterothopter(UUID ownerId) { + super(ownerId); + this.cardNumber = 218; + this.expansionSetCode = "ME2"; + } + + public Roterothopter(final Roterothopter card) { + super(card); + } + + @Override + public Roterothopter copy() { + return new Roterothopter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/RoyalTrooper.java b/Mage.Sets/src/mage/sets/masterseditionii/RoyalTrooper.java new file mode 100644 index 00000000000..4378fa74d2a --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/RoyalTrooper.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class RoyalTrooper extends mage.sets.starter1999.RoyalTrooper { + + public RoyalTrooper(UUID ownerId) { + super(ownerId); + this.cardNumber = 32; + this.expansionSetCode = "ME2"; + this.rarity = Rarity.COMMON; + } + + public RoyalTrooper(final RoyalTrooper card) { + super(card); + } + + @Override + public RoyalTrooper copy() { + return new RoyalTrooper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/SkeletonShip.java b/Mage.Sets/src/mage/sets/masterseditionii/SkeletonShip.java new file mode 100644 index 00000000000..96b1af5b4e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/SkeletonShip.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SkeletonShip extends mage.sets.iceage.SkeletonShip { + + public SkeletonShip(UUID ownerId) { + super(ownerId); + this.cardNumber = 197; + this.expansionSetCode = "ME2"; + } + + public SkeletonShip(final SkeletonShip card) { + super(card); + } + + @Override + public SkeletonShip copy() { + return new SkeletonShip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredForest.java b/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredForest.java index c401ad7b9f6..85eab452798 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredForest.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredForest.java @@ -27,6 +27,8 @@ */ package mage.sets.masterseditionii; +import mage.constants.Rarity; + import java.util.UUID; /** @@ -39,6 +41,7 @@ public class SnowCoveredForest extends mage.sets.iceage.SnowCoveredForest { super(ownerId); this.cardNumber = 245; this.expansionSetCode = "ME2"; + this.rarity = Rarity.LAND; } public SnowCoveredForest(final SnowCoveredForest card) { diff --git a/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredIsland.java b/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredIsland.java index 2d132f5b550..a08bb19f695 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredIsland.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredIsland.java @@ -27,6 +27,8 @@ */ package mage.sets.masterseditionii; +import mage.constants.Rarity; + import java.util.UUID; /** @@ -39,6 +41,7 @@ public class SnowCoveredIsland extends mage.sets.iceage.SnowCoveredIsland { super(ownerId); this.cardNumber = 242; this.expansionSetCode = "ME2"; + this.rarity = Rarity.LAND; } public SnowCoveredIsland(final SnowCoveredIsland card) { diff --git a/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredMountain.java b/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredMountain.java index a15fd535633..0f1512d7cf0 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredMountain.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredMountain.java @@ -27,6 +27,8 @@ */ package mage.sets.masterseditionii; +import mage.constants.Rarity; + import java.util.UUID; /** @@ -39,6 +41,7 @@ public class SnowCoveredMountain extends mage.sets.iceage.SnowCoveredMountain { super(ownerId); this.cardNumber = 244; this.expansionSetCode = "ME2"; + this.rarity = Rarity.LAND; } public SnowCoveredMountain(final SnowCoveredMountain card) { diff --git a/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredPlains.java b/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredPlains.java index 3045a22ca88..fbd1547700a 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredPlains.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredPlains.java @@ -27,6 +27,8 @@ */ package mage.sets.masterseditionii; +import mage.constants.Rarity; + import java.util.UUID; /** @@ -39,6 +41,7 @@ public class SnowCoveredPlains extends mage.sets.iceage.SnowCoveredPlains { super(ownerId); this.cardNumber = 241; this.expansionSetCode = "ME2"; + this.rarity = Rarity.LAND; } public SnowCoveredPlains(final SnowCoveredPlains card) { diff --git a/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredSwamp.java b/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredSwamp.java index 643d8b29efc..19c3b53e5c3 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredSwamp.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/SnowCoveredSwamp.java @@ -27,6 +27,8 @@ */ package mage.sets.masterseditionii; +import mage.constants.Rarity; + import java.util.UUID; /** @@ -39,6 +41,7 @@ public class SnowCoveredSwamp extends mage.sets.iceage.SnowCoveredSwamp { super(ownerId); this.cardNumber = 243; this.expansionSetCode = "ME2"; + this.rarity = Rarity.LAND; } public SnowCoveredSwamp(final SnowCoveredSwamp card) { diff --git a/Mage.Sets/src/mage/sets/masterseditionii/SoulKiss.java b/Mage.Sets/src/mage/sets/masterseditionii/SoulKiss.java new file mode 100644 index 00000000000..cbdde3ebb6f --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/SoulKiss.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SoulKiss extends CardImpl { + + public SoulKiss(UUID ownerId) { + super(ownerId, 112, "Soul Kiss", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // {B}, Pay 1 life: Enchanted creature gets +2/+2 until end of turn. Activate this ability no more than three times each turn. + ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.EndOfTurn), + new ManaCostsImpl("{B}"), 3); + ability.addCost(new PayLifeCost(1)); + this.addAbility(ability); + } + + public SoulKiss(final SoulKiss card) { + super(card); + } + + @Override + public SoulKiss copy() { + return new SoulKiss(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/SporeFlower.java b/Mage.Sets/src/mage/sets/masterseditionii/SporeFlower.java new file mode 100644 index 00000000000..e31dcc7dec8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/SporeFlower.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SporeFlower extends mage.sets.fallenempires.SporeFlower { + + public SporeFlower(UUID ownerId) { + super(ownerId); + this.cardNumber = 177; + this.expansionSetCode = "ME2"; + } + + public SporeFlower(final SporeFlower card) { + super(card); + } + + @Override + public SporeFlower copy() { + return new SporeFlower(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Stampede.java b/Mage.Sets/src/mage/sets/masterseditionii/Stampede.java new file mode 100644 index 00000000000..29cb2bab399 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Stampede.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Stampede extends mage.sets.iceage.Stampede { + + public Stampede(UUID ownerId) { + super(ownerId); + this.cardNumber = 178; + this.expansionSetCode = "ME2"; + this.rarity = Rarity.UNCOMMON; + } + + public Stampede(final Stampede card) { + super(card); + } + + @Override + public Stampede copy() { + return new Stampede(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/StoneSpirit.java b/Mage.Sets/src/mage/sets/masterseditionii/StoneSpirit.java new file mode 100644 index 00000000000..c680580c57b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/StoneSpirit.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class StoneSpirit extends mage.sets.iceage.StoneSpirit { + + public StoneSpirit(UUID ownerId) { + super(ownerId); + this.cardNumber = 150; + this.expansionSetCode = "ME2"; + } + + public StoneSpirit(final StoneSpirit card) { + super(card); + } + + @Override + public StoneSpirit copy() { + return new StoneSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Stonehands.java b/Mage.Sets/src/mage/sets/masterseditionii/Stonehands.java new file mode 100644 index 00000000000..6e666840ffa --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Stonehands.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Stonehands extends mage.sets.iceage.Stonehands { + + public Stonehands(UUID ownerId) { + super(ownerId); + this.cardNumber = 151; + this.expansionSetCode = "ME2"; + } + + public Stonehands(final Stonehands card) { + super(card); + } + + @Override + public Stonehands copy() { + return new Stonehands(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/StormSpirit.java b/Mage.Sets/src/mage/sets/masterseditionii/StormSpirit.java new file mode 100644 index 00000000000..1bfc7f9e771 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/StormSpirit.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class StormSpirit extends CardImpl { + + public StormSpirit(UUID ownerId) { + super(ownerId, 198, "Storm Spirit", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{W}{U}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Elemental"); + this.subtype.add("Spirit"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {tap}: Storm Spirit deals 2 damage to target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public StormSpirit(final StormSpirit card) { + super(card); + } + + @Override + public StormSpirit copy() { + return new StormSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/TheloniteDruid.java b/Mage.Sets/src/mage/sets/masterseditionii/TheloniteDruid.java new file mode 100644 index 00000000000..758cc68cfab --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/TheloniteDruid.java @@ -0,0 +1,100 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.DependencyType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.Token; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class TheloniteDruid extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("Forests you control"); + + static { + filter.add(new SubtypePredicate("Forest")); + } + + public TheloniteDruid(UUID ownerId) { + super(ownerId, 182, "Thelonite Druid", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.subtype.add("Druid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{G}, {tap}, Sacrifice a creature: Forests you control become 2/3 creatures until end of turn. They're still lands. + ContinuousEffect effect = new BecomesCreatureAllEffect(new TheloniteDruidLandToken(), "Forests", filter, Duration.EndOfTurn); + effect.getDependencyTypes().add(DependencyType.BecomeForest); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + effect, + new ManaCostsImpl("{1}{G}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.addAbility(ability); + } + + public TheloniteDruid(final TheloniteDruid card) { + super(card); + } + + @Override + public TheloniteDruid copy() { + return new TheloniteDruid(this); + } +} + +class TheloniteDruidLandToken extends Token { + + public TheloniteDruidLandToken() { + super("", "2/3 creatures"); + cardType.add(CardType.CREATURE); + power = new MageInt(2); + toughness = new MageInt(3); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java b/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java new file mode 100644 index 00000000000..b555221479c --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Thermokarst.java @@ -0,0 +1,96 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author fireshoes + */ +public class Thermokarst extends CardImpl { + + public Thermokarst(UUID ownerId) { + super(ownerId, 183, "Thermokarst", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}{G}"); + this.expansionSetCode = "ME2"; + + // Destroy target land. If that land was a snow land, you gain 1 life. + this.getSpellAbility().addEffect(new ThermokarstEffect()); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + } + + public Thermokarst(final Thermokarst card) { + super(card); + } + + @Override + public Thermokarst copy() { + return new Thermokarst(this); + } +} + +class ThermokarstEffect extends OneShotEffect { + + public ThermokarstEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Destroy target land. If that land was a snow land, you gain 1 life."; + } + + public ThermokarstEffect(final ThermokarstEffect effect) { + super(effect); + } + + @Override + public ThermokarstEffect copy() { + return new ThermokarstEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null && controller != null) { + permanent.destroy(source.getSourceId(), game, false); + if (permanent.getSupertype().contains("Snow")) { + controller.gainLife(1, game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/ThoughtLash.java b/Mage.Sets/src/mage/sets/masterseditionii/ThoughtLash.java new file mode 100644 index 00000000000..65a48ed577a --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/ThoughtLash.java @@ -0,0 +1,182 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileFromTopOfLibraryCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.players.Player; + +/** + * + * @author emerald000 + */ +public class ThoughtLash extends CardImpl { + + public ThoughtLash(UUID ownerId) { + super(ownerId, 70, "Thought Lash", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}"); + this.expansionSetCode = "ME2"; + + // Cumulative upkeep - Exile the top card of your library. + this.addAbility(new CumulativeUpkeepAbility(new ExileFromTopOfLibraryCost(1))); + + // When a player doesn't pay Thought Lash's cumulative upkeep, that player exiles all cards from his or her library. + this.addAbility(new ThoughtLashTriggeredAbility()); + + // Exile the top card of your library: Prevent the next 1 damage that would be dealt to you this turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ThoughtLashPreventionEffect(), new ExileFromTopOfLibraryCost(1))); + } + + public ThoughtLash(final ThoughtLash card) { + super(card); + } + + @Override + public ThoughtLash copy() { + return new ThoughtLash(this); + } +} + +class ThoughtLashTriggeredAbility extends TriggeredAbilityImpl { + + ThoughtLashTriggeredAbility() { + super(Zone.BATTLEFIELD, new ThoughtLashExileLibraryEffect(), false); + } + + ThoughtLashTriggeredAbility(final ThoughtLashTriggeredAbility ability) { + super(ability); + } + + @Override + public ThoughtLashTriggeredAbility copy() { + return new ThoughtLashTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DIDNT_PAY_CUMULATIVE_UPKEEP; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getSourceId() != null && event.getSourceId().equals(this.getSourceId()); + } + + @Override + public String getRule() { + return "When a player doesn't pay {this}'s cumulative upkeep, that player exiles all cards from his or her library."; + } +} + +class ThoughtLashExileLibraryEffect extends OneShotEffect { + + ThoughtLashExileLibraryEffect() { + super(Outcome.Detriment); + this.staticText = "that player exiles all cards from his or her library"; + } + + ThoughtLashExileLibraryEffect(final ThoughtLashExileLibraryEffect effect) { + super(effect); + } + + @Override + public ThoughtLashExileLibraryEffect copy() { + return new ThoughtLashExileLibraryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Cards cards = new CardsImpl(); + cards.addAll(controller.getLibrary().getTopCards(game, controller.getLibrary().size())); + controller.moveCards(cards, Zone.LIBRARY, Zone.EXILED, source, game); + return true; + } + return false; + } +} + +class ThoughtLashPreventionEffect extends PreventionEffectImpl { + + ThoughtLashPreventionEffect() { + super(Duration.EndOfTurn); + this.staticText = "Prevent the next 1 damage that would be dealt to you this turn"; + } + + ThoughtLashPreventionEffect(final ThoughtLashPreventionEffect effect) { + super(effect); + } + + @Override + public ThoughtLashPreventionEffect copy() { + return new ThoughtLashPreventionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, + source.getControllerId(), source.getSourceId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + int damage = event.getAmount(); + if (damage > 0) { + event.setAmount(damage - 1); + this.used = true; + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, + source.getControllerId(), source.getSourceId(), source.getControllerId(), 1)); + } + } + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return !this.used && super.applies(event, source, game) && event.getTargetId().equals(source.getControllerId()); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/TimeBomb.java b/Mage.Sets/src/mage/sets/masterseditionii/TimeBomb.java new file mode 100644 index 00000000000..1777a4ad542 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/TimeBomb.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class TimeBomb extends CardImpl { + + public TimeBomb(UUID ownerId) { + super(ownerId, 223, "Time Bomb", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "ME2"; + + // At the beginning of your upkeep, put a time counter on Time Bomb. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(), true), TargetController.YOU, false)); + + // {1}, {tap}, Sacrifice Time Bomb: Time Bomb deals damage equal to the number of time counters on it to each creature and each player. + Effect effect = new DamageEverythingEffect(new CountersCount(CounterType.TIME), new FilterCreaturePermanent()); + effect.setText("{this} deals damage equal to the number of time counters on it to each creature and each player"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(1)); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public TimeBomb(final TimeBomb card) { + super(card); + } + + @Override + public TimeBomb copy() { + return new TimeBomb(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/VisceridArmor.java b/Mage.Sets/src/mage/sets/masterseditionii/VisceridArmor.java new file mode 100644 index 00000000000..f4b9c4d6210 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/VisceridArmor.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class VisceridArmor extends CardImpl { + + public VisceridArmor(UUID ownerId) { + super(ownerId, 72, "Viscerid Armor", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); + // {1}{U}: Return Viscerid Armor to its owner's hand. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{1}{U}"))); + } + + public VisceridArmor(final VisceridArmor card) { + super(card); + } + + @Override + public VisceridArmor copy() { + return new VisceridArmor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Warning.java b/Mage.Sets/src/mage/sets/masterseditionii/Warning.java new file mode 100644 index 00000000000..dc1d2d49c9d --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Warning.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetAttackingCreature; + +/** + * + * @author LoneFox + */ +public class Warning extends CardImpl { + + public Warning(UUID ownerId) { + super(ownerId, 38, "Warning", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "ME2"; + + // Prevent all combat damage that would be dealt by target attacking creature this turn. + this.getSpellAbility().addEffect(new PreventDamageByTargetEffect(Duration.EndOfTurn, true)); + this.getSpellAbility().addTarget(new TargetAttackingCreature()); + } + + public Warning(final Warning card) { + super(card); + } + + @Override + public Warning copy() { + return new Warning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/WingsOfAesthir.java b/Mage.Sets/src/mage/sets/masterseditionii/WingsOfAesthir.java new file mode 100644 index 00000000000..0676cb73fe8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/WingsOfAesthir.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + + * + * @author LoneFox + */ +public class WingsOfAesthir extends CardImpl { + + public WingsOfAesthir(UUID ownerId) { + super(ownerId, 199, "Wings of Aesthir", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}{U}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +1/+0 and has flying and first strike. + Effect effect = new BoostEnchantedEffect(1, 0, Duration.WhileOnBattlefield); + effect.setText("enchanted creature gets +1/+0"); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); + effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield); + effect.setText("and has flying"); + ability.addEffect(effect); + effect = new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield); + effect.setText("and first strike"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public WingsOfAesthir(final WingsOfAesthir card) { + super(card); + } + + @Override + public WingsOfAesthir copy() { + return new WingsOfAesthir(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/WolfPack.java b/Mage.Sets/src/mage/sets/masterseditionii/WolfPack.java new file mode 100644 index 00000000000..6bf9aeb6bfa --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/WolfPack.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DamageAsThoughNotBlockedAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WolfPack extends CardImpl { + + public WolfPack(UUID ownerId) { + super(ownerId, 187, "Wolf Pack", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{G}{G}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Wolf"); + this.power = new MageInt(7); + this.toughness = new MageInt(6); + + // You may have Wolf Pack assign its combat damage as though it weren't blocked. + this.addAbility(DamageAsThoughNotBlockedAbility.getInstance()); + } + + public WolfPack(final WolfPack card) { + super(card); + } + + @Override + public WolfPack copy() { + return new WolfPack(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/YavimayaAncients.java b/Mage.Sets/src/mage/sets/masterseditionii/YavimayaAncients.java new file mode 100644 index 00000000000..a9c4568dc8a --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/YavimayaAncients.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class YavimayaAncients extends CardImpl { + + public YavimayaAncients(UUID ownerId) { + super(ownerId, 190, "Yavimaya Ancients", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Treefolk"); + this.power = new MageInt(2); + this.toughness = new MageInt(7); + + // {G}: Yavimaya Ancients gets +1/-2 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, -2, Duration.EndOfTurn), new ManaCostsImpl("{G}"))); + } + + public YavimayaAncients(final YavimayaAncients card) { + super(card); + } + + @Override + public YavimayaAncients copy() { + return new YavimayaAncients(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/ZuranSpellcaster.java b/Mage.Sets/src/mage/sets/masterseditionii/ZuranSpellcaster.java new file mode 100644 index 00000000000..7c28041325d --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/ZuranSpellcaster.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditionii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ZuranSpellcaster extends mage.sets.iceage.ZuranSpellcaster { + + public ZuranSpellcaster(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + this.expansionSetCode = "ME2"; + } + + public ZuranSpellcaster(final ZuranSpellcaster card) { + super(card); + } + + @Override + public ZuranSpellcaster copy() { + return new ZuranSpellcaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/AmrouKithkin.java b/Mage.Sets/src/mage/sets/masterseditioniii/AmrouKithkin.java new file mode 100644 index 00000000000..4faa50a4975 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/AmrouKithkin.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AmrouKithkin extends mage.sets.legends.AmrouKithkin { + + public AmrouKithkin(UUID ownerId) { + super(ownerId); + this.cardNumber = 3; + this.expansionSetCode = "ME3"; + } + + public AmrouKithkin(final AmrouKithkin card) { + super(card); + } + + @Override + public AmrouKithkin copy() { + return new AmrouKithkin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ArcadesSabboth.java b/Mage.Sets/src/mage/sets/masterseditioniii/ArcadesSabboth.java new file mode 100644 index 00000000000..0820d13dadb --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ArcadesSabboth.java @@ -0,0 +1,97 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.TappedPredicate; + +/** + * + * @author fireshoes + */ +public class ArcadesSabboth extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("untapped creatures you control"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(Predicates.not(new TappedPredicate())); + filter.add(Predicates.not(new AttackingPredicate())); + } + + public ArcadesSabboth(UUID ownerId) { + super(ownerId, 142, "Arcades Sabboth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}{W}{W}{U}{U}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Elder"); + this.subtype.add("Dragon"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // At the beginning of your upkeep, sacrifice Arcades Sabboth unless you pay {G}{W}{U}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{G}{W}{U}")), TargetController.YOU, false)); + + // Each untapped creature you control gets +0/+2 as long as it's not attacking. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(0, 2, Duration.WhileOnBattlefield, filter, false))); + + // {W}: Arcades Sabboth gets +0/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{W}"))); + } + + public ArcadesSabboth(final ArcadesSabboth card) { + super(card); + } + + @Override + public ArcadesSabboth copy() { + return new ArcadesSabboth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/BorisDevilboon.java b/Mage.Sets/src/mage/sets/masterseditioniii/BorisDevilboon.java new file mode 100644 index 00000000000..ad273286c8b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/BorisDevilboon.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class BorisDevilboon extends mage.sets.legends.BorisDevilboon { + + public BorisDevilboon(UUID ownerId) { + super(ownerId); + this.cardNumber = 146; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.UNCOMMON; + } + + public BorisDevilboon(final BorisDevilboon card) { + super(card); + } + + @Override + public BorisDevilboon copy() { + return new BorisDevilboon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/Chromium.java b/Mage.Sets/src/mage/sets/masterseditioniii/Chromium.java new file mode 100644 index 00000000000..cc0e032a460 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/Chromium.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class Chromium extends CardImpl { + + public Chromium(UUID ownerId) { + super(ownerId, 147, "Chromium", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{W}{U}{U}{B}{B}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Elder"); + this.subtype.add("Dragon"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Rampage 2 + this.addAbility(new RampageAbility(2)); + // At the beginning of your upkeep, sacrifice Chromium unless you pay {W}{U}{B}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect( + new ManaCostsImpl("{W}{U}{B}")), TargetController.YOU, false)); + } + + public Chromium(final Chromium card) { + super(card); + } + + @Override + public Chromium copy() { + return new Chromium(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/CinderStorm.java b/Mage.Sets/src/mage/sets/masterseditioniii/CinderStorm.java new file mode 100644 index 00000000000..a5a7aedac9b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/CinderStorm.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class CinderStorm extends mage.sets.starter1999.CinderStorm { + + public CinderStorm(UUID ownerId) { + super(ownerId); + this.cardNumber = 91; + this.expansionSetCode = "ME3"; + } + + public CinderStorm(final CinderStorm card) { + super(card); + } + + @Override + public CinderStorm copy() { + return new CinderStorm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/Cleanse.java b/Mage.Sets/src/mage/sets/masterseditioniii/Cleanse.java new file mode 100644 index 00000000000..e4334cf3de1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/Cleanse.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Cleanse extends mage.sets.legends.Cleanse { + + public Cleanse(UUID ownerId) { + super(ownerId); + this.cardNumber = 5; + this.expansionSetCode = "ME3"; + } + + public Cleanse(final Cleanse card) { + super(card); + } + + @Override + public Cleanse copy() { + return new Cleanse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/CorruptEunuchs.java b/Mage.Sets/src/mage/sets/masterseditioniii/CorruptEunuchs.java new file mode 100644 index 00000000000..266fba9eeba --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/CorruptEunuchs.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class CorruptEunuchs extends CardImpl { + + public CorruptEunuchs(UUID ownerId) { + super(ownerId, 92, "Corrupt Eunuchs", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "ME3"; + this.subtype.add("Human"); + this.subtype.add("Advisor"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Corrupt Eunuchs enters the battlefield, it deals 2 damage to target creature. + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2), false); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public CorruptEunuchs(final CorruptEunuchs card) { + super(card); + } + + @Override + public CorruptEunuchs copy() { + return new CorruptEunuchs(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/CosmicHorror.java b/Mage.Sets/src/mage/sets/masterseditioniii/CosmicHorror.java new file mode 100644 index 00000000000..a43202b347a --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/CosmicHorror.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class CosmicHorror extends mage.sets.legends.CosmicHorror { + + public CosmicHorror(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "ME3"; + } + + public CosmicHorror(final CosmicHorror card) { + super(card); + } + + @Override + public CosmicHorror copy() { + return new CosmicHorror(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/DesperateCharge.java b/Mage.Sets/src/mage/sets/masterseditioniii/DesperateCharge.java new file mode 100644 index 00000000000..d33a2052ff8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/DesperateCharge.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class DesperateCharge extends mage.sets.portalthreekingdoms.DesperateCharge { + + public DesperateCharge(UUID ownerId) { + super(ownerId); + this.cardNumber = 63; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.COMMON; + } + + public DesperateCharge(final DesperateCharge card) { + super(card); + } + + @Override + public DesperateCharge copy() { + return new DesperateCharge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/DongZhouTheTyrant.java b/Mage.Sets/src/mage/sets/masterseditioniii/DongZhouTheTyrant.java new file mode 100644 index 00000000000..979841a4a14 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/DongZhouTheTyrant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DongZhouTheTyrant extends mage.sets.portalthreekingdoms.DongZhouTheTyrant { + + public DongZhouTheTyrant(UUID ownerId) { + super(ownerId); + this.cardNumber = 96; + this.expansionSetCode = "ME3"; + } + + public DongZhouTheTyrant(final DongZhouTheTyrant card) { + super(card); + } + + @Override + public DongZhouTheTyrant copy() { + return new DongZhouTheTyrant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/FeveredStrength.java b/Mage.Sets/src/mage/sets/masterseditioniii/FeveredStrength.java new file mode 100644 index 00000000000..47fd69436c3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/FeveredStrength.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FeveredStrength extends mage.sets.alliances.FeveredStrength1 { + + public FeveredStrength(UUID ownerId) { + super(ownerId); + this.cardNumber = 66; + this.expansionSetCode = "ME3"; + } + + public FeveredStrength(final FeveredStrength card) { + super(card); + } + + @Override + public FeveredStrength copy() { + return new FeveredStrength(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/FlashFlood.java b/Mage.Sets/src/mage/sets/masterseditioniii/FlashFlood.java new file mode 100644 index 00000000000..86f6f8ccdc2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/FlashFlood.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FlashFlood extends mage.sets.legends.FlashFlood { + + public FlashFlood(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.UNCOMMON; + } + + public FlashFlood(final FlashFlood card) { + super(card); + } + + @Override + public FlashFlood copy() { + return new FlashFlood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ForcedRetreat.java b/Mage.Sets/src/mage/sets/masterseditioniii/ForcedRetreat.java new file mode 100644 index 00000000000..4ab6fb188bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ForcedRetreat.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ForcedRetreat extends CardImpl { + + public ForcedRetreat(UUID ownerId) { + super(ownerId, 37, "Forced Retreat", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "ME3"; + + // Put target creature on top of its owner's library. + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public ForcedRetreat(final ForcedRetreat card) { + super(card); + } + + @Override + public ForcedRetreat copy() { + return new ForcedRetreat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/FrostGiant.java b/Mage.Sets/src/mage/sets/masterseditioniii/FrostGiant.java new file mode 100644 index 00000000000..3775baa11b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/FrostGiant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class FrostGiant extends mage.sets.legends.FrostGiant { + + public FrostGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 101; + this.expansionSetCode = "ME3"; + } + + public FrostGiant(final FrostGiant card) { + super(card); + } + + @Override + public FrostGiant copy() { + return new FrostGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/GhostlyVisit.java b/Mage.Sets/src/mage/sets/masterseditioniii/GhostlyVisit.java new file mode 100644 index 00000000000..a9f1ec18d0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/GhostlyVisit.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class GhostlyVisit extends mage.sets.portalthreekingdoms.GhostlyVisit { + + public GhostlyVisit(UUID ownerId) { + super(ownerId); + this.cardNumber = 67; + this.expansionSetCode = "ME3"; + } + + public GhostlyVisit(final GhostlyVisit card) { + super(card); + } + + @Override + public GhostlyVisit copy() { + return new GhostlyVisit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/GhostsOfTheDamned.java b/Mage.Sets/src/mage/sets/masterseditioniii/GhostsOfTheDamned.java new file mode 100644 index 00000000000..e2d6369df47 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/GhostsOfTheDamned.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author hanasu + */ +public class GhostsOfTheDamned extends CardImpl { + + public GhostsOfTheDamned(UUID ownerId) { + super(ownerId, 68, "Ghosts of the Damned", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "ME3"; + this.subtype.add("Spirit"); + this.power = new MageInt(0); + this.toughness = new MageInt(2); + + // {tap}: Target creature gets -1/-0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-1, 0, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public GhostsOfTheDamned(final GhostsOfTheDamned card) { + super(card); + } + + @Override + public GhostsOfTheDamned copy() { + return new GhostsOfTheDamned(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/GuanYuSaintedWarrior.java b/Mage.Sets/src/mage/sets/masterseditioniii/GuanYuSaintedWarrior.java new file mode 100644 index 00000000000..87fd01dfd43 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/GuanYuSaintedWarrior.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.ShuffleIntoLibrarySourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class GuanYuSaintedWarrior extends CardImpl { + + public GuanYuSaintedWarrior(UUID ownerId) { + super(ownerId, 12, "Guan Yu, Sainted Warrior", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // When Guan Yu, Sainted Warrior is put into your graveyard from the battlefield, you may shuffle Guan Yu into your library. + this.addAbility(new DiesTriggeredAbility(new ShuffleIntoLibrarySourceEffect(), true)); + } + + public GuanYuSaintedWarrior(final GuanYuSaintedWarrior card) { + super(card); + } + + @Override + public GuanYuSaintedWarrior copy() { + return new GuanYuSaintedWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/GuanYus1000LiMarch.java b/Mage.Sets/src/mage/sets/masterseditioniii/GuanYus1000LiMarch.java new file mode 100644 index 00000000000..a391fb5ad5f --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/GuanYus1000LiMarch.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.TappedPredicate; + +/** + * + * @author LoneFox + */ +public class GuanYus1000LiMarch extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creatures"); + + static { + filter.add(new TappedPredicate()); + } + + public GuanYus1000LiMarch(UUID ownerId) { + super(ownerId, 13, "Guan Yu's 1,000-Li March", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{W}{W}"); + this.expansionSetCode = "ME3"; + + // Destroy all tapped creatures. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter, false)); + } + + public GuanYus1000LiMarch(final GuanYus1000LiMarch card) { + super(card); + } + + @Override + public GuanYus1000LiMarch copy() { + return new GuanYus1000LiMarch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/HundingGjornersen.java b/Mage.Sets/src/mage/sets/masterseditioniii/HundingGjornersen.java new file mode 100644 index 00000000000..a124aaa1bef --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/HundingGjornersen.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class HundingGjornersen extends mage.sets.legends.HundingGjornersen { + + public HundingGjornersen(UUID ownerId) { + super(ownerId); + this.cardNumber = 152; + this.expansionSetCode = "ME3"; + } + + public HundingGjornersen(final HundingGjornersen card) { + super(card); + } + + @Override + public HundingGjornersen copy() { + return new HundingGjornersen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/HuntingCheetah.java b/Mage.Sets/src/mage/sets/masterseditioniii/HuntingCheetah.java new file mode 100644 index 00000000000..3ae56e6bfd3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/HuntingCheetah.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class HuntingCheetah extends mage.sets.portalthreekingdoms.HuntingCheetah { + + public HuntingCheetah(UUID ownerId) { + super(ownerId); + this.cardNumber = 124; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.COMMON; + } + + public HuntingCheetah(final HuntingCheetah card) { + super(card); + } + + @Override + public HuntingCheetah copy() { + return new HuntingCheetah(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/Infuse.java b/Mage.Sets/src/mage/sets/masterseditioniii/Infuse.java new file mode 100644 index 00000000000..a67a3b3f188 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/Infuse.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Infuse extends mage.sets.iceage.Infuse { + + public Infuse(UUID ownerId) { + super(ownerId); + this.cardNumber = 38; + this.expansionSetCode = "ME3"; + } + + public Infuse(final Infuse card) { + super(card); + } + + @Override + public Infuse copy() { + return new Infuse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/KeiTakahashi.java b/Mage.Sets/src/mage/sets/masterseditioniii/KeiTakahashi.java new file mode 100644 index 00000000000..a1042182d0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/KeiTakahashi.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class KeiTakahashi extends CardImpl { + + public KeiTakahashi(UUID ownerId) { + super(ownerId, 155, "Kei Takahashi", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{W}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {tap}: Prevent the next 2 damage that would be dealt to target creature this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new PreventDamageToTargetEffect(Duration.EndOfTurn, 2), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public KeiTakahashi(final KeiTakahashi card) { + super(card); + } + + @Override + public KeiTakahashi copy() { + return new KeiTakahashi(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/KoboldDrillSergeant.java b/Mage.Sets/src/mage/sets/masterseditioniii/KoboldDrillSergeant.java index 225d0176d3e..19390b22d4c 100644 --- a/Mage.Sets/src/mage/sets/masterseditioniii/KoboldDrillSergeant.java +++ b/Mage.Sets/src/mage/sets/masterseditioniii/KoboldDrillSergeant.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.keyword.TrampleAbility; @@ -47,7 +48,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; * @author ilcartographer */ public class KoboldDrillSergeant extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Kobold creatures"); static { @@ -62,9 +63,11 @@ public class KoboldDrillSergeant extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(2); - // Other Kobold creatures you control get +0/+1 and have trample. + // Other Kobold creatures you control get +0/+1 and have trample. Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 1, Duration.WhileOnBattlefield, filter, true)); - ability.addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, filter, true)); + Effect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, filter, true); + effect.setText("and have trample"); + ability.addEffect(effect); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/LadyCaleria.java b/Mage.Sets/src/mage/sets/masterseditioniii/LadyCaleria.java new file mode 100644 index 00000000000..ae90dcbaee8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/LadyCaleria.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetAttackingOrBlockingCreature; + +/** + * + * @author LoneFox + */ +public class LadyCaleria extends CardImpl { + + public LadyCaleria(UUID ownerId) { + super(ownerId, 157, "Lady Caleria", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}{W}{W}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Archer"); + this.power = new MageInt(3); + this.toughness = new MageInt(6); + + // {T}: Lady Caleria deals 3 damage to target attacking or blocking creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3), new TapSourceCost()); + ability.addTarget(new TargetAttackingOrBlockingCreature()); + this.addAbility(ability); + } + + public LadyCaleria(final LadyCaleria card) { + super(card); + } + + @Override + public LadyCaleria copy() { + return new LadyCaleria(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/LightningBlow.java b/Mage.Sets/src/mage/sets/masterseditioniii/LightningBlow.java new file mode 100644 index 00000000000..b536eee6dda --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/LightningBlow.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class LightningBlow extends mage.sets.iceage.LightningBlow { + + public LightningBlow(UUID ownerId) { + super(ownerId); + this.cardNumber = 18; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.COMMON; + } + + public LightningBlow(final LightningBlow card) { + super(card); + } + + @Override + public LightningBlow copy() { + return new LightningBlow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/LiuBeiLordOfShu.java b/Mage.Sets/src/mage/sets/masterseditioniii/LiuBeiLordOfShu.java new file mode 100644 index 00000000000..e98e81460f4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/LiuBeiLordOfShu.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class LiuBeiLordOfShu extends mage.sets.portalthreekingdoms.LiuBeiLordOfShu { + + public LiuBeiLordOfShu(UUID ownerId) { + super(ownerId); + this.cardNumber = 19; + this.expansionSetCode = "ME3"; + } + + public LiuBeiLordOfShu(final LiuBeiLordOfShu card) { + super(card); + } + + @Override + public LiuBeiLordOfShu copy() { + return new LiuBeiLordOfShu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/LivonyaSilone.java b/Mage.Sets/src/mage/sets/masterseditioniii/LivonyaSilone.java new file mode 100644 index 00000000000..7f44414c988 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/LivonyaSilone.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.LandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author LoneFox + */ +public class LivonyaSilone extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("Legendary land"); + + static { + filter.add(new SupertypePredicate("Legendary")); + } + + public LivonyaSilone(UUID ownerId) { + super(ownerId, 160, "Livonya Silone", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}{G}{G}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // legendary landwalk + this.addAbility(new LandwalkAbility(filter)); + } + + public LivonyaSilone(final LivonyaSilone card) { + super(card); + } + + @Override + public LivonyaSilone copy() { + return new LivonyaSilone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/LuMengWuGeneral.java b/Mage.Sets/src/mage/sets/masterseditioniii/LuMengWuGeneral.java new file mode 100644 index 00000000000..915f6c742af --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/LuMengWuGeneral.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LuMengWuGeneral extends mage.sets.portalthreekingdoms.LuMengWuGeneral { + + public LuMengWuGeneral(UUID ownerId) { + super(ownerId); + this.cardNumber = 41; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.UNCOMMON; + } + + public LuMengWuGeneral(final LuMengWuGeneral card) { + super(card); + } + + @Override + public LuMengWuGeneral copy() { + return new LuMengWuGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ManaVortex.java b/Mage.Sets/src/mage/sets/masterseditioniii/ManaVortex.java new file mode 100644 index 00000000000..6cf19b12be0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ManaVortex.java @@ -0,0 +1,163 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.StateTriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.abilities.effects.common.SacrificeEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterLandPermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author fireshoes + */ +public class ManaVortex extends CardImpl { + + public static final FilterLandPermanent filter = new FilterLandPermanent(); + + public ManaVortex(UUID ownerId) { + super(ownerId, 44, "Mana Vortex", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}"); + this.expansionSetCode = "ME3"; + + // When you cast Mana Vortex, counter it unless you sacrifice a land. + this.addAbility(new CastSourceTriggeredAbility(new CounterSourceEffect())); + + // At the beginning of each player's upkeep, that player sacrifices a land. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(new FilterLandPermanent(), 1, "that player"), + TargetController.ANY, false)); + + // When there are no lands on the battlefield, sacrifice Mana Vortex. + this.addAbility(new ManaVortexStateTriggeredAbility()); + } + + public ManaVortex(final ManaVortex card) { + super(card); + } + + @Override + public ManaVortex copy() { + return new ManaVortex(this); + } +} + +class CounterSourceEffect extends OneShotEffect { + + public CounterSourceEffect() { + super(Outcome.Detriment); + } + + public CounterSourceEffect(final CounterSourceEffect effect) { + super(effect); + } + + @Override + public CounterSourceEffect copy() { + return new CounterSourceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + + StackObject spell = null; + for(StackObject objet : game.getStack()){ + if(objet instanceof Spell && objet.getSourceId().equals(source.getSourceId())){ + spell = objet; + } + } + if(spell != null){ + Player controller = game.getPlayer(source.getControllerId()); + if(controller.chooseUse(Outcome.Detriment, "Sacrifice a land to not counter " + spell.getName() + "?", source, game)){ + SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent())); + if(cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)){ + game.informPlayers(controller.getLogName() + " sacrifices a land to not counter " + spell.getName() + "."); + return true; + } + else { + game.getStack().counter(spell.getId(), source.getSourceId(), game); + } + } + return true; + } + return false; + } + + @Override + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + return "counter it unless you sacrifice a land"; + } +} + +class ManaVortexStateTriggeredAbility extends StateTriggeredAbility { + + public ManaVortexStateTriggeredAbility() { + super(Zone.BATTLEFIELD, new SacrificeSourceEffect()); + } + + public ManaVortexStateTriggeredAbility(final ManaVortexStateTriggeredAbility ability) { + super(ability); + } + + @Override + public ManaVortexStateTriggeredAbility copy() { + return new ManaVortexStateTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return game.getBattlefield().count(ManaVortex.filter, this.getSourceId(), this.getControllerId(), game) == 0; + } + + @Override + public String getRule() { + return new StringBuilder("When there are no lands on the battlefield, ").append(super.getRule()).toString() ; + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/MarhaultElsdragon.java b/Mage.Sets/src/mage/sets/masterseditioniii/MarhaultElsdragon.java new file mode 100644 index 00000000000..3269d81cd5e --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/MarhaultElsdragon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MarhaultElsdragon extends mage.sets.legends.MarhaultElsdragon { + + public MarhaultElsdragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 161; + this.expansionSetCode = "ME3"; + } + + public MarhaultElsdragon(final MarhaultElsdragon card) { + super(card); + } + + @Override + public MarhaultElsdragon copy() { + return new MarhaultElsdragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/PalladiaMors.java b/Mage.Sets/src/mage/sets/masterseditioniii/PalladiaMors.java new file mode 100644 index 00000000000..29daf0ab709 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/PalladiaMors.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class PalladiaMors extends CardImpl { + + public PalladiaMors(UUID ownerId) { + super(ownerId, 164, "Palladia-Mors", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}{G}{G}{W}{W}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Elder"); + this.subtype.add("Dragon"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Trample + this.addAbility(TrampleAbility.getInstance()); + // At the beginning of your upkeep, sacrifice Palladia-Mors unless you pay {R}{G}{W}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{R}{G}{W}")), TargetController.YOU, false)); + } + + public PalladiaMors(final PalladiaMors card) { + super(card); + } + + @Override + public PalladiaMors copy() { + return new PalladiaMors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/PavelMaliki.java b/Mage.Sets/src/mage/sets/masterseditioniii/PavelMaliki.java new file mode 100644 index 00000000000..d34bad95083 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/PavelMaliki.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class PavelMaliki extends mage.sets.legends.PavelMaliki { + + public PavelMaliki(UUID ownerId) { + super(ownerId); + this.cardNumber = 165; + this.expansionSetCode = "ME3"; + } + + public PavelMaliki(final PavelMaliki card) { + super(card); + } + + @Override + public PavelMaliki copy() { + return new PavelMaliki(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/PrincessLucrezia.java b/Mage.Sets/src/mage/sets/masterseditioniii/PrincessLucrezia.java new file mode 100644 index 00000000000..d3b41fc3df7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/PrincessLucrezia.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.abilities.mana.BlueManaAbility; + +/** + * + * @author LoneFox + */ +public class PrincessLucrezia extends CardImpl { + + public PrincessLucrezia(UUID ownerId) { + super(ownerId, 166, "Princess Lucrezia", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}{B}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // {tap}: Add {U} to your mana pool. + this.addAbility(new BlueManaAbility()); + } + + public PrincessLucrezia(final PrincessLucrezia card) { + super(card); + } + + @Override + public PrincessLucrezia copy() { + return new PrincessLucrezia(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/RamsesOverdark.java b/Mage.Sets/src/mage/sets/masterseditioniii/RamsesOverdark.java new file mode 100644 index 00000000000..89483eb456f --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/RamsesOverdark.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.EnchantedPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class RamsesOverdark extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("enchanted creature"); + + static { + filter.add(new EnchantedPredicate()); + } + + public RamsesOverdark(UUID ownerId) { + super(ownerId, 169, "Ramses Overdark", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}{B}{B}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Assassin"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // {tap}: Destroy target enchanted creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public RamsesOverdark(final RamsesOverdark card) { + super(card); + } + + @Override + public RamsesOverdark copy() { + return new RamsesOverdark(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/RevekaWizardSavant.java b/Mage.Sets/src/mage/sets/masterseditioniii/RevekaWizardSavant.java new file mode 100644 index 00000000000..2416727587a --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/RevekaWizardSavant.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author hanasu + */ +public class RevekaWizardSavant extends CardImpl { + + public RevekaWizardSavant(UUID ownerId) { + super(ownerId, 49, "Reveka, Wizard Savant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Dwarf"); + this.subtype.add("Wizard"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // {tap}: Reveka, Wizard Savant deals 2 damage to target creature or player and doesn't untap during your next untap step. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + ability.addEffect(new DontUntapInControllersNextUntapStepSourceEffect()); + this.addAbility(ability); + } + + public RevekaWizardSavant(final RevekaWizardSavant card) { + super(card); + } + + @Override + public RevekaWizardSavant copy() { + return new RevekaWizardSavant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/RidingTheDiluHorse.java b/Mage.Sets/src/mage/sets/masterseditioniii/RidingTheDiluHorse.java new file mode 100644 index 00000000000..20069b53790 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/RidingTheDiluHorse.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class RidingTheDiluHorse extends CardImpl { + + public RidingTheDiluHorse(UUID ownerId) { + super(ownerId, 131, "Riding the Dilu Horse", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{G}"); + this.expansionSetCode = "ME3"; + + // Target creature gets +2/+2 and gains horsemanship. + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.WhileOnBattlefield)); + Effect effect = new GainAbilityTargetEffect(HorsemanshipAbility.getInstance(), Duration.WhileOnBattlefield); + effect.setText("and gains horsemanship"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public RidingTheDiluHorse(final RidingTheDiluHorse card) { + super(card); + } + + @Override + public RidingTheDiluHorse copy() { + return new RidingTheDiluHorse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/RivenTurnbull.java b/Mage.Sets/src/mage/sets/masterseditioniii/RivenTurnbull.java new file mode 100644 index 00000000000..59b049ae3a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/RivenTurnbull.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class RivenTurnbull extends mage.sets.legends.RivenTurnbull { + + public RivenTurnbull(UUID ownerId) { + super(ownerId); + this.cardNumber = 171; + this.expansionSetCode = "ME3"; + } + + public RivenTurnbull(final RivenTurnbull card) { + super(card); + } + + @Override + public RivenTurnbull copy() { + return new RivenTurnbull(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ShuCavalry.java b/Mage.Sets/src/mage/sets/masterseditioniii/ShuCavalry.java new file mode 100644 index 00000000000..1457dd6fffb --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ShuCavalry.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ShuCavalry extends CardImpl { + + public ShuCavalry(UUID ownerId) { + super(ownerId, 23, "Shu Cavalry", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "ME3"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + } + + public ShuCavalry(final ShuCavalry card) { + super(card); + } + + @Override + public ShuCavalry copy() { + return new ShuCavalry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ShuEliteCompanions.java b/Mage.Sets/src/mage/sets/masterseditioniii/ShuEliteCompanions.java new file mode 100644 index 00000000000..a463cd13021 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ShuEliteCompanions.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ShuEliteCompanions extends CardImpl { + + public ShuEliteCompanions(UUID ownerId) { + super(ownerId, 24, "Shu Elite Companions", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "ME3"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + } + + public ShuEliteCompanions(final ShuEliteCompanions card) { + super(card); + } + + @Override + public ShuEliteCompanions copy() { + return new ShuEliteCompanions(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ShuGeneral.java b/Mage.Sets/src/mage/sets/masterseditioniii/ShuGeneral.java new file mode 100644 index 00000000000..1c47b7fd10a --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ShuGeneral.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ShuGeneral extends mage.sets.portalthreekingdoms.ShuGeneral { + + public ShuGeneral(UUID ownerId) { + super(ownerId); + this.cardNumber = 25; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.COMMON; + } + + public ShuGeneral(final ShuGeneral card) { + super(card); + } + + @Override + public ShuGeneral copy() { + return new ShuGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ShuSoldierFarmers.java b/Mage.Sets/src/mage/sets/masterseditioniii/ShuSoldierFarmers.java new file mode 100644 index 00000000000..c045ae172cc --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ShuSoldierFarmers.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ShuSoldierFarmers extends mage.sets.portalthreekingdoms.ShuSoldierFarmers { + + public ShuSoldierFarmers(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.COMMON; + } + + public ShuSoldierFarmers(final ShuSoldierFarmers card) { + super(card); + } + + @Override + public ShuSoldierFarmers copy() { + return new ShuSoldierFarmers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/SlashingTiger.java b/Mage.Sets/src/mage/sets/masterseditioniii/SlashingTiger.java new file mode 100644 index 00000000000..0075609f813 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/SlashingTiger.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SlashingTiger extends mage.sets.portalthreekingdoms.SlashingTiger { + + public SlashingTiger(UUID ownerId) { + super(ownerId); + this.cardNumber = 133; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.COMMON; + } + + public SlashingTiger(final SlashingTiger card) { + super(card); + } + + @Override + public SlashingTiger copy() { + return new SlashingTiger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/StolenGrain.java b/Mage.Sets/src/mage/sets/masterseditioniii/StolenGrain.java new file mode 100644 index 00000000000..b8a7ad87418 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/StolenGrain.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author LoneFox + */ +public class StolenGrain extends CardImpl { + + public StolenGrain(UUID ownerId) { + super(ownerId, 75, "Stolen Grain", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{B}{B}"); + this.expansionSetCode = "ME3"; + + // Stolen Grain deals 5 damage to target opponent. You gain 5 life. + this.getSpellAbility().addEffect(new DamageTargetEffect(5)); + this.getSpellAbility().addEffect(new GainLifeEffect(5)); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public StolenGrain(final StolenGrain card) { + super(card); + } + + @Override + public StolenGrain copy() { + return new StolenGrain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/SunCeYoungConquerer.java b/Mage.Sets/src/mage/sets/masterseditioniii/SunCeYoungConquerer.java new file mode 100644 index 00000000000..be6957bee40 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/SunCeYoungConquerer.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SunCeYoungConquerer extends CardImpl { + + public SunCeYoungConquerer(UUID ownerId) { + super(ownerId, 52, "Sun Ce, Young Conquerer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // When Sun Ce, Young Conquerer enters the battlefield, you may return target creature to its owner's hand. + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public SunCeYoungConquerer(final SunCeYoungConquerer card) { + super(card); + } + + @Override + public SunCeYoungConquerer copy() { + return new SunCeYoungConquerer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/SunastianFalconer.java b/Mage.Sets/src/mage/sets/masterseditioniii/SunastianFalconer.java new file mode 100644 index 00000000000..56cd522fa8b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/SunastianFalconer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class SunastianFalconer extends mage.sets.legends.SunastianFalconer { + + public SunastianFalconer(UUID ownerId) { + super(ownerId); + this.cardNumber = 178; + this.expansionSetCode = "ME3"; + } + + public SunastianFalconer(final SunastianFalconer card) { + super(card); + } + + @Override + public SunastianFalconer copy() { + return new SunastianFalconer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/TorWauki.java b/Mage.Sets/src/mage/sets/masterseditioniii/TorWauki.java new file mode 100644 index 00000000000..bfd68ec93bb --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/TorWauki.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class TorWauki extends mage.sets.legends.TorWauki { + + public TorWauki(UUID ownerId) { + super(ownerId); + this.cardNumber = 182; + this.expansionSetCode = "ME3"; + } + + public TorWauki(final TorWauki card) { + super(card); + } + + @Override + public TorWauki copy() { + return new TorWauki(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/TripWire.java b/Mage.Sets/src/mage/sets/masterseditioniii/TripWire.java new file mode 100644 index 00000000000..f95dca4b43e --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/TripWire.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class TripWire extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with horsemanship"); + + static { + filter.add(new AbilityPredicate(HorsemanshipAbility.class)); + } + + public TripWire(UUID ownerId) { + super(ownerId, 137, "Trip Wire", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}"); + this.expansionSetCode = "ME3"; + + // Destroy target creature with horsemanship. + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + } + + public TripWire(final TripWire card) { + super(card); + } + + @Override + public TripWire copy() { + return new TripWire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/TuknirDeathlock.java b/Mage.Sets/src/mage/sets/masterseditioniii/TuknirDeathlock.java new file mode 100644 index 00000000000..dff5f112c7a --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/TuknirDeathlock.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class TuknirDeathlock extends CardImpl { + + public TuknirDeathlock(UUID ownerId) { + super(ownerId, 184, "Tuknir Deathlock", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{R}{R}{G}{G}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {R}{G}, {tap}: Target creature gets +2/+2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new ManaCostsImpl("{R}{G}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public TuknirDeathlock(final TuknirDeathlock card) { + super(card); + } + + @Override + public TuknirDeathlock copy() { + return new TuknirDeathlock(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/VaevictisAsmadi.java b/Mage.Sets/src/mage/sets/masterseditioniii/VaevictisAsmadi.java new file mode 100644 index 00000000000..93e0513a6fa --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/VaevictisAsmadi.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class VaevictisAsmadi extends CardImpl { + + public VaevictisAsmadi(UUID ownerId) { + super(ownerId, 185, "Vaevictis Asmadi", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}{R}{R}{G}{G}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Elder"); + this.subtype.add("Dragon"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // At the beginning of your upkeep, sacrifice Vaevictis Asmadi unless you pay {B}{R}{G}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{B}{R}{G}")), TargetController.YOU, false)); + // {B}: Vaevictis Asmadi gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + // {R}: Vaevictis Asmadi gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + // {G}: Vaevictis Asmadi gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{G}"))); + } + + public VaevictisAsmadi(final VaevictisAsmadi card) { + super(card); + } + + @Override + public VaevictisAsmadi copy() { + return new VaevictisAsmadi(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/WallOfLight.java b/Mage.Sets/src/mage/sets/masterseditioniii/WallOfLight.java new file mode 100644 index 00000000000..83fdd6802bb --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/WallOfLight.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class WallOfLight extends CardImpl { + + private static final FilterCard filter = new FilterCard("black"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public WallOfLight(UUID ownerId) { + super(ownerId, 27, "Wall of Light", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "ME3"; + this.subtype.add("Wall"); + this.power = new MageInt(1); + this.toughness = new MageInt(5); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Protection from black + this.addAbility(new ProtectionAbility(filter)); + } + + public WallOfLight(final WallOfLight card) { + super(card); + } + + @Override + public WallOfLight copy() { + return new WallOfLight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/WanderingMage.java b/Mage.Sets/src/mage/sets/masterseditioniii/WanderingMage.java new file mode 100644 index 00000000000..a09c453c49b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/WanderingMage.java @@ -0,0 +1,140 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.CostImpl; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.Target; +import mage.target.TargetPlayer; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class WanderingMage extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Cleric or Wizard"); + + static { + filter.add(Predicates.or( + new SubtypePredicate("Cleric"), + new SubtypePredicate("Wizard"))); + } + + public WanderingMage(UUID ownerId) { + super(ownerId, 186, "Wandering Mage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{U}{B}"); + this.expansionSetCode = "ME3"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.subtype.add("Wizard"); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // {W}, Pay 1 life: Prevent the next 2 damage that would be dealt to target creature this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new PreventDamageToTargetEffect(Duration.EndOfTurn, 2), new ManaCostsImpl("{W}")); + ability.addCost(new PayLifeCost(1)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // {U}: Prevent the next 1 damage that would be dealt to target Cleric or Wizard creature this turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new ManaCostsImpl("{U}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + + // {B}, Put a -1/-1 counter on a creature you control: Prevent the next 2 damage that would be dealt to target player this turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new PreventDamageToTargetEffect(Duration.EndOfTurn, 2), new ManaCostsImpl("{B}")); + ability.addCost(new WanderingMageCost()); + ability.addTarget(new TargetPlayer()); + Target target = new TargetControlledCreaturePermanent(); + target.setNotTarget(true); + ability.addTarget(target); + this.addAbility(ability); + } + + public WanderingMage(final WanderingMage card) { + super(card); + } + + @Override + public WanderingMage copy() { + return new WanderingMage(this); + } +} + +class WanderingMageCost extends CostImpl { + + public WanderingMageCost() { + this.text = "Put a -1/-1 counter on a creature you control"; + } + + public WanderingMageCost(WanderingMageCost cost) { + super(cost); + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + return true; + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Permanent permanent = game.getPermanent(ability.getTargets().get(1).getFirstTarget()); + if (permanent != null) { + permanent.addCounters(CounterType.M1M1.createInstance(), game); + this.paid = true; + } + return paid; + } + + @Override + public WanderingMageCost copy() { + return new WanderingMageCost(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/WeiEliteCompanions.java b/Mage.Sets/src/mage/sets/masterseditioniii/WeiEliteCompanions.java new file mode 100644 index 00000000000..9af6c47d2dc --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/WeiEliteCompanions.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WeiEliteCompanions extends CardImpl { + + public WeiEliteCompanions(UUID ownerId) { + super(ownerId, 79, "Wei Elite Companions", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "ME3"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + } + + public WeiEliteCompanions(final WeiEliteCompanions card) { + super(card); + } + + @Override + public WeiEliteCompanions copy() { + return new WeiEliteCompanions(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/WeiNightRaiders.java b/Mage.Sets/src/mage/sets/masterseditioniii/WeiNightRaiders.java new file mode 100644 index 00000000000..9f9001e97d4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/WeiNightRaiders.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WeiNightRaiders extends mage.sets.portalthreekingdoms.WeiNightRaiders { + + public WeiNightRaiders(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "ME3"; + } + + public WeiNightRaiders(final WeiNightRaiders card) { + super(card); + } + + @Override + public WeiNightRaiders copy() { + return new WeiNightRaiders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/WeiStrikeForce.java b/Mage.Sets/src/mage/sets/masterseditioniii/WeiStrikeForce.java new file mode 100644 index 00000000000..08224ecece6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/WeiStrikeForce.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WeiStrikeForce extends mage.sets.portalthreekingdoms.WeiStrikeForce { + + public WeiStrikeForce(UUID ownerId) { + super(ownerId); + this.cardNumber = 82; + this.expansionSetCode = "ME3"; + } + + public WeiStrikeForce(final WeiStrikeForce card) { + super(card); + } + + @Override + public WeiStrikeForce copy() { + return new WeiStrikeForce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/WormwoodTreefolk.java b/Mage.Sets/src/mage/sets/masterseditioniii/WormwoodTreefolk.java new file mode 100644 index 00000000000..4e6beb8c3f0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/WormwoodTreefolk.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class WormwoodTreefolk extends mage.sets.thedark.WormwoodTreefolk { + + public WormwoodTreefolk(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.UNCOMMON; + } + + public WormwoodTreefolk(final WormwoodTreefolk card) { + super(card); + } + + @Override + public WormwoodTreefolk copy() { + return new WormwoodTreefolk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/WuEliteCavalry.java b/Mage.Sets/src/mage/sets/masterseditioniii/WuEliteCavalry.java new file mode 100644 index 00000000000..ea254c501c8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/WuEliteCavalry.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WuEliteCavalry extends mage.sets.portalthreekingdoms.WuEliteCavalry { + + public WuEliteCavalry(UUID ownerId) { + super(ownerId); + this.cardNumber = 54; + this.expansionSetCode = "ME3"; + } + + public WuEliteCavalry(final WuEliteCavalry card) { + super(card); + } + + @Override + public WuEliteCavalry copy() { + return new WuEliteCavalry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/YoungWeiRecruits.java b/Mage.Sets/src/mage/sets/masterseditioniii/YoungWeiRecruits.java new file mode 100644 index 00000000000..843d6ddacfa --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/YoungWeiRecruits.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CantBlockAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class YoungWeiRecruits extends CardImpl { + + public YoungWeiRecruits(UUID ownerId) { + super(ownerId, 84, "Young Wei Recruits", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ME3"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Young Wei Recruits can't block. + this.addAbility(new CantBlockAbility()); + } + + public YoungWeiRecruits(final YoungWeiRecruits card) { + super(card); + } + + @Override + public YoungWeiRecruits copy() { + return new YoungWeiRecruits(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ZhangFeiFierceWarrior.java b/Mage.Sets/src/mage/sets/masterseditioniii/ZhangFeiFierceWarrior.java new file mode 100644 index 00000000000..db64cef8861 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ZhangFeiFierceWarrior.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZhangFeiFierceWarrior extends CardImpl { + + public ZhangFeiFierceWarrior(UUID ownerId) { + super(ownerId, 28, "Zhang Fei, Fierce Warrior", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Vigilance; horsemanship + this.addAbility(VigilanceAbility.getInstance()); + this.addAbility(HorsemanshipAbility.getInstance()); + } + + public ZhangFeiFierceWarrior(final ZhangFeiFierceWarrior card) { + super(card); + } + + @Override + public ZhangFeiFierceWarrior copy() { + return new ZhangFeiFierceWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ZodiacDragon.java b/Mage.Sets/src/mage/sets/masterseditioniii/ZodiacDragon.java new file mode 100644 index 00000000000..8cd972b8ca2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ZodiacDragon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ZodiacDragon extends mage.sets.portalthreekingdoms.ZodiacDragon { + + public ZodiacDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 112; + this.expansionSetCode = "ME3"; + } + + public ZodiacDragon(final ZodiacDragon card) { + super(card); + } + + @Override + public ZodiacDragon copy() { + return new ZodiacDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/Aladdin.java b/Mage.Sets/src/mage/sets/masterseditioniv/Aladdin.java new file mode 100644 index 00000000000..612f31d52ca --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/Aladdin.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author nigelzor + */ +public class Aladdin extends CardImpl { + + public Aladdin(UUID ownerId) { + super(ownerId, 106, "Aladdin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Human"); + this.subtype.add("Rogue"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{R}{R}, {tap}: Gain control of target artifact for as long as you control Aladdin. + ConditionalContinuousEffect effect = new ConditionalContinuousEffect( + new GainControlTargetEffect(Duration.Custom), + new SourceOnBattlefieldControlUnchangedCondition(), + "Gain control of target artifact for as long as you control Aladdin"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{R}{R}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetArtifactPermanent()); + this.addAbility(ability); + } + + public Aladdin(final Aladdin card) { + super(card); + } + + @Override + public Aladdin copy() { + return new Aladdin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/ArgivianBlacksmith.java b/Mage.Sets/src/mage/sets/masterseditioniv/ArgivianBlacksmith.java new file mode 100644 index 00000000000..39f60c163ab --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/ArgivianBlacksmith.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ArgivianBlacksmith extends mage.sets.antiquities.ArgivianBlacksmith { + + public ArgivianBlacksmith(UUID ownerId) { + super(ownerId); + this.cardNumber = 4; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.UNCOMMON; + } + + public ArgivianBlacksmith(final ArgivianBlacksmith card) { + super(card); + } + + @Override + public ArgivianBlacksmith copy() { + return new ArgivianBlacksmith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/BookOfRass.java b/Mage.Sets/src/mage/sets/masterseditioniv/BookOfRass.java new file mode 100644 index 00000000000..dee10ce1316 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/BookOfRass.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class BookOfRass extends mage.sets.thedark.BookOfRass { + + public BookOfRass(UUID ownerId) { + super(ownerId); + this.cardNumber = 183; + this.expansionSetCode = "ME4"; + } + + public BookOfRass(final BookOfRass card) { + super(card); + } + + @Override + public BookOfRass copy() { + return new BookOfRass(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/ClockworkGnomes.java b/Mage.Sets/src/mage/sets/masterseditioniv/ClockworkGnomes.java new file mode 100644 index 00000000000..d25ca1ac669 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/ClockworkGnomes.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author hanasu + */ +public class ClockworkGnomes extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + + public ClockworkGnomes(UUID ownerId) { + super(ownerId, 191, "Clockwork Gnomes", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Gnome"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {3}, {tap}: Regenerate target artifact creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public ClockworkGnomes(final ClockworkGnomes card) { + super(card); + } + + @Override + public ClockworkGnomes copy() { + return new ClockworkGnomes(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/Conversion.java b/Mage.Sets/src/mage/sets/masterseditioniv/Conversion.java new file mode 100644 index 00000000000..afca2b79f50 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/Conversion.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.RARE; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/CoralHelm.java b/Mage.Sets/src/mage/sets/masterseditioniv/CoralHelm.java new file mode 100644 index 00000000000..d76d8738ad8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/CoralHelm.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author nigelzor + */ +public class CoralHelm extends CardImpl { + + public CoralHelm(UUID ownerId) { + super(ownerId, 194, "Coral Helm", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "ME4"; + + // {3}, Discard a card at random: Target creature gets +2/+2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new GenericManaCost(3)); + ability.addCost(new DiscardCardCost(true)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public CoralHelm(final CoralHelm card) { + super(card); + } + + @Override + public CoralHelm copy() { + return new CoralHelm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/Crumble.java b/Mage.Sets/src/mage/sets/masterseditioniv/Crumble.java new file mode 100644 index 00000000000..6c6708362da --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/Crumble.java @@ -0,0 +1,100 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author fireshoes + */ +public class Crumble extends CardImpl { + + public Crumble(UUID ownerId) { + super(ownerId, 147, "Crumble", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "ME4"; + + // Destroy target artifact. It can't be regenerated. + this.getSpellAbility().addTarget(new TargetArtifactPermanent()); + this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); + + // That artifact's controller gains life equal to its converted mana cost. + this.getSpellAbility().addEffect(new CrumbleEffect()); + } + + public Crumble(final Crumble card) { + super(card); + } + + @Override + public Crumble copy() { + return new Crumble(this); + } +} + +class CrumbleEffect extends OneShotEffect { + + public CrumbleEffect() { + super(Outcome.GainLife); + staticText = "That artifact's controller gains life equal to its converted mana cost"; + } + + public CrumbleEffect(final CrumbleEffect effect) { + super(effect); + } + + @Override + public CrumbleEffect copy() { + return new CrumbleEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + if (permanent != null) { + int cost = permanent.getManaCost().convertedManaCost(); + Player player = game.getPlayer(permanent.getControllerId()); + if (player != null) { + player.gainLife(cost, game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/DakmorPlague.java b/Mage.Sets/src/mage/sets/masterseditioniv/DakmorPlague.java new file mode 100644 index 00000000000..27b3e2d2a1b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/DakmorPlague.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DakmorPlague extends mage.sets.starter1999.DakmorPlague { + + public DakmorPlague(UUID ownerId) { + super(ownerId); + this.cardNumber = 73; + this.expansionSetCode = "ME4"; + } + + public DakmorPlague(final DakmorPlague card) { + super(card); + } + + @Override + public DakmorPlague copy() { + return new DakmorPlague(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/DeathcoilWurm.java b/Mage.Sets/src/mage/sets/masterseditioniv/DeathcoilWurm.java new file mode 100644 index 00000000000..ba2489bf26c --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/DeathcoilWurm.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class DeathcoilWurm extends mage.sets.portalsecondage.DeathcoilWurm { + + public DeathcoilWurm(UUID ownerId) { + super(ownerId); + this.cardNumber = 149; + this.expansionSetCode = "ME4"; + } + + public DeathcoilWurm(final DeathcoilWurm card) { + super(card); + } + + @Override + public DeathcoilWurm copy() { + return new DeathcoilWurm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/Deathgrip.java b/Mage.Sets/src/mage/sets/masterseditioniv/Deathgrip.java new file mode 100644 index 00000000000..e5d9b196a87 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/Deathgrip.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Deathgrip extends mage.sets.limitedbeta.Deathgrip { + + public Deathgrip(UUID ownerId) { + super(ownerId); + this.cardNumber = 75; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.RARE; + } + + public Deathgrip(final Deathgrip card) { + super(card); + } + + @Override + public Deathgrip copy() { + return new Deathgrip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/Detonate.java b/Mage.Sets/src/mage/sets/masterseditioniv/Detonate.java new file mode 100644 index 00000000000..4fc34356daf --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/Detonate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Detonate extends mage.sets.fifthedition.Detonate { + + public Detonate(UUID ownerId) { + super(ownerId); + this.cardNumber = 111; + this.expansionSetCode = "ME4"; + } + + public Detonate(final Detonate card) { + super(card); + } + + @Override + public Detonate copy() { + return new Detonate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/DiabolicMachine.java b/Mage.Sets/src/mage/sets/masterseditioniv/DiabolicMachine.java new file mode 100644 index 00000000000..2978f689ab2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/DiabolicMachine.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class DiabolicMachine extends mage.sets.fourthedition.DiabolicMachine { + + public DiabolicMachine(UUID ownerId) { + super(ownerId); + this.cardNumber = 196; + this.expansionSetCode = "ME4"; + } + + public DiabolicMachine(final DiabolicMachine card) { + super(card); + } + + @Override + public DiabolicMachine copy() { + return new DiabolicMachine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/DreadReaper.java b/Mage.Sets/src/mage/sets/masterseditioniv/DreadReaper.java new file mode 100644 index 00000000000..8802183addd --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/DreadReaper.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DreadReaper extends mage.sets.starter1999.DreadReaper { + + public DreadReaper(UUID ownerId) { + super(ownerId); + this.cardNumber = 78; + this.expansionSetCode = "ME4"; + } + + public DreadReaper(final DreadReaper card) { + super(card); + } + + @Override + public DreadReaper copy() { + return new DreadReaper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/Drowned.java b/Mage.Sets/src/mage/sets/masterseditioniv/Drowned.java new file mode 100644 index 00000000000..94839a3396c --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/Drowned.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Drowned extends mage.sets.thedark.Drowned { + + public Drowned(UUID ownerId) { + super(ownerId); + this.cardNumber = 47; + this.expansionSetCode = "ME4"; + } + + public Drowned(final Drowned card) { + super(card); + } + + @Override + public Drowned copy() { + return new Drowned(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/EbonDragon.java b/Mage.Sets/src/mage/sets/masterseditioniv/EbonDragon.java new file mode 100644 index 00000000000..9836e47c57b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/EbonDragon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EbonDragon extends mage.sets.ftvdragons.EbonDragon { + + public EbonDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 80; + this.expansionSetCode = "ME4"; + } + + public EbonDragon(final EbonDragon card) { + super(card); + } + + @Override + public EbonDragon copy() { + return new EbonDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/EliteCatWarrior.java b/Mage.Sets/src/mage/sets/masterseditioniv/EliteCatWarrior.java index b0590a190b5..44097685a26 100644 --- a/Mage.Sets/src/mage/sets/masterseditioniv/EliteCatWarrior.java +++ b/Mage.Sets/src/mage/sets/masterseditioniv/EliteCatWarrior.java @@ -1,52 +1,52 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.masterseditioniv; - -import java.util.UUID; - -/** - * - * @author LevelX2 - */ -public class EliteCatWarrior extends mage.sets.portal.EliteCatWarrior { - - public EliteCatWarrior(UUID ownerId) { - super(ownerId); - this.cardNumber = 151; - this.expansionSetCode = "ME4"; - } - - public EliteCatWarrior(final EliteCatWarrior card) { - super(card); - } - - @Override - public EliteCatWarrior copy() { - return new EliteCatWarrior(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class EliteCatWarrior extends mage.sets.portal.EliteCatWarrior1 { + + public EliteCatWarrior(UUID ownerId) { + super(ownerId); + this.cardNumber = 151; + this.expansionSetCode = "ME4"; + } + + public EliteCatWarrior(final EliteCatWarrior card) { + super(card); + } + + @Override + public EliteCatWarrior copy() { + return new EliteCatWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/FoulSpirit.java b/Mage.Sets/src/mage/sets/masterseditioniv/FoulSpirit.java index bf83c7d77ad..4a00e1cc953 100644 --- a/Mage.Sets/src/mage/sets/masterseditioniv/FoulSpirit.java +++ b/Mage.Sets/src/mage/sets/masterseditioniv/FoulSpirit.java @@ -29,16 +29,13 @@ package mage.sets.masterseditioniv; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.filter.common.FilterControlledLandPermanent; -import mage.target.common.TargetControlledPermanent; +import mage.filter.common.FilterLandPermanent; /** * @@ -55,13 +52,9 @@ public class FoulSpirit extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // When Foul Spirit enters the battlefield, sacrifice a land. - Effect effect = new SacrificeTargetEffect(); - effect.setText("sacrifice a land"); - Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); - ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent())); - this.addAbility(ability); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false)); } public FoulSpirit(final FoulSpirit card) { diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/GateToPhyrexia.java b/Mage.Sets/src/mage/sets/masterseditioniv/GateToPhyrexia.java new file mode 100644 index 00000000000..0dcdf6b7829 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/GateToPhyrexia.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GateToPhyrexia extends mage.sets.antiquities.GateToPhyrexia { + + public GateToPhyrexia(UUID ownerId) { + super(ownerId); + this.cardNumber = 82; + this.expansionSetCode = "ME4"; + } + + public GateToPhyrexia(final GateToPhyrexia card) { + super(card); + } + + @Override + public GateToPhyrexia copy() { + return new GateToPhyrexia(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/GoblinCaves.java b/Mage.Sets/src/mage/sets/masterseditioniv/GoblinCaves.java new file mode 100644 index 00000000000..909c490246e --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/GoblinCaves.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class GoblinCaves extends mage.sets.thedark.GoblinCaves { + + public GoblinCaves(UUID ownerId) { + super(ownerId); + this.cardNumber = 119; + this.expansionSetCode = "ME4"; + } + + public GoblinCaves(final GoblinCaves card) { + super(card); + } + + @Override + public GoblinCaves copy() { + return new GoblinCaves(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/GorillaWarCry.java b/Mage.Sets/src/mage/sets/masterseditioniv/GorillaWarCry.java new file mode 100644 index 00000000000..8fdd8972bf2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/GorillaWarCry.java @@ -0,0 +1,124 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.TurnPhase; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author fireshoes + */ +public class GorillaWarCry extends CardImpl { + + public GorillaWarCry(UUID ownerId) { + super(ownerId, 124, "Gorilla War Cry", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "ME4"; + + // Cast Gorilla War Cry only during combat before blockers are declared. + Ability ability = new SimpleStaticAbility(Zone.ALL, new GorillaWarCryRuleModifyingEffect()); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + + // All creatures gain menace until end of turn. (They can't be blocked except by two or more creatures.) + Effect effect = new GainAbilityAllEffect(new MenaceAbility(), Duration.EndOfTurn, new FilterCreaturePermanent()); + effect.setText("All creatures gain menace until end of turn. (They can't be blocked except by two or more creatures.)"); + this.getSpellAbility().addEffect(effect); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public GorillaWarCry(final GorillaWarCry card) { + super(card); + } + + @Override + public GorillaWarCry copy() { + return new GorillaWarCry(this); + } +} + +class GorillaWarCryRuleModifyingEffect extends ContinuousRuleModifyingEffectImpl { + + GorillaWarCryRuleModifyingEffect() { + super(Duration.EndOfGame, Outcome.Detriment); + staticText = "Cast {this} only during combat before blockers are declared"; + } + + GorillaWarCryRuleModifyingEffect(final GorillaWarCryRuleModifyingEffect effect) { + super(effect); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType().equals(GameEvent.EventType.CAST_SPELL); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getSourceId().equals(source.getSourceId())) { + return !TurnPhase.COMBAT.equals(game.getTurn().getPhaseType()) || + game.getStep().getType().equals(PhaseStep.DECLARE_BLOCKERS) || + game.getStep().getType().equals(PhaseStep.FIRST_COMBAT_DAMAGE) || + game.getStep().getType().equals(PhaseStep.COMBAT_DAMAGE) || + game.getStep().getType().equals(PhaseStep.END_COMBAT); + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public GorillaWarCryRuleModifyingEffect copy() { + return new GorillaWarCryRuleModifyingEffect(this); + } +} + diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/JununEfreet.java b/Mage.Sets/src/mage/sets/masterseditioniv/JununEfreet.java new file mode 100644 index 00000000000..11361effc37 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/JununEfreet.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class JununEfreet extends mage.sets.fourthedition.JununEfreet { + + public JununEfreet(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "ME4"; + } + + public JununEfreet(final JununEfreet card) { + super(card); + } + + @Override + public JununEfreet copy() { + return new JununEfreet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/LastChance.java b/Mage.Sets/src/mage/sets/masterseditioniv/LastChance.java new file mode 100644 index 00000000000..1dc88330dbe --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/LastChance.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LastChance extends CardImpl { + + public LastChance(UUID ownerId) { + super(ownerId, 125, "Last Chance", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{R}{R}"); + this.expansionSetCode = "ME4"; + + // Take an extra turn after this one. At the beginning of that turn's end step, you lose the game. + this.getSpellAbility().addEffect(new AddExtraTurnControllerEffect(true)); + } + + public LastChance(final LastChance card) { + super(card); + } + + @Override + public LastChance copy() { + return new LastChance(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/Lifeforce.java b/Mage.Sets/src/mage/sets/masterseditioniv/Lifeforce.java new file mode 100644 index 00000000000..0b37d2e5ba4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/Lifeforce.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.TargetSpell; + +/** + * + * @author anonymous + */ +public class Lifeforce extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("black spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public Lifeforce(UUID ownerId) { + super(ownerId, 160, "Lifeforce", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G}{G}"); + this.expansionSetCode = "ME4"; + + // {G}{G}: Counter target black spell. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{G}{G}")); + ability.addTarget(new TargetSpell(filter)); + this.addAbility(ability); + } + + public Lifeforce(final Lifeforce card) { + super(card); + } + + @Override + public Lifeforce copy() { + return new Lifeforce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/MysticDecree.java b/Mage.Sets/src/mage/sets/masterseditioniv/MysticDecree.java new file mode 100644 index 00000000000..ba2f77ca693 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/MysticDecree.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class MysticDecree extends mage.sets.homelands.MysticDecree { + + public MysticDecree(UUID ownerId) { + super(ownerId); + this.cardNumber = 53; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.UNCOMMON; + } + + public MysticDecree(final MysticDecree card) { + super(card); + } + + @Override + public MysticDecree copy() { + return new MysticDecree(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/NakedSingularity.java b/Mage.Sets/src/mage/sets/masterseditioniv/NakedSingularity.java new file mode 100644 index 00000000000..355d9ad917f --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/NakedSingularity.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class NakedSingularity extends mage.sets.iceage.NakedSingularity { + + public NakedSingularity(UUID ownerId) { + super(ownerId); + this.cardNumber = 216; + this.expansionSetCode = "ME4"; + } + + public NakedSingularity(final NakedSingularity card) { + super(card); + } + + @Override + public NakedSingularity copy() { + return new NakedSingularity(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/OrcishMechanics.java b/Mage.Sets/src/mage/sets/masterseditioniv/OrcishMechanics.java new file mode 100644 index 00000000000..ffb1f92ce4e --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/OrcishMechanics.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class OrcishMechanics extends mage.sets.antiquities.OrcishMechanics { + + public OrcishMechanics(UUID ownerId) { + super(ownerId); + this.cardNumber = 129; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.UNCOMMON; + } + + public OrcishMechanics(final OrcishMechanics card) { + super(card); + } + + @Override + public OrcishMechanics copy() { + return new OrcishMechanics(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/OsaiVultures.java b/Mage.Sets/src/mage/sets/masterseditioniv/OsaiVultures.java new file mode 100644 index 00000000000..f7d15e66619 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/OsaiVultures.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class OsaiVultures extends mage.sets.legends.OsaiVultures { + + public OsaiVultures(UUID ownerId) { + super(ownerId); + this.cardNumber = 21; + this.expansionSetCode = "ME4"; + } + + public OsaiVultures(final OsaiVultures card) { + super(card); + } + + @Override + public OsaiVultures copy() { + return new OsaiVultures(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/RingOfRenewal.java b/Mage.Sets/src/mage/sets/masterseditioniv/RingOfRenewal.java new file mode 100644 index 00000000000..61ac07d1299 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/RingOfRenewal.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.discard.DiscardControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class RingOfRenewal extends CardImpl { + + public RingOfRenewal(UUID ownerId) { + super(ownerId, 224, "Ring of Renewal", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "ME4"; + + // {5}, {tap}: Discard a card at random, then draw two cards. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DiscardControllerEffect(1, true), new ManaCostsImpl("{5}")); + ability.addCost(new TapSourceCost()); + Effect effect = new DrawCardSourceControllerEffect(2); + effect.setText(", then draw two cards"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public RingOfRenewal(final RingOfRenewal card) { + super(card); + } + + @Override + public RingOfRenewal copy() { + return new RingOfRenewal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/RockslideAmbush.java b/Mage.Sets/src/mage/sets/masterseditioniv/RockslideAmbush.java new file mode 100644 index 00000000000..b899b3818fa --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/RockslideAmbush.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class RockslideAmbush extends mage.sets.portalthreekingdoms.RockslideAmbush { + + public RockslideAmbush(UUID ownerId) { + super(ownerId); + this.cardNumber = 134; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public RockslideAmbush(final RockslideAmbush card) { + super(card); + } + + @Override + public RockslideAmbush copy() { + return new RockslideAmbush(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/ScavengingGhoul.java b/Mage.Sets/src/mage/sets/masterseditioniv/ScavengingGhoul.java new file mode 100644 index 00000000000..700e284c555 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/ScavengingGhoul.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ScavengingGhoul extends mage.sets.limitedalpha.ScavengingGhoul { + + public ScavengingGhoul(UUID ownerId) { + super(ownerId); + this.cardNumber = 95; + this.expansionSetCode = "ME4"; + } + + public ScavengingGhoul(final ScavengingGhoul card) { + super(card); + } + + @Override + public ScavengingGhoul copy() { + return new ScavengingGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/SoldeviMachinist.java b/Mage.Sets/src/mage/sets/masterseditioniv/SoldeviMachinist.java new file mode 100644 index 00000000000..6af888069af --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/SoldeviMachinist.java @@ -0,0 +1,115 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.ConditionalMana; +import mage.MageInt; +import mage.MageObject; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.mana.ConditionalColorlessManaAbility; +import mage.abilities.mana.builder.ConditionalManaBuilder; +import mage.abilities.mana.conditional.ManaCondition; +import mage.cards.CardImpl; +import mage.constants.AbilityType; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.Game; + +/** + * + * @author hanasu + */ +public class SoldeviMachinist extends CardImpl { + + public SoldeviMachinist(UUID ownerId) { + super(ownerId, 63, "Soldevi Machinist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.subtype.add("Artificer"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Add {2} to your mana pool. Spend this mana only to activate abilities of artifacts. + this.addAbility(new ConditionalColorlessManaAbility(new TapSourceCost(), 2, new SoldeviMachinistManaBuilder())); + } + + public SoldeviMachinist(final SoldeviMachinist card) { + super(card); + } + + @Override + public SoldeviMachinist copy() { + return new SoldeviMachinist(this); + } +} + +class SoldeviMachinistManaBuilder extends ConditionalManaBuilder { + + @Override + public ConditionalMana build(Object... options) { + return new ArtifactAbilityConditionalMana(this.mana); + } + + @Override + public String getRule() { + return "Spend this mana only to activate abilities of artifacts"; + } +} + +class ArtifactAbilityConditionalMana extends ConditionalMana { + + public ArtifactAbilityConditionalMana(Mana mana) { + super(mana); + staticText = "Spend this mana only to activate abilities of artifacts"; + addCondition(new ArtifactAbilityManaCondition()); + } +} + +class ArtifactAbilityManaCondition extends ManaCondition implements Condition { + + @Override + public boolean apply(Game game, Ability source) { + if (source != null && source.getAbilityType().equals(AbilityType.ACTIVATED)) { + MageObject object = game.getObject(source.getSourceId()); + if (object != null && object.getCardType().contains(CardType.ARTIFACT)) { + return true; + } + } + return false; + } + + @Override + public boolean apply(Game game, Ability source, UUID originalId) { + return apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/SoulShred.java b/Mage.Sets/src/mage/sets/masterseditioniv/SoulShred.java new file mode 100644 index 00000000000..6f113481737 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/SoulShred.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class SoulShred extends CardImpl { + + public static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public SoulShred(UUID ownerId) { + super(ownerId, 98, "Soul Shred", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); + this.expansionSetCode = "ME4"; + + // Soul Shred deals 3 damage to target nonblack creature. You gain 3 life. + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new GainLifeEffect(3)); + } + + public SoulShred(final SoulShred card) { + super(card); + } + + @Override + public SoulShred copy() { + return new SoulShred(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/SymbolOfUnsummoning.java b/Mage.Sets/src/mage/sets/masterseditioniv/SymbolOfUnsummoning.java new file mode 100644 index 00000000000..8623042a52c --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/SymbolOfUnsummoning.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class SymbolOfUnsummoning extends mage.sets.portal.SymbolOfUnsummoning { + + public SymbolOfUnsummoning(UUID ownerId) { + super(ownerId); + this.cardNumber = 65; + this.expansionSetCode = "ME4"; + } + + public SymbolOfUnsummoning(final SymbolOfUnsummoning card) { + super(card); + } + + @Override + public SymbolOfUnsummoning copy() { + return new SymbolOfUnsummoning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/TawnossWeaponry.java b/Mage.Sets/src/mage/sets/masterseditioniv/TawnossWeaponry.java new file mode 100644 index 00000000000..5552c3316d4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/TawnossWeaponry.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class TawnossWeaponry extends mage.sets.fifthedition.TawnossWeaponry { + + public TawnossWeaponry(UUID ownerId) { + super(ownerId); + this.cardNumber = 232; + this.expansionSetCode = "ME4"; + } + + public TawnossWeaponry(final TawnossWeaponry card) { + super(card); + } + + @Override + public TawnossWeaponry copy() { + return new TawnossWeaponry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/ThingFromTheDeep.java b/Mage.Sets/src/mage/sets/masterseditioniv/ThingFromTheDeep.java new file mode 100644 index 00000000000..ccb0561ff81 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/ThingFromTheDeep.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author fireshoes + */ +public class ThingFromTheDeep extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("an Island"); + + static{ + filter.add(new SubtypePredicate("Island")); + } + + public ThingFromTheDeep(UUID ownerId) { + super(ownerId, 68, "Thing from the Deep", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}{U}{U}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Leviathan"); + this.power = new MageInt(9); + this.toughness = new MageInt(9); + + // Whenever Thing from the Deep attacks, sacrifice it unless you sacrifice an Island. + Effect effect = new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + effect.setText("sacrifice it unless you sacrifice an Island"); + this.addAbility(new AttacksTriggeredAbility(effect, false)); + } + + public ThingFromTheDeep(final ThingFromTheDeep card) { + super(card); + } + + @Override + public ThingFromTheDeep copy() { + return new ThingFromTheDeep(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/TriassicEgg.java b/Mage.Sets/src/mage/sets/masterseditioniv/TriassicEgg.java new file mode 100644 index 00000000000..ff16671e170 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/TriassicEgg.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TriassicEgg extends mage.sets.legends.TriassicEgg { + + public TriassicEgg(UUID ownerId) { + super(ownerId); + this.cardNumber = 235; + this.expansionSetCode = "ME4"; + } + + public TriassicEgg(final TriassicEgg card) { + super(card); + } + + @Override + public TriassicEgg copy() { + return new TriassicEgg(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/TwoHeadedGiantOfForiys.java b/Mage.Sets/src/mage/sets/masterseditioniv/TwoHeadedGiantOfForiys.java new file mode 100644 index 00000000000..2ae39054866 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/TwoHeadedGiantOfForiys.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class TwoHeadedGiantOfForiys extends CardImpl { + + public TwoHeadedGiantOfForiys(UUID ownerId) { + super(ownerId, 139, "Two-Headed Giant of Foriys", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Giant"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Two-Headed Giant of Foriys can block an additional creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAdditionalCreatureEffect())); + } + + public TwoHeadedGiantOfForiys(final TwoHeadedGiantOfForiys card) { + super(card); + } + + @Override + public TwoHeadedGiantOfForiys copy() { + return new TwoHeadedGiantOfForiys(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/WarpArtifact.java b/Mage.Sets/src/mage/sets/masterseditioniv/WarpArtifact.java new file mode 100644 index 00000000000..d9dfb231282 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/WarpArtifact.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 100; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/WickedPact.java b/Mage.Sets/src/mage/sets/masterseditioniv/WickedPact.java new file mode 100644 index 00000000000..50d791d1f02 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/WickedPact.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class WickedPact extends mage.sets.portal.WickedPact { + + public WickedPact(UUID ownerId) { + super(ownerId); + this.cardNumber = 102; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.UNCOMMON; + } + + public WickedPact(final WickedPact card) { + super(card); + } + + @Override + public WickedPact copy() { + return new WickedPact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/WildAesthir.java b/Mage.Sets/src/mage/sets/masterseditioniv/WildAesthir.java new file mode 100644 index 00000000000..fd99068c415 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/WildAesthir.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniv; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author nigelzor + */ +public class WildAesthir extends CardImpl { + + public WildAesthir(UUID ownerId) { + super(ownerId, 34, "Wild Aesthir", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Bird"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // {W}{W}: Wild Aesthir gets +2/+0 until end of turn. Activate this ability only once each turn. + this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, + new BoostSourceEffect(2, 0, Duration.EndOfTurn), new ManaCostsImpl("{W}{W}"))); + } + + public WildAesthir(final WildAesthir card) { + super(card); + } + + @Override + public WildAesthir copy() { + return new WildAesthir(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/AeronautTinkerer.java b/Mage.Sets/src/mage/sets/mediainserts/AeronautTinkerer.java new file mode 100644 index 00000000000..872d6eacf3c --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/AeronautTinkerer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AeronautTinkerer extends mage.sets.magic2015.AeronautTinkerer { + + public AeronautTinkerer(UUID ownerId) { + super(ownerId); + this.cardNumber = 118; + this.expansionSetCode = "MBP"; + } + + public AeronautTinkerer(final AeronautTinkerer card) { + super(card); + } + + @Override + public AeronautTinkerer copy() { + return new AeronautTinkerer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/ArashinSovereign.java b/Mage.Sets/src/mage/sets/mediainserts/ArashinSovereign.java new file mode 100644 index 00000000000..58fb78efed5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/ArashinSovereign.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ArashinSovereign extends mage.sets.dragonsoftarkir.ArashinSovereign { + + public ArashinSovereign(UUID ownerId) { + super(ownerId); + this.cardNumber = 112; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public ArashinSovereign(final ArashinSovereign card) { + super(card); + } + + @Override + public ArashinSovereign copy() { + return new ArashinSovereign(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/ArchfiendOfDepravity.java b/Mage.Sets/src/mage/sets/mediainserts/ArchfiendOfDepravity.java new file mode 100644 index 00000000000..0df29acf88d --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/ArchfiendOfDepravity.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ArchfiendOfDepravity extends mage.sets.fatereforged.ArchfiendOfDepravity { + + public ArchfiendOfDepravity(UUID ownerId) { + super(ownerId); + this.cardNumber = 109; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public ArchfiendOfDepravity(final ArchfiendOfDepravity card) { + super(card); + } + + @Override + public ArchfiendOfDepravity copy() { + return new ArchfiendOfDepravity(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/BoltwingMarauder.java b/Mage.Sets/src/mage/sets/mediainserts/BoltwingMarauder.java new file mode 100644 index 00000000000..575017da956 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/BoltwingMarauder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class BoltwingMarauder extends mage.sets.dragonsoftarkir.BoltwingMarauder { + + public BoltwingMarauder(UUID ownerId) { + super(ownerId); + this.cardNumber = 115; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public BoltwingMarauder(final BoltwingMarauder card) { + super(card); + } + + @Override + public BoltwingMarauder copy() { + return new BoltwingMarauder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/ChandraFireOfKaladesh.java b/Mage.Sets/src/mage/sets/mediainserts/ChandraFireOfKaladesh.java new file mode 100644 index 00000000000..ccb17f9bdc8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/ChandraFireOfKaladesh.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ChandraFireOfKaladesh extends mage.sets.magicorigins.ChandraFireOfKaladesh { + + public ChandraFireOfKaladesh(UUID ownerId) { + super(ownerId); + this.cardNumber = 127; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public ChandraFireOfKaladesh(final ChandraFireOfKaladesh card) { + super(card); + } + + @Override + public ChandraFireOfKaladesh copy() { + return new ChandraFireOfKaladesh(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/ChandraRoaringFlame.java b/Mage.Sets/src/mage/sets/mediainserts/ChandraRoaringFlame.java new file mode 100644 index 00000000000..6dd12eff6b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/ChandraRoaringFlame.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ChandraRoaringFlame extends mage.sets.magicorigins.ChandraRoaringFlame { + + public ChandraRoaringFlame(UUID ownerId) { + super(ownerId); + this.cardNumber = 127; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public ChandraRoaringFlame(final ChandraRoaringFlame card) { + super(card); + } + + @Override + public ChandraRoaringFlame copy() { + return new ChandraRoaringFlame(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/DragonFodder.java b/Mage.Sets/src/mage/sets/mediainserts/DragonFodder.java new file mode 100644 index 00000000000..c7dd1bcc48c --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/DragonFodder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DragonFodder extends mage.sets.shardsofalara.DragonFodder { + + public DragonFodder(UUID ownerId) { + super(ownerId); + this.cardNumber = 119; + this.expansionSetCode = "MBP"; + } + + public DragonFodder(final DragonFodder card) { + super(card); + } + + @Override + public DragonFodder copy() { + return new DragonFodder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/DragonlordsServant.java b/Mage.Sets/src/mage/sets/mediainserts/DragonlordsServant.java new file mode 100644 index 00000000000..2e017e7ab44 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/DragonlordsServant.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class DragonlordsServant extends mage.sets.dragonsoftarkir.DragonlordsServant { + + public DragonlordsServant(UUID ownerId) { + super(ownerId); + this.cardNumber = 120; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public DragonlordsServant(final DragonlordsServant card) { + super(card); + } + + @Override + public DragonlordsServant copy() { + return new DragonlordsServant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/DragonscaleGeneral.java b/Mage.Sets/src/mage/sets/mediainserts/DragonscaleGeneral.java new file mode 100644 index 00000000000..fcdf0a9354e --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/DragonscaleGeneral.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class DragonscaleGeneral extends mage.sets.fatereforged.DragonscaleGeneral { + + public DragonscaleGeneral(UUID ownerId) { + super(ownerId); + this.cardNumber = 107; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public DragonscaleGeneral(final DragonscaleGeneral card) { + super(card); + } + + @Override + public DragonscaleGeneral copy() { + return new DragonscaleGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/EvolvingWilds.java b/Mage.Sets/src/mage/sets/mediainserts/EvolvingWilds.java new file mode 100644 index 00000000000..d921ecdf4dc --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/EvolvingWilds.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EvolvingWilds extends mage.sets.riseoftheeldrazi.EvolvingWilds { + + public EvolvingWilds(UUID ownerId) { + super(ownerId); + this.cardNumber = 121; + this.expansionSetCode = "MBP"; + } + + public EvolvingWilds(final EvolvingWilds card) { + super(card); + } + + @Override + public EvolvingWilds copy() { + return new EvolvingWilds(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/FlamerushRider.java b/Mage.Sets/src/mage/sets/mediainserts/FlamerushRider.java new file mode 100644 index 00000000000..e005213db30 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/FlamerushRider.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class FlamerushRider extends mage.sets.fatereforged.FlamerushRider { + + public FlamerushRider(UUID ownerId) { + super(ownerId); + this.cardNumber = 110; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public FlamerushRider(final FlamerushRider card) { + super(card); + } + + @Override + public FlamerushRider copy() { + return new FlamerushRider(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/FoeRazerRegent.java b/Mage.Sets/src/mage/sets/mediainserts/FoeRazerRegent.java new file mode 100644 index 00000000000..bde27d9ff55 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/FoeRazerRegent.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class FoeRazerRegent extends mage.sets.dragonsoftarkir.FoeRazerRegent { + + public FoeRazerRegent(UUID ownerId) { + super(ownerId); + this.cardNumber = 122; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public FoeRazerRegent(final FoeRazerRegent card) { + super(card); + } + + @Override + public FoeRazerRegent copy() { + return new FoeRazerRegent(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/GideonBattleForged.java b/Mage.Sets/src/mage/sets/mediainserts/GideonBattleForged.java new file mode 100644 index 00000000000..785e67304d1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/GideonBattleForged.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class GideonBattleForged extends mage.sets.magicorigins.GideonBattleForged { + + public GideonBattleForged(UUID ownerId) { + super(ownerId); + this.cardNumber = 124; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public GideonBattleForged(final GideonBattleForged card) { + super(card); + } + + @Override + public GideonBattleForged copy() { + return new GideonBattleForged(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/HarbingerOfTheHunt.java b/Mage.Sets/src/mage/sets/mediainserts/HarbingerOfTheHunt.java new file mode 100644 index 00000000000..d084f6b9cca --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/HarbingerOfTheHunt.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class HarbingerOfTheHunt extends mage.sets.dragonsoftarkir.HarbingerOfTheHunt { + + public HarbingerOfTheHunt(UUID ownerId) { + super(ownerId); + this.cardNumber = 116; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public HarbingerOfTheHunt(final HarbingerOfTheHunt card) { + super(card); + } + + @Override + public HarbingerOfTheHunt copy() { + return new HarbingerOfTheHunt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/JaceTelepathUnbound.java b/Mage.Sets/src/mage/sets/mediainserts/JaceTelepathUnbound.java new file mode 100644 index 00000000000..7e1084a51f7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/JaceTelepathUnbound.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class JaceTelepathUnbound extends mage.sets.magicorigins.JaceTelepathUnbound { + + public JaceTelepathUnbound(UUID ownerId) { + super(ownerId); + this.cardNumber = 125; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public JaceTelepathUnbound(final JaceTelepathUnbound card) { + super(card); + } + + @Override + public JaceTelepathUnbound copy() { + return new JaceTelepathUnbound(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/JaceVrynsProdigy.java b/Mage.Sets/src/mage/sets/mediainserts/JaceVrynsProdigy.java new file mode 100644 index 00000000000..dae017224c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/JaceVrynsProdigy.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class JaceVrynsProdigy extends mage.sets.magicorigins.JaceVrynsProdigy { + + public JaceVrynsProdigy(UUID ownerId) { + super(ownerId); + this.cardNumber = 125; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public JaceVrynsProdigy(final JaceVrynsProdigy card) { + super(card); + } + + @Override + public JaceVrynsProdigy copy() { + return new JaceVrynsProdigy(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/KytheonHeroOfAkros.java b/Mage.Sets/src/mage/sets/mediainserts/KytheonHeroOfAkros.java new file mode 100644 index 00000000000..49f8b6f13e3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/KytheonHeroOfAkros.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class KytheonHeroOfAkros extends mage.sets.magicorigins.KytheonHeroOfAkros { + + public KytheonHeroOfAkros(UUID ownerId) { + super(ownerId); + this.cardNumber = 124; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public KytheonHeroOfAkros(final KytheonHeroOfAkros card) { + super(card); + } + + @Override + public KytheonHeroOfAkros copy() { + return new KytheonHeroOfAkros(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/LilianaDefiantNecromancer.java b/Mage.Sets/src/mage/sets/mediainserts/LilianaDefiantNecromancer.java new file mode 100644 index 00000000000..455dae6edc6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/LilianaDefiantNecromancer.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class LilianaDefiantNecromancer extends mage.sets.magicorigins.LilianaDefiantNecromancer { + + public LilianaDefiantNecromancer(UUID ownerId) { + super(ownerId); + this.cardNumber = 126; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public LilianaDefiantNecromancer(final LilianaDefiantNecromancer card) { + super(card); + } + + @Override + public LilianaDefiantNecromancer copy() { + return new LilianaDefiantNecromancer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/LilianaHereticalHealer.java b/Mage.Sets/src/mage/sets/mediainserts/LilianaHereticalHealer.java new file mode 100644 index 00000000000..c9c611d459e --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/LilianaHereticalHealer.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class LilianaHereticalHealer extends mage.sets.magicorigins.LilianaHereticalHealer { + + public LilianaHereticalHealer(UUID ownerId) { + super(ownerId); + this.cardNumber = 126; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public LilianaHereticalHealer(final LilianaHereticalHealer card) { + super(card); + } + + @Override + public LilianaHereticalHealer copy() { + return new LilianaHereticalHealer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/MagisterOfWorth.java b/Mage.Sets/src/mage/sets/mediainserts/MagisterOfWorth.java new file mode 100644 index 00000000000..0c293502e33 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/MagisterOfWorth.java @@ -0,0 +1,192 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class MagisterOfWorth extends CardImpl { + + public MagisterOfWorth(UUID ownerId) { + super(ownerId, 86, "Magister of Worth", Rarity.SPECIAL, new CardType[]{CardType.CREATURE}, "{4}{W}{B}"); + this.expansionSetCode = "MBP"; + this.subtype.add("Angel"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Will of the council - When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth. + Effect effect = new MagisterOfWorthVoteEffect(); + effect.setText("Will of the council - When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth"); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false, true)); + } + + public MagisterOfWorth(final MagisterOfWorth card) { + super(card); + } + + @Override + public MagisterOfWorth copy() { + return new MagisterOfWorth(this); + } +} + +class MagisterOfWorthVoteEffect extends OneShotEffect { + + MagisterOfWorthVoteEffect() { + super(Outcome.Benefit); + this.staticText = "Will of the council - When {this} enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than {this}."; + } + + MagisterOfWorthVoteEffect(final MagisterOfWorthVoteEffect effect) { + super(effect); + } + + @Override + public MagisterOfWorthVoteEffect copy() { + return new MagisterOfWorthVoteEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int graceCount = 0; + int condemnationCount = 0; + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + if (player.chooseUse(Outcome.DestroyPermanent, "Choose grace?", source, game)) { + graceCount++; + game.informPlayers(player.getLogName() + " has chosen: grace"); + } else { + condemnationCount++; + game.informPlayers(player.getLogName() + " has chosen: condemnation"); + } + } + } + if (graceCount > condemnationCount) { + new MagisterOfWorthReturnFromGraveyardEffect().apply(game, source); + } else { + new MagisterOfWorthDestroyEffect().apply(game, source); + } + return true; + } + return false; + } +} + +class MagisterOfWorthDestroyEffect extends OneShotEffect { + + private static final FilterPermanent filter = new FilterCreaturePermanent("creatures other than {this}"); + + static { + filter.add(new AnotherPredicate()); + } + + public MagisterOfWorthDestroyEffect() { + super(Outcome.DestroyPermanent); + staticText = "destroy all creatures other than {this}"; + } + + public MagisterOfWorthDestroyEffect(final MagisterOfWorthDestroyEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + permanent.destroy(source.getSourceId(), game, false); + } + return true; + } + + @Override + public MagisterOfWorthDestroyEffect copy() { + return new MagisterOfWorthDestroyEffect(this); + } + +} + +class MagisterOfWorthReturnFromGraveyardEffect extends OneShotEffect { + + public MagisterOfWorthReturnFromGraveyardEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "each player returns each creature card from his or her graveyard to the battlefield"; + } + + public MagisterOfWorthReturnFromGraveyardEffect(final MagisterOfWorthReturnFromGraveyardEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + for (UUID playerId : controller.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.moveCards(player.getGraveyard().getCards(new FilterCreatureCard(), game), Zone.BATTLEFIELD, source, game); + } + } + return true; + } + return false; + } + + @Override + public MagisterOfWorthReturnFromGraveyardEffect copy() { + return new MagisterOfWorthReturnFromGraveyardEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/NecromasterDragon.java b/Mage.Sets/src/mage/sets/mediainserts/NecromasterDragon.java new file mode 100644 index 00000000000..919494239c3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/NecromasterDragon.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class NecromasterDragon extends mage.sets.dragonsoftarkir.NecromasterDragon { + + public NecromasterDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 114; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public NecromasterDragon(final NecromasterDragon card) { + super(card); + } + + @Override + public NecromasterDragon copy() { + return new NecromasterDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/NissaSageAnimist.java b/Mage.Sets/src/mage/sets/mediainserts/NissaSageAnimist.java new file mode 100644 index 00000000000..a002b3b2d74 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/NissaSageAnimist.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class NissaSageAnimist extends mage.sets.magicorigins.NissaSageAnimist { + + public NissaSageAnimist(UUID ownerId) { + super(ownerId); + this.cardNumber = 128; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public NissaSageAnimist(final NissaSageAnimist card) { + super(card); + } + + @Override + public NissaSageAnimist copy() { + return new NissaSageAnimist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/NissaVastwoodSeer.java b/Mage.Sets/src/mage/sets/mediainserts/NissaVastwoodSeer.java new file mode 100644 index 00000000000..90661eda135 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/NissaVastwoodSeer.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class NissaVastwoodSeer extends mage.sets.magicorigins.NissaVastwoodSeer { + + public NissaVastwoodSeer(UUID ownerId) { + super(ownerId); + this.cardNumber = 128; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public NissaVastwoodSeer(final NissaVastwoodSeer card) { + super(card); + } + + @Override + public NissaVastwoodSeer copy() { + return new NissaVastwoodSeer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/PristineSkywise.java b/Mage.Sets/src/mage/sets/mediainserts/PristineSkywise.java new file mode 100644 index 00000000000..bc1e7f07476 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/PristineSkywise.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class PristineSkywise extends mage.sets.dragonsoftarkir.PristineSkywise { + + public PristineSkywise(UUID ownerId) { + super(ownerId); + this.cardNumber = 113; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public PristineSkywise(final PristineSkywise card) { + super(card); + } + + @Override + public PristineSkywise copy() { + return new PristineSkywise(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/RelicSeeker.java b/Mage.Sets/src/mage/sets/mediainserts/RelicSeeker.java index bf67641740e..cd117abe57b 100644 --- a/Mage.Sets/src/mage/sets/mediainserts/RelicSeeker.java +++ b/Mage.Sets/src/mage/sets/mediainserts/RelicSeeker.java @@ -1,55 +1,55 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.mediainserts; - -import java.util.UUID; -import mage.constants.Rarity; - -/** - * - * @author LevelX2 - */ -public class RelicSeeker extends mage.sets.magicorigins.RelicSeeker { - - public RelicSeeker(UUID ownerId) { - super(ownerId); - this.cardNumber = 107; - this.expansionSetCode = "MBP"; - this.rarity = Rarity.RARE; - - } - - public RelicSeeker(final RelicSeeker card) { - super(card); - } - - @Override - public RelicSeeker copy() { - return new RelicSeeker(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class RelicSeeker extends mage.sets.magicorigins.RelicSeeker { + + public RelicSeeker(UUID ownerId) { + super(ownerId); + this.cardNumber = 123; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.RARE; + + } + + public RelicSeeker(final RelicSeeker card) { + super(card); + } + + @Override + public RelicSeeker copy() { + return new RelicSeeker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/RuinousPath.java b/Mage.Sets/src/mage/sets/mediainserts/RuinousPath.java new file mode 100644 index 00000000000..317fed6ec02 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/RuinousPath.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class RuinousPath extends mage.sets.battleforzendikar.RuinousPath { + + public RuinousPath(UUID ownerId) { + super(ownerId); + this.cardNumber = 129; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public RuinousPath(final RuinousPath card) { + super(card); + } + + @Override + public RuinousPath copy() { + return new RuinousPath(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/SageEyeAvengers.java b/Mage.Sets/src/mage/sets/mediainserts/SageEyeAvengers.java new file mode 100644 index 00000000000..004ee5eec53 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/SageEyeAvengers.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class SageEyeAvengers extends mage.sets.fatereforged.SageEyeAvengers { + + public SageEyeAvengers(UUID ownerId) { + super(ownerId); + this.cardNumber = 108; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public SageEyeAvengers(final SageEyeAvengers card) { + super(card); + } + + @Override + public SageEyeAvengers copy() { + return new SageEyeAvengers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/ScytheLeopard.java b/Mage.Sets/src/mage/sets/mediainserts/ScytheLeopard.java new file mode 100644 index 00000000000..ebc04fcffca --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/ScytheLeopard.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ScytheLeopard extends mage.sets.battleforzendikar.ScytheLeopard { + + public ScytheLeopard(UUID ownerId) { + super(ownerId); + this.cardNumber = 130; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public ScytheLeopard(final ScytheLeopard card) { + super(card); + } + + @Override + public ScytheLeopard copy() { + return new ScytheLeopard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/SultaiCharm.java b/Mage.Sets/src/mage/sets/mediainserts/SultaiCharm.java new file mode 100644 index 00000000000..31421bc84ea --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/SultaiCharm.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class SultaiCharm extends mage.sets.khansoftarkir.SultaiCharm { + + public SultaiCharm(UUID ownerId) { + super(ownerId); + this.cardNumber = 117; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public SultaiCharm(final SultaiCharm card) { + super(card); + } + + @Override + public SultaiCharm copy() { + return new SultaiCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/TemurWarShaman.java b/Mage.Sets/src/mage/sets/mediainserts/TemurWarShaman.java new file mode 100644 index 00000000000..f7a8e287ae1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/TemurWarShaman.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class TemurWarShaman extends mage.sets.fatereforged.TemurWarShaman { + + public TemurWarShaman(UUID ownerId) { + super(ownerId); + this.cardNumber = 111; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public TemurWarShaman(final TemurWarShaman card) { + super(card); + } + + @Override + public TemurWarShaman copy() { + return new TemurWarShaman(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/VoidmageHusher.java b/Mage.Sets/src/mage/sets/mediainserts/VoidmageHusher.java new file mode 100644 index 00000000000..869e1f69887 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/VoidmageHusher.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mediainserts; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetActivatedAbility; + +/** + * + * @author andyfries + */ +public class VoidmageHusher extends CardImpl { + + public VoidmageHusher(UUID ownerId) { + super(ownerId, 62, "Voidmage Husher", Rarity.SPECIAL, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "MBP"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // When Voidmage Husher enters the battlefield, counter target activated ability. + Ability ability = new EntersBattlefieldTriggeredAbility(new CounterTargetEffect()); + ability.addTarget(new TargetActivatedAbility()); + this.addAbility(ability); + + // Whenever you cast a spell, you may return Voidmage Husher to its owner's hand. + this.addAbility(new SpellCastControllerTriggeredAbility(new ReturnToHandSourceEffect(true), true)); + } + + public VoidmageHusher(final VoidmageHusher card) { + super(card); + } + + @Override + public VoidmageHusher copy() { + return new VoidmageHusher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/AlabasterWall.java b/Mage.Sets/src/mage/sets/mercadianmasques/AlabasterWall.java new file mode 100644 index 00000000000..02b27f964fe --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/AlabasterWall.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class AlabasterWall extends CardImpl { + + public AlabasterWall(UUID ownerId) { + super(ownerId, 2, "Alabaster Wall", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Wall"); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // {tap}: Prevent the next 1 damage that would be dealt to target creature or player this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public AlabasterWall(final AlabasterWall card) { + super(card); + } + + @Override + public AlabasterWall copy() { + return new AlabasterWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/BalloonPeddler.java b/Mage.Sets/src/mage/sets/mercadianmasques/BalloonPeddler.java new file mode 100644 index 00000000000..1c99cbcea6f --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/BalloonPeddler.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class BalloonPeddler extends CardImpl { + + public BalloonPeddler(UUID ownerId) { + super(ownerId, 59, "Balloon Peddler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {U}, {tap}, Discard a card: Target creature gains flying until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect( + FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{U}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public BalloonPeddler(final BalloonPeddler card) { + super(card); + } + + @Override + public BalloonPeddler copy() { + return new BalloonPeddler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/BattleSquadron.java b/Mage.Sets/src/mage/sets/mercadianmasques/BattleSquadron.java new file mode 100644 index 00000000000..88565f75e1e --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/BattleSquadron.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class BattleSquadron extends CardImpl { + + public BattleSquadron(UUID ownerId) { + super(ownerId, 174, "Battle Squadron", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Goblin"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Battle Squadron's power and toughness are each equal to the number of creatures you control. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( + new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), Duration.EndOfGame))); + } + + public BattleSquadron(final BattleSquadron card) { + super(card); + } + + @Override + public BattleSquadron copy() { + return new BattleSquadron(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/BlasterMage.java b/Mage.Sets/src/mage/sets/mercadianmasques/BlasterMage.java new file mode 100644 index 00000000000..6d00565bf35 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/BlasterMage.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class BlasterMage extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Wall"); + + static { + filter.add(new SubtypePredicate("Wall")); + } + + public BlasterMage(UUID ownerId) { + super(ownerId, 175, "Blaster Mage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {R}, {tap}, Discard a card: Destroy target Wall. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{R}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public BlasterMage(final BlasterMage card) { + super(card); + } + + @Override + public BlasterMage copy() { + return new BlasterMage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/BogWitch.java b/Mage.Sets/src/mage/sets/mercadianmasques/BogWitch.java new file mode 100644 index 00000000000..82c83f63f0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/BogWitch.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class BogWitch extends CardImpl { + + public BogWitch(UUID ownerId) { + super(ownerId, 118, "Bog Witch", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {B}, {tap}, Discard a card: Add {B}{B}{B} to your mana pool. + Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 0, 0, 0, 3, 0, 0)), new ManaCostsImpl("{B}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public BogWitch(final BogWitch card) { + super(card); + } + + @Override + public BogWitch copy() { + return new BogWitch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/Bribery.java b/Mage.Sets/src/mage/sets/mercadianmasques/Bribery.java index 199c4f5e1bc..c7aec373447 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/Bribery.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/Bribery.java @@ -27,7 +27,6 @@ */ package mage.sets.mercadianmasques; -import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; @@ -91,13 +90,8 @@ class BriberyEffect extends OneShotEffect { if (controller != null && opponent != null) { TargetCardInLibrary target = new TargetCardInLibrary(0, 1, new FilterCreatureCard("creature card")); if (controller.searchLibrary(target, game, opponent.getId())) { - List targets = target.getTargets(); - for (UUID targetId : targets) { - Card card = opponent.getLibrary().getCard(targetId, game); - if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); - } - } + Card card = opponent.getLibrary().getCard(target.getFirstTarget(), game); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } opponent.shuffleLibrary(game); return true; diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/CacklingWitch.java b/Mage.Sets/src/mage/sets/mercadianmasques/CacklingWitch.java new file mode 100644 index 00000000000..93bc1c8ca47 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/CacklingWitch.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class CacklingWitch extends CardImpl { + + public CacklingWitch(UUID ownerId) { + super(ownerId, 119, "Cackling Witch", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {X}{B}, {tap}, Discard a card: Target creature gets +X/+0 until end of turn. + ManacostVariableValue manaX = new ManacostVariableValue(); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BoostTargetEffect(manaX, new StaticValue(0), Duration.EndOfTurn), + new ManaCostsImpl("{X}{B}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public CacklingWitch(final CacklingWitch card) { + super(card); + } + + @Override + public CacklingWitch copy() { + return new CacklingWitch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java b/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java new file mode 100644 index 00000000000..91bddccba45 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/CaveSense.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class CaveSense extends CardImpl { + + public CaveSense(UUID ownerId) { + super(ownerId, 179, "Cave Sense", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets +1/+1 and has mountainwalk. + Effect effect = new GainAbilityAttachedEffect(new MountainwalkAbility(), AttachmentType.AURA); + effect.setText("and has mountainwalk"); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1)); + ability.addEffect(effect); + this.addAbility(ability); + } + + public CaveSense(final CaveSense card) { + super(card); + } + + @Override + public CaveSense copy() { + return new CaveSense(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/CavernCrawler.java b/Mage.Sets/src/mage/sets/mercadianmasques/CavernCrawler.java new file mode 100644 index 00000000000..f800a3e61cb --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/CavernCrawler.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class CavernCrawler extends CardImpl { + + public CavernCrawler(UUID ownerId) { + super(ownerId, 181, "Cavern Crawler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Insect"); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Mountainwalk + this.addAbility(new MountainwalkAbility()); + + // {R}: Cavern Crawler gets +1/-1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public CavernCrawler(final CavernCrawler card) { + super(card); + } + + @Override + public CavernCrawler copy() { + return new CavernCrawler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/CrenellatedWall.java b/Mage.Sets/src/mage/sets/mercadianmasques/CrenellatedWall.java new file mode 100644 index 00000000000..4ccdbb4b311 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/CrenellatedWall.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class CrenellatedWall extends CardImpl { + + public CrenellatedWall(UUID ownerId) { + super(ownerId, 290, "Crenellated Wall", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Wall"); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // {tap}: Target creature gets +0/+4 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(0, 4, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public CrenellatedWall(final CrenellatedWall card) { + super(card); + } + + @Override + public CrenellatedWall copy() { + return new CrenellatedWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/DeepwoodDrummer.java b/Mage.Sets/src/mage/sets/mercadianmasques/DeepwoodDrummer.java new file mode 100644 index 00000000000..916a3b3dd48 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/DeepwoodDrummer.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DeepwoodDrummer extends CardImpl { + + public DeepwoodDrummer(UUID ownerId) { + super(ownerId, 239, "Deepwood Drummer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {G}, {tap}, Discard a card: Target creature gets +2/+2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new ManaCostsImpl("{G}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public DeepwoodDrummer(final DeepwoodDrummer card) { + super(card); + } + + @Override + public DeepwoodDrummer copy() { + return new DeepwoodDrummer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/DiplomaticEscort.java b/Mage.Sets/src/mage/sets/mercadianmasques/DiplomaticEscort.java new file mode 100644 index 00000000000..0abf5537b9e --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/DiplomaticEscort.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterStackObject; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.other.TargetsPermanentPredicate; +import mage.target.TargetStackObject; + +/** + * + * @author LoneFox + */ +public class DiplomaticEscort extends CardImpl { + + private final static FilterStackObject filter = new FilterStackObject("spell or ability that targets a creature"); + + static { + filter.add(new TargetsPermanentPredicate(new FilterCreaturePermanent())); + } + + public DiplomaticEscort(UUID ownerId) { + super(ownerId, 74, "Diplomatic Escort", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {U}, {tap}, Discard a card: Counter target spell or ability that targets a creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{U}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetStackObject(filter)); + this.addAbility(ability); + } + + public DiplomaticEscort(final DiplomaticEscort card) { + super(card); + } + + @Override + public DiplomaticEscort copy() { + return new DiplomaticEscort(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/DrakeHatchling.java b/Mage.Sets/src/mage/sets/mercadianmasques/DrakeHatchling.java new file mode 100644 index 00000000000..66dc772a936 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/DrakeHatchling.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class DrakeHatchling extends CardImpl { + + public DrakeHatchling(UUID ownerId) { + super(ownerId, 76, "Drake Hatchling", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Drake"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {U}: Drake Hatchling gets +1/+0 until end of turn. Activate this ability only once each turn. + this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{U}"))); + } + + public DrakeHatchling(final DrakeHatchling card) { + super(card); + } + + @Override + public DrakeHatchling copy() { + return new DrakeHatchling(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/Embargo.java b/Mage.Sets/src/mage/sets/mercadianmasques/Embargo.java new file mode 100644 index 00000000000..b23284d6211 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/Embargo.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterNonlandPermanent; + +/** + * + * @author fireshoes + */ +public class Embargo extends CardImpl { + + private static final FilterPermanent filter = new FilterNonlandPermanent(); + + public Embargo(UUID ownerId) { + super(ownerId, 77, "Embargo", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}"); + this.expansionSetCode = "MMQ"; + + // Nonland permanents don't untap during their controllers' untap steps. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, filter))); + + // At the beginning of your upkeep, you lose 2 life. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(2), TargetController.YOU, false)); + } + + public Embargo(final Embargo card) { + super(card); + } + + @Override + public Embargo copy() { + return new Embargo(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/FlailingManticore.java b/Mage.Sets/src/mage/sets/mercadianmasques/FlailingManticore.java new file mode 100644 index 00000000000..b9ff2f968f0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/FlailingManticore.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FlailingManticore extends CardImpl { + + public FlailingManticore(UUID ownerId) { + super(ownerId, 187, "Flailing Manticore", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Manticore"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // {1}: Flailing Manticore gets +1/+1 until end of turn. Any player may activate this ability. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn) , new ManaCostsImpl("{1}")); + ability.setMayActivate(TargetController.ANY); + ability.addEffect(new InfoEffect("Any player may activate this ability")); + this.addAbility(ability); + // {1}: Flailing Manticore gets -1/-1 until end of turn. Any player may activate this ability. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-1, -1, Duration.EndOfTurn) , new ManaCostsImpl("{1}")); + ability.setMayActivate(TargetController.ANY); + ability.addEffect(new InfoEffect("Any player may activate this ability")); + this.addAbility(ability); + } + + public FlailingManticore(final FlailingManticore card) { + super(card); + } + + @Override + public FlailingManticore copy() { + return new FlailingManticore(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/FlailingOgre.java b/Mage.Sets/src/mage/sets/mercadianmasques/FlailingOgre.java new file mode 100644 index 00000000000..a197c8cd082 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/FlailingOgre.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FlailingOgre extends CardImpl { + + public FlailingOgre(UUID ownerId) { + super(ownerId, 188, "Flailing Ogre", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Ogre"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {1}: Flailing Ogre gets +1/+1 until end of turn. Any player may activate this ability. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn) , new ManaCostsImpl("{1}")); + ability.setMayActivate(TargetController.ANY); + ability.addEffect(new InfoEffect("Any player may activate this ability")); + this.addAbility(ability); + // {1}: Flailing Ogre gets -1/-1 until end of turn. Any player may activate this ability. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-1, -1, Duration.EndOfTurn) , new ManaCostsImpl("{1}")); + ability.setMayActivate(TargetController.ANY); + ability.addEffect(new InfoEffect("Any player may activate this ability")); + this.addAbility(ability); + } + + public FlailingOgre(final FlailingOgre card) { + super(card); + } + + @Override + public FlailingOgre copy() { + return new FlailingOgre(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/FlailingSoldier.java b/Mage.Sets/src/mage/sets/mercadianmasques/FlailingSoldier.java new file mode 100644 index 00000000000..d6af4a77d6e --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/FlailingSoldier.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FlailingSoldier extends CardImpl { + + public FlailingSoldier(UUID ownerId) { + super(ownerId, 189, "Flailing Soldier", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {1}: Flailing Soldier gets +1/+1 until end of turn. Any player may activate this ability. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn) , new ManaCostsImpl("{1}")); + ability.setMayActivate(TargetController.ANY); + ability.addEffect(new InfoEffect("Any player may activate this ability")); + this.addAbility(ability); + // {1}: Flailing Soldier gets -1/-1 until end of turn. Any player may activate this ability. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-1, -1, Duration.EndOfTurn) , new ManaCostsImpl("{1}")); + ability.setMayActivate(TargetController.ANY); + ability.addEffect(new InfoEffect("Any player may activate this ability")); + this.addAbility(ability); + } + + public FlailingSoldier(final FlailingSoldier card) { + super(card); + } + + @Override + public FlailingSoldier copy() { + return new FlailingSoldier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/GiantCaterpillar.java b/Mage.Sets/src/mage/sets/mercadianmasques/GiantCaterpillar.java new file mode 100644 index 00000000000..2c6b07c61ed --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/GiantCaterpillar.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + */ +public class GiantCaterpillar extends CardImpl { + + public GiantCaterpillar(UUID ownerId) { + super(ownerId, 249, "Giant Caterpillar", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Insect"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {G}, Sacrifice Giant Caterpillar: Put a 1/1 green Insect creature token with flying named Butterfly onto the battlefield at the beginning of the next end step. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new CreateTokenEffect(new ButterflyToken()))), + new ManaCostsImpl("{G}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public GiantCaterpillar(final GiantCaterpillar card) { + super(card); + } + + @Override + public GiantCaterpillar copy() { + return new GiantCaterpillar(this); + } +} + +class ButterflyToken extends Token { + + public ButterflyToken() { + super("Butterfly", "1/1 green Insect creature token with flying named Butterfly"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Insect"); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(FlyingAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/HammerMage.java b/Mage.Sets/src/mage/sets/mercadianmasques/HammerMage.java new file mode 100644 index 00000000000..3ca66c69f0a --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/HammerMage.java @@ -0,0 +1,105 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LoneFox + */ +public class HammerMage extends CardImpl { + + public HammerMage(UUID ownerId) { + super(ownerId, 193, "Hammer Mage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {X}{R}, {tap}, Discard a card: Destroy all artifacts with converted mana cost X or less. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new HammerMageEffect(), new ManaCostsImpl("{X}{R}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public HammerMage(final HammerMage card) { + super(card); + } + + @Override + public HammerMage copy() { + return new HammerMage(this); + } +} + +class HammerMageEffect extends OneShotEffect { + + public HammerMageEffect() { + super(Outcome.DestroyPermanent); + staticText = "Destroy all artifacts with converted mana cost X or less"; + } + + public HammerMageEffect(final HammerMageEffect effect) { + super(effect); + } + + @Override + public HammerMageEffect copy() { + return new HammerMageEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + FilterArtifactPermanent filter = new FilterArtifactPermanent(); + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, source.getManaCostsToPay().getX() + 1)); + for(Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + permanent.destroy(source.getSourceId(), game, false); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java b/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java new file mode 100644 index 00000000000..dbeedd47928 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/HauntedCrossroads.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author fireshoes + */ +public class HauntedCrossroads extends CardImpl { + + public HauntedCrossroads(UUID ownerId) { + super(ownerId, 138, "Haunted Crossroads", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "MMQ"; + + // {B}: Put target creature card from your graveyard on top of your library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(true), new ManaCostsImpl("{B}")); + ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + this.addAbility(ability); + } + + public HauntedCrossroads(final HauntedCrossroads card) { + super(card); + } + + @Override + public HauntedCrossroads copy() { + return new HauntedCrossroads(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/KrisMage.java b/Mage.Sets/src/mage/sets/mercadianmasques/KrisMage.java new file mode 100644 index 00000000000..04571e2b2fa --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/KrisMage.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class KrisMage extends CardImpl { + + public KrisMage(UUID ownerId) { + super(ownerId, 195, "Kris Mage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {R}, {tap}, Discard a card: Kris Mage deals 1 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public KrisMage(final KrisMage card) { + super(card); + } + + @Override + public KrisMage copy() { + return new KrisMage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/KyrenGlider.java b/Mage.Sets/src/mage/sets/mercadianmasques/KyrenGlider.java new file mode 100644 index 00000000000..65419676bc2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/KyrenGlider.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.CantBlockAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * @author BursegSardaukar + */ +public class KyrenGlider extends CardImpl { + + public KyrenGlider(UUID ownerId) { + super(ownerId, 196, "Kyren Glider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Goblin"); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Kyren Glider can't block. + Ability ability = new CantBlockAbility(); + this.addAbility(ability); + } + + public KyrenGlider(final KyrenGlider card) { + super(card); + } + + @Override + public KyrenGlider copy() { + return new KyrenGlider(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/KyrenSniper.java b/Mage.Sets/src/mage/sets/mercadianmasques/KyrenSniper.java new file mode 100644 index 00000000000..9e8d012d7a3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/KyrenSniper.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.target.TargetPlayer; + +/** + * @author BursegSardaukar + */ +public class KyrenSniper extends CardImpl { + + public KyrenSniper(UUID ownerId) { + super(ownerId, 199, "Kyren Sniper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Goblin"); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // At the beginning of your upkeep, you may have Kyren Sniper deal 1 damage to target player. + Ability ability = new BeginningOfUpkeepTriggeredAbility(new DamageTargetEffect(1), TargetController.YOU, true); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public KyrenSniper(final KyrenSniper card) { + super(card); + } + + @Override + public KyrenSniper copy() { + return new KyrenSniper(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/Lithophage.java b/Mage.Sets/src/mage/sets/mercadianmasques/Lithophage.java new file mode 100644 index 00000000000..6c08c9990fc --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/Lithophage.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author fireshoes + */ +public class Lithophage extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("a Mountain"); + + static { + filter.add(new SubtypePredicate("Mountain")); + } + + public Lithophage(UUID ownerId) { + super(ownerId, 202, "Lithophage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Insect"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // At the beginning of your upkeep, sacrifice Lithophage unless you sacrifice a Mountain. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, + new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(filter))), TargetController.YOU, false)); + } + + public Lithophage(final Lithophage card) { + super(card); + } + + @Override + public Lithophage copy() { + return new Lithophage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/LumberingSatyr.java b/Mage.Sets/src/mage/sets/mercadianmasques/LumberingSatyr.java new file mode 100644 index 00000000000..60bec905e18 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/LumberingSatyr.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class LumberingSatyr extends CardImpl { + + public LumberingSatyr(UUID ownerId) { + super(ownerId, 257, "Lumbering Satyr", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Satyr"); + this.subtype.add("Beast"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // All creatures have forestwalk. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new GainAbilityAllEffect(new ForestwalkAbility(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); + } + + public LumberingSatyr(final LumberingSatyr card) { + super(card); + } + + @Override + public LumberingSatyr copy() { + return new LumberingSatyr(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/MagistratesScepter.java b/Mage.Sets/src/mage/sets/mercadianmasques/MagistratesScepter.java new file mode 100644 index 00000000000..7188340f9ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/MagistratesScepter.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; + +/** + * + * @author fireshoes + */ +public class MagistratesScepter extends CardImpl { + + public MagistratesScepter(UUID ownerId) { + super(ownerId, 304, "Magistrate's Scepter", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "MMQ"; + + // {4}, {tap}: Put a charge counter on Magistrate's Scepter. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new GenericManaCost(4)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {tap}, Remove three charge counters from Magistrate's Scepter: Take an extra turn after this one. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddExtraTurnControllerEffect(), new TapSourceCost()); + ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(3))); + this.addAbility(ability); + } + + public MagistratesScepter(final MagistratesScepter card) { + super(card); + } + + @Override + public MagistratesScepter copy() { + return new MagistratesScepter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/MagistratesVeto.java b/Mage.Sets/src/mage/sets/mercadianmasques/MagistratesVeto.java new file mode 100644 index 00000000000..88a61653bb4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/MagistratesVeto.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CantBlockAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author fireshoes + */ +public class MagistratesVeto extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("white creatures and blue creatures"); + + static { + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.WHITE), + new ColorPredicate(ObjectColor.BLUE))); + } + + public MagistratesVeto(UUID ownerId) { + super(ownerId, 204, "Magistrate's Veto", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "MMQ"; + + // White creatures and blue creatures can't block. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBlockAllEffect(filter, Duration.WhileOnBattlefield))); + } + + public MagistratesVeto(final MagistratesVeto card) { + super(card); + } + + @Override + public MagistratesVeto copy() { + return new MagistratesVeto(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/MonkeyCage.java b/Mage.Sets/src/mage/sets/mercadianmasques/MonkeyCage.java new file mode 100644 index 00000000000..8af3e58fc38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/MonkeyCage.java @@ -0,0 +1,110 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + */ +public class MonkeyCage extends CardImpl { + + public MonkeyCage(UUID ownerId) { + super(ownerId, 307, "Monkey Cage", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "MMQ"; + + // When a creature enters the battlefield, sacrifice Monkey Cage and put X 2/2 green Ape creature tokens onto the battlefield, where X is that creature's converted mana cost. + Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), + new FilterCreaturePermanent("a creature"), false, SetTargetPointer.PERMANENT, ""); + ability.addEffect(new MonkeyCageEffect()); + this.addAbility(ability); + } + + public MonkeyCage(final MonkeyCage card) { + super(card); + } + + @Override + public MonkeyCage copy() { + return new MonkeyCage(this); + } +} + +class MonkeyCageEffect extends OneShotEffect { + + public MonkeyCageEffect() { + super(Outcome.Benefit); + staticText = "and put X 2/2 green Ape creature tokens onto the battlefield, where X is that creature's converted mana cost"; + } + + public MonkeyCageEffect(final MonkeyCageEffect effect) { + super(effect); + } + + @Override + public MonkeyCageEffect copy() { + return new MonkeyCageEffect(this); + } + + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + if(creature != null) { + int cmc = creature.getManaCost().convertedManaCost(); + return new CreateTokenEffect(new ApeToken(), cmc).apply(game, source); + } + return false; + } +} + +class ApeToken extends Token { + ApeToken() { + super("Ape", "2/2 green Ape creature token"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Ape"); + power = new MageInt(2); + toughness = new MageInt(2); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/NotoriousAssassin.java b/Mage.Sets/src/mage/sets/mercadianmasques/NotoriousAssassin.java new file mode 100644 index 00000000000..94f01ebd6bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/NotoriousAssassin.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class NotoriousAssassin extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public NotoriousAssassin(UUID ownerId) { + super(ownerId, 150, "Notorious Assassin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.subtype.add("Assassin"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {2}{B}, {tap}, Discard a card: Destroy target nonblack creature. It can't be regenerated. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(true), new ManaCostsImpl("{2}{B}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public NotoriousAssassin(final NotoriousAssassin card) { + super(card); + } + + @Override + public NotoriousAssassin copy() { + return new NotoriousAssassin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/RappellingScouts.java b/Mage.Sets/src/mage/sets/mercadianmasques/RappellingScouts.java new file mode 100644 index 00000000000..233820aefca --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/RappellingScouts.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainProtectionFromColorSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class RappellingScouts extends CardImpl { + + public RappellingScouts(UUID ownerId) { + super(ownerId, 41, "Rappelling Scouts", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Rebel"); + this.subtype.add("Scout"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {2}{W}: Rappelling Scouts gains protection from the color of your choice until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainProtectionFromColorSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{2}{W}"))); + } + + public RappellingScouts(final RappellingScouts card) { + super(card); + } + + @Override + public RappellingScouts copy() { + return new RappellingScouts(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/RishadanAirship.java b/Mage.Sets/src/mage/sets/mercadianmasques/RishadanAirship.java new file mode 100644 index 00000000000..5ea871ef1e8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/RishadanAirship.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class RishadanAirship extends CardImpl { + + public RishadanAirship(UUID ownerId) { + super(ownerId, 91, "Rishadan Airship", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Pirate"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Rishadan Airship can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + } + + public RishadanAirship(final RishadanAirship card) { + super(card); + } + + @Override + public RishadanAirship copy() { + return new RishadanAirship(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/SandSquid.java b/Mage.Sets/src/mage/sets/mercadianmasques/SandSquid.java new file mode 100644 index 00000000000..dfe44fc04cb --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/SandSquid.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DontUntapAsLongAsSourceTappedEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.IslandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SandSquid extends CardImpl { + + public SandSquid(UUID ownerId) { + super(ownerId, 96, "Sand Squid", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Squid"); + this.subtype.add("Beast"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Islandwalk + this.addAbility(new IslandwalkAbility()); + // You may choose not to untap Sand Squid during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {tap}: Tap target creature. That creature doesn't untap during its controller's untap step for as long as Sand Squid remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + ability.addEffect(new DontUntapAsLongAsSourceTappedEffect()); + this.addAbility(ability); + } + + public SandSquid(final SandSquid card) { + super(card); + } + + @Override + public SandSquid copy() { + return new SandSquid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/SeismicMage.java b/Mage.Sets/src/mage/sets/mercadianmasques/SeismicMage.java new file mode 100644 index 00000000000..41aca51a7db --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/SeismicMage.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class SeismicMage extends CardImpl { + + public SeismicMage(UUID ownerId) { + super(ownerId, 211, "Seismic Mage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {2}{R}, {tap}, Discard a card: Destroy target land. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{2}{R}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + } + + public SeismicMage(final SeismicMage card) { + super(card); + } + + @Override + public SeismicMage copy() { + return new SeismicMage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/SnakePit.java b/Mage.Sets/src/mage/sets/mercadianmasques/SnakePit.java new file mode 100644 index 00000000000..5528d737e71 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/SnakePit.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.permanent.token.SnakeToken; + +/** + * + * @author LoneFox + */ +public class SnakePit extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("a blue or black spell"); + + static { + filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLUE), new ColorPredicate(ObjectColor.BLACK))); + } + + public SnakePit(UUID ownerId) { + super(ownerId, 271, "Snake Pit", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}"); + this.expansionSetCode = "MMQ"; + + // Whenever an opponent casts a blue or black spell, you may put a 1/1 green Snake creature token onto the battlefield. + this.addAbility(new SpellCastOpponentTriggeredAbility(new CreateTokenEffect(new SnakeToken()), filter, true)); + } + + public SnakePit(final SnakePit card) { + super(card); + } + + @Override + public SnakePit copy() { + return new SnakePit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/SpectersWail.java b/Mage.Sets/src/mage/sets/mercadianmasques/SpectersWail.java new file mode 100644 index 00000000000..0ff06d09757 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/SpectersWail.java @@ -0,0 +1,56 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class SpectersWail extends CardImpl { + + public SpectersWail(UUID ownerId) { + super(ownerId, 164, "Specter's Wail", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{B}"); + this.expansionSetCode = "MMQ"; + + // Target player discards a card at random. + } + + public SpectersWail(final SpectersWail card) { + super(card); + } + + @Override + public SpectersWail copy() { + return new SpectersWail(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/SpontaneousGeneration.java b/Mage.Sets/src/mage/sets/mercadianmasques/SpontaneousGeneration.java new file mode 100644 index 00000000000..6d92e259b88 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/SpontaneousGeneration.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.SaprolingToken; + +/** + * + * @author fireshoes + */ +public class SpontaneousGeneration extends CardImpl { + + public SpontaneousGeneration(UUID ownerId) { + super(ownerId, 274, "Spontaneous Generation", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{G}"); + this.expansionSetCode = "MMQ"; + + // Put a 1/1 green Saproling creature token onto the battlefield for each card in your hand. + this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new CardsInControllerHandCount())); + } + + public SpontaneousGeneration(final SpontaneousGeneration card) { + super(card); + } + + @Override + public SpontaneousGeneration copy() { + return new SpontaneousGeneration(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/Squeeze.java b/Mage.Sets/src/mage/sets/mercadianmasques/Squeeze.java new file mode 100644 index 00000000000..554723aecaf --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/Squeeze.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author fireshoes + */ +public class Squeeze extends CardImpl { + + private static final FilterCard filter = new FilterCard("Sorcery spells"); + + static { + filter.add(new CardTypePredicate(CardType.SORCERY)); + } + + public Squeeze(UUID ownerId) { + super(ownerId, 105, "Squeeze", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}"); + this.expansionSetCode = "MMQ"; + + // Sorcery spells cost {3} more to cast. + Effect effect = new SpellsCostIncreasementAllEffect(filter, 3); + effect.setText("Sorcery spells cost {3} more to cast"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public Squeeze(final Squeeze card) { + super(card); + } + + @Override + public Squeeze copy() { + return new Squeeze(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/StingingBarrier.java b/Mage.Sets/src/mage/sets/mercadianmasques/StingingBarrier.java new file mode 100644 index 00000000000..b2a4e6186b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/StingingBarrier.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class StingingBarrier extends CardImpl { + + public StingingBarrier(UUID ownerId) { + super(ownerId, 107, "Stinging Barrier", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Wall"); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // {U}, {tap}: Stinging Barrier deals 1 damage to target creature or player. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{U}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public StingingBarrier(final StingingBarrier card) { + super(card); + } + + @Override + public StingingBarrier copy() { + return new StingingBarrier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/TectonicBreak.java b/Mage.Sets/src/mage/sets/mercadianmasques/TectonicBreak.java new file mode 100644 index 00000000000..855a2faf3fc --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/TectonicBreak.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.SacrificeAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledLandPermanent; + +/** + * + * @author LoneFox + */ +public class TectonicBreak extends CardImpl { + + public TectonicBreak(UUID ownerId) { + super(ownerId, 216, "Tectonic Break", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{R}{R}"); + this.expansionSetCode = "MMQ"; + + // Each player sacrifices X lands. + this.getSpellAbility().addEffect(new SacrificeAllEffect(new ManacostVariableValue(), new FilterControlledLandPermanent("lands"))); + } + + public TectonicBreak(final TectonicBreak card) { + super(card); + } + + @Override + public TectonicBreak copy() { + return new TectonicBreak(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/Thwart.java b/Mage.Sets/src/mage/sets/mercadianmasques/Thwart.java index a8c224e8dfe..0ecda013df4 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/Thwart.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/Thwart.java @@ -29,7 +29,7 @@ package mage.sets.mercadianmasques; import java.util.UUID; import mage.abilities.costs.AlternativeCostSourceAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -54,7 +54,7 @@ public class Thwart extends CardImpl { // You may return three Islands you control to their owner's hand rather than pay Thwart's mana cost. AlternativeCostSourceAbility ability; - ability = new AlternativeCostSourceAbility(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(3, 3, filter, true))); + ability = new AlternativeCostSourceAbility(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(3, 3, filter, true))); this.addAbility(ability); // Counter target spell. diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/TidalBore.java b/Mage.Sets/src/mage/sets/mercadianmasques/TidalBore.java index abd9bf620da..792c862964f 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/TidalBore.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/TidalBore.java @@ -29,7 +29,7 @@ package mage.sets.mercadianmasques; import java.util.UUID; import mage.abilities.costs.AlternativeCostSourceAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.MayTapOrUntapTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -58,7 +58,7 @@ public class TidalBore extends CardImpl { this.expansionSetCode = "MMQ"; // You may return an Island you control to its owner's hand rather than pay Tidal Bore's mana cost. - this.addAbility(new AlternativeCostSourceAbility(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)))); + this.addAbility(new AlternativeCostSourceAbility(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)))); // You may tap or untap target creature. this.getSpellAbility().addEffect(new MayTapOrUntapTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java b/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java new file mode 100644 index 00000000000..1de3906ba4b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/TigerClaws.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlashAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class TigerClaws extends CardImpl { + + public TigerClaws(UUID ownerId) { + super(ownerId, 279, "Tiger Claws", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Aura"); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets +1/+1 and has trample. + Effect effect = new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has trample"); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1)); + ability.addEffect(effect); + this.addAbility(ability); + } + + public TigerClaws(final TigerClaws card) { + super(card); + } + + @Override + public TigerClaws copy() { + return new TigerClaws(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/VineDryad.java b/Mage.Sets/src/mage/sets/mercadianmasques/VineDryad.java new file mode 100644 index 00000000000..1ce491629c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/VineDryad.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.costs.AlternativeCostSourceAbility; +import mage.abilities.costs.common.ExileFromHandCost; +import mage.abilities.keyword.FlashAbility; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterOwnedCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardIdPredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCardInHand; + +/** + * + * @author fireshoes + */ +public class VineDryad extends CardImpl { + + public VineDryad(UUID ownerId) { + super(ownerId, 284, "Vine Dryad", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Dryad"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Forestwalk + this.addAbility(new ForestwalkAbility()); + + // You may exile a green card from your hand rather than pay Vine Dryad's mana cost. + FilterOwnedCard filter = new FilterOwnedCard("a green card from your hand"); + filter.add(new ColorPredicate(ObjectColor.GREEN)); + filter.add(Predicates.not(new CardIdPredicate(this.getId()))); // the exile cost can never be paid with the card itself + + this.addAbility(new AlternativeCostSourceAbility(new ExileFromHandCost(new TargetCardInHand(filter)))); + } + + public VineDryad(final VineDryad card) { + super(card); + } + + @Override + public VineDryad copy() { + return new VineDryad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/WordOfBlasting.java b/Mage.Sets/src/mage/sets/mercadianmasques/WordOfBlasting.java new file mode 100644 index 00000000000..5ea6f8b39f2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/WordOfBlasting.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mercadianmasques; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WordOfBlasting extends mage.sets.iceage.WordOfBlasting { + + public WordOfBlasting(UUID ownerId) { + super(ownerId); + this.cardNumber = 228; + this.expansionSetCode = "MMQ"; + } + + public WordOfBlasting(final WordOfBlasting card) { + super(card); + } + + @Override + public WordOfBlasting copy() { + return new WordOfBlasting(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/AmberPrison.java b/Mage.Sets/src/mage/sets/mirage/AmberPrison.java index 3653f69be88..ad18768cb65 100644 --- a/Mage.Sets/src/mage/sets/mirage/AmberPrison.java +++ b/Mage.Sets/src/mage/sets/mirage/AmberPrison.java @@ -29,27 +29,19 @@ package mage.sets.mirage; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SkipUntapOptionalAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.RestrictionEffect; +import mage.abilities.effects.common.DontUntapAsLongAsSourceTappedEffect; +import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; /** @@ -75,12 +67,11 @@ public class AmberPrison extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {4}, {tap}: Tap target artifact, creature, or land. That permanent doesn't untap during its controller's untap step for as long as Amber Prison remains tapped. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AmberPrisonTapTargetEffect(), new GenericManaCost(4)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new GenericManaCost(4)); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetPermanent(filter)); + ability.addEffect(new DontUntapAsLongAsSourceTappedEffect()); this.addAbility(ability); - this.addAbility(new AmberPrisonUntapTriggeredAbility()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AmberPrisonRestrictionEffect())); } public AmberPrison(final AmberPrison card) { @@ -92,124 +83,3 @@ public class AmberPrison extends CardImpl { return new AmberPrison(this); } } - -class AmberPrisonTapTargetEffect extends OneShotEffect { - - public AmberPrisonTapTargetEffect() { - super(Outcome.Tap); - this.staticText = "Tap target artifact, creature, or land. That permanent doesn't untap during its controller's untap step for as long as {source} remains tapped."; - } - - public AmberPrisonTapTargetEffect(final AmberPrisonTapTargetEffect effect) { - super(effect); - } - - @Override - public AmberPrisonTapTargetEffect copy() { - return new AmberPrisonTapTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - for (UUID target : targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(target); - if (permanent != null) { - if (sourcePermanent != null) { - sourcePermanent.addConnectedCard("AmberPrison", permanent.getId()); - } - permanent.tap(game); - } - } - return true; - } - -} - -class AmberPrisonRestrictionEffect extends RestrictionEffect { - - public AmberPrisonRestrictionEffect() { - super(Duration.WhileOnBattlefield); - } - - public AmberPrisonRestrictionEffect(final AmberPrisonRestrictionEffect effect) { - super(effect); - } - - @Override - public AmberPrisonRestrictionEffect copy() { - return new AmberPrisonRestrictionEffect(this); - } - - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (sourcePermanent != null && sourcePermanent.isTapped()) { - if (sourcePermanent.getConnectedCards("AmberPrison") != null) { - return sourcePermanent.getConnectedCards("AmberPrison").contains(permanent.getId()); - } - } - return false; - } - - @Override - public boolean canBeUntapped(Permanent permanent, Ability source, Game game) { - return false; - } - -} - -class AmberPrisonUntapTriggeredAbility extends TriggeredAbilityImpl { - - public AmberPrisonUntapTriggeredAbility() { - super(Zone.BATTLEFIELD, new AmberPrisonReleaseOnUntapEffect(), false); - this.usesStack = false; - this.ruleVisible = false; - } - - public AmberPrisonUntapTriggeredAbility(final AmberPrisonUntapTriggeredAbility ability) { - super(ability); - } - - @Override - public AmberPrisonUntapTriggeredAbility copy() { - return new AmberPrisonUntapTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.UNTAP; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return event.getTargetId().equals(this.getSourceId()); - } -} - -class AmberPrisonReleaseOnUntapEffect extends OneShotEffect { - - public AmberPrisonReleaseOnUntapEffect() { - super(Outcome.Detriment); - } - - public AmberPrisonReleaseOnUntapEffect(final AmberPrisonReleaseOnUntapEffect effect) { - super(effect); - } - - @Override - public AmberPrisonReleaseOnUntapEffect copy() { - return new AmberPrisonReleaseOnUntapEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (sourcePermanent != null) { - sourcePermanent.clearConnectedCards("AmberPrison"); - return true; - } - return false; - } - -} diff --git a/Mage.Sets/src/mage/sets/mirage/ArmorOfThorns.java b/Mage.Sets/src/mage/sets/mirage/ArmorOfThorns.java new file mode 100644 index 00000000000..5fff4649089 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/ArmorOfThorns.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SacrificeIfCastAtInstantTimeTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashSourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ArmorOfThorns extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public ArmorOfThorns(UUID ownerId) { + super(ownerId, 104, "Armor of Thorns", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Aura"); + + // You may cast Armor of Thorns as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame))); + this.addAbility(new SacrificeIfCastAtInstantTimeTriggeredAbility()); + // Enchant nonblack creature + TargetPermanent auraTarget = new TargetCreaturePermanent(filter); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +2/+2. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield))); + } + + public ArmorOfThorns(final ArmorOfThorns card) { + super(card); + } + + @Override + public ArmorOfThorns copy() { + return new ArmorOfThorns(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/AzimaetDrake.java b/Mage.Sets/src/mage/sets/mirage/AzimaetDrake.java new file mode 100644 index 00000000000..05e1e6bb41f --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/AzimaetDrake.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author nigelzor + */ +public class AzimaetDrake extends CardImpl { + + public AzimaetDrake(UUID ownerId) { + super(ownerId, 53, "Azimaet Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Drake"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {U}: Azimaet Drake gets +1/+0 until end of turn. Activate this ability only once each turn. + this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{U}"))); + } + + public AzimaetDrake(final AzimaetDrake card) { + super(card); + } + + @Override + public AzimaetDrake copy() { + return new AzimaetDrake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/BarbedBackWurm.java b/Mage.Sets/src/mage/sets/mirage/BarbedBackWurm.java new file mode 100644 index 00000000000..139d3f54ac7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/BarbedBackWurm.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.permanent.BlockingAttackerIdPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class BarbedBackWurm extends CardImpl { + + public BarbedBackWurm(UUID ownerId) { + super(ownerId, 3, "Barbed-Back Wurm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Wurm"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // {B}: Target green creature blocking Barbed-Back Wurm gets -1/-1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-1, -1, Duration.EndOfTurn), new ManaCostsImpl("{B}")); + FilterCreaturePermanent filter = new FilterCreaturePermanent("green creature blocking {this}"); + filter.add(new ColorPredicate(ObjectColor.GREEN)); + filter.add(new BlockingAttackerIdPredicate(this.getId())); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public BarbedBackWurm(final BarbedBackWurm card) { + super(card); + } + + @Override + public BarbedBackWurm copy() { + return new BarbedBackWurm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/BenthicDjinn.java b/Mage.Sets/src/mage/sets/mirage/BenthicDjinn.java new file mode 100644 index 00000000000..e0602d4fee3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/BenthicDjinn.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.abilities.keyword.IslandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author fireshoes + */ +public class BenthicDjinn extends CardImpl { + + public BenthicDjinn(UUID ownerId) { + super(ownerId, 317, "Benthic Djinn", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{B}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Djinn"); + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + // Islandwalk + this.addAbility(new IslandwalkAbility()); + + // At the beginning of your upkeep, you lose 2 life. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(2), TargetController.YOU, false)); + } + + public BenthicDjinn(final BenthicDjinn card) { + super(card); + } + + @Override + public BenthicDjinn copy() { + return new BenthicDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/BoneHarvest.java b/Mage.Sets/src/mage/sets/mirage/BoneHarvest.java new file mode 100644 index 00000000000..0d770f08eaf --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/BoneHarvest.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author fireshoes + */ +public class BoneHarvest extends CardImpl { + + public BoneHarvest(UUID ownerId) { + super(ownerId, 6, "Bone Harvest", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{B}"); + this.expansionSetCode = "MIR"; + + // Put any number of target creature cards from your graveyard on top of your library. + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard"))); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public BoneHarvest(final BoneHarvest card) { + super(card); + } + + @Override + public BoneHarvest copy() { + return new BoneHarvest(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/Breathstealer.java b/Mage.Sets/src/mage/sets/mirage/Breathstealer.java new file mode 100644 index 00000000000..97f83251c56 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/Breathstealer.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class Breathstealer extends CardImpl { + + public Breathstealer(UUID ownerId) { + super(ownerId, 7, "Breathstealer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Nightstalker"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {B}: Breathstealer gets +1/-1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + } + + public Breathstealer(final Breathstealer card) { + super(card); + } + + @Override + public Breathstealer copy() { + return new Breathstealer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/Brushwagg.java b/Mage.Sets/src/mage/sets/mirage/Brushwagg.java new file mode 100644 index 00000000000..9881a68a2a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/Brushwagg.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Brushwagg extends CardImpl { + + public Brushwagg(UUID ownerId) { + super(ownerId, 106, "Brushwagg", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Brushwagg"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever Brushwagg blocks or becomes blocked, it gets -2/+2 until end of turn. + this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(-2, 2, Duration.EndOfTurn), false)); + } + + public Brushwagg(final Brushwagg card) { + super(card); + } + + @Override + public Brushwagg copy() { + return new Brushwagg(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/CelestialDawn.java b/Mage.Sets/src/mage/sets/mirage/CelestialDawn.java new file mode 100644 index 00000000000..a0f4bf3c743 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/CelestialDawn.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class CelestialDawn extends mage.sets.timeshifted.CelestialDawn { + + public CelestialDawn(UUID ownerId) { + super(ownerId); + this.cardNumber = 210; + this.expansionSetCode = "MIR"; + this.rarity = Rarity.RARE; + } + + public CelestialDawn(final CelestialDawn card) { + super(card); + } + + @Override + public CelestialDawn copy() { + return new CelestialDawn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/CeruleanWyvern.java b/Mage.Sets/src/mage/sets/mirage/CeruleanWyvern.java new file mode 100644 index 00000000000..e5ff0bd4514 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/CeruleanWyvern.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class CeruleanWyvern extends CardImpl { + + private static final FilterCard filter = new FilterCard("green"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public CeruleanWyvern(UUID ownerId) { + super(ownerId, 57, "Cerulean Wyvern", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Drake"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // protection from green + this.addAbility(new ProtectionAbility(filter)); + } + + public CeruleanWyvern(final CeruleanWyvern card) { + super(card); + } + + @Override + public CeruleanWyvern copy() { + return new CeruleanWyvern(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/ChaosCharm.java b/Mage.Sets/src/mage/sets/mirage/ChaosCharm.java new file mode 100644 index 00000000000..5f99b6cd5f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/ChaosCharm.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ChaosCharm extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Wall"); + + static { + filter.add(new SubtypePredicate("Wall")); + } + + public ChaosCharm(UUID ownerId) { + super(ownerId, 163, "Chaos Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "MIR"; + + // Choose one - Destroy target Wall + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + // or Chaos Charm deals 1 damage to target creature + Mode mode = new Mode(); + mode.getEffects().add(new DamageTargetEffect(1)); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode); + // or target creature gains haste until end of turn. + mode = new Mode(); + mode.getEffects().add(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode); + } + + public ChaosCharm(final ChaosCharm card) { + super(card); + } + + @Override + public ChaosCharm copy() { + return new ChaosCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/CivicGuildmage.java b/Mage.Sets/src/mage/sets/mirage/CivicGuildmage.java new file mode 100644 index 00000000000..2a697a9af2b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/CivicGuildmage.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class CivicGuildmage extends CardImpl { + + public CivicGuildmage(UUID ownerId) { + super(ownerId, 211, "Civic Guildmage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {G}, {tap}: Target creature gets +0/+1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{G}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // {U}, {tap}: Put target creature you control on top of its owner's library. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(true), new ManaCostsImpl("{U}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + public CivicGuildmage(final CivicGuildmage card) { + super(card); + } + + @Override + public CivicGuildmage copy() { + return new CivicGuildmage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/CloakOfInvisibility.java b/Mage.Sets/src/mage/sets/mirage/CloakOfInvisibility.java new file mode 100644 index 00000000000..1e9f7b1c966 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/CloakOfInvisibility.java @@ -0,0 +1,118 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.PhasingAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class CloakOfInvisibility extends CardImpl { + + public CloakOfInvisibility(UUID ownerId) { + super(ownerId, 58, "Cloak of Invisibility", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature has phasing and can't be blocked except by Walls. + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(PhasingAbility.getInstance(), AttachmentType.AURA)); + ability.addEffect(new CantBeBlockedByWallsEffect()); + this.addAbility(ability); + } + + public CloakOfInvisibility(final CloakOfInvisibility card) { + super(card); + } + + @Override + public CloakOfInvisibility copy() { + return new CloakOfInvisibility(this); + } +} + +class CantBeBlockedByWallsEffect extends RestrictionEffect { + + public CantBeBlockedByWallsEffect() { + super(Duration.WhileOnBattlefield); + staticText = "Enchanted creature can't be blocked except by Walls"; + } + + public CantBeBlockedByWallsEffect(final CantBeBlockedByWallsEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + if (permanent.getId().equals(enchantment.getAttachedTo())) { + return true; + } + } + return false; + } + + @Override + public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { + if (!blocker.hasSubtype("Wall")) { + return false; + } + return true; + } + + @Override + public CantBeBlockedByWallsEffect copy() { + return new CantBeBlockedByWallsEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/CoralFighters.java b/Mage.Sets/src/mage/sets/mirage/CoralFighters.java new file mode 100644 index 00000000000..2d1c89dcf63 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/CoralFighters.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CoralFighters extends mage.sets.venservskoth.CoralFighters { + + public CoralFighters(UUID ownerId) { + super(ownerId); + this.cardNumber = 59; + this.expansionSetCode = "MIR"; + } + + public CoralFighters(final CoralFighters card) { + super(card); + } + + @Override + public CoralFighters copy() { + return new CoralFighters(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/CryptCobra.java b/Mage.Sets/src/mage/sets/mirage/CryptCobra.java new file mode 100644 index 00000000000..95459bda11f --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/CryptCobra.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.counter.AddPoisonCounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CryptCobra extends CardImpl { + + public CryptCobra(UUID ownerId) { + super(ownerId, 12, "Crypt Cobra", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Snake"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Crypt Cobra attacks and isn't blocked, defending player gets a poison counter. + Effect effect = new AddPoisonCounterTargetEffect(1); + effect.setText("defending player gets a poison counter"); + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(effect, false, true)); + } + + public CryptCobra(final CryptCobra card) { + super(card); + } + + @Override + public CryptCobra copy() { + return new CryptCobra(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/CrystalGolem.java b/Mage.Sets/src/mage/sets/mirage/CrystalGolem.java new file mode 100644 index 00000000000..4b069186add --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/CrystalGolem.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.effects.common.PhaseOutSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author fireshoes + */ +public class CrystalGolem extends CardImpl { + + public CrystalGolem(UUID ownerId) { + super(ownerId, 263, "Crystal Golem", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Golem"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // At the beginning of your end step, Crystal Golem phases out. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new PhaseOutSourceEffect(), TargetController.YOU, false)); + } + + public CrystalGolem(final CrystalGolem card) { + super(card); + } + + @Override + public CrystalGolem copy() { + return new CrystalGolem(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/DirtwaterWraith.java b/Mage.Sets/src/mage/sets/mirage/DirtwaterWraith.java new file mode 100644 index 00000000000..285ca37a10c --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/DirtwaterWraith.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class DirtwaterWraith extends CardImpl { + + public DirtwaterWraith(UUID ownerId) { + super(ownerId, 15, "Dirtwater Wraith", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Wraith"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Swampwalk + this.addAbility(new SwampwalkAbility()); + + // {B}: Dirtwater Wraith gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + } + + public DirtwaterWraith(final DirtwaterWraith card) { + super(card); + } + + @Override + public DirtwaterWraith copy() { + return new DirtwaterWraith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/EbonyCharm.java b/Mage.Sets/src/mage/sets/mirage/EbonyCharm.java new file mode 100644 index 00000000000..ced14bb8364 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/EbonyCharm.java @@ -0,0 +1,141 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FearAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInASingleGraveyard; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class EbonyCharm extends CardImpl { + + public EbonyCharm(UUID ownerId) { + super(ownerId, 18, "Ebony Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "MIR"; + + // Choose one - Target opponent loses 1 life and you gain 1 life; + this.getSpellAbility().addEffect(new EbonyCharmDrainEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + + // or exile up to three target cards from a single graveyard; + Mode mode = new Mode(); + mode.getEffects().add(new EbonyCharmExileEffect()); + mode.getTargets().add((new TargetCardInASingleGraveyard(0, 3, new FilterCard("up to three target cards from a single graveyard")))); + this.getSpellAbility().addMode(mode); + + // or target creature gains fear until end of turn. + mode = new Mode(); + mode.getTargets().add(new TargetCreaturePermanent()); + mode.getEffects().add(new GainAbilityTargetEffect(FearAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addMode(mode); + } + + public EbonyCharm(final EbonyCharm card) { + super(card); + } + + @Override + public EbonyCharm copy() { + return new EbonyCharm(this); + } +} + +class EbonyCharmDrainEffect extends OneShotEffect { + + EbonyCharmDrainEffect() { + super(Outcome.Damage); + staticText = "target opponent loses 1 life and you gain 1 life"; + } + + EbonyCharmDrainEffect(final EbonyCharmDrainEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(source.getFirstTarget()); + Player controllerPlayer = game.getPlayer(source.getControllerId()); + if (targetPlayer != null && controllerPlayer != null) { + targetPlayer.damage(1, source.getSourceId(), game, false, true); + controllerPlayer.gainLife(1, game); + } + return false; + } + + @Override + public EbonyCharmDrainEffect copy() { + return new EbonyCharmDrainEffect(this); + } + +} + +class EbonyCharmExileEffect extends OneShotEffect { + + public EbonyCharmExileEffect() { + super(Outcome.Exile); + this.staticText = "Exile up to three target cards from a single graveyard"; + } + + public EbonyCharmExileEffect(final EbonyCharmExileEffect effect) { + super(effect); + } + + @Override + public EbonyCharmExileEffect copy() { + return new EbonyCharmExileEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (UUID targetID : source.getTargets().get(0).getTargets()) { + Card card = game.getCard(targetID); + if (card != null) { + card.moveToExile(null, "", source.getSourceId(), game); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/Flare.java b/Mage.Sets/src/mage/sets/mirage/Flare.java new file mode 100644 index 00000000000..967557d19a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/Flare.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Flare extends mage.sets.fifthedition.Flare { + + public Flare(UUID ownerId) { + super(ownerId); + this.cardNumber = 176; + this.expansionSetCode = "MIR"; + } + + public Flare(final Flare card) { + super(card); + } + + @Override + public Flare copy() { + return new Flare(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/ForsakenWastes.java b/Mage.Sets/src/mage/sets/mirage/ForsakenWastes.java new file mode 100644 index 00000000000..00612501e4e --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/ForsakenWastes.java @@ -0,0 +1,114 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.continuous.CantGainLifeAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.stack.Spell; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class ForsakenWastes extends CardImpl { + + public ForsakenWastes(UUID ownerId) { + super(ownerId, 23, "Forsaken Wastes", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "MIR"; + this.supertype.add("World"); + + // Players can't gain life. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantGainLifeAllEffect())); + + // At the beginning of each player's upkeep, that player loses 1 life. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), TargetController.ANY, false, true)); + + // Whenever Forsaken Wastes becomes the target of a spell, that spell's controller loses 5 life. + this.addAbility(new ForsakenWastesTriggeredAbility()); + } + + public ForsakenWastes(final ForsakenWastes card) { + super(card); + } + + @Override + public ForsakenWastes copy() { + return new ForsakenWastes(this); + } +} + +class ForsakenWastesTriggeredAbility extends TriggeredAbilityImpl { + + public ForsakenWastesTriggeredAbility() { + super(Zone.BATTLEFIELD, new LoseLifeTargetEffect(5), false); + } + + public ForsakenWastesTriggeredAbility(final ForsakenWastesTriggeredAbility ability) { + super(ability); + } + + @Override + public ForsakenWastesTriggeredAbility copy() { + return new ForsakenWastesTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + MageObject eventSourceObject = game.getObject(event.getSourceId()); + if (eventSourceObject != null && event.getTargetId().equals(this.getSourceId())&& eventSourceObject instanceof Spell ) { + getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} becomes the target of a spell, that spell's controller loses 5 life."; + } + +} diff --git a/Mage.Sets/src/mage/sets/mirage/FreneticEfreet.java b/Mage.Sets/src/mage/sets/mirage/FreneticEfreet.java new file mode 100644 index 00000000000..98a77984ab0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/FreneticEfreet.java @@ -0,0 +1,106 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class FreneticEfreet extends CardImpl { + + public FreneticEfreet(UUID ownerId) { + super(ownerId, 324, "Frenetic Efreet", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{R}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Efreet"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // {0}: Flip a coin. If you win the flip, Frenetic Efreet phases out. If you lose the flip, sacrifice Frenetic Efreet. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new FreneticEfreetEffect(), new GenericManaCost(0))); + } + + public FreneticEfreet(final FreneticEfreet card) { + super(card); + } + + @Override + public FreneticEfreet copy() { + return new FreneticEfreet(this); + } +} + +class FreneticEfreetEffect extends OneShotEffect { + + public FreneticEfreetEffect() { + super(Outcome.Damage); + staticText = "Flip a coin. If you win the flip, {this} phases out. If you lose the flip, sacrifice {this}"; + } + + public FreneticEfreetEffect(FreneticEfreetEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null && permanent != null) { + if (controller.flipCoin(game)) { + return permanent.phaseOut(game); + } else { + permanent.sacrifice(source.getSourceId(), game); + return true; + } + } + return false; + } + + @Override + public FreneticEfreetEffect copy() { + return new FreneticEfreetEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/GoblinScouts.java b/Mage.Sets/src/mage/sets/mirage/GoblinScouts.java new file mode 100644 index 00000000000..87df71dda84 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/GoblinScouts.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.Token; + +/** + * + * @author fireshoes + */ +public class GoblinScouts extends CardImpl { + + public GoblinScouts(UUID ownerId) { + super(ownerId, 178, "Goblin Scouts", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "MIR"; + + // Put three 1/1 red Goblin Scout creature tokens with mountainwalk onto the battlefield. + this.getSpellAbility().addEffect(new CreateTokenEffect(new GoblinScoutsToken(), 3)); + } + + public GoblinScouts(final GoblinScouts card) { + super(card); + } + + @Override + public GoblinScouts copy() { + return new GoblinScouts(this); + } +} + +class GoblinScoutsToken extends Token { + + public GoblinScoutsToken() { + super("Goblin Scout", "1/1 red Goblin Scout creature tokens with mountainwalk"); + cardType.add(CardType.CREATURE); + color.setRed(true); + subtype.add("Goblin"); + subtype.add("Scout"); + power = new MageInt(1); + toughness = new MageInt(1); + + this.addAbility(new MountainwalkAbility()); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirage/GoblinSoothsayer.java b/Mage.Sets/src/mage/sets/mirage/GoblinSoothsayer.java new file mode 100644 index 00000000000..a8077e0bb79 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/GoblinSoothsayer.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author BursegSardaukar + */ +public class GoblinSoothsayer extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("red creatures"); + private static final FilterControlledPermanent filter2 = new FilterControlledPermanent("goblin"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + filter2.add(new SubtypePredicate("Goblin")); + } + + public GoblinSoothsayer(UUID ownerId) { + super(ownerId, 179, "Goblin Soothsayer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Goblin"); + this.subtype.add("Shaman"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {R}, {T}, Sacrifice a Goblin: Red creatures get +1/+1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1,1,Duration.EndOfTurn, filter, false), new ManaCostsImpl("{R}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter2))); + this.addAbility(ability); + + } + + public GoblinSoothsayer(final GoblinSoothsayer card) { + super(card); + } + + @Override + public GoblinSoothsayer copy() { + return new GoblinSoothsayer(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirage/GraveServitude.java b/Mage.Sets/src/mage/sets/mirage/GraveServitude.java new file mode 100644 index 00000000000..e162e3aae2d --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/GraveServitude.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SacrificeIfCastAtInstantTimeTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashSourceEffect; +import mage.abilities.effects.common.continuous.SetCardColorAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class GraveServitude extends CardImpl { + + public GraveServitude(UUID ownerId) { + super(ownerId, 24, "Grave Servitude", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Aura"); + + // You may cast Grave Servitude as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame))); + this.addAbility(new SacrificeIfCastAtInstantTimeTriggeredAbility()); + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +3/-1 and is black. + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, -1, Duration.WhileOnBattlefield)); + Effect effect = new SetCardColorAttachedEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield, AttachmentType.AURA); + effect.setText("and is black"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public GraveServitude(final GraveServitude card) { + super(card); + } + + @Override + public GraveServitude copy() { + return new GraveServitude(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/HammerOfBogardan.java b/Mage.Sets/src/mage/sets/mirage/HammerOfBogardan.java index 43bce3d67f7..fc954383305 100644 --- a/Mage.Sets/src/mage/sets/mirage/HammerOfBogardan.java +++ b/Mage.Sets/src/mage/sets/mirage/HammerOfBogardan.java @@ -29,15 +29,15 @@ package mage.sets.mirage; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.condition.common.IsStepCondition; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.decorator.ConditionalActivatedAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.PhaseStep; +import mage.constants.Rarity; import mage.constants.Zone; import mage.target.common.TargetCreatureOrPlayer; @@ -58,8 +58,8 @@ public class HammerOfBogardan extends CardImpl { this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); // {2}{R}{R}{R}: Return Hammer of Bogardan from your graveyard to your hand. Activate this ability only during your upkeep. - this.addAbility(new ConditionalActivatedAbility(Zone.GRAVEYARD, - new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl("{2}{R}{R}{R}"), new IsStepCondition(PhaseStep.END_COMBAT), null)); + this.addAbility(new ConditionalActivatedAbility(Zone.GRAVEYARD, + new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl("{2}{R}{R}{R}"), new IsStepCondition(PhaseStep.UPKEEP), null)); } public HammerOfBogardan(final HammerOfBogardan card) { diff --git a/Mage.Sets/src/mage/sets/mirage/HazeriderDrake.java b/Mage.Sets/src/mage/sets/mirage/HazeriderDrake.java new file mode 100644 index 00000000000..9fafa332568 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/HazeriderDrake.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class HazeriderDrake extends CardImpl { + + private static final FilterCard filter = new FilterCard("red"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public HazeriderDrake(UUID ownerId) { + super(ownerId, 328, "Hazerider Drake", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}{U}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Drake"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // protection from red + this.addAbility(new ProtectionAbility(filter)); + } + + public HazeriderDrake(final HazeriderDrake card) { + super(card); + } + + @Override + public HazeriderDrake copy() { + return new HazeriderDrake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/HorribleHordes.java b/Mage.Sets/src/mage/sets/mirage/HorribleHordes.java new file mode 100644 index 00000000000..e51cb4f7ecb --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/HorribleHordes.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class HorribleHordes extends CardImpl { + + public HorribleHordes(UUID ownerId) { + super(ownerId, 269, "Horrible Hordes", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Rampage 1 + this.addAbility(new RampageAbility(1)); + } + + public HorribleHordes(final HorribleHordes card) { + super(card); + } + + @Override + public HorribleHordes copy() { + return new HorribleHordes(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/Illumination.java b/Mage.Sets/src/mage/sets/mirage/Illumination.java new file mode 100644 index 00000000000..cbf7f23238c --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/Illumination.java @@ -0,0 +1,121 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author fireshoes + */ +public class Illumination extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("artifact or enchantment spell"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); + } + + public Illumination(UUID ownerId) { + super(ownerId, 225, "Illumination", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}{W}"); + this.expansionSetCode = "MIR"; + + // Counter target artifact or enchantment spell. + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + + // Its controller gains life equal to its converted mana cost. + this.getSpellAbility().addEffect(new IlluminationEffect()); + } + + public Illumination(final Illumination card) { + super(card); + } + + @Override + public Illumination copy() { + return new Illumination(this); + } +} + +class IlluminationEffect extends OneShotEffect { + + public IlluminationEffect() { + super(Outcome.GainLife); + staticText = "Its controller gains life equal to its converted mana cost"; + } + + public IlluminationEffect(final IlluminationEffect effect) { + super(effect); + } + + @Override + public IlluminationEffect copy() { + return new IlluminationEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID targetId = source.getFirstTarget(); + Player controller = null; + boolean countered = false; + if (targetId != null) { + controller = game.getPlayer(game.getControllerId(targetId)); + } + if (targetId != null + && game.getStack().counter(targetId, source.getSourceId(), game)) { + countered = true; + } + if (controller != null) { + Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); + int cost = spell.getManaCost().convertedManaCost(); + Player player = game.getPlayer(spell.getControllerId()); + if (player != null) { + player.gainLife(cost, game); + } + return true; + } + return countered; + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/IvoryCharm.java b/Mage.Sets/src/mage/sets/mirage/IvoryCharm.java new file mode 100644 index 00000000000..50d7e9be957 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/IvoryCharm.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class IvoryCharm extends CardImpl { + + public IvoryCharm(UUID ownerId) { + super(ownerId, 227, "Ivory Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "MIR"; + + // Choose one - All creatures get -2/-0 until end of turn + this.getSpellAbility().addEffect(new BoostAllEffect(-2, 0, Duration.EndOfTurn)); + // or tap target creature + Mode mode = new Mode(); + mode.getEffects().add(new TapTargetEffect()); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode); + // or prevent the next 1 damage that would be dealt to target creature or player this turn. + mode = new Mode(); + mode.getEffects().add(new PreventDamageToTargetEffect(Duration.EndOfTurn, 1)); + mode.getTargets().add(new TargetCreatureOrPlayer()); + this.getSpellAbility().addMode(mode); + } + + public IvoryCharm(final IvoryCharm card) { + super(card); + } + + @Override + public IvoryCharm copy() { + return new IvoryCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/Jolt.java b/Mage.Sets/src/mage/sets/mirage/Jolt.java new file mode 100644 index 00000000000..820ea3ba0e0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/Jolt.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class Jolt extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or land"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); + } + + public Jolt(UUID ownerId) { + super(ownerId, 70, "Jolt", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); + this.expansionSetCode = "MIR"; + + // You may tap or untap target artifact, creature, or land. + this.getSpellAbility().addEffect(new MayTapOrUntapTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false)); + } + + public Jolt(final Jolt card) { + super(card); + } + + @Override + public Jolt copy() { + return new Jolt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/JungleWurm.java b/Mage.Sets/src/mage/sets/mirage/JungleWurm.java new file mode 100644 index 00000000000..0ad27034812 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/JungleWurm.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.combat.CombatGroup; +import mage.game.events.GameEvent; + +/** + * + * @author LoneFox + */ +public class JungleWurm extends CardImpl { + + public JungleWurm(UUID ownerId) { + super(ownerId, 122, "Jungle Wurm", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Wurm"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Whenever Jungle Wurm becomes blocked, it gets -1/-1 until end of turn for each creature blocking it beyond the first. + this.addAbility(new JungleWurmAbility()); + } + + public JungleWurm(final JungleWurm card) { + super(card); + } + + @Override + public JungleWurm copy() { + return new JungleWurm(this); + } +} + +class JungleWurmAbility extends BecomesBlockedTriggeredAbility { + + public JungleWurmAbility() { + super(null, false); + JungleWurmValue value = new JungleWurmValue(); + this.addEffect(new BoostSourceEffect(value, value, Duration.EndOfTurn)); + } + + public JungleWurmAbility(final JungleWurmAbility ability) { + super(ability); + } + + @Override + public JungleWurmAbility copy() { + return new JungleWurmAbility(this); + } + + @Override + public String getRule() { + return "Whenever {this} becomes blocked, it gets -1/-1 until end of turn for each creature blocking it beyond the first."; + } +} + +class JungleWurmValue implements DynamicValue { + + @Override + public JungleWurmValue copy() { + return new JungleWurmValue(); + } + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + int count = 0; + for(CombatGroup combatGroup : game.getCombat().getGroups()) { + if(combatGroup.getAttackers().contains(sourceAbility.getSourceId())) { + int blockers = combatGroup.getBlockers().size(); + return blockers > 1 ? -(blockers - 1) : 0; + } + } + return 0; + } + + @Override + public String getMessage() { + return "-1/-1 until end of turn for each creature blocking it beyond the first"; + } +} + diff --git a/Mage.Sets/src/mage/sets/mirage/KarooMeerkat.java b/Mage.Sets/src/mage/sets/mirage/KarooMeerkat.java new file mode 100644 index 00000000000..4c05f5806b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/KarooMeerkat.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class KarooMeerkat extends CardImpl { + + private static final FilterCard filter = new FilterCard("blue"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public KarooMeerkat(UUID ownerId) { + super(ownerId, 123, "Karoo Meerkat", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Mongoose"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Protection from blue + this.addAbility(new ProtectionAbility(filter)); + } + + public KarooMeerkat(final KarooMeerkat card) { + super(card); + } + + @Override + public KarooMeerkat copy() { + return new KarooMeerkat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/LightningReflexes.java b/Mage.Sets/src/mage/sets/mirage/LightningReflexes.java new file mode 100644 index 00000000000..627c87926b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/LightningReflexes.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SacrificeIfCastAtInstantTimeTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class LightningReflexes extends CardImpl { + + public LightningReflexes(UUID ownerId) { + super(ownerId, 186, "Lightning Reflexes", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Aura"); + + // You may cast Lightning Reflexes as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame))); + this.addAbility(new SacrificeIfCastAtInstantTimeTriggeredAbility()); + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +1/+0 and has first strike. + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.WhileOnBattlefield)); + Effect effect = new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has first strike"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public LightningReflexes(final LightningReflexes card) { + super(card); + } + + @Override + public LightningReflexes copy() { + return new LightningReflexes(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/MelesseSpirit.java b/Mage.Sets/src/mage/sets/mirage/MelesseSpirit.java new file mode 100644 index 00000000000..1299568ed9c --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/MelesseSpirit.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class MelesseSpirit extends CardImpl { + + private static final FilterCard filter = new FilterCard("black"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public MelesseSpirit(UUID ownerId) { + super(ownerId, 231, "Melesse Spirit", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Angel"); + this.subtype.add("Spirit"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // protection from black + this.addAbility(new ProtectionAbility(filter)); + } + + public MelesseSpirit(final MelesseSpirit card) { + super(card); + } + + @Override + public MelesseSpirit copy() { + return new MelesseSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/MerfolkSeer.java b/Mage.Sets/src/mage/sets/mirage/MerfolkSeer.java new file mode 100644 index 00000000000..08d85b6ecf7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/MerfolkSeer.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class MerfolkSeer extends CardImpl { + + public MerfolkSeer(UUID ownerId) { + super(ownerId, 76, "Merfolk Seer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Merfolk"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Merfolk Seer dies, you may pay {1}{U}. If you do, draw a card. + this.addAbility(new DiesTriggeredAbility(new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{1}{U}")))); + } + + public MerfolkSeer(final MerfolkSeer card) { + super(card); + } + + @Override + public MerfolkSeer copy() { + return new MerfolkSeer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/MistDragon.java b/Mage.Sets/src/mage/sets/mirage/MistDragon.java new file mode 100644 index 00000000000..672b23b45e5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/MistDragon.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PhaseOutSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.continuous.LoseAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class MistDragon extends CardImpl { + + public MistDragon(UUID ownerId) { + super(ownerId, 79, "Mist Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Dragon"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {0}: Mist Dragon gains flying. This effect lasts indefinitely + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield), new GenericManaCost(0))); + + // {0}: Mist Dragon loses flying. This effect lasts indefinitely + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new LoseAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield), new GenericManaCost(0))); + + // {3}{U}{U}: Mist Dragon phases out. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new PhaseOutSourceEffect(), new ManaCostsImpl("{3}{U}{U}"))); + } + + public MistDragon(final MistDragon card) { + super(card); + } + + @Override + public MistDragon copy() { + return new MistDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/NettletoothDjinn.java b/Mage.Sets/src/mage/sets/mirage/NettletoothDjinn.java new file mode 100644 index 00000000000..c14f72308f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/NettletoothDjinn.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class NettletoothDjinn extends CardImpl { + + public NettletoothDjinn(UUID ownerId) { + super(ownerId, 130, "Nettletooth Djinn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Djinn"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // At the beginning of your upkeep, Nettletooth Djinn deals 1 damage to you. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DamageControllerEffect(1), TargetController.YOU, false)); } + + public NettletoothDjinn(final NettletoothDjinn card) { + super(card); + } + + @Override + public NettletoothDjinn copy() { + return new NettletoothDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/PaupersCage.java b/Mage.Sets/src/mage/sets/mirage/PaupersCage.java new file mode 100644 index 00000000000..7a2d0d3741d --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/PaupersCage.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.common.CardsInHandCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class PaupersCage extends CardImpl { + + public PaupersCage(UUID ownerId) { + super(ownerId, 279, "Paupers' Cage", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "MIR"; + + // At the beginning of each opponent's upkeep, if that player has two or fewer cards in hand, Paupers' Cage deals 2 damage to him or her. + TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, + new DamageTargetEffect(2), TargetController.OPPONENT, false, true); + CardsInHandCondition condition = new CardsInHandCondition(CardsInHandCondition.CountType.FEWER_THAN, 3); + this.addAbility(new ConditionalTriggeredAbility(ability, condition, "At the beginning of each opponent's upkeep, if that player has two or fewer cards in hand, {this} deals 2 damage to him or her.")); + } + + public PaupersCage(final PaupersCage card) { + super(card); + } + + @Override + public PaupersCage copy() { + return new PaupersCage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/PhyrexianTribute.java b/Mage.Sets/src/mage/sets/mirage/PhyrexianTribute.java new file mode 100644 index 00000000000..c77629097dd --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/PhyrexianTribute.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; + +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterArtifactPermanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author nigelzor + */ +public class PhyrexianTribute extends CardImpl { + + public PhyrexianTribute(UUID ownerId) { + super(ownerId, 32, "Phyrexian Tribute", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{B}"); + this.expansionSetCode = "MIR"; + + // As an additional cost to cast Phyrexian Tribute, sacrifice two creatures. + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(2))); + // Destroy target artifact. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(new FilterArtifactPermanent())); + } + + public PhyrexianTribute(final PhyrexianTribute card) { + super(card); + } + + @Override + public PhyrexianTribute copy() { + return new PhyrexianTribute(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/PoliticalTrickery.java b/Mage.Sets/src/mage/sets/mirage/PoliticalTrickery.java new file mode 100644 index 00000000000..75727938267 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/PoliticalTrickery.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; + +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.ExchangeControlTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author andyfries + */ +public class PoliticalTrickery extends CardImpl { + + private static final String rule = "exchange control of target land you control and target land an opponent controls"; + + private static final FilterLandPermanent filter = new FilterLandPermanent("land an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public PoliticalTrickery(UUID ownerId) { + super(ownerId, 81, "Political Trickery", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "MIR"; + + // Exchange control of target land you control and target land an opponent controls. + Effect effect = new ExchangeControlTargetEffect(Duration.EndOfGame, rule, false, true); + effect.setText("exchange control of target land you control and target land an opponent controls"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent())); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + public PoliticalTrickery(final PoliticalTrickery card) { + super(card); + } + + @Override + public PoliticalTrickery copy() { + return new PoliticalTrickery(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/RealityRipple.java b/Mage.Sets/src/mage/sets/mirage/RealityRipple.java new file mode 100644 index 00000000000..1ec6929a7c6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/RealityRipple.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.effects.common.PhaseOutTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class RealityRipple extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or land"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); + } + + public RealityRipple(UUID ownerId) { + super(ownerId, 87, "Reality Ripple", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "MIR"; + + // Target artifact, creature, or land phases out. + this.getSpellAbility().addEffect(new PhaseOutTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + public RealityRipple(final RealityRipple card) { + super(card); + } + + @Override + public RealityRipple copy() { + return new RealityRipple(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/RitualOfSteel.java b/Mage.Sets/src/mage/sets/mirage/RitualOfSteel.java new file mode 100644 index 00000000000..b3e56b3a3e9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/RitualOfSteel.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class RitualOfSteel extends CardImpl { + + public RitualOfSteel(UUID ownerId) { + super(ownerId, 240, "Ritual of Steel", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // When Ritual of Steel enters the battlefield, draw a card at the beginning of the next turn's upkeep. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1)), false))); + + // Enchanted creature gets +0/+2. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(0,2, Duration.WhileOnBattlefield))); + } + + public RitualOfSteel(final RitualOfSteel card) { + super(card); + } + + @Override + public RitualOfSteel copy() { + return new RitualOfSteel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/RockBasilisk.java b/Mage.Sets/src/mage/sets/mirage/RockBasilisk.java index 66e96becae5..cbe897d304f 100644 --- a/Mage.Sets/src/mage/sets/mirage/RockBasilisk.java +++ b/Mage.Sets/src/mage/sets/mirage/RockBasilisk.java @@ -29,21 +29,17 @@ package mage.sets.mirage; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.target.targetpointer.FixedTarget; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -51,6 +47,12 @@ import mage.target.targetpointer.FixedTarget; */ public class RockBasilisk extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall creature"); + + static { + filter.add(Predicates.not(new SubtypePredicate("Wall"))); + } + public RockBasilisk(UUID ownerId) { super(ownerId, 339, "Rock Basilisk", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}{G}"); this.expansionSetCode = "MIR"; @@ -60,7 +62,10 @@ public class RockBasilisk extends CardImpl { this.toughness = new MageInt(5); // Whenever Rock Basilisk blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat. - this.addAbility(new RockBasiliskTriggeredAbility()); + Effect effect = new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); + effect.setText("destroy that creature at end of combat"); + this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false)); } public RockBasilisk(final RockBasilisk card) { @@ -72,80 +77,3 @@ public class RockBasilisk extends CardImpl { return new RockBasilisk(this); } } - -class RockBasiliskTriggeredAbility extends TriggeredAbilityImpl { - - RockBasiliskTriggeredAbility() { - super(Zone.BATTLEFIELD, new RockBasiliskEffect()); - } - - RockBasiliskTriggeredAbility(final RockBasiliskTriggeredAbility ability) { - super(ability); - } - - @Override - public RockBasiliskTriggeredAbility copy() { - return new RockBasiliskTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.BLOCKER_DECLARED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent blocker = game.getPermanent(event.getSourceId()); - Permanent blocked = game.getPermanent(event.getTargetId()); - Permanent rockBasilisk = game.getPermanent(sourceId); - if (blocker != null && blocker != rockBasilisk - && !blocker.getSubtype().contains("Wall") - && blocked == rockBasilisk) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId())); - return true; - } - if (blocker != null && blocker == rockBasilisk - && !blocked.getSubtype().contains("Wall")) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId())); - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever {this} blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat."; - } -} - -class RockBasiliskEffect extends OneShotEffect { - - RockBasiliskEffect() { - super(Outcome.DestroyPermanent); - staticText = "destroy that creature at end of combat"; - } - - RockBasiliskEffect(final RockBasiliskEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - if (targetCreature != null) { - AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId())); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - return false; - } - - @Override - public RockBasiliskEffect copy() { - return new RockBasiliskEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/mirage/SacredMesa.java b/Mage.Sets/src/mage/sets/mirage/SacredMesa.java index 825bdbc7be6..1f44ac6bc21 100644 --- a/Mage.Sets/src/mage/sets/mirage/SacredMesa.java +++ b/Mage.Sets/src/mage/sets/mirage/SacredMesa.java @@ -35,7 +35,6 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; @@ -43,7 +42,7 @@ import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.PegasusToken; import mage.target.common.TargetControlledPermanent; /** @@ -51,7 +50,7 @@ import mage.target.common.TargetControlledPermanent; * @author emerald000 */ public class SacredMesa extends CardImpl { - + private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Pegasus"); static { filter.add(new SubtypePredicate("Pegasus")); @@ -61,12 +60,11 @@ public class SacredMesa extends CardImpl { super(ownerId, 241, "Sacred Mesa", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); this.expansionSetCode = "MIR"; - // At the beginning of your upkeep, sacrifice Sacred Mesa unless you sacrifice a Pegasus. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(filter))), TargetController.YOU, false)); - + // {1}{W}: Put a 1/1 white Pegasus creature token with flying onto the battlefield. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SacredMesaPegasusToken()), new ManaCostsImpl<>("{1}{W}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new PegasusToken()), new ManaCostsImpl<>("{1}{W}"))); } public SacredMesa(final SacredMesa card) { @@ -78,16 +76,3 @@ public class SacredMesa extends CardImpl { return new SacredMesa(this); } } - -class SacredMesaPegasusToken extends Token { - - SacredMesaPegasusToken() { - super("Pegasus", "1/1 white Pegasus creature token with flying"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Pegasus"); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(FlyingAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/mirage/SapphireCharm.java b/Mage.Sets/src/mage/sets/mirage/SapphireCharm.java new file mode 100644 index 00000000000..187e8399b5f --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/SapphireCharm.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardTargetEffect; +import mage.abilities.effects.common.PhaseOutTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.TargetPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class SapphireCharm extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public SapphireCharm(UUID ownerId) { + super(ownerId, 89, "Sapphire Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "MIR"; + + // Choose one - Target player draws a card at the beginning of the next turn's upkeep; + Effect effect = new DrawCardTargetEffect(1); + effect.setText("Target player draws a card"); + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(effect), true)); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // or target creature gains flying until end of turn; + Mode mode = new Mode(); + mode.getEffects().add(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode); + + // or target creature an opponent controls phases out. + mode = new Mode(); + mode.getEffects().add(new PhaseOutTargetEffect()); + mode.getTargets().add(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addMode(mode); + } + + public SapphireCharm(final SapphireCharm card) { + super(card); + } + + @Override + public SapphireCharm copy() { + return new SapphireCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/SeedlingCharm.java b/Mage.Sets/src/mage/sets/mirage/SeedlingCharm.java new file mode 100644 index 00000000000..8b22af98f7f --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/SeedlingCharm.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Mode; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AttachedToPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SeedlingCharm extends CardImpl { + + private static final FilterPermanent filter1 = new FilterPermanent("Aura attached to a creature"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("green creature"); + + static { + filter1.add(new SubtypePredicate("Aura")); + filter1.add(new AttachedToPredicate(new FilterCreaturePermanent())); + filter2.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public SeedlingCharm(UUID ownerId) { + super(ownerId, 138, "Seedling Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "MIR"; + + // Choose one - Return target Aura attached to a creature to its owner's hand + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter1)); + // or regenerate target green creature + Mode mode = new Mode(); + mode.getEffects().add(new RegenerateTargetEffect()); + mode.getTargets().add(new TargetPermanent(filter2)); + this.getSpellAbility().addMode(mode); + // or target creature gains trample until end of turn. + mode = new Mode(); + mode.getEffects().add(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode); + } + + public SeedlingCharm(final SeedlingCharm card) { + super(card); + } + + @Override + public SeedlingCharm copy() { + return new SeedlingCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/SereneHeart.java b/Mage.Sets/src/mage/sets/mirage/SereneHeart.java new file mode 100644 index 00000000000..bc493242d18 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/SereneHeart.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class SereneHeart extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Auras"); + + static { + filter.add(new SubtypePredicate("Aura")); + } + + public SereneHeart(UUID ownerId) { + super(ownerId, 140, "Serene Heart", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "MIR"; + + // Destroy all Auras. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); + } + + public SereneHeart(final SereneHeart card) { + super(card); + } + + @Override + public SereneHeart copy() { + return new SereneHeart(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/ShallowGrave.java b/Mage.Sets/src/mage/sets/mirage/ShallowGrave.java index b2e00d17bb5..9ee5675fccf 100644 --- a/Mage.Sets/src/mage/sets/mirage/ShallowGrave.java +++ b/Mage.Sets/src/mage/sets/mirage/ShallowGrave.java @@ -44,6 +44,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -57,10 +58,9 @@ public class ShallowGrave extends CardImpl { super(ownerId, 39, "Shallow Grave", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{B}"); this.expansionSetCode = "MIR"; - // Return the top creature card of your graveyard to the battlefield. That creature gains haste until end of turn. Exile it at the beginning of the next end step. this.getSpellAbility().addEffect(new ShallowGraveEffect()); - + } public ShallowGrave(final ShallowGrave card) { @@ -74,46 +74,49 @@ public class ShallowGrave extends CardImpl { } class ShallowGraveEffect extends OneShotEffect { - + public ShallowGraveEffect() { super(Outcome.Benefit); this.staticText = "Return the top creature card of your graveyard to the battlefield. That creature gains haste until end of turn. Exile it at the beginning of the next end step"; } - + public ShallowGraveEffect(final ShallowGraveEffect effect) { super(effect); } - + @Override public ShallowGraveEffect copy() { return new ShallowGraveEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card lastCreatureCard = null; - for (Card card :controller.getGraveyard().getCards(game)) { + for (Card card : controller.getGraveyard().getCards(game)) { if (card.getCardType().contains(CardType.CREATURE)) { lastCreatureCard = card; - } + } } if (lastCreatureCard != null) { - if (controller.putOntoBattlefieldWithInfo(lastCreatureCard, game, Zone.GRAVEYARD, source.getSourceId())) { - FixedTarget fixedTarget = new FixedTarget(lastCreatureCard.getId()); - // Gains Haste - ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); - hasteEffect.setTargetPointer(fixedTarget); - game.addEffect(hasteEffect, source); - // Exile it at end of turn - ExileTargetEffect exileEffect = new ExileTargetEffect(null,"",Zone.BATTLEFIELD); - exileEffect.setTargetPointer(fixedTarget); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + if (controller.moveCards(lastCreatureCard, Zone.BATTLEFIELD, source, game)) { + Permanent returnedCreature = game.getPermanent(lastCreatureCard.getId()); + if (returnedCreature != null) { + FixedTarget fixedTarget = new FixedTarget(returnedCreature, game); + // Gains Haste + ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); + hasteEffect.setTargetPointer(fixedTarget); + game.addEffect(hasteEffect, source); + // Exile it at end of turn + ExileTargetEffect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD); + exileEffect.setTargetPointer(fixedTarget); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } } } return true; diff --git a/Mage.Sets/src/mage/sets/mirage/Shimmer.java b/Mage.Sets/src/mage/sets/mirage/Shimmer.java new file mode 100644 index 00000000000..0f17fa2768d --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/Shimmer.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.ChooseLandTypeEffect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.PhasingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.ChosenSubtypePredicate; + +/** + * + * @author fireshoes + */ +public class Shimmer extends CardImpl { + + public Shimmer(UUID ownerId) { + super(ownerId, 92, "Shimmer", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}"); + this.expansionSetCode = "MIR"; + + // As Shimmer enters the battlefield, choose a land type. + this.addAbility(new AsEntersBattlefieldAbility(new ChooseLandTypeEffect(Outcome.Detriment))); + + // Each land of the chosen type has phasing. + FilterLandPermanent filter = new FilterLandPermanent("Each land of the chosen type"); + filter.add(new ChosenSubtypePredicate(this.getId())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(PhasingAbility.getInstance(), Duration.WhileOnBattlefield, filter, false))); + } + + public Shimmer(final Shimmer card) { + super(card); + } + + @Override + public Shimmer copy() { + return new Shimmer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/SidarJabari.java b/Mage.Sets/src/mage/sets/mirage/SidarJabari.java index ad3b3bc31fe..5334d42ffbf 100644 --- a/Mage.Sets/src/mage/sets/mirage/SidarJabari.java +++ b/Mage.Sets/src/mage/sets/mirage/SidarJabari.java @@ -34,7 +34,6 @@ import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.keyword.FlankingAbility; import mage.cards.CardImpl; -import mage.constants.AbilityType; import mage.constants.CardType; import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; @@ -48,6 +47,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class SidarJabari extends CardImpl { + private final UUID originalId; + public SidarJabari(UUID ownerId) { super(ownerId, 243, "Sidar Jabari", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}"); this.expansionSetCode = "MIR"; @@ -59,20 +60,22 @@ public class SidarJabari extends CardImpl { // Flanking this.addAbility(new FlankingAbility()); - + // Whenever Sidar Jabari attacks, tap target creature defending player controls. Ability ability = new AttacksTriggeredAbility(new TapTargetEffect(), false); ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls"))); + originalId = ability.getOriginalId(); this.addAbility(ability); } public SidarJabari(final SidarJabari card) { super(card); + this.originalId = card.originalId; } - + @Override public void adjustTargets(Ability ability, Game game) { - if (ability.getAbilityType().equals(AbilityType.TRIGGERED)) { + if (ability.getOriginalId().equals(originalId)) { ability.getTargets().clear(); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId()); diff --git a/Mage.Sets/src/mage/sets/mirage/SkulkingGhost.java b/Mage.Sets/src/mage/sets/mirage/SkulkingGhost.java new file mode 100644 index 00000000000..e6c67922517 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/SkulkingGhost.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesTargetTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SkulkingGhost extends CardImpl { + + public SkulkingGhost(UUID ownerId) { + super(ownerId, 41, "Skulking Ghost", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Skulking Ghost becomes the target of a spell or ability, sacrifice it. + this.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect())); + } + + public SkulkingGhost(final SkulkingGhost card) { + super(card); + } + + @Override + public SkulkingGhost copy() { + return new SkulkingGhost(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/Soar.java b/Mage.Sets/src/mage/sets/mirage/Soar.java new file mode 100644 index 00000000000..bcdd172fccd --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/Soar.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SacrificeIfCastAtInstantTimeTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Soar extends CardImpl { + + public Soar(UUID ownerId) { + super(ownerId, 93, "Soar", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Aura"); + + // You may cast Soar as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame))); + this.addAbility(new SacrificeIfCastAtInstantTimeTriggeredAbility()); + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +0/+1 and has flying. + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(0, 1, Duration.WhileOnBattlefield)); + Effect effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has flying"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public Soar(final Soar card) { + super(card); + } + + @Override + public Soar copy() { + return new Soar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/Taniwha.java b/Mage.Sets/src/mage/sets/mirage/Taniwha.java new file mode 100644 index 00000000000..ca2154c5021 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/Taniwha.java @@ -0,0 +1,108 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.PhasingAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledLandPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class Taniwha extends CardImpl { + + public Taniwha(UUID ownerId) { + super(ownerId, 95, "Taniwha", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "MIR"; + this.supertype.add("Legendary"); + this.subtype.add("Serpent"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Phasing + this.addAbility(PhasingAbility.getInstance()); + + // At the beginning of your upkeep, all lands you control phase out. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new TaniwhaEffect(), TargetController.YOU, false)); + } + + public Taniwha(final Taniwha card) { + super(card); + } + + @Override + public Taniwha copy() { + return new Taniwha(this); + } +} + +class TaniwhaEffect extends OneShotEffect { + + public TaniwhaEffect() { + super(Outcome.Detriment); + this.staticText = "all lands you control phase out"; + } + + public TaniwhaEffect(final TaniwhaEffect effect) { + super(effect); + } + + @Override + public TaniwhaEffect copy() { + return new TaniwhaEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterControlledLandPermanent(), controller.getId(), game)) { + permanent.phaseOut(game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/TeekasDragon.java b/Mage.Sets/src/mage/sets/mirage/TeekasDragon.java new file mode 100644 index 00000000000..80f95a882b0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/TeekasDragon.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.RampageAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TeekasDragon extends CardImpl { + + public TeekasDragon(UUID ownerId) { + super(ownerId, 285, "Teeka's Dragon", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{9}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Dragon"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // trample + this.addAbility(TrampleAbility.getInstance()); + // rampage 4 + this.addAbility(new RampageAbility(4)); + } + + public TeekasDragon(final TeekasDragon card) { + super(card); + } + + @Override + public TeekasDragon copy() { + return new TeekasDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/TeferisCurse.java b/Mage.Sets/src/mage/sets/mirage/TeferisCurse.java new file mode 100644 index 00000000000..340d1172f01 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/TeferisCurse.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.PhasingAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class TeferisCurse extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ARTIFACT))); + } + + public TeferisCurse(UUID ownerId) { + super(ownerId, 96, "Teferi's Curse", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Aura"); + + // Enchant artifact or creature + TargetPermanent auraTarget = new TargetPermanent(filter); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted permanent has phasing. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(PhasingAbility.getInstance(), AttachmentType.AURA))); + } + + public TeferisCurse(final TeferisCurse card) { + super(card); + } + + @Override + public TeferisCurse copy() { + return new TeferisCurse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/TelimTorsDarts.java b/Mage.Sets/src/mage/sets/mirage/TelimTorsDarts.java new file mode 100644 index 00000000000..be3802ccd70 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/TelimTorsDarts.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPlayer; + +/** + * + * @author nigelzor + */ +public class TelimTorsDarts extends CardImpl { + + public TelimTorsDarts(UUID ownerId) { + super(ownerId, 286, "Telim'Tor's Darts", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "MIR"; + + // {2}, {tap}: Telim'Tor's Darts deals 1 damage to target player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public TelimTorsDarts(final TelimTorsDarts card) { + super(card); + } + + @Override + public TelimTorsDarts copy() { + return new TelimTorsDarts(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/Thirst.java b/Mage.Sets/src/mage/sets/mirage/Thirst.java new file mode 100644 index 00000000000..bf3c47fce7b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/Thirst.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.effects.common.TapEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Thirst extends CardImpl { + + public Thirst(UUID ownerId) { + super(ownerId, 99, "Thirst", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // When Thirst enters the battlefield, tap enchanted creature. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TapEnchantedEffect())); + // Enchanted creature doesn't untap during its controller's untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect())); + // At the beginning of your upkeep, sacrifice Thirst unless you pay {U}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{U}")), + TargetController.YOU, false)); + } + + public Thirst(final Thirst card) { + super(card); + } + + @Override + public Thirst copy() { + return new Thirst(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/TidalWave.java b/Mage.Sets/src/mage/sets/mirage/TidalWave.java new file mode 100644 index 00000000000..e6c61ac286b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/TidalWave.java @@ -0,0 +1,115 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.Token; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author nigelzor + */ +public class TidalWave extends CardImpl { + + public TidalWave(UUID ownerId) { + super(ownerId, 100, "Tidal Wave", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); + this.expansionSetCode = "MIR"; + + // Put a 5/5 blue Wall creature token with defender onto the battlefield. Sacrifice it at the beginning of the next end step. + this.getSpellAbility().addEffect(new TidalWaveEffect()); + } + + public TidalWave(final TidalWave card) { + super(card); + } + + @Override + public TidalWave copy() { + return new TidalWave(this); + } +} + +class TidalWaveEffect extends OneShotEffect { + + public TidalWaveEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "Put a 5/5 blue Wall creature token with defender onto the battlefield. Sacrifice it at the beginning of the next end step."; + } + + public TidalWaveEffect(TidalWaveEffect effect) { + super(effect); + } + + @Override + public TidalWaveEffect copy() { + return new TidalWaveEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Token token = new WallToken(); + if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect(); + sacrificeEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect), source); + } + } + return true; + } + return false; + } +} + +class WallToken extends Token { + + WallToken() { + super("Wall", "5/5 blue Wall creature token with defender"); + cardType.add(CardType.CREATURE); + color.setBlue(true); + subtype.add("Wall"); + power = new MageInt(5); + toughness = new MageInt(5); + this.addAbility(DefenderAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/TranquilDomain.java b/Mage.Sets/src/mage/sets/mirage/TranquilDomain.java new file mode 100644 index 00000000000..0e3bdd114fb --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/TranquilDomain.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class TranquilDomain extends CardImpl { + + private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("non-Aura enchantments"); + + static { + filter.add(Predicates.not(new SubtypePredicate("Aura"))); + } + + public TranquilDomain(UUID ownerId) { + super(ownerId, 143, "Tranquil Domain", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "MIR"; + + // Destroy all non-Aura enchantments. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); + } + + public TranquilDomain(final TranquilDomain card) { + super(card); + } + + @Override + public TranquilDomain copy() { + return new TranquilDomain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/UnfulfilledDesires.java b/Mage.Sets/src/mage/sets/mirage/UnfulfilledDesires.java new file mode 100644 index 00000000000..7d122a642e2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/UnfulfilledDesires.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawDiscardControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class UnfulfilledDesires extends CardImpl { + + public UnfulfilledDesires(UUID ownerId) { + super(ownerId, 345, "Unfulfilled Desires", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{B}"); + this.expansionSetCode = "MIR"; + + // {1}, Pay 1 life: Draw a card, then discard a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawDiscardControllerEffect(), new ManaCostsImpl("{1}")); + ability.addCost(new PayLifeCost(1)); + this.addAbility(ability); + } + + public UnfulfilledDesires(final UnfulfilledDesires card) { + super(card); + } + + @Override + public UnfulfilledDesires copy() { + return new UnfulfilledDesires(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/UnseenWalker.java b/Mage.Sets/src/mage/sets/mirage/UnseenWalker.java index 79df8370f6a..bf705f63b24 100644 --- a/Mage.Sets/src/mage/sets/mirage/UnseenWalker.java +++ b/Mage.Sets/src/mage/sets/mirage/UnseenWalker.java @@ -59,7 +59,9 @@ public class UnseenWalker extends CardImpl { this.addAbility(new ForestwalkAbility()); // {1}{G}{G}: Target creature gains forestwalk until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new ForestwalkAbility(), Duration.EndOfTurn), new ManaCostsImpl("{1}{G}{G}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new ForestwalkAbility(false), Duration.EndOfTurn), + new ManaCostsImpl("{1}{G}{G}")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/mirage/UnyaroBeeSting.java b/Mage.Sets/src/mage/sets/mirage/UnyaroBeeSting.java new file mode 100644 index 00000000000..1203dbd3163 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/UnyaroBeeSting.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class UnyaroBeeSting extends CardImpl { + + public UnyaroBeeSting(UUID ownerId) { + super(ownerId, 148, "Unyaro Bee Sting", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}"); + this.expansionSetCode = "MIR"; + + // Unyaro Bee Sting deals 2 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(2)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public UnyaroBeeSting(final UnyaroBeeSting card) { + super(card); + } + + @Override + public UnyaroBeeSting copy() { + return new UnyaroBeeSting(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/VaporousDjinn.java b/Mage.Sets/src/mage/sets/mirage/VaporousDjinn.java new file mode 100644 index 00000000000..5d264035798 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/VaporousDjinn.java @@ -0,0 +1,109 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class VaporousDjinn extends CardImpl { + + public VaporousDjinn(UUID ownerId) { + super(ownerId, 101, "Vaporous Djinn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Djinn"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // At the beginning of your upkeep, Vaporous Djinn phases out unless you pay {U}{U}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new VaporousDjinnEffect(), TargetController.YOU, false)); + } + + public VaporousDjinn(final VaporousDjinn card) { + super(card); + } + + @Override + public VaporousDjinn copy() { + return new VaporousDjinn(this); + } +} + +class VaporousDjinnEffect extends OneShotEffect { + + public VaporousDjinnEffect() { + super(Outcome.Damage); + this.staticText = "{this} phases out unless you pay {U}{U}"; + } + + public VaporousDjinnEffect(final VaporousDjinnEffect effect) { + super(effect); + } + + @Override + public VaporousDjinnEffect copy() { + return new VaporousDjinnEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Cost cost = new ManaCostsImpl("{U}{U}"); + String message = "Would you like to pay {U}{U} to prevent {this} from phasing out?"; + if (!(controller.chooseUse(Outcome.Benefit, message, source, game) + && cost.pay(source, game, source.getSourceId(), controller.getId(), false))) { + permanent.phaseOut(game); + } + return true; + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/mirage/VigilantMartyr.java b/Mage.Sets/src/mage/sets/mirage/VigilantMartyr.java new file mode 100644 index 00000000000..c0bfb95c423 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/VigilantMartyr.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.filter.predicate.other.TargetsPermanentPredicate; +import mage.target.TargetSpell; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class VigilantMartyr extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("spell that targets an enchantment"); + + static { + filter.add(new TargetsPermanentPredicate(new FilterEnchantmentPermanent())); + } + + public VigilantMartyr(UUID ownerId) { + super(ownerId, 249, "Vigilant Martyr", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Sacrifice Vigilant Martyr: Regenerate target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + // {W}{W}, {tap}, Sacrifice Vigilant Martyr: Counter target spell that targets an enchantment. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{W}{W}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetSpell(filter)); + this.addAbility(ability); + } + + public VigilantMartyr(final VigilantMartyr card) { + super(card); + } + + @Override + public VigilantMartyr copy() { + return new VigilantMartyr(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/VitalizingCascade.java b/Mage.Sets/src/mage/sets/mirage/VitalizingCascade.java new file mode 100644 index 00000000000..13cb72b880e --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/VitalizingCascade.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.Game; + +/** + * + * @author LoneFox + */ +public class VitalizingCascade extends CardImpl { + + public VitalizingCascade(UUID ownerId) { + super(ownerId, 346, "Vitalizing Cascade", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{X}{G}{W}"); + this.expansionSetCode = "MIR"; + + // You gain X plus 3 life. + this.getSpellAbility().addEffect(new GainLifeEffect(new VitalizingCascadeValue())); + } + + public VitalizingCascade(final VitalizingCascade card) { + super(card); + } + + @Override + public VitalizingCascade copy() { + return new VitalizingCascade(this); + } +} + +class VitalizingCascadeValue extends ManacostVariableValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + return super.calculate(game, sourceAbility, effect) + 3; + } + + @Override + public VitalizingCascadeValue copy() { + return new VitalizingCascadeValue(); + } + + @Override + public String toString() { + return "X plus 3"; + } +} + diff --git a/Mage.Sets/src/mage/sets/mirage/WardOfLights.java b/Mage.Sets/src/mage/sets/mirage/WardOfLights.java new file mode 100644 index 00000000000..844d498701f --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/WardOfLights.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SacrificeIfCastAtInstantTimeTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ChooseColorEffect; +import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashSourceEffect; +import mage.abilities.effects.keyword.ProtectionChosenColorAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class WardOfLights extends CardImpl { + + public WardOfLights(UUID ownerId) { + super(ownerId, 251, "Ward of Lights", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Aura"); + + // You may cast Ward of Lights as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame))); + this.addAbility(new SacrificeIfCastAtInstantTimeTriggeredAbility()); + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // As Ward of Lights enters the battlefield, choose a color. + this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Benefit))); + // Enchanted creature has protection from the chosen color. This effect doesn't remove Ward of Lights. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ProtectionChosenColorAttachedEffect(true))); + } + + public WardOfLights(final WardOfLights card) { + super(card); + } + + @Override + public WardOfLights copy() { + return new WardOfLights(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/WindreaperFalcon.java b/Mage.Sets/src/mage/sets/mirage/WindreaperFalcon.java new file mode 100644 index 00000000000..cc3c7df5956 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/WindreaperFalcon.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; +/** + * + * @author LoneFox + */ +public class WindreaperFalcon extends CardImpl { + + private static final FilterCard filter = new FilterCard("blue"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public WindreaperFalcon(UUID ownerId) { + super(ownerId, 349, "Windreaper Falcon", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{G}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Bird"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // protection from blue + this.addAbility(new ProtectionAbility(filter)); + } + + public WindreaperFalcon(final WindreaperFalcon card) { + super(card); + } + + @Override + public WindreaperFalcon copy() { + return new WindreaperFalcon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/WitheringBoon.java b/Mage.Sets/src/mage/sets/mirage/WitheringBoon.java new file mode 100644 index 00000000000..60bf5a1f635 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/WitheringBoon.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetSpell; + +/** + * + * @author markedagain + */ +public class WitheringBoon extends CardImpl { + private static final FilterSpell filter = new FilterSpell("creature spell"); + + static { + filter.add(new CardTypePredicate(CardType.CREATURE)); + } + public WitheringBoon(UUID ownerId) { + super(ownerId, 50, "Withering Boon", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{B}"); + this.expansionSetCode = "MIR"; + + // As an additional cost to cast Withering Boon, pay 3 life. + this.getSpellAbility().addCost(new PayLifeCost(3)); + // Counter target creature spell. + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + } + + public WitheringBoon(final WitheringBoon card) { + super(card); + } + + @Override + public WitheringBoon copy() { + return new WitheringBoon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/ZuberiGoldenFeather.java b/Mage.Sets/src/mage/sets/mirage/ZuberiGoldenFeather.java new file mode 100644 index 00000000000..26b8e89195a --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/ZuberiGoldenFeather.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author nigelzor + */ +public class ZuberiGoldenFeather extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Griffin", "Griffin creatures"); + + public ZuberiGoldenFeather(UUID ownerId) { + super(ownerId, 255, "Zuberi, Golden Feather", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "MIR"; + this.supertype.add("Legendary"); + this.subtype.add("Griffin"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Other Griffin creatures get +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); + } + + public ZuberiGoldenFeather(final ZuberiGoldenFeather card) { + super(card); + } + + @Override + public ZuberiGoldenFeather copy() { + return new ZuberiGoldenFeather(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/ChaliceOfTheVoid.java b/Mage.Sets/src/mage/sets/mirrodin/ChaliceOfTheVoid.java index 9547ef0150b..4192513f685 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ChaliceOfTheVoid.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ChaliceOfTheVoid.java @@ -29,12 +29,11 @@ package mage.sets.mirrodin; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -58,7 +57,7 @@ public class ChaliceOfTheVoid extends CardImpl { this.expansionSetCode = "MRD"; // Chalice of the Void enters the battlefield with X charge counters on it. - this.addAbility(new EntersBattlefieldAbility(new ChaliceOfTheVoidEffect(), "with X charge counters on it")); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.CHARGE.createInstance()))); // Whenever a player casts a spell with converted mana cost equal to the number of charge counters on Chalice of the Void, counter that spell. this.addAbility(new ChaliceOfTheVoidTriggeredAbility()); @@ -74,47 +73,12 @@ public class ChaliceOfTheVoid extends CardImpl { } } - -class ChaliceOfTheVoidEffect extends OneShotEffect { - public ChaliceOfTheVoidEffect() { - super(Outcome.Benefit); - } - - public ChaliceOfTheVoidEffect(final ChaliceOfTheVoidEffect effect) { - super(effect); - } - - @java.lang.Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); - } - } - } - return true; - } - - @java.lang.Override - public ChaliceOfTheVoidEffect copy() { - return new ChaliceOfTheVoidEffect(this); - } -} - class ChaliceOfTheVoidTriggeredAbility extends TriggeredAbilityImpl { - public ChaliceOfTheVoidTriggeredAbility() { super(Zone.BATTLEFIELD, new CounterEffect()); } - public ChaliceOfTheVoidTriggeredAbility(final ChaliceOfTheVoidTriggeredAbility abiltity) { super(abiltity); } @@ -128,12 +92,12 @@ class ChaliceOfTheVoidTriggeredAbility extends TriggeredAbilityImpl { public boolean checkEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.SPELL_CAST; } - + @java.lang.Override public boolean checkTrigger(GameEvent event, Game game) { Permanent chalice = game.getPermanent(getSourceId()); Spell spell = game.getStack().getSpell(event.getTargetId()); - if(spell != null && chalice != null && spell.getConvertedManaCost() == chalice.getCounters().getCount(CounterType.CHARGE)){ + if (spell != null && chalice != null && spell.getConvertedManaCost() == chalice.getCounters().getCount(CounterType.CHARGE)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } @@ -148,7 +112,6 @@ class ChaliceOfTheVoidTriggeredAbility extends TriggeredAbilityImpl { } } - class CounterEffect extends OneShotEffect { public CounterEffect() { diff --git a/Mage.Sets/src/mage/sets/mirrodin/ChromeMox.java b/Mage.Sets/src/mage/sets/mirrodin/ChromeMox.java index af94a37a999..a480d10d23e 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ChromeMox.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ChromeMox.java @@ -1,205 +1,214 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.mirrodin; - -import java.util.List; -import java.util.UUID; -import mage.Mana; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ManaEffect; -import mage.abilities.mana.SimpleManaAbility; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.FilterCard; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.TargetCard; - -/** - * - * @author Plopman - */ -public class ChromeMox extends CardImpl { - - public ChromeMox(UUID ownerId) { - super(ownerId, 152, "Chrome Mox", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{0}"); - this.expansionSetCode = "MRD"; - - // Imprint - When Chrome Mox enters the battlefield, you may exile a nonartifact, nonland card from your hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new ChromeMoxEffect(), true)); - // {tap}: Add one mana of any of the exiled card's colors to your mana pool. - this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new ChromeMoxManaEffect(), new TapSourceCost())); - } - - public ChromeMox(final ChromeMox card) { - super(card); - } - - @java.lang.Override - public ChromeMox copy() { - return new ChromeMox(this); - } -} - -class ChromeMoxEffect extends OneShotEffect { - - private static final FilterCard filter = new FilterCard("nonartifact, nonland card"); - static { - filter.add(Predicates.not(Predicates.or(new CardTypePredicate(CardType.LAND), new CardTypePredicate(CardType.ARTIFACT)))); - } - public ChromeMoxEffect() { - super(Outcome.Benefit); - staticText = "exile a nonartifact, nonland card from your hand"; - } - - public ChromeMoxEffect(ChromeMoxEffect effect) { - super(effect); - } - - @java.lang.Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player.getHand().size() > 0) { - TargetCard target = new TargetCard(Zone.HAND, filter); - player.choose(Outcome.Benefit, player.getHand(), target, game); - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - card.moveToExile(getId(), "Chrome Mox (Imprint)", source.getSourceId(), game); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.imprint(card.getId(), game); - } - return true; - } - } - return true; - } - - @java.lang.Override - public ChromeMoxEffect copy() { - return new ChromeMoxEffect(this); - } - - -} - -class ChromeMoxManaEffect extends ManaEffect { - - - ChromeMoxManaEffect() { - super(); - staticText = "Add one mana of any of the exiled card's colors to your mana pool"; - } - - ChromeMoxManaEffect(ChromeMoxManaEffect effect) { - super(effect); - } - - - - @java.lang.Override - public ChromeMoxManaEffect copy() { - return new ChromeMoxManaEffect(this); - } - - @java.lang.Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - Player player = game.getPlayer(source.getControllerId()); - if (permanent != null && player != null) { - List imprinted = permanent.getImprinted(); - if (imprinted.size() > 0) { - Card imprintedCard = game.getCard(imprinted.get(0)); - if (imprintedCard != null) { - Choice choice = new ChoiceImpl(true); - choice.setMessage("Pick a mana color"); - ObjectColor color = imprintedCard.getColor(game); - if (color.isBlack()) { - choice.getChoices().add("Black"); - } - if (color.isRed()) { - choice.getChoices().add("Red"); - } - if (color.isBlue()) { - choice.getChoices().add("Blue"); - } - if (color.isGreen()) { - choice.getChoices().add("Green"); - } - if (color.isWhite()) { - choice.getChoices().add("White"); - } - - if (choice.getChoices().size() > 0) { - Mana mana = new Mana(); - if (choice.getChoices().size() == 1) { - choice.setChoice(choice.getChoices().iterator().next()); - } else { - player.choose(outcome, choice, game); - } - if (choice.getChoice().equals("Black")) { - player.getManaPool().addMana(Mana.BlackMana, game, source); - } else if (choice.getChoice().equals("Blue")) { - player.getManaPool().addMana(Mana.BlueMana, game, source); - } else if (choice.getChoice().equals("Red")) { - player.getManaPool().addMana(Mana.RedMana, game, source); - } else if (choice.getChoice().equals("Green")) { - player.getManaPool().addMana(Mana.GreenMana, game, source); - } else if (choice.getChoice().equals("White")) { - player.getManaPool().addMana(Mana.WhiteMana, game, source); - } else if (choice.getChoice().equals("Colorless")) { - player.getManaPool().addMana(Mana.ColorlessMana, game, source); - } - checkToFirePossibleEvents(mana, game, source); - player.getManaPool().addMana(mana, game, source); - } - } - } - } - return true; - } - - @java.lang.Override - public Mana getMana(Game game, Ability source) { - return null; - } - -} \ No newline at end of file +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirrodin; + +import java.util.List; +import java.util.UUID; +import mage.MageObject; +import mage.Mana; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ManaEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetCard; +import mage.util.CardUtil; +import mage.util.GameLog; + +/** + * + * @author Plopman + */ +public class ChromeMox extends CardImpl { + + public ChromeMox(UUID ownerId) { + super(ownerId, 152, "Chrome Mox", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{0}"); + this.expansionSetCode = "MRD"; + + // Imprint - When Chrome Mox enters the battlefield, you may exile a nonartifact, nonland card from your hand. + this.addAbility(new EntersBattlefieldTriggeredAbility(new ChromeMoxEffect(), true)); + // {tap}: Add one mana of any of the exiled card's colors to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new ChromeMoxManaEffect(), new TapSourceCost())); + } + + public ChromeMox(final ChromeMox card) { + super(card); + } + + @java.lang.Override + public ChromeMox copy() { + return new ChromeMox(this); + } +} + +class ChromeMoxEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("nonartifact, nonland card"); + + static { + filter.add(Predicates.not(Predicates.or(new CardTypePredicate(CardType.LAND), new CardTypePredicate(CardType.ARTIFACT)))); + } + + public ChromeMoxEffect() { + super(Outcome.Benefit); + staticText = "exile a nonartifact, nonland card from your hand"; + } + + public ChromeMoxEffect(ChromeMoxEffect effect) { + super(effect); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + TargetCard target = new TargetCard(Zone.HAND, filter); + target.setNotTarget(true); + Card cardToImprint = null; + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (controller.getHand().size() > 0 && controller.choose(Outcome.Benefit, target, source.getSourceId(), game)) { + cardToImprint = controller.getHand().get(target.getFirstTarget(), game); + } + if (sourcePermanent != null) { + if (cardToImprint != null) { + controller.moveCardsToExile(cardToImprint, source, game, true, source.getSourceId(), sourceObject.getIdName() + " (Imprint)"); + sourcePermanent.imprint(cardToImprint.getId(), game); + sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - " + GameLog.getColoredObjectIdNameForTooltip(cardToImprint) + "]"), game); + } else { + sourcePermanent.addInfo("imprint", CardUtil.addToolTipMarkTags("[Imprinted card - None]"), game); + } + } + return true; + + } + return false; + } + + @java.lang.Override + public ChromeMoxEffect copy() { + return new ChromeMoxEffect(this); + } + +} + +class ChromeMoxManaEffect extends ManaEffect { + + ChromeMoxManaEffect() { + super(); + staticText = "Add one mana of any of the exiled card's colors to your mana pool"; + } + + ChromeMoxManaEffect(ChromeMoxManaEffect effect) { + super(effect); + } + + @java.lang.Override + public ChromeMoxManaEffect copy() { + return new ChromeMoxManaEffect(this); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + Player player = game.getPlayer(source.getControllerId()); + if (permanent != null && player != null) { + List imprinted = permanent.getImprinted(); + if (imprinted.size() > 0) { + Card imprintedCard = game.getCard(imprinted.get(0)); + if (imprintedCard != null) { + Choice choice = new ChoiceImpl(true); + choice.setMessage("Pick a mana color"); + ObjectColor color = imprintedCard.getColor(game); + if (color.isBlack()) { + choice.getChoices().add("Black"); + } + if (color.isRed()) { + choice.getChoices().add("Red"); + } + if (color.isBlue()) { + choice.getChoices().add("Blue"); + } + if (color.isGreen()) { + choice.getChoices().add("Green"); + } + if (color.isWhite()) { + choice.getChoices().add("White"); + } + + if (choice.getChoices().size() > 0) { + Mana mana = new Mana(); + if (choice.getChoices().size() == 1) { + choice.setChoice(choice.getChoices().iterator().next()); + } else { + player.choose(outcome, choice, game); + } + if (choice.getChoice().equals("Black")) { + player.getManaPool().addMana(Mana.BlackMana, game, source); + } else if (choice.getChoice().equals("Blue")) { + player.getManaPool().addMana(Mana.BlueMana, game, source); + } else if (choice.getChoice().equals("Red")) { + player.getManaPool().addMana(Mana.RedMana, game, source); + } else if (choice.getChoice().equals("Green")) { + player.getManaPool().addMana(Mana.GreenMana, game, source); + } else if (choice.getChoice().equals("White")) { + player.getManaPool().addMana(Mana.WhiteMana, game, source); + } else if (choice.getChoice().equals("Colorless")) { + player.getManaPool().addMana(Mana.ColorlessMana, game, source); + } + checkToFirePossibleEvents(mana, game, source); + player.getManaPool().addMana(mana, game, source); + } + } + } + } + return true; + } + + @java.lang.Override + public Mana getMana(Game game, Ability source) { + return null; + } + +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/Detonate.java b/Mage.Sets/src/mage/sets/mirrodin/Detonate.java new file mode 100644 index 00000000000..3a24b785993 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/Detonate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirrodin; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Detonate extends mage.sets.fifthedition.Detonate { + + public Detonate(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "MRD"; + } + + public Detonate(final Detonate card) { + super(card); + } + + @java.lang.Override + public Detonate copy() { + return new Detonate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/DrossScorpion.java b/Mage.Sets/src/mage/sets/mirrodin/DrossScorpion.java new file mode 100644 index 00000000000..727d367e7f9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/DrossScorpion.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirrodin; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author fireshoes + */ +public class DrossScorpion extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + + public DrossScorpion(UUID ownerId) { + super(ownerId, 164, "Dross Scorpion", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "MRD"; + this.subtype.add("Scorpion"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Whenever Dross Scorpion or another artifact creature dies, you may untap target artifact. + Ability ability = new DiesThisOrAnotherCreatureTriggeredAbility(new UntapTargetEffect(), true, filter); + ability.addTarget(new TargetArtifactPermanent()); + this.addAbility(ability); + } + + public DrossScorpion(final DrossScorpion card) { + super(card); + } + + @java.lang.Override + public DrossScorpion copy() { + return new DrossScorpion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/Fatespinner.java b/Mage.Sets/src/mage/sets/mirrodin/Fatespinner.java new file mode 100644 index 00000000000..344f8ac9b3b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/Fatespinner.java @@ -0,0 +1,168 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirrodin; + +import java.util.HashSet; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author LoneFox + */ +public class Fatespinner extends CardImpl { + + public Fatespinner(UUID ownerId) { + super(ownerId, 36, "Fatespinner", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "MRD"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // At the beginning of each opponent's upkeep, that player chooses draw step, main phase, or combat phase. The player skips each instance of the chosen step or phase this turn. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new FatespinnerChooseEffect(), + TargetController.OPPONENT, false, true)); + } + + public Fatespinner(final Fatespinner card) { + super(card); + } + + @java.lang.Override + public Fatespinner copy() { + return new Fatespinner(this); + } +} + +class FatespinnerChooseEffect extends OneShotEffect { + + private static final HashSet choices = new HashSet<>(); + + static { + choices.add("Draw step"); + choices.add("Main phase"); + choices.add("Combat phase"); + } + + public FatespinnerChooseEffect() { + super(Outcome.Detriment); + staticText = "At the beginning of each opponent's upkeep, that player chooses draw step, main phase, or combat phase. The player skips each instance of the chosen step or phase this turn."; + } + + public FatespinnerChooseEffect(final FatespinnerChooseEffect effect) { + super(effect); + } + + @java.lang.Override + public FatespinnerChooseEffect copy() { + return new FatespinnerChooseEffect(this); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); + if(player != null) { + Choice choice = new ChoiceImpl(true); + choice.setMessage("Choose phase or step to skip"); + choice.setChoices(choices); + while(!player.choose(outcome, choice, game)) { + if(player.canRespond()) { + return false; + } + } + String chosenPhase = choice.getChoice(); + game.informPlayers(player.getLogName() + " has chosen to skip " + chosenPhase.toLowerCase() + "."); + game.addEffect(new FatespinnerSkipEffect(chosenPhase), source); + return true; + } + return false; + } +} + +class FatespinnerSkipEffect extends ReplacementEffectImpl { + + private final String phase; + + public FatespinnerSkipEffect(String phase) { + super(Duration.EndOfTurn, Outcome.Detriment); + this.phase = phase; + } + + public FatespinnerSkipEffect(final FatespinnerSkipEffect effect) { + super(effect); + this.phase = effect.phase; + } + + @java.lang.Override + public FatespinnerSkipEffect copy() { + return new FatespinnerSkipEffect(this); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + return true; + } + + @java.lang.Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + EventType type = event.getType(); + return ((phase.equals("Draw step") && type == EventType.DRAW_STEP) + || (phase.equals("Main phase") && (type == EventType.PRECOMBAT_MAIN_PHASE || type == EventType.POSTCOMBAT_MAIN_PHASE)) + || (phase.equals("Combat phase") && type == EventType.COMBAT_PHASE)); + } + + @java.lang.Override + public boolean checksEventType(GameEvent event, Game game) { + EventType type = event.getType(); + return (type == EventType.DRAW_STEP || type == EventType.PRECOMBAT_MAIN_PHASE + || type == EventType.POSTCOMBAT_MAIN_PHASE || type == EventType.COMBAT_PHASE); + } + + @java.lang.Override + public boolean applies(GameEvent event, Ability source, Game game) { + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/GridMonitor.java b/Mage.Sets/src/mage/sets/mirrodin/GridMonitor.java new file mode 100644 index 00000000000..7ef1888e8c9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/GridMonitor.java @@ -0,0 +1,103 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirrodin; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author fireshoes + */ +public class GridMonitor extends CardImpl { + + public GridMonitor(UUID ownerId) { + super(ownerId, 183, "Grid Monitor", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "MRD"; + this.subtype.add("Construct"); + this.power = new MageInt(4); + this.toughness = new MageInt(6); + + // You can't cast creature spells. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GridMonitorEffect())); + } + + public GridMonitor(final GridMonitor card) { + super(card); + } + + @java.lang.Override + public GridMonitor copy() { + return new GridMonitor(this); + } +} + +class GridMonitorEffect extends ContinuousRuleModifyingEffectImpl { + + public GridMonitorEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "You can't cast creature spells"; + } + + public GridMonitorEffect(final GridMonitorEffect effect) { + super(effect); + } + + @java.lang.Override + public GridMonitorEffect copy() { + return new GridMonitorEffect(this); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + return true; + } + + @java.lang.Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.CAST_SPELL && event.getPlayerId().equals(source.getControllerId())) { + MageObject object = game.getObject(event.getSourceId()); + if (object.getCardType().contains(CardType.CREATURE)) { + return true; + } + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirrodin/InciteWar.java b/Mage.Sets/src/mage/sets/mirrodin/InciteWar.java index b7635f2125e..d646a4430e0 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/InciteWar.java +++ b/Mage.Sets/src/mage/sets/mirrodin/InciteWar.java @@ -48,18 +48,19 @@ import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; +import mage.watchers.common.AttackedThisTurnWatcher; /** * * @author fireshoes */ public class InciteWar extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control"); static { filter.add(new ControllerPredicate(TargetController.YOU)); - } + } public InciteWar(UUID ownerId) { super(ownerId, 96, "Incite War", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); @@ -68,12 +69,13 @@ public class InciteWar extends CardImpl { // Choose one - Creatures target player controls attack this turn if able; this.getSpellAbility().addEffect(new InciteWarMustAttackEffect()); this.getSpellAbility().addTarget(new TargetPlayer()); - + this.getSpellAbility().addWatcher(new AttackedThisTurnWatcher()); + // or creatures you control gain first strike until end of turn. Mode mode = new Mode(); mode.getEffects().add(new GainAbilityAllEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, filter)); this.getSpellAbility().getModes().addMode(mode); - + // Entwine {2} this.addAbility(new EntwineAbility("{2}")); } @@ -91,7 +93,7 @@ public class InciteWar extends CardImpl { class InciteWarMustAttackEffect extends OneShotEffect { public InciteWarMustAttackEffect() { - super(Outcome.Detriment); + super(Outcome.Detriment); staticText = "Creatures target player control attack this turn if able"; } @@ -116,4 +118,4 @@ class InciteWarMustAttackEffect extends OneShotEffect { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/IsochronScepter.java b/Mage.Sets/src/mage/sets/mirrodin/IsochronScepter.java index 182669babf1..e4eb8d30835 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/IsochronScepter.java +++ b/Mage.Sets/src/mage/sets/mirrodin/IsochronScepter.java @@ -28,11 +28,6 @@ package mage.sets.mirrodin; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -41,6 +36,10 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -50,6 +49,7 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetCard; import mage.util.CardUtil; +import org.apache.log4j.Logger; /** * @@ -84,7 +84,8 @@ public class IsochronScepter extends CardImpl { class IsochronScepterImprintEffect extends OneShotEffect { private static final FilterCard filter = new FilterCard("instant card with converted mana cost 2 or less from your hand"); - static { + + static { filter.add(new CardTypePredicate(CardType.INSTANT)); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 3)); } @@ -109,7 +110,7 @@ class IsochronScepterImprintEffect extends OneShotEffect { && controller.choose(Outcome.Benefit, controller.getHand(), target, game)) { Card card = controller.getHand().get(target.getFirstTarget(), game); if (card != null) { - controller.moveCardToExileWithInfo(card, source.getSourceId(), sourcePermanent.getIdName() +" (Imprint)", source.getSourceId(), game, Zone.HAND, true); + controller.moveCardToExileWithInfo(card, source.getSourceId(), sourcePermanent.getIdName() + " (Imprint)", source.getSourceId(), game, Zone.HAND, true); Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { permanent.imprint(card.getId(), game); @@ -121,7 +122,7 @@ class IsochronScepterImprintEffect extends OneShotEffect { return true; } return false; - + } @java.lang.Override @@ -158,10 +159,14 @@ class IsochronScepterCopyEffect extends OneShotEffect { if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append("?").toString(), source, game)) { Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId()); if (copiedCard != null) { - game.getExile().add(source.getSourceId(), "",copiedCard); + game.getExile().add(source.getSourceId(), "", copiedCard); game.getState().setZone(copiedCard.getId(), Zone.EXILED); if (controller.chooseUse(outcome, "Cast the copied card without paying mana cost?", source, game)) { - controller.cast(copiedCard.getSpellAbility(), game, true); + if (copiedCard.getSpellAbility() != null) { + controller.cast(copiedCard.getSpellAbility(), game, true); + } else { + Logger.getLogger(IsochronScepterCopyEffect.class).error("Isochron Scepter: spell ability == null " + copiedCard.getName()); + } } } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/JinxedChoker.java b/Mage.Sets/src/mage/sets/mirrodin/JinxedChoker.java new file mode 100644 index 00000000000..9ce1f78d594 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/JinxedChoker.java @@ -0,0 +1,180 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirrodin; + +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; +import mage.abilities.common.OnEventTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.counter.RemoveCounterSourceEffect; +import mage.cards.CardImpl; +import mage.constants.*; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +import java.lang.Override; +import java.util.UUID; + +/** + * + * @author andyfries + */ + +public class JinxedChoker extends CardImpl { + + public JinxedChoker(UUID ownerId) { + super(ownerId, 189, "Jinxed Choker", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "MRD"; + + // At the beginning of your end step, target opponent gains control of Jinxed Choker and puts a charge counter on it. + Ability endStepAbility = new BeginningOfYourEndStepTriggeredAbility(new JinxedChokerChangeControllerEffect(), false); + endStepAbility.addTarget(new TargetOpponent()); + + AddCountersSourceEffect addCountersSourceEffect = new AddCountersSourceEffect(CounterType.CHARGE.createInstance()); + addCountersSourceEffect.setText(""); + endStepAbility.addEffect(addCountersSourceEffect); + this.addAbility(endStepAbility); + + // At the beginning of your upkeep, Jinxed Choker deals damage to you equal to the number of charge counters on it. + Ability upkeepAbility = new OnEventTriggeredAbility(GameEvent.EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new DamageControllerEffect(new JinxedChokerDynamicValue()), false); + this.addAbility(upkeepAbility); + + // {3}: Put a charge counter on Jinxed Choker or remove one from it. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new JinxedChokerCounterEffect(), new ManaCostsImpl("{3}")); + this.addAbility(ability); + } + + public JinxedChoker(final JinxedChoker card) { + super(card); + } + + @Override + public JinxedChoker copy() { + return new JinxedChoker(this); + } +} + +class JinxedChokerChangeControllerEffect extends ContinuousEffectImpl { + + public JinxedChokerChangeControllerEffect() { + super(Duration.Custom, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); + staticText = "target opponent gains control of {this} and puts a charge counter on it"; + } + + public JinxedChokerChangeControllerEffect(final JinxedChokerChangeControllerEffect effect) { + super(effect); + } + + @Override + public JinxedChokerChangeControllerEffect copy() { + return new JinxedChokerChangeControllerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game); + if (permanent != null) { + return permanent.changeControllerId(source.getFirstTarget(), game); + } else { + discard(); + } + return false; + } + +} + +class JinxedChokerDynamicValue implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Permanent permanent = game.getPermanent(sourceAbility.getSourceId()); + + int count = 0; + if (permanent != null){ + count = permanent.getCounters().getCount(CounterType.CHARGE); + } + return count; + } + + @Override + public JinxedChokerDynamicValue copy() { + return new JinxedChokerDynamicValue(); + } + + @Override + public String getMessage() { + return "charge counter on it"; + } + + @Override + public String toString() { + return "1"; + } +} + +class JinxedChokerCounterEffect extends OneShotEffect { + + public JinxedChokerCounterEffect() { + super(Outcome.Detriment); + this.staticText = "Put a charge counter on {this} or remove one from it"; + } + + public JinxedChokerCounterEffect(final JinxedChokerCounterEffect effect) { + super(effect); + } + + @Override + public JinxedChokerCounterEffect copy() { + return new JinxedChokerCounterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (controller != null && sourcePermanent != null) { + if (!sourcePermanent.getCounters().containsKey(CounterType.CHARGE) || controller.chooseUse(outcome, "Put a charge counter on? (No removes one)", source, game)) { + return new AddCountersSourceEffect(CounterType.CHARGE.createInstance(), true).apply(game, source); + } else { + return new RemoveCounterSourceEffect(CounterType.CHARGE.createInstance()).apply(game, source); + } + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirrodin/Leveler.java b/Mage.Sets/src/mage/sets/mirrodin/Leveler.java new file mode 100644 index 00000000000..e76e9b346e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/Leveler.java @@ -0,0 +1,96 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirrodin; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class Leveler extends CardImpl { + + public Leveler(UUID ownerId) { + super(ownerId, 195, "Leveler", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); + this.expansionSetCode = "MRD"; + this.subtype.add("Juggernaut"); + this.power = new MageInt(10); + this.toughness = new MageInt(10); + + // When Leveler enters the battlefield, exile all cards from your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new LevelerExileLibraryEffect(), false)); + } + + public Leveler(final Leveler card) { + super(card); + } + + @java.lang.Override + public Leveler copy() { + return new Leveler(this); + } +} + +class LevelerExileLibraryEffect extends OneShotEffect { + + public LevelerExileLibraryEffect() { + super(Outcome.Exile); + staticText = "exile all cards from your library"; + } + + @java.lang.Override + public LevelerExileLibraryEffect copy() { + return new LevelerExileLibraryEffect(); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int count = controller.getLibrary().size(); + Cards cards = new CardsImpl(); + cards.addAll(controller.getLibrary().getTopCards(game, count)); + controller.moveCards(cards, Zone.LIBRARY, Zone.EXILED, source, game); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/NimDevourer.java b/Mage.Sets/src/mage/sets/mirrodin/NimDevourer.java index b66386c5280..cce49286673 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/NimDevourer.java +++ b/Mage.Sets/src/mage/sets/mirrodin/NimDevourer.java @@ -30,9 +30,10 @@ package mage.sets.mirrodin; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.IsStepCondition; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; @@ -42,6 +43,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.PhaseStep; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; @@ -76,7 +78,10 @@ public class NimDevourer extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new PermanentsOnBattlefieldCount(filter), new StaticValue(0), Duration.WhileOnBattlefield))); // {B}{B}: Return Nim Devourer from your graveyard to the battlefield, then sacrifice a creature. Activate this ability only during your upkeep. - Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(), new ManaCostsImpl("{B}{B}")); + Ability ability = new ConditionalActivatedAbility(Zone.GRAVEYARD, + new ReturnSourceFromGraveyardToBattlefieldEffect(), + new ManaCostsImpl("{B}{B}"), + new IsStepCondition(PhaseStep.UPKEEP), null); ability.addEffect(new NimDevourerEffect()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/mirrodin/PearlShard.java b/Mage.Sets/src/mage/sets/mirrodin/PearlShard.java new file mode 100644 index 00000000000..de7459c3113 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/PearlShard.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirrodin; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class PearlShard extends CardImpl { + + public PearlShard(UUID ownerId) { + super(ownerId, 225, "Pearl Shard", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "MRD"; + + // {3}, {tap} or {W}, {tap}: Prevent the next 2 damage that would be dealt to target creature or player this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 2), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 2), new ManaCostsImpl("{W}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public PearlShard(final PearlShard card) { + super(card); + } + + @java.lang.Override + public PearlShard copy() { + return new PearlShard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/ProteusStaff.java b/Mage.Sets/src/mage/sets/mirrodin/ProteusStaff.java index 7cfbf933b62..eaf8987852c 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ProteusStaff.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ProteusStaff.java @@ -76,21 +76,21 @@ public class ProteusStaff extends CardImpl { } class ProteusStaffEffect extends OneShotEffect { - + ProteusStaffEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "Put target creature on the bottom of its owner's library. That creature's controller reveals cards from the top of his or her library until he or she reveals a creature card. The player puts that card onto the battlefield and the rest on the bottom of his or her library in any order."; } - + ProteusStaffEffect(final ProteusStaffEffect effect) { super(effect); } - + @java.lang.Override public ProteusStaffEffect copy() { return new ProteusStaffEffect(this); } - + @java.lang.Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); @@ -100,7 +100,7 @@ class ProteusStaffEffect extends OneShotEffect { if (owner != null && controller != null) { // Put target creature on the bottom of its owner's library. owner.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, false, true); - + // That creature's controller reveals cards from the top of his or her library until he or she reveals a creature card. Cards cards = new CardsImpl(); while (controller.getLibrary().size() > 0) { @@ -108,16 +108,15 @@ class ProteusStaffEffect extends OneShotEffect { if (card != null) { if (card.getCardType().contains(CardType.CREATURE)) { // The player puts that card onto the battlefield - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); break; - } - else { + } else { cards.add(card); } } } controller.revealCards("Proteus Staff", cards, game); - + // and the rest on the bottom of his or her library in any order. while (cards.size() > 0 && controller.canRespond()) { if (cards.size() == 1) { @@ -125,9 +124,8 @@ class ProteusStaffEffect extends OneShotEffect { if (card != null) { controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, false, false); cards.remove(card); - } - } - else { + } + } else { TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put on bottom of your library (last chosen will be on bottom)")); controller.choose(Outcome.Neutral, cards, target, game); Card card = cards.get(target.getFirstTarget(), game); diff --git a/Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java b/Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java index a0b0f53927a..67e45f89c1a 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java @@ -158,8 +158,7 @@ class ScytheOfTheWretchedReanimateEffect extends OneShotEffect { Card card = game.getCard(getTargetPointer().getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); if (card != null && controller != null) { - Zone currentZone = game.getState().getZone(card.getId()); - controller.putOntoBattlefieldWithInfo(card, game, currentZone, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); Effect effect = new AttachEffect(Outcome.AddAbility); effect.setTargetPointer(new FixedTarget(card.getId())); effect.apply(game, source); diff --git a/Mage.Sets/src/mage/sets/mirrodin/SoulFoundry.java b/Mage.Sets/src/mage/sets/mirrodin/SoulFoundry.java index 0ae3d362a29..801eaf76dca 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/SoulFoundry.java +++ b/Mage.Sets/src/mage/sets/mirrodin/SoulFoundry.java @@ -37,6 +37,7 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; @@ -47,9 +48,9 @@ import mage.filter.FilterCard; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.players.Player; import mage.target.TargetCard; +import mage.target.targetpointer.FixedTarget; import mage.util.CardUtil; /** @@ -175,9 +176,9 @@ class SoulFoundryEffect extends OneShotEffect { Card imprinted = game.getCard(soulFoundry.getImprinted().get(0)); if (imprinted != null && game.getState().getZone(imprinted.getId()).equals(Zone.EXILED)) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(imprinted); - return token.putOntoBattlefield(1, game, source.getSourceId(), controller.getId()); + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); + effect.setTargetPointer(new FixedTarget(imprinted.getId(), imprinted.getZoneChangeCounter(game))); + return effect.apply(game, source); } } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/SpellweaverHelix.java b/Mage.Sets/src/mage/sets/mirrodin/SpellweaverHelix.java new file mode 100644 index 00000000000..e83b0afe794 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/SpellweaverHelix.java @@ -0,0 +1,231 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirrodin; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.common.TargetCardInASingleGraveyard; +import mage.target.targetpointer.FixedTarget; +import mage.util.CardUtil; + +/** + * + * @author emerald000 + */ +public class SpellweaverHelix extends CardImpl { + + private static final FilterCard filter = new FilterCard("sorcery cards from a single graveyard"); + static { + filter.add(new CardTypePredicate(CardType.SORCERY)); + } + + public SpellweaverHelix(UUID ownerId) { + super(ownerId, 247, "Spellweaver Helix", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "MRD"; + + // Imprint - When Spellweaver Helix enters the battlefield, you may exile two target sorcery cards from a single graveyard. + Ability ability = new EntersBattlefieldTriggeredAbility(new SpellweaverHelixImprintEffect(), true, "Imprint — "); + ability.addTarget(new TargetCardInASingleGraveyard(2, 2, filter)); + this.addAbility(ability); + + // Whenever a player casts a card, if it has the same name as one of the cards exiled with Spellweaver Helix, you may copy the other. If you do, you may cast the copy without paying its mana cost. + this.addAbility(new SpellweaverHelixTriggeredAbility()); + } + + public SpellweaverHelix(final SpellweaverHelix card) { + super(card); + } + + @java.lang.Override + public SpellweaverHelix copy() { + return new SpellweaverHelix(this); + } +} + +class SpellweaverHelixImprintEffect extends OneShotEffect { + + SpellweaverHelixImprintEffect() { + super(Outcome.Exile); + this.staticText = "you may exile two target sorcery cards from a single graveyard"; + } + + SpellweaverHelixImprintEffect(final SpellweaverHelixImprintEffect effect) { + super(effect); + } + + @java.lang.Override + public SpellweaverHelixImprintEffect copy() { + return new SpellweaverHelixImprintEffect(this); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + for (UUID targetId : this.getTargetPointer().getTargets(game, source)) { + Card card = game.getCard(targetId); + if (card != null) { + controller.moveCardsToExile(card, source, game, true, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), source.getSourceObject(game).getIdName()); + if (sourcePermanent != null) { + sourcePermanent.imprint(targetId, game); + } + } + } + return true; + } + return false; + } +} + +class SpellweaverHelixTriggeredAbility extends TriggeredAbilityImpl { + + SpellweaverHelixTriggeredAbility() { + super(Zone.BATTLEFIELD, new SpellweaverHelixCastEffect(), false); + } + + SpellweaverHelixTriggeredAbility(final SpellweaverHelixTriggeredAbility ability) { + super(ability); + } + + @java.lang.Override + public SpellweaverHelixTriggeredAbility copy() { + return new SpellweaverHelixTriggeredAbility(this); + } + + @java.lang.Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST; + } + + @java.lang.Override + public boolean checkTrigger(GameEvent event, Game game) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getCard() != null && !spell.getCard().isCopy()) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(spell.getId())); + } + return true; + } + return false; + } + + @java.lang.Override + public boolean checkInterveningIfClause(Game game) { + Spell spell = game.getStack().getSpell(this.getEffects().get(0).getTargetPointer().getFirst(game, this)); + if (spell != null) { + String spellName = spell.getName(); + Permanent sourcePermanent = game.getPermanent(this.getSourceId()); + if (sourcePermanent != null) { + for (UUID imprintId : sourcePermanent.getImprinted()) { + Card card = game.getCard(imprintId); + if (card != null && card.getName().equals(spellName)) { + ((SpellweaverHelixCastEffect) this.getEffects().get(0)).setSpellName(spellName); + return true; + } + } + } + } + return false; + } + + @java.lang.Override + public String getRule() { + return "Whenever a player casts a card, if it has the same name as one of the cards exiled with Spellweaver Helix, you may copy the other. If you do, you may cast the copy without paying its mana cost."; + } +} + +class SpellweaverHelixCastEffect extends OneShotEffect { + + private String spellName = ""; + + SpellweaverHelixCastEffect() { + super(Outcome.Benefit); + this.staticText = "you may copy the other. If you do, you may cast the copy without paying its mana cost"; + } + + SpellweaverHelixCastEffect(final SpellweaverHelixCastEffect effect) { + super(effect); + this.spellName = effect.spellName; + } + + @java.lang.Override + public SpellweaverHelixCastEffect copy() { + return new SpellweaverHelixCastEffect(this); + } + + public void setSpellName(String spellName) { + this.spellName = spellName; + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (sourcePermanent != null) { + boolean foundSpellWithSameName = false; + for (UUID imprintId : sourcePermanent.getImprinted()) { + Card card = game.getCard(imprintId); + if (card != null) { + if (!foundSpellWithSameName && card.getName().equals(spellName)) { + foundSpellWithSameName = true; + } + else { + if (controller.chooseUse(Outcome.Copy, "Copy " + card.getIdName(), source, game)) { + Card copy = game.copyCard(card, source, source.getControllerId()); + if (controller.chooseUse(Outcome.PlayForFree, "Cast " + copy.getIdName() + " without paying its mana cost?", source, game)) { + controller.cast(copy.getSpellAbility(), game, true); + } + } + } + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/ViridianLongbow.java b/Mage.Sets/src/mage/sets/mirrodin/ViridianLongbow.java new file mode 100644 index 00000000000..785498a0619 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/ViridianLongbow.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mirrodin; + +import java.util.UUID; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class ViridianLongbow extends CardImpl { + + public ViridianLongbow(UUID ownerId) { + super(ownerId, 270, "Viridian Longbow", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "MRD"; + this.subtype.add("Equipment"); + + // Equipped creature has "{tap}: This creature deals 1 damage to target creature or player." + Effect effect = new DamageTargetEffect(1); + effect.setText("This creature deals 1 damage to target creature or player"); + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability, AttachmentType.EQUIPMENT))); + + // Equip {3} + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); + } + + public ViridianLongbow(final ViridianLongbow card) { + super(card); + } + + @java.lang.Override + public ViridianLongbow copy() { + return new ViridianLongbow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java index 738f32b57bf..6dc9c35fac7 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.mirrodinbesieged; import java.util.UUID; @@ -47,18 +46,22 @@ import mage.game.events.GameEvent.EventType; */ public class ConsecratedSphinx extends CardImpl { - public ConsecratedSphinx (UUID ownerId) { + public ConsecratedSphinx(UUID ownerId) { super(ownerId, 21, "Consecrated Sphinx", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); this.expansionSetCode = "MBS"; this.subtype.add("Sphinx"); this.power = new MageInt(4); this.toughness = new MageInt(6); + + // Flying this.addAbility(FlyingAbility.getInstance()); + + // Whenever an opponent draws a card, you may draw two cards. this.addAbility(new ConsecratedSphinxTriggeredAbility()); } - public ConsecratedSphinx (final ConsecratedSphinx card) { + public ConsecratedSphinx(final ConsecratedSphinx card) { super(card); } @@ -70,6 +73,7 @@ public class ConsecratedSphinx extends CardImpl { } class ConsecratedSphinxTriggeredAbility extends TriggeredAbilityImpl { + ConsecratedSphinxTriggeredAbility() { super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(2), true); } @@ -95,6 +99,6 @@ class ConsecratedSphinxTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Whenever an opponent draws a card, you may draw two cards"; + return "Whenever an opponent draws a card, you may draw two cards."; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/CorruptedConscience.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/CorruptedConscience.java index 74adb82e243..c26e3cff44c 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/CorruptedConscience.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/CorruptedConscience.java @@ -25,12 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.mirrodinbesieged; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; @@ -39,6 +36,11 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.InfectAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -48,21 +50,26 @@ import mage.target.common.TargetCreaturePermanent; */ public class CorruptedConscience extends CardImpl { - public CorruptedConscience (UUID ownerId) { + public CorruptedConscience(UUID ownerId) { super(ownerId, 22, "Corrupted Conscience", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}"); this.expansionSetCode = "MBS"; this.subtype.add("Aura"); + // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); + + // You control enchanted creature. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); + + // Enchanted creature has infect. (It deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.) this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(InfectAbility.getInstance(), AttachmentType.AURA))); } - public CorruptedConscience (final CorruptedConscience card) { + public CorruptedConscience(final CorruptedConscience card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java index 64202e88ca3..cb57582bc57 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java @@ -25,17 +25,19 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.mirrodinbesieged; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; @@ -43,12 +45,11 @@ import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; import mage.util.functions.ApplyToPermanent; -import java.util.UUID; - /** * @author Loki */ public class Cryptoplasm extends CardImpl { + final static FilterCreaturePermanent filter = new FilterCreaturePermanent(); static { @@ -64,7 +65,7 @@ public class Cryptoplasm extends CardImpl { this.toughness = new MageInt(2); // At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability. - Ability ability = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmTransformEffect(), TargetController.YOU, true); + Ability ability = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmEffect(), TargetController.YOU, true); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } @@ -80,43 +81,46 @@ public class Cryptoplasm extends CardImpl { } -class CryptoplasmTransformEffect extends ContinuousEffectImpl { +class CryptoplasmEffect extends OneShotEffect { - CryptoplasmTransformEffect() { - super(Duration.WhileOnBattlefield, Layer.CopyEffects_1, SubLayer.NA, Outcome.Copy); - staticText = "you may have {this} become a copy of another target creature. If you do, {this} gains this ability"; + public CryptoplasmEffect() { + super(Outcome.Copy); + this.staticText = "you may have {this} become a copy of another target creature. If you do, {this} gains this ability"; } - CryptoplasmTransformEffect(final CryptoplasmTransformEffect effect) { + public CryptoplasmEffect(final CryptoplasmEffect effect) { super(effect); } @Override - public boolean apply(Game game, final Ability source) { - Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); - Permanent permanent = game.getPermanent(source.getSourceId()); - - if (creature == null || permanent == null) { - return false; - } - - game.copyPermanent(creature, permanent, source, new ApplyToPermanent() { - @Override - public Boolean apply(Game game, Permanent permanent) { - Ability upkeepAbility = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmTransformEffect(), TargetController.YOU, true); - upkeepAbility.addTarget(new TargetCreaturePermanent()); - permanent.addAbility(upkeepAbility, source.getSourceId(), game); - return true; - } - }); - - - return true; + public CryptoplasmEffect copy() { + return new CryptoplasmEffect(this); } @Override - public CryptoplasmTransformEffect copy() { - return new CryptoplasmTransformEffect(this); - } + public boolean apply(Game game, final Ability source) { + Permanent creatureToCopy = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (creatureToCopy != null) { + ApplyToPermanent applier = new ApplyToPermanent() { + @Override + public Boolean apply(Game game, Permanent permanent) { + Ability upkeepAbility = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmEffect(), TargetController.YOU, true); + upkeepAbility.addTarget(new TargetCreaturePermanent()); + permanent.addAbility(upkeepAbility, source.getSourceId(), game); + return true; + } + @Override + public Boolean apply(Game game, MageObject mageObject) { + Ability upkeepAbility = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmEffect(), TargetController.YOU, true); + upkeepAbility.addTarget(new TargetCreaturePermanent()); + mageObject.getAbilities().add(upkeepAbility); + return true; + } + + }; + game.copyPermanent(creatureToCopy, source.getSourceId(), source, applier); + } + return true; + } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java index 1fcbb3dd8d2..f0f805c5b06 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java @@ -28,20 +28,14 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; - +import mage.abilities.dynamicvalue.common.TargetConvertedManaCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DestroyTargetEffect; -import mage.cards.CardImpl; -import mage.constants.Outcome; -import mage.filter.FilterPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.TargetPermanent; +import mage.target.common.TargetArtifactPermanent; /** * @@ -49,21 +43,17 @@ import mage.target.TargetPermanent; */ public class DivineOffering extends CardImpl { - private final static FilterPermanent filter = new FilterPermanent("artifact"); - - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public DivineOffering(UUID ownerId) { super(ownerId, 5, "Divine Offering", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); this.expansionSetCode = "MBS"; // Destroy target artifact. You gain life equal to its converted mana cost. - this.getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addEffect(new DivineOfferingEffect()); + Effect effect = new GainLifeEffect(new TargetConvertedManaCost()); + effect.setText("You gain life equal to its converted mana cost"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetArtifactPermanent()); } public DivineOffering(final DivineOffering card) { @@ -74,35 +64,4 @@ public class DivineOffering extends CardImpl { public DivineOffering copy() { return new DivineOffering(this); } - - private class DivineOfferingEffect extends OneShotEffect { - - public DivineOfferingEffect() { - super(Outcome.DestroyPermanent); - staticText = "You gain life equal to its converted mana cost"; - } - - public DivineOfferingEffect(DivineOfferingEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent artefact = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); - if (artefact != null) { - int cost = artefact.getManaCost().convertedManaCost(); - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.gainLife(cost, game); - } - } - return true; - } - - @Override - public DivineOfferingEffect copy() { - return new DivineOfferingEffect(this); - } - - } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java index eb95700b42a..03cb3e2fbf8 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java @@ -25,18 +25,18 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.mirrodinbesieged; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ShuffleSpellEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.Filter; import mage.filter.FilterCard; @@ -47,8 +47,6 @@ import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; -import java.util.UUID; - /** * @author Loki */ @@ -77,6 +75,7 @@ public class GreenSunsZenith extends CardImpl { } class GreenSunsZenithSearchEffect extends OneShotEffect { + GreenSunsZenithSearchEffect() { super(Outcome.PutCreatureInPlay); staticText = "Search your library for a green creature card with converted mana cost X or less, put it onto the battlefield, then shuffle your library"; @@ -88,28 +87,28 @@ class GreenSunsZenithSearchEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } //Set the mana cost one higher to 'emulate' a less than or equal to comparison. int xValue = source.getManaCostsToPay().getX() + 1; FilterCard filter = new FilterCard("green creature card with converted mana cost " + xValue + " or less"); filter.add(new ColorPredicate(ObjectColor.GREEN)); - filter.add(new CardTypePredicate(CardType.CREATURE)); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, xValue)); TargetCardInLibrary target = new TargetCardInLibrary(filter); - if (player.searchLibrary(target, game)) { + if (controller.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { - Card card = player.getLibrary().getCard(target.getFirstTarget(), game); + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return true; } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/HeroOfOxidRidge.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/HeroOfOxidRidge.java index a05107e2675..30ed390b48f 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/HeroOfOxidRidge.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/HeroOfOxidRidge.java @@ -25,13 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.mirrodinbesieged; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; @@ -39,6 +35,9 @@ import mage.abilities.effects.RestrictionEffect; import mage.abilities.keyword.BattleCryAbility; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; import mage.game.Game; import mage.game.permanent.Permanent; @@ -91,9 +90,7 @@ class HeroOfOxidRidgeEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getPower().getValue() <= 1) - return true; - return false; + return permanent.getPower().getValue() <= 1; } @Override diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/IntoTheCore.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/IntoTheCore.java index ef3159e90c3..a66f5038a55 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/IntoTheCore.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/IntoTheCore.java @@ -28,12 +28,12 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.ExileTargetEffect; import mage.cards.CardImpl; -import mage.filter.FilterPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterArtifactPermanent; import mage.target.TargetPermanent; /** @@ -42,20 +42,15 @@ import mage.target.TargetPermanent; */ public class IntoTheCore extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("artifact"); - - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public IntoTheCore(UUID ownerId) { super(ownerId, 67, "Into the Core", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{R}{R}"); this.expansionSetCode = "MBS"; - - this.getSpellAbility().addTarget(new TargetPermanent(filter)); - this.getSpellAbility().addTarget(new TargetPermanent(filter)); - this.getSpellAbility().addEffect(new ExileTargetEffect()); + // Exile two target artifacts. + this.getSpellAbility().addTarget(new TargetPermanent(2, 2, new FilterArtifactPermanent("artifacts"), false)); + Effect effect = new ExileTargetEffect(); + effect.setText("Exile two target artifacts"); + this.getSpellAbility().addEffect(effect); } public IntoTheCore(final IntoTheCore card) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java index 40475118a59..606fe4a93a0 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -28,6 +28,7 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -43,10 +44,12 @@ import mage.filter.common.FilterNonlandCard; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; +import mage.game.permanent.PermanentToken; import mage.game.stack.Spell; import mage.players.Player; import mage.target.common.TargetCardInExile; import mage.target.targetpointer.FixedTarget; +import mage.util.CardUtil; /** * @@ -57,8 +60,10 @@ public class KnowledgePool extends CardImpl { public KnowledgePool(UUID ownerId) { super(ownerId, 111, "Knowledge Pool", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{6}"); this.expansionSetCode = "MBS"; + // Imprint - When Knowledge Pool enters the battlefield, each player exiles the top three cards of his or her library this.addAbility(new EntersBattlefieldTriggeredAbility(new KnowledgePoolEffect1(), false)); + // Whenever a player casts a spell from his or her hand, that player exiles it. If the player does, he or she may cast another nonland card exiled with Knowledge Pool without paying that card's mana cost. this.addAbility(new KnowledgePoolAbility()); } @@ -87,14 +92,17 @@ class KnowledgePoolEffect1 extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player sourcePlayer = game.getPlayer(source.getControllerId()); - for (UUID playerId: sourcePlayer.getInRange()) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller == null || sourceObject == null) { + return false; + } + for (UUID playerId : controller.getInRange()) { Player player = game.getPlayer(playerId); if (player != null) { - int amount = Math.min(3, player.getLibrary().size()); - for (int i = 0; i < amount; i++) { - player.getLibrary().removeFromTop(game).moveToExile(source.getSourceId(), "Knowledge Pool Exile", source.getSourceId(), game); - } + player.moveCardsToExile(player.getLibrary().getTopCards(game, 3), source, game, true, + CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), + sourceObject.getIdName() + " (" + sourceObject.getZoneChangeCounter(game) + ")"); } } return true; @@ -129,7 +137,7 @@ class KnowledgePoolAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getZone() == Zone.HAND) { + if (event.getZone() == Zone.HAND) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null) { for (Effect effect : this.getEffects()) { @@ -159,12 +167,16 @@ class KnowledgePoolEffect2 extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); - if (spell != null) { - if (spell.moveToExile(source.getSourceId(), "Knowledge Pool Exile", source.getSourceId(), game)) { + MageObject sourceObject = game.getObject(source.getSourceId()); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null && spell != null && sourceObject != null) { + int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() - 1; + UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter); + if (controller.moveCardsToExile(spell, source, game, true, exileZoneId, sourceObject.getIdName())) { Player player = game.getPlayer(spell.getControllerId()); - if (player != null && player.chooseUse(Outcome.PlayForFree, "Cast another nonland card exiled with Knowledge Pool without paying that card's mana cost?", source, game)) { + if (player != null && player.chooseUse(Outcome.PlayForFree, "Cast another nonland card exiled with " + sourceObject.getLogName() + " without paying that card's mana cost?", source, game)) { TargetCardInExile target = new TargetCardInExile(filter, source.getSourceId()); - while (player.choose(Outcome.PlayForFree, game.getExile().getExileZone(source.getSourceId()), target, game)) { + while (player.choose(Outcome.PlayForFree, game.getExile().getExileZone(exileZoneId), target, game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null && !card.getId().equals(spell.getSourceId())) { game.getExile().removeCard(card, game); @@ -184,4 +196,4 @@ class KnowledgePoolEffect2 extends OneShotEffect { return new KnowledgePoolEffect2(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java index 6bc55444c9a..93d3b051d17 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -28,26 +28,20 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.costs.Cost; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.SetTargetPointer; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.game.permanent.PermanentToken; -import mage.game.permanent.token.EmptyToken; -import mage.players.Player; -import mage.target.targetpointer.FixedTarget; -import mage.util.CardUtil; +import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.filter.predicate.permanent.TokenPredicate; /** * @@ -55,13 +49,23 @@ import mage.util.CardUtil; */ public class Mirrorworks extends CardImpl { + private final static FilterArtifactPermanent filter = new FilterArtifactPermanent("another nontoken artifact"); + + static { + filter.add(new AnotherPredicate()); + filter.add(Predicates.not(new TokenPredicate())); + } + public Mirrorworks(UUID ownerId) { super(ownerId, 114, "Mirrorworks", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); this.expansionSetCode = "MBS"; // Whenever another nontoken artifact enters the battlefield under your control, you may pay {2}. // If you do, put a token that's a copy of that artifact onto the battlefield. - this.addAbility(new MirrorworksAbility()); + Effect effect = new DoIfCostPaid(new PutTokenOntoBattlefieldCopyTargetEffect(), + new ManaCostsImpl("{2}"), "Put a token that's a copy of that artifact onto the battlefield?"); + effect.setText("you may pay {2}. If you do, put a token that's a copy of that artifact onto the battlefield"); + this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, effect, filter, false, SetTargetPointer.PERMANENT, null)); } public Mirrorworks(final Mirrorworks card) { @@ -74,90 +78,3 @@ public class Mirrorworks extends CardImpl { } } - -class MirrorworksAbility extends TriggeredAbilityImpl { - - public MirrorworksAbility() { - super(Zone.BATTLEFIELD, new MirrorworksEffect()); - } - - public MirrorworksAbility(final MirrorworksAbility ability) { - super(ability); - } - - @Override - public MirrorworksAbility copy() { - return new MirrorworksAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (!event.getTargetId().equals(this.getSourceId())) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null - && permanent.getControllerId().equals(getControllerId()) - && !(permanent instanceof PermanentToken) - && permanent.getCardType().contains(CardType.ARTIFACT)) { - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - return true; - } - } - return false; - } - - @Override - public String getRule() { - return "Whenever another nontoken artifact enters the battlefield under your control, you may pay {2}. If you do, put a token that's a copy of that artifact onto the battlefield"; - } - -} - -class MirrorworksEffect extends OneShotEffect { - - public MirrorworksEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "put a token that's a copy of that artifact onto the battlefield"; - } - - public MirrorworksEffect(final MirrorworksEffect effect) { - super(effect); - } - - @Override - public MirrorworksEffect copy() { - return new MirrorworksEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - UUID targetId = targetPointer.getFirst(game, source); - if (targetId != null && player != null) { - MageObject target = game.getPermanent(targetId); - if (target == null) { - target = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD); - } - if (target != null) { - Cost cost = new ManaCostsImpl("{2}"); - if (player.chooseUse(outcome, new StringBuilder("Pay ").append(cost.getText()).append(" and put a token copy of ").append(target.getName()).append(" onto the battlefield").toString(), source, game)) { - cost.clearPaid(); - if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { - if (target instanceof Permanent) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from((Permanent)target); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } - } - } - } - } - return false; - } - -} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianRevoker.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianRevoker.java index 279bd693526..6a51fef04bc 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianRevoker.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianRevoker.java @@ -25,32 +25,25 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.mirrodinbesieged; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.NameACardEffect; import mage.cards.CardImpl; -import mage.cards.repository.CardRepository; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.util.CardUtil; /** * @@ -66,7 +59,7 @@ public class PhyrexianRevoker extends CardImpl { this.toughness = new MageInt(1); // As Phyrexian Revoker enters the battlefield, name a nonland card. - this.addAbility(new AsEntersBattlefieldAbility(new PhyrexianRevokerEffect1())); + this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME))); // Activated abilities of sources with the chosen name can't be activated. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianRevokerEffect2())); @@ -83,46 +76,6 @@ public class PhyrexianRevoker extends CardImpl { } -class PhyrexianRevokerEffect1 extends OneShotEffect { - - public PhyrexianRevokerEffect1() { - super(Outcome.Detriment); - staticText = "name a nonland card"; - } - - public PhyrexianRevokerEffect1(final PhyrexianRevokerEffect1 effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (controller != null && permanent != null) { - Choice cardChoice = new ChoiceImpl(); - cardChoice.setChoices(CardRepository.instance.getNonLandNames()); - cardChoice.clearChoice(); - while (!controller.choose(Outcome.Detriment, cardChoice, game)) { - if (!controller.canRespond()) { - return false; - } - } - String cardName = cardChoice.getChoice(); - game.informPlayers(permanent.getLogName() + ", named card: [" + cardName + "]"); - game.getState().setValue(source.getSourceId().toString(), cardName); - permanent.addInfo("named card", CardUtil.addToolTipMarkTags("Named card: [" + cardName +"]"), game); - return true; - } - return false; - } - - @Override - public PhyrexianRevokerEffect1 copy() { - return new PhyrexianRevokerEffect1(this); - } - -} - class PhyrexianRevokerEffect2 extends ContinuousRuleModifyingEffectImpl { public PhyrexianRevokerEffect2() { @@ -143,7 +96,7 @@ class PhyrexianRevokerEffect2 extends ContinuousRuleModifyingEffectImpl { public PhyrexianRevokerEffect2 copy() { return new PhyrexianRevokerEffect2(this); } - + @Override public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); @@ -157,7 +110,7 @@ class PhyrexianRevokerEffect2 extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == EventType.ACTIVATE_ABILITY) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString()))) { + if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { return true; } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/RedSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/RedSunsZenith.java index 48dec655e1c..54631fd0c1e 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/RedSunsZenith.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/RedSunsZenith.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -49,7 +49,9 @@ public class RedSunsZenith extends CardImpl { super(ownerId, 74, "Red Sun's Zenith", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{R}"); this.expansionSetCode = "MBS"; - + // Red Sun's Zenith deals X damage to target creature or player. + // If a creature dealt damage this way would die this turn, exile it instead. + // Shuffle Red Sun's Zenith into its owner's library. this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn)); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SpireSerpent.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SpireSerpent.java index f753cc56de5..778d8e7cd66 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SpireSerpent.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SpireSerpent.java @@ -41,7 +41,7 @@ import mage.abilities.decorator.ConditionalAsThoughEffect; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; @@ -64,7 +64,7 @@ public class SpireSerpent extends CardImpl { this.addAbility(DefenderAbility.getInstance()); ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), MetalcraftCondition.getInstance(), abilityText1); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect1); - Effect effect = new ConditionalAsThoughEffect(new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), + Effect effect = new ConditionalAsThoughEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), MetalcraftCondition.getInstance()); effect.setText("and can attack as though it didn't have defender"); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/TezzeretAgentOfBolas.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/TezzeretAgentOfBolas.java index df35e2d49d7..90520e0a75a 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/TezzeretAgentOfBolas.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/TezzeretAgentOfBolas.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,16 +20,17 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets.mirrodinbesieged; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.Effect; @@ -37,13 +38,11 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -52,8 +51,6 @@ import mage.players.Player; import mage.target.TargetPlayer; import mage.target.common.TargetArtifactPermanent; -import java.util.UUID; - /** * * @author BetaSteward_at_googlemail.com @@ -61,6 +58,7 @@ import java.util.UUID; public class TezzeretAgentOfBolas extends CardImpl { private static final FilterCard filter = new FilterCard("an artifact card"); + static { filter.add(new CardTypePredicate(CardType.ARTIFACT)); } @@ -70,8 +68,7 @@ public class TezzeretAgentOfBolas extends CardImpl { this.expansionSetCode = "MBS"; this.subtype.add("Tezzeret"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +1: Look at the top five cards of your library. You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in any order. this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(5, 1, filter, true), 1)); @@ -80,7 +77,7 @@ public class TezzeretAgentOfBolas extends CardImpl { Effect effect = new AddCardTypeTargetEffect(CardType.CREATURE, Duration.EndOfGame); effect.setText("Target artifact becomes an artifact creature"); LoyaltyAbility ability1 = new LoyaltyAbility(effect, -1); - effect = new SetPowerToughnessTargetEffect(5,5, Duration.EndOfGame); + effect = new SetPowerToughnessTargetEffect(5, 5, Duration.EndOfGame); effect.setText("with base power and toughness 5/5"); ability1.addEffect(effect); ability1.addTarget(new TargetArtifactPermanent()); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/WhiteSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/WhiteSunsZenith.java index ca6630a0c4d..4ff0f362062 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/WhiteSunsZenith.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/WhiteSunsZenith.java @@ -29,7 +29,6 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.effects.common.CreateTokenEffect; @@ -37,7 +36,7 @@ import mage.abilities.effects.common.ShuffleSpellEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.CatToken; /** * @@ -62,16 +61,3 @@ public class WhiteSunsZenith extends CardImpl { return new WhiteSunsZenith(this); } } - -class CatToken extends Token { - public CatToken() { - super("Cat", "2/2 white Cat creature token"); - setOriginalExpansionSetCode("SOM"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Cat"); - power = new MageInt(2); - toughness = new MageInt(2); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/modernmasters/DoublingSeason.java b/Mage.Sets/src/mage/sets/modernmasters/DoublingSeason.java index 4c42462e1fe..1067cb393f1 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/DoublingSeason.java +++ b/Mage.Sets/src/mage/sets/modernmasters/DoublingSeason.java @@ -113,6 +113,7 @@ class DoublingSeasonTokenEffect extends ReplacementEffectImpl { } class DoublingSeasonCounterEffect extends ReplacementEffectImpl { + DoublingSeasonCounterEffect() { super(Duration.WhileOnBattlefield, Outcome.BoostCreature, false); staticText = "If an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead"; @@ -128,15 +129,18 @@ class DoublingSeasonCounterEffect extends ReplacementEffectImpl { return false; } - @Override + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ADD_COUNTERS; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - Permanent target = game.getPermanent(event.getTargetId()); - if (target != null && target.getControllerId().equals(source.getControllerId())) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent == null) { + permanent = game.getPermanentEntering(event.getTargetId()); + } + if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { return true; } return false; diff --git a/Mage.Sets/src/mage/sets/modernmasters/Epochrasite.java b/Mage.Sets/src/mage/sets/modernmasters/Epochrasite.java index 61a7cc1e97e..6f652e82b4e 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/Epochrasite.java +++ b/Mage.Sets/src/mage/sets/modernmasters/Epochrasite.java @@ -67,7 +67,7 @@ public class Epochrasite extends CardImpl { // Epochrasite enters the battlefield with three +1/+1 counters on it if you didn't cast it from your hand. this.addAbility(new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), - new InvertCondition(new CastFromHandCondition()), true, + new InvertCondition(new CastFromHandCondition()), "{this} enters the battlefield with three +1/+1 counters on it if you didn't cast it from your hand",""), new CastFromHandWatcher()); diff --git a/Mage.Sets/src/mage/sets/modernmasters/MarshFlitter.java b/Mage.Sets/src/mage/sets/modernmasters/MarshFlitter.java index 56a97459bb9..719eca0111e 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/MarshFlitter.java +++ b/Mage.Sets/src/mage/sets/modernmasters/MarshFlitter.java @@ -41,10 +41,11 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinRogueToken; import mage.target.common.TargetControlledPermanent; /** @@ -54,6 +55,7 @@ import mage.target.common.TargetControlledPermanent; public class MarshFlitter extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Goblin"); + static { filter.add(new SubtypePredicate("Goblin")); } @@ -70,9 +72,9 @@ public class MarshFlitter extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // When Marsh Flitter enters the battlefield, put two 1/1 black Goblin Rogue creature tokens onto the battlefield. - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new BlackGoblinRogueToken(), 2), false)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GoblinRogueToken(), 2), false)); // Sacrifice a Goblin: Marsh Flitter has base power and toughness 3/3 until end of turn. - Effect effect = new SetPowerToughnessSourceEffect(3, 3, Duration.EndOfTurn); + Effect effect = new SetPowerToughnessSourceEffect(3, 3, Duration.EndOfTurn, SubLayer.SetPT_7b); effect.setText("{this} has base power and toughness 3/3 until end of turn"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new SacrificeTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); @@ -88,15 +90,3 @@ public class MarshFlitter extends CardImpl { return new MarshFlitter(this); } } - -class BlackGoblinRogueToken extends Token { - BlackGoblinRogueToken() { - super("Goblin Rogue", "1/1 black Goblin Rogue creature tokens"); - cardType.add(CardType.CREATURE); - color.setBlack(true); - subtype.add("Goblin"); - subtype.add("Rogue"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/modernmasters/ToothAndNail.java b/Mage.Sets/src/mage/sets/modernmasters/ToothAndNail.java index 3902ef10adc..1ce14ebe81c 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/ToothAndNail.java +++ b/Mage.Sets/src/mage/sets/modernmasters/ToothAndNail.java @@ -33,8 +33,8 @@ import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.abilities.keyword.EntwineAbility; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -55,7 +55,7 @@ public class ToothAndNail extends CardImpl { super(ownerId, 170, "Tooth and Nail", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{G}{G}"); this.expansionSetCode = "MMA"; - // Choose one - + // Choose one - // Search your library for up to two creature cards, reveal them, put them into your hand, then shuffle your library; this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 2, new FilterCreatureCard()), true)); // or put up to two creature cards from your hand onto the battlefield. @@ -95,20 +95,15 @@ class ToothAndNailPutCreatureOnBattlefieldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } TargetCardInHand target = new TargetCardInHand(0, 2, new FilterCreatureCard("creature cards")); - if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { - for (UUID targetId: target.getTargets()) { - Card card = game.getCard(targetId); - if (card != null) { - card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId()); - } - } - return true; + if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { + return controller.moveCards(new CardsImpl(target.getTargets()).getCards(game), + Zone.BATTLEFIELD, source, game, false, false, false, null); } return false; } diff --git a/Mage.Sets/src/mage/sets/modernmasters/WarrenWeirding.java b/Mage.Sets/src/mage/sets/modernmasters/WarrenWeirding.java index 8a294fd70a3..b3f6d2144fa 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/WarrenWeirding.java +++ b/Mage.Sets/src/mage/sets/modernmasters/WarrenWeirding.java @@ -47,6 +47,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.game.permanent.token.GoblinRogueToken; import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.TargetPlayer; @@ -83,9 +84,11 @@ public class WarrenWeirding extends CardImpl { class WarrenWeirdingEffect extends OneShotEffect { private static final FilterCreaturePermanent filterGoblin = new FilterCreaturePermanent(); + static { filterGoblin.add(new SubtypePredicate("Goblin")); } + WarrenWeirdingEffect ( ) { super(Outcome.Sacrifice); staticText = "Target player sacrifices a creature. If a Goblin is sacrificed this way, that player puts two 1/1 black Goblin Rogue creature tokens onto the battlefield, and those tokens gain haste until end of turn"; @@ -113,7 +116,7 @@ class WarrenWeirdingEffect extends OneShotEffect { permanent.sacrifice(source.getSourceId(), game); if (filterGoblin.match(permanent, game)) { for (int i = 0; i < 2; i++) { - Token token = new WarrenWeirdingBlackGoblinRogueToken(); + Token token = new GoblinRogueToken(); Effect effect = new CreateTokenTargetEffect(token); effect.setTargetPointer(new FixedTarget(player.getId())); if (effect.apply(game, source)) { @@ -138,15 +141,3 @@ class WarrenWeirdingEffect extends OneShotEffect { } } - -class WarrenWeirdingBlackGoblinRogueToken extends Token { - WarrenWeirdingBlackGoblinRogueToken() { - super("Goblin Rogue", "1/1 black Goblin Rogue creature tokens, and those tokens gain haste until end of turn"); - cardType.add(CardType.CREATURE); - color.setBlack(true); - subtype.add("Goblin"); - subtype.add("Rogue"); - power.setValue(1); - toughness.setValue(1); - } -} diff --git a/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java b/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java index b9ca13546a4..06051fdcd96 100644 --- a/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java +++ b/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java @@ -65,10 +65,10 @@ public class WorldheartPhoenix extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. + // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. // If you do, it enters the battlefield with two +1/+1 counters on it. Ability ability = new SimpleStaticAbility(Zone.ALL, new WorldheartPhoenixPlayEffect()); - ability.addEffect(new EntersBattlefieldEffect(new WorldheartPhoenixEntersBattlefieldEffect(), + ability.addEffect(new EntersBattlefieldEffect(new WorldheartPhoenixEntersBattlefieldEffect(), "If you do, it enters the battlefield with two +1/+1 counters on it")); this.addAbility(ability); @@ -111,7 +111,7 @@ public class WorldheartPhoenix extends CardImpl { Player player = game.getPlayer(affectedControllerId); if (player != null) { // can sometimes be cast with base mana cost from grave???? - player.setCastSourceIdWithAlternateMana(sourceId, new ManaCostsImpl<>("{W}{U}{B}{R}{G}")); + player.setCastSourceIdWithAlternateMana(sourceId, new ManaCostsImpl<>("{W}{U}{B}{R}{G}"), null); return true; } } @@ -136,10 +136,12 @@ public class WorldheartPhoenix extends CardImpl { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) { // TODO: No perfect solution because there could be other effects that allow to cast the card for this mana cost - if (((SpellAbility) obj).getManaCosts().getText().equals("{W}{U}{B}{R}{G}")) { + if (spellAbility.getManaCosts().getText().equals("{W}{U}{B}{R}{G}")) { permanent.addCounters(CounterType.P1P1.createInstance(2), game); } } diff --git a/Mage.Sets/src/mage/sets/morningtide/Bitterblossom.java b/Mage.Sets/src/mage/sets/morningtide/Bitterblossom.java index e7a64e2a949..2a19532c5d4 100644 --- a/Mage.Sets/src/mage/sets/morningtide/Bitterblossom.java +++ b/Mage.Sets/src/mage/sets/morningtide/Bitterblossom.java @@ -1,82 +1,66 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.morningtide; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.LoseLifeSourceControllerEffect; -import mage.abilities.keyword.FlyingAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.game.permanent.token.Token; - -/** - * - * @author Loki - */ -public class Bitterblossom extends CardImpl { - - public Bitterblossom(UUID ownerId) { - super(ownerId, 58, "Bitterblossom", Rarity.RARE, new CardType[]{CardType.TRIBAL, CardType.ENCHANTMENT}, "{1}{B}"); - this.expansionSetCode = "MOR"; - this.subtype.add("Faerie"); - - - // At the beginning of your upkeep, you lose 1 life and put a 1/1 black Faerie Rogue creature token with flying onto the battlefield. - Ability ability = new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(1), TargetController.YOU, false); - ability.addEffect(new CreateTokenEffect(new FaerieToken(), 1)); - this.addAbility(ability); - } - - public Bitterblossom(final Bitterblossom card) { - super(card); - } - - @Override - public Bitterblossom copy() { - return new Bitterblossom(this); - } -} - -class FaerieToken extends Token { - FaerieToken() { - super("Faerie Rogue", "1/1 black Faerie Rogue creature token with flying"); - cardType.add(CardType.CREATURE); - color.setBlack(true); - subtype.add("Faerie"); - subtype.add("Rogue"); - power = new MageInt(1); - toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); - } -} \ No newline at end of file +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.permanent.token.FaerieRogueToken; + +/** + * + * @author Loki + */ +public class Bitterblossom extends CardImpl { + + public Bitterblossom(UUID ownerId) { + super(ownerId, 58, "Bitterblossom", Rarity.RARE, new CardType[]{CardType.TRIBAL, CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Faerie"); + + // At the beginning of your upkeep, you lose 1 life and put a 1/1 black Faerie Rogue creature token with flying onto the battlefield. + Ability ability = new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(1), TargetController.YOU, false); + ability.addEffect(new CreateTokenEffect(new FaerieRogueToken(), 1)); + this.addAbility(ability); + } + + public Bitterblossom(final Bitterblossom card) { + super(card); + } + + @Override + public Bitterblossom copy() { + return new Bitterblossom(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/BoldwyrIntimidator.java b/Mage.Sets/src/mage/sets/morningtide/BoldwyrIntimidator.java new file mode 100644 index 00000000000..e7a229c1b25 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/BoldwyrIntimidator.java @@ -0,0 +1,127 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.RestrictionEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureTypeTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class BoldwyrIntimidator extends CardImpl { + + public BoldwyrIntimidator(UUID ownerId) { + super(ownerId, 86, "Boldwyr Intimidator", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{R}{R}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Giant"); + this.subtype.add("Warrior"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Cowards can't block Warriors. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoldwyrIntimidatorEffect())); + + // {R}: Target creature becomes a Coward until end of turn. + Effect effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, new ArrayList<>(Arrays.asList("Coward")), true); + effect.setText("Target creature becomes a Coward until end of turn"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{R}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // {2}{R}: Target creature becomes a Warrior until end of turn. + effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, new ArrayList<>(Arrays.asList("Warrior")), true); + effect.setText("Target creature becomes a Warrior until end of turn"); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{R}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public BoldwyrIntimidator(final BoldwyrIntimidator card) { + super(card); + } + + @Override + public BoldwyrIntimidator copy() { + return new BoldwyrIntimidator(this); + } +} + +class BoldwyrIntimidatorEffect extends RestrictionEffect { + + BoldwyrIntimidatorEffect() { + super(Duration.WhileOnBattlefield); + staticText = "Cowards can't block Warriors"; + } + + BoldwyrIntimidatorEffect(final BoldwyrIntimidatorEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (sourcePermanent != null) { + return true; + } + return false; + } + + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { + if (attacker != null && blocker != null) { + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (sourcePermanent != null && attacker.getSubtype().contains("Warrior")) { + return !blocker.getSubtype().contains("Coward"); + } + } + return true; + } + + @Override + public BoldwyrIntimidatorEffect copy() { + return new BoldwyrIntimidatorEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/BorderlandBehemoth.java b/Mage.Sets/src/mage/sets/morningtide/BorderlandBehemoth.java new file mode 100644 index 00000000000..f4650f2c6a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/BorderlandBehemoth.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BorderlandBehemoth extends mage.sets.commander2015.BorderlandBehemoth { + + public BorderlandBehemoth(UUID ownerId) { + super(ownerId); + this.cardNumber = 87; + this.expansionSetCode = "MOR"; + } + + public BorderlandBehemoth(final BorderlandBehemoth card) { + super(card); + } + + @Override + public BorderlandBehemoth copy() { + return new BorderlandBehemoth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/BramblewoodParagon.java b/Mage.Sets/src/mage/sets/morningtide/BramblewoodParagon.java index 51657bef406..7d9eb88b969 100644 --- a/Mage.Sets/src/mage/sets/morningtide/BramblewoodParagon.java +++ b/Mage.Sets/src/mage/sets/morningtide/BramblewoodParagon.java @@ -44,6 +44,7 @@ import mage.counters.CounterType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.CounterPredicate; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -52,8 +53,9 @@ import mage.game.permanent.Permanent; * @author emerald000 */ public class BramblewoodParagon extends CardImpl { - + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Each creature you control with a +1/+1 counter on it"); + static { filter.add(new CounterPredicate(CounterType.P1P1)); } @@ -68,15 +70,15 @@ public class BramblewoodParagon extends CardImpl { // Each other Warrior creature you control enters the battlefield with an additional +1/+1 counter on it. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BramblewoodParagonReplacementEffect())); - + // Each creature you control with a +1/+1 counter on it has trample. this.addAbility(new SimpleStaticAbility( - Zone.BATTLEFIELD, + Zone.BATTLEFIELD, new GainAbilityAllEffect( - TrampleAbility.getInstance(), - Duration.WhileOnBattlefield, + TrampleAbility.getInstance(), + Duration.WhileOnBattlefield, filter))); - + } public BramblewoodParagon(final BramblewoodParagon card) { @@ -99,16 +101,16 @@ class BramblewoodParagonReplacementEffect extends ReplacementEffectImpl { BramblewoodParagonReplacementEffect(BramblewoodParagonReplacementEffect effect) { super(effect); } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getTargetId()); - return creature != null && creature.getControllerId().equals(source.getControllerId()) + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); + return creature != null && creature.getControllerId().equals(source.getControllerId()) && creature.getCardType().contains(CardType.CREATURE) && creature.hasSubtype("Warrior") && !event.getTargetId().equals(source.getSourceId()); @@ -116,14 +118,13 @@ class BramblewoodParagonReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getTargetId()); + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); if (creature != null) { creature.addCounters(CounterType.P1P1.createInstance(), game); } return false; } - @Override public BramblewoodParagonReplacementEffect copy() { return new BramblewoodParagonReplacementEffect(this); diff --git a/Mage.Sets/src/mage/sets/morningtide/BrighthearthBanneret.java b/Mage.Sets/src/mage/sets/morningtide/BrighthearthBanneret.java index e404891c77d..521d13e03fa 100644 --- a/Mage.Sets/src/mage/sets/morningtide/BrighthearthBanneret.java +++ b/Mage.Sets/src/mage/sets/morningtide/BrighthearthBanneret.java @@ -52,7 +52,7 @@ public class BrighthearthBanneret extends CardImpl { static { filter.add(Predicates.or( new SubtypePredicate("Elemental"), - new SubtypePredicate("Shaman"))); + new SubtypePredicate("Warrior"))); } public BrighthearthBanneret(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java b/Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java index 56d7df6a2e4..a57e67d4f3d 100644 --- a/Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java +++ b/Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java @@ -28,26 +28,22 @@ package mage.sets.morningtide; import java.util.UUID; + import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.SubLayer; import mage.constants.Zone; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; +import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.ChangelingAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -76,7 +72,8 @@ public class ChameleonColossus extends CardImpl { this.addAbility(new ProtectionAbility(filter)); // {2}{G}{G}: Chameleon Colossus gets +X/+X until end of turn, where X is its power. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChameleonColossusEffect(), new ManaCostsImpl("{2}{G}{G}"))); + SourcePermanentPowerCount x = new SourcePermanentPowerCount(); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(x, x, Duration.EndOfTurn, true), new ManaCostsImpl("{2}{G}{G}"))); } public ChameleonColossus(final ChameleonColossus card) { @@ -88,31 +85,3 @@ public class ChameleonColossus extends CardImpl { return new ChameleonColossus(this); } } - -class ChameleonColossusEffect extends ContinuousEffectImpl { - public ChameleonColossusEffect() { - super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); - staticText = "{this} gets +X/+X until end of turn, where X is its power"; - } - - public ChameleonColossusEffect(final ChameleonColossusEffect effect) { - super(effect); - } - - @Override - public ChameleonColossusEffect copy() { - return new ChameleonColossusEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (sourcePermanent != null) { - int power = sourcePermanent.getPower().getValue(); - sourcePermanent.addPower(power); - sourcePermanent.addToughness(power); - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/morningtide/CountrysideCrusher.java b/Mage.Sets/src/mage/sets/morningtide/CountrysideCrusher.java index bc8f7d46c19..9bee542397c 100644 --- a/Mage.Sets/src/mage/sets/morningtide/CountrysideCrusher.java +++ b/Mage.Sets/src/mage/sets/morningtide/CountrysideCrusher.java @@ -28,10 +28,6 @@ package mage.sets.morningtide; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -42,8 +38,11 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.TargetController; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterLandCard; import mage.game.Game; @@ -70,7 +69,7 @@ public class CountrysideCrusher extends CardImpl { // Whenever a land card is put into your graveyard from anywhere, put a +1/+1 counter on Countryside Crusher. this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance()), - false, new FilterLandCard("a land card"),TargetController.YOU + false, new FilterLandCard("a land card"), TargetController.YOU )); } @@ -111,7 +110,7 @@ class CountrysideCrusherEffect extends OneShotEffect { Card card = controller.getLibrary().getFromTop(game); cards.add(card); if (card.getCardType().contains(CardType.LAND)) { - controller.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); + controller.moveCards(card, Zone.GRAVEYARD, source, game); } else { break; } diff --git a/Mage.Sets/src/mage/sets/morningtide/DeclarationOfNaught.java b/Mage.Sets/src/mage/sets/morningtide/DeclarationOfNaught.java index 7f91e4a9af4..38c343102a5 100644 --- a/Mage.Sets/src/mage/sets/morningtide/DeclarationOfNaught.java +++ b/Mage.Sets/src/mage/sets/morningtide/DeclarationOfNaught.java @@ -48,7 +48,8 @@ import mage.target.TargetSpell; * @author jeffwadsworth */ public class DeclarationOfNaught extends CardImpl { - + + private final UUID originalId; static final private FilterSpell filter = new FilterSpell("spell with the chosen name"); public DeclarationOfNaught(UUID ownerId) { @@ -61,13 +62,14 @@ public class DeclarationOfNaught extends CardImpl { // {U}: Counter target spell with the chosen name. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{U}")); ability.addTarget(new TargetSpell(filter)); + originalId = ability.getOriginalId(); this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SimpleActivatedAbility) { + if (ability.getOriginalId().equals(originalId)) { ability.getTargets().clear(); FilterSpell filter2 = new FilterSpell("spell with the chosen name"); filter2.add(new NamePredicate((String) game.getState().getValue(ability.getSourceId().toString() + NameACardEffect.INFO_KEY))); @@ -78,10 +80,11 @@ public class DeclarationOfNaught extends CardImpl { public DeclarationOfNaught(final DeclarationOfNaught card) { super(card); + this.originalId = card.originalId; } @Override public DeclarationOfNaught copy() { return new DeclarationOfNaught(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/morningtide/DewdropSpy.java b/Mage.Sets/src/mage/sets/morningtide/DewdropSpy.java new file mode 100644 index 00000000000..88f037780f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/DewdropSpy.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.LookLibraryTopCardTargetPlayerEffect; +import mage.abilities.keyword.FlashAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class DewdropSpy extends CardImpl { + + public DewdropSpy(UUID ownerId) { + super(ownerId, 30, "Dewdrop Spy", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Faerie"); + this.subtype.add("Rogue"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Dewdrop Spy enters the battlefield, look at the top card of target player's library. + Ability ability = new EntersBattlefieldTriggeredAbility(new LookLibraryTopCardTargetPlayerEffect(), false); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public DewdropSpy(final DewdropSpy card) { + super(card); + } + + @Override + public DewdropSpy copy() { + return new DewdropSpy(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/FencerClique.java b/Mage.Sets/src/mage/sets/morningtide/FencerClique.java new file mode 100644 index 00000000000..60f71959c35 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/FencerClique.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PutOnLibrarySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FencerClique extends CardImpl { + + public FencerClique(UUID ownerId) { + super(ownerId, 33, "Fencer Clique", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Faerie"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {U}: Put Fencer Clique on top of its owner's library. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibrarySourceEffect(true), new ManaCostsImpl("{U}"))); + } + + public FencerClique(final FencerClique card) { + super(card); + } + + @Override + public FencerClique copy() { + return new FencerClique(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/FireJuggler.java b/Mage.Sets/src/mage/sets/morningtide/FireJuggler.java new file mode 100644 index 00000000000..a056936308c --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/FireJuggler.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.effects.common.DoIfClashWonEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.permanent.BlockingAttackerIdPredicate; + +/** + * + * @author BursegSardaukar + */ +public class FireJuggler extends CardImpl { + + public FireJuggler(UUID ownerId) { + super(ownerId, 90, "Fire Juggler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Goblin"); + this.subtype.add("Shaman"); + + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Fire Juggler becomes blocked, clash with an opponent. If you win, Fire Juggler deals 4 damage to each creature blocking it. + FilterPermanent filter = new FilterPermanent("each creature blocking it"); + filter.add(new BlockingAttackerIdPredicate(this.getId())); + this.addAbility(new BecomesBlockedTriggeredAbility(new DoIfClashWonEffect(new DamageAllEffect(4,filter)),false)); + } + + public FireJuggler(final FireJuggler card) { + super(card); + } + + @Override + public FireJuggler copy() { + return new FireJuggler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/GiltLeafArchdruid.java b/Mage.Sets/src/mage/sets/morningtide/GiltLeafArchdruid.java index 92e5ee86a55..4773cc926f9 100644 --- a/Mage.Sets/src/mage/sets/morningtide/GiltLeafArchdruid.java +++ b/Mage.Sets/src/mage/sets/morningtide/GiltLeafArchdruid.java @@ -50,6 +50,7 @@ import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.players.Player; import mage.target.TargetPlayer; import mage.target.common.TargetControlledCreaturePermanent; @@ -60,11 +61,11 @@ import mage.target.common.TargetControlledCreaturePermanent; public class GiltLeafArchdruid extends CardImpl { private static final FilterSpell filterSpell = new FilterSpell("a Druid spell"); - + static { filterSpell.add(new SubtypePredicate("Druid")); } - + public GiltLeafArchdruid(UUID ownerId) { super(ownerId, 124, "Gilt-Leaf Archdruid", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); this.expansionSetCode = "MOR"; @@ -76,6 +77,7 @@ public class GiltLeafArchdruid extends CardImpl { // Whenever you cast a Druid spell, you may draw a card. this.addAbility(new SpellCastControllerTriggeredAbility(new DrawCardSourceControllerEffect(1), filterSpell, true)); + // Tap seven untapped Druids you control: Gain control of all lands target player controls. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlAllLandsEffect(Duration.EndOfGame), new TapTargetCost(new TargetControlledCreaturePermanent(7, 7, new FilterControlledCreaturePermanent("Druid", "Druids you control"), true))); ability.addTarget(new TargetPlayer()); @@ -109,14 +111,17 @@ class GainControlAllLandsEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - if (targetPointer != null) { - for(Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), targetPointer.getFirst(game, source), game)){ + Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + if (targetPlayer != null && targetPlayer.isInGame()) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterLandPermanent(), targetPointer.getFirst(game, source), game)) { if (permanent != null) { permanent.changeControllerId(source.getControllerId(), game); } } + } else { + discard(); } - return false; + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/morningtide/GrimoireThief.java b/Mage.Sets/src/mage/sets/morningtide/GrimoireThief.java new file mode 100644 index 00000000000..17d751edb03 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/GrimoireThief.java @@ -0,0 +1,253 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.cards.SplitCard; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.ExileZone; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.common.TargetOpponent; +import mage.util.CardUtil; + +/** + * + * @author jeffwadsworth + */ +public class GrimoireThief extends CardImpl { + + protected static final String VALUE_PREFIX = "ExileZones"; + + public GrimoireThief(UUID ownerId) { + super(ownerId, 35, "Grimoire Thief", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{U}{U}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Merfolk"); + this.subtype.add("Rogue"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Grimoire Thief becomes tapped, exile the top three cards of target opponent's library face down. + Ability ability = new BecomesTappedSourceTriggeredAbility(new GrimoireThiefExileEffect(), false); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + + // You may look at cards exiled with Grimoire Thief. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new GrimoireThiefLookEffect())); + + // {U}, Sacrifice Grimoire Thief: Turn all cards exiled with Grimoire Thief face up. Counter all spells with those names. + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrimoireThiefCounterspellEffect(), new ManaCostsImpl("{U}")); + ability2.addCost(new SacrificeSourceCost()); + this.addAbility(ability2); + + } + + public GrimoireThief(final GrimoireThief card) { + super(card); + } + + @Override + public GrimoireThief copy() { + return new GrimoireThief(this); + } +} + +class GrimoireThiefExileEffect extends OneShotEffect { + + public GrimoireThiefExileEffect() { + super(Outcome.Discard); + staticText = "exile the top three cards of target opponent's library face down"; + } + + public GrimoireThiefExileEffect(final GrimoireThiefExileEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetOpponent = game.getPlayer(source.getFirstTarget()); + if (targetOpponent != null) { + Set cards = targetOpponent.getLibrary().getTopCards(game, 3); + MageObject sourceObject = source.getSourceObject(game); + if (!cards.isEmpty() && sourceObject != null) { + for (Card card : cards) { + card.setFaceDown(true, game); + } + UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); + targetOpponent.moveCardsToExile(cards, source, game, false, exileZoneId, sourceObject.getIdName()); + for (Card card : cards) { + card.setFaceDown(true, game); + } + Set exileZones = (Set) game.getState().getValue(GrimoireThief.VALUE_PREFIX + source.getSourceId().toString()); + if (exileZones == null) { + exileZones = new HashSet<>(); + game.getState().setValue(GrimoireThief.VALUE_PREFIX + source.getSourceId().toString(), exileZones); + } + exileZones.add(exileZoneId); + return true; + } + } + return false; + } + + @Override + public GrimoireThiefExileEffect copy() { + return new GrimoireThiefExileEffect(this); + } +} + +class GrimoireThiefLookEffect extends AsThoughEffectImpl { + + public GrimoireThiefLookEffect() { + super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit); + staticText = "You may look at the cards exiled with {this}"; + } + + public GrimoireThiefLookEffect(final GrimoireThiefLookEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public GrimoireThiefLookEffect copy() { + return new GrimoireThiefLookEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId).equals(Zone.EXILED)) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + Card card = game.getCard(objectId); + if (card != null && card.isFaceDown(game)) { + Set exileZones = (Set) game.getState().getValue(GrimoireThief.VALUE_PREFIX + source.getSourceId().toString()); + if (exileZones != null) { + for (ExileZone exileZone : game.getExile().getExileZones()) { + if (exileZone.contains(objectId)) { + if (!exileZones.contains(exileZone.getId())) { + return false; + } + } + } + return true; + } + } + } + } + return false; + } +} + +class GrimoireThiefCounterspellEffect extends OneShotEffect { + + public GrimoireThiefCounterspellEffect() { + super(Outcome.Discard); + staticText = "Turn all cards exiled with {this} face up. Counter all spells with those names"; + } + + public GrimoireThiefCounterspellEffect(final GrimoireThiefCounterspellEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Cards cards = new CardsImpl(); + MageObject sourceObject = game.getObject(source.getSourceId()); + Set exileZones = (Set) game.getState().getValue(GrimoireThief.VALUE_PREFIX + source.getSourceId().toString()); + if (exileZones != null) { + for (ExileZone exileZone : game.getExile().getExileZones()) { + if (!exileZone.isEmpty()) { + cards.addAll(exileZone.getCards(game)); + } + } + // set face up first + for (Card card : cards.getCards(game)) { + card.setFaceDown(false, game); + } + // then counter any with the same name as the card exiled with Grimoire Thief + for (Card card : cards.getCards(game)) { + for (Iterator iterator = game.getStack().iterator(); iterator.hasNext();) { + StackObject stackObject = iterator.next(); + MageObject mageObject = game.getObject(card.getId()); + // handle split cards + if (mageObject instanceof SplitCard) { + if (stackObject instanceof Spell + && (stackObject.getName().contains(((SplitCard)mageObject).getLeftHalfCard().getName()) + || stackObject.getName().contains(((SplitCard)mageObject).getRightHalfCard().getName()))) { + Spell spell = (Spell) stackObject; + spell.counter(source.getSourceId(), game); + game.informPlayers(sourceObject.getLogName() + ": the split-card spell named " + spell.getName() + " was countered."); + } + } + if (stackObject instanceof Spell + && stackObject.getName().contains(card.getName())) { + Spell spell = (Spell) stackObject; + spell.counter(source.getSourceId(), game); + game.informPlayers(sourceObject.getLogName() + ": the spell named " + spell.getName() + " was countered."); + } + } + } + return true; + } + return false; + } + + @Override + public GrimoireThiefCounterspellEffect copy() { + return new GrimoireThiefCounterspellEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/IdyllicTutor.java b/Mage.Sets/src/mage/sets/morningtide/IdyllicTutor.java index 9663c6739a9..f224f660074 100644 --- a/Mage.Sets/src/mage/sets/morningtide/IdyllicTutor.java +++ b/Mage.Sets/src/mage/sets/morningtide/IdyllicTutor.java @@ -28,11 +28,10 @@ package mage.sets.morningtide; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInLibrary; @@ -42,7 +41,7 @@ import mage.target.common.TargetCardInLibrary; */ public class IdyllicTutor extends CardImpl { - private static final FilterCard filter = new FilterCard("enchantment"); + private static final FilterCard filter = new FilterCard("an enchantment"); static { filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); @@ -52,7 +51,6 @@ public class IdyllicTutor extends CardImpl { super(ownerId, 12, "Idyllic Tutor", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}"); this.expansionSetCode = "MOR"; - // Search your library for an enchantment card, reveal it, and put it into your hand. Then shuffle your library. this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true)); } diff --git a/Mage.Sets/src/mage/sets/morningtide/KinsbaileBorderguard.java b/Mage.Sets/src/mage/sets/morningtide/KinsbaileBorderguard.java new file mode 100644 index 00000000000..5080aa2baa5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/KinsbaileBorderguard.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.Counter; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.KithkinToken; + +/** + * + * @author LoneFox + */ +public class KinsbaileBorderguard extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent(); + + static { + filter.add(new SubtypePredicate("Kithkin")); + } + + public KinsbaileBorderguard(UUID ownerId) { + super(ownerId, 14, "Kinsbaile Borderguard", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Kithkin"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Kinsbaile Borderguard enters the battlefield with a +1/+1 counter on it for each other Kithkin you control. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), + new PermanentsOnBattlefieldCount(filter), true), "with a +1/+1 counter on it for each other Kithkin you control")); + // When Kinsbaile Borderguard dies, put a 1/1 white Kithkin Soldier creature token onto the battlefield for each counter on it. + this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new KithkinToken(), new AllCountersCount()))); + } + + public KinsbaileBorderguard(final KinsbaileBorderguard card) { + super(card); + } + + @Override + public KinsbaileBorderguard copy() { + return new KinsbaileBorderguard(this); + } +} + +class AllCountersCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(sourceAbility.getSourceId()); + if(sourcePermanent != null) { + int total = 0; + for(Counter counter : sourcePermanent.getCounters().values()) { + total += counter.getCount(); + } + return total; + } + return 0; + } + + @Override + public DynamicValue copy() { + return new AllCountersCount(); + } + + @Override + public String getMessage() { + return "for each counter on it"; + } + + @Override + public String toString() { + return "1"; + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/KinsbaileCavalier.java b/Mage.Sets/src/mage/sets/morningtide/KinsbaileCavalier.java index c7bacdd92a1..a16e1c7aadf 100644 --- a/Mage.Sets/src/mage/sets/morningtide/KinsbaileCavalier.java +++ b/Mage.Sets/src/mage/sets/morningtide/KinsbaileCavalier.java @@ -47,7 +47,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class KinsbaileCavalier extends CardImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Knight"); + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Knight creatures"); static { filter.add(new SubtypePredicate("Knight")); diff --git a/Mage.Sets/src/mage/sets/morningtide/LeafCrownedElder.java b/Mage.Sets/src/mage/sets/morningtide/LeafCrownedElder.java index 29bf162db7e..80824610284 100644 --- a/Mage.Sets/src/mage/sets/morningtide/LeafCrownedElder.java +++ b/Mage.Sets/src/mage/sets/morningtide/LeafCrownedElder.java @@ -55,10 +55,10 @@ public class LeafCrownedElder extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(5); - // Kinship - At the beginning of your upkeep, you may look at the top card of your library. If it shares a creature type with Leaf-Crowned Elder, you may reveal it. + // Kinship - At the beginning of your upkeep, you may look at the top card of your library. If it shares a creature type with Leaf-Crowned Elder, you may reveal it. // If you do, you may play that card without paying its mana cost. this.addAbility(new KinshipAbility(new LeafCrownedElderPlayEffect())); - + } public LeafCrownedElder(final LeafCrownedElder card) { @@ -84,18 +84,11 @@ class LeafCrownedElderPlayEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); Card card = game.getCard(getTargetPointer().getFirst(game, source)); - if (player != null && card != null) { - if (player.chooseUse(Outcome.PlayForFree, "Play " + card.getName() + " without paying its mana cost?", source, game)) { - if (card.getCardType().contains(CardType.LAND)) { - // If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn. - if (game.getActivePlayerId().equals(player.getId()) && player.canPlayLand()) { - player.playLand(card, game); - } - } else { - player.cast(card.getSpellAbility(), game, true); - } + if (controller != null && card != null) { + if (controller.chooseUse(Outcome.PlayForFree, "Play " + card.getIdName() + " without paying its mana cost?", source, game)) { + controller.playCard(card, game, true, true); } return true; } diff --git a/Mage.Sets/src/mage/sets/morningtide/LunkErrant.java b/Mage.Sets/src/mage/sets/morningtide/LunkErrant.java new file mode 100644 index 00000000000..4c73889e2ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/LunkErrant.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LunkErrant extends CardImpl { + + public LunkErrant(UUID ownerId) { + super(ownerId, 94, "Lunk Errant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{R}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Giant"); + this.subtype.add("Warrior"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever Lunk Errant attacks alone, it gets +1/+1 and gains trample until end of turn. + Effect effect = new BoostSourceEffect(1, 1, Duration.EndOfTurn); + effect.setText("it gets +1/+1"); + Ability ability = new AttacksAloneTriggeredAbility(effect); + effect = new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains trample until end of turn"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public LunkErrant(final LunkErrant card) { + super(card); + } + + @Override + public LunkErrant copy() { + return new LunkErrant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/MerrowWitsniper.java b/Mage.Sets/src/mage/sets/morningtide/MerrowWitsniper.java new file mode 100644 index 00000000000..7d58ed18646 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/MerrowWitsniper.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class MerrowWitsniper extends CardImpl { + + public MerrowWitsniper(UUID ownerId) { + super(ownerId, 40, "Merrow Witsniper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Merfolk"); + this.subtype.add("Rogue"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Merrow Witsniper enters the battlefield, target player puts the top card of his or her library into his or her graveyard. + Ability ability = new EntersBattlefieldTriggeredAbility(new PutLibraryIntoGraveTargetEffect(1)); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public MerrowWitsniper(final MerrowWitsniper card) { + super(card); + } + + @Override + public MerrowWitsniper copy() { + return new MerrowWitsniper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/NotoriousThrong.java b/Mage.Sets/src/mage/sets/morningtide/NotoriousThrong.java new file mode 100644 index 00000000000..d943672f4a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/NotoriousThrong.java @@ -0,0 +1,112 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.condition.common.ProwlCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; +import mage.abilities.keyword.ProwlAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.token.FaerieRogueToken; +import mage.players.Player; +import mage.watchers.common.AmountOfDamageAPlayerReceivedThisTurnWatcher; + +/** + * + * @author LoneFox + */ +public class NotoriousThrong extends CardImpl { + + public NotoriousThrong(UUID ownerId) { + super(ownerId, 45, "Notorious Throng", Rarity.RARE, new CardType[]{CardType.TRIBAL, CardType.SORCERY}, "{3}{U}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Rogue"); + + // Prowl {5}{U} + this.addAbility(new ProwlAbility(this, "{5}{U}")); + // Put X 1/1 black Faerie Rogue creature tokens with flying onto the battlefield, where X is the damage dealt to your opponents this turn. + this.getSpellAbility().addEffect(new NotoriousThrongEffect()); + this.getSpellAbility().addWatcher(new AmountOfDamageAPlayerReceivedThisTurnWatcher()); + // If Notorious Throng's prowl cost was paid, take an extra turn after this one. + Effect effect = new ConditionalOneShotEffect(new AddExtraTurnControllerEffect(), ProwlCondition.getInstance()); + effect.setText("If {this}'s prowl cost was paid, take an extra turn after this one."); + this.getSpellAbility().addEffect(effect); + } + + public NotoriousThrong(final NotoriousThrong card) { + super(card); + } + + @Override + public NotoriousThrong copy() { + return new NotoriousThrong(this); + } +} + +class NotoriousThrongEffect extends OneShotEffect { + + public NotoriousThrongEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "Put X 1/1 black Faerie Rogue creature tokens with flying onto the battlefield, where X is the damage dealt to your opponents this turn"; + } + + public NotoriousThrongEffect(NotoriousThrongEffect effect) { + super(effect); + } + + @Override + public NotoriousThrongEffect copy() { + return new NotoriousThrongEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + AmountOfDamageAPlayerReceivedThisTurnWatcher watcher = (AmountOfDamageAPlayerReceivedThisTurnWatcher) game.getState().getWatchers().get("AmountOfDamageReceivedThisTurn"); + if(controller != null && watcher != null) { + int numTokens = 0; + for(UUID opponentId: game.getOpponents(controller.getId())) { + numTokens += watcher.getAmountOfDamageReceivedThisTurn(opponentId); + } + if(numTokens > 0) { + new CreateTokenEffect(new FaerieRogueToken(), numTokens).apply(game, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/OonasBlackguard.java b/Mage.Sets/src/mage/sets/morningtide/OonasBlackguard.java index 624ac5cf2dc..e652196c9d1 100644 --- a/Mage.Sets/src/mage/sets/morningtide/OonasBlackguard.java +++ b/Mage.Sets/src/mage/sets/morningtide/OonasBlackguard.java @@ -45,6 +45,7 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -102,7 +103,7 @@ class OonasBlackguardReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getTargetId()); + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); if (creature != null && creature.getControllerId().equals(source.getControllerId()) && creature.getCardType().contains(CardType.CREATURE) && creature.hasSubtype("Rogue") @@ -119,7 +120,7 @@ class OonasBlackguardReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getTargetId()); + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); if (creature != null) { creature.addCounters(CounterType.P1P1.createInstance(), game); } diff --git a/Mage.Sets/src/mage/sets/morningtide/PrimalBeyond.java b/Mage.Sets/src/mage/sets/morningtide/PrimalBeyond.java index c58aba7dd96..ff3738c83a0 100644 --- a/Mage.Sets/src/mage/sets/morningtide/PrimalBeyond.java +++ b/Mage.Sets/src/mage/sets/morningtide/PrimalBeyond.java @@ -46,7 +46,6 @@ import mage.constants.Rarity; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; - import mage.target.common.TargetCardInHand; /** @@ -54,25 +53,24 @@ import mage.target.common.TargetCardInHand; * @author TGower */ public class PrimalBeyond extends CardImpl { - + private static final FilterCard filter = new FilterCard("a Elemental card from your hand"); - + static { filter.add(new SubtypePredicate("Elemental")); } - public PrimalBeyond(UUID ownerId) { super(ownerId, 149, "Primal Beyond", Rarity.RARE, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "MOR"; - + // As Primal Beyond enters the battlefield, you may reveal an Elemental card from your hand. If you don't, Primal Beyond enters the battlefield tapped. this.addAbility(new AsEntersBattlefieldAbility(new TapSourceUnlessPaysEffect(new RevealTargetFromHandCost(new TargetCardInHand(filter))), "you may reveal a Elemental card from your hand. If you don't, {this} enters the battlefield tapped")); // {tap}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); // {tap}: Add one mana of any color to your mana pool. Spend this mana only to cast an Elemental spell or activate an ability of an Elemental. - Ability ability = new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new PrimalBeyondManaBuilder(), true); - this.addAbility(ability); + Ability ability = new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new PrimalBeyondManaBuilder(), true); + this.addAbility(ability); } public PrimalBeyond(final PrimalBeyond card) { @@ -85,7 +83,6 @@ public class PrimalBeyond extends CardImpl { } } - class PrimalBeyondManaBuilder extends ConditionalManaBuilder { @Override @@ -113,9 +110,6 @@ class PrimalBeyondManaCondition implements Condition { @Override public boolean apply(Game game, Ability source) { MageObject object = game.getObject(source.getSourceId()); - if (object != null && object.hasSubtype("Elemental")) { - return true; - } - return false; + return object != null && object.hasSubtype("Elemental"); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/morningtide/RecrossThePaths.java b/Mage.Sets/src/mage/sets/morningtide/RecrossThePaths.java index a1fdaf96195..e4841e300df 100644 --- a/Mage.Sets/src/mage/sets/morningtide/RecrossThePaths.java +++ b/Mage.Sets/src/mage/sets/morningtide/RecrossThePaths.java @@ -54,9 +54,9 @@ public class RecrossThePaths extends CardImpl { super(ownerId, 133, "Recross the Paths", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{G}"); this.expansionSetCode = "MOR"; - // Reveal cards from the top of your library until you reveal a land card. Put that card onto the battlefield and the rest on the bottom of your library in any order. + // Reveal cards from the top of your library until you reveal a land card. Put that card onto the battlefield and the rest on the bottom of your library in any order. this.getSpellAbility().addEffect(new RecrossThePathsEffect()); - + // Clash with an opponent. If you win, return Recross the Paths to its owner's hand. this.getSpellAbility().addEffect(ClashWinReturnToHandSpellEffect.getInstance()); } @@ -96,23 +96,23 @@ class RecrossThePathsEffect extends OneShotEffect { if (controller == null || sourceObject == null) { return false; } - + Cards cards = new CardsImpl(); Card cardFound = null; while (controller.getLibrary().size() > 0) { Card card = controller.getLibrary().removeFromTop(game); if (card != null) { - cards.add(card); - if (filter.match(card, game)){ + cards.add(card); + if (filter.match(card, game)) { cardFound = card; break; } - } + } } if (!cards.isEmpty()) { - controller.revealCards(sourceObject.getName(), cards, game); + controller.revealCards(sourceObject.getIdName(), cards, game); if (cardFound != null) { - controller.putOntoBattlefieldWithInfo(cardFound, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(cardFound, Zone.BATTLEFIELD, source, game); cards.remove(cardFound); } controller.putCardsOnBottomOfLibrary(cards, game, source, true); diff --git a/Mage.Sets/src/mage/sets/morningtide/SageOfFables.java b/Mage.Sets/src/mage/sets/morningtide/SageOfFables.java index c7a423909b4..ee007b91f51 100644 --- a/Mage.Sets/src/mage/sets/morningtide/SageOfFables.java +++ b/Mage.Sets/src/mage/sets/morningtide/SageOfFables.java @@ -44,6 +44,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -64,7 +65,7 @@ public class SageOfFables extends CardImpl { // Each other Wizard creature you control enters the battlefield with an additional +1/+1 counter on it. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SageOfFablesReplacementEffect())); - + // {2}, Remove a +1/+1 counter from a creature you control: Draw a card. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(2)); ability.addCost(new RemoveCounterCost(new TargetControlledCreaturePermanent(), CounterType.P1P1)); @@ -91,16 +92,16 @@ class SageOfFablesReplacementEffect extends ReplacementEffectImpl { SageOfFablesReplacementEffect(SageOfFablesReplacementEffect effect) { super(effect); } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getTargetId()); - return creature != null && creature.getControllerId().equals(source.getControllerId()) + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); + return creature != null && creature.getControllerId().equals(source.getControllerId()) && creature.getCardType().contains(CardType.CREATURE) && creature.getSubtype().contains("Wizard") && !event.getTargetId().equals(source.getSourceId()); @@ -113,14 +114,13 @@ class SageOfFablesReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getTargetId()); + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); if (creature != null) { creature.addCounters(CounterType.P1P1.createInstance(), game); } return false; } - @Override public SageOfFablesReplacementEffect copy() { return new SageOfFablesReplacementEffect(this); diff --git a/Mage.Sets/src/mage/sets/morningtide/SagesDousing.java b/Mage.Sets/src/mage/sets/morningtide/SagesDousing.java new file mode 100644 index 00000000000..d6c235a11ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/SagesDousing.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetSpell; + +/** + * + * @author fireshoes + */ +public class SagesDousing extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Wizard"); + + static { + filter.add(new SubtypePredicate("Wizard")); + } + + public SagesDousing(UUID ownerId) { + super(ownerId, 48, "Sage's Dousing", Rarity.UNCOMMON, new CardType[]{CardType.TRIBAL, CardType.INSTANT}, "{2}{U}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Wizard"); + + // Counter target spell unless its controller pays {3}. + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(3))); + + // If you control a Wizard, draw a card. + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DrawCardSourceControllerEffect(1), + new PermanentsOnTheBattlefieldCondition(filter),"If you control a Wizard, draw a card")); + } + + public SagesDousing(final SagesDousing card) { + super(card); + } + + @Override + public SagesDousing copy() { + return new SagesDousing(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/Scapeshift.java b/Mage.Sets/src/mage/sets/morningtide/Scapeshift.java index f1c69c592e4..5e7f57e6dd5 100644 --- a/Mage.Sets/src/mage/sets/morningtide/Scapeshift.java +++ b/Mage.Sets/src/mage/sets/morningtide/Scapeshift.java @@ -27,16 +27,14 @@ */ package mage.sets.morningtide; -import java.util.List; import java.util.UUID; - +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.CardImpl; import mage.constants.Zone; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.common.FilterLandCard; @@ -56,7 +54,6 @@ public class Scapeshift extends CardImpl { super(ownerId, 136, "Scapeshift", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); this.expansionSetCode = "MOR"; - // Sacrifice any number of lands. Search your library for that many land cards, put them onto the battlefield tapped, then shuffle your library. this.getSpellAbility().addEffect(new ScapeshiftEffect()); } @@ -71,12 +68,11 @@ public class Scapeshift extends CardImpl { } } - class ScapeshiftEffect extends OneShotEffect { public ScapeshiftEffect() { super(Outcome.Neutral); - staticText = "Sacrifice any number of lands. Search your library for that many land cards, put them onto the battlefield tapped, then shuffle your library"; + staticText = "Sacrifice any number of lands. Search your library for that many land cards, put them onto the battlefield tapped, then shuffle your library"; } public ScapeshiftEffect(final ScapeshiftEffect effect) { @@ -90,35 +86,29 @@ class ScapeshiftEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null){ + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } int amount = 0; TargetControlledPermanent sacrificeLand = new TargetControlledPermanent(0, Integer.MAX_VALUE, new FilterControlledLandPermanent("lands you control"), true); - if(player.chooseTarget(Outcome.Sacrifice, sacrificeLand, source, game)){ - for(Object uuid : sacrificeLand.getTargets()){ - Permanent land = game.getPermanent((UUID)uuid); - if(land != null){ + if (controller.chooseTarget(Outcome.Sacrifice, sacrificeLand, source, game)) { + for (Object uuid : sacrificeLand.getTargets()) { + Permanent land = game.getPermanent((UUID) uuid); + if (land != null) { land.sacrifice(source.getSourceId(), game); amount++; } } } TargetCardInLibrary target = new TargetCardInLibrary(amount, new FilterLandCard("lands")); - if (player.searchLibrary(target, game)) { - if (target.getTargets().size() > 0) { - for (UUID cardId: (List)target.getTargets()) { - Card card = player.getLibrary().getCard(cardId, game); - if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getControllerId(), true); - } - } - } - player.shuffleLibrary(game); + if (controller.searchLibrary(target, game)) { + controller.moveCards(new CardsImpl(target.getTargets()).getCards(game), + Zone.BATTLEFIELD, source, game, true, false, false, null); + controller.shuffleLibrary(game); return true; } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return false; } diff --git a/Mage.Sets/src/mage/sets/morningtide/StinkdrinkerBandit.java b/Mage.Sets/src/mage/sets/morningtide/StinkdrinkerBandit.java new file mode 100644 index 00000000000..82fecdc17ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/StinkdrinkerBandit.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.abilities.effects.Effect; +import mage.abilities.common.SimpleTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.ProwlAbility; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.filter.predicate.permanent.BlockedPredicate; +import mage.game.events.GameEvent; + +/** + * + * @author BursegSardaukar + */ +public class StinkdrinkerBandit extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Attacking and unblocked Rogues"); + + static { + filter.add(new SubtypePredicate("Rogue")); + filter.add(new AttackingPredicate()); + filter.add(Predicates.not(new BlockedPredicate())); + } + + public StinkdrinkerBandit(UUID ownerId) { + super(ownerId, 80, "Stinkdrinker Bandit", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Goblin"); + this.subtype.add("Rogue"); + + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Prowl {1}, {B} (You may cast this for its prowl cost if you dealt combat damage to a player this turn with a Goblin or Rogue.) + this.addAbility(new ProwlAbility(this, "{1}{B}")); + + // Whenever a Rogue you control attacks and isn't blocked, it gets +2/+1 until end of turn. + Effect effect = new BoostControlledEffect(2,1,Duration.EndOfTurn, filter); + Ability ability = new SimpleTriggeredAbility(Zone.BATTLEFIELD, GameEvent.EventType.DECLARED_BLOCKERS, effect, "Whenever a Rogue you control attacks and isn't blocked,"); + this.addAbility(ability); + } + + public StinkdrinkerBandit(final StinkdrinkerBandit card) { + super(card); + } + + @Override + public StinkdrinkerBandit copy() { + return new StinkdrinkerBandit(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/morningtide/StonybrookSchoolmaster.java b/Mage.Sets/src/mage/sets/morningtide/StonybrookSchoolmaster.java index 691d5c6c073..f4c59c8063f 100644 --- a/Mage.Sets/src/mage/sets/morningtide/StonybrookSchoolmaster.java +++ b/Mage.Sets/src/mage/sets/morningtide/StonybrookSchoolmaster.java @@ -29,7 +29,7 @@ package mage.sets.morningtide; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -51,7 +51,7 @@ public class StonybrookSchoolmaster extends CardImpl { this.toughness = new MageInt(2); // Whenever Stonybrook Schoolmaster becomes tapped, you may put a 1/1 blue Merfolk Wizard creature token onto the battlefield. - this.addAbility(new BecomesTappedTriggeredAbility(new CreateTokenEffect(new MerfolkWizardToken()), true)); + this.addAbility(new BecomesTappedSourceTriggeredAbility(new CreateTokenEffect(new MerfolkWizardToken()), true)); } public StonybrookSchoolmaster(final StonybrookSchoolmaster card) { @@ -62,4 +62,4 @@ public class StonybrookSchoolmaster extends CardImpl { public StonybrookSchoolmaster copy() { return new StonybrookSchoolmaster(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/morningtide/StreamOfUnconsciousness.java b/Mage.Sets/src/mage/sets/morningtide/StreamOfUnconsciousness.java new file mode 100644 index 00000000000..dceb753b77e --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/StreamOfUnconsciousness.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class StreamOfUnconsciousness extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Wizard"); + + static { + filter.add(new SubtypePredicate("Wizard")); + } + + public StreamOfUnconsciousness(UUID ownerId) { + super(ownerId, 52, "Stream of Unconsciousness", Rarity.COMMON, new CardType[]{CardType.TRIBAL, CardType.INSTANT}, "{U}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Wizard"); + + // Target creature gets -4/-0 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(-4, 0, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // If you control a Wizard, draw a card. + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DrawCardSourceControllerEffect(1), + new PermanentsOnTheBattlefieldCondition(filter),"If you control a Wizard, draw a card")); + } + + public StreamOfUnconsciousness(final StreamOfUnconsciousness card) { + super(card); + } + + @Override + public StreamOfUnconsciousness copy() { + return new StreamOfUnconsciousness(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/VendilionClique.java b/Mage.Sets/src/mage/sets/morningtide/VendilionClique.java index 8a69fe999c5..fcc33b174d6 100644 --- a/Mage.Sets/src/mage/sets/morningtide/VendilionClique.java +++ b/Mage.Sets/src/mage/sets/morningtide/VendilionClique.java @@ -28,10 +28,8 @@ package mage.sets.morningtide; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -40,7 +38,9 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardsImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterNonlandCard; import mage.game.Game; @@ -85,6 +85,7 @@ public class VendilionClique extends CardImpl { } class VendilionCliqueEffect extends OneShotEffect { + VendilionCliqueEffect() { super(Outcome.Discard); staticText = "look at target player's hand. You may choose a nonland card from it. If you do, that player reveals the chosen card, puts it on the bottom of his or her library, then draws a card"; @@ -97,17 +98,18 @@ class VendilionCliqueEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); - Player sourcePlayer = game.getPlayer(source.getControllerId()); - if (player != null && sourcePlayer != null) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (player != null && controller != null && sourceObject != null) { TargetCard targetCard = new TargetCard(Zone.ALL, new FilterNonlandCard()); targetCard.setRequired(false); - if (sourcePlayer.choose(Outcome.Discard, player.getHand(), targetCard, game)) { - Card c = game.getCard(targetCard.getFirstTarget()); - if (c != null) { + if (controller.choose(Outcome.Discard, player.getHand(), targetCard, game)) { + Card card = game.getCard(targetCard.getFirstTarget()); + if (card != null) { CardsImpl cards = new CardsImpl(); - cards.add(c); - player.revealCards("Vendilion Clique effect", cards, game); - c.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); + cards.add(card); + player.revealCards(sourceObject.getIdName(), cards, game); + player.putCardsOnBottomOfLibrary(cards, game, source, true); player.drawCards(1, game); } } @@ -120,4 +122,4 @@ class VendilionCliqueEffect extends OneShotEffect { public VendilionCliqueEffect copy() { return new VendilionCliqueEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/morningtide/VengefulFirebrand.java b/Mage.Sets/src/mage/sets/morningtide/VengefulFirebrand.java new file mode 100644 index 00000000000..2ce4e29736b --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/VengefulFirebrand.java @@ -0,0 +1,103 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class VengefulFirebrand extends CardImpl { + + public VengefulFirebrand(UUID ownerId) { + super(ownerId, 111, "Vengeful Firebrand", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Elemental"); + this.subtype.add("Warrior"); + this.power = new MageInt(5); + this.toughness = new MageInt(2); + + // Vengeful Firebrand has haste as long as a Warrior card is in your graveyard. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield), + VengefulFirebrandCondition.getInstance(), + "{this} has haste as long as a Warrior card is in your graveyard"))); + + // {R}: Vengeful Firebrand gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public VengefulFirebrand(final VengefulFirebrand card) { + super(card); + } + + @Override + public VengefulFirebrand copy() { + return new VengefulFirebrand(this); + } +} + +class VengefulFirebrandCondition implements Condition { + + private static VengefulFirebrandCondition fInstance = new VengefulFirebrandCondition(); + private static final FilterCard filter = new FilterCard("Warrior"); + + static { + filter.add(new SubtypePredicate("Warrior")); + } + + public static Condition getInstance() { + return fInstance; + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + return player != null && player.getGraveyard().count(filter, game) > 0; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/morningtide/VioletPall.java b/Mage.Sets/src/mage/sets/morningtide/VioletPall.java index 7b760e28e44..b76090f5c2e 100644 --- a/Mage.Sets/src/mage/sets/morningtide/VioletPall.java +++ b/Mage.Sets/src/mage/sets/morningtide/VioletPall.java @@ -28,18 +28,16 @@ package mage.sets.morningtide; import java.util.UUID; -import mage.MageInt; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.ObjectColor; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DestroyTargetEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.FaerieRogueToken; import mage.target.common.TargetCreaturePermanent; /** @@ -61,7 +59,7 @@ public class VioletPall extends CardImpl { this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); - this.getSpellAbility().addEffect(new CreateTokenEffect(new VioletPallFaerieToken(), 1)); + this.getSpellAbility().addEffect(new CreateTokenEffect(new FaerieRogueToken(), 1)); } public VioletPall(final VioletPall card) { @@ -73,17 +71,3 @@ public class VioletPall extends CardImpl { return new VioletPall(this); } } - -class VioletPallFaerieToken extends Token { - - VioletPallFaerieToken() { - super("Faerie Rogue", "1/1 black Faerie Rogue creature token with flying"); - cardType.add(CardType.CREATURE); - color.setBlack(true); - subtype.add("Faerie"); - subtype.add("Rogue"); - power = new MageInt(1); - toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/morningtide/WeedPrunerPoplar.java b/Mage.Sets/src/mage/sets/morningtide/WeedPrunerPoplar.java new file mode 100644 index 00000000000..7bba0a6d3b1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/WeedPrunerPoplar.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.morningtide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class WeedPrunerPoplar extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature other than {this}"); + + static { + filter.add(new AnotherPredicate()); + } + + public WeedPrunerPoplar(UUID ownerId) { + super(ownerId, 83, "Weed-Pruner Poplar", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Treefolk"); + this.subtype.add("Assassin"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // At the beginning of your upkeep, target creature other than Weed-Pruner Poplar gets -1/-1 until end of turn. + Ability ability = new BeginningOfUpkeepTriggeredAbility(new BoostTargetEffect(-1, -1, Duration.EndOfTurn), TargetController.YOU, false); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public WeedPrunerPoplar(final WeedPrunerPoplar card) { + super(card); + } + + @Override + public WeedPrunerPoplar copy() { + return new WeedPrunerPoplar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/WeirdingShaman.java b/Mage.Sets/src/mage/sets/morningtide/WeirdingShaman.java index 8bc8b3e8eb4..063142396ed 100644 --- a/Mage.Sets/src/mage/sets/morningtide/WeirdingShaman.java +++ b/Mage.Sets/src/mage/sets/morningtide/WeirdingShaman.java @@ -41,7 +41,7 @@ import mage.cards.CardImpl; import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinRogueToken; import mage.target.common.TargetControlledPermanent; /** @@ -64,7 +64,7 @@ public class WeirdingShaman extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new goblinRogueToken(), 2), new ManaCostsImpl("{3}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new GoblinRogueToken(), 2), new ManaCostsImpl("{3}{B}")); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); } @@ -78,15 +78,3 @@ public class WeirdingShaman extends CardImpl { return new WeirdingShaman(this); } } - -class goblinRogueToken extends Token { - goblinRogueToken() { - super("Goblin", "1/1 black Goblin Rogue creature tokens"); - cardType.add(CardType.CREATURE); - color.setBlack(true); - subtype.add("Goblin"); - subtype.add("Rogue"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/nemesis/AncientHydra.java b/Mage.Sets/src/mage/sets/nemesis/AncientHydra.java new file mode 100644 index 00000000000..a9ea30a9979 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/AncientHydra.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FadingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class AncientHydra extends CardImpl { + + public AncientHydra(UUID ownerId) { + super(ownerId, 76, "Ancient Hydra", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Hydra"); + this.power = new MageInt(5); + this.toughness = new MageInt(1); + + // Fading 5 + this.addAbility(new FadingAbility(5, this)); + // {1}, Remove a fade counter from Ancient Hydra: Ancient Hydra deals 1 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}")); + ability.addCost(new RemoveCountersSourceCost(CounterType.FADE.createInstance(1))); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public AncientHydra(final AncientHydra card) { + super(card); + } + + @Override + public AncientHydra copy() { + return new AncientHydra(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/AnimateLand.java b/Mage.Sets/src/mage/sets/nemesis/AnimateLand.java new file mode 100644 index 00000000000..04a11385bea --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/AnimateLand.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.permanent.token.Token; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class AnimateLand extends CardImpl { + + public AnimateLand(UUID ownerId) { + super(ownerId, 101, "Animate Land", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "NMS"; + + // Until end of turn, target land becomes a 3/3 creature that's still a land. + this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new AnimatedLand(), false, true, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + } + + public AnimateLand(final AnimateLand card) { + super(card); + } + + @Override + public AnimateLand copy() { + return new AnimateLand(this); + } +} + +class AnimatedLand extends Token { + + public AnimatedLand() { + super("", "3/3 creature"); + this.cardType.add(CardType.CREATURE); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/AvengerEnDal.java b/Mage.Sets/src/mage/sets/nemesis/AvengerEnDal.java new file mode 100644 index 00000000000..9875b337a52 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/AvengerEnDal.java @@ -0,0 +1,110 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetAttackingCreature; + +/** + * + * @author fireshoes + */ +public class AvengerEnDal extends CardImpl { + + public AvengerEnDal(UUID ownerId) { + super(ownerId, 2, "Avenger en-Dal", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {2}{W}, {tap}, Discard a card: Exile target attacking creature. Its controller gains life equal to its toughness. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new ManaCostsImpl("{2}{W}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetAttackingCreature()); + ability.addEffect(new AvengerEnDalEffect()); + this.addAbility(ability); + } + + public AvengerEnDal(final AvengerEnDal card) { + super(card); + } + + @Override + public AvengerEnDal copy() { + return new AvengerEnDal(this); + } +} + +class AvengerEnDalEffect extends OneShotEffect { + + public AvengerEnDalEffect() { + super(Outcome.GainLife); + staticText = "Its controller gains life equal to its toughness"; + } + + public AvengerEnDalEffect(final AvengerEnDalEffect effect) { + super(effect); + } + + @Override + public AvengerEnDalEffect copy() { + return new AvengerEnDalEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + if (permanent != null) { + Player player = game.getPlayer(permanent.getControllerId()); + if (player != null) { + player.gainLife(permanent.getToughness().getValue(), game); + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/nemesis/BattlefieldPercher.java b/Mage.Sets/src/mage/sets/nemesis/BattlefieldPercher.java new file mode 100644 index 00000000000..7d4698c545f --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/BattlefieldPercher.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class BattlefieldPercher extends CardImpl { + + public BattlefieldPercher(UUID ownerId) { + super(ownerId, 52, "Battlefield Percher", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Battlefield Percher can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + // {1}{B}: Battlefield Percher gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), + new ManaCostsImpl("{1}{B}"))); + } + + public BattlefieldPercher(final BattlefieldPercher card) { + super(card); + } + + @Override + public BattlefieldPercher copy() { + return new BattlefieldPercher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/BelbesPercher.java b/Mage.Sets/src/mage/sets/nemesis/BelbesPercher.java new file mode 100644 index 00000000000..cf18440b8ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/BelbesPercher.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class BelbesPercher extends CardImpl { + + public BelbesPercher(UUID ownerId) { + super(ownerId, 53, "Belbe's Percher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Belbe's Percher can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + } + + public BelbesPercher(final BelbesPercher card) { + super(card); + } + + @Override + public BelbesPercher copy() { + return new BelbesPercher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/Daze.java b/Mage.Sets/src/mage/sets/nemesis/Daze.java index 5cdf8ec4c8c..ecb769b3740 100644 --- a/Mage.Sets/src/mage/sets/nemesis/Daze.java +++ b/Mage.Sets/src/mage/sets/nemesis/Daze.java @@ -29,7 +29,7 @@ package mage.sets.nemesis; import java.util.UUID; import mage.abilities.costs.AlternativeCostSourceAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CounterUnlessPaysEffect; import mage.cards.CardImpl; @@ -60,7 +60,7 @@ public class Daze extends CardImpl { // You may return an Island you control to its owner's hand rather than pay Daze's mana cost. - this.addAbility(new AlternativeCostSourceAbility(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter)))); + this.addAbility(new AlternativeCostSourceAbility(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter)))); // Counter target spell unless its controller pays {1}. this.getSpellAbility().addTarget(new TargetSpell()); diff --git a/Mage.Sets/src/mage/sets/nemesis/DefenderEnVec.java b/Mage.Sets/src/mage/sets/nemesis/DefenderEnVec.java new file mode 100644 index 00000000000..e6a7c7557f9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/DefenderEnVec.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.keyword.FadingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class DefenderEnVec extends CardImpl { + + public DefenderEnVec(UUID ownerId) { + super(ownerId, 5, "Defender en-Vec", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Fading 4 + this.addAbility(new FadingAbility(4, this)); + + // Remove a fade counter from Defender en-Vec: Prevent the next 2 damage that would be dealt to target creature or player this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new PreventDamageToTargetEffect(Duration.EndOfTurn, 2), new RemoveCountersSourceCost(CounterType.FADE.createInstance())); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public DefenderEnVec(final DefenderEnVec card) { + super(card); + } + + @Override + public DefenderEnVec copy() { + return new DefenderEnVec(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/DefiantFalcon.java b/Mage.Sets/src/mage/sets/nemesis/DefiantFalcon.java new file mode 100644 index 00000000000..ea6c267313c --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/DefiantFalcon.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author fireshoes + */ +public class DefiantFalcon extends CardImpl { + + private static final FilterPermanentCard filter = new FilterPermanentCard("Rebel permanent card with converted mana cost 3 or less"); + + static { + filter.add(new SubtypePredicate("Rebel")); + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 4)); + } + + public DefiantFalcon(UUID ownerId) { + super(ownerId, 6, "Defiant Falcon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Rebel"); + this.subtype.add("Bird"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // {4}, {tap}: Search your library for a Rebel permanent card with converted mana cost 3 or less and put it onto the battlefield. Then shuffle your library. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), false), + new ManaCostsImpl("{4}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public DefiantFalcon(final DefiantFalcon card) { + super(card); + } + + @Override + public DefiantFalcon copy() { + return new DefiantFalcon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/Dominate.java b/Mage.Sets/src/mage/sets/nemesis/Dominate.java new file mode 100644 index 00000000000..6c03ea78ddb --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/Dominate.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Dominate extends CardImpl { + + public Dominate(UUID ownerId) { + super(ownerId, 31, "Dominate", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{X}{1}{U}{U}"); + this.expansionSetCode = "NMS"; + + // Gain control of target creature with converted mana cost X or less. + this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.Custom, true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with converted mana cost X or less"))); + } + + public Dominate(final Dominate card) { + super(card); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if(ability instanceof SpellAbility) { + ability.getTargets().clear(); + int xValue = ability.getManaCostsToPay().getX(); + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost X or less"); + filter.add(Predicates.not(new ConvertedManaCostPredicate(Filter.ComparisonType.GreaterThan, xValue))); + ability.addTarget(new TargetCreaturePermanent(filter)); + } + } + + @Override + public Dominate copy() { + return new Dominate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/DownhillCharge.java b/Mage.Sets/src/mage/sets/nemesis/DownhillCharge.java new file mode 100644 index 00000000000..cddd20e8ac1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/DownhillCharge.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.abilities.costs.AlternativeCostSourceAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DownhillCharge extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Mountain"); + + static { + filter.add(new SubtypePredicate("Mountain")); + } + + public DownhillCharge(UUID ownerId) { + super(ownerId, 79, "Downhill Charge", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); + this.expansionSetCode = "NMS"; + + // You may sacrifice a Mountain rather than pay Downhill Charge's mana cost. + this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(new TargetControlledPermanent(filter)))); + // Target creature gets +X/+0 until end of turn, where X is the number of Mountains you control. + Effect effect = new BoostTargetEffect(new PermanentsOnBattlefieldCount(filter), new StaticValue(0), Duration.EndOfTurn); + effect.setText("Target creature gets +X/+0 until end of turn, where X is the number of Mountains you control."); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public DownhillCharge(final DownhillCharge card) { + super(card); + } + + @Override + public DownhillCharge copy() { + return new DownhillCharge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/Ensnare.java b/Mage.Sets/src/mage/sets/nemesis/Ensnare.java new file mode 100644 index 00000000000..85295255c9a --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/Ensnare.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.abilities.costs.AlternativeCostSourceAbility; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; +import mage.abilities.effects.common.TapAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author fireshoes + */ +public class Ensnare extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("Islands"); + static{ + filter.add(new SubtypePredicate("Island")); + } + + public Ensnare(UUID ownerId) { + super(ownerId, 32, "Ensnare", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{U}"); + this.expansionSetCode = "NMS"; + + // You may return two Islands you control to their owner's hand rather than pay Ensnare's mana cost. + AlternativeCostSourceAbility ability; + ability = new AlternativeCostSourceAbility(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2, 2, filter, true))); + this.addAbility(ability); + + // Tap all creatures. + this.getSpellAbility().addEffect(new TapAllEffect(new FilterCreaturePermanent())); + } + + public Ensnare(final Ensnare card) { + super(card); + } + + @Override + public Ensnare copy() { + return new Ensnare(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/FlowstoneArmor.java b/Mage.Sets/src/mage/sets/nemesis/FlowstoneArmor.java new file mode 100644 index 00000000000..78ddf85917b --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/FlowstoneArmor.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FlowstoneArmor extends CardImpl { + + public FlowstoneArmor(UUID ownerId) { + super(ownerId, 131, "Flowstone Armor", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "NMS"; + + // You may choose not to untap Flowstone Armor during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {3}, {tap}: Target creature gets +1/-1 for as long as Flowstone Armor remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostTargetEffect(1, -1, Duration.Custom), SourceTappedCondition.getInstance(), + "target creature gets +1/-1 for as long as {this} remains tapped"), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FlowstoneArmor(final FlowstoneArmor card) { + super(card); + } + + @Override + public FlowstoneArmor copy() { + return new FlowstoneArmor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/FlowstoneCrusher.java b/Mage.Sets/src/mage/sets/nemesis/FlowstoneCrusher.java new file mode 100644 index 00000000000..6c85d1c1a37 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/FlowstoneCrusher.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FlowstoneCrusher extends mage.sets.ninthedition.FlowstoneCrusher { + + public FlowstoneCrusher(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "NMS"; + this.rarity = Rarity.COMMON; + } + + public FlowstoneCrusher(final FlowstoneCrusher card) { + super(card); + } + + @Override + public FlowstoneCrusher copy() { + return new FlowstoneCrusher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/Infiltrate.java b/Mage.Sets/src/mage/sets/nemesis/Infiltrate.java new file mode 100644 index 00000000000..cb8f7fbc9ea --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/Infiltrate.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author AlumiuN + */ +public class Infiltrate extends CardImpl { + + public Infiltrate(UUID ownerId) { + super(ownerId, 33, "Infiltrate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "NMS"; + + // Target creature is unblockable this turn. + this.getSpellAbility().addEffect(new CantBeBlockedTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public Infiltrate(final Infiltrate card) { + super(card); + } + + @Override + public Infiltrate copy() { + return new Infiltrate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/Lawbringer.java b/Mage.Sets/src/mage/sets/nemesis/Lawbringer.java new file mode 100644 index 00000000000..ab0b587a21e --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/Lawbringer.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Lawbringer extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("red creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public Lawbringer(UUID ownerId) { + super(ownerId, 10, "Lawbringer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Kor"); + this.subtype.add("Rebel"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {tap}, Sacrifice Lawbringer: Exile target red creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public Lawbringer(final Lawbringer card) { + super(card); + } + + @Override + public Lawbringer copy() { + return new Lawbringer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/Lightbringer.java b/Mage.Sets/src/mage/sets/nemesis/Lightbringer.java new file mode 100644 index 00000000000..aefe3b373cd --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/Lightbringer.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Lightbringer extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("black creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public Lightbringer(UUID ownerId) { + super(ownerId, 11, "Lightbringer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Kor"); + this.subtype.add("Rebel"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {tap}, Sacrifice Lightbringer: Exile target black creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public Lightbringer(final Lightbringer card) { + super(card); + } + + @Override + public Lightbringer copy() { + return new Lightbringer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/LinSivviDefiantHero.java b/Mage.Sets/src/mage/sets/nemesis/LinSivviDefiantHero.java new file mode 100644 index 00000000000..3748ad54259 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/LinSivviDefiantHero.java @@ -0,0 +1,145 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.Filter.ComparisonType; +import mage.filter.FilterCard; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.other.OwnerPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author fireshoes + */ +public class LinSivviDefiantHero extends CardImpl { + + private static final FilterCard filter = new FilterCard("Rebel card from your graveyard"); + + static { + filter.add(new OwnerPredicate(TargetController.YOU)); + filter.add(new SubtypePredicate("Rebel")); + } + + static final String rule = "Put target Rebel card from your graveyard on the bottom of your library"; + + public LinSivviDefiantHero(UUID ownerId) { + super(ownerId, 12, "Lin Sivvi, Defiant Hero", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "NMS"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Rebel"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // {X}, {tap}: Search your library for a Rebel permanent card with converted mana cost X or less and put it onto the battlefield. Then shuffle your library. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new LinSivviDefiantHeroEffect(), + new ManaCostsImpl("{X}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + // {3}: Put target Rebel card from your graveyard on the bottom of your library. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(false, rule), new GenericManaCost(3)); + ability.addTarget(new TargetCardInYourGraveyard(1, filter)); + this.addAbility(ability); + } + + public LinSivviDefiantHero(final LinSivviDefiantHero card) { + super(card); + } + + @Override + public LinSivviDefiantHero copy() { + return new LinSivviDefiantHero(this); + } +} + +class LinSivviDefiantHeroEffect extends OneShotEffect { + + public LinSivviDefiantHeroEffect() { + super(Outcome.DrawCard); + this.staticText = "Search your library for a Rebel permanent card with converted mana cost X or less and put it onto the battlefield. Then shuffle your library"; + } + + public LinSivviDefiantHeroEffect(final LinSivviDefiantHeroEffect effect) { + super(effect); + } + + @Override + public LinSivviDefiantHeroEffect copy() { + return new LinSivviDefiantHeroEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + + int xCost = source.getManaCostsToPay().getX(); + + FilterPermanentCard filter = new FilterPermanentCard(new StringBuilder("Rebel permanent card with converted mana cost ").append(xCost).append(" or less").toString()); + filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, xCost + 1)); + filter.add(new SubtypePredicate("Rebel")); + TargetCardInLibrary target = new TargetCardInLibrary(filter); + + if (controller.searchLibrary(target, game)) { + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); + if (card != null) { + controller.moveCards(card, Zone.BATTLEFIELD, source, game); + } + controller.shuffleLibrary(game); + return true; + } + controller.shuffleLibrary(game); + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/MoggAlarm.java b/Mage.Sets/src/mage/sets/nemesis/MoggAlarm.java new file mode 100644 index 00000000000..3a7e4d58fb1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/MoggAlarm.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.abilities.costs.AlternativeCostSourceAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.GoblinToken; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author markedagain + */ +public class MoggAlarm extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("two Mountains"); + static { + filter.add(new SubtypePredicate("Mountain")); + } + + public MoggAlarm(UUID ownerId) { + super(ownerId, 93, "Mogg Alarm", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); + this.expansionSetCode = "NMS"; + + // You may sacrifice two Mountains rather than pay Mogg Alarm's mana cost. + this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, filter, true)))); + // Put two 1/1 red Goblin creature tokens onto the battlefield. + this.getSpellAbility().addEffect(new CreateTokenEffect(new GoblinToken(),2)); + + } + + public MoggAlarm(final MoggAlarm card) { + super(card); + } + + @Override + public MoggAlarm copy() { + return new MoggAlarm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/Oraxid.java b/Mage.Sets/src/mage/sets/nemesis/Oraxid.java new file mode 100644 index 00000000000..137056a5cbb --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/Oraxid.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class Oraxid extends CardImpl { + + private static final FilterCard filter = new FilterCard("red"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public Oraxid(UUID ownerId) { + super(ownerId, 35, "Oraxid", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Crab"); + this.subtype.add("Beast"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Protection from red + this.addAbility(new ProtectionAbility(filter)); + } + + public Oraxid(final Oraxid card) { + super(card); + } + + @Override + public Oraxid copy() { + return new Oraxid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/ParallaxDementia.java b/Mage.Sets/src/mage/sets/nemesis/ParallaxDementia.java new file mode 100644 index 00000000000..4eb75225eb2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/ParallaxDementia.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FadingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ParallaxDementia extends CardImpl { + + public ParallaxDementia(UUID ownerId) { + super(ownerId, 62, "Parallax Dementia", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Fading 1 + this.addAbility(new FadingAbility(1, this)); + // Enchanted creature gets +3/+2. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 2, Duration.WhileOnBattlefield))); + // When Parallax Dementia leaves the battlefield, destroy enchanted creature. That creature can't be regenerated. + this.addAbility(new LeavesBattlefieldTriggeredAbility(new DestroyAttachedEffect("enchanted creature", true), false)); + } + + public ParallaxDementia(final ParallaxDementia card) { + super(card); + } + + @Override + public ParallaxDementia copy() { + return new ParallaxDementia(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/ParallaxWave.java b/Mage.Sets/src/mage/sets/nemesis/ParallaxWave.java index 6b1311d8f0e..f2c46b36031 100644 --- a/Mage.Sets/src/mage/sets/nemesis/ParallaxWave.java +++ b/Mage.Sets/src/mage/sets/nemesis/ParallaxWave.java @@ -36,7 +36,6 @@ import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileTargetForSourceEffect; import mage.abilities.keyword.FadingAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -60,10 +59,9 @@ public class ParallaxWave extends CardImpl { super(ownerId, 17, "Parallax Wave", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); this.expansionSetCode = "NMS"; - // Fading 5 this.addAbility(new FadingAbility(5, this)); - + // Remove a fade counter from Parallax Wave: Exile target creature. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect(), new RemoveCountersSourceCost(CounterType.FADE.createInstance())); ability.addTarget(new TargetCreaturePermanent()); @@ -103,21 +101,16 @@ class ParallaxWaveEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { MageObject sourceObject = source.getSourceObject(game); - if (sourceObject != null) { - int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() -1; + Player controller = game.getPlayer(source.getControllerId()); + if (sourceObject != null && controller != null) { + int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() - 1; UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter); if (exileZoneId != null) { ExileZone exileZone = game.getExile().getExileZone(exileZoneId); if (exileZone != null) { - for (Card card: exileZone.getCards(game)) { - Player player = game.getPlayer(card.getOwnerId()); - if (player != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); - } - } - exileZone.clear(); + return controller.moveCards(exileZone.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null); } - return true; + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/nemesis/RisingWaters.java b/Mage.Sets/src/mage/sets/nemesis/RisingWaters.java new file mode 100644 index 00000000000..7afea122781 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/RisingWaters.java @@ -0,0 +1,112 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author fireshoes + */ +public class RisingWaters extends CardImpl { + + public RisingWaters(UUID ownerId) { + super(ownerId, 38, "Rising Waters", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}"); + this.expansionSetCode = "NMS"; + + // Lands don't untap during their controllers' untap steps. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, new FilterLandPermanent("Lands")))); + + // At the beginning of each player's upkeep, that player untaps a land he or she controls. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new RisingWatersUntapEffect(), TargetController.ANY, false)); + } + + public RisingWaters(final RisingWaters card) { + super(card); + } + + @Override + public RisingWaters copy() { + return new RisingWaters(this); + } +} + +class RisingWatersUntapEffect extends OneShotEffect { + + public RisingWatersUntapEffect() { + super(Outcome.Untap); + this.staticText = "that player untaps a land he or she controls"; + } + + public RisingWatersUntapEffect(final RisingWatersUntapEffect effect) { + super(effect); + } + + @Override + public RisingWatersUntapEffect copy() { + return new RisingWatersUntapEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(game.getActivePlayerId()); + FilterLandPermanent filter = new FilterLandPermanent("land you control"); + filter.add(new ControllerIdPredicate(game.getActivePlayerId())); + Target target = new TargetLandPermanent(filter); + if (player != null && player.chooseTarget(Outcome.Untap, target, source, game)) { + for (UUID landId : target.getTargets()) { + Permanent land = game.getPermanent(landId); + if (land != null) { + land.untap(game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/SaprolingBurst.java b/Mage.Sets/src/mage/sets/nemesis/SaprolingBurst.java new file mode 100644 index 00000000000..1b1d9f7c8e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/SaprolingBurst.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class SaprolingBurst extends mage.sets.vintagemasters.SaprolingBurst { + + public SaprolingBurst(UUID ownerId) { + super(ownerId); + this.cardNumber = 113; + this.expansionSetCode = "NMS"; + } + + public SaprolingBurst(final SaprolingBurst card) { + super(card); + } + + @Override + public SaprolingBurst copy() { + return new SaprolingBurst(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/SaprolingCluster.java b/Mage.Sets/src/mage/sets/nemesis/SaprolingCluster.java new file mode 100644 index 00000000000..2d0ff917a9a --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/SaprolingCluster.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.InfoEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.permanent.token.SaprolingToken; + +/** + * + * @author fireshoes + */ +public class SaprolingCluster extends CardImpl { + + public SaprolingCluster(UUID ownerId) { + super(ownerId, 114, "Saproling Cluster", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + this.expansionSetCode = "NMS"; + + // {1}, Discard a card: Put a 1/1 green Saproling creature token onto the battlefield. Any player may activate this ability. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SaprolingToken()) , new GenericManaCost(1)); + ability.addCost(new DiscardCardCost()); + ability.setMayActivate(TargetController.ANY); + ability.addEffect(new InfoEffect("Any player may activate this ability")); + this.addAbility(ability); + } + + public SaprolingCluster(final SaprolingCluster card) { + super(card); + } + + @Override + public SaprolingCluster copy() { + return new SaprolingCluster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/ShriekingMogg.java b/Mage.Sets/src/mage/sets/nemesis/ShriekingMogg.java new file mode 100644 index 00000000000..4470042228a --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/ShriekingMogg.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.TapAllEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author BursegSardaukar + */ +public class ShriekingMogg extends CardImpl { + + static final FilterCreaturePermanent filter = new FilterCreaturePermanent("all other creatures"); + + static { + filter.add(new AnotherPredicate()); + } + + public ShriekingMogg(UUID ownerId) { + super(ownerId, 99, "Shrieking Mogg", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Goblin"); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // When Shrieking Mogg enters the battlefield, tap all other creatures. + Ability ability = new EntersBattlefieldTriggeredAbility(new TapAllEffect(filter)); + this.addAbility(ability); + } + + public ShriekingMogg(final ShriekingMogg card) { + super(card); + } + + @Override + public ShriekingMogg copy() { + return new ShriekingMogg(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/nemesis/SilkenfistFighter.java b/Mage.Sets/src/mage/sets/nemesis/SilkenfistFighter.java new file mode 100644 index 00000000000..8ac25b84cc3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/SilkenfistFighter.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SilkenfistFighter extends CardImpl { + + public SilkenfistFighter(UUID ownerId) { + super(ownerId, 19, "Silkenfist Fighter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Kor"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Whenever Silkenfist Fighter becomes blocked, untap it. + Effect effect = new UntapSourceEffect(); + effect.setText("untap it"); + this.addAbility(new BecomesBlockedTriggeredAbility(effect, false)); + } + + public SilkenfistFighter(final SilkenfistFighter card) { + super(card); + } + + @Override + public SilkenfistFighter copy() { + return new SilkenfistFighter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/SilkenfistOrder.java b/Mage.Sets/src/mage/sets/nemesis/SilkenfistOrder.java new file mode 100644 index 00000000000..23ecd99ace7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/SilkenfistOrder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SilkenfistOrder extends CardImpl { + + public SilkenfistOrder(UUID ownerId) { + super(ownerId, 20, "Silkenfist Order", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Kor"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Whenever Silkenfist Order becomes blocked, untap it. + Effect effect = new UntapSourceEffect(); + effect.setText("untap it"); + this.addAbility(new BecomesBlockedTriggeredAbility(effect, false)); + } + + public SilkenfistOrder(final SilkenfistOrder card) { + super(card); + } + + @Override + public SilkenfistOrder copy() { + return new SilkenfistOrder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/StrongholdZeppelin.java b/Mage.Sets/src/mage/sets/nemesis/StrongholdZeppelin.java new file mode 100644 index 00000000000..8d15644b66f --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/StrongholdZeppelin.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class StrongholdZeppelin extends CardImpl { + + public StrongholdZeppelin(UUID ownerId) { + super(ownerId, 47, "Stronghold Zeppelin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Human"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Stronghold Zeppelin can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + } + + public StrongholdZeppelin(final StrongholdZeppelin card) { + super(card); + } + + @Override + public StrongholdZeppelin copy() { + return new StrongholdZeppelin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/TricksterMage.java b/Mage.Sets/src/mage/sets/nemesis/TricksterMage.java new file mode 100644 index 00000000000..771161cf3c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/TricksterMage.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class TricksterMage extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or land"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); + } + + public TricksterMage(UUID ownerId) { + super(ownerId, 49, "Trickster Mage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {U}, {tap}, Discard a card: You may tap or untap target artifact, creature, or land. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MayTapOrUntapTargetEffect(), new ManaCostsImpl("{U}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + public TricksterMage(final TricksterMage card) { + super(card); + } + + @Override + public TricksterMage copy() { + return new TricksterMage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/VoiceOfTruth.java b/Mage.Sets/src/mage/sets/nemesis/VoiceOfTruth.java new file mode 100644 index 00000000000..fc9f0e37975 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/VoiceOfTruth.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; +/** + * + * @author LoneFox + */ +public class VoiceOfTruth extends CardImpl { + + private static final FilterCard filter = new FilterCard("white"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public VoiceOfTruth(UUID ownerId) { + super(ownerId, 25, "Voice of Truth", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Angel"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // protection from white + this.addAbility(new ProtectionAbility(filter)); + } + + public VoiceOfTruth(final VoiceOfTruth card) { + super(card); + } + + @Override + public VoiceOfTruth copy() { + return new VoiceOfTruth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/Woodripper.java b/Mage.Sets/src/mage/sets/nemesis/Woodripper.java new file mode 100644 index 00000000000..38a2f942a43 --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/Woodripper.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.FadingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author LoneFox + */ +public class Woodripper extends CardImpl { + + public Woodripper(UUID ownerId) { + super(ownerId, 125, "Woodripper", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Beast"); + this.power = new MageInt(4); + this.toughness = new MageInt(6); + + // Fading 3 + this.addAbility(new FadingAbility(3, this)); + // {1}, Remove a fade counter from Woodripper: Destroy target artifact. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{1}")); + ability.addCost(new RemoveCountersSourceCost(CounterType.FADE.createInstance())); + ability.addTarget(new TargetArtifactPermanent()); + this.addAbility(ability); + } + + public Woodripper(final Woodripper card) { + super(card); + } + + @Override + public Woodripper copy() { + return new Woodripper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/BirthingPod.java b/Mage.Sets/src/mage/sets/newphyrexia/BirthingPod.java index 03790814187..8109def52a8 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/BirthingPod.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/BirthingPod.java @@ -28,9 +28,6 @@ package mage.sets.newphyrexia; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.common.ActivateAsSorceryActivatedAbility; import mage.abilities.costs.Cost; @@ -40,7 +37,9 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.Filter; import mage.filter.FilterCard; @@ -61,7 +60,6 @@ public class BirthingPod extends CardImpl { super(ownerId, 104, "Birthing Pod", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}{GP}"); this.expansionSetCode = "NPH"; - // {1}{GP}, {tap}, Sacrifice a creature: Search your library for a creature card with converted mana cost equal to 1 plus the sacrificed creature's converted mana cost, put that card onto the battlefield, then shuffle your library. Activate this ability only any time you could cast a sorcery. Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new BirthingPodEffect(), new ManaCostsImpl("{1}{GP}")); ability.addCost(new TapSourceCost()); @@ -80,6 +78,7 @@ public class BirthingPod extends CardImpl { } class BirthingPodEffect extends OneShotEffect { + BirthingPodEffect() { super(Outcome.Benefit); staticText = "Search your library for a creature card with converted mana cost equal to 1 plus the sacrificed creature's converted mana cost, put that card onto the battlefield, then shuffle your library"; @@ -101,22 +100,18 @@ class BirthingPodEffect extends OneShotEffect { break; } } - Player player = game.getPlayer(source.getControllerId()); - if (sacrificedPermanent != null && player != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (sacrificedPermanent != null && controller != null) { int newConvertedCost = sacrificedPermanent.getManaCost().convertedManaCost() + 1; FilterCard filter = new FilterCard("creature card with converted mana cost " + newConvertedCost); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, newConvertedCost)); filter.add(new CardTypePredicate(CardType.CREATURE)); TargetCardInLibrary target = new TargetCardInLibrary(filter); - if (player.searchLibrary(target, game)) { - for (UUID cardId : target.getTargets()) { - Card card = player.getLibrary().getCard(cardId, game); - if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); - } - } + if (controller.searchLibrary(target, game)) { + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/newphyrexia/BrutalizerExarch.java b/Mage.Sets/src/mage/sets/newphyrexia/BrutalizerExarch.java index 9c516b48f16..76a5f179f4f 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/BrutalizerExarch.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/BrutalizerExarch.java @@ -28,19 +28,17 @@ package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; +import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.Predicates; @@ -71,7 +69,11 @@ public class BrutalizerExarch extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(3); - Ability ability = new EntersBattlefieldTriggeredAbility(new BrutalizerExarchEffect1()); + // When Brutalizer Exarch enters the battlefield, choose one + // - Search your library for a creature card, reveal it, then shuffle your library and put that card on top of it; + TargetCardInLibrary target = new TargetCardInLibrary(new FilterCreatureCard("a creature card")); + Ability ability = new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(target, true, true), false); + // or put target noncreature permanent on the bottom of its owner's library. Mode mode = new Mode(); mode.getEffects().add(new BrutalizerExarchEffect2()); mode.getTargets().add(new TargetPermanent(filter)); @@ -89,45 +91,6 @@ public class BrutalizerExarch extends CardImpl { } } -class BrutalizerExarchEffect1 extends OneShotEffect { - - public BrutalizerExarchEffect1() { - super(Outcome.Benefit); - this.staticText = "Search your library for a creature card, reveal it, then shuffle your library and put that card on top of it"; - } - - public BrutalizerExarchEffect1(final BrutalizerExarchEffect1 effect) { - super(effect); - } - - @Override - public BrutalizerExarchEffect1 copy() { - return new BrutalizerExarchEffect1(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - TargetCardInLibrary target = new TargetCardInLibrary(new FilterCreatureCard("creature card in your library")); - if (player.searchLibrary(target, game)) { - Card card = player.getLibrary().remove(target.getFirstTarget(), game); - if (card != null) { - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards("Brutalizer Exarch", cards, game); - } - player.shuffleLibrary(game); - if (card != null) - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - return true; - } - player.shuffleLibrary(game); - } - return false; - } -} - class BrutalizerExarchEffect2 extends OneShotEffect { public BrutalizerExarchEffect2() { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java index 581d2670154..bda2d542c8a 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java @@ -35,7 +35,6 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; @@ -45,7 +44,7 @@ import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinTokenWithHaste; /** * @@ -73,7 +72,7 @@ public class ChancellorOfTheForge extends CardImpl { // When Chancellor of the Forge enters the battlefield, put X 1/1 red Goblin creature tokens with haste onto the battlefield, where X is the number of creatures you control. DynamicValue value = new PermanentsOnBattlefieldCount(filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GoblinToken(), value), false)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GoblinTokenWithHaste(), value), false)); } public ChancellorOfTheForge(final ChancellorOfTheForge card) { @@ -89,7 +88,7 @@ public class ChancellorOfTheForge extends CardImpl { class ChancellorOfTheForgeDelayedTriggeredAbility extends DelayedTriggeredAbility { ChancellorOfTheForgeDelayedTriggeredAbility () { - super(new CreateTokenEffect(new GoblinToken())); + super(new CreateTokenEffect(new GoblinTokenWithHaste())); } ChancellorOfTheForgeDelayedTriggeredAbility(ChancellorOfTheForgeDelayedTriggeredAbility ability) { @@ -110,15 +109,3 @@ class ChancellorOfTheForgeDelayedTriggeredAbility extends DelayedTriggeredAbilit return new ChancellorOfTheForgeDelayedTriggeredAbility(this); } } - -class GoblinToken extends Token { - public GoblinToken() { - super("Goblin", "1/1 red Goblin creature token with haste"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add("Goblin"); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(HasteAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/DueRespect.java b/Mage.Sets/src/mage/sets/newphyrexia/DueRespect.java index 2fef2672aa1..d59865ecdbd 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/DueRespect.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/DueRespect.java @@ -28,15 +28,16 @@ package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -50,7 +51,6 @@ public class DueRespect extends CardImpl { super(ownerId, 8, "Due Respect", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); this.expansionSetCode = "NPH"; - // Permanents enter the battlefield tapped this turn. this.getSpellAbility().addEffect(new DueRespectEffect()); // Draw a card. @@ -85,18 +85,18 @@ class DueRespectEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(event.getTargetId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null) { permanent.setTapped(true); } return false; } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { return true; diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Enslave.java b/Mage.Sets/src/mage/sets/newphyrexia/Enslave.java index d158331c83f..b9bd7826273 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Enslave.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Enslave.java @@ -25,12 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.newphyrexia; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -39,6 +36,11 @@ import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.ControlEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -51,21 +53,26 @@ import mage.target.common.TargetCreaturePermanent; */ public class Enslave extends CardImpl { - public Enslave (UUID ownerId) { + public Enslave(UUID ownerId) { super(ownerId, 58, "Enslave", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}{B}"); this.expansionSetCode = "NPH"; this.subtype.add("Aura"); + // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); + + // You control enchanted creature. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ControlEnchantedEffect())); + + // At the beginning of your upkeep, enchanted creature deals 1 damage to its owner. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new EnslaveEffect(), TargetController.YOU, false, false)); } - public Enslave (final Enslave card) { + public Enslave(final Enslave card) { super(card); } @@ -77,6 +84,7 @@ public class Enslave extends CardImpl { } class EnslaveEffect extends OneShotEffect { + EnslaveEffect() { super(Outcome.Damage); staticText = "enchanted creature deals 1 damage to its owner"; @@ -88,13 +96,13 @@ class EnslaveEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (sourcePermanent != null) { - Permanent attached = game.getPermanent(sourcePermanent.getAttachedTo()); + Permanent attached = game.getPermanentOrLKIBattlefield(sourcePermanent.getAttachedTo()); if (attached != null) { Player owner = game.getPlayer(attached.getOwnerId()); if (owner != null) { - owner.damage(1, source.getSourceId(), game, false, true); + owner.damage(1, attached.getId(), game, false, true); return true; } } @@ -108,4 +116,4 @@ class EnslaveEffect extends OneShotEffect { return new EnslaveEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/GitaxianProbe.java b/Mage.Sets/src/mage/sets/newphyrexia/GitaxianProbe.java index bf3054706e8..298ed67b7b6 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/GitaxianProbe.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/GitaxianProbe.java @@ -1,99 +1,65 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.newphyrexia; - -import java.util.UUID; -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.game.Game; -import mage.players.Player; -import mage.target.TargetPlayer; - -/** - * - * @author Loki - */ -public class GitaxianProbe extends CardImpl { - - public GitaxianProbe(UUID ownerId) { - super(ownerId, 35, "Gitaxian Probe", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{UP}"); - this.expansionSetCode = "NPH"; - - // Look at target player's hand. - this.getSpellAbility().addEffect(new GitaxianProbeEffect()); - this.getSpellAbility().addTarget(new TargetPlayer()); - // Draw a card. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); - - } - - public GitaxianProbe(final GitaxianProbe card) { - super(card); - } - - @Override - public GitaxianProbe copy() { - return new GitaxianProbe(this); - } - -} - -class GitaxianProbeEffect extends OneShotEffect { - - GitaxianProbeEffect() { - super(Outcome.DrawCard); - staticText = "Look at target player's hand"; - } - - GitaxianProbeEffect(final GitaxianProbeEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - MageObject sourceObject = source.getSourceObject(game); - if (player != null && controller != null && sourceObject != null) { - controller.lookAtCards(sourceObject.getIdName() + " (" + player.getName() + ")", player.getHand(), game); - } - return true; - } - - @Override - public GitaxianProbeEffect copy() { - return new GitaxianProbeEffect(this); - } - -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.newphyrexia; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LookAtTargetPlayerHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author Loki + */ +public class GitaxianProbe extends CardImpl { + + public GitaxianProbe(UUID ownerId) { + super(ownerId, 35, "Gitaxian Probe", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{UP}"); + this.expansionSetCode = "NPH"; + + // Look at target player's hand. + this.getSpellAbility().addEffect(new LookAtTargetPlayerHandEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + + } + + public GitaxianProbe(final GitaxianProbe card) { + super(card); + } + + @Override + public GitaxianProbe copy() { + return new GitaxianProbe(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/HexParasite.java b/Mage.Sets/src/mage/sets/newphyrexia/HexParasite.java index e1190a24fbc..dd9bf4bfea6 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/HexParasite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/HexParasite.java @@ -28,11 +28,6 @@ package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -40,6 +35,11 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -77,12 +77,12 @@ public class HexParasite extends CardImpl { class HexParasiteEffect extends OneShotEffect { - HexParasiteEffect ( ) { + HexParasiteEffect() { super(Outcome.Benefit); staticText = "Remove up to X counters from target permanent. For each counter removed this way, {this} gets +1/+0 until end of turn"; } - HexParasiteEffect ( HexParasiteEffect effect ) { + HexParasiteEffect(HexParasiteEffect effect) { super(effect); } @@ -93,7 +93,7 @@ class HexParasiteEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - TargetPermanent target = (TargetPermanent)source.getTargets().get(0); + TargetPermanent target = (TargetPermanent) source.getTargets().get(0); Permanent permanent = game.getPermanent(target.getFirstTarget()); Player player = game.getPlayer(source.getControllerId()); if (permanent != null && player != null) { @@ -104,8 +104,8 @@ class HexParasiteEffect extends OneShotEffect { if (player.chooseUse(Outcome.Neutral, "Do you want to remove " + counterName + " counters?", source, game)) { if (permanent.getCounters().get(counterName).getCount() == 1 || toRemove == 1) { permanent.getCounters().removeCounter(counterName, 1); - } - else { + removed++; + } else { int amount = player.getAmount(1, Math.min(permanent.getCounters().get(counterName).getCount(), toRemove - removed), "How many?", game); if (amount > 0) { removed += amount; @@ -113,8 +113,9 @@ class HexParasiteEffect extends OneShotEffect { } } } - if (removed >= toRemove) + if (removed >= toRemove) { break; + } } game.addEffect(new BoostSourceEffect(removed, 0, Duration.EndOfTurn), source); return true; diff --git a/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java b/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java index 5b5a30d8035..468537a4201 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java @@ -34,11 +34,10 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileFromZoneTargetEffect; import mage.abilities.effects.common.ExileTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; @@ -47,7 +46,6 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterCard; import mage.game.ExileZone; import mage.game.Game; @@ -72,7 +70,7 @@ public class KarnLiberated extends CardImpl { super(ownerId, 1, "Karn Liberated", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{7}"); this.expansionSetCode = "NPH"; this.subtype.add("Karn"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6)); // +4: Target player exiles a card from his or her hand. LoyaltyAbility ability1 = new LoyaltyAbility(new ExileFromZoneTargetEffect(Zone.HAND, exileId, this.getIdName(), new FilterCard()), 4); @@ -141,12 +139,17 @@ class KarnLiberatedEffect extends OneShotEffect { if (card.getOwnerId().equals(player.getId()) && !card.isCopy() // no copies && !player.getSideboard().contains(card.getId()) && !cards.contains(card)) { // not the exiled cards - player.getLibrary().putOnTop(card, game); + if (card.getId().equals(player.getCommanderId())) { + card.moveToZone(Zone.COMMAND, null, game, true); + } else { + player.getLibrary().putOnTop(card, game); + } } } player.init(game); } for (Card card : cards) { + game.getState().setZone(card.getId(), Zone.EXILED); if (CardUtil.isPermanentCard(card) && !card.getSubtype().contains("Aura")) { game.getExile().add(exileId, sourceObject.getIdName(), card); } @@ -211,16 +214,21 @@ class KarnLiberatedDelayedEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - ExileZone exile = game.getExile().getExileZone(exileId); - if (exile != null) { - Cards cards = new CardsImpl(); // needed because putOntoTheBattlefield removes from exile - cards.addAll(exile); - for (Card card : cards.getCards(game)) { - card.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), source.getControllerId()); - Permanent permanent = game.getPermanent(card.getId()); - ((PermanentImpl) permanent).removeSummoningSickness(); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + ExileZone exile = game.getExile().getExileZone(exileId); + if (exile != null) { + // Creatures put onto the battlefield due to Karn's ability will have been under their controller's control continuously + // since the beginning of the first turn. They can attack and their activated abilities with {T} in the cost can be activated. + Cards cards = new CardsImpl(); // needed because putOntoTheBattlefield removes from exile + cards.addAll(exile); + controller.moveCards(cards, Zone.BATTLEFIELD, source, game); + for (Card card : cards.getCards(game)) { + Permanent permanent = game.getPermanent(card.getId()); + ((PermanentImpl) permanent).removeSummoningSickness(); + } + return true; } - return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/LeechingBite.java b/Mage.Sets/src/mage/sets/newphyrexia/LeechingBite.java index 7ab4a6277b2..54869297d22 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/LeechingBite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/LeechingBite.java @@ -28,18 +28,15 @@ package mage.sets.newphyrexia; import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.abilities.Ability; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; +import mage.filter.common.FilterCreaturePermanent; import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.SecondTargetPointer; /** * @@ -51,9 +48,16 @@ public class LeechingBite extends CardImpl { super(ownerId, 113, "Leeching Bite", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); this.expansionSetCode = "NPH"; - - this.getSpellAbility().addEffect(new LeechingBiteEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(2)); + // Target creature gets +1/+1 until end of turn. Another target creature gets -1/-1 until end of turn. + Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn); + effect.setText("Target creature gets +1/+1 until end of turn"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (getting the +1/+1 counter)"))); + effect = new BoostTargetEffect(-1, -1, Duration.EndOfTurn); + effect.setText("Another target creature gets -1/-1 until end of turn"); + effect.setTargetPointer(new SecondTargetPointer()); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (getting the -1/-1 counter)"))); } public LeechingBite(final LeechingBite card) { @@ -65,35 +69,3 @@ public class LeechingBite extends CardImpl { return new LeechingBite(this); } } - -class LeechingBiteEffect extends ContinuousEffectImpl { - - public LeechingBiteEffect() { - super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); - this.staticText = "Target creature gets +1/+1 until end of turn. Another target creature gets -1/-1 until end of turn"; - } - - public LeechingBiteEffect(final LeechingBiteEffect effect) { - super(effect); - } - - @Override - public LeechingBiteEffect copy() { - return new LeechingBiteEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.addPower(1); - permanent.addToughness(1); - } - permanent = game.getPermanent(source.getTargets().get(0).getTargets().get(1)); - if (permanent != null) { - permanent.addPower(-1); - permanent.addToughness(-1); - } - return true; - } -} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/MeliraSylvokOutcast.java b/Mage.Sets/src/mage/sets/newphyrexia/MeliraSylvokOutcast.java index b43ddb45473..0e370f97e18 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/MeliraSylvokOutcast.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/MeliraSylvokOutcast.java @@ -29,13 +29,6 @@ package mage.sets.newphyrexia; import java.util.Set; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -43,6 +36,13 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.keyword.InfectAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; @@ -63,7 +63,6 @@ public class MeliraSylvokOutcast extends CardImpl { this.subtype.add("Human"); this.subtype.add("Scout"); - this.power = new MageInt(2); this.toughness = new MageInt(2); @@ -113,7 +112,7 @@ class MeliraSylvokOutcastEffect extends ReplacementEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ADD_COUNTER; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { return event.getData().equals(CounterType.POISON.getName()) && event.getTargetId().equals(source.getControllerId()); @@ -141,16 +140,19 @@ class MeliraSylvokOutcastEffect2 extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { return true; } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ADD_COUNTER; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getData().equals(CounterType.M1M1.getName())) { Permanent perm = game.getPermanent(event.getTargetId()); + if (perm == null) { + perm = game.getPermanentEntering(event.getTargetId()); + } if (perm != null && perm.getCardType().contains(CardType.CREATURE) && perm.getControllerId().equals(source.getControllerId())) { return true; } @@ -181,7 +183,7 @@ class MeliraSylvokOutcastEffect3 extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { Set opponents = game.getOpponents(source.getControllerId()); - for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { if (opponents.contains(perm.getControllerId())) { perm.getAbilities().remove(InfectAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java b/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java index b4aad1e5299..ad3c61a53e2 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java @@ -76,7 +76,7 @@ public class NumbingDose extends CardImpl { this.addAbility(new EnchantAbility(auraTarget.getTargetName())); // Enchanted permanent doesn't untap during its controller's untap step. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect("permanent"))); // At the beginning of the upkeep of enchanted permanent's controller, that player loses 1 life. this.addAbility(new NumbingDoseTriggeredAbility()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/OmenMachine.java b/Mage.Sets/src/mage/sets/newphyrexia/OmenMachine.java index 5f88e32d91f..6f7bf4cf1a4 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/OmenMachine.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/OmenMachine.java @@ -28,11 +28,6 @@ package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.BeginningOfDrawTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -40,7 +35,12 @@ import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.TargetController; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -125,9 +125,8 @@ class OmenMachineEffect2 extends OneShotEffect { if (card != null) { player.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, true); if (card.getCardType().contains(CardType.LAND)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); - } - else { + player.moveCards(card, Zone.BATTLEFIELD, source, game); + } else { if (card.getSpellAbility().canChooseTarget(game)) { player.cast(card.getSpellAbility(), game, true); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java index 681c7882c45..b6a7057dda5 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java @@ -25,20 +25,20 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -51,7 +51,7 @@ import mage.util.functions.ApplyToPermanent; * @author Loki */ public class PhyrexianMetamorph extends CardImpl { - + private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); static { @@ -59,8 +59,8 @@ public class PhyrexianMetamorph extends CardImpl { new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE))); } - - public PhyrexianMetamorph (UUID ownerId) { + + public PhyrexianMetamorph(UUID ownerId) { super(ownerId, 42, "Phyrexian Metamorph", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}{UP}"); this.expansionSetCode = "NPH"; this.subtype.add("Shapeshifter"); @@ -71,22 +71,28 @@ public class PhyrexianMetamorph extends CardImpl { ApplyToPermanent phyrexianMetamorphApplier = new ApplyToPermanent() { @Override public Boolean apply(Game game, Permanent permanent) { - if (!permanent.getCardType().contains(CardType.ARTIFACT)) { - permanent.getCardType().add(CardType.ARTIFACT); + return apply(game, (MageObject) permanent); + } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + if (!mageObject.getCardType().contains(CardType.ARTIFACT)) { + mageObject.getCardType().add(CardType.ARTIFACT); } return true; } + }; - + // {UP} ( can be paid with either {U} or 2 life.) // You may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types. Effect effect = new CopyPermanentEffect(filter, phyrexianMetamorphApplier); effect.setText("You may have {this} enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types"); - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect)); + Ability ability = new SimpleStaticAbility(Zone.ALL, new EntersBattlefieldEffect(effect)); this.addAbility(ability); } - public PhyrexianMetamorph (final PhyrexianMetamorph card) { + public PhyrexianMetamorph(final PhyrexianMetamorph card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java index 5811c99d20a..16b0136dbda 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java @@ -58,7 +58,10 @@ public class PhyrexianObliterator extends CardImpl { this.power = new MageInt(5); this.toughness = new MageInt(5); + // Trample this.addAbility(TrampleAbility.getInstance()); + + // Whenever a source deals damage to Phyrexian Obliterator, that source's controller sacrifices that many permanents. this.addAbility(new PhyrexianObliteratorTriggeredAbility()); } @@ -73,6 +76,7 @@ public class PhyrexianObliterator extends CardImpl { } class PhyrexianObliteratorTriggeredAbility extends TriggeredAbilityImpl { + PhyrexianObliteratorTriggeredAbility() { super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterPermanent(), 0, "")); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PraetorsGrasp.java b/Mage.Sets/src/mage/sets/newphyrexia/PraetorsGrasp.java index de9c500e10d..f101663e2b7 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PraetorsGrasp.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PraetorsGrasp.java @@ -34,8 +34,6 @@ import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; import mage.constants.AsThoughEffectType; import mage.constants.CardType; import mage.constants.Duration; @@ -167,7 +165,7 @@ class PraetorsGraspRevealEffect extends AsThoughEffectImpl { private final UUID cardId; public PraetorsGraspRevealEffect(UUID cardId) { - super(AsThoughEffectType.REVEAL_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit); + super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit); this.cardId = cardId; staticText = "You may look at and play that card for as long as it remains exiled"; } @@ -198,10 +196,7 @@ class PraetorsGraspRevealEffect extends AsThoughEffectImpl { Player controller = game.getPlayer(source.getControllerId()); Card card = game.getCard(cardId); if (controller != null && card != null && game.getState().getZone(cardId) == Zone.EXILED) { - if (controller.chooseUse(outcome, "Reveal exiled card?", source, game)) { - Cards cards = new CardsImpl(card); - controller.lookAtCards("Exiled with " + sourceObject.getIdName(), cards, game); - } + return true; } } else { discard(); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ReaperOfSheoldred.java b/Mage.Sets/src/mage/sets/newphyrexia/ReaperOfSheoldred.java index c8da60dba23..5e9a8469cf7 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ReaperOfSheoldred.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ReaperOfSheoldred.java @@ -41,6 +41,7 @@ import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; +import mage.players.Player; import mage.target.targetpointer.FixedTarget; /** @@ -57,7 +58,10 @@ public class ReaperOfSheoldred extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(5); + // Infect (This creature deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.) this.addAbility(InfectAbility.getInstance()); + + // Whenever a source deals damage to Reaper of Sheoldred, that source's controller gets a poison counter. this.addAbility(new ReaperOfSheoldredTriggeredAbility()); } @@ -72,6 +76,7 @@ public class ReaperOfSheoldred extends CardImpl { } class ReaperOfSheoldredTriggeredAbility extends TriggeredAbilityImpl { + ReaperOfSheoldredTriggeredAbility() { super(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.POISON.createInstance())); } @@ -93,10 +98,16 @@ class ReaperOfSheoldredTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId().equals(this.getSourceId())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); + UUID controller = game.getControllerId(event.getSourceId()); + if (controller != null) { + Player player = game.getPlayer(controller); + if (player != null) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(player.getId())); + } + return true; + } } - return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java b/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java index 6c6db8f49c8..4e127421977 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java @@ -29,24 +29,15 @@ package mage.sets.newphyrexia; import java.util.UUID; import mage.MageInt; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChangeATargetOfTargetSpellAbilityToSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.stack.Spell; -import mage.game.stack.StackAbility; -import mage.game.stack.StackObject; -import mage.players.Player; -import mage.target.Target; import mage.target.TargetStackObject; -import mage.target.Targets; /** * @@ -62,7 +53,7 @@ public class Spellskite extends CardImpl { this.toughness = new MageInt(4); // {UP}: Change a target of target spell or ability to Spellskite. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SpellskiteEffect(), new ManaCostsImpl("{UP}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChangeATargetOfTargetSpellAbilityToSourceEffect(), new ManaCostsImpl("{UP}")); ability.addTarget(new TargetStackObject()); this.addAbility(ability); } @@ -76,92 +67,3 @@ public class Spellskite extends CardImpl { return new Spellskite(this); } } - -class SpellskiteEffect extends OneShotEffect { - - public SpellskiteEffect() { - super(Outcome.Neutral); - staticText = "Change a target of target spell or ability to {this}"; - } - - public SpellskiteEffect(final SpellskiteEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); - MageObject sourceObject = game.getObject(source.getSourceId()); - if (stackObject != null && sourceObject != null) { - Targets targets; - Ability sourceAbility; - MageObject oldTarget = null; - if (stackObject instanceof Spell) { - Spell spell = (Spell)stackObject; - sourceAbility = spell.getSpellAbility(); - targets = spell.getSpellAbility().getTargets(); - } else if (stackObject instanceof StackAbility) { - StackAbility stackAbility = (StackAbility)stackObject; - sourceAbility = stackAbility; - targets = stackAbility.getTargets(); - } else { - return false; - } - boolean twoTimesTarget = false; - if (targets.size() == 1 && targets.get(0).getTargets().size() == 1) { - Target target = targets.get(0); - if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) { - oldTarget = game.getObject(targets.getFirstTarget()); - target.clearChosen(); - // The source is still the spell on the stack - target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); - } - } else { - Player player = game.getPlayer(source.getControllerId()); - for (Target target: targets) { - for (UUID targetId: target.getTargets()) { - MageObject object = game.getObject(targetId); - String name; - if (object == null) { - Player targetPlayer = game.getPlayer(targetId); - name = targetPlayer.getLogName(); - } else { - name = object.getName(); - } - if (!targetId.equals(source.getSourceId()) && target.getTargets().contains(source.getSourceId())) { - // you can't change this target to Spellskite because Spellskite is already another targetId of that target. - twoTimesTarget = true; - continue; - } - if (name != null && player.chooseUse(Outcome.Neutral, new StringBuilder("Change target from ").append(name).append(" to ").append(sourceObject.getName()).append("?").toString(), source, game)) { - if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) { - oldTarget = game.getObject(targets.getFirstTarget()); - target.remove(targetId); - // The source is still the spell on the stack - target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); - break; - } - } - } - } - } - if (oldTarget != null) { - game.informPlayers(sourceObject.getLogName() + ": Changed target of " +stackObject.getLogName() + " from " + oldTarget.getLogName() + " to " + sourceObject.getLogName()); - } else { - if (twoTimesTarget) { - game.informPlayers(sourceObject.getLogName() + ": Target not changed to " + sourceObject.getLogName() + " because its not valid to target it twice for " + stackObject.getName()); - } else { - game.informPlayers(sourceObject.getLogName() + ": Target not changed to " + sourceObject.getLogName() + " because its no valid target for " + stackObject.getName()); - } - } - return true; - } - return false; - } - - @Override - public SpellskiteEffect copy() { - return new SpellskiteEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/TorporOrb.java b/Mage.Sets/src/mage/sets/newphyrexia/TorporOrb.java index 59519623423..eb91ef9938c 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/TorporOrb.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/TorporOrb.java @@ -40,6 +40,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -77,23 +78,24 @@ class TorporOrbEffect extends ContinuousRuleModifyingEffectImpl { TorporOrbEffect(final TorporOrbEffect effect) { super(effect); } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { Ability ability = (Ability) getValue("targetAbility"); if (ability != null && AbilityType.TRIGGERED.equals(ability.getAbilityType())) { - Permanent p = game.getPermanent(event.getTargetId()); - if (p != null && p.getCardType().contains(CardType.CREATURE)) { + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { return true; } } return false; } + @Override public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(event.getSourceId()); @@ -103,7 +105,7 @@ class TorporOrbEffect extends ContinuousRuleModifyingEffectImpl { } return null; } - + @Override public TorporOrbEffect copy() { return new TorporOrbEffect(this); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/UrabraskTheHidden.java b/Mage.Sets/src/mage/sets/newphyrexia/UrabraskTheHidden.java index 45d79931645..9c0a62aa76d 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/UrabraskTheHidden.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/UrabraskTheHidden.java @@ -28,18 +28,21 @@ package mage.sets.newphyrexia; import java.util.UUID; - -import mage.constants.*; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.keyword.HasteAbility; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -74,6 +77,7 @@ public class UrabraskTheHidden extends CardImpl { } class UrabraskTheHiddenEffect extends ReplacementEffectImpl { + UrabraskTheHiddenEffect() { super(Duration.WhileOnBattlefield, Outcome.Tap); staticText = "Creatures your opponents control enter the battlefield tapped"; @@ -85,7 +89,7 @@ class UrabraskTheHiddenEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent target = game.getPermanent(event.getTargetId()); + Permanent target = ((EntersTheBattlefieldEvent) event).getTarget(); if (target != null) { target.setTapped(true); } @@ -96,21 +100,20 @@ class UrabraskTheHiddenEffect extends ReplacementEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { - Card card = game.getCard(event.getTargetId()); - if (card != null && card.getCardType().contains(CardType.CREATURE)) { + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { return true; } } return false; } - @Override public UrabraskTheHiddenEffect copy() { return new UrabraskTheHiddenEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java b/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java index 00d838eea5e..90f4773e0d9 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java @@ -62,7 +62,9 @@ public class VorinclexVoiceOfHunger extends CardImpl { this.power = new MageInt(7); this.toughness = new MageInt(6); + // Trample this.addAbility(TrampleAbility.getInstance()); + // Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced. ManaEffect effect = new AddManaOfAnyTypeProducedEffect(); effect.setText("add one mana to your mana pool of any type that land produced"); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Xenograft.java b/Mage.Sets/src/mage/sets/newphyrexia/Xenograft.java index df7da676226..0bcb89be3a9 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Xenograft.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Xenograft.java @@ -29,6 +29,12 @@ package mage.sets.newphyrexia; import java.util.List; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.ChooseCreatureTypeEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -36,19 +42,9 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.common.AsEntersBattlefieldAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.cards.repository.CardRepository; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.players.Player; /** * @@ -60,9 +56,8 @@ public class Xenograft extends CardImpl { super(ownerId, 51, "Xenograft", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{U}"); this.expansionSetCode = "NPH"; - // As Xenograft enters the battlefield, choose a creature type. - this.addAbility(new AsEntersBattlefieldAbility(new XenograftEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.Detriment))); // Each creature you control is the chosen type in addition to its other types. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new XenograftAddSubtypeEffect())); } @@ -77,43 +72,6 @@ public class Xenograft extends CardImpl { } } -class XenograftEffect extends OneShotEffect { - - public XenograftEffect() { - super(Outcome.DrawCard); - staticText = "choose a creature type"; - } - - public XenograftEffect(final XenograftEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose creature type"); - typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); - while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { - if (!player.canRespond()) { - return false; - } - } - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice()); - game.getState().setValue(source.getSourceId() + "_XenograftType", typeChoice.getChoice()); - permanent.addInfo("chosen type", "Chosen type: " + typeChoice.getChoice().toString() + "", game); - } - return false; - } - - @Override - public XenograftEffect copy() { - return new XenograftEffect(this); - } -} - class XenograftAddSubtypeEffect extends ContinuousEffectImpl { public XenograftAddSubtypeEffect() { @@ -127,7 +85,7 @@ class XenograftAddSubtypeEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - String subtype = (String) game.getState().getValue(source.getSourceId() + "_XenograftType"); + String subtype = (String) game.getState().getValue(source.getSourceId() + "_type"); if (subtype != null) { List permanents = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); for (Permanent permanent : permanents) { diff --git a/Mage.Sets/src/mage/sets/ninthedition/AnabaShaman.java b/Mage.Sets/src/mage/sets/ninthedition/AnabaShaman.java index 40ad7100342..f1615de3394 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/AnabaShaman.java +++ b/Mage.Sets/src/mage/sets/ninthedition/AnabaShaman.java @@ -28,16 +28,15 @@ package mage.sets.ninthedition; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.target.common.TargetCreatureOrPlayer; @@ -57,7 +56,7 @@ public class AnabaShaman extends CardImpl { this.toughness = new MageInt(2); // {R}, {tap}: Anaba Shaman deals 1 damage to target creature or player. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamagePlayersEffect(1), new ManaCostsImpl("{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/ninthedition/AvenWindreader.java b/Mage.Sets/src/mage/sets/ninthedition/AvenWindreader.java index 1c4b2d5ec6c..f2df72e840b 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/AvenWindreader.java +++ b/Mage.Sets/src/mage/sets/ninthedition/AvenWindreader.java @@ -32,16 +32,12 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.RevealTargetPlayerLibraryEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.cards.CardsImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.players.Player; import mage.target.TargetPlayer; /** @@ -62,8 +58,9 @@ public class AvenWindreader extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); + // {1}{U}: Target player reveals the top card of his or her library. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RevealTopCardTargetPlayerEffect(), new ManaCostsImpl("{1}{U}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RevealTargetPlayerLibraryEffect(1), new ManaCostsImpl("{1}{U}")); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } @@ -77,31 +74,3 @@ public class AvenWindreader extends CardImpl { return new AvenWindreader(this); } } - -class RevealTopCardTargetPlayerEffect extends OneShotEffect { - - public RevealTopCardTargetPlayerEffect() { - super(Outcome.Benefit); - this.staticText = "Target player reveals the top card of his or her library."; - } - - public RevealTopCardTargetPlayerEffect(final RevealTopCardTargetPlayerEffect effect) { - super(effect); - } - - @Override - public RevealTopCardTargetPlayerEffect copy() { - return new RevealTopCardTargetPlayerEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - CardsImpl cards = new CardsImpl(); - cards.add(player.getLibrary().removeFromTop(game)); - player.revealCards("Top card of target player's library", cards, game); - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/ninthedition/GiantOctopus.java b/Mage.Sets/src/mage/sets/ninthedition/Biorhythm.java similarity index 84% rename from Mage.Sets/src/mage/sets/ninthedition/GiantOctopus.java rename to Mage.Sets/src/mage/sets/ninthedition/Biorhythm.java index 938f1942a84..f9019b96086 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/GiantOctopus.java +++ b/Mage.Sets/src/mage/sets/ninthedition/Biorhythm.java @@ -31,22 +31,22 @@ import java.util.UUID; /** * - * @author LevelX2 + * @author LoneFox */ -public class GiantOctopus extends mage.sets.seventhedition.GiantOctopus { +public class Biorhythm extends mage.sets.onslaught.Biorhythm { - public GiantOctopus(UUID ownerId) { + public Biorhythm(UUID ownerId) { super(ownerId); - this.cardNumber = 4; + this.cardNumber = 231; this.expansionSetCode = "9ED"; } - public GiantOctopus(final GiantOctopus card) { + public Biorhythm(final Biorhythm card) { super(card); } @Override - public GiantOctopus copy() { - return new GiantOctopus(this); + public Biorhythm copy() { + return new Biorhythm(this); } } diff --git a/Mage.Sets/src/mage/sets/ninthedition/BloodMoon.java b/Mage.Sets/src/mage/sets/ninthedition/BloodMoon.java index c374adde742..ac21d7d9855 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/BloodMoon.java +++ b/Mage.Sets/src/mage/sets/ninthedition/BloodMoon.java @@ -28,6 +28,12 @@ package mage.sets.ninthedition; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.cards.repository.CardRepository; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -35,11 +41,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.mana.RedManaAbility; -import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SupertypePredicate; @@ -56,7 +57,6 @@ public class BloodMoon extends CardImpl { super(ownerId, 176, "Blood Moon", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); this.expansionSetCode = "9ED"; - // Nonbasic lands are Mountains. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BloodMoonEffect())); } @@ -74,6 +74,7 @@ public class BloodMoon extends CardImpl { class BloodMoonEffect extends ContinuousEffectImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); + static { filter.add(Predicates.not(new SupertypePredicate("Basic"))); } @@ -99,16 +100,18 @@ class BloodMoonEffect extends ContinuousEffectImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - for (Permanent land: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + for (Permanent land : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { switch (layer) { - case AbilityAddingRemovingEffects_6: - land.removeAllAbilities(source.getSourceId(), game); - land.addAbility(new RedManaAbility(), source.getSourceId(), game); - break; case TypeChangingEffects_4: - land.getSubtype().clear(); + // 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects + // So the ability removing has to be done before Layer 6 + land.removeAllAbilities(source.getSourceId(), game); + land.getSubtype().removeAll(CardRepository.instance.getLandTypes()); land.getSubtype().add("Mountain"); break; + case AbilityAddingRemovingEffects_6: + land.addAbility(new RedManaAbility(), source.getSourceId(), game); + break; } } return true; diff --git a/Mage.Sets/src/mage/sets/ninthedition/ContaminatedBond.java b/Mage.Sets/src/mage/sets/ninthedition/ContaminatedBond.java index c2ec93bd388..7f03c8fb9e3 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/ContaminatedBond.java +++ b/Mage.Sets/src/mage/sets/ninthedition/ContaminatedBond.java @@ -30,19 +30,14 @@ package mage.sets.ninthedition; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.AttacksOrBlocksEnchantedTriggeredAbility; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.StaticValue; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.LoseLifeControllerAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -77,50 +72,3 @@ public class ContaminatedBond extends CardImpl { return new ContaminatedBond(this); } } - -class LoseLifeControllerAttachedEffect extends OneShotEffect { - - protected DynamicValue amount; - - public LoseLifeControllerAttachedEffect(int amount) { - this(new StaticValue(amount)); - } - - public LoseLifeControllerAttachedEffect(DynamicValue amount) { - super(Outcome.Damage); - this.amount = amount; - staticText = "its controller loses " + amount.toString() +" life"; - } - - public LoseLifeControllerAttachedEffect(final LoseLifeControllerAttachedEffect effect) { - super(effect); - this.amount = effect.amount.copy(); - } - - @Override - public LoseLifeControllerAttachedEffect copy() { - return new LoseLifeControllerAttachedEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment == null) { - enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - } - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature == null) { - creature = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - } - if (creature != null) { - Player player = game.getPlayer(creature.getControllerId()); - if (player != null) { - player.loseLife(amount.calculate(game, source, this), game); - return true; - } - } - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/ninthedition/Deathgazer.java b/Mage.Sets/src/mage/sets/ninthedition/Deathgazer.java index 68f56668e4d..f8bd55460ae 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/Deathgazer.java +++ b/Mage.Sets/src/mage/sets/ninthedition/Deathgazer.java @@ -29,18 +29,18 @@ package mage.sets.ninthedition; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; +import mage.ObjectColor; +import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility; +import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.target.targetpointer.FixedTarget; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -48,6 +48,12 @@ import mage.target.targetpointer.FixedTarget; */ public class Deathgazer extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + public Deathgazer(UUID ownerId) { super(ownerId, 124, "Deathgazer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); this.expansionSetCode = "9ED"; @@ -57,7 +63,11 @@ public class Deathgazer extends CardImpl { this.toughness = new MageInt(2); // Whenever Deathgazer blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat. - this.addAbility(new DeathgazerTriggeredAbility(new DestroyTargetEffect(), false)); + Effect effect = new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); + effect.setText("destroy that creature at end of combat"); + this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false)); + } public Deathgazer(final Deathgazer card) { @@ -69,54 +79,3 @@ public class Deathgazer extends CardImpl { return new Deathgazer(this); } } - -class DeathgazerTriggeredAbility extends TriggeredAbilityImpl { - - - - public DeathgazerTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, effect, optional); - } - - public DeathgazerTriggeredAbility(final DeathgazerTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.BLOCKER_DECLARED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getSourceId().equals(this.getSourceId())) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && !permanent.getColor(game).isBlack()) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - } - return true; - } - } - if (event.getTargetId().equals(this.getSourceId())) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && !permanent.getColor(game).isBlack()) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getSourceId())); - } - return true; - } - } - return false; - } - - @Override - public String getRule() { - return "Whenever {this} blocks or becomes blocked by a nonblack creature, " + super.getRule(); - } - - @Override - public DeathgazerTriggeredAbility copy() { - return new DeathgazerTriggeredAbility(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/ninthedition/FinalPunishment.java b/Mage.Sets/src/mage/sets/ninthedition/FinalPunishment.java new file mode 100644 index 00000000000..1db22add0bc --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/FinalPunishment.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class FinalPunishment extends mage.sets.scourge.FinalPunishment { + + public FinalPunishment(UUID ownerId) { + super(ownerId); + this.cardNumber = 131; + this.expansionSetCode = "9ED"; + } + + public FinalPunishment(final FinalPunishment card) { + super(card); + } + + @Override + public FinalPunishment copy() { + return new FinalPunishment(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/FishliverOil.java b/Mage.Sets/src/mage/sets/ninthedition/FishliverOil.java index ebad40a8646..f10d10bc854 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/FishliverOil.java +++ b/Mage.Sets/src/mage/sets/ninthedition/FishliverOil.java @@ -32,7 +32,7 @@ import java.util.UUID; /** * @author Laxika */ -public class FishliverOil extends mage.sets.arabiannights.FishliverOil { +public class FishliverOil extends mage.sets.arabiannights.FishliverOil1 { public FishliverOil(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/ninthedition/FlowstoneCrusher.java b/Mage.Sets/src/mage/sets/ninthedition/FlowstoneCrusher.java new file mode 100644 index 00000000000..d05061444b4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/FlowstoneCrusher.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FlowstoneCrusher extends CardImpl { + + public FlowstoneCrusher(UUID ownerId) { + super(ownerId, 184, "Flowstone Crusher", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "9ED"; + this.subtype.add("Beast"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {R}: Flowstone Crusher gets +1/-1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BoostSourceEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public FlowstoneCrusher(final FlowstoneCrusher card) { + super(card); + } + + @Override + public FlowstoneCrusher copy() { + return new FlowstoneCrusher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/FlowstoneShambler.java b/Mage.Sets/src/mage/sets/ninthedition/FlowstoneShambler.java new file mode 100644 index 00000000000..4ec8d5747a6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/FlowstoneShambler.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FlowstoneShambler extends CardImpl { + + public FlowstoneShambler(UUID ownerId) { + super(ownerId, 185, "Flowstone Shambler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "9ED"; + this.subtype.add("Beast"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {R}: Flowstone Shambler gets +1/-1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BoostSourceEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public FlowstoneShambler(final FlowstoneShambler card) { + super(card); + } + + @Override + public FlowstoneShambler copy() { + return new FlowstoneShambler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/GuerrillaTactics.java b/Mage.Sets/src/mage/sets/ninthedition/GuerrillaTactics.java index 052be88b5cf..e49ec5a5267 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/GuerrillaTactics.java +++ b/Mage.Sets/src/mage/sets/ninthedition/GuerrillaTactics.java @@ -50,7 +50,6 @@ public class GuerrillaTactics extends CardImpl { super(ownerId, 196, "Guerrilla Tactics", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); this.expansionSetCode = "9ED"; - // Guerrilla Tactics deals 2 damage to target creature or player. this.getSpellAbility().addEffect(new DamageTargetEffect(2)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); @@ -91,9 +90,13 @@ class GuerrillaTacticsTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) && - StackObject.class.isInstance(game.getObject(event.getSourceId())) && - getSourceId().equals(event.getTargetId()); + if (getSourceId().equals(event.getTargetId())) { + StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); + if (stackObject != null) { + return game.getOpponents(this.getControllerId()).contains(stackObject.getControllerId()); + } + } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/ninthedition/HellsCaretaker.java b/Mage.Sets/src/mage/sets/ninthedition/HellsCaretaker.java new file mode 100644 index 00000000000..8e545b8c4b0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/HellsCaretaker.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.condition.common.IsStepCondition; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class HellsCaretaker extends CardImpl { + + public HellsCaretaker(UUID ownerId) { + super(ownerId, 137, "Hell's Caretaker", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "9ED"; + this.subtype.add("Horror"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}, Sacrifice a creature: Return target creature card from your graveyard to the battlefield. Activate this ability only during your upkeep. + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + new ReturnFromGraveyardToBattlefieldTargetEffect(), + new TapSourceCost(), + new IsStepCondition(PhaseStep.UPKEEP), null); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + this.addAbility(ability); + } + + public HellsCaretaker(final HellsCaretaker card) { + super(card); + } + + @Override + public HellsCaretaker copy() { + return new HellsCaretaker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/HorrorOfHorrors.java b/Mage.Sets/src/mage/sets/ninthedition/HorrorOfHorrors.java new file mode 100644 index 00000000000..5f229c7da13 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/HorrorOfHorrors.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class HorrorOfHorrors extends mage.sets.legends.HorrorOfHorrors { + + public HorrorOfHorrors(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + this.expansionSetCode = "9ED"; + } + + public HorrorOfHorrors(final HorrorOfHorrors card) { + super(card); + } + + @Override + public HorrorOfHorrors copy() { + return new HorrorOfHorrors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/ImaginaryPet.java b/Mage.Sets/src/mage/sets/ninthedition/ImaginaryPet.java new file mode 100644 index 00000000000..cbc264edc80 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/ImaginaryPet.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ImaginaryPet extends mage.sets.urzassaga.ImaginaryPet { + + public ImaginaryPet(UUID ownerId) { + super(ownerId); + this.cardNumber = 82; + this.expansionSetCode = "9ED"; + } + + public ImaginaryPet(final ImaginaryPet card) { + super(card); + } + + @Override + public ImaginaryPet copy() { + return new ImaginaryPet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/Inspirit.java b/Mage.Sets/src/mage/sets/ninthedition/Inspirit.java new file mode 100644 index 00000000000..12112f59e1d --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/Inspirit.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Inspirit extends mage.sets.onslaught.Inspirit { + + public Inspirit(UUID ownerId) { + super(ownerId); + this.cardNumber = 22; + this.expansionSetCode = "9ED"; + } + + public Inspirit(final Inspirit card) { + super(card); + } + + @Override + public Inspirit copy() { + return new Inspirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/MarbleTitan.java b/Mage.Sets/src/mage/sets/ninthedition/MarbleTitan.java new file mode 100644 index 00000000000..61d49319d2f --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/MarbleTitan.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MarbleTitan extends mage.sets.tempest.MarbleTitan { + + public MarbleTitan(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + this.expansionSetCode = "9ED"; + } + + public MarbleTitan(final MarbleTitan card) { + super(card); + } + + @Override + public MarbleTitan copy() { + return new MarbleTitan(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/RogueKavu.java b/Mage.Sets/src/mage/sets/ninthedition/RogueKavu.java new file mode 100644 index 00000000000..88b9d47c882 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/RogueKavu.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class RogueKavu extends CardImpl { + + public RogueKavu(UUID ownerId) { + super(ownerId, 213, "Rogue Kavu", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "9ED"; + this.subtype.add("Kavu"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Rogue Kavu attacks alone, it gets +2/+0 until end of turn. + this.addAbility(new AttacksAloneTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn))); + } + + public RogueKavu(final RogueKavu card) { + super(card); + } + + @Override + public RogueKavu copy() { + return new RogueKavu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/RukhEgg.java b/Mage.Sets/src/mage/sets/ninthedition/RukhEgg.java index 511c5a81db2..4afbb0214eb 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/RukhEgg.java +++ b/Mage.Sets/src/mage/sets/ninthedition/RukhEgg.java @@ -34,7 +34,7 @@ import mage.constants.Rarity; * * @author anonymous */ -public class RukhEgg extends mage.sets.arabiannights.RukhEgg { +public class RukhEgg extends mage.sets.arabiannights.RukhEgg1 { public RukhEgg(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/ninthedition/SageAven.java b/Mage.Sets/src/mage/sets/ninthedition/SageAven.java new file mode 100644 index 00000000000..c7a91f38e44 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/SageAven.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.LookLibraryControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SageAven extends CardImpl { + + public SageAven(UUID ownerId) { + super(ownerId, 95, "Sage Aven", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "9ED"; + this.subtype.add("Bird"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Sage Aven enters the battlefield, look at the top four cards of your library, then put them back in any order. + this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryControllerEffect(4))); + } + + public SageAven(final SageAven card) { + super(card); + } + + @Override + public SageAven copy() { + return new SageAven(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/SanctumGuardian.java b/Mage.Sets/src/mage/sets/ninthedition/SanctumGuardian.java new file mode 100644 index 00000000000..938fc482053 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/SanctumGuardian.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.PreventNextDamageFromChosenSourceToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class SanctumGuardian extends CardImpl { + + public SanctumGuardian(UUID ownerId) { + super(ownerId, 40, "Sanctum Guardian", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "9ED"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Sacrifice Sanctum Guardian: The next time a source of your choice would deal damage to target creature or player this turn, prevent that damage. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventNextDamageFromChosenSourceToTargetEffect(Duration.EndOfTurn), + new SacrificeSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public SanctumGuardian(final SanctumGuardian card) { + super(card); + } + + @Override + public SanctumGuardian copy() { + return new SanctumGuardian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/TeferisPuzzleBox.java b/Mage.Sets/src/mage/sets/ninthedition/TeferisPuzzleBox.java index 636a1fe1ad8..a62fe24a922 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/TeferisPuzzleBox.java +++ b/Mage.Sets/src/mage/sets/ninthedition/TeferisPuzzleBox.java @@ -27,25 +27,22 @@ */ package mage.sets.ninthedition; -import mage.constants.*; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.BeginningOfDrawTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.filter.FilterCard; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; import mage.game.Game; import mage.players.Player; -import mage.target.TargetCard; - -import java.util.UUID; /** * * @author noxx - + * */ public class TeferisPuzzleBox extends CardImpl { @@ -87,30 +84,7 @@ class TeferisPuzzleBoxEffect extends OneShotEffect { Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player != null) { int count = player.getHand().size(); - - // puts the cards in his or her hand on the bottom of his or her library in any order - Cards cards = new CardsImpl(); - for (Card card : player.getHand().getCards(game)) { - cards.add(card.getId()); - } - - TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library")); - while (player.canRespond() && cards.size() > 1) { - player.choose(Outcome.Neutral, cards, target, game); - Card card = cards.get(target.getFirstTarget(), game); - if (card != null) { - cards.remove(card); - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); - } - target.clearChosen(); - } - if (cards.size() == 1) { - Card card = cards.get(cards.iterator().next(), game); - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false); - } - player.getHand().clear(); - - // draws that many cards + player.putCardsOnBottomOfLibrary(player.getHand(), game, source, true); player.drawCards(count, game); } return true; diff --git a/Mage.Sets/src/mage/sets/ninthedition/Thundermare.java b/Mage.Sets/src/mage/sets/ninthedition/Thundermare.java new file mode 100644 index 00000000000..a9e7495472e --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/Thundermare.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Thundermare extends mage.sets.portal.Thundermare { + + public Thundermare(UUID ownerId) { + super(ownerId); + this.cardNumber = 224; + this.expansionSetCode = "9ED"; + } + + public Thundermare(final Thundermare card) { + super(card); + } + + @Override + public Thundermare copy() { + return new Thundermare(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java b/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java index e506714d397..c769466b309 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java +++ b/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java @@ -29,17 +29,14 @@ package mage.sets.ninthedition; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.Effect; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; +import mage.constants.TargetController; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; /** * @@ -61,8 +58,8 @@ public class ViashinoSandstalker extends CardImpl { this.addAbility(HasteAbility.getInstance()); // At the beginning of the end step, return Viashino Sandstalker to its owner's hand. - this.addAbility(new BeginningOfEndStepTriggeredAbility(new ReturnToHandSourceEffect(true), false)); - + this.addAbility(new BeginningOfEndStepTriggeredAbility(new ReturnToHandSourceEffect(true), + TargetController.ANY, false)); } public ViashinoSandstalker(final ViashinoSandstalker card) { @@ -74,34 +71,3 @@ public class ViashinoSandstalker extends CardImpl { return new ViashinoSandstalker(this); } } - -class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl { - - public BeginningOfEndStepTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, effect, optional); - } - - public BeginningOfEndStepTriggeredAbility(final BeginningOfEndStepTriggeredAbility ability) { - super(ability); - } - - @Override - public BeginningOfEndStepTriggeredAbility copy() { - return new BeginningOfEndStepTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.END_TURN_STEP_PRE; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return true; - } - - @Override - public String getRule() { - return "At the beginning of the end step, return {this} to its owner's hand"; - } -} diff --git a/Mage.Sets/src/mage/sets/ninthedition/WanderguardSentry.java b/Mage.Sets/src/mage/sets/ninthedition/WanderguardSentry.java index e0e33069cdf..798ecb02a0c 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/WanderguardSentry.java +++ b/Mage.Sets/src/mage/sets/ninthedition/WanderguardSentry.java @@ -31,11 +31,11 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.common.RevealHandTargetEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.LookAtTargetPlayerHandEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.TargetController; import mage.target.common.TargetOpponent; /** @@ -53,7 +53,9 @@ public class WanderguardSentry extends CardImpl { this.toughness = new MageInt(3); // When Wanderguard Sentry enters the battlefield, look at target opponent's hand. - Ability ability = new EntersBattlefieldTriggeredAbility(new RevealHandTargetEffect(TargetController.OPPONENT)); + Effect effect = new LookAtTargetPlayerHandEffect(); + effect.setText("look at target opponent's hand"); + Ability ability = new EntersBattlefieldTriggeredAbility(effect); ability.addTarget(new TargetOpponent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/ninthedition/WhipSergeant.java b/Mage.Sets/src/mage/sets/ninthedition/WhipSergeant.java new file mode 100644 index 00000000000..9342c790986 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/WhipSergeant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WhipSergeant extends mage.sets.prophecy.WhipSergeant { + + public WhipSergeant(UUID ownerId) { + super(ownerId); + this.cardNumber = 227; + this.expansionSetCode = "9ED"; + } + + public WhipSergeant(final WhipSergeant card) { + super(card); + } + + @Override + public WhipSergeant copy() { + return new WhipSergeant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/ZealousInquisitor.java b/Mage.Sets/src/mage/sets/ninthedition/ZealousInquisitor.java new file mode 100644 index 00000000000..f5053a18f8e --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/ZealousInquisitor.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ninthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RedirectDamageFromSourceToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class ZealousInquisitor extends CardImpl { + + public ZealousInquisitor(UUID ownerId) { + super(ownerId, 57, "Zealous Inquisitor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "9ED"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {1}{W}: The next 1 damage that would be dealt to Zealous Inquisitor this turn is dealt to target creature instead. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RedirectDamageFromSourceToTargetEffect(Duration.EndOfTurn, 1, true), new ManaCostsImpl("{1}{W}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ZealousInquisitor(final ZealousInquisitor card) { + super(card); + } + + @Override + public ZealousInquisitor copy() { + return new ZealousInquisitor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/AnimalBoneyard.java b/Mage.Sets/src/mage/sets/odyssey/AnimalBoneyard.java index 1d5d1346d3d..9209498429f 100644 --- a/Mage.Sets/src/mage/sets/odyssey/AnimalBoneyard.java +++ b/Mage.Sets/src/mage/sets/odyssey/AnimalBoneyard.java @@ -69,11 +69,11 @@ public class AnimalBoneyard extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - // Enchanted land has "{tap}, Sacrifice a creature: You gain life equal to that creature's toughness." + // Enchanted land has "{T}, Sacrifice a creature: You gain life equal to that creature's toughness." Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AnimalBoneyardEffect(), new TapSourceCost()); gainedAbility.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, - "Enchanted land has \"{tap}, Sacrifice a creature: You gain life equal to that creature's toughness.\""); + "Enchanted land has \"{T}, Sacrifice a creature: You gain life equal to that creature's toughness.\""); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/sets/odyssey/AuraGraft.java b/Mage.Sets/src/mage/sets/odyssey/AuraGraft.java new file mode 100644 index 00000000000..788ded625bd --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/AuraGraft.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class AuraGraft extends mage.sets.tenthedition.AuraGraft { + + public AuraGraft(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "ODY"; + } + + public AuraGraft(final AuraGraft card) { + super(card); + } + + @Override + public AuraGraft copy() { + return new AuraGraft(this); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/BalshanGriffin.java b/Mage.Sets/src/mage/sets/odyssey/BalshanGriffin.java index 02662a1d3bc..fe4767b9919 100644 --- a/Mage.Sets/src/mage/sets/odyssey/BalshanGriffin.java +++ b/Mage.Sets/src/mage/sets/odyssey/BalshanGriffin.java @@ -49,7 +49,7 @@ import mage.target.common.TargetCardInHand; public class BalshanGriffin extends CardImpl { public BalshanGriffin(UUID ownerId) { - super(ownerId, 67, "Balshan Griffin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + super(ownerId, 67, "Balshan Griffin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); this.expansionSetCode = "ODY"; this.subtype.add("Griffin"); diff --git a/Mage.Sets/src/mage/sets/odyssey/BeastAttack.java b/Mage.Sets/src/mage/sets/odyssey/BeastAttack.java index d0b535fcdd1..750cf415525 100644 --- a/Mage.Sets/src/mage/sets/odyssey/BeastAttack.java +++ b/Mage.Sets/src/mage/sets/odyssey/BeastAttack.java @@ -28,7 +28,6 @@ package mage.sets.odyssey; import java.util.UUID; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; @@ -37,7 +36,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.TimingRule; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.BeastToken2; /** * @@ -49,10 +48,9 @@ public class BeastAttack extends CardImpl { super(ownerId, 230, "Beast Attack", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{G}{G}{G}"); this.expansionSetCode = "ODY"; - // Put a 4/4 green Beast creature token onto the battlefield. - this.getSpellAbility().addEffect(new CreateTokenEffect(new BeastToken_44())); - + this.getSpellAbility().addEffect(new CreateTokenEffect(new BeastToken2())); + // Flashback {2}{G}{G}{G} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{G}{G}{G}"), TimingRule.INSTANT)); } @@ -66,18 +64,3 @@ public class BeastAttack extends CardImpl { return new BeastAttack(this); } } - -class BeastToken_44 extends Token { - - public BeastToken_44() { - super("Beast", "4/4 green Beast creature token"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Beast"); - power = new MageInt(4); - toughness = new MageInt(4); - // to get an image for the token - this.setOriginalExpansionSetCode("ZEN"); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/odyssey/BurningSands.java b/Mage.Sets/src/mage/sets/odyssey/BurningSands.java index de47ee28336..fbea465432a 100644 --- a/Mage.Sets/src/mage/sets/odyssey/BurningSands.java +++ b/Mage.Sets/src/mage/sets/odyssey/BurningSands.java @@ -46,20 +46,22 @@ import mage.target.targetpointer.FixedTarget; */ public class BurningSands extends CardImpl { + private final UUID originalId; private static final FilterLandPermanent filter = new FilterLandPermanent("a land"); public BurningSands(UUID ownerId) { super(ownerId, 180, "Burning Sands", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}"); this.expansionSetCode = "ODY"; - // Whenever a creature dies, that creature's controller sacrifices a land. - this.addAbility(new DiesCreatureTriggeredAbility(new SacrificeEffect(filter, 1, "that creature's controller"), false, false, true)); + Ability ability = new DiesCreatureTriggeredAbility(new SacrificeEffect(filter, 1, "that creature's controller"), false, false, true); + originalId = ability.getOriginalId(); + this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof DiesCreatureTriggeredAbility) { + if (ability.getOriginalId().equals(originalId)) { UUID creatureId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability); Permanent creature = (Permanent) game.getLastKnownInformation(creatureId, Zone.BATTLEFIELD); if (creature != null) { @@ -70,6 +72,7 @@ public class BurningSands extends CardImpl { public BurningSands(final BurningSands card) { super(card); + this.originalId = card.originalId; } @Override diff --git a/Mage.Sets/src/mage/sets/odyssey/CabalInquisitor.java b/Mage.Sets/src/mage/sets/odyssey/CabalInquisitor.java index 7d3dac197f4..a0a48bb3b26 100644 --- a/Mage.Sets/src/mage/sets/odyssey/CabalInquisitor.java +++ b/Mage.Sets/src/mage/sets/odyssey/CabalInquisitor.java @@ -89,7 +89,7 @@ public class CabalInquisitor extends CardImpl { class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl { private Condition condition; - private String ruleText = "Threshold - {1}{B}, {t}, Exile two cards from your graveyard: Target player discards a card. Activate this ability only any time you could cast a sorcery, and only if seven or more cards are in your graveyard."; + private String ruleText = "Threshold - {1}{B}, {t}, Exile two cards from your graveyard: Target player discards a card. Activate this ability only any time you could cast a sorcery, and only if seven or more cards are in your graveyard."; private static final Effects emptyEffects = new Effects(); diff --git a/Mage.Sets/src/mage/sets/odyssey/CeaseFire.java b/Mage.Sets/src/mage/sets/odyssey/CeaseFire.java index 46fb361deca..e10245abbee 100644 --- a/Mage.Sets/src/mage/sets/odyssey/CeaseFire.java +++ b/Mage.Sets/src/mage/sets/odyssey/CeaseFire.java @@ -31,7 +31,6 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -55,11 +54,10 @@ public class CeaseFire extends CardImpl { super(ownerId, 14, "Cease-Fire", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); this.expansionSetCode = "ODY"; - // Target player can't cast creature spells this turn. this.getSpellAbility().addEffect(new CeaseFireEffect()); this.getSpellAbility().addTarget(new TargetPlayer()); - + // Draw a card. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); } @@ -77,6 +75,7 @@ public class CeaseFire extends CardImpl { class CeaseFireEffect extends ContinuousRuleModifyingEffectImpl { private static final FilterSpell filter = new FilterSpell(); + static { filter.add(new CardTypePredicate(CardType.CREATURE)); } @@ -104,7 +103,7 @@ class CeaseFireEffect extends ContinuousRuleModifyingEffectImpl { public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't cast creature spells this turn (" + mageObject.getLogName() + ")."; + return "You can't cast creature spells this turn (" + mageObject.getIdName() + ")."; } return null; } diff --git a/Mage.Sets/src/mage/sets/odyssey/Decimate.java b/Mage.Sets/src/mage/sets/odyssey/Decimate.java index a5f40f11349..e4c7b92ee7f 100644 --- a/Mage.Sets/src/mage/sets/odyssey/Decimate.java +++ b/Mage.Sets/src/mage/sets/odyssey/Decimate.java @@ -48,9 +48,8 @@ public class Decimate extends CardImpl { super(ownerId, 287, "Decimate", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{R}{G}"); this.expansionSetCode = "ODY"; - // Destroy target artifact, target creature, target enchantment, and target land. - Effect effect = new DestroyTargetEffect(); + Effect effect = new DestroyTargetEffect(false, true); effect.setText("Destroy target artifact, target creature, target enchantment, and target land."); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetArtifactPermanent()); diff --git a/Mage.Sets/src/mage/sets/odyssey/DiligentFarmhand.java b/Mage.Sets/src/mage/sets/odyssey/DiligentFarmhand.java index fbd76745f53..eff14e87010 100644 --- a/Mage.Sets/src/mage/sets/odyssey/DiligentFarmhand.java +++ b/Mage.Sets/src/mage/sets/odyssey/DiligentFarmhand.java @@ -31,10 +31,8 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.InfoEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -63,7 +61,7 @@ public class DiligentFarmhand extends CardImpl { ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); // If Diligent Farmhand is in a graveyard, effects from spells named Muscle Burst count it as a card named Muscle Burst. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new InfoEffect("If Diligent Farmhand is in a graveyard, effects from spells named Muscle Burst count it as a card named Muscle Burst"))); + this.addAbility(MuscleBurst.getCountAsAbility()); } public DiligentFarmhand(final DiligentFarmhand card) { diff --git a/Mage.Sets/src/mage/sets/odyssey/DivineSacrament.java b/Mage.Sets/src/mage/sets/odyssey/DivineSacrament.java index 0758743b18d..c6650039d9b 100644 --- a/Mage.Sets/src/mage/sets/odyssey/DivineSacrament.java +++ b/Mage.Sets/src/mage/sets/odyssey/DivineSacrament.java @@ -32,8 +32,7 @@ import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.CardsInControllerGraveCondition; -import mage.abilities.decorator.ConditionalOneShotEffect; -import mage.abilities.effects.common.AddContinuousEffectToGame; +import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -63,8 +62,8 @@ public class DivineSacrament extends CardImpl { Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false)); this.addAbility(ability); // Threshold - White creatures get an additional +1/+1 as long as seven or more cards are in your graveyard. - ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalOneShotEffect( - new AddContinuousEffectToGame(new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false)), + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false), new CardsInControllerGraveCondition(7), "Threshold - If seven or more cards are in your graveyard, white creatures get an additional +1/+1." )); diff --git a/Mage.Sets/src/mage/sets/odyssey/FerventDenial.java b/Mage.Sets/src/mage/sets/odyssey/FerventDenial.java index 990232bc94e..24cb2a3e330 100644 --- a/Mage.Sets/src/mage/sets/odyssey/FerventDenial.java +++ b/Mage.Sets/src/mage/sets/odyssey/FerventDenial.java @@ -44,7 +44,7 @@ import mage.target.TargetSpell; public class FerventDenial extends CardImpl { public FerventDenial(UUID ownerId) { - super(ownerId, 86, "Fervent Denial", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{U}"); + super(ownerId, 86, "Fervent Denial", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{U}{U}"); this.expansionSetCode = "ODY"; diff --git a/Mage.Sets/src/mage/sets/odyssey/FlameBurst.java b/Mage.Sets/src/mage/sets/odyssey/FlameBurst.java new file mode 100644 index 00000000000..b10502aa3e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/FlameBurst.java @@ -0,0 +1,122 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class FlameBurst extends CardImpl { + + private static final FilterCard filter = new FilterCard(); + + static { + filter.add(Predicates.or(new NamePredicate("Flame Burst"), + new AbilityPredicate(CountAsFlameBurstAbility.class))); + } + + public FlameBurst(UUID ownerId) { + super(ownerId, 194, "Flame Burst", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "ODY"; + + // Flame Burst deals X damage to target creature or player, where X is 2 plus the number of cards named Flame Burst in all graveyards. + Effect effect = new DamageTargetEffect(new FlameBurstCount(filter)); + effect.setText("{this} deals X damage to target creature or player, where X is 2 plus the number of cards named Flame Burst in all graveyards."); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public FlameBurst(final FlameBurst card) { + super(card); + } + + @Override + public FlameBurst copy() { + return new FlameBurst(this); + } + + public static Ability getCountAsAbility() { + return new CountAsFlameBurstAbility(); + } +} + +class FlameBurstCount extends CardsInAllGraveyardsCount { + + public FlameBurstCount(FilterCard filter) { + super(filter); + } + + public FlameBurstCount(FlameBurstCount value) { + super(value); + } + + public FlameBurstCount copy() { + return new FlameBurstCount(this); + } + + @Override + public int calculate(Game game, Ability source, Effect effect) { + return super.calculate(game, source, effect) + 2; + } + +} + +class CountAsFlameBurstAbility extends SimpleStaticAbility { + + public CountAsFlameBurstAbility() { + super(Zone.GRAVEYARD, new InfoEffect("If {this} is in a graveyard, effects from spells named Flame Burst count it as a card named Flame Burst")); + } + + public CountAsFlameBurstAbility(CountAsFlameBurstAbility ability) { + super(ability); + } + + @Override + public CountAsFlameBurstAbility copy() { + return new CountAsFlameBurstAbility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/MomentsPeace.java b/Mage.Sets/src/mage/sets/odyssey/MomentsPeace.java index 356c6690658..99d6411591d 100644 --- a/Mage.Sets/src/mage/sets/odyssey/MomentsPeace.java +++ b/Mage.Sets/src/mage/sets/odyssey/MomentsPeace.java @@ -28,14 +28,13 @@ package mage.sets.odyssey; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.PreventAllDamageByAllEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.TimingRule; /** @@ -48,9 +47,9 @@ public class MomentsPeace extends CardImpl { super(ownerId, 251, "Moment's Peace", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); this.expansionSetCode = "ODY"; - // Prevent all combat damage that would be dealt this turn. this.getSpellAbility().addEffect(new PreventAllDamageByAllEffect(Duration.EndOfTurn, true)); + // Flashback {2}{G} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{G}"), TimingRule.INSTANT)); } diff --git a/Mage.Sets/src/mage/sets/odyssey/MuscleBurst.java b/Mage.Sets/src/mage/sets/odyssey/MuscleBurst.java new file mode 100644 index 00000000000..d2108c88c4d --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/MuscleBurst.java @@ -0,0 +1,123 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MuscleBurst extends CardImpl { + + private static final FilterCard filter = new FilterCard(); + + static { + filter.add(Predicates.or(new NamePredicate("Muscle Burst"), + new AbilityPredicate(CountAsMuscleBurstAbility.class))); + } + + public MuscleBurst(UUID ownerId) { + super(ownerId, 252, "Muscle Burst", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "ODY"; + + // Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards. + MuscleBurstCount count = new MuscleBurstCount(filter); + Effect effect = new BoostTargetEffect(count, count, Duration.EndOfTurn, true); + effect.setText("Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards."); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public MuscleBurst(final MuscleBurst card) { + super(card); + } + + @Override + public MuscleBurst copy() { + return new MuscleBurst(this); + } + + public static Ability getCountAsAbility() { + return new CountAsMuscleBurstAbility(); + } +} + +class MuscleBurstCount extends CardsInAllGraveyardsCount { + + public MuscleBurstCount(FilterCard filter) { + super(filter); + } + + public MuscleBurstCount(MuscleBurstCount value) { + super(value); + } + + public MuscleBurstCount copy() { + return new MuscleBurstCount(this); + } + + @Override + public int calculate(Game game, Ability source, Effect effect) { + return super.calculate(game, source, effect) + 3; + } + +} + +class CountAsMuscleBurstAbility extends SimpleStaticAbility { + + public CountAsMuscleBurstAbility() { + super(Zone.GRAVEYARD, new InfoEffect("If {this} is in a graveyard, effects from spells named Muscle Burst count it as a card named Muscle Burst")); + } + + public CountAsMuscleBurstAbility(CountAsMuscleBurstAbility ability) { + super(ability); + } + + @Override + public CountAsMuscleBurstAbility copy() { + return new CountAsMuscleBurstAbility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/NomadDecoy.java b/Mage.Sets/src/mage/sets/odyssey/NomadDecoy.java index 94f051146c7..b2befb9492c 100644 --- a/Mage.Sets/src/mage/sets/odyssey/NomadDecoy.java +++ b/Mage.Sets/src/mage/sets/odyssey/NomadDecoy.java @@ -65,13 +65,13 @@ public class NomadDecoy extends CardImpl { ability.addCost(new TapSourceCost()); this.addAbility(ability); - // Threshold - {W}{W}, {tap}: Tap two target creatures. Activate this ability only if seven or more cards are in your graveyard. + // Threshold - {W}{W}, {T}: Tap two target creatures. Activate this ability only if seven or more cards are in your graveyard. Ability thresholdAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{W}{W}")); thresholdAbility.addTarget(new TargetCreaturePermanent(2)); thresholdAbility.addCost(new TapSourceCost()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(thresholdAbility), new CardsInControllerGraveCondition(7), - "Threshold - {W}{W}, {tap}: Tap two target creatures. Activate this ability only if seven or more cards are in your graveyard."))); + "Threshold - {W}{W}, {T}: Tap two target creatures. Activate this ability only if seven or more cards are in your graveyard."))); } public NomadDecoy(final NomadDecoy card) { diff --git a/Mage.Sets/src/mage/sets/odyssey/PardicFirecat.java b/Mage.Sets/src/mage/sets/odyssey/PardicFirecat.java new file mode 100644 index 00000000000..fa4acba3663 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/PardicFirecat.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class PardicFirecat extends CardImpl { + + public PardicFirecat(UUID ownerId) { + super(ownerId, 211, "Pardic Firecat", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "ODY"; + this.subtype.add("Elemental"); + this.subtype.add("Cat"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // If Pardic Firecat is in a graveyard, effects from spells named Flame Burst count it as a card named Flame Burst. + this.addAbility(FlameBurst.getCountAsAbility()); + } + + public PardicFirecat(final PardicFirecat card) { + super(card); + } + + @Override + public PardicFirecat copy() { + return new PardicFirecat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/PardicMiner.java b/Mage.Sets/src/mage/sets/odyssey/PardicMiner.java index 3dcbfb8222b..42875327669 100644 --- a/Mage.Sets/src/mage/sets/odyssey/PardicMiner.java +++ b/Mage.Sets/src/mage/sets/odyssey/PardicMiner.java @@ -75,7 +75,7 @@ public class PardicMiner extends CardImpl { } class PardicMinerEffect extends ContinuousRuleModifyingEffectImpl { - + public PardicMinerEffect() { super(Duration.EndOfTurn, Outcome.Detriment); staticText = "Target player can't play lands this turn."; @@ -99,7 +99,7 @@ class PardicMinerEffect extends ContinuousRuleModifyingEffectImpl { public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't play lands this turn (" + mageObject.getLogName() + ")."; + return "You can't play lands this turn (" + mageObject.getIdName() + ")."; } return null; } diff --git a/Mage.Sets/src/mage/sets/odyssey/RitesOfInitiation.java b/Mage.Sets/src/mage/sets/odyssey/RitesOfInitiation.java new file mode 100644 index 00000000000..dbaff078468 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/RitesOfInitiation.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author emerald000 + */ +public class RitesOfInitiation extends CardImpl { + + public RitesOfInitiation(UUID ownerId) { + super(ownerId, 217, "Rites of Initiation", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "ODY"; + + // Discard any number of cards at random. Creatures you control get +1/+0 until end of turn for each card discarded this way. + this.getSpellAbility().addEffect(new RitesOfInitiationEffect()); + } + + public RitesOfInitiation(final RitesOfInitiation card) { + super(card); + } + + @Override + public RitesOfInitiation copy() { + return new RitesOfInitiation(this); + } +} + +class RitesOfInitiationEffect extends OneShotEffect { + + RitesOfInitiationEffect() { + super(Outcome.BoostCreature); + this.staticText = "Discard any number of cards at random. Creatures you control get +1/+0 until end of turn for each card discarded this way"; + } + + RitesOfInitiationEffect(final RitesOfInitiationEffect effect) { + super(effect); + } + + @Override + public RitesOfInitiationEffect copy() { + return new RitesOfInitiationEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + int numToDiscard = player.getAmount(0, player.getHand().size(), "Discard how many cards at random?", game); + player.discard(numToDiscard, true, source, game); + game.addEffect(new BoostControlledEffect(numToDiscard, 0, Duration.EndOfTurn), source); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/SacredRites.java b/Mage.Sets/src/mage/sets/odyssey/SacredRites.java index 9b81acc9b99..b066c5a7482 100644 --- a/Mage.Sets/src/mage/sets/odyssey/SacredRites.java +++ b/Mage.Sets/src/mage/sets/odyssey/SacredRites.java @@ -41,7 +41,6 @@ import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; import mage.target.Target; -import mage.target.Targets; import mage.target.common.TargetCardInHand; /** @@ -56,7 +55,6 @@ public class SacredRites extends CardImpl { // Discard any number of cards. Creatures you control get +0/+1 until end of turn for each card discarded this way. - this.getSpellAbility().addTarget(new TargetCardInHand(0, Integer.MAX_VALUE, new FilterCard())); this.getSpellAbility().addEffect(new SacredRitesEffect()); } @@ -72,12 +70,12 @@ public class SacredRites extends CardImpl { class SacredRitesEffect extends OneShotEffect { - public SacredRitesEffect() { + SacredRitesEffect() { super(Outcome.Benefit); this.staticText = "Discard any number of cards. Creatures you control get +0/+1 until end of turn for each card discarded this way."; } - public SacredRitesEffect(final SacredRitesEffect effect) { + SacredRitesEffect(final SacredRitesEffect effect) { super(effect); } @@ -90,14 +88,18 @@ class SacredRitesEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - Targets targets = source.getTargets(); - int i = 0; - for (Target target: targets) { - Card card = game.getCard(target.getFirstTarget()); - player.discard(card, source, game); - i++; + Target target = new TargetCardInHand(0, Integer.MAX_VALUE, new FilterCard("cards to discard")); + while (player.canRespond() && !target.isChosen()) { + target.choose(Outcome.BoostCreature, player.getId(), source.getSourceId(), game); + } + int numDiscarded = 0; + for (UUID targetId : target.getTargets()) { + Card card = player.getHand().get(targetId, game); + if (player.discard(card, source, game)) { + numDiscarded++; + } } - game.addEffect(new BoostControlledEffect(0, i, Duration.EndOfTurn), source); + game.addEffect(new BoostControlledEffect(0, numDiscarded, Duration.EndOfTurn), source); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/odyssey/ShowerOfCoals.java b/Mage.Sets/src/mage/sets/odyssey/ShowerOfCoals.java index 6043783ef79..f7bb4159f8e 100644 --- a/Mage.Sets/src/mage/sets/odyssey/ShowerOfCoals.java +++ b/Mage.Sets/src/mage/sets/odyssey/ShowerOfCoals.java @@ -53,7 +53,7 @@ public class ShowerOfCoals extends CardImpl { Effect effect = new ConditionalOneShotEffect(new DamageTargetEffect(4), new DamageTargetEffect(2), new CardsInControllerGraveCondition(7), - "{this} deals 2 damage to each of up to three target creatures and/or players.

Threshold - {this} deals 4 damage to each of those creatures and/or players instead if seven or more cards are in your graveyard."); + "{this} deals 2 damage to each of up to three target creatures and/or players.

Threshold - {this} deals 4 damage to each of those creatures and/or players instead if seven or more cards are in your graveyard."); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer(0,3)); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/sets/odyssey/SylvanMight.java b/Mage.Sets/src/mage/sets/odyssey/SylvanMight.java new file mode 100644 index 00000000000..5c999e567c9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/SylvanMight.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.FlashbackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TimingRule; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SylvanMight extends CardImpl { + + public SylvanMight(UUID ownerId) { + super(ownerId, 277, "Sylvan Might", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "ODY"; + + // Target creature gets +2/+2 and gains trample until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // Flashback {2}{G}{G} + this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{G}{G}"), TimingRule.INSTANT)); + } + + public SylvanMight(final SylvanMight card) { + super(card); + } + + @Override + public SylvanMight copy() { + return new SylvanMight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/Vivify.java b/Mage.Sets/src/mage/sets/odyssey/Vivify.java new file mode 100644 index 00000000000..1ace55114a1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/Vivify.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.permanent.token.Token; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class Vivify extends CardImpl { + + public Vivify(UUID ownerId) { + super(ownerId, 281, "Vivify", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); + this.expansionSetCode = "ODY"; + + // Target land becomes a 3/3 creature until end of turn. It's still a land. + this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new AnimatedLand(), false, true, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public Vivify(final Vivify card) { + super(card); + } + + @Override + public Vivify copy() { + return new Vivify(this); + } +} + +class AnimatedLand extends Token { + + public AnimatedLand() { + super("", "3/3 creature"); + this.cardType.add(CardType.CREATURE); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/Whipkeeper.java b/Mage.Sets/src/mage/sets/odyssey/Whipkeeper.java index 56d1531aaca..dc2d27c82ad 100644 --- a/Mage.Sets/src/mage/sets/odyssey/Whipkeeper.java +++ b/Mage.Sets/src/mage/sets/odyssey/Whipkeeper.java @@ -56,7 +56,7 @@ public class Whipkeeper extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - // {tap}: Whipkeeper deals damage to target creature equal to the damage already dealt to it this turn. + // {T}: Whipkeeper deals damage to target creature equal to the damage already dealt to it this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new WhipkeeperEffect(), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); @@ -77,7 +77,7 @@ class WhipkeeperEffect extends OneShotEffect { public WhipkeeperEffect() { super(Outcome.Damage); - staticText = "{tap}: {this} deals damage to target creature equal to the damage already dealt to it this turn."; + staticText = "{this} deals damage to target creature equal to the damage already dealt to it this turn."; } public WhipkeeperEffect(final WhipkeeperEffect effect) { super(effect); diff --git a/Mage.Sets/src/mage/sets/odyssey/Zoologist.java b/Mage.Sets/src/mage/sets/odyssey/Zoologist.java index 5780599cfe9..cc7330b0491 100644 --- a/Mage.Sets/src/mage/sets/odyssey/Zoologist.java +++ b/Mage.Sets/src/mage/sets/odyssey/Zoologist.java @@ -29,6 +29,7 @@ package mage.sets.odyssey; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; @@ -36,7 +37,6 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.cards.Cards; import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -94,25 +94,23 @@ class ZoologistEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller == null || sourceObject == null) { return false; } - if (player.getLibrary().size() > 0) { - Card card = player.getLibrary().getFromTop(game); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards("Zoologist", cards, game); - + if (controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().getFromTop(game); + controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); if (card != null) { if (card.getCardType().contains(CardType.CREATURE)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } else { - player.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); + controller.moveCards(card, Zone.GRAVEYARD, source, game); } } } - return false; + return true; } } diff --git a/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java b/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java new file mode 100644 index 00000000000..433fb6e541b --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class AirdropCondor extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Goblin creature"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public AirdropCondor(UUID ownerId) { + super(ownerId, 186, "Airdrop Condor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // {1}{R}, Sacrifice a Goblin creature: Airdrop Condor deals damage equal to the sacrificed creature's power to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new SacrificeCostCreaturesPower()), new ManaCostsImpl("{1}{R}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public AirdropCondor(final AirdropCondor card) { + super(card); + } + + @Override + public AirdropCondor copy() { + return new AirdropCondor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/AphettoGrifter.java b/Mage.Sets/src/mage/sets/onslaught/AphettoGrifter.java new file mode 100644 index 00000000000..8c5ffc0495c --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/AphettoGrifter.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class AphettoGrifter extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Wizards you control"); + + static { + filter.add(Predicates.not(new TappedPredicate())); + filter.add(new SubtypePredicate("Wizard")); + } + + public AphettoGrifter(UUID ownerId) { + super(ownerId, 65, "Aphetto Grifter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Tap two untapped Wizards you control: Tap target permanent. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapTargetCost(new TargetControlledPermanent(2, 2, filter, false))); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public AphettoGrifter(final AphettoGrifter card) { + super(card); + } + + @Override + public AphettoGrifter copy() { + return new AphettoGrifter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/AscendingAven.java b/Mage.Sets/src/mage/sets/onslaught/AscendingAven.java new file mode 100644 index 00000000000..f0b1e288940 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/AscendingAven.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class AscendingAven extends CardImpl { + + public AscendingAven(UUID ownerId) { + super(ownerId, 68, "Ascending Aven", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Ascending Aven can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + // Morph {2}{U} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{U}"))); + } + + public AscendingAven(final AscendingAven card) { + super(card); + } + + @Override + public AscendingAven copy() { + return new AscendingAven(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/Aurification.java b/Mage.Sets/src/mage/sets/onslaught/Aurification.java new file mode 100644 index 00000000000..92479ceca51 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/Aurification.java @@ -0,0 +1,164 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BecomesSubtypeAllEffect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.CounterPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +import java.util.ArrayList; +import java.util.UUID; + +/** + * + * @author andyfries + */ + +public class Aurification extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Each creature with a gold counter on it"); + + static { + filter.add(new CounterPredicate(CounterType.GOLD)); + } + + final String rule = "Each creature with a gold counter on it is a Wall in addition to its other creature types and has defender."; + + public Aurification(UUID ownerId) { + super(ownerId, 6, "Aurification", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); + this.expansionSetCode = "ONS"; + + // Whenever a creature deals damage to you, put a gold counter on it. + this.addAbility(new AddGoldCountersAbility()); + + // Each creature with a gold counter on it is a Wall in addition to its other creature types and has defender. + ArrayList subtypes = new ArrayList<>(1); + subtypes.add("Wall"); + + BecomesSubtypeAllEffect becomesSubtypeAllEffect = new BecomesSubtypeAllEffect(Duration.WhileOnBattlefield, subtypes, filter, false); + becomesSubtypeAllEffect.setText(""); + + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, becomesSubtypeAllEffect)); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(DefenderAbility.getInstance(), Duration.WhileOnBattlefield, filter, rule))); + + // When Aurification leaves the battlefield, remove all gold counters from all creatures. + this.addAbility(new LeavesBattlefieldTriggeredAbility(new RemoveAllGoldCountersEffect(), false)); + } + + public Aurification(final Aurification card) { + super(card); + } + + @Override + public Aurification copy() { + return new Aurification(this); + } + + public class AddGoldCountersAbility extends TriggeredAbilityImpl { + + public AddGoldCountersAbility() { + super(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.GOLD.createInstance())); + } + + public AddGoldCountersAbility(final AddGoldCountersAbility ability) { + super(ability); + } + + @Override + public AddGoldCountersAbility copy() { + return new AddGoldCountersAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getPlayerId().equals(this.getControllerId())) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); + } + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever a creature deals damage to you, put a gold counter on it."; + } + + } + + public class RemoveAllGoldCountersEffect extends OneShotEffect { + public RemoveAllGoldCountersEffect() { + super(Outcome.Neutral); + this.staticText = "remove all gold counters from all creatures"; + } + + public RemoveAllGoldCountersEffect(final RemoveAllGoldCountersEffect effect) { + super(effect); + } + + @Override + public RemoveAllGoldCountersEffect copy() { + return new RemoveAllGoldCountersEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) { + if (permanent != null){ + permanent.getCounters().removeAllCounters(CounterType.GOLD); + } + } + return true; + } + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/onslaught/AvenBrigadier.java b/Mage.Sets/src/mage/sets/onslaught/AvenBrigadier.java new file mode 100644 index 00000000000..8c3e7032911 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/AvenBrigadier.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class AvenBrigadier extends CardImpl { + + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Bird creatures"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("Soldier creatures"); + + static { + filter1.add(new SubtypePredicate("Bird")); + filter2.add(new SubtypePredicate("Soldier")); + } + + public AvenBrigadier(UUID ownerId) { + super(ownerId, 7, "Aven Brigadier", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}{W}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Other Bird creatures get +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter1, true))); + // Other Soldier creatures get +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter2, true))); + } + + public AvenBrigadier(final AvenBrigadier card) { + super(card); + } + + @Override + public AvenBrigadier copy() { + return new AvenBrigadier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/AvenFateshaper.java b/Mage.Sets/src/mage/sets/onslaught/AvenFateshaper.java new file mode 100644 index 00000000000..38118afecae --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/AvenFateshaper.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.LookLibraryControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class AvenFateshaper extends CardImpl { + + public AvenFateshaper(UUID ownerId) { + super(ownerId, 69, "Aven Fateshaper", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{6}{U}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Bird"); + this.subtype.add("Wizard"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Aven Fateshaper enters the battlefield, look at the top four cards of your library, then put them back in any order. + this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryControllerEffect(4))); + // {4}{U}: Look at the top four cards of your library, then put them back in any order. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(4), new ManaCostsImpl("{4}{U}"))); + } + + public AvenFateshaper(final AvenFateshaper card) { + super(card); + } + + @Override + public AvenFateshaper copy() { + return new AvenFateshaper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/BatteringCraghorn.java b/Mage.Sets/src/mage/sets/onslaught/BatteringCraghorn.java new file mode 100644 index 00000000000..482ff2d529b --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/BatteringCraghorn.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class BatteringCraghorn extends mage.sets.archenemy.BatteringCraghorn { + + public BatteringCraghorn(UUID ownerId) { + super(ownerId); + this.cardNumber = 188; + this.expansionSetCode = "ONS"; + } + + public BatteringCraghorn(final BatteringCraghorn card) { + super(card); + } + + @Override + public BatteringCraghorn copy() { + return new BatteringCraghorn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/Biorhythm.java b/Mage.Sets/src/mage/sets/onslaught/Biorhythm.java new file mode 100644 index 00000000000..d3ddf2be150 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/Biorhythm.java @@ -0,0 +1,99 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LoneFox + */ +public class Biorhythm extends CardImpl { + + public Biorhythm(UUID ownerId) { + super(ownerId, 247, "Biorhythm", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{6}{G}{G}"); + this.expansionSetCode = "ONS"; + + // Each player's life total becomes the number of creatures he or she controls. + this.getSpellAbility().addEffect(new BiorhythmEffect()); + } + + public Biorhythm(final Biorhythm card) { + super(card); + } + + @Override + public Biorhythm copy() { + return new Biorhythm(this); + } +} + +class BiorhythmEffect extends OneShotEffect { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + public BiorhythmEffect() { + super(Outcome.Neutral); + this.staticText = "Each player's life total becomes the number of creatures he or she controls"; + } + + public BiorhythmEffect(final BiorhythmEffect effect) { + super(effect); + } + + @Override + public BiorhythmEffect copy() { + return new BiorhythmEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for(UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if(player != null) { + int diff = player.getLife() - game.getBattlefield().countAll(filter, playerId, game); + if(diff > 0) { + player.loseLife(diff, game); + } + if(diff < 0) { + player.gainLife(-diff, game); + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/BlatantThievery.java b/Mage.Sets/src/mage/sets/onslaught/BlatantThievery.java new file mode 100644 index 00000000000..12c5dc8cfe9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/BlatantThievery.java @@ -0,0 +1,215 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author emerald000 + */ +public class BlatantThievery extends CardImpl { + + public BlatantThievery(UUID ownerId) { + super(ownerId, 71, "Blatant Thievery", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{U}{U}{U}"); + this.expansionSetCode = "ONS"; + + // For each opponent, gain control of target permanent that player controls. + this.getSpellAbility().addEffect(new BlatantThieveryEffect()); + } + + public BlatantThievery(final BlatantThievery card) { + super(card); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if (ability instanceof SpellAbility) { + ability.getTargets().clear(); + ability.addTarget(new BlatantThieveryTarget(game.getOpponents(ability.getControllerId()).size())); + } + } + + @Override + public BlatantThievery copy() { + return new BlatantThievery(this); + } +} + +class BlatantThieveryEffect extends OneShotEffect { + + BlatantThieveryEffect() { + super(Outcome.GainControl); + this.staticText = "For each opponent, gain control of target permanent that player controls"; + } + + BlatantThieveryEffect(final BlatantThieveryEffect effect) { + super(effect); + } + + @Override + public BlatantThieveryEffect copy() { + return new BlatantThieveryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (UUID targetId : getTargetPointer().getTargets(game, source)) { + ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame); + effect.setTargetPointer(new FixedTarget(targetId)); + game.addEffect(effect, source); + } + return true; + } +} + +class BlatantThieveryTarget extends TargetPermanent { + + Map targetOpponent = new HashMap<>(); + + public BlatantThieveryTarget(int opponents) { + super(opponents, opponents, new FilterPermanent("a permanent for each opponent"), false); + } + + public BlatantThieveryTarget(final BlatantThieveryTarget target) { + super(target); + this.targetOpponent.putAll(target.targetOpponent); + } + + @Override + public boolean canTarget(UUID controllerId, UUID objectId, Ability source, Game game) { + Permanent targetObject = game.getPermanent(objectId); + if (targetObject == null || !game.getOpponents(source.getControllerId()).contains(targetObject.getControllerId())) { + return false; + } + // If a permanent changes controller after being targeted but before this spell resolves, you won't gain control of that permanent. + if (targetOpponent.containsKey(objectId)) { + if (!targetOpponent.get(objectId).equals(targetObject.getControllerId())) { + return false; + } + } else { + // if already a target from this opponent exists, another can't be target + if (targetOpponent.values().contains(targetObject.getControllerId())) { + return false; + } + } + return super.canTarget(controllerId, objectId, source, game); + } + + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + Set opponents = new HashSet<>(); + for (UUID targetId : getTargets()) { + Permanent oldTargets = game.getPermanent(targetId); + if (oldTargets != null) { + opponents.add(oldTargets.getControllerId()); + } + } + Set possibleTargets = new HashSet<>(); + MageObject mageObject = game.getObject(sourceId); + if (mageObject == null) { + return possibleTargets; + } + for (UUID opponentId : game.getOpponents(sourceControllerId)) { + if (opponents.contains(opponentId)) { + // Target for this opponent already selected + continue; + } + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(opponentId)) { + if (permanent.canBeTargetedBy(mageObject, sourceControllerId, game)) { + possibleTargets.add(permanent.getId()); + } + } + } + return possibleTargets; + } + + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + for (UUID opponentId : game.getOpponents(sourceControllerId)) { + boolean targetAvailable = false; + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(opponentId)) { + if (!targets.containsKey(permanent.getId())) { + MageObject mageObject = game.getObject(sourceId); + if (mageObject != null && permanent.canBeTargetedBy(mageObject, sourceControllerId, game)) { + targetAvailable = true; + break; + } + + } else { + targetAvailable = true; + break; + } + } + if (!targetAvailable) { + return false; + } + } + return true; + } + + @Override + public void addTarget(UUID objectId, int amount, Ability source, Game game, boolean skipEvent) { + Permanent targetObject = game.getPermanent(objectId); + if (targetObject != null) { + targetOpponent.put(objectId, targetObject.getControllerId()); + } + super.addTarget(objectId, amount, source, game, skipEvent); + } + + @Override + public void remove(UUID id) { + super.remove(id); + targetOpponent.remove(id); + } + + @Override + public BlatantThieveryTarget copy() { + return new BlatantThieveryTarget(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/Boneknitter.java b/Mage.Sets/src/mage/sets/onslaught/Boneknitter.java new file mode 100644 index 00000000000..eacced8d3ca --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/Boneknitter.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class Boneknitter extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Zombie"); + + static { + filter.add(new SubtypePredicate("Zombie")); + } + + public Boneknitter(UUID ownerId) { + super(ownerId, 128, "Boneknitter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Zombie"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{B}: Regenerate target Zombie. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{1}{B}")); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + // Morph {2}{B} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{B}"))); + } + + public Boneknitter(final Boneknitter card) { + super(card); + } + + @Override + public Boneknitter copy() { + return new Boneknitter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/BrightstoneRitual.java b/Mage.Sets/src/mage/sets/onslaught/BrightstoneRitual.java index 896507e5b5f..5ed1e6e4089 100644 --- a/Mage.Sets/src/mage/sets/onslaught/BrightstoneRitual.java +++ b/Mage.Sets/src/mage/sets/onslaught/BrightstoneRitual.java @@ -34,7 +34,9 @@ import mage.abilities.effects.common.DynamicManaEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; +import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -42,12 +44,18 @@ import mage.filter.common.FilterCreaturePermanent; */ public class BrightstoneRitual extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent("Goblin on the battlefield"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + public BrightstoneRitual(UUID ownerId) { super(ownerId, 191, "Brightstone Ritual", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); this.expansionSetCode = "ONS"; // Add {R} to your mana pool for each Goblin on the battlefield. - this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana, new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("Goblin","Goblin on the battlefield")))); + this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana, new PermanentsOnBattlefieldCount(filter))); } public BrightstoneRitual(final BrightstoneRitual card) { diff --git a/Mage.Sets/src/mage/sets/onslaught/CabalArchon.java b/Mage.Sets/src/mage/sets/onslaught/CabalArchon.java index e67cd3fa843..9f666a50fe0 100644 --- a/Mage.Sets/src/mage/sets/onslaught/CabalArchon.java +++ b/Mage.Sets/src/mage/sets/onslaught/CabalArchon.java @@ -33,25 +33,26 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPlayer; -import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetControlledPermanent; /** * * @author fireshoes */ public class CabalArchon extends CardImpl { - - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Cleric"); - + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Cleric"); + static { filter.add(new SubtypePredicate("Cleric")); } @@ -66,8 +67,10 @@ public class CabalArchon extends CardImpl { // {B}, Sacrifice a Cleric: Target player loses 2 life and you gain 2 life. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(2), new ManaCostsImpl("{B}")); - ability.addEffect(new GainLifeEffect(2)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false))); + Effect effect = new GainLifeEffect(2); + effect.setText("and you gain 2 life"); + ability.addEffect(effect); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, false))); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/onslaught/CabalSlaver.java b/Mage.Sets/src/mage/sets/onslaught/CabalSlaver.java index ac9da8f9eae..e05a2c5ec57 100644 --- a/Mage.Sets/src/mage/sets/onslaught/CabalSlaver.java +++ b/Mage.Sets/src/mage/sets/onslaught/CabalSlaver.java @@ -43,7 +43,8 @@ import mage.filter.predicate.mageobject.SubtypePredicate; * @author markedagain */ public class CabalSlaver extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("Goblin"); + + private static final FilterPermanent filter = new FilterPermanent("a Goblin"); static { filter.add(new SubtypePredicate("Goblin")); @@ -58,7 +59,7 @@ public class CabalSlaver extends CardImpl { this.toughness = new MageInt(1); // Whenever a Goblin deals combat damage to a player, that player discards a card. - this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(new DiscardTargetEffect(1),filter, false, SetTargetPointer.NONE, true)); + this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(new DiscardTargetEffect(1), filter, false, SetTargetPointer.PLAYER, true)); } public CabalSlaver(final CabalSlaver card) { diff --git a/Mage.Sets/src/mage/sets/onslaught/CatapultSquad.java b/Mage.Sets/src/mage/sets/onslaught/CatapultSquad.java new file mode 100644 index 00000000000..b2d86150117 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/CatapultSquad.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterAttackingOrBlockingCreature; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class CatapultSquad extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Soldiers you control"); + + static { + filter.add(Predicates.not(new TappedPredicate())); + filter.add(new SubtypePredicate("Soldier")); + } + + public CatapultSquad(UUID ownerId) { + super(ownerId, 11, "Catapult Squad", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Tap two untapped Soldiers you control: Catapult Squad deals 2 damage to target attacking or blocking creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapTargetCost(new TargetControlledPermanent(2, 2, filter, false))); + ability.addTarget(new TargetCreaturePermanent(new FilterAttackingOrBlockingCreature())); + this.addAbility(ability); + } + + public CatapultSquad(final CatapultSquad card) { + super(card); + } + + @Override + public CatapultSquad copy() { + return new CatapultSquad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/CentaurGlade.java b/Mage.Sets/src/mage/sets/onslaught/CentaurGlade.java index 75c0807d8d2..83937e00c64 100644 --- a/Mage.Sets/src/mage/sets/onslaught/CentaurGlade.java +++ b/Mage.Sets/src/mage/sets/onslaught/CentaurGlade.java @@ -28,7 +28,6 @@ package mage.sets.onslaught; import java.util.UUID; -import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; @@ -36,7 +35,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.CentaurToken; /** * @@ -61,14 +60,3 @@ public class CentaurGlade extends CardImpl { return new CentaurGlade(this); } } - -class CentaurToken extends Token { - CentaurToken() { - super("Centaur", "3/3 green Centaur creature token"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Centaur"); - power = new MageInt(3); - toughness = new MageInt(3); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/onslaught/ChainOfVapor.java b/Mage.Sets/src/mage/sets/onslaught/ChainOfVapor.java index dd376b43af1..a87a9bfec3f 100644 --- a/Mage.Sets/src/mage/sets/onslaught/ChainOfVapor.java +++ b/Mage.Sets/src/mage/sets/onslaught/ChainOfVapor.java @@ -28,6 +28,7 @@ package mage.sets.onslaught; import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; @@ -87,34 +88,31 @@ class ChainOfVaporEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { + MageObject sourceObject = source.getSourceObject(game); + if (controller == null || sourceObject == null) { return false; } Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent != null) { controller.moveCards(permanent, null, Zone.HAND, source, game); Player player = game.getPlayer(permanent.getControllerId()); - if (player.chooseUse(Outcome.ReturnToHand, "Sacrifice a land to copy this spell?", source, game)) { - TargetControlledPermanent target = new TargetControlledPermanent(new FilterControlledLandPermanent()); - if (player.chooseTarget(Outcome.Sacrifice, target, source, game)) { - Permanent land = game.getPermanent(target.getFirstTarget()); - if (land != null) { - if (land.sacrifice(source.getSourceId(), game)) { - Spell spell = game.getStack().getSpell(source.getSourceId()); - if (spell != null) { - Spell copy = spell.copySpell(); - copy.setControllerId(player.getId()); - copy.setCopiedSpell(true); - game.getStack().push(copy); - copy.chooseNewTargets(game, player.getId()); - String activateMessage = copy.getActivatedMessage(game); - if (activateMessage.startsWith(" casts ")) { - activateMessage = activateMessage.substring(6); - } - game.informPlayers(player.getLogName() + " copies " + activateMessage); - return true; + TargetControlledPermanent target = new TargetControlledPermanent(0, 1, new FilterControlledLandPermanent("a land to sacrifice (to be able to copy " + sourceObject.getName() + ")"), true); + if (player.chooseTarget(Outcome.Sacrifice, target, source, game)) { + Permanent land = game.getPermanent(target.getFirstTarget()); + if (land != null && land.sacrifice(source.getSourceId(), game)) { + if (player.chooseUse(outcome, "Copy the spell?", source, game)) { + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + Spell copy = spell.copySpell(); + copy.setControllerId(player.getId()); + copy.setCopiedSpell(true); + game.getStack().push(copy); + copy.chooseNewTargets(game, player.getId()); + String activateMessage = copy.getActivatedMessage(game); + if (activateMessage.startsWith(" casts ")) { + activateMessage = activateMessage.substring(6); } - return false; + game.informPlayers(player.getLogName() + " " + activateMessage); } } } diff --git a/Mage.Sets/src/mage/sets/onslaught/ChargingSlateback.java b/Mage.Sets/src/mage/sets/onslaught/ChargingSlateback.java new file mode 100644 index 00000000000..85e7d4663c3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/ChargingSlateback.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CantBlockAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ChargingSlateback extends CardImpl { + + public ChargingSlateback(UUID ownerId) { + super(ownerId, 194, "Charging Slateback", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Beast"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Charging Slateback can't block. + this.addAbility(new CantBlockAbility()); + // Morph {4}{R} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{4}{R}"))); + } + + public ChargingSlateback(final ChargingSlateback card) { + super(card); + } + + @Override + public ChargingSlateback copy() { + return new ChargingSlateback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/Complicate.java b/Mage.Sets/src/mage/sets/onslaught/Complicate.java index 29e679a624c..3d5023a5869 100644 --- a/Mage.Sets/src/mage/sets/onslaught/Complicate.java +++ b/Mage.Sets/src/mage/sets/onslaught/Complicate.java @@ -52,12 +52,12 @@ public class Complicate extends CardImpl { // Counter target spell unless its controller pays {3}. this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(3))); this.getSpellAbility().addTarget(new TargetSpell()); - + // Cycling {2}{U} this.addAbility(new CyclingAbility(new ManaCostsImpl<>("{2}{U}"))); - + // When you cycle Complicate, you may counter target spell unless its controller pays {1}. - Ability ability = new CycleTriggeredAbility(new CounterUnlessPaysEffect(new GenericManaCost(1))); + Ability ability = new CycleTriggeredAbility(new CounterUnlessPaysEffect(new GenericManaCost(1)), true); ability.addTarget(new TargetSpell()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/onslaught/ConvalescentCare.java b/Mage.Sets/src/mage/sets/onslaught/ConvalescentCare.java new file mode 100644 index 00000000000..691e8fe9b2a --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/ConvalescentCare.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.Game; + +/** + * + * @author fireshoes + */ +public class ConvalescentCare extends CardImpl { + + public ConvalescentCare(UUID ownerId) { + super(ownerId, 14, "Convalescent Care", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); + this.expansionSetCode = "ONS"; + + // At the beginning of your upkeep, if you have 5 or less life, you gain 3 life and draw a card. + Effect effect = new DrawCardSourceControllerEffect(1); + TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(3), TargetController.YOU, false); + ability.addEffect(effect); + this.addAbility(new ConditionalTriggeredAbility(ability, new FiveOrLessLifeCondition(), "At the beginning of your upkeep, if you have 5 or less life, you gain 3 life and draw a card.")); + } + + public ConvalescentCare(final ConvalescentCare card) { + super(card); + } + + @Override + public ConvalescentCare copy() { + return new ConvalescentCare(this); + } + + class FiveOrLessLifeCondition implements Condition { + + @Override + public boolean apply(Game game, Ability source) { + return game.getPlayer(source.getControllerId()).getLife() <= 5; + } + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/CrudeRampart.java b/Mage.Sets/src/mage/sets/onslaught/CrudeRampart.java new file mode 100644 index 00000000000..5bda4d9b290 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/CrudeRampart.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CrudeRampart extends CardImpl { + + public CrudeRampart(UUID ownerId) { + super(ownerId, 17, "Crude Rampart", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Wall"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Morph {4}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{4}{W}"))); + } + + public CrudeRampart(final CrudeRampart card) { + super(card); + } + + @Override + public CrudeRampart copy() { + return new CrudeRampart(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/DaruLancer.java b/Mage.Sets/src/mage/sets/onslaught/DaruLancer.java new file mode 100644 index 00000000000..a0ede3c08c0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/DaruLancer.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class DaruLancer extends CardImpl { + + public DaruLancer(UUID ownerId) { + super(ownerId, 20, "Daru Lancer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // Morph {2}{W}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{W}{W}"))); + } + + public DaruLancer(final DaruLancer card) { + super(card); + } + + @Override + public DaruLancer copy() { + return new DaruLancer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/DeathPulse.java b/Mage.Sets/src/mage/sets/onslaught/DeathPulse.java index be0c44a8f87..0cf9e25b03d 100644 --- a/Mage.Sets/src/mage/sets/onslaught/DeathPulse.java +++ b/Mage.Sets/src/mage/sets/onslaught/DeathPulse.java @@ -52,11 +52,11 @@ public class DeathPulse extends CardImpl { // Target creature gets -4/-4 until end of turn. this.getSpellAbility().addEffect(new BoostTargetEffect(-4, -4, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - + // Cycling {1}{B}{B} this.addAbility(new CyclingAbility(new ManaCostsImpl("{1}{B}{B}"))); // When you cycle Death Pulse, you may have target creature get -1/-1 until end of turn. - Ability ability = new CycleTriggeredAbility(new BoostTargetEffect(-1, -1, Duration.EndOfTurn)); + Ability ability = new CycleTriggeredAbility(new BoostTargetEffect(-1, -1, Duration.EndOfTurn), true); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/onslaught/DiveBomber.java b/Mage.Sets/src/mage/sets/onslaught/DiveBomber.java new file mode 100644 index 00000000000..48a017e5c78 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/DiveBomber.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterAttackingOrBlockingCreature; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DiveBomber extends CardImpl { + + public DiveBomber(UUID ownerId) { + super(ownerId, 26, "Dive Bomber", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {tap}, Sacrifice Dive Bomber: Dive Bomber deals 2 damage to target attacking or blocking creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent(new FilterAttackingOrBlockingCreature())); + this.addAbility(ability); + } + + public DiveBomber(final DiveBomber card) { + super(card); + } + + @Override + public DiveBomber copy() { + return new DiveBomber(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/EbonbladeReaper.java b/Mage.Sets/src/mage/sets/onslaught/EbonbladeReaper.java new file mode 100644 index 00000000000..12b22f0ff17 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/EbonbladeReaper.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.LoseHalfLifeEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author BijanT + */ +public class EbonbladeReaper extends CardImpl { + + public EbonbladeReaper(UUID ownerId) { + super(ownerId, 141, "Ebonblade Reaper", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + //Whenever Ebonblade Reaper attacks, you lose half your life, rounded up. + this.addAbility(new AttacksTriggeredAbility(new LoseHalfLifeEffect(), false)); + + //Whenever Ebonblade Reaper deals combat damage to a player, that player loses half his or her life, rounded up. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new EbonbladeReaperEffect(), false, true)); + + //Morph {3}{B}{B} + this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{3}{B}{B}"))); + } + + public EbonbladeReaper(final EbonbladeReaper card) { + super(card); + } + + @Override + public Card copy() { + return new EbonbladeReaper(this); + } +} + +class EbonbladeReaperEffect extends OneShotEffect { + + public EbonbladeReaperEffect() { + super(Outcome.Damage); + this.staticText = "that player loses half his or her life, rounded up"; + } + + public EbonbladeReaperEffect(final EbonbladeReaperEffect effect) { + super(effect); + } + + @Override + public Effect copy() { + return new EbonbladeReaperEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (player != null) { + Integer amount = (int) Math.ceil(player.getLife() / 2f); + if (amount > 0) { + player.loseLife(amount, game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/ElvishPathcutter.java b/Mage.Sets/src/mage/sets/onslaught/ElvishPathcutter.java new file mode 100644 index 00000000000..b78333c95a3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/ElvishPathcutter.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class ElvishPathcutter extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creature"); + + static { + filter.add(new SubtypePredicate("Elf")); + } + + public ElvishPathcutter(UUID ownerId) { + super(ownerId, 256, "Elvish Pathcutter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Elf"); + this.subtype.add("Scout"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {2}{G}: Target Elf creature gains forestwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new ForestwalkAbility(), Duration.EndOfTurn), new ManaCostsImpl("{2}{G}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public ElvishPathcutter(final ElvishPathcutter card) { + super(card); + } + + @Override + public ElvishPathcutter copy() { + return new ElvishPathcutter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/ElvishVanguard.java b/Mage.Sets/src/mage/sets/onslaught/ElvishVanguard.java new file mode 100644 index 00000000000..1f876e83614 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/ElvishVanguard.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LoneFox + */ +public class ElvishVanguard extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("another Elf"); + + static { + filter.add(new SubtypePredicate("Elf")); + filter.add(new AnotherPredicate()); + } + + public ElvishVanguard(UUID ownerId) { + super(ownerId, 259, "Elvish Vanguard", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Elf"); + this.subtype.add("Warrior"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever another Elf enters the battlefield, put a +1/+1 counter on Elvish Vanguard. + this.addAbility(new EntersBattlefieldAllTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter)); + } + + public ElvishVanguard(final ElvishVanguard card) { + super(card); + } + + @Override + public ElvishVanguard copy() { + return new ElvishVanguard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/ErraticExplosion.java b/Mage.Sets/src/mage/sets/onslaught/ErraticExplosion.java new file mode 100644 index 00000000000..d41a0f9f88d --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/ErraticExplosion.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class ErraticExplosion extends mage.sets.planechase2012.ErraticExplosion { + + public ErraticExplosion(UUID ownerId) { + super(ownerId); + this.cardNumber = 201; + this.expansionSetCode = "ONS"; + } + + public ErraticExplosion(final ErraticExplosion card) { + super(card); + } + + @Override + public ErraticExplosion copy() { + return new ErraticExplosion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/EvergloveCourier.java b/Mage.Sets/src/mage/sets/onslaught/EvergloveCourier.java new file mode 100644 index 00000000000..3ecfc22b812 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/EvergloveCourier.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class EvergloveCourier extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creature"); + + static { + filter.add(new SubtypePredicate("Elf")); + } + + public EvergloveCourier(UUID ownerId) { + super(ownerId, 262, "Everglove Courier", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Elf"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // You may choose not to untap Everglove Courier during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {2}{G}, {tap}: Target Elf creature gets +2/+2 and has trample for as long as Everglove Courier remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.getInstance(), + "target Elf creature gets +2/+2"), new ManaCostsImpl("{2}{G}")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), + Duration.Custom), SourceTappedCondition.getInstance(),"and has trample for as long as {this} remains tapped")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public EvergloveCourier(final EvergloveCourier card) { + super(card); + } + + @Override + public EvergloveCourier copy() { + return new EvergloveCourier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/FallenCleric.java b/Mage.Sets/src/mage/sets/onslaught/FallenCleric.java new file mode 100644 index 00000000000..a4e9bbfa379 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/FallenCleric.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class FallenCleric extends CardImpl { + + private static final FilterCard filter = new FilterCard("Clerics"); + + static { + filter.add(new SubtypePredicate("Cleric")); + } + + public FallenCleric(UUID ownerId) { + super(ownerId, 145, "Fallen Cleric", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Zombie"); + this.subtype.add("Cleric"); + this.power = new MageInt(4); + this.toughness = new MageInt(2); + + // Protection from Clerics + this.addAbility(new ProtectionAbility(filter)); + // Morph {4}{B} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{4}{B}"))); + } + + public FallenCleric(final FallenCleric card) { + super(card); + } + + @Override + public FallenCleric copy() { + return new FallenCleric(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/FeedingFrenzy.java b/Mage.Sets/src/mage/sets/onslaught/FeedingFrenzy.java index ff57cf267b9..55d168c3091 100644 --- a/Mage.Sets/src/mage/sets/onslaught/FeedingFrenzy.java +++ b/Mage.Sets/src/mage/sets/onslaught/FeedingFrenzy.java @@ -28,20 +28,20 @@ package mage.sets.onslaught; import java.util.UUID; - import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CountersCount; import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.counters.CounterType; +import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; @@ -51,13 +51,21 @@ import mage.target.common.TargetCreaturePermanent; */ public class FeedingFrenzy extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent(); + + static { + filter.add(new SubtypePredicate("Zombie")); + } + public FeedingFrenzy(UUID ownerId) { super(ownerId, 147, "Feeding Frenzy", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{B}"); this.expansionSetCode = "ONS"; // Target creature gets -X/-X until end of turn, where X is the number of Zombies on the battlefield. - DynamicValue x = new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("Zombie", "Zombie on the battlefield"), -1); - this.getSpellAbility().addEffect(new BoostTargetEffect(x, x, Duration.EndOfTurn)); + DynamicValue x = new PermanentsOnBattlefieldCount(filter, -1); + Effect effect = new BoostTargetEffect(x, x, Duration.EndOfTurn); + effect.setText("Target creature gets -X/-X until end of turn, where X is the number of Zombies on the battlefield"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/sets/onslaught/FeverCharm.java b/Mage.Sets/src/mage/sets/onslaught/FeverCharm.java new file mode 100644 index 00000000000..69737911466 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/FeverCharm.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FeverCharm extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Wizard creature"); + + static { + filter.add(new SubtypePredicate("Wizard")); + } + + public FeverCharm(UUID ownerId) { + super(ownerId, 202, "Fever Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "ONS"; + + // Choose one - Target creature gains haste until end of turn + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // or target creature gets +2/+0 until end of turn + Mode mode = new Mode(); + mode.getEffects().add(new BoostTargetEffect(2, 0, Duration.EndOfTurn)); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode); + // or Fever Charm deals 3 damage to target Wizard creature. + mode = new Mode(); + mode.getEffects().add(new DamageTargetEffect(3)); + mode.getTargets().add(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addMode(mode); + } + + public FeverCharm(final FeverCharm card) { + super(card); + } + + @Override + public FeverCharm copy() { + return new FeverCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/FlamestickCourier.java b/Mage.Sets/src/mage/sets/onslaught/FlamestickCourier.java new file mode 100644 index 00000000000..33ca61ca662 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/FlamestickCourier.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FlamestickCourier extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creature"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public FlamestickCourier(UUID ownerId) { + super(ownerId, 203, "Flamestick Courier", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Goblin"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // You may choose not to untap Flamestick Courier during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {2}{R}, {tap}: Target Goblin creature gets +2/+2 and has haste for as long as Flamestick Courier remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.getInstance(), + "target Goblin creature gets +2/+2"), new ManaCostsImpl("{2}{R}")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), + Duration.Custom), SourceTappedCondition.getInstance(),"and has haste for as long as {this} remains tapped")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public FlamestickCourier(final FlamestickCourier card) { + super(card); + } + + @Override + public FlamestickCourier copy() { + return new FlamestickCourier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/FoothillGuide.java b/Mage.Sets/src/mage/sets/onslaught/FoothillGuide.java new file mode 100644 index 00000000000..18265611be5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/FoothillGuide.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class FoothillGuide extends CardImpl { + + private static final FilterCard filter = new FilterCard("Goblins"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public FoothillGuide(UUID ownerId) { + super(ownerId, 29, "Foothill Guide", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Protection from Goblins + this.addAbility(new ProtectionAbility(filter)); + // Morph {W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{W}"))); + } + + public FoothillGuide(final FoothillGuide card) { + super(card); + } + + @Override + public FoothillGuide copy() { + return new FoothillGuide(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/FrightshroudCourier.java b/Mage.Sets/src/mage/sets/onslaught/FrightshroudCourier.java new file mode 100644 index 00000000000..71a3e443cba --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/FrightshroudCourier.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FearAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FrightshroudCourier extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Zombie creature"); + + static { + filter.add(new SubtypePredicate("Zombie")); + } + + public FrightshroudCourier(UUID ownerId) { + super(ownerId, 149, "Frightshroud Courier", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // You may choose not to untap Frightshroud Courier during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {2}{B}, {tap}: Target Zombie creature gets +2/+2 and has fear for as long as Frightshroud Courier remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.getInstance(), + "target Zombie creature gets +2/+2"), new ManaCostsImpl("{2}{B}")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(FearAbility.getInstance(), + Duration.Custom), SourceTappedCondition.getInstance(),"and has fear for as long as {this} remains tapped")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public FrightshroudCourier(final FrightshroudCourier card) { + super(card); + } + + @Override + public FrightshroudCourier copy() { + return new FrightshroudCourier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/FutureSight.java b/Mage.Sets/src/mage/sets/onslaught/FutureSight.java index 0c8dff1f1c6..929246b111d 100644 --- a/Mage.Sets/src/mage/sets/onslaught/FutureSight.java +++ b/Mage.Sets/src/mage/sets/onslaught/FutureSight.java @@ -35,7 +35,6 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.FilterCard; /** * @@ -47,11 +46,10 @@ public class FutureSight extends CardImpl { super(ownerId, 84, "Future Sight", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}{U}"); this.expansionSetCode = "ONS"; - // Play with the top card of your library revealed. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect())); // You may play the top card of your library. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayTheTopCardEffect(new FilterCard()))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayTheTopCardEffect())); } public FutureSight(final FutureSight card) { diff --git a/Mage.Sets/src/mage/sets/onslaught/GhosthelmCourier.java b/Mage.Sets/src/mage/sets/onslaught/GhosthelmCourier.java new file mode 100644 index 00000000000..415aab1d5cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/GhosthelmCourier.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class GhosthelmCourier extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Wizard creature"); + + static { + filter.add(new SubtypePredicate("Wizard")); + } + + public GhosthelmCourier(UUID ownerId) { + super(ownerId, 85, "Ghosthelm Courier", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // You may choose not to untap Ghosthelm Courier during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {2}{U}, {tap}: Target Wizard creature gets +2/+2 and has shroud for as long as Ghosthelm Courier remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.getInstance(), + "target Wizard creature gets +2/+2"), new ManaCostsImpl("{2}{U}")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(ShroudAbility.getInstance(), + Duration.Custom), SourceTappedCondition.getInstance(),"and has shroud for as long as {this} remains tapped")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public GhosthelmCourier(final GhosthelmCourier card) { + super(card); + } + + @Override + public GhosthelmCourier copy() { + return new GhosthelmCourier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/GoblinBurrows.java b/Mage.Sets/src/mage/sets/onslaught/GoblinBurrows.java index c54781b82e8..66bcc8033fe 100644 --- a/Mage.Sets/src/mage/sets/onslaught/GoblinBurrows.java +++ b/Mage.Sets/src/mage/sets/onslaught/GoblinBurrows.java @@ -49,7 +49,7 @@ import mage.target.common.TargetCreaturePermanent; */ public class GoblinBurrows extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creature"); static { filter.add(new SubtypePredicate(("Goblin"))); diff --git a/Mage.Sets/src/mage/sets/onslaught/GoblinTaskmaster.java b/Mage.Sets/src/mage/sets/onslaught/GoblinTaskmaster.java new file mode 100644 index 00000000000..e6fe04dc554 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/GoblinTaskmaster.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class GoblinTaskmaster extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creature"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public GoblinTaskmaster(UUID ownerId) { + super(ownerId, 210, "Goblin Taskmaster", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Goblin"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{R}: Target Goblin creature gets +1/+0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{1}{R}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + + // Morph {R} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{R}"))); + } + + public GoblinTaskmaster(final GoblinTaskmaster card) { + super(card); + } + + @Override + public GoblinTaskmaster copy() { + return new GoblinTaskmaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/GrasslandCrusader.java b/Mage.Sets/src/mage/sets/onslaught/GrasslandCrusader.java new file mode 100644 index 00000000000..e7d0cebe0a0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/GrasslandCrusader.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class GrasslandCrusader extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf or Soldier creature"); + + static { + filter.add(Predicates.or(new SubtypePredicate("Elf"), new SubtypePredicate("Soldier"))); + } + + public GrasslandCrusader(UUID ownerId) { + super(ownerId, 32, "Grassland Crusader", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{W}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // {tap}: Target Elf or Soldier creature gets +2/+2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public GrasslandCrusader(final GrasslandCrusader card) { + super(card); + } + + @Override + public GrasslandCrusader copy() { + return new GrasslandCrusader(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/GravelSlinger.java b/Mage.Sets/src/mage/sets/onslaught/GravelSlinger.java new file mode 100644 index 00000000000..23b3b50eeb0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/GravelSlinger.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterAttackingOrBlockingCreature; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class GravelSlinger extends CardImpl { + + public GravelSlinger(UUID ownerId) { + super(ownerId, 33, "Gravel Slinger", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // {tap}: Gravel Slinger deals 1 damage to target attacking or blocking creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(new FilterAttackingOrBlockingCreature())); + this.addAbility(ability); + // Morph {1}{W} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{1}{W}"))); + } + + public GravelSlinger(final GravelSlinger card) { + super(card); + } + + @Override + public GravelSlinger copy() { + return new GravelSlinger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/GrinningDemon.java b/Mage.Sets/src/mage/sets/onslaught/GrinningDemon.java new file mode 100644 index 00000000000..e11f608d748 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/GrinningDemon.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class GrinningDemon extends CardImpl { + + public GrinningDemon(UUID ownerId) { + super(ownerId, 153, "Grinning Demon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Demon"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // At the beginning of your upkeep, you lose 2 life. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LoseLifeSourceControllerEffect(2), TargetController.YOU, false)); + // Morph {2}{B}{B} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{B}{B}"))); + } + + public GrinningDemon(final GrinningDemon card) { + super(card); + } + + @Override + public GrinningDemon copy() { + return new GrinningDemon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java b/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java new file mode 100644 index 00000000000..d0dce29fb32 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java @@ -0,0 +1,125 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.cards.repository.CardRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author pcasaretto + */ +public class HarshMercy extends CardImpl { + + public HarshMercy(UUID ownerId) { + super(ownerId, 39, "Harsh Mercy", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "ONS"; + + // Each player chooses a creature type. Destroy all creatures that aren't of a type chosen this way. They can't be regenerated. + this.getSpellAbility().addEffect(new HarshMercyEffect()); + } + + public HarshMercy(final HarshMercy card) { + super(card); + } + + @Override + public HarshMercy copy() { + return new HarshMercy(this); + } +} + +class HarshMercyEffect extends OneShotEffect { + + public HarshMercyEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Each player chooses a creature type. Destroy all creatures that aren't of a type chosen this way. They can't be regenerated."; + } + + public HarshMercyEffect(final HarshMercyEffect effect) { + super(effect); + } + + @Override + public HarshMercyEffect copy() { + return new HarshMercyEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + Set chosenTypes = new HashSet<>(); + PlayerIteration: + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + Player player = game.getPlayer(playerId); + Choice typeChoice = new ChoiceImpl(true); + typeChoice.setMessage("Choose a creature type"); + typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); + while (!player.choose(Outcome.DestroyPermanent, typeChoice, game)) { + if (!player.canRespond()) { + continue PlayerIteration; + } + } + String chosenType = typeChoice.getChoice(); + if (chosenType != null) { + game.informPlayers(sourceObject.getIdName() + ": " + player.getLogName() + " has chosen " + chosenType); + chosenTypes.add(chosenType); + } + } + + FilterPermanent filter = new FilterCreaturePermanent("creatures"); + for (String type : chosenTypes) { + filter.add(Predicates.not(new SubtypePredicate(type))); + } + + return new DestroyAllEffect(filter, true).apply(game, source); + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/onslaught/HeedlessOne.java b/Mage.Sets/src/mage/sets/onslaught/HeedlessOne.java index 6fd87e1ddd7..d275b1ca5f3 100644 --- a/Mage.Sets/src/mage/sets/onslaught/HeedlessOne.java +++ b/Mage.Sets/src/mage/sets/onslaught/HeedlessOne.java @@ -38,7 +38,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; /** @@ -47,7 +47,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class HeedlessOne extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elves on the battlefield"); + private static final FilterPermanent filter = new FilterPermanent("Elves on the battlefield"); static { filter.add(new SubtypePredicate("Elf")); diff --git a/Mage.Sets/src/mage/sets/onslaught/Imagecrafter.java b/Mage.Sets/src/mage/sets/onslaught/Imagecrafter.java index cb3db6bc1dd..543086215f0 100644 --- a/Mage.Sets/src/mage/sets/onslaught/Imagecrafter.java +++ b/Mage.Sets/src/mage/sets/onslaught/Imagecrafter.java @@ -34,25 +34,13 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.ContinuousEffect; -import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.BecomesChosenNonWallCreatureTypeTargetEffect; -import mage.abilities.effects.common.continuous.BecomesSubtypeTargetEffect; +import mage.abilities.effects.common.continuous.BecomesChosenCreatureTypeTargetEffect; import mage.cards.CardImpl; -import mage.cards.repository.CardRepository; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetCreaturePermanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -69,7 +57,7 @@ public class Imagecrafter extends CardImpl { this.toughness = new MageInt(1); // {tap}: Choose a creature type other than Wall. Target creature becomes that type until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesChosenNonWallCreatureTypeTargetEffect(), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesChosenCreatureTypeTargetEffect(true), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } @@ -82,5 +70,5 @@ public class Imagecrafter extends CardImpl { public Imagecrafter copy() { return new Imagecrafter(this); } - -} \ No newline at end of file + +} diff --git a/Mage.Sets/src/mage/sets/onslaught/ImprovisedArmor.java b/Mage.Sets/src/mage/sets/onslaught/ImprovisedArmor.java new file mode 100644 index 00000000000..f186ac5f089 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/ImprovisedArmor.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ImprovisedArmor extends CardImpl { + + public ImprovisedArmor(UUID ownerId) { + super(ownerId, 40, "Improvised Armor", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +2/+5. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 5, Duration.WhileOnBattlefield))); + // Cycling {3} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{3}"))); + } + + public ImprovisedArmor(final ImprovisedArmor card) { + super(card); + } + + @Override + public ImprovisedArmor copy() { + return new ImprovisedArmor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/InformationDealer.java b/Mage.Sets/src/mage/sets/onslaught/InformationDealer.java new file mode 100644 index 00000000000..e9cb8b80e36 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/InformationDealer.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.LookLibraryControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class InformationDealer extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Wizards on the battlefield"); + + static { + filter.add(new SubtypePredicate("Wizard")); + } + + public InformationDealer(UUID ownerId) { + super(ownerId, 88, "Information Dealer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Look at the top X cards of your library, where X is the number of Wizards on the battlefield, then put them back in any order. + Effect effect = new LookLibraryControllerEffect(new PermanentsOnBattlefieldCount(filter)); + effect.setText("Look at the top X cards of your library, where X is the number of Wizards on the battlefield, then put them back in any order."); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost())); + } + + public InformationDealer(final InformationDealer card) { + super(card); + } + + @Override + public InformationDealer copy() { + return new InformationDealer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/Inspirit.java b/Mage.Sets/src/mage/sets/onslaught/Inspirit.java new file mode 100644 index 00000000000..fd26c17183a --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/Inspirit.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Inspirit extends CardImpl { + + public Inspirit(UUID ownerId) { + super(ownerId, 41, "Inspirit", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); + this.expansionSetCode = "ONS"; + + // Untap target creature. It gets +2/+4 until end of turn. + this.getSpellAbility().addEffect(new UntapTargetEffect()); + Effect effect = new BoostTargetEffect(2, 4, Duration.EndOfTurn); + effect.setText("It gets +2/+4 until end of turn"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public Inspirit(final Inspirit card) { + super(card); + } + + @Override + public Inspirit copy() { + return new Inspirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/KrosanColossus.java b/Mage.Sets/src/mage/sets/onslaught/KrosanColossus.java new file mode 100644 index 00000000000..bc7d6f1918e --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/KrosanColossus.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class KrosanColossus extends CardImpl { + + public KrosanColossus(UUID ownerId) { + super(ownerId, 270, "Krosan Colossus", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{G}{G}{G}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Beast"); + this.power = new MageInt(9); + this.toughness = new MageInt(9); + + // Morph {6}{G}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{6}{G}{G}"))); + } + + public KrosanColossus(final KrosanColossus card) { + super(card); + } + + @Override + public KrosanColossus copy() { + return new KrosanColossus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/KrosanGroundshaker.java b/Mage.Sets/src/mage/sets/onslaught/KrosanGroundshaker.java new file mode 100644 index 00000000000..e33d105a911 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/KrosanGroundshaker.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class KrosanGroundshaker extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Beast creature"); + + static { + filter.add(new SubtypePredicate("Beast")); + } + + public KrosanGroundshaker(UUID ownerId) { + super(ownerId, 271, "Krosan Groundshaker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{G}{G}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Beast"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // {G}: Target Beast creature gains trample until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{G}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public KrosanGroundshaker(final KrosanGroundshaker card) { + super(card); + } + + @Override + public KrosanGroundshaker copy() { + return new KrosanGroundshaker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/MagesGuile.java b/Mage.Sets/src/mage/sets/onslaught/MagesGuile.java new file mode 100644 index 00000000000..d8609439697 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/MagesGuile.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class MagesGuile extends CardImpl { + + public MagesGuile(UUID ownerId) { + super(ownerId, 91, "Mage's Guile", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "ONS"; + + // Target creature gains shroud until end of turn. + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(ShroudAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // Cycling {U} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{U}"))); + } + + public MagesGuile(final MagesGuile card) { + super(card); + } + + @Override + public MagesGuile copy() { + return new MagesGuile(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/MiseryCharm.java b/Mage.Sets/src/mage/sets/onslaught/MiseryCharm.java new file mode 100644 index 00000000000..d3cbf5e1a78 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/MiseryCharm.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; +import mage.target.TargetPlayer; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LoneFox + */ +public class MiseryCharm extends CardImpl { + + private static final FilterPermanent filter1 = new FilterPermanent("Cleric"); + private static final FilterCard filter2 = new FilterCard("Cleric card from your graveyard"); + + static { + filter1.add(new SubtypePredicate("Cleric")); + filter2.add(new SubtypePredicate("Cleric")); + } + + public MiseryCharm(UUID ownerId) { + super(ownerId, 158, "Misery Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "ONS"; + + // Choose one - Destroy target Cleric + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter1)); + // or return target Cleric card from your graveyard to your hand + Mode mode = new Mode(); + mode.getEffects().add(new ReturnToHandTargetEffect()); + mode.getTargets().add(new TargetCardInYourGraveyard(filter2)); + this.getSpellAbility().addMode(mode); + // or target player loses 2 life. + mode = new Mode(); + mode.getEffects().add(new LoseLifeTargetEffect(2)); + mode.getTargets().add(new TargetPlayer()); + this.getSpellAbility().addMode(mode); + } + + public MiseryCharm(final MiseryCharm card) { + super(card); + } + + @Override + public MiseryCharm copy() { + return new MiseryCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/MistformMutant.java b/Mage.Sets/src/mage/sets/onslaught/MistformMutant.java index 1573178e3aa..c9ce8287761 100644 --- a/Mage.Sets/src/mage/sets/onslaught/MistformMutant.java +++ b/Mage.Sets/src/mage/sets/onslaught/MistformMutant.java @@ -34,25 +34,13 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.ContinuousEffect; -import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.BecomesChosenNonWallCreatureTypeTargetEffect; -import mage.abilities.effects.common.continuous.BecomesSubtypeTargetEffect; +import mage.abilities.effects.common.continuous.BecomesChosenCreatureTypeTargetEffect; import mage.cards.CardImpl; -import mage.cards.repository.CardRepository; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetCreaturePermanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -69,7 +57,7 @@ public class MistformMutant extends CardImpl { this.toughness = new MageInt(4); // {1}{U}: Choose a creature type other than Wall. Target creature becomes that type until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesChosenNonWallCreatureTypeTargetEffect(), new ManaCostsImpl<>("{1}{U}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesChosenCreatureTypeTargetEffect(true), new ManaCostsImpl<>("{1}{U}")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } @@ -82,4 +70,4 @@ public class MistformMutant extends CardImpl { public MistformMutant copy() { return new MistformMutant(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/onslaught/NamelessOne.java b/Mage.Sets/src/mage/sets/onslaught/NamelessOne.java new file mode 100644 index 00000000000..76e6b6cc06e --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/NamelessOne.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class NamelessOne extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Wizards on the battlefield"); + + static { + filter.add(new SubtypePredicate("Wizard")); + } + + public NamelessOne(UUID ownerId) { + super(ownerId, 100, "Nameless One", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Wizard"); + this.subtype.add("Avatar"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Nameless One's power and toughness are each equal to the number of Wizards on the battlefield. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); + // Morph {2}{U} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{U}"))); + } + + public NamelessOne(final NamelessOne card) { + super(card); + } + + @Override + public NamelessOne copy() { + return new NamelessOne(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/Oblation.java b/Mage.Sets/src/mage/sets/onslaught/Oblation.java index af44e16f604..5bf88ee64a5 100644 --- a/Mage.Sets/src/mage/sets/onslaught/Oblation.java +++ b/Mage.Sets/src/mage/sets/onslaught/Oblation.java @@ -50,7 +50,6 @@ public class Oblation extends CardImpl { super(ownerId, 46, "Oblation", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{W}"); this.expansionSetCode = "ONS"; - // The owner of target nonland permanent shuffles it into his or her library, then draws two cards. this.getSpellAbility().addEffect(new OblationEffect()); this.getSpellAbility().addTarget(new TargetNonlandPermanent()); @@ -67,21 +66,21 @@ public class Oblation extends CardImpl { } class OblationEffect extends OneShotEffect { - + OblationEffect() { super(Outcome.Removal); this.staticText = "The owner of target nonland permanent shuffles it into his or her library, then draws two cards"; } - + OblationEffect(final OblationEffect effect) { super(effect); } - + @Override public OblationEffect copy() { return new OblationEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); @@ -90,6 +89,9 @@ class OblationEffect extends OneShotEffect { if (player != null) { player.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true); player.shuffleLibrary(game); + + game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw + player.drawCards(2, game); return true; } diff --git a/Mage.Sets/src/mage/sets/onslaught/OversoldCemetery.java b/Mage.Sets/src/mage/sets/onslaught/OversoldCemetery.java new file mode 100644 index 00000000000..1f5ff6efbeb --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/OversoldCemetery.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInGraveyard; + +/** + * + * @author fireshoes + */ +public class OversoldCemetery extends CardImpl { + + public OversoldCemetery(UUID ownerId) { + super(ownerId, 160, "Oversold Cemetery", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "ONS"; + + // At the beginning of your upkeep, if you have four or more creature cards in your graveyard, you may return target creature card from your graveyard to your hand. + TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToHandTargetEffect(), TargetController.YOU, true); + ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard())); + CardsInControllerGraveCondition condition = new CardsInControllerGraveCondition(4, new FilterCreatureCard("creature card from your graveyard")); + this.addAbility(new ConditionalTriggeredAbility(ability, condition, "At the beginning of your upkeep, if you have four or more creature cards in your graveyard, you may return target creature card from your graveyard to your hand.")); + } + + public OversoldCemetery(final OversoldCemetery card) { + super(card); + } + + @Override + public OversoldCemetery copy() { + return new OversoldCemetery(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/PatriarchsBidding.java b/Mage.Sets/src/mage/sets/onslaught/PatriarchsBidding.java index 42b4dfd2de0..61d54f0c357 100644 --- a/Mage.Sets/src/mage/sets/onslaught/PatriarchsBidding.java +++ b/Mage.Sets/src/mage/sets/onslaught/PatriarchsBidding.java @@ -35,7 +35,6 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.repository.CardRepository; import mage.choices.Choice; @@ -78,7 +77,7 @@ class PatriarchsBiddingEffect extends OneShotEffect { public PatriarchsBiddingEffect() { super(Outcome.PutCreatureInPlay); - this.staticText = "Each player chooses a creature type. Each player returns all creature cards of a type chosen this way from his or her graveyard to the battlefield."; + this.staticText = "each player chooses a creature type. Each player returns all creature cards of a type chosen this way from his or her graveyard to the battlefield"; } public PatriarchsBiddingEffect(final PatriarchsBiddingEffect effect) { @@ -91,12 +90,12 @@ class PatriarchsBiddingEffect extends OneShotEffect { } @Override - public boolean apply(Game game, Ability ability) { - Player controller = game.getPlayer(ability.getControllerId()); - MageObject sourceObject = game.getObject(ability.getSourceId()); + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null) { Set chosenTypes = new HashSet<>(); - for (UUID playerId : controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); Choice typeChoice = new ChoiceImpl(true); typeChoice.setMessage("Choose a creature type"); @@ -108,24 +107,21 @@ class PatriarchsBiddingEffect extends OneShotEffect { } String chosenType = typeChoice.getChoice(); if (chosenType != null) { - game.informPlayers(sourceObject.getName() + ": " + player.getLogName() + " has chosen " + chosenType); + game.informPlayers(sourceObject.getLogName() + ": " + player.getLogName() + " has chosen " + chosenType); chosenTypes.add(chosenType); } } - + List predicates = new ArrayList<>(); for (String type : chosenTypes) { predicates.add(new SubtypePredicate(type)); } FilterCard filter = new FilterCreatureCard(); filter.add(Predicates.or(predicates)); - - for (UUID playerId : controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card : player.getGraveyard().getCards(filter, game)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, ability.getSourceId()); - } + player.moveCards(player.getGraveyard().getCards(filter, game), Zone.BATTLEFIELD, source, game); } } return true; diff --git a/Mage.Sets/src/mage/sets/onslaught/PearlspearCourier.java b/Mage.Sets/src/mage/sets/onslaught/PearlspearCourier.java new file mode 100644 index 00000000000..337976c425f --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/PearlspearCourier.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class PearlspearCourier extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Soldier creature"); + + static { + filter.add(new SubtypePredicate("Soldier")); + } + + public PearlspearCourier(UUID ownerId) { + super(ownerId, 48, "Pearlspear Courier", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // You may choose not to untap Pearlspear Courier during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {2}{W}, {tap}: Target Soldier creature gets +2/+2 and has vigilance for as long as Pearlspear Courier remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostTargetEffect(2, 2, Duration.Custom), SourceTappedCondition.getInstance(), + "target Soldier creature gets +2/+2"), new ManaCostsImpl("{2}{W}")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilityTargetEffect(VigilanceAbility.getInstance(), + Duration.Custom), SourceTappedCondition.getInstance(),"and has vigilance for as long as {this} remains tapped")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public PearlspearCourier(final PearlspearCourier card) { + super(card); + } + + @Override + public PearlspearCourier copy() { + return new PearlspearCourier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/PietyCharm.java b/Mage.Sets/src/mage/sets/onslaught/PietyCharm.java new file mode 100644 index 00000000000..6a0ab78137b --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/PietyCharm.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AttachedToPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class PietyCharm extends CardImpl { + + private static final FilterPermanent filter1 = new FilterPermanent("Aura attached to a creature"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("Soldier creature"); + + static { + filter1.add(new SubtypePredicate("Aura")); + filter1.add(new AttachedToPredicate(new FilterCreaturePermanent())); + filter2.add(new SubtypePredicate("Soldier")); + } + + public PietyCharm(UUID ownerId) { + super(ownerId, 49, "Piety Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "ONS"; + + // Choose one - Destroy target Aura attached to a creature + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter1)); + // or target Soldier creature gets +2/+2 until end of turn + Mode mode = new Mode(); + mode.getEffects().add(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); + mode.getTargets().add(new TargetCreaturePermanent(filter2)); + this.getSpellAbility().addMode(mode); + // or creatures you control gain vigilance until end of turn. + mode = new Mode(); + mode.getEffects().add(new GainAbilityAllEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("creatures you control"))); + this.getSpellAbility().addMode(mode); + } + + public PietyCharm(final PietyCharm card) { + super(card); + } + + @Override + public PietyCharm copy() { + return new PietyCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/PinpointAvalanche.java b/Mage.Sets/src/mage/sets/onslaught/PinpointAvalanche.java new file mode 100644 index 00000000000..e92467ae501 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/PinpointAvalanche.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class PinpointAvalanche extends CardImpl { + + public PinpointAvalanche(UUID ownerId) { + super(ownerId, 221, "Pinpoint Avalanche", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{R}{R}"); + this.expansionSetCode = "ONS"; + + // Pinpoint Avalanche deals 4 damage to target creature. The damage can't be prevented. + this.getSpellAbility().addEffect(new DamageTargetEffect(4, false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public PinpointAvalanche(final PinpointAvalanche card) { + super(card); + } + + @Override + public PinpointAvalanche copy() { + return new PinpointAvalanche(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/PrimalBoost.java b/Mage.Sets/src/mage/sets/onslaught/PrimalBoost.java new file mode 100644 index 00000000000..9d050f1fc28 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/PrimalBoost.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.CycleTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class PrimalBoost extends CardImpl { + + public PrimalBoost(UUID ownerId) { + super(ownerId, 277, "Primal Boost", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); + this.expansionSetCode = "ONS"; + + // Target creature gets +4/+4 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(4, 4, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // Cycling {2}{G} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}{G}"))); + // When you cycle Primal Boost, you may have target creature get +1/+1 until end of turn. + Ability ability = new CycleTriggeredAbility(new BoostTargetEffect(1, 1, Duration.EndOfTurn), true); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public PrimalBoost(final PrimalBoost card) { + super(card); + } + + @Override + public PrimalBoost copy() { + return new PrimalBoost(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/RecklessOne.java b/Mage.Sets/src/mage/sets/onslaught/RecklessOne.java index c79f35586ee..a6808042b8f 100644 --- a/Mage.Sets/src/mage/sets/onslaught/RecklessOne.java +++ b/Mage.Sets/src/mage/sets/onslaught/RecklessOne.java @@ -38,7 +38,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; /** @@ -47,7 +47,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class RecklessOne extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblins on the battlefield"); + private static final FilterPermanent filter = new FilterPermanent("Goblins on the battlefield"); static { filter.add(new SubtypePredicate("Goblin")); diff --git a/Mage.Sets/src/mage/sets/onslaught/RiptideBiologist.java b/Mage.Sets/src/mage/sets/onslaught/RiptideBiologist.java new file mode 100644 index 00000000000..dc469edda8a --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/RiptideBiologist.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class RiptideBiologist extends CardImpl { + + private static final FilterCard filter = new FilterCard("Beasts"); + + static { + filter.add(new SubtypePredicate("Beast")); + } + + public RiptideBiologist(UUID ownerId) { + super(ownerId, 106, "Riptide Biologist", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Protection from Beasts + this.addAbility(new ProtectionAbility(filter)); + // Morph {2}{U} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{U}"))); + } + + public RiptideBiologist(final RiptideBiologist card) { + super(card); + } + + @Override + public RiptideBiologist copy() { + return new RiptideBiologist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/RiptideLaboratory.java b/Mage.Sets/src/mage/sets/onslaught/RiptideLaboratory.java index 06b74c0ec8d..808150e100c 100644 --- a/Mage.Sets/src/mage/sets/onslaught/RiptideLaboratory.java +++ b/Mage.Sets/src/mage/sets/onslaught/RiptideLaboratory.java @@ -38,17 +38,18 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetControlledPermanent; /** * * @author emerald000 */ public class RiptideLaboratory extends CardImpl { - - private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Wizard"); + + private final static FilterControlledPermanent filter = new FilterControlledPermanent("Wizard you control"); + static { filter.add(new SubtypePredicate("Wizard")); } @@ -59,11 +60,11 @@ public class RiptideLaboratory extends CardImpl { // {tap}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); - + // {1}{U}, {tap}: Return target Wizard you control to its owner's hand. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{1}{U}")); ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetControlledCreaturePermanent(filter)); + ability.addTarget(new TargetControlledPermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/onslaught/RiptideShapeshifter.java b/Mage.Sets/src/mage/sets/onslaught/RiptideShapeshifter.java index 0f4b766a2cd..615d8f2ee16 100644 --- a/Mage.Sets/src/mage/sets/onslaught/RiptideShapeshifter.java +++ b/Mage.Sets/src/mage/sets/onslaught/RiptideShapeshifter.java @@ -29,6 +29,7 @@ package mage.sets.onslaught; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; @@ -55,7 +56,7 @@ import mage.players.Player; public class RiptideShapeshifter extends CardImpl { public RiptideShapeshifter(UUID ownerId) { - super(ownerId, 109, "Riptide Shapeshifter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + super(ownerId, 109, "Riptide Shapeshifter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); this.expansionSetCode = "ONS"; this.subtype.add("Shapeshifter"); @@ -79,47 +80,46 @@ public class RiptideShapeshifter extends CardImpl { } class RiptideShapeshifterEffect extends OneShotEffect { - + RiptideShapeshifterEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "Choose a creature type. Reveal cards from the top of your library until you reveal a creature card of that type. Put that card onto the battlefield and shuffle the rest into your library"; } - + RiptideShapeshifterEffect(final RiptideShapeshifterEffect effect) { super(effect); } - + @Override public RiptideShapeshifterEffect copy() { return new RiptideShapeshifterEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { Choice choice = new ChoiceImpl(true); choice.setMessage("Choose a creature type:"); choice.setChoices(CardRepository.instance.getCreatureTypes()); - while (!player.choose(Outcome.BoostCreature, choice, game)) { - if (!player.canRespond()) { + while (!controller.choose(Outcome.BoostCreature, choice, game)) { + if (!controller.canRespond()) { return false; } } Cards revealedCards = new CardsImpl(); - while (player.getLibrary().size() > 0) { - Card card = player.getLibrary().removeFromTop(game); + while (controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().removeFromTop(game); if (card.getCardType().contains(CardType.CREATURE) && card.getSubtype().contains(choice.getChoice())) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); break; } revealedCards.add(card); } - player.revealCards("Riptide Shapeshifter", revealedCards, game); - for (Card card: revealedCards.getCards(game)) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - player.shuffleLibrary(game); + controller.revealCards(sourceObject.getIdName(), revealedCards, game); + controller.moveCards(revealedCards, Zone.LIBRARY, source, game); + controller.shuffleLibrary(game); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/onslaught/RotlungReanimator.java b/Mage.Sets/src/mage/sets/onslaught/RotlungReanimator.java index 15ec38fc4df..38ce5a39a6d 100644 --- a/Mage.Sets/src/mage/sets/onslaught/RotlungReanimator.java +++ b/Mage.Sets/src/mage/sets/onslaught/RotlungReanimator.java @@ -29,7 +29,7 @@ package mage.sets.onslaught; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -59,7 +59,7 @@ public class RotlungReanimator extends CardImpl { this.toughness = new MageInt(2); // Whenever Rotlung Reanimator or another Cleric dies, put a 2/2 black Zombie creature token onto the battlefield. - this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new ZombieToken()), false, filter)); + this.addAbility(new DiesThisOrAnotherCreatureTriggeredAbility(new CreateTokenEffect(new ZombieToken()), false, filter)); } public RotlungReanimator(final RotlungReanimator card) { diff --git a/Mage.Sets/src/mage/sets/onslaught/SageAven.java b/Mage.Sets/src/mage/sets/onslaught/SageAven.java new file mode 100644 index 00000000000..d1d40e34d7f --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/SageAven.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class SageAven extends mage.sets.ninthedition.SageAven { + + public SageAven(UUID ownerId) { + super(ownerId); + this.cardNumber = 111; + this.expansionSetCode = "ONS"; + } + + public SageAven(final SageAven card) { + super(card); + } + + @Override + public SageAven copy() { + return new SageAven(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/SeasideHaven.java b/Mage.Sets/src/mage/sets/onslaught/SeasideHaven.java index 193ab18919c..ab893d66547 100644 --- a/Mage.Sets/src/mage/sets/onslaught/SeasideHaven.java +++ b/Mage.Sets/src/mage/sets/onslaught/SeasideHaven.java @@ -33,6 +33,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -47,9 +48,9 @@ import mage.target.common.TargetControlledPermanent; * @author anonymous */ public class SeasideHaven extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("Bird"); - + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Bird"); + static{ filter.add(new SubtypePredicate("Bird")); } @@ -61,7 +62,7 @@ public class SeasideHaven extends CardImpl { // {tap}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); // {W}{U}, {tap}, Sacrifice a Bird: Draw a card. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, null, new ManaCostsImpl<>("{W}{U}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl<>("{W}{U}")); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/onslaught/SnarlingUndorak.java b/Mage.Sets/src/mage/sets/onslaught/SnarlingUndorak.java new file mode 100644 index 00000000000..b7f2be02a46 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/SnarlingUndorak.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SnarlingUndorak extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Beast creature"); + + static { + filter.add(new SubtypePredicate("Beast")); + } + + public SnarlingUndorak(UUID ownerId) { + super(ownerId, 283, "Snarling Undorak", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Beast"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {2}{G}: Target Beast creature gets +1/+1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{2}{G}")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + // Morph {1}{G}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{1}{G}{G}"))); + } + + public SnarlingUndorak(final SnarlingUndorak card) { + super(card); + } + + @Override + public SnarlingUndorak copy() { + return new SnarlingUndorak(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/SpinedBasher.java b/Mage.Sets/src/mage/sets/onslaught/SpinedBasher.java new file mode 100644 index 00000000000..fb63ab3944c --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/SpinedBasher.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SpinedBasher extends CardImpl { + + public SpinedBasher(UUID ownerId) { + super(ownerId, 172, "Spined Basher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Zombie"); + this.subtype.add("Beast"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Morph {2}{B} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{B}"))); + } + + public SpinedBasher(final SpinedBasher card) { + super(card); + } + + @Override + public SpinedBasher copy() { + return new SpinedBasher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/SpittingGourna.java b/Mage.Sets/src/mage/sets/onslaught/SpittingGourna.java new file mode 100644 index 00000000000..ce970c772eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/SpittingGourna.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.ReachAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SpittingGourna extends CardImpl { + + public SpittingGourna(UUID ownerId) { + super(ownerId, 284, "Spitting Gourna", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Beast"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Reach + this.addAbility(ReachAbility.getInstance()); + // Morph {4}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{4}{G}"))); + } + + public SpittingGourna(final SpittingGourna card) { + super(card); + } + + @Override + public SpittingGourna copy() { + return new SpittingGourna(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/SpurredWolverine.java b/Mage.Sets/src/mage/sets/onslaught/SpurredWolverine.java new file mode 100644 index 00000000000..10ad8ce064d --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/SpurredWolverine.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SpurredWolverine extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Beasts you control"); + + static { + filter.add(Predicates.not(new TappedPredicate())); + filter.add(new SubtypePredicate("Beast")); + } + + public SpurredWolverine(UUID ownerId) { + super(ownerId, 237, "Spurred Wolverine", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Wolverine"); + this.subtype.add("Beast"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Tap two untapped Beasts you control: Target creature gains first strike until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect( + FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new TapTargetCost(new TargetControlledPermanent(2, 2, filter, false))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public SpurredWolverine(final SpurredWolverine card) { + super(card); + } + + @Override + public SpurredWolverine copy() { + return new SpurredWolverine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/StagBeetle.java b/Mage.Sets/src/mage/sets/onslaught/StagBeetle.java new file mode 100644 index 00000000000..665e8a1dbb3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/StagBeetle.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LoneFox + */ +public class StagBeetle extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("other creatures"); + + static { + filter.add(new AnotherPredicate()); + } + + public StagBeetle(UUID ownerId) { + super(ownerId, 285, "Stag Beetle", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Insect"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Stag Beetle enters the battlefield with X +1/+1 counters on it, where X is the number of other creatures on the battlefield. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(), + new PermanentsOnBattlefieldCount(filter), false), + "with X +1/+1 counters on it, where X is the number of other creatures on the battlefield")); + } + + public StagBeetle(final StagBeetle card) { + super(card); + } + + @Override + public StagBeetle copy() { + return new StagBeetle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/Standardize.java b/Mage.Sets/src/mage/sets/onslaught/Standardize.java index 760ae76aead..07ffd013875 100644 --- a/Mage.Sets/src/mage/sets/onslaught/Standardize.java +++ b/Mage.Sets/src/mage/sets/onslaught/Standardize.java @@ -29,12 +29,10 @@ package mage.sets.onslaught; import java.util.Set; import java.util.UUID; - import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.BecomesChosenNonWallCreatureTypeTargetEffect; import mage.abilities.effects.common.continuous.BecomesSubtypeAllEffect; import mage.cards.CardImpl; import mage.cards.repository.CardRepository; @@ -59,8 +57,7 @@ public class Standardize extends CardImpl { this.expansionSetCode = "ONS"; // Choose a creature type other than Wall. Each creature becomes that type until end of turn. - - this.getSpellAbility().addEffect(new BecomesChosenNonWallCreatureTypeTargetEffect()); + this.getSpellAbility().addEffect(new StandardizeEffect()); } public Standardize(final Standardize card) { @@ -77,24 +74,24 @@ public class Standardize extends CardImpl { class StandardizeEffect extends OneShotEffect { - public StandardizeEffect() { - super(Outcome.BoostCreature); - staticText = "choose a creature type other than wall, each creature's type becomes that type until end of turn"; - - } - - public StandardizeEffect(final StandardizeEffect effect) { - super(effect); - } + public StandardizeEffect() { + super(Outcome.BoostCreature); + staticText = "choose a creature type other than Wall. Each creature becomes that type until end of turn"; - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + } + + public StandardizeEffect(final StandardizeEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); String chosenType = ""; if (player != null && permanent != null) { Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose creature type other than Wall"); + typeChoice.setMessage("Choose a creature type other than Wall"); Set types = CardRepository.instance.getCreatureTypes(); types.remove("Wall"); typeChoice.setChoices(types); @@ -111,14 +108,13 @@ class StandardizeEffect extends OneShotEffect { game.addEffect(effect, source); return true; } - + } return false; - } - - @Override - public Effect copy() { - return new StandardizeEffect(this); - } + } + @Override + public Effect copy() { + return new StandardizeEffect(this); + } } diff --git a/Mage.Sets/src/mage/sets/onslaught/SunfireBalm.java b/Mage.Sets/src/mage/sets/onslaught/SunfireBalm.java new file mode 100644 index 00000000000..896fcdc29a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/SunfireBalm.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.CycleTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class SunfireBalm extends CardImpl { + + public SunfireBalm(UUID ownerId) { + super(ownerId, 56, "Sunfire Balm", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{W}"); + this.expansionSetCode = "ONS"; + + // Prevent the next 4 damage that would be dealt to target creature or player this turn. + this.getSpellAbility().addEffect(new PreventDamageToTargetEffect(Duration.EndOfTurn, 4)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + // Cycling {1}{W} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{1}{W}"))); + // When you cycle Sunfire Balm, you may prevent the next 1 damage that would be dealt to target creature or player this turn. + Ability ability = new CycleTriggeredAbility(new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), true); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + + } + + public SunfireBalm(final SunfireBalm card) { + super(card); + } + + @Override + public SunfireBalm copy() { + return new SunfireBalm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/SymbioticElf.java b/Mage.Sets/src/mage/sets/onslaught/SymbioticElf.java new file mode 100644 index 00000000000..4ad72947189 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/SymbioticElf.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.InsectToken; + +/** + * + * @author LoneFox + */ +public class SymbioticElf extends CardImpl { + + public SymbioticElf(UUID ownerId) { + super(ownerId, 288, "Symbiotic Elf", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Elf"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Symbiotic Elf dies, put two 1/1 green Insect creature tokens onto the battlefield. + this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new InsectToken(), 2))); + } + + public SymbioticElf(final SymbioticElf card) { + super(card); + } + + @Override + public SymbioticElf copy() { + return new SymbioticElf(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/ThunderOfHooves.java b/Mage.Sets/src/mage/sets/onslaught/ThunderOfHooves.java new file mode 100644 index 00000000000..d5b051cb3a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/ThunderOfHooves.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author fireshoes + */ +public class ThunderOfHooves extends CardImpl { + + private static final FilterCreaturePermanent filterNotFlying = new FilterCreaturePermanent(); + private static final FilterPermanent filterBeasts = new FilterPermanent(); + + static { + filterNotFlying.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + filterBeasts.add(new SubtypePredicate("Beast")); + } + + public ThunderOfHooves(UUID ownerId) { + super(ownerId, 242, "Thunder of Hooves", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); + this.expansionSetCode = "ONS"; + + // Thunder of Hooves deals X damage to each creature without flying and each player, where X is the number of Beasts on the battlefield. + Effect effect = new DamageEverythingEffect(new PermanentsOnBattlefieldCount(new FilterPermanent(filterBeasts)), new FilterCreaturePermanent(filterNotFlying)); + effect.setText("{this} deals X damage to each creature, where X is the number of creatures on the battlefield"); + this.getSpellAbility().addEffect(effect); + } + + public ThunderOfHooves(final ThunderOfHooves card) { + super(card); + } + + @Override + public ThunderOfHooves copy() { + return new ThunderOfHooves(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/ToweringBaloth.java b/Mage.Sets/src/mage/sets/onslaught/ToweringBaloth.java new file mode 100644 index 00000000000..87b8eeab819 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/ToweringBaloth.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ToweringBaloth extends CardImpl { + + public ToweringBaloth(UUID ownerId) { + super(ownerId, 292, "Towering Baloth", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{6}{G}{G}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Beast"); + this.power = new MageInt(7); + this.toughness = new MageInt(6); + + // Morph {6}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{6}{G}"))); + } + + public ToweringBaloth(final ToweringBaloth card) { + super(card); + } + + @Override + public ToweringBaloth copy() { + return new ToweringBaloth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/TreespringLorian.java b/Mage.Sets/src/mage/sets/onslaught/TreespringLorian.java new file mode 100644 index 00000000000..40b9221b986 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/TreespringLorian.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TreespringLorian extends CardImpl { + + public TreespringLorian(UUID ownerId) { + super(ownerId, 293, "Treespring Lorian", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Beast"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Morph {5}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{5}{G}"))); + } + + public TreespringLorian(final TreespringLorian card) { + super(card); + } + + @Override + public TreespringLorian copy() { + return new TreespringLorian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/TrickeryCharm.java b/Mage.Sets/src/mage/sets/onslaught/TrickeryCharm.java new file mode 100644 index 00000000000..5e2251ae6f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/TrickeryCharm.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.LookLibraryControllerEffect; +import mage.abilities.effects.common.continuous.BecomesChosenCreatureTypeTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class TrickeryCharm extends CardImpl { + + public TrickeryCharm(UUID ownerId) { + super(ownerId, 119, "Trickery Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "ONS"; + + // Choose one - Target creature gains flying until end of turn + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // or target creature becomes the creature type of your choice until end of turn + Mode mode = new Mode(); + mode.getEffects().add(new BecomesChosenCreatureTypeTargetEffect()); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode); + // or look at the top four cards of your library, then put them back in any order. + mode = new Mode(); + mode.getEffects().add(new LookLibraryControllerEffect(4)); + this.getSpellAbility().addMode(mode); + } + + public TrickeryCharm(final TrickeryCharm card) { + super(card); + } + + @Override + public TrickeryCharm copy() { + return new TrickeryCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/UndeadGladiator.java b/Mage.Sets/src/mage/sets/onslaught/UndeadGladiator.java new file mode 100644 index 00000000000..19428fda45c --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/UndeadGladiator.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.condition.common.IsStepCondition; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class UndeadGladiator extends CardImpl { + + public UndeadGladiator(UUID ownerId) { + super(ownerId, 178, "Undead Gladiator", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Zombie"); + this.subtype.add("Barbarian"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // {1}{B}, Discard a card: Return Undead Gladiator from your graveyard to your hand. Activate this ability only during your upkeep. + Ability ability = new ConditionalActivatedAbility(Zone.GRAVEYARD, + new ReturnSourceFromGraveyardToHandEffect(), + new ManaCostsImpl("{1}{B}"), + new IsStepCondition(PhaseStep.UPKEEP), null); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + + // Cycling {1}{B} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{1}{B}"))); + } + + public UndeadGladiator(final UndeadGladiator card) { + super(card); + } + + @Override + public UndeadGladiator copy() { + return new UndeadGladiator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/VitalityCharm.java b/Mage.Sets/src/mage/sets/onslaught/VitalityCharm.java new file mode 100644 index 00000000000..eee200ea12c --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/VitalityCharm.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.InsectToken; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class VitalityCharm extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Beast"); + + static { + filter.add(new SubtypePredicate("Beast")); + } + + public VitalityCharm(UUID ownerId) { + super(ownerId, 296, "Vitality Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "ONS"; + + // Choose one - Put a 1/1 green Insect creature token onto the battlefield + this.getSpellAbility().addEffect(new CreateTokenEffect(new InsectToken())); + // or target creature gets +1/+1 and gains trample until end of turn + Mode mode = new Mode(); + Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn); + effect.setText("target creature gets +1/+1"); + mode.getEffects().add(effect); + effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains trample until end of turn"); + mode.getEffects().add(effect); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode); + // or regenerate target Beast. + mode = new Mode(); + mode.getEffects().add(new RegenerateTargetEffect()); + mode.getTargets().add(new TargetPermanent(filter)); + this.getSpellAbility().addMode(mode); + } + + public VitalityCharm(final VitalityCharm card) { + super(card); + } + + @Override + public VitalityCharm copy() { + return new VitalityCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/VoiceOfTheWoods.java b/Mage.Sets/src/mage/sets/onslaught/VoiceOfTheWoods.java index b10c2dfa800..5395bdf8339 100644 --- a/Mage.Sets/src/mage/sets/onslaught/VoiceOfTheWoods.java +++ b/Mage.Sets/src/mage/sets/onslaught/VoiceOfTheWoods.java @@ -38,12 +38,12 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.TappedPredicate; import mage.game.permanent.token.Token; -import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetControlledPermanent; /** * @@ -51,7 +51,7 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class VoiceOfTheWoods extends CardImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Elves you control"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Elves you control"); static { filter.add(Predicates.not(new TappedPredicate())); @@ -69,7 +69,7 @@ public class VoiceOfTheWoods extends CardImpl { // Tap five untapped Elves you control: Put a 7/7 green Elemental creature token with trample onto the battlefield. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new VoiceOfTheWoodsElementalToken()), - new TapTargetCost(new TargetControlledCreaturePermanent(5,5, filter, false))); + new TapTargetCost(new TargetControlledPermanent(5,5, filter, false))); this.addAbility(ability); } @@ -97,4 +97,4 @@ class VoiceOfTheWoodsElementalToken extends Token { addAbility(TrampleAbility.getInstance()); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/onslaught/WeatheredWayfarer.java b/Mage.Sets/src/mage/sets/onslaught/WeatheredWayfarer.java index 74c9474f8ea..738cd6a0d18 100644 --- a/Mage.Sets/src/mage/sets/onslaught/WeatheredWayfarer.java +++ b/Mage.Sets/src/mage/sets/onslaught/WeatheredWayfarer.java @@ -35,7 +35,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.condition.Condition; -import mage.abilities.condition.common.OpponentControllsMoreCondition; +import mage.abilities.condition.common.OpponentControlsMoreCondition; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; @@ -67,7 +67,7 @@ public class WeatheredWayfarer extends CardImpl { Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterLandCard()), true, true), new ManaCostsImpl("{W}"), - new OpponentControllsMoreCondition(new FilterLandPermanent("lands"))); + new OpponentControlsMoreCondition(new FilterLandPermanent("lands"))); ability.addCost(new TapSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/onslaught/Wellwisher.java b/Mage.Sets/src/mage/sets/onslaught/Wellwisher.java index 43851a1fd76..eb80dcfae3e 100644 --- a/Mage.Sets/src/mage/sets/onslaught/Wellwisher.java +++ b/Mage.Sets/src/mage/sets/onslaught/Wellwisher.java @@ -37,7 +37,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; /** @@ -46,7 +46,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class Wellwisher extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf on the battlefield"); + private static final FilterPermanent filter = new FilterPermanent("Elf on the battlefield"); static { filter.add(new SubtypePredicate("Elf")); diff --git a/Mage.Sets/src/mage/sets/onslaught/WheelAndDeal.java b/Mage.Sets/src/mage/sets/onslaught/WheelAndDeal.java new file mode 100644 index 00000000000..2d1d551ecd9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/WheelAndDeal.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.DrawCardTargetEffect; +import mage.abilities.effects.common.discard.DiscardHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.FilterPlayer; +import mage.filter.predicate.other.PlayerPredicate; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class WheelAndDeal extends CardImpl { + + private static final FilterPlayer filter = new FilterPlayer("opponent"); + + static { + filter.add(new PlayerPredicate(TargetController.OPPONENT)); + } + + public WheelAndDeal(UUID ownerId) { + super(ownerId, 121, "Wheel and Deal", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{U}"); + this.expansionSetCode = "ONS"; + + // Any number of target opponents each discards his or her hand and draws seven cards. + Effect effect = new DiscardHandTargetEffect(); + effect.setText("Any number of target opponents each discards his or her hand"); + this.getSpellAbility().addTarget(new TargetPlayer(0, Integer.MAX_VALUE, false, filter)); + this.getSpellAbility().addEffect(effect); + effect = new DrawCardTargetEffect(7); + effect.setText("and draws seven cards"); + this.getSpellAbility().addEffect(effect); + + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public WheelAndDeal(final WheelAndDeal card) { + super(card); + } + + @Override + public WheelAndDeal copy() { + return new WheelAndDeal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/WirewoodHerald.java b/Mage.Sets/src/mage/sets/onslaught/WirewoodHerald.java index 209057bb5e8..1db70103973 100644 --- a/Mage.Sets/src/mage/sets/onslaught/WirewoodHerald.java +++ b/Mage.Sets/src/mage/sets/onslaught/WirewoodHerald.java @@ -34,7 +34,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.filter.common.FilterCreatureCard; +import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; @@ -44,7 +44,7 @@ import mage.target.common.TargetCardInLibrary; */ public class WirewoodHerald extends CardImpl { - private static final FilterCreatureCard filter = new FilterCreatureCard("Elf card"); + private static final FilterCard filter = new FilterCard("Elf card"); static { filter.add(new SubtypePredicate("Elf")); diff --git a/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java b/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java index be1dc8700a9..594d11f12bf 100644 --- a/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java +++ b/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java @@ -38,9 +38,9 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.target.common.TargetCreaturePermanent; +import mage.target.TargetPermanent; /** * @@ -48,7 +48,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class WirewoodLodge extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf"); + private static final FilterPermanent filter = new FilterPermanent("Elf"); + static { filter.add(new SubtypePredicate("Elf")); } @@ -56,14 +57,14 @@ public class WirewoodLodge extends CardImpl { public WirewoodLodge(UUID ownerId) { super(ownerId, 329, "Wirewood Lodge", Rarity.RARE, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "ONS"; - + // {T}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); - + // {G}, {T}: Untap target Elf. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ManaCostsImpl("{G}")); ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent(filter)); + ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/onslaught/WirewoodSavage.java b/Mage.Sets/src/mage/sets/onslaught/WirewoodSavage.java index e6935282b58..1f91cb2fb19 100644 --- a/Mage.Sets/src/mage/sets/onslaught/WirewoodSavage.java +++ b/Mage.Sets/src/mage/sets/onslaught/WirewoodSavage.java @@ -35,7 +35,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; /** @@ -44,7 +44,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class WirewoodSavage extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a Beast"); + private static final FilterPermanent filter = new FilterPermanent("a Beast"); static { filter.add(new SubtypePredicate("Beast")); diff --git a/Mage.Sets/src/mage/sets/pdsgraveborn/SickeningDreams.java b/Mage.Sets/src/mage/sets/pdsgraveborn/SickeningDreams.java new file mode 100644 index 00000000000..0cfcfa9aff6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/pdsgraveborn/SickeningDreams.java @@ -0,0 +1,103 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.pdsgraveborn; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.Cost; +import mage.abilities.costs.VariableCostImpl; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.dynamicvalue.common.GetXValue; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInHand; + +/** + * + * @author fireshoes + */ +public class SickeningDreams extends CardImpl { + + public SickeningDreams(UUID ownerId) { + super(ownerId, 18, "Sickening Dreams", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{B}"); + this.expansionSetCode = "PD3"; + + // As an additional cost to cast Sickening Dreams, discard X cards. + this.getSpellAbility().addCost(new SickeningDreamsAdditionalCost()); + + // Sickening Dreams deals X damage to each creature and each player. + this.getSpellAbility().addEffect(new DamageEverythingEffect(new GetXValue(), new FilterCreaturePermanent())); + } + + public SickeningDreams(final SickeningDreams card) { + super(card); + } + + @Override + public SickeningDreams copy() { + return new SickeningDreams(this); + } +} + +class SickeningDreamsAdditionalCost extends VariableCostImpl { + + SickeningDreamsAdditionalCost() { + super("cards to discard"); + this.text = "As an additional cost to cast {this}, discard X cards"; + } + + SickeningDreamsAdditionalCost(final SickeningDreamsAdditionalCost cost) { + super(cost); + } + + @Override + public SickeningDreamsAdditionalCost copy() { + return new SickeningDreamsAdditionalCost(this); + } + + @Override + public int getMaxValue(Ability source, Game game) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + return controller.getHand().size(); + } + return 0; + } + + @Override + public Cost getFixedCostsFromAnnouncedValue(int xValue) { + TargetCardInHand target = new TargetCardInHand(xValue, new FilterCard()); + return new DiscardTargetCost(target); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/phyrexiavsthecoalition/HornetCannon.java b/Mage.Sets/src/mage/sets/phyrexiavsthecoalition/HornetCannon.java index 921db990ae4..df761c9c72c 100644 --- a/Mage.Sets/src/mage/sets/phyrexiavsthecoalition/HornetCannon.java +++ b/Mage.Sets/src/mage/sets/phyrexiavsthecoalition/HornetCannon.java @@ -29,7 +29,6 @@ package mage.sets.phyrexiavsthecoalition; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.costs.common.TapSourceCost; @@ -42,6 +41,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.game.permanent.token.HornetToken; import mage.game.permanent.token.Token; import mage.target.targetpointer.FixedTarget; @@ -73,33 +73,33 @@ public class HornetCannon extends CardImpl { } class HornetCannonEffect extends OneShotEffect { - + public HornetCannonEffect() { super(Outcome.PutCreatureInPlay); staticText = "Put a 1/1 colorless Insect artifact creature token with flying and haste named Hornet onto the battlefield. Destroy it at the beginning of the next end step."; } - + public HornetCannonEffect(final HornetCannonEffect effect) { super(effect); } - + @Override public HornetCannonEffect copy() { return new HornetCannonEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Token hornetToken = new HornetToken(); hornetToken.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - - DestroyTargetEffect destroyEffect = new DestroyTargetEffect("destroy the token."); - destroyEffect.setTargetPointer(new FixedTarget(hornetToken.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(destroyEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + for (UUID tokenId : hornetToken.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + DestroyTargetEffect destroyEffect = new DestroyTargetEffect(false); + destroyEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(destroyEffect), source); + } + } return true; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/AvenRiftwatcher.java b/Mage.Sets/src/mage/sets/planarchaos/AvenRiftwatcher.java index 8cf27f15ec2..4da27ce5740 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/AvenRiftwatcher.java +++ b/Mage.Sets/src/mage/sets/planarchaos/AvenRiftwatcher.java @@ -29,6 +29,7 @@ package mage.sets.planarchaos; import java.util.UUID; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersOrLeavesTheBattlefieldSourceTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; @@ -60,7 +61,9 @@ public class AvenRiftwatcher extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Vanishing 3 - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)))); + Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3))); + ability.setRuleVisible(false); + this.addAbility(ability); this.addAbility(new VanishingUpkeepAbility(3)); this.addAbility(new VanishingSacrificeAbility()); diff --git a/Mage.Sets/src/mage/sets/planarchaos/BatteringSliver.java b/Mage.Sets/src/mage/sets/planarchaos/BatteringSliver.java index d52aa2499c0..0f3880bf287 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/BatteringSliver.java +++ b/Mage.Sets/src/mage/sets/planarchaos/BatteringSliver.java @@ -46,7 +46,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class BatteringSliver extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("all Sliver creatures"); static { filter.add(new SubtypePredicate("Sliver")); diff --git a/Mage.Sets/src/mage/sets/planarchaos/BoomBust.java b/Mage.Sets/src/mage/sets/planarchaos/BoomBust.java index b73609a114a..9bfd48af8f8 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/BoomBust.java +++ b/Mage.Sets/src/mage/sets/planarchaos/BoomBust.java @@ -25,32 +25,25 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.planarchaos; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.TargetController; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPermanent; -/** - * - * @author LevelX2 - */ - - public class BoomBust extends SplitCard { private static final FilterLandPermanent filter1 = new FilterLandPermanent("land you control"); private static final FilterLandPermanent filter2 = new FilterLandPermanent("land you don't control"); + static { filter1.add(new ControllerPredicate(TargetController.YOU)); filter2.add(new ControllerPredicate(TargetController.NOT_YOU)); @@ -62,7 +55,7 @@ public class BoomBust extends SplitCard { // Boom // Destroy target land you control and target land you don't control. - Effect effect = new DestroyTargetEffect(); + Effect effect = new DestroyTargetEffect(false, true); effect.setText("Destroy target land you control and target land you don't control"); getLeftHalfCard().getSpellAbility().addEffect(effect); getLeftHalfCard().getSpellAbility().addTarget(new TargetPermanent(filter1)); diff --git a/Mage.Sets/src/mage/sets/planarchaos/BraidsConjurerAdept.java b/Mage.Sets/src/mage/sets/planarchaos/BraidsConjurerAdept.java new file mode 100644 index 00000000000..6938504723b --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/BraidsConjurerAdept.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author LoneFox + */ +public class BraidsConjurerAdept extends CardImpl { + + private static final FilterCard filter = new FilterCard("artifact, creature, or land card") +; + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); + } + + public BraidsConjurerAdept(UUID ownerId) { + super(ownerId, 36, "Braids, Conjurer Adept", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "PLC"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // At the beginning of each player's upkeep, that player may put an artifact, creature, or land card from his or her hand onto the battlefield. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new PutPermanentOnBattlefieldEffect(filter, true), TargetController.ANY, false)); + } + + public BraidsConjurerAdept(final BraidsConjurerAdept card) { + super(card); + } + + @Override + public BraidsConjurerAdept copy() { + return new BraidsConjurerAdept(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/BrainGorgers.java b/Mage.Sets/src/mage/sets/planarchaos/BrainGorgers.java new file mode 100644 index 00000000000..53fd0d565b6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/BrainGorgers.java @@ -0,0 +1,118 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.abilities.keyword.MadnessAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class BrainGorgers extends CardImpl { + + public BrainGorgers(UUID ownerId) { + super(ownerId, 65, "Brain Gorgers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Zombie"); + this.power = new MageInt(4); + this.toughness = new MageInt(2); + + // When you cast Brain Gorgers, any player may sacrifice a creature. If a player does, counter Brain Gorgers. + this.addAbility(new CastSourceTriggeredAbility(new BrainGorgersCounterSourceEffect())); + + // Madness {1}{B} + this.addAbility(new MadnessAbility(this, new ManaCostsImpl<>("{1}{B}"))); + } + + public BrainGorgers(final BrainGorgers card) { + super(card); + } + + @Override + public BrainGorgers copy() { + return new BrainGorgers(this); + } +} + +class BrainGorgersCounterSourceEffect extends OneShotEffect { + + public BrainGorgersCounterSourceEffect() { + super(Outcome.AIDontUseIt); + staticText = "any player may sacrifice a creature. If a player does, counter {source}"; + } + + public BrainGorgersCounterSourceEffect(final BrainGorgersCounterSourceEffect effect) { + super(effect); + } + + @Override + public BrainGorgersCounterSourceEffect copy() { + return new BrainGorgersCounterSourceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = source.getSourceObject(game); + if (sourceObject != null) { + SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent()); + for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) { + cost.clearPaid(); + Player player = game.getPlayer(playerId); + if (cost.canPay(source, source.getSourceId(), player.getId(), game) + && player.chooseUse(outcome, "Sacrifice a creature to counter " + sourceObject.getIdName() + "?", source, game)) { + if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) { + game.informPlayers(player.getLogName() + " sacrifices a creature to counter " + sourceObject.getIdName() + "."); + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + game.getStack().counter(spell.getId(), source.getSourceId(), game); + } + } + } + } + return true; + } + return false; + + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/Calciderm.java b/Mage.Sets/src/mage/sets/planarchaos/Calciderm.java index 39865b67a5d..3bc5e170170 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/Calciderm.java +++ b/Mage.Sets/src/mage/sets/planarchaos/Calciderm.java @@ -28,15 +28,16 @@ package mage.sets.planarchaos; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.ShroudAbility; import mage.abilities.keyword.VanishingSacrificeAbility; import mage.abilities.keyword.VanishingUpkeepAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.counters.CounterType; /** @@ -56,7 +57,9 @@ public class Calciderm extends CardImpl { // Shroud this.addAbility(ShroudAbility.getInstance()); // Vanishing 4 - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(4)))); + Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(4))); + ability.setRuleVisible(false); + this.addAbility(ability); this.addAbility(new VanishingUpkeepAbility(4)); this.addAbility(new VanishingSacrificeAbility()); } diff --git a/Mage.Sets/src/mage/sets/planarchaos/Chronozoa.java b/Mage.Sets/src/mage/sets/planarchaos/Chronozoa.java index a97add2ef48..660b1a980ae 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/Chronozoa.java +++ b/Mage.Sets/src/mage/sets/planarchaos/Chronozoa.java @@ -28,13 +28,14 @@ package mage.sets.planarchaos; import java.util.UUID; - import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.DiesCreatureTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.common.LastTimeCounterRemovedCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.effects.CopyCardEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.VanishingSacrificeAbility; @@ -47,14 +48,11 @@ import mage.counters.CounterType; /** * * @author Gal Lerman - + * */ public class Chronozoa extends CardImpl { - private static final int timeCounters = 3; - private static final int numCopies = 2; - - public Chronozoa(UUID ownerId) { + public Chronozoa(UUID ownerId) { super(ownerId, 37, "Chronozoa", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.expansionSetCode = "PLC"; this.subtype.add("Illusion"); @@ -64,13 +62,17 @@ public class Chronozoa extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Vanishing 3 - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(timeCounters)))); - this.addAbility(new VanishingUpkeepAbility(timeCounters)); + Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3))); + ability.setRuleVisible(false); + this.addAbility(ability); + this.addAbility(new VanishingUpkeepAbility(3)); this.addAbility(new VanishingSacrificeAbility()); // When Chronozoa is put into a graveyard from play, if it had no time counters on it, put two tokens into play that are copies of it. - this.addAbility(new ConditionalTriggeredAbility(new DiesCreatureTriggeredAbility(new CopyCardEffect(this, numCopies), false), - new LastTimeCounterRemovedCondition(), - "When {this} is put into a graveyard from play, if it had no time counters on it, put two tokens into play that are copies of it.")); + Effect effect = new PutTokenOntoBattlefieldCopySourceEffect(2); + effect.setText("put two tokens into play that are copies of it"); + this.addAbility(new ConditionalTriggeredAbility(new DiesCreatureTriggeredAbility(effect, false), + new LastTimeCounterRemovedCondition(), + "When {this} dies, if it had no time counters on it, put two tokens that are copies of it onto the battlefield.")); } public Chronozoa(final Chronozoa card) { diff --git a/Mage.Sets/src/mage/sets/planarchaos/DashHopes.java b/Mage.Sets/src/mage/sets/planarchaos/DashHopes.java new file mode 100644 index 00000000000..d061e582a98 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/DashHopes.java @@ -0,0 +1,114 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author LevelX2 + */ +public class DashHopes extends CardImpl { + + public DashHopes(UUID ownerId) { + super(ownerId, 68, "Dash Hopes", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}{B}"); + this.expansionSetCode = "PLC"; + + // When you cast Dash Hopes, any player may pay 5 life. If a player does, counter Dash Hopes. + this.addAbility(new CastSourceTriggeredAbility(new DashHopesCounterSourceEffect())); + + // Counter target spell. + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + public DashHopes(final DashHopes card) { + super(card); + } + + @Override + public DashHopes copy() { + return new DashHopes(this); + } +} + +class DashHopesCounterSourceEffect extends OneShotEffect { + + public DashHopesCounterSourceEffect() { + super(Outcome.AIDontUseIt); + staticText = "any player may pay 5 life. If a player does, counter {source}"; + } + + public DashHopesCounterSourceEffect(final DashHopesCounterSourceEffect effect) { + super(effect); + } + + @Override + public DashHopesCounterSourceEffect copy() { + return new DashHopesCounterSourceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = source.getSourceObject(game); + if (sourceObject != null) { + PayLifeCost cost = new PayLifeCost(5); + for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) { + Player player = game.getPlayer(playerId); + cost.clearPaid(); + if (cost.canPay(source, source.getSourceId(), player.getId(), game) + && player.chooseUse(outcome, "Pay 5 life to counter " + sourceObject.getIdName() + "?", source, game)) { + if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) { + game.informPlayers(player.getLogName() + " pays 5 life to counter " + sourceObject.getIdName() + "."); + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + game.getStack().counter(spell.getId(), source.getSourceId(), game); + } + } + } + } + return true; + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/DeadlyGrub.java b/Mage.Sets/src/mage/sets/planarchaos/DeadlyGrub.java new file mode 100644 index 00000000000..6b580ad1324 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/DeadlyGrub.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.common.LastTimeCounterRemovedCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.ShroudAbility; +import mage.abilities.keyword.VanishingSacrificeAbility; +import mage.abilities.keyword.VanishingUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + */ +public class DeadlyGrub extends CardImpl { + + public DeadlyGrub(UUID ownerId) { + super(ownerId, 69, "Deadly Grub", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Insect"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Vanishing 3 + Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3))); + ability.setRuleVisible(false); + this.addAbility(ability); + this.addAbility(new VanishingUpkeepAbility(3)); + this.addAbility(new VanishingSacrificeAbility()); + // When Deadly Grub dies, if it had no time counters on it, put a 6/1 green Insect creature token with shroud onto the battlefield. + this.addAbility(new ConditionalTriggeredAbility(new DiesTriggeredAbility(new CreateTokenEffect(new DeadlyGrubToken(), 1)), + new LastTimeCounterRemovedCondition(), "When {this} dies, if it had no time counters on it, put a 6/1 green Insect creature token with shroud onto the battlefield.")); + } + + public DeadlyGrub(final DeadlyGrub card) { + super(card); + } + + @Override + public DeadlyGrub copy() { + return new DeadlyGrub(this); + } +} + +class DeadlyGrubToken extends Token { + DeadlyGrubToken() { + super("Insect", "6/1 green Insect creature token with shroud"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Insect"); + power = new MageInt(6); + toughness = new MageInt(1); + this.addAbility(ShroudAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/DreamscapeArtist.java b/Mage.Sets/src/mage/sets/planarchaos/DreamscapeArtist.java index 14335e8ba6b..00a1cea424e 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/DreamscapeArtist.java +++ b/Mage.Sets/src/mage/sets/planarchaos/DreamscapeArtist.java @@ -63,12 +63,12 @@ public class DreamscapeArtist extends CardImpl { // {2}{U}, {tap}, Discard a card, Sacrifice a land: Search your library for up to two basic land cards and put them onto the battlefield. Then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard()); Ability ability = new SimpleActivatedAbility( - Zone.BATTLEFIELD, - new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay), + Zone.BATTLEFIELD, + new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay), new ManaCostsImpl("{2}{U}")); ability.addCost(new TapSourceCost()); ability.addCost(new DiscardCardCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent("land")))); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land")))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/planarchaos/ErraticMutation.java b/Mage.Sets/src/mage/sets/planarchaos/ErraticMutation.java index f7ac4e93c3e..0aacfa5dfe8 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/ErraticMutation.java +++ b/Mage.Sets/src/mage/sets/planarchaos/ErraticMutation.java @@ -28,6 +28,8 @@ package mage.sets.planarchaos; import java.util.UUID; + +import mage.MageObject; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -40,13 +42,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardsImpl; import mage.game.Game; -import mage.players.Library; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; - - /** * * @author LevelX2 @@ -57,7 +56,6 @@ public class ErraticMutation extends CardImpl { super(ownerId, 41, "Erratic Mutation", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); this.expansionSetCode = "PLC"; - // Choose target creature. Reveal cards from the top of your library until you reveal a nonland card. That creature gets +X/-X until end of turn, where X is that card's converted mana cost. Put all cards revealed this way on the bottom of your library in any order. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new ErraticMutationEffect()); @@ -77,7 +75,7 @@ public class ErraticMutation extends CardImpl { class ErraticMutationEffect extends OneShotEffect { public ErraticMutationEffect() { - super(Outcome.DrawCard); + super(Outcome.UnboostCreature); this.staticText = "Choose target creature. Reveal cards from the top of your library until you reveal a nonland card. That creature gets +X/-X until end of turn, where X is that card's converted mana cost. Put all cards revealed this way on the bottom of your library in any order"; } @@ -92,29 +90,33 @@ class ErraticMutationEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null && player.getLibrary().size() > 0) { - CardsImpl cards = new CardsImpl(); - Library library = player.getLibrary(); - Card card = null; - do { - card = library.removeFromTop(game); - if (card != null) { - cards.add(card); + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + CardsImpl toReveal = new CardsImpl(); + Card nonLandCard = null; + + while (nonLandCard == null && controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().removeFromTop(game); + toReveal.add(card); + if (!card.getCardType().contains(CardType.LAND)) { + nonLandCard = card; } - } while (library.size() > 0 && card != null && card.getCardType().contains(CardType.LAND)); + } // reveal cards - if (!cards.isEmpty()) { - player.revealCards("Erratic Mutation", cards, game); + if (!toReveal.isEmpty()) { + controller.revealCards(sourceObject.getIdName(), toReveal, game); } // the nonland card - int boostValue = card.getManaCost().convertedManaCost(); - // unboost target - ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue * -1, Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(this.getTargetPointer().getFirst(game, source))); - game.addEffect(effect, source); + if (nonLandCard != null) { + int boostValue = nonLandCard.getManaCost().convertedManaCost(); + // unboost target + ContinuousEffect effect = new BoostTargetEffect(boostValue, -boostValue, Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(this.getTargetPointer().getFirst(game, source))); + game.addEffect(effect, source); + } // put the cards on the bottom of the library in any order - return player.putCardsOnBottomOfLibrary(cards, game, source, true); + return controller.putCardsOnBottomOfLibrary(toReveal, game, source, true); } return false; } diff --git a/Mage.Sets/src/mage/sets/planarchaos/FatalFrenzy.java b/Mage.Sets/src/mage/sets/planarchaos/FatalFrenzy.java index 43ba60a9041..0bbef4cfb3c 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/FatalFrenzy.java +++ b/Mage.Sets/src/mage/sets/planarchaos/FatalFrenzy.java @@ -28,10 +28,6 @@ package mage.sets.planarchaos; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; @@ -43,7 +39,12 @@ import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.targetpointer.FixedTarget; @@ -57,7 +58,6 @@ public class FatalFrenzy extends CardImpl { super(ownerId, 98, "Fatal Frenzy", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{R}"); this.expansionSetCode = "PLC"; - // Until end of turn, target creature you control gains trample and gets +X/+0, where X is its power. Sacrifice it at the beginning of the next end step. this.getSpellAbility().addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)); this.getSpellAbility().addEffect(new BoostTargetEffect(new TargetPermanentPowerCount(), new StaticValue(0), Duration.EndOfTurn, true)); @@ -94,13 +94,16 @@ class FatalFrenzyEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this"); - sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + Permanent targetCreature = game.getPermanent(source.getFirstTarget()); + if (targetCreature != null) { + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this", source.getControllerId()); + sacrificeEffect.setTargetPointer(new FixedTarget(targetCreature, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } return true; } } diff --git a/Mage.Sets/src/mage/sets/planarchaos/FirefrightMage.java b/Mage.Sets/src/mage/sets/planarchaos/FirefrightMage.java new file mode 100644 index 00000000000..729e237799c --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/FirefrightMage.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CantBeBlockedByAllTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author BursegSardaukar + */ +public class FirefrightMage extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("except by artifact creatures and/or red creatures"); + + static { + filter.add(Predicates.not( + Predicates.or( + Predicates.and(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE)), + Predicates.and(new CardTypePredicate(CardType.CREATURE), new ColorPredicate(ObjectColor.RED) + )))); + } + + public FirefrightMage(UUID ownerId) { + super(ownerId, 99, "Firefright Mage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Goblin"); + this.subtype.add("Spellshaper"); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + //{1}{R}, {T}, Discard a card: Target creature can't be blocked this turn except by artifact creatures and/or red creatures. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedByAllTargetEffect(filter, Duration.EndOfTurn), new ManaCostsImpl("{1}{R}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FirefrightMage(final FirefrightMage card) { + super(card); + } + + @Override + public FirefrightMage copy() { + return new FirefrightMage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/FrozenAEther.java b/Mage.Sets/src/mage/sets/planarchaos/FrozenAEther.java index 39c827a0a17..5c84fa60d09 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/FrozenAEther.java +++ b/Mage.Sets/src/mage/sets/planarchaos/FrozenAEther.java @@ -38,6 +38,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -67,6 +68,7 @@ public class FrozenAEther extends CardImpl { } class FrozenAEtherTapEffect extends ReplacementEffectImpl { + FrozenAEtherTapEffect() { super(Duration.WhileOnBattlefield, Outcome.Tap); staticText = "Artifacts, creatures, and lands your opponents control enter the battlefield tapped"; @@ -78,7 +80,7 @@ class FrozenAEtherTapEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent target = game.getPermanent(event.getTargetId()); + Permanent target = ((EntersTheBattlefieldEvent) event).getTarget(); if (target != null) { target.setTapped(true); } @@ -89,15 +91,15 @@ class FrozenAEtherTapEffect extends ReplacementEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && - (permanent.getCardType().contains(CardType.CREATURE) || - permanent.getCardType().contains(CardType.LAND) || - permanent.getCardType().contains(CardType.ARTIFACT))) { + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); + if (permanent != null + && (permanent.getCardType().contains(CardType.CREATURE) + || permanent.getCardType().contains(CardType.LAND) + || permanent.getCardType().contains(CardType.ARTIFACT))) { return true; } } diff --git a/Mage.Sets/src/mage/sets/planarchaos/FungalBehemoth.java b/Mage.Sets/src/mage/sets/planarchaos/FungalBehemoth.java index 7317d947f4c..d701c130fe1 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/FungalBehemoth.java +++ b/Mage.Sets/src/mage/sets/planarchaos/FungalBehemoth.java @@ -44,6 +44,7 @@ import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -122,7 +123,7 @@ class P1P1CountersOnControlledCreaturesCount implements DynamicValue { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { int count = 0; - for (Permanent permanent :game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), sourceAbility.getControllerId(), game)) { count += permanent.getCounters().getCount(CounterType.P1P1); } return count; diff --git a/Mage.Sets/src/mage/sets/planarchaos/GhostTactician.java b/Mage.Sets/src/mage/sets/planarchaos/GhostTactician.java new file mode 100644 index 00000000000..0dd988d3638 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/GhostTactician.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class GhostTactician extends CardImpl { + + public GhostTactician(UUID ownerId) { + super(ownerId, 6, "Ghost Tactician", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Spirit"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(2); + this.toughness = new MageInt(5); + + // {W}, {T}, Discard a card: Creatures you control get +1/+0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BoostControlledEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{W}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public GhostTactician(final GhostTactician card) { + super(card); + } + + @Override + public GhostTactician copy() { + return new GhostTactician(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/GossamerPhantasm.java b/Mage.Sets/src/mage/sets/planarchaos/GossamerPhantasm.java new file mode 100644 index 00000000000..651ed2bd337 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/GossamerPhantasm.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesTargetTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class GossamerPhantasm extends CardImpl { + + public GossamerPhantasm(UUID ownerId) { + super(ownerId, 55, "Gossamer Phantasm", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Illusion"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Gossamer Phantasm becomes the target of a spell or ability, sacrifice it. + this.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect())); + } + + public GossamerPhantasm(final GossamerPhantasm card) { + super(card); + } + + @Override + public GossamerPhantasm copy() { + return new GossamerPhantasm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/HealingLeaves.java b/Mage.Sets/src/mage/sets/planarchaos/HealingLeaves.java new file mode 100644 index 00000000000..f412e8438ce --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/HealingLeaves.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.GainLifeTargetEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.TargetPlayer; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class HealingLeaves extends CardImpl { + + public HealingLeaves(UUID ownerId) { + super(ownerId, 150, "Healing Leaves", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "PLC"; + + // Choose one - Target player gains 3 life; or prevent the next 3 damage that would be dealt to target creature or player this turn. + this.getSpellAbility().addEffect(new GainLifeTargetEffect(3)); + this.getSpellAbility().addTarget(new TargetPlayer()); + Mode mode = new Mode(); + mode.getEffects().add(new PreventDamageToTargetEffect(Duration.EndOfTurn, 3)); + mode.getTargets().add(new TargetCreatureOrPlayer()); + this.getSpellAbility().addMode(mode); + } + + public HealingLeaves(final HealingLeaves card) { + super(card); + } + + @Override + public HealingLeaves copy() { + return new HealingLeaves(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/HeroesRemembered.java b/Mage.Sets/src/mage/sets/planarchaos/HeroesRemembered.java new file mode 100644 index 00000000000..54d15e377e2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/HeroesRemembered.java @@ -0,0 +1,33 @@ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +public class HeroesRemembered extends CardImpl{ + + public HeroesRemembered(UUID ownerId){ + super(ownerId, 7, "Heroes Remembered", Rarity.RARE, new CardType[] {CardType.SORCERY}, "{6}{W}{W}{W}"); + this.expansionSetCode = "PLC"; + + //You gain 20 life. + this.getSpellAbility().addEffect(new GainLifeEffect(20)); + //Suspend 10-{W} + this.addAbility(new SuspendAbility(10, new ManaCostsImpl("{W}"), this)); + } + + public HeroesRemembered(final HeroesRemembered card) { + super(card); + } + + @Override + public Card copy() { + return new HeroesRemembered(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/IntetTheDreamer.java b/Mage.Sets/src/mage/sets/planarchaos/IntetTheDreamer.java index 88d32915c33..4e45cd7b79c 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/IntetTheDreamer.java +++ b/Mage.Sets/src/mage/sets/planarchaos/IntetTheDreamer.java @@ -27,21 +27,21 @@ */ package mage.sets.planarchaos; +import java.util.HashSet; +import java.util.Set; import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.AsThoughEffectImpl; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; import mage.constants.AsThoughEffectType; import mage.constants.CardType; import mage.constants.Duration; @@ -59,6 +59,8 @@ import mage.util.CardUtil; */ public class IntetTheDreamer extends CardImpl { + protected static final String VALUE_PREFIX = "ExileZones"; + public IntetTheDreamer(UUID ownerId) { super(ownerId, 158, "Intet, the Dreamer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{R}{G}"); this.expansionSetCode = "PLC"; @@ -72,9 +74,12 @@ public class IntetTheDreamer extends CardImpl { // Whenever Intet, the Dreamer deals combat damage to a player, you may pay {2}{U}. If you do, exile the top card of your library face down. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility( new DoIfCostPaid(new IntetTheDreamerExileEffect(), new ManaCostsImpl("{2}{U}")), false, true)); - // You may look at that card for as long as it remains exiled. You may play that card without paying its mana cost for as long as Intet remains on the battlefield. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new IntetTheDreamerEffect())); + // You may look at that card for as long as it remains exiled. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new IntetTheDreamerLookEffect())); + // You may play that card without paying its mana cost for as long as Intet remains on the battlefield. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new IntetTheDreamerCastEffect())); } + public IntetTheDreamer(final IntetTheDreamer card) { super(card); } @@ -86,46 +91,53 @@ public class IntetTheDreamer extends CardImpl { } class IntetTheDreamerExileEffect extends OneShotEffect { - + public IntetTheDreamerExileEffect() { super(Outcome.Discard); staticText = "exile the top card of your library face down"; } - + public IntetTheDreamerExileEffect(final IntetTheDreamerExileEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - Card card = player.getLibrary().getFromTop(game); - MageObject sourceObject = source.getSourceObject(game); - if (card != null && sourceObject != null) { - UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); - player.moveCardToExileWithInfo(card, exileZoneId, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, false); - card.setFaceDown(true, game); - return true; - } - } - return false; + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Card card = controller.getLibrary().getFromTop(game); + MageObject sourceObject = source.getSourceObject(game); + if (card != null && sourceObject != null) { + UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); + card.setFaceDown(true, game); + controller.moveCardsToExile(card, source, game, false, exileZoneId, sourceObject.getIdName()); + card.setFaceDown(true, game); + Set exileZones = (Set) game.getState().getValue(IntetTheDreamer.VALUE_PREFIX + source.getSourceId().toString()); + if (exileZones == null) { + exileZones = new HashSet<>(); + game.getState().setValue(IntetTheDreamer.VALUE_PREFIX + source.getSourceId().toString(), exileZones); + } + exileZones.add(exileZoneId); + return true; + } + } + return false; } - + @Override public IntetTheDreamerExileEffect copy() { return new IntetTheDreamerExileEffect(this); } } -class IntetTheDreamerEffect extends AsThoughEffectImpl { +class IntetTheDreamerCastEffect extends AsThoughEffectImpl { - public IntetTheDreamerEffect() { + public IntetTheDreamerCastEffect() { super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "You may play the card from exile without paying its mana cost for as long as {this} remains on the battlefield"; } - public IntetTheDreamerEffect(final IntetTheDreamerEffect effect) { + public IntetTheDreamerCastEffect(final IntetTheDreamerCastEffect effect) { super(effect); } @@ -135,30 +147,80 @@ class IntetTheDreamerEffect extends AsThoughEffectImpl { } @Override - public IntetTheDreamerEffect copy() { - return new IntetTheDreamerEffect(this); + public IntetTheDreamerCastEffect copy() { + return new IntetTheDreamerCastEffect(this); } @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - Player controller = game.getPlayer(source.getControllerId()); - MageObject sourceObject = source.getSourceObject(game); - if (controller != null && sourceObject != null) { - Card card = game.getCard(objectId); - if (affectedControllerId.equals(source.getControllerId()) && card != null && game.getState().getZone(card.getId()) == Zone.EXILED) { - ExileZone zone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter())); - if (zone != null && zone.contains(card.getId())) { - if (controller.chooseUse(outcome, "Look at the card?", source, game)) { - Cards cards = new CardsImpl(); - cards.add(card); - controller.lookAtCards(sourceObject.getName(), cards, game); - return false; - } - controller.setCastSourceIdWithAlternateMana(objectId, null); - return true; + if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId).equals(Zone.EXILED)) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + Card card = game.getCard(objectId); + if (card != null && card.isFaceDown(game)) { + ExileZone zone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter())); + if (zone != null && zone.contains(card.getId())/* && CardUtil.cardCanBePlayedNow(card, controller.getId(), game)*/) { + if (card.getCardType().contains(CardType.LAND)) { + if (game.canPlaySorcery(controller.getId()) && game.getPlayer(controller.getId()).canPlayLand()) { + return controller.chooseUse(outcome, "Play " + card.getName() + "?", source, game); + } + } else { + controller.setCastSourceIdWithAlternateMana(objectId, null, null); + return true; + } + } + } + } + } + return false; + + } +} + +class IntetTheDreamerLookEffect extends AsThoughEffectImpl { + + public IntetTheDreamerLookEffect() { + super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit); + staticText = "You may look at that card for as long as it remains exiled"; + } + + public IntetTheDreamerLookEffect(final IntetTheDreamerLookEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public IntetTheDreamerLookEffect copy() { + return new IntetTheDreamerLookEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId).equals(Zone.EXILED)) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + Card card = game.getCard(objectId); + if (card != null && card.isFaceDown(game)) { + Set exileZones = (Set) game.getState().getValue(IntetTheDreamer.VALUE_PREFIX + source.getSourceId().toString()); + if (exileZones != null) { + for (ExileZone exileZone : game.getExile().getExileZones()) { + if (exileZone.contains(objectId)) { + if (!exileZones.contains(exileZone.getId())) { + return false; + } + } + } + return true; + } } } } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/KeldonMarauders.java b/Mage.Sets/src/mage/sets/planarchaos/KeldonMarauders.java index d342e0f28d2..952005b8c69 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/KeldonMarauders.java +++ b/Mage.Sets/src/mage/sets/planarchaos/KeldonMarauders.java @@ -28,8 +28,6 @@ package mage.sets.planarchaos; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; @@ -39,6 +37,8 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.VanishingSacrificeAbility; import mage.abilities.keyword.VanishingUpkeepAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.counters.CounterType; import mage.target.TargetPlayer; @@ -58,12 +58,14 @@ public class KeldonMarauders extends CardImpl { this.toughness = new MageInt(3); // Vanishing 2 - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2)))); + Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2))); + ability.setRuleVisible(false); + this.addAbility(ability); this.addAbility(new VanishingUpkeepAbility(2)); this.addAbility(new VanishingSacrificeAbility()); - + // When Keldon Marauders enters the battlefield or leaves the battlefield, it deals 1 damage to target player. - Ability ability = new EntersOrLeavesTheBattlefieldSourceTriggeredAbility(new DamageTargetEffect(1), false); + ability = new EntersOrLeavesTheBattlefieldSourceTriggeredAbility(new DamageTargetEffect(1), false); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/planarchaos/LavacoreElemental.java b/Mage.Sets/src/mage/sets/planarchaos/LavacoreElemental.java index c7ffdca38be..972e529d883 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/LavacoreElemental.java +++ b/Mage.Sets/src/mage/sets/planarchaos/LavacoreElemental.java @@ -29,6 +29,7 @@ package mage.sets.planarchaos; import java.util.UUID; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.Effect; @@ -56,10 +57,12 @@ public class LavacoreElemental extends CardImpl { this.toughness = new MageInt(3); // Vanishing 1 - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(1)))); + Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(1))); + ability.setRuleVisible(false); + this.addAbility(ability); this.addAbility(new VanishingUpkeepAbility(1)); this.addAbility(new VanishingSacrificeAbility()); - + // Whenever a creature you control deals combat damage to a player, put a time counter on Lavacore Elemental. Effect effect = new AddCountersSourceEffect(CounterType.TIME.createInstance(1)); effect.setText("put a time counter on {this}"); diff --git a/Mage.Sets/src/mage/sets/planarchaos/MagusOfTheBazaar.java b/Mage.Sets/src/mage/sets/planarchaos/MagusOfTheBazaar.java new file mode 100644 index 00000000000..fa9b7eaf222 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/MagusOfTheBazaar.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DrawDiscardControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class MagusOfTheBazaar extends CardImpl { + + public MagusOfTheBazaar(UUID ownerId) { + super(ownerId, 43, "Magus of the Bazaar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // {tap}: Draw two cards, then discard three cards. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawDiscardControllerEffect(2, 3), new TapSourceCost())); } + + public MagusOfTheBazaar(final MagusOfTheBazaar card) { + super(card); + } + + @Override + public MagusOfTheBazaar copy() { + return new MagusOfTheBazaar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/MalachOfTheDawn.java b/Mage.Sets/src/mage/sets/planarchaos/MalachOfTheDawn.java new file mode 100644 index 00000000000..6bbae42c676 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/MalachOfTheDawn.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class MalachOfTheDawn extends CardImpl { + + public MalachOfTheDawn(UUID ownerId) { + super(ownerId, 24, "Malach of the Dawn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Angel"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {W}{W}{W}: Regenerate Malach of the Dawn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{W}{W}{W}"))); + } + + public MalachOfTheDawn(final MalachOfTheDawn card) { + super(card); + } + + @Override + public MalachOfTheDawn copy() { + return new MalachOfTheDawn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/Melancholy.java b/Mage.Sets/src/mage/sets/planarchaos/Melancholy.java new file mode 100644 index 00000000000..9a5c7cc3e63 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/Melancholy.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.effects.common.TapEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; +/** + * + * @author LoneFox + */ +public class Melancholy extends CardImpl { + + public Melancholy(UUID ownerId) { + super(ownerId, 88, "Melancholy", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // When Melancholy enters the battlefield, tap enchanted creature. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TapEnchantedEffect())); + // Enchanted creature doesn't untap during its controller's untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect())); + // At the beginning of your upkeep, sacrifice Melancholy unless you pay {B}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{B}")), + TargetController.YOU, false)); + } + + public Melancholy(final Melancholy card) { + super(card); + } + + @Override + public Melancholy copy() { + return new Melancholy(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/MerfolkThaumaturgist.java b/Mage.Sets/src/mage/sets/planarchaos/MerfolkThaumaturgist.java new file mode 100644 index 00000000000..849ade5be0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/MerfolkThaumaturgist.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.SwitchPowerToughnessTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class MerfolkThaumaturgist extends CardImpl { + + public MerfolkThaumaturgist(UUID ownerId) { + super(ownerId, 56, "Merfolk Thaumaturgist", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Merfolk"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {tap}: Switch target creature's power and toughness until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SwitchPowerToughnessTargetEffect(Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public MerfolkThaumaturgist(final MerfolkThaumaturgist card) { + super(card); + } + + @Override + public MerfolkThaumaturgist copy() { + return new MerfolkThaumaturgist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/MidnightCharm.java b/Mage.Sets/src/mage/sets/planarchaos/MidnightCharm.java new file mode 100644 index 00000000000..3e280291816 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/MidnightCharm.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MidnightCharm extends CardImpl { + + public MidnightCharm(UUID ownerId) { + super(ownerId, 74, "Midnight Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "PLC"; + + // Choose one - Midnight Charm deals 1 damage to target creature and you gain 1 life; or target creature gains first strike until end of turn; or tap target creature. + this.getSpellAbility().addEffect(new DamageTargetEffect(1)); + this.getSpellAbility().addEffect(new GainLifeEffect(1)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + Mode mode = new Mode(); + mode.getEffects().add(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode); + mode = new Mode(); + mode.getEffects().add(new TapTargetEffect()); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode); + } + + public MidnightCharm(final MidnightCharm card) { + super(card); + } + + @Override + public MidnightCharm copy() { + return new MidnightCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/Mycologist.java b/Mage.Sets/src/mage/sets/planarchaos/Mycologist.java new file mode 100644 index 00000000000..8c1d968b68c --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/Mycologist.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.SaprolingToken; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class Mycologist extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Saproling"); + + static { + filter.add(new SubtypePredicate("Saproling")); + } + + public Mycologist(UUID ownerId) { + super(ownerId, 27, "Mycologist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Human"); + this.subtype.add("Druid"); + this.power = new MageInt(0); + this.toughness = new MageInt(2); + + // At the beginning of your upkeep, put a spore counter on Mycologist. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.SPORE.createInstance()), TargetController.YOU, false)); + // Remove three spore counters from Mycologist: Put a 1/1 green Saproling creature token onto the battlefield. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SaprolingToken()), new RemoveCountersSourceCost(CounterType.SPORE.createInstance(3)))); + // Sacrifice a Saproling: You gain 2 life. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), + new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, false)))); + } + + public Mycologist(final Mycologist card) { + super(card); + } + + @Override + public Mycologist copy() { + return new Mycologist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/Ovinize.java b/Mage.Sets/src/mage/sets/planarchaos/Ovinize.java index 01a618d528e..416f27cba60 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/Ovinize.java +++ b/Mage.Sets/src/mage/sets/planarchaos/Ovinize.java @@ -28,6 +28,7 @@ package mage.sets.planarchaos; import java.util.UUID; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; import mage.cards.CardImpl; @@ -50,7 +51,9 @@ public class Ovinize extends CardImpl { // Target creature loses all abilities and becomes 0/1 until end of turn. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn)); + Effect effect = new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn); + effect.setText("and has base power and toughness 0/1"); + this.getSpellAbility().addEffect(effect); } public Ovinize(final Ovinize card) { diff --git a/Mage.Sets/src/mage/sets/planarchaos/PallidMycoderm.java b/Mage.Sets/src/mage/sets/planarchaos/PallidMycoderm.java index 8ed3c7192a6..1052c0548bf 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/PallidMycoderm.java +++ b/Mage.Sets/src/mage/sets/planarchaos/PallidMycoderm.java @@ -59,7 +59,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class PallidMycoderm extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Each creature you control that's a Fungus or a Saproling"); - private static final FilterControlledCreaturePermanent filterSaproling = new FilterControlledCreaturePermanent("Saproling"); + private static final FilterControlledCreaturePermanent filterSaproling = new FilterControlledCreaturePermanent("a Saproling"); static { filter.add(new ControllerPredicate(TargetController.YOU)); filter.add(Predicates.or(new SubtypePredicate("Fungus"), new SubtypePredicate("Saproling"))); @@ -79,10 +79,9 @@ public class PallidMycoderm extends CardImpl { // Remove three spore counters from Pallid Mycoderm: Put a 1/1 green Saproling creature token onto the battlefield. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SaprolingToken()), new RemoveCountersSourceCost(CounterType.SPORE.createInstance(3)))); // Sacrifice a Saproling: Each creature you control that's a Fungus or a Saproling gets +1/+1 until end of turn. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new BoostAllEffect(1,1,Duration.EndOfTurn, filter, false), + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BoostAllEffect(1,1,Duration.EndOfTurn, filter, false), new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1,filterSaproling, false)))); - } public PallidMycoderm(final PallidMycoderm card) { diff --git a/Mage.Sets/src/mage/sets/planarchaos/Phantasmagorian.java b/Mage.Sets/src/mage/sets/planarchaos/Phantasmagorian.java index e8e99f9eb63..31778c36699 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/Phantasmagorian.java +++ b/Mage.Sets/src/mage/sets/planarchaos/Phantasmagorian.java @@ -29,6 +29,7 @@ package mage.sets.planarchaos; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.common.SimpleActivatedAbility; @@ -44,7 +45,6 @@ import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; import mage.game.stack.Spell; -import mage.game.stack.StackObject; import mage.players.Player; import mage.target.common.TargetCardInHand; @@ -81,7 +81,7 @@ public class Phantasmagorian extends CardImpl { class CounterSourceEffect extends OneShotEffect { public CounterSourceEffect() { - super(Outcome.Detriment); + super(Outcome.AIDontUseIt); } public CounterSourceEffect(final CounterSourceEffect effect) { @@ -95,22 +95,20 @@ class CounterSourceEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - - StackObject spell = null; - for(StackObject objet : game.getStack()){ - if(objet instanceof Spell && objet.getSourceId().equals(source.getSourceId())){ - spell = objet; - } - } - if(spell != null){ - for(UUID uuid : game.getPlayerList()){ - Player player = game.getPlayer(uuid); - if(player.chooseUse(Outcome.Detriment, "Discard three cards to counter " + spell.getName() + "?", source, game)){ - DiscardTargetCost cost = new DiscardTargetCost(new TargetCardInHand(3, 3, new FilterCard())); - if(cost.pay(source, game, source.getSourceId(), uuid, false)){ - game.informPlayers(player.getLogName() + " discards 3 cards to counter " + spell.getName() + "."); - game.getStack().counter(spell.getId(), source.getSourceId(), game); - return true; + MageObject sourceObject = source.getSourceObject(game); + if (sourceObject != null) { + DiscardTargetCost cost = new DiscardTargetCost(new TargetCardInHand(3, 3, new FilterCard())); + for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) { + Player player = game.getPlayer(playerId); + cost.clearPaid(); + if (cost.canPay(source, source.getSourceId(), player.getId(), game) + && player.chooseUse(outcome, "Discard three cards to counter " + sourceObject.getIdName() + "?", source, game)) { + if (cost.pay(source, game, source.getSourceId(), playerId, false)) { + game.informPlayers(player.getLogName() + " discards 3 cards to counter " + sourceObject.getIdName() + "."); + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + game.getStack().counter(spell.getId(), source.getSourceId(), game); + } } } } diff --git a/Mage.Sets/src/mage/sets/planarchaos/PsychotropeThallid.java b/Mage.Sets/src/mage/sets/planarchaos/PsychotropeThallid.java index 19002bc5507..7e5babcf3a2 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/PsychotropeThallid.java +++ b/Mage.Sets/src/mage/sets/planarchaos/PsychotropeThallid.java @@ -54,8 +54,8 @@ import mage.target.common.TargetControlledCreaturePermanent; * @author fireshoes */ public class PsychotropeThallid extends CardImpl { - - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Saproling"); + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Saproling"); static { filter.add(new SubtypePredicate("Saproling")); } @@ -71,11 +71,11 @@ public class PsychotropeThallid extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.SPORE.createInstance()), TargetController.YOU, false)); // Remove three spore counters from Psychotrope Thallid: Put a 1/1 green Saproling creature token onto the battlefield. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new CreateTokenEffect(new SaprolingToken()), + new CreateTokenEffect(new SaprolingToken()), new RemoveCountersSourceCost(CounterType.SPORE.createInstance(3)))); // {1}, Sacrifice a Saproling: Draw a card. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new DrawCardSourceControllerEffect(1), + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new DrawCardSourceControllerEffect(1), new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1, filter, false))); ability.addCost(new GenericManaCost(1)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/planarchaos/RealityAcid.java b/Mage.Sets/src/mage/sets/planarchaos/RealityAcid.java index 4357565e296..ac39868c19b 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/RealityAcid.java +++ b/Mage.Sets/src/mage/sets/planarchaos/RealityAcid.java @@ -69,13 +69,14 @@ public class RealityAcid extends CardImpl { this.addAbility(ability); // Vanishing 3 - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)))); + ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3))); + ability.setRuleVisible(false); + this.addAbility(ability); this.addAbility(new VanishingUpkeepAbility(3)); this.addAbility(new VanishingSacrificeAbility()); // When Reality Acid leaves the battlefield, enchanted permanent's controller sacrifices it. - Effect effect = new SacrificeTargetEffect(); - effect.setText("enchanted permanent's controller sacrifices it"); + Effect effect = new SacrificeTargetEffect("enchanted permanent's controller sacrifices it"); this.addAbility(new RealityAcidTriggeredAbility(effect, false)); } diff --git a/Mage.Sets/src/mage/sets/planarchaos/RebuffTheWicked.java b/Mage.Sets/src/mage/sets/planarchaos/RebuffTheWicked.java new file mode 100644 index 00000000000..cf3e1780ce9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/RebuffTheWicked.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.other.TargetsPermanentPredicate; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + */ +public class RebuffTheWicked extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("spell that targets a permanent you control"); + + static { + filter.add(new TargetsPermanentPredicate(new FilterControlledPermanent())); + } + + public RebuffTheWicked(UUID ownerId) { + super(ownerId, 12, "Rebuff the Wicked", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "PLC"; + + // Counter target spell that targets a permanent you control. + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + } + + public RebuffTheWicked(final RebuffTheWicked card) { + super(card); + } + + @Override + public RebuffTheWicked copy() { + return new RebuffTheWicked(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/ReveredDead.java b/Mage.Sets/src/mage/sets/planarchaos/ReveredDead.java new file mode 100644 index 00000000000..18abc745114 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/ReveredDead.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class ReveredDead extends CardImpl { + + public ReveredDead(UUID ownerId) { + super(ownerId, 29, "Revered Dead", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Spirit"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {W}: Regenerate Revered Dead. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{W}"))); + } + + public ReveredDead(final ReveredDead card) { + super(card); + } + + @Override + public ReveredDead copy() { + return new ReveredDead(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/RidgedKusite.java b/Mage.Sets/src/mage/sets/planarchaos/RidgedKusite.java new file mode 100644 index 00000000000..87ab8078e8e --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/RidgedKusite.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class RidgedKusite extends CardImpl { + + public RidgedKusite(UUID ownerId) { + super(ownerId, 78, "Ridged Kusite", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Horror"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{B}, {tap}, Discard a card: Target creature gets +1/+0 and gains first strike until end of turn. + Effect effect = new BoostTargetEffect(1, 0, Duration.EndOfTurn); + effect.setText("Target creature gets +1/+0"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}")); + effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains first strike until end of turn"); + ability.addEffect(effect); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public RidgedKusite(final RidgedKusite card) { + super(card); + } + + @Override + public RidgedKusite copy() { + return new RidgedKusite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/RiptidePilferer.java b/Mage.Sets/src/mage/sets/planarchaos/RiptidePilferer.java new file mode 100644 index 00000000000..dbb0b57f71c --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/RiptidePilferer.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class RiptidePilferer extends CardImpl { + + public RiptidePilferer(UUID ownerId) { + super(ownerId, 60, "Riptide Pilferer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Merfolk"); + this.subtype.add("Rogue"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Riptide Pilferer deals combat damage to a player, that player discards a card. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1), false, true)); // Morph {U} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{U}"))); + } + + public RiptidePilferer(final RiptidePilferer card) { + super(card); + } + + @Override + public RiptidePilferer copy() { + return new RiptidePilferer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/SerendibSorcerer.java b/Mage.Sets/src/mage/sets/planarchaos/SerendibSorcerer.java new file mode 100644 index 00000000000..acc479365bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/SerendibSorcerer.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SerendibSorcerer extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target creature other than {this}"); + + static { + filter.add(new AnotherPredicate()); + } + + public SerendibSorcerer(UUID ownerId) { + super(ownerId, 61, "Serendib Sorcerer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Target creature other than Serendib Sorcerer becomes 0/2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetPowerToughnessTargetEffect(0, 2, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public SerendibSorcerer(final SerendibSorcerer card) { + super(card); + } + + @Override + public SerendibSorcerer copy() { + return new SerendibSorcerer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/ShroudedLore.java b/Mage.Sets/src/mage/sets/planarchaos/ShroudedLore.java new file mode 100644 index 00000000000..a9ffdeab0bc --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/ShroudedLore.java @@ -0,0 +1,141 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardIdPredicate; +import mage.filter.predicate.other.OwnerIdPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetOpponent; + +/** + * + * @author LoneFox + */ +public class ShroudedLore extends CardImpl { + + public ShroudedLore(UUID ownerId) { + super(ownerId, 91, "Shrouded Lore", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{B}"); + this.expansionSetCode = "PLC"; + + // Target opponent chooses a card in your graveyard. You may pay {B}. If you do, repeat this process except that opponent can't choose a card already chosen for Shrouded Lore. Then put the last chosen card into your hand. + this.getSpellAbility().addEffect(new ShroudedLoreEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public ShroudedLore(final ShroudedLore card) { + super(card); + } + + @Override + public ShroudedLore copy() { + return new ShroudedLore(this); + } +} + +class ShroudedLoreEffect extends OneShotEffect { + + public ShroudedLoreEffect() { + super(Outcome.Benefit); + staticText = "Target opponent chooses a card in your graveyard. You may pay {B}. If you do, repeat this process except that opponent can't choose a card already chosen for {this}. Then put the last chosen card into your hand."; + } + + public ShroudedLoreEffect(final ShroudedLoreEffect effect) { + super(effect); + } + + @Override + public ShroudedLoreEffect copy() { + return new ShroudedLoreEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player you = game.getPlayer(source.getControllerId()); + Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); + if(you != null && opponent != null) + { + FilterCard filter = new FilterCard(); + filter.add(new OwnerIdPredicate(you.getId())); + Cost cost = new ManaCostsImpl("{B}"); + TargetCardInGraveyard chosenCard; + Card card = null; + boolean done = false; + do { + chosenCard = new TargetCardInGraveyard(filter); + chosenCard.setNotTarget(true); + if(chosenCard.canChoose(opponent.getId(), game)) { + opponent.chooseTarget(Outcome.ReturnToHand, chosenCard, source, game); + card = game.getCard(chosenCard.getFirstTarget()); + filter.add(Predicates.not(new CardIdPredicate(card.getId()))); + game.informPlayers("Shrouded Lore: " + opponent.getLogName() + " has chosen " + card.getLogName()); + } + else { + done = true; + } + + if(!done) { + if(cost.canPay(source, source.getSourceId(), you.getId(), game) && you.chooseUse(Outcome.Benefit, "Pay {B} to choose a different card ?", source, game)) { + cost.clearPaid(); + if(!cost.pay(source, game, source.getSourceId(), you.getId(), false)) { + done = true; + } + } + else { + done = true; + } + } + + } while(!done); + + if(card != null) { + Cards cardsToHand = new CardsImpl(); + cardsToHand.add(card); + you.moveCards(cardsToHand, Zone.GRAVEYARD, Zone.HAND, source, game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/SophicCentaur.java b/Mage.Sets/src/mage/sets/planarchaos/SophicCentaur.java new file mode 100644 index 00000000000..82a85a27141 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/SophicCentaur.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.MultipliedValue; +import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class SophicCentaur extends CardImpl { + + public SophicCentaur(UUID ownerId) { + super(ownerId, 139, "Sophic Centaur", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Centaur"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {2}{G}{G}, {tap}, Discard a card: You gain 2 life for each card in your hand. + DynamicValue lifeToGainAmount = new MultipliedValue(new CardsInControllerHandCount(), 2); + Effect effect = new GainLifeEffect(lifeToGainAmount); + effect.setText("You gain 2 life for each card in your hand"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{G}{G}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public SophicCentaur(final SophicCentaur card) { + super(card); + } + + @Override + public SophicCentaur copy() { + return new SophicCentaur(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/TemporalExtortion.java b/Mage.Sets/src/mage/sets/planarchaos/TemporalExtortion.java new file mode 100644 index 00000000000..c1a25134a5a --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/TemporalExtortion.java @@ -0,0 +1,108 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class TemporalExtortion extends CardImpl { + + public TemporalExtortion(UUID ownerId) { + super(ownerId, 81, "Temporal Extortion", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{B}{B}{B}{B}"); + this.expansionSetCode = "PLC"; + + // When you cast Temporal Extortion, any player may pay half his or her life, rounded up. If a player does, counter Temporal Extortion. + this.addAbility(new CastSourceTriggeredAbility(new TemporalExtortionCounterSourceEffect())); + + // Take an extra turn after this one. + this.getSpellAbility().addEffect(new AddExtraTurnControllerEffect()); + } + + public TemporalExtortion(final TemporalExtortion card) { + super(card); + } + + @Override + public TemporalExtortion copy() { + return new TemporalExtortion(this); + } +} + +class TemporalExtortionCounterSourceEffect extends OneShotEffect { + + public TemporalExtortionCounterSourceEffect() { + super(Outcome.AIDontUseIt); + staticText = "any player may pay half his or her life, rounded up. If a player does, counter {source}"; + } + + public TemporalExtortionCounterSourceEffect(final TemporalExtortionCounterSourceEffect effect) { + super(effect); + } + + @Override + public TemporalExtortionCounterSourceEffect copy() { + return new TemporalExtortionCounterSourceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = source.getSourceObject(game); + if (sourceObject != null) { + for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) { + Player player = game.getPlayer(playerId); + if (player.chooseUse(outcome, "Pay half your life, rounded up to counter " + sourceObject.getIdName() + "?", source, game)) { + Integer amount = (int) Math.ceil(player.getLife() / 2f); + player.loseLife(amount, game); + game.informPlayers(player.getLogName() + " pays half his or her life, rounded up to counter " + sourceObject.getIdName() + "."); + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + game.getStack().counter(spell.getId(), source.getSourceId(), game); + } + } + } + return true; + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/Tidewalker.java b/Mage.Sets/src/mage/sets/planarchaos/Tidewalker.java new file mode 100644 index 00000000000..3c55beed826 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/Tidewalker.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.VanishingSacrificeAbility; +import mage.abilities.keyword.VanishingUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class Tidewalker extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Island you control"); + + static { + filter.add(new SubtypePredicate("Island")); + } + + public Tidewalker(UUID ownerId) { + super(ownerId, 49, "Tidewalker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Elemental"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Tidewalker enters the battlefield with a time counter on it for each Island you control. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(0), new PermanentsOnBattlefieldCount(filter), true), "with a time counter on it for each Island you control")); + // Vanishing + this.addAbility(new VanishingUpkeepAbility(0)); + this.addAbility(new VanishingSacrificeAbility()); + // Tidewalker's power and toughness are each equal to the number of time counters on it. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CountersCount(CounterType.TIME), Duration.EndOfGame))); + } + + public Tidewalker(final Tidewalker card) { + super(card); + } + + @Override + public Tidewalker copy() { + return new Tidewalker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/Timbermare.java b/Mage.Sets/src/mage/sets/planarchaos/Timbermare.java new file mode 100644 index 00000000000..3a3c321c9b1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/Timbermare.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.TapAllEffect; +import mage.abilities.keyword.EchoAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LoneFox + */ +public class Timbermare extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("other creatures"); + + static { + filter.add(new AnotherPredicate()); + } + + public Timbermare(UUID ownerId) { + super(ownerId, 140, "Timbermare", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Elemental"); + this.subtype.add("Horse"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // Echo {5}{G} + this.addAbility(new EchoAbility("{5}{G}")); + // When Timbermare enters the battlefield, tap all other creatures. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TapAllEffect(filter))); + } + + public Timbermare(final Timbermare card) { + super(card); + } + + @Override + public Timbermare copy() { + return new Timbermare(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/UktabiDrake.java b/Mage.Sets/src/mage/sets/planarchaos/UktabiDrake.java new file mode 100644 index 00000000000..cd638634faf --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/UktabiDrake.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.EchoAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class UktabiDrake extends CardImpl { + + public UktabiDrake(UUID ownerId) { + super(ownerId, 141, "Uktabi Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Drake"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Haste + this.addAbility(HasteAbility.getInstance()); + // Echo {1}{G}{G} + this.addAbility(new EchoAbility("{1}{G}{G}")); + } + + public UktabiDrake(final UktabiDrake card) { + super(card); + } + + @Override + public UktabiDrake copy() { + return new UktabiDrake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/VitasporeThallid.java b/Mage.Sets/src/mage/sets/planarchaos/VitasporeThallid.java index c9ea1e225fd..0e7d29b505c 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/VitasporeThallid.java +++ b/Mage.Sets/src/mage/sets/planarchaos/VitasporeThallid.java @@ -56,8 +56,8 @@ import mage.target.common.TargetCreaturePermanent; * @author fireshoes */ public class VitasporeThallid extends CardImpl { - - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Saproling"); + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Saproling"); static { filter.add(new SubtypePredicate("Saproling")); } @@ -73,11 +73,11 @@ public class VitasporeThallid extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.SPORE.createInstance()), TargetController.YOU, false)); // Remove three spore counters from Vitaspore Thallid: Put a 1/1 green Saproling creature token onto the battlefield. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new CreateTokenEffect(new SaprolingToken()), + new CreateTokenEffect(new SaprolingToken()), new RemoveCountersSourceCost(CounterType.SPORE.createInstance(3)))); // Sacrifice a Saproling: Target creature gains haste until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1, filter, false))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/planarchaos/VoidstoneGargoyle.java b/Mage.Sets/src/mage/sets/planarchaos/VoidstoneGargoyle.java index 76bc947d8e7..92ebfdb6731 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/VoidstoneGargoyle.java +++ b/Mage.Sets/src/mage/sets/planarchaos/VoidstoneGargoyle.java @@ -28,8 +28,6 @@ package mage.sets.planarchaos; import java.util.UUID; - -import mage.constants.*; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -37,11 +35,17 @@ import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.NameACardEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.repository.CardRepository; import mage.choices.Choice; import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -66,7 +70,7 @@ public class VoidstoneGargoyle extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // As Voidstone Gargoyle enters the battlefield, name a nonland card. - this.addAbility(new AsEntersBattlefieldAbility(new VoidstoneGargoyleChooseCardEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME))); // The named card can't be cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new VoidstoneGargoyleReplacementEffect1())); // Activated abilities of sources with the chosen name can't be activated. @@ -97,7 +101,7 @@ class VoidstoneGargoyleChooseCardEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (controller != null && permanent != null) { Choice cardChoice = new ChoiceImpl(); cardChoice.setChoices(CardRepository.instance.getNonLandNames()); @@ -110,9 +114,9 @@ class VoidstoneGargoyleChooseCardEffect extends OneShotEffect { String cardName = cardChoice.getChoice(); game.informPlayers(permanent.getLogName() + ", named card: [" + cardName + "]"); game.getState().setValue(source.getSourceId().toString(), cardName); - permanent.addInfo("named card", CardUtil.addToolTipMarkTags("Named card: [" + cardName +"]"), game); + permanent.addInfo("named card", CardUtil.addToolTipMarkTags("Named card: [" + cardName + "]"), game); return true; - } + } return false; } @@ -148,7 +152,7 @@ class VoidstoneGargoyleReplacementEffect1 extends ContinuousRuleModifyingEffectI public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't cast a card with that name (" + mageObject.getLogName() + ")."; + return "You can't cast a card with that name (" + mageObject.getIdName() + ")."; } return null; } @@ -157,7 +161,8 @@ class VoidstoneGargoyleReplacementEffect1 extends ContinuousRuleModifyingEffectI public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.CAST_SPELL) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString()))) { + if (object != null + && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { return true; } } @@ -200,7 +205,7 @@ class VoidstoneGargoyleRuleModifyingEffect2 extends ContinuousRuleModifyingEffec public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == EventType.ACTIVATE_ABILITY) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString()))) { + if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { return true; } } diff --git a/Mage.Sets/src/mage/sets/planarchaos/WaningWurm.java b/Mage.Sets/src/mage/sets/planarchaos/WaningWurm.java new file mode 100644 index 00000000000..7a37457f8dd --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/WaningWurm.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.VanishingSacrificeAbility; +import mage.abilities.keyword.VanishingUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + */ +public class WaningWurm extends CardImpl { + + public WaningWurm(UUID ownerId) { + super(ownerId, 83, "Waning Wurm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Zombie"); + this.subtype.add("Wurm"); + this.power = new MageInt(7); + this.toughness = new MageInt(6); + + // Vanishing 2 + Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2))); + ability.setRuleVisible(false); + this.addAbility(ability); + this.addAbility(new VanishingUpkeepAbility(2)); + this.addAbility(new VanishingSacrificeAbility()); + } + + public WaningWurm(final WaningWurm card) { + super(card); + } + + @Override + public WaningWurm copy() { + return new WaningWurm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/WistfulThinking.java b/Mage.Sets/src/mage/sets/planarchaos/WistfulThinking.java index 021d6e01b3a..b662e319be5 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/WistfulThinking.java +++ b/Mage.Sets/src/mage/sets/planarchaos/WistfulThinking.java @@ -28,6 +28,7 @@ package mage.sets.planarchaos; import java.util.UUID; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.cards.CardImpl; @@ -44,12 +45,12 @@ public class WistfulThinking extends CardImpl { public WistfulThinking(UUID ownerId) { super(ownerId, 53, "Wistful Thinking", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); this.expansionSetCode = "PLC"; - - // Target player draws two cards, then discards four cards. this.getSpellAbility().addEffect(new DrawCardTargetEffect(2)); - this.getSpellAbility().addEffect(new DiscardTargetEffect(4)); + Effect effect = new DiscardTargetEffect(4); + effect.setText(", then discards four cards"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/sets/planechase/BogardanFirefiend.java b/Mage.Sets/src/mage/sets/planechase/BogardanFirefiend.java index 0b4a65412d6..4a454f826db 100644 --- a/Mage.Sets/src/mage/sets/planechase/BogardanFirefiend.java +++ b/Mage.Sets/src/mage/sets/planechase/BogardanFirefiend.java @@ -35,7 +35,7 @@ import mage.abilities.Ability; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.target.common.TargetCreatureOrPlayer; +import mage.target.common.TargetCreaturePermanent; /** * @@ -52,7 +52,7 @@ public class BogardanFirefiend extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); Ability ability = new DiesTriggeredAbility(new DamageTargetEffect(2), false); - ability.addTarget(new TargetCreatureOrPlayer()); + ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java b/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java index 769221d7eb9..34c051fa009 100644 --- a/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java +++ b/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java @@ -29,24 +29,20 @@ package mage.sets.planechase; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.Cost; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.constants.Outcome; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; +import mage.filter.common.FilterControlledArtifactPermanent; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -55,13 +51,7 @@ import mage.target.common.TargetCreatureOrPlayer; * @author jeffwadsworth */ public class BoshIronGolem extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact"); - - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - + public BoshIronGolem(UUID ownerId) { super(ownerId, 108, "Bosh, Iron Golem", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{8}"); this.expansionSetCode = "HOP"; @@ -73,10 +63,12 @@ public class BoshIronGolem extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); - + // {3}{R}, Sacrifice an artifact: Bosh, Iron Golem deals damage equal to the sacrificed artifact's converted mana cost to target creature or player. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoshIronGolemEffect(), new ManaCostsImpl("{3}{R}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + Effect effect = new DamageTargetEffect(new SacrificeCostConvertedMana("artifact")); + effect.setText("{this} deals damage equal to the sacrificed artifact's converted mana cost to target creature or player"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{3}{R}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact")))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } @@ -90,45 +82,3 @@ public class BoshIronGolem extends CardImpl { return new BoshIronGolem(this); } } - -class BoshIronGolemEffect extends OneShotEffect { - - public BoshIronGolemEffect() { - super(Outcome.Damage); - staticText = "{this} deals damage equal to the sacrificed artifact's converted mana cost to target creature or player"; - } - - public BoshIronGolemEffect(final BoshIronGolemEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - int amount = 0; - for (Cost cost: source.getCosts()) { - if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost)cost).getPermanents().size() > 0) { - amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getManaCost().convertedManaCost(); - break; - } - } - if (amount > 0) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.damage(amount, source.getSourceId(), game, false, true); - return true; - } - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.damage(amount, source.getSourceId(), game, false, true); - return true; - } - } - return false; - } - - @Override - public BoshIronGolemEffect copy() { - return new BoshIronGolemEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/planechase/ForgottenAncient.java b/Mage.Sets/src/mage/sets/planechase/ForgottenAncient.java new file mode 100644 index 00000000000..e8b9b7dfc5c --- /dev/null +++ b/Mage.Sets/src/mage/sets/planechase/ForgottenAncient.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planechase; + +import java.util.UUID; + +/** + * + * @author Blinke + */ +public class ForgottenAncient extends mage.sets.scourge.ForgottenAncient { + + public ForgottenAncient(UUID ownerId) { + super(ownerId); + this.cardNumber = 73; + this.expansionSetCode = "HOP"; + } + + public ForgottenAncient(final ForgottenAncient card) { + super(card); + } + + @Override + public ForgottenAncient copy() { + return new ForgottenAncient(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planechase/IvyElemental.java b/Mage.Sets/src/mage/sets/planechase/IvyElemental.java index 2895430d7d8..acda1a8a755 100644 --- a/Mage.Sets/src/mage/sets/planechase/IvyElemental.java +++ b/Mage.Sets/src/mage/sets/planechase/IvyElemental.java @@ -29,20 +29,12 @@ package mage.sets.planechase; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.dynamicvalue.common.ManacostVariableValue; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -59,7 +51,7 @@ public class IvyElemental extends CardImpl { this.toughness = new MageInt(0); // Ivy Elemental enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new IvyElementalEntersBattlefieldEffect() ,"with X +1/+1 counters on it")); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); } public IvyElemental(final IvyElemental card) { @@ -71,41 +63,3 @@ public class IvyElemental extends CardImpl { return new IvyElemental(this); } } - -class IvyElementalEntersBattlefieldEffect extends OneShotEffect { - - public IvyElementalEntersBattlefieldEffect() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - public IvyElementalEntersBattlefieldEffect(final IvyElementalEntersBattlefieldEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - SpellAbility spellAbility = (SpellAbility) obj; - if (spellAbility.getSourceId().equals(source.getSourceId())) { // put into play by normal cast - int amount = spellAbility.getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - } - return true; - } - - @Override - public IvyElementalEntersBattlefieldEffect copy() { - return new IvyElementalEntersBattlefieldEffect(this); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/planechase/LoxodonWarhammer.java b/Mage.Sets/src/mage/sets/planechase/LoxodonWarhammer.java index 8b84efc9598..c6a48c99003 100644 --- a/Mage.Sets/src/mage/sets/planechase/LoxodonWarhammer.java +++ b/Mage.Sets/src/mage/sets/planechase/LoxodonWarhammer.java @@ -60,7 +60,7 @@ public class LoxodonWarhammer extends CardImpl { effect.setText("and has trample"); ability.addEffect(effect); effect = new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), AttachmentType.EQUIPMENT); - effect.setText("and lifelink. (If the creature would assign enough damage to its blockers to destroy them, you may have it assign the rest of its damage to defending player or planeswalker. Damage dealt by the creature also causes its controller to gain that much life.)"); + effect.setText("and lifelink. (If the creature would assign enough damage to its blockers to destroy them, you may have it assign the rest of its damage to defending player or planeswalker. Damage dealt by the creature also causes its controller to gain that much life.)"); ability.addEffect(effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/planechase/RaziaBorosArchangel.java b/Mage.Sets/src/mage/sets/planechase/RaziaBorosArchangel.java index 720d19460c3..be5502dbe76 100644 --- a/Mage.Sets/src/mage/sets/planechase/RaziaBorosArchangel.java +++ b/Mage.Sets/src/mage/sets/planechase/RaziaBorosArchangel.java @@ -29,11 +29,12 @@ package mage.sets.planechase; import java.util.UUID; import mage.MageInt; +import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.Effect; -import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.RedirectionEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.VigilanceAbility; @@ -42,9 +43,11 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AnotherTargetPredicate; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; +import mage.target.Target; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -72,11 +75,18 @@ public class RaziaBorosArchangel extends CardImpl { // Haste this.addAbility(HasteAbility.getInstance()); - // {tap}: The next 3 damage that would be dealt to target creature you control this turn is dealt to another target creature instead. + // {T}: The next 3 damage that would be dealt to target creature you control this turn is dealt to another target creature instead. Effect effect = new RaziaBorosArchangelEffect(Duration.EndOfTurn, 3); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); - ability.addTarget(new TargetControlledCreaturePermanent()); - ability.addTarget(new TargetCreaturePermanent()); + Target target = new TargetControlledCreaturePermanent(); + target.setTargetTag(1); + ability.addTarget(target); + + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature (damage is redirected to)"); + filter.add(new AnotherTargetPredicate(2)); + target = new TargetCreaturePermanent(filter); + target.setTargetTag(2); + ability.addTarget(target); this.addAbility(ability); } @@ -91,19 +101,17 @@ public class RaziaBorosArchangel extends CardImpl { } } -class RaziaBorosArchangelEffect extends PreventionEffectImpl { +class RaziaBorosArchangelEffect extends RedirectionEffect { - private int amount; + protected MageObjectReference redirectToObject; public RaziaBorosArchangelEffect(Duration duration, int amount) { - super(duration); - this.amount = amount; + super(duration, 3, true); staticText = "The next " + amount + " damage that would be dealt to target creature you control this turn is dealt to another target creature instead"; } public RaziaBorosArchangelEffect(final RaziaBorosArchangelEffect effect) { super(effect); - this.amount = effect.amount; } @Override @@ -117,42 +125,16 @@ class RaziaBorosArchangelEffect extends PreventionEffectImpl { } @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), event.getAmount(), false); - if (!game.replaceEvent(preventEvent)) { - int prevented; - if (event.getAmount() >= this.amount) { - int damage = amount; - event.setAmount(event.getAmount() - amount); - this.used = true; - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage)); - prevented = damage; - } else { - int damage = event.getAmount(); - event.setAmount(0); - amount -= damage; - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage)); - prevented = damage; - } - - // deal damage now - if (prevented > 0) { - UUID redirectTo = source.getTargets().get(1).getFirstTarget(); - Permanent permanent = game.getPermanent(redirectTo); - if (permanent != null) { - game.informPlayers("Dealing " + prevented + " to " + permanent.getName() + " instead"); - // keep the original source id as it is redirecting - permanent.damage(prevented, event.getSourceId(), game, false, true); - } - } - } - return false; + public void init(Ability source, Game game) { + super.init(source, game); + redirectToObject = new MageObjectReference(source.getTargets().get(1).getFirstTarget(), game); } @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (!this.used && super.applies(event, source, game)) { - if (source.getTargets().getFirstTarget().equals(event.getTargetId())) { + if (event.getTargetId().equals(getTargetPointer().getFirst(game, source))) { + if (redirectToObject.equals(new MageObjectReference(source.getTargets().get(1).getFirstTarget(), game))) { + redirectTarget = source.getTargets().get(1); return true; } } diff --git a/Mage.Sets/src/mage/sets/planechase/SilverMyr.java b/Mage.Sets/src/mage/sets/planechase/SilverMyr.java index 97f6440f77c..84d30675695 100644 --- a/Mage.Sets/src/mage/sets/planechase/SilverMyr.java +++ b/Mage.Sets/src/mage/sets/planechase/SilverMyr.java @@ -40,7 +40,6 @@ public class SilverMyr extends mage.sets.mirrodin.SilverMyr { super(ownerId); this.cardNumber = 126; this.expansionSetCode = "HOP"; - this.subtype.add("Myr"); } public SilverMyr (final SilverMyr card) { diff --git a/Mage.Sets/src/mage/sets/planechase2012/ErraticExplosion.java b/Mage.Sets/src/mage/sets/planechase2012/ErraticExplosion.java new file mode 100644 index 00000000000..3495a42414b --- /dev/null +++ b/Mage.Sets/src/mage/sets/planechase2012/ErraticExplosion.java @@ -0,0 +1,122 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planechase2012; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author nigelzor + */ +public class ErraticExplosion extends CardImpl { + + public ErraticExplosion(UUID ownerId) { + super(ownerId, 41, "Erratic Explosion", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{R}"); + this.expansionSetCode = "PC2"; + + // Choose target creature or player. Reveal cards from the top of your library until you reveal a nonland card. Erratic Explosion deals damage equal to that card's converted mana cost to that creature or player. Put the revealed cards on the bottom of your library in any order. + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(new ErraticExplosionEffect()); + } + + public ErraticExplosion(final ErraticExplosion card) { + super(card); + } + + @Override + public ErraticExplosion copy() { + return new ErraticExplosion(this); + } +} + +class ErraticExplosionEffect extends OneShotEffect { + + public ErraticExplosionEffect() { + super(Outcome.Damage); + this.staticText = "Choose target creature or player. Reveal cards from the top of your library until you reveal a nonland card. {this} deals damage equal to that card's converted mana cost to that creature or player. Put the revealed cards on the bottom of your library in any order"; + } + + public ErraticExplosionEffect(ErraticExplosionEffect effect) { + super(effect); + } + + @Override + public ErraticExplosionEffect copy() { + return new ErraticExplosionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + CardsImpl toReveal = new CardsImpl(); + Card nonLandCard = null; + + while (nonLandCard == null && controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().removeFromTop(game); + toReveal.add(card); + if (!card.getCardType().contains(CardType.LAND)) { + nonLandCard = card; + } + } + // reveal cards + if (!toReveal.isEmpty()) { + controller.revealCards(sourceObject.getIdName(), toReveal, game); + } + // the nonland card + if (nonLandCard != null) { + Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); + if (targetCreature != null) { + targetCreature.damage(nonLandCard.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); + } else { + Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source)); + if (targetPlayer != null) { + targetPlayer.damage(nonLandCard.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); + } + } + } + // put the cards on the bottom of the library in any order + return controller.putCardsOnBottomOfLibrary(toReveal, game, source, true); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/planechase2012/IllusoryAngel.java b/Mage.Sets/src/mage/sets/planechase2012/IllusoryAngel.java index 81f8242dc1e..b7038bd470f 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/IllusoryAngel.java +++ b/Mage.Sets/src/mage/sets/planechase2012/IllusoryAngel.java @@ -28,21 +28,14 @@ package mage.sets.planechase2012; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.ruleModifying.CastOnlyIfYouHaveCastAnotherSpellEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.watchers.common.CastSpellLastTurnWatcher; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; /** * @@ -55,7 +48,6 @@ public class IllusoryAngel extends CardImpl { this.expansionSetCode = "PC2"; this.subtype.add("Angel"); this.subtype.add("Illusion"); - this.power = new MageInt(4); this.toughness = new MageInt(4); @@ -63,7 +55,7 @@ public class IllusoryAngel extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Cast Illusory Angel only if you've cast another spell this turn. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new IllusoryAngelEffect())); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastOnlyIfYouHaveCastAnotherSpellEffect())); } public IllusoryAngel(final IllusoryAngel card) { @@ -75,36 +67,3 @@ public class IllusoryAngel extends CardImpl { return new IllusoryAngel(this); } } - -class IllusoryAngelEffect extends ContinuousRuleModifyingEffectImpl { - IllusoryAngelEffect() { - super(Duration.EndOfGame, Outcome.Detriment); - staticText = "Cast {this} only if you've cast another spell this turn"; - } - - IllusoryAngelEffect(final IllusoryAngelEffect effect) { - super(effect); - } - - @Override - public boolean checksEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.CAST_SPELL; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getSourceId().equals(source.getSourceId())) { - CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher"); - if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId()) == 0) { - return true; - } - } - return false; - - } - - @Override - public IllusoryAngelEffect copy() { - return new IllusoryAngelEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/planechase2012/KrondTheDawnClad.java b/Mage.Sets/src/mage/sets/planechase2012/KrondTheDawnClad.java index a42a96ec85f..75c25f891d0 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/KrondTheDawnClad.java +++ b/Mage.Sets/src/mage/sets/planechase2012/KrondTheDawnClad.java @@ -28,8 +28,6 @@ package mage.sets.planechase2012; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; @@ -37,7 +35,10 @@ import mage.abilities.condition.common.EnchantedCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.target.TargetPermanent; /** @@ -52,18 +53,18 @@ public class KrondTheDawnClad extends CardImpl { this.supertype.add("Legendary"); this.subtype.add("Archon"); - this.power = new MageInt(6); this.toughness = new MageInt(6); - // Flying + // Flying, vigilance this.addAbility(FlyingAbility.getInstance()); + this.addAbility(VigilanceAbility.getInstance()); // Whenever Krond the Dawn-Clad attacks, if it's enchanted, exile target permanent. Ability ability = new ConditionalTriggeredAbility( new AttacksTriggeredAbility(new ExileTargetEffect(), false), new EnchantedCondition(), - "Whenever Krond the Dawn-Clad attacks, if it's enchanted, exile target permanent."); + "Whenever {this} attacks, if it's enchanted, exile target permanent."); ability.addTarget(new TargetPermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/planechase2012/MassMutiny.java b/Mage.Sets/src/mage/sets/planechase2012/MassMutiny.java index fd242dfa30e..3931ee3e8ec 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/MassMutiny.java +++ b/Mage.Sets/src/mage/sets/planechase2012/MassMutiny.java @@ -28,11 +28,6 @@ package mage.sets.planechase2012; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.effects.ContinuousEffect; @@ -41,6 +36,10 @@ import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.continuous.GainControlTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; @@ -60,20 +59,20 @@ public class MassMutiny extends CardImpl { super(ownerId, 48, "Mass Mutiny", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); this.expansionSetCode = "PC2"; - this.getSpellAbility().addEffect(new MassMutinyEffect()); // For each opponent, gain control of up to one target creature that player controls until end of turn. Untap those creatures. They gain haste until end of turn. + this.getSpellAbility().addEffect(new MassMutinyEffect()); } @Override public void adjustTargets(Ability ability, Game game) { if (ability instanceof SpellAbility) { - for(UUID opponentId : game.getOpponents(ability.getControllerId())) { + for (UUID opponentId : game.getOpponents(ability.getControllerId())) { Player opponent = game.getPlayer(opponentId); if (opponent != null) { ability.getTargets().clear(); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature from opponent " + opponent.getLogName()); filter.add(new ControllerIdPredicate(opponentId)); - TargetCreaturePermanent target = new TargetCreaturePermanent(0,1, filter,false); + TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false); ability.addTarget(target); } } @@ -90,7 +89,6 @@ public class MassMutiny extends CardImpl { } } - class MassMutinyEffect extends OneShotEffect { public MassMutinyEffect() { @@ -110,7 +108,7 @@ class MassMutinyEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { boolean result = false; - for (Target target: source.getTargets()) { + for (Target target : source.getTargets()) { if (target instanceof TargetCreaturePermanent) { Permanent targetCreature = game.getPermanent(target.getFirstTarget()); if (targetCreature != null) { diff --git a/Mage.Sets/src/mage/sets/planechase2012/PrimalPlasma.java b/Mage.Sets/src/mage/sets/planechase2012/PrimalPlasma.java index 4d91881eea1..273836df79d 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/PrimalPlasma.java +++ b/Mage.Sets/src/mage/sets/planechase2012/PrimalPlasma.java @@ -43,8 +43,10 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -66,7 +68,7 @@ public class PrimalPlasma extends CardImpl { this.toughness = new MageInt(0); // As Primal Plasma enters the battlefield, it becomes your choice of a 3/3 creature, a 2/2 creature with flying, or a 1/6 creature with defender. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PrimalPlasmaReplacementEffect())); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new PrimalPlasmaReplacementEffect())); } public PrimalPlasma(final PrimalPlasma card) { @@ -102,7 +104,7 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getSourceId())) { - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + Permanent sourcePermanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (sourcePermanent != null && !sourcePermanent.isFaceDown(game)) { return true; } @@ -117,7 +119,7 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null) { Choice choice = new ChoiceImpl(true); choice.setMessage("Choose what " + permanent.getIdName() + " becomes to"); @@ -151,7 +153,7 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl { game.addEffect(new GainAbilitySourceEffect(DefenderAbility.getInstance(), Duration.Custom), source); break; } - game.addEffect(new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom), source); + game.addEffect(new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom, SubLayer.SetPT_7b), source); } return false; diff --git a/Mage.Sets/src/mage/sets/planechase2012/QuietDisrepair.java b/Mage.Sets/src/mage/sets/planechase2012/QuietDisrepair.java index fd4fde99256..9257307fd9c 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/QuietDisrepair.java +++ b/Mage.Sets/src/mage/sets/planechase2012/QuietDisrepair.java @@ -29,24 +29,22 @@ package mage.sets.planechase2012; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.GainLifeEffect; -import mage.abilities.keyword.EnchantAbility; -import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; /** @@ -76,7 +74,7 @@ public class QuietDisrepair extends CardImpl { this.addAbility(ability); // At the beginning of your upkeep, choose one - Destroy enchanted permanent; or you gain 2 life. - ability = new BeginningOfUpkeepTriggeredAbility(new QuietDisrepairDestroyEffect(), TargetController.YOU, false); + ability = new BeginningOfUpkeepTriggeredAbility(new DestroyAttachedEffect("enchanted permanent"), TargetController.YOU, false); Mode mode = new Mode(); mode.getEffects().add(new GainLifeEffect(2)); ability.addMode(mode); @@ -92,35 +90,3 @@ public class QuietDisrepair extends CardImpl { return new QuietDisrepair(this); } } - -class QuietDisrepairDestroyEffect extends OneShotEffect { - - public QuietDisrepairDestroyEffect() { - super(Outcome.DestroyPermanent); - this.staticText = "Destroy enchanted permanent"; - } - - public QuietDisrepairDestroyEffect(final QuietDisrepairDestroyEffect effect) { - super(effect); - } - - @Override - public QuietDisrepairDestroyEffect copy() { - return new QuietDisrepairDestroyEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment == null) { - enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - } - if (enchantment != null) { - Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); - if (enchanted != null) { - return enchanted.destroy(source.getSourceId(), game, false); - } - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java b/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java index f0a0c1e585d..2797a6b8908 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java +++ b/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java @@ -28,19 +28,17 @@ package mage.sets.planechase2012; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; -import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.CopyPermanentEffect; import mage.abilities.keyword.NinjutsuAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.util.functions.ApplyToPermanent; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.util.functions.AddSubtypeApplier; /** * @@ -59,11 +57,11 @@ public class SakashimasStudent extends CardImpl { // Ninjutsu {1}{U} this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{1}{U}"))); + // You may have Sakashima's Student enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,new EntersBattlefieldEffect( - new CopyPermanentEffect(new SakashimasStudentApplyToPermanent()), - "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types", - true))); + Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new AddSubtypeApplier("Ninja")); + effect.setText("as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types"); + this.addAbility(new EntersBattlefieldAbility(effect, true)); } @@ -76,14 +74,3 @@ public class SakashimasStudent extends CardImpl { return new SakashimasStudent(this); } } - -class SakashimasStudentApplyToPermanent extends ApplyToPermanent { - - @Override - public Boolean apply(Game game, Permanent permanent) { - if (!permanent.getSubtype().contains("Ninja")) { - permanent.getSubtype().add("Ninja"); - } - return true; - } -} diff --git a/Mage.Sets/src/mage/sets/planechase2012/WhirlpoolWarrior.java b/Mage.Sets/src/mage/sets/planechase2012/WhirlpoolWarrior.java index 475a7fd9634..059d5a709c2 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/WhirlpoolWarrior.java +++ b/Mage.Sets/src/mage/sets/planechase2012/WhirlpoolWarrior.java @@ -27,11 +27,9 @@ */ package mage.sets.planechase2012; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -41,7 +39,10 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.cards.Cards; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -99,16 +100,23 @@ class WhirlpoolWarriorTriggeredEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - int cardsHand = controller.getHand().size(); - if (cardsHand > 0){ - for (Card card: controller.getHand().getCards(game)) { - if (card != null) { - controller.removeFromHand(card, game); - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + Map cardsToDraw = new LinkedHashMap<>(); + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + int cardsInHand = player.getHand().size(); + if (cardsInHand > 0) { + cardsToDraw.put(playerId, cardsInHand); } + player.moveCards(player.getHand(), Zone.HAND, Zone.LIBRARY, source, game); + player.shuffleLibrary(game); + } + } + for (UUID playerId : cardsToDraw.keySet()) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.drawCards(cardsToDraw.get(playerId), game); } - controller.shuffleLibrary(game); - controller.drawCards(cardsHand, game); } return true; } @@ -141,8 +149,8 @@ class WhirlpoolWarriorActivatedEffect extends OneShotEffect { Player player = game.getPlayer(playerId); if (player != null) { int cardsHand = player.getHand().size(); - if (cardsHand > 0){ - for (Card card: player.getHand().getCards(game)) { + if (cardsHand > 0) { + for (Card card : player.getHand().getCards(game)) { if (card != null) { player.removeFromHand(card, game); card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); diff --git a/Mage.Sets/src/mage/sets/planeshift/ArcticMerfolk.java b/Mage.Sets/src/mage/sets/planeshift/ArcticMerfolk.java index e7993aa1681..0bdfbb25581 100644 --- a/Mage.Sets/src/mage/sets/planeshift/ArcticMerfolk.java +++ b/Mage.Sets/src/mage/sets/planeshift/ArcticMerfolk.java @@ -33,7 +33,7 @@ import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.common.KickedCondition; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; @@ -56,13 +56,12 @@ public class ArcticMerfolk extends CardImpl { this.toughness = new MageInt(1); // Kicker—Return a creature you control to its owner's hand. (You may return a creature you control to its owner's hand in addition to any other costs as you cast this spell.) - this.addAbility(new KickerAbility(new ReturnToHandTargetPermanentCost(new TargetControlledCreaturePermanent(1,1,new FilterControlledCreaturePermanent("a creature"),true)))); + this.addAbility(new KickerAbility(new ReturnToHandChosenControlledPermanentCost(new TargetControlledCreaturePermanent(1,1,new FilterControlledCreaturePermanent("a creature"),true)))); // If Arctic Merfolk was kicked, it enters the battlefield with a +1/+1 counter on it. this.addAbility(new EntersBattlefieldAbility( new AddCountersSourceEffect(CounterType.P1P1.createInstance()), - KickedCondition.getInstance(), - true,"If Arctic Merfolk was kicked, it enters the battlefield with a +1/+1 counter on it.","")); + KickedCondition.getInstance(),"If Arctic Merfolk was kicked, it enters the battlefield with a +1/+1 counter on it.","")); } public ArcticMerfolk(final ArcticMerfolk card) { diff --git a/Mage.Sets/src/mage/sets/planeshift/CloudCover.java b/Mage.Sets/src/mage/sets/planeshift/CloudCover.java new file mode 100644 index 00000000000..c8b82d6a5f2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/CloudCover.java @@ -0,0 +1,106 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planeshift; + +import java.util.UUID; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class CloudCover extends CardImpl { + + public CloudCover(UUID ownerId) { + super(ownerId, 98, "Cloud Cover", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{U}"); + this.expansionSetCode = "PLS"; + + // Whenever another permanent you control becomes the target of a spell or ability an opponent controls, you may return that permanent to its owner's hand. + this.addAbility(new CloudCoverAbility()); + } + + public CloudCover(final CloudCover card) { + super(card); + } + + @Override + public CloudCover copy() { + return new CloudCover(this); + } +} + +class CloudCoverAbility extends TriggeredAbilityImpl { + + public CloudCoverAbility() { + super(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), true); + } + + public CloudCoverAbility(final CloudCoverAbility ability) { + super(ability); + } + + @Override + public CloudCoverAbility copy() { + return new CloudCoverAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + Player controller = game.getPlayer(this.getControllerId()); + Player targetter = game.getPlayer(event.getPlayerId()); + if (permanent != null && !permanent.getId().equals(this.getSourceId()) + && controller != null && targetter != null + && !controller.getId().equals(targetter.getId())) { + getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever another permanent you control becomes the target of a spell or ability an opponent controls, you may return that permanent to its owner's hand."; + } +} diff --git a/Mage.Sets/src/mage/sets/planeshift/Confound.java b/Mage.Sets/src/mage/sets/planeshift/Confound.java new file mode 100644 index 00000000000..44f266b00bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/Confound.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planeshift; + +import java.util.UUID; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.other.TargetsPermanentPredicate; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + */ +public class Confound extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("spell that targets one or more creatures"); + + static { + filter.add(new TargetsPermanentPredicate(new FilterCreaturePermanent())); + } + + public Confound(UUID ownerId) { + super(ownerId, 22, "Confound", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "PLS"; + + // Counter target spell that targets one or more creatures. + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public Confound(final Confound card) { + super(card); + } + + @Override + public Confound copy() { + return new Confound(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planeshift/CrosissCatacombs.java b/Mage.Sets/src/mage/sets/planeshift/CrosissCatacombs.java index 40cafe55313..7efc25e7f80 100644 --- a/Mage.Sets/src/mage/sets/planeshift/CrosissCatacombs.java +++ b/Mage.Sets/src/mage/sets/planeshift/CrosissCatacombs.java @@ -29,7 +29,7 @@ package mage.sets.planeshift; import java.util.UUID; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlueManaAbility; @@ -59,7 +59,7 @@ public class CrosissCatacombs extends CardImpl { this.subtype.add("Lair"); // When Crosis's Catacombs enters the battlefield, sacrifice it unless you return a non-Lair land you control to its owner's hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))))); // {tap}: Add {U}, {B}, or {R} to your mana pool. this.addAbility(new BlueManaAbility()); this.addAbility(new BlackManaAbility()); diff --git a/Mage.Sets/src/mage/sets/planeshift/DarigaazsCaldera.java b/Mage.Sets/src/mage/sets/planeshift/DarigaazsCaldera.java index cf9b3567fda..09e9902d6cc 100644 --- a/Mage.Sets/src/mage/sets/planeshift/DarigaazsCaldera.java +++ b/Mage.Sets/src/mage/sets/planeshift/DarigaazsCaldera.java @@ -29,7 +29,7 @@ package mage.sets.planeshift; import java.util.UUID; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.GreenManaAbility; @@ -59,7 +59,7 @@ public class DarigaazsCaldera extends CardImpl { this.subtype.add("Lair"); // When Darigaaz's Caldera enters the battlefield, sacrifice it unless you return a non-Lair land you control to its owner's hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))))); // {tap}: Add {B}, {R}, or {G} to your mana pool. this.addAbility(new BlackManaAbility()); this.addAbility(new RedManaAbility()); diff --git a/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java b/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java index 11e62798662..bf5b2311558 100644 --- a/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java +++ b/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java @@ -38,7 +38,6 @@ import mage.abilities.costs.Costs; import mage.abilities.costs.CostsImpl; import mage.abilities.costs.common.DiscardCardCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.Effect; import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; @@ -76,8 +75,8 @@ public class DralnusPet extends CardImpl { kickerCosts.add(new DiscardCardCost(new FilterCreatureCard())); this.addAbility(new KickerAbility(kickerCosts)); // If Dralnu's Pet was kicked, it enters the battlefield with flying and with X +1/+1 counters on it, where X is the discarded card's converted mana cost. - Ability ability = new EntersBattlefieldAbility(new DralnusPetEffect(), KickedCondition.getInstance(), true, - "If {this} was kicked, it enters the battlefield with flying and with X +1/+1 counters on it, where X is the discarded card's converted mana cost", ""); + Ability ability = new EntersBattlefieldAbility(new DralnusPetEffect(), KickedCondition.getInstance(), + "If {this} was kicked, it enters the battlefield with flying and with X +1/+1 counters on it, where X is the discarded card's converted mana cost", ""); ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield)); this.addAbility(ability); } @@ -113,10 +112,12 @@ class DralnusPetEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (controller != null && permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) { int cmc = 0; - for (Cost cost : ((SpellAbility) obj).getCosts()) { + for (Cost cost : spellAbility.getCosts()) { if (cost instanceof DiscardCardCost && ((DiscardCardCost) cost).getCards().size() > 0) { cmc = ((DiscardCardCost) cost).getCards().get(0).getManaCost().convertedManaCost(); } diff --git a/Mage.Sets/src/mage/sets/planeshift/DromarsCavern.java b/Mage.Sets/src/mage/sets/planeshift/DromarsCavern.java index 0527355c9bc..87e138351ae 100644 --- a/Mage.Sets/src/mage/sets/planeshift/DromarsCavern.java +++ b/Mage.Sets/src/mage/sets/planeshift/DromarsCavern.java @@ -29,7 +29,7 @@ package mage.sets.planeshift; import java.util.UUID; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlueManaAbility; @@ -58,7 +58,7 @@ public class DromarsCavern extends CardImpl { this.subtype.add("Lair"); // When Dromar's Cavern enters the battlefield, sacrifice it unless you return a non-Lair land you control to its owner's hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))))); // {tap}: Add {W}, {U}, or {B} to your mana pool. this.addAbility(new WhiteManaAbility()); this.addAbility(new BlueManaAbility()); diff --git a/Mage.Sets/src/mage/sets/planeshift/Insolence.java b/Mage.Sets/src/mage/sets/planeshift/Insolence.java index 4fdcbf1b6c5..9d8de7ca711 100644 --- a/Mage.Sets/src/mage/sets/planeshift/Insolence.java +++ b/Mage.Sets/src/mage/sets/planeshift/Insolence.java @@ -60,7 +60,7 @@ public class Insolence extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever enchanted creature becomes tapped, Insolence deals 2 damage to that creature's controller. - this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DamageAttachedControllerEffect(2), false)); + this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DamageAttachedControllerEffect(2), "enchanted creature")); } public Insolence(final Insolence card) { diff --git a/Mage.Sets/src/mage/sets/planeshift/MoggJailer.java b/Mage.Sets/src/mage/sets/planeshift/MoggJailer.java new file mode 100644 index 00000000000..e58a1f87559 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/MoggJailer.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planeshift; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CantAttackIfDefenderControlsPermanent; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.filter.predicate.permanent.TappedPredicate; + +/** + * + * @author BursegSardaukar + + */ +public class MoggJailer extends CardImpl { + + static final private FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature with power 2 or less"); + + static { + filter.add(Predicates.and(new PowerPredicate(Filter.ComparisonType.LessThan, 2), Predicates.not(new TappedPredicate()))); + } + + public MoggJailer(UUID ownerId) { + super(ownerId, 68, "Mogg Jailer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "PLS"; + this.subtype.add("Goblin"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Mogg Jailer can't attack if defending player controls an untapped creature with power 2 or less. + Effect effect = new CantAttackIfDefenderControlsPermanent(filter); + effect.setText("Mogg Jailer can't attack if defending player controls an untapped creature with power 2 or less."); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public MoggJailer(final MoggJailer card) { + super(card); + } + + @Override + public MoggJailer copy() { + return new MoggJailer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planeshift/OrimsChant.java b/Mage.Sets/src/mage/sets/planeshift/OrimsChant.java index 6c87841a9ef..5a35bbde4f3 100644 --- a/Mage.Sets/src/mage/sets/planeshift/OrimsChant.java +++ b/Mage.Sets/src/mage/sets/planeshift/OrimsChant.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.sets.planeshift; import java.util.UUID; @@ -56,7 +55,6 @@ public class OrimsChant extends CardImpl { super(ownerId, 11, "Orim's Chant", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{W}"); this.expansionSetCode = "PLS"; - // Kicker {W} (You may pay an additional {W} as you cast this spell.) this.addAbility(new KickerAbility("{W}")); @@ -81,7 +79,7 @@ public class OrimsChant extends CardImpl { class OrimsChantCantCastEffect extends ContinuousRuleModifyingEffectImpl { - public OrimsChantCantCastEffect() { + public OrimsChantCantCastEffect() { super(Duration.EndOfTurn, Outcome.Benefit); staticText = "Target player can't cast spells this turn"; } @@ -97,12 +95,12 @@ class OrimsChantCantCastEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.CAST_SPELL; + return GameEvent.EventType.CAST_SPELL.equals(event.getType()); } @Override public boolean applies(GameEvent event, Ability source, Game game) { - return event.getPlayerId() == getTargetPointer().getFirst(game, source); + return event.getPlayerId().equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/sets/planeshift/PhyrexianScuta.java b/Mage.Sets/src/mage/sets/planeshift/PhyrexianScuta.java index 5a43de13839..8dae36a679d 100644 --- a/Mage.Sets/src/mage/sets/planeshift/PhyrexianScuta.java +++ b/Mage.Sets/src/mage/sets/planeshift/PhyrexianScuta.java @@ -56,8 +56,7 @@ public class PhyrexianScuta extends CardImpl { // Kicker-Pay 3 life. this.addAbility(new KickerAbility(new PayLifeCost(3))); // If Phyrexian Scuta was kicked, it enters the battlefield with two +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), KickedCondition.getInstance(), - true, "If Phyrexian Scuta was kicked, it enters the battlefield with two +1/+1 counters on it.", "")); + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), KickedCondition.getInstance(), "If Phyrexian Scuta was kicked, it enters the battlefield with two +1/+1 counters on it.", "")); } public PhyrexianScuta(final PhyrexianScuta card) { diff --git a/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFavor.java b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFavor.java new file mode 100644 index 00000000000..7fc8f0b20f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFavor.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planeshift; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetOpponent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class PlaneswalkersFavor extends CardImpl { + + public PlaneswalkersFavor(UUID ownerId) { + super(ownerId, 86, "Planeswalker's Favor", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "PLS"; + + // {3}{G}: Target opponent reveals a card at random from his or her hand. Target creature gets +X/+X until end of turn, where X is the revealed card's converted mana cost. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PlaneswalkersFavorEffect(), new ManaCostsImpl("{3}{G}")); + Target target = new TargetOpponent(); + ability.addTarget(target); + target = new TargetCreaturePermanent(); + ability.addTarget(target); + this.addAbility(ability); + } + + public PlaneswalkersFavor(final PlaneswalkersFavor card) { + super(card); + } + + @Override + public PlaneswalkersFavor copy() { + return new PlaneswalkersFavor(this); + } +} + +class PlaneswalkersFavorEffect extends OneShotEffect { + + public PlaneswalkersFavorEffect() { + super(Outcome.Damage); + staticText = "Target opponent reveals a card at random from his or her hand. Target creature gets +X/+X until end of turn, where X is the revealed card's converted mana cost"; + } + + public PlaneswalkersFavorEffect(final PlaneswalkersFavorEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(source.getTargets().get(0).getFirstTarget()); + if (opponent != null && opponent.getHand().size() > 0) { + Cards revealed = new CardsImpl(); + Card card = opponent.getHand().getRandom(game); + if (card != null) { + revealed.add(card); + int boostValue = card.getManaCost().convertedManaCost(); + opponent.revealCards("Planeswalker's Favor", revealed, game); + ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget())); + game.addEffect(effect, source); + } + return true; + } + return false; + } + + @Override + public PlaneswalkersFavorEffect copy() { + return new PlaneswalkersFavorEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFury.java b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFury.java new file mode 100644 index 00000000000..c95d3ae35d1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersFury.java @@ -0,0 +1,105 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planeshift; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class PlaneswalkersFury extends CardImpl { + + public PlaneswalkersFury(UUID ownerId) { + super(ownerId, 70, "Planeswalker's Fury", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "PLS"; + + // {3}{R}: Target opponent reveals a card at random from his or her hand. Planeswalker's Fury deals damage equal to that card's converted mana cost to that player. Activate this ability only any time you could cast a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new PlaneswalkersFuryEffect(), new ManaCostsImpl("{3}{R}")); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public PlaneswalkersFury(final PlaneswalkersFury card) { + super(card); + } + + @Override + public PlaneswalkersFury copy() { + return new PlaneswalkersFury(this); + } +} + +class PlaneswalkersFuryEffect extends OneShotEffect { + + public PlaneswalkersFuryEffect() { + super(Outcome.Damage); + staticText = "Target opponent reveals a card at random from his or her hand. Planeswalker's Fury deals damage equal to that card's converted mana cost to that player"; + } + + public PlaneswalkersFuryEffect(final PlaneswalkersFuryEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); + if (opponent != null && opponent.getHand().size() > 0) { + Cards revealed = new CardsImpl(); + Card card = opponent.getHand().getRandom(game); + if (card != null) { + revealed.add(card); + opponent.revealCards("Planeswalker's Fury", revealed, game); + opponent.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true); + } + return true; + } + return false; + } + + @Override + public PlaneswalkersFuryEffect copy() { + return new PlaneswalkersFuryEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersMirth.java b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersMirth.java new file mode 100644 index 00000000000..c468a5f7988 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersMirth.java @@ -0,0 +1,106 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planeshift; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class PlaneswalkersMirth extends CardImpl { + + public PlaneswalkersMirth(UUID ownerId) { + super(ownerId, 12, "Planeswalker's Mirth", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); + this.expansionSetCode = "PLS"; + + // {3}{W}: Target opponent reveals a card at random from his or her hand. You gain life equal to that card's converted mana cost. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PlaneswalkersMirthEffect(), new ManaCostsImpl("{3}{W}")); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public PlaneswalkersMirth(final PlaneswalkersMirth card) { + super(card); + } + + @Override + public PlaneswalkersMirth copy() { + return new PlaneswalkersMirth(this); + } +} + +class PlaneswalkersMirthEffect extends OneShotEffect { + + public PlaneswalkersMirthEffect() { + super(Outcome.Damage); + staticText = "Target opponent reveals a card at random from his or her hand. You gain life equal to that card's converted mana cost"; + } + + public PlaneswalkersMirthEffect(final PlaneswalkersMirthEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); + Player player = game.getPlayer(source.getControllerId()); + if (opponent != null && player!= null && opponent.getHand().size() > 0) { + Cards revealed = new CardsImpl(); + Card card = opponent.getHand().getRandom(game); + if (card != null) { + revealed.add(card); + opponent.revealCards("Planeswalker's Mirth", revealed, game); + player.gainLife(card.getManaCost().convertedManaCost(), game); + } + return true; + } + return false; + } + + @Override + public PlaneswalkersMirthEffect copy() { + return new PlaneswalkersMirthEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersScorn.java b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersScorn.java new file mode 100644 index 00000000000..d1b42fbd758 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/PlaneswalkersScorn.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planeshift; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetOpponent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class PlaneswalkersScorn extends CardImpl { + + public PlaneswalkersScorn(UUID ownerId) { + super(ownerId, 52, "Planeswalker's Scorn", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); + this.expansionSetCode = "PLS"; + + // {3}{B}: Target opponent reveals a card at random from his or her hand. Target creature gets -X/-X until end of turn, where X is the revealed card's converted mana cost. Activate this ability only any time you could cast a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new PlaneswalkersScornEffect(), new ManaCostsImpl("{3}{B}")); + Target target = new TargetOpponent(); + ability.addTarget(target); + target = new TargetCreaturePermanent(); + ability.addTarget(target); + this.addAbility(ability); + } + + public PlaneswalkersScorn(final PlaneswalkersScorn card) { + super(card); + } + + @Override + public PlaneswalkersScorn copy() { + return new PlaneswalkersScorn(this); + } +} + +class PlaneswalkersScornEffect extends OneShotEffect { + + public PlaneswalkersScornEffect() { + super(Outcome.Damage); + staticText = "Target opponent reveals a card at random from his or her hand. Target creature gets -X/-X until end of turn, where X is the revealed card's converted mana cost"; + } + + public PlaneswalkersScornEffect(final PlaneswalkersScornEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(source.getTargets().get(0).getFirstTarget()); + if (opponent != null && opponent.getHand().size() > 0) { + Cards revealed = new CardsImpl(); + Card card = opponent.getHand().getRandom(game); + if (card != null) { + revealed.add(card); + int boostValue = -1 * card.getManaCost().convertedManaCost(); + opponent.revealCards("Planeswalker's Scorn", revealed, game); + ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget())); + game.addEffect(effect, source); + } + return true; + } + return false; + } + + @Override + public PlaneswalkersScornEffect copy() { + return new PlaneswalkersScornEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/planeshift/PollenRemedy.java b/Mage.Sets/src/mage/sets/planeshift/PollenRemedy.java index 7e3d7d8b1b7..dd294e5e17c 100644 --- a/Mage.Sets/src/mage/sets/planeshift/PollenRemedy.java +++ b/Mage.Sets/src/mage/sets/planeshift/PollenRemedy.java @@ -41,8 +41,8 @@ import mage.constants.Duration; import mage.constants.Rarity; import mage.filter.common.FilterControlledLandPermanent; import mage.game.Game; -import mage.target.common.TargetCreatureOrPlayerAmount; import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreatureOrPlayerAmount; /** * diff --git a/Mage.Sets/src/mage/sets/planeshift/RithsGrove.java b/Mage.Sets/src/mage/sets/planeshift/RithsGrove.java index d0fe9fde6f0..aa36ec7965a 100644 --- a/Mage.Sets/src/mage/sets/planeshift/RithsGrove.java +++ b/Mage.Sets/src/mage/sets/planeshift/RithsGrove.java @@ -29,7 +29,7 @@ package mage.sets.planeshift; import java.util.UUID; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; @@ -59,7 +59,7 @@ public class RithsGrove extends CardImpl { this.subtype.add("Lair"); // When Rith's Grove enters the battlefield, sacrifice it unless you return a non-Lair land you control to its owner's hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))))); // {tap}: Add {R}, {G}, or {W} to your mana pool. this.addAbility(new RedManaAbility()); this.addAbility(new GreenManaAbility()); diff --git a/Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java b/Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java index 22a1c755e1b..06d9fb2a02c 100644 --- a/Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java +++ b/Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java @@ -92,7 +92,7 @@ class SkyshipWeatherlightEffect extends SearchEffect { MageObject sourceObject = source.getSourceObject(game); if (sourceObject != null && controller != null) { if (controller.searchLibrary(target, game)) { - UUID exileZone = CardUtil.getObjectExileZoneId(game, sourceObject); + UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); if (target.getTargets().size() > 0) { for (UUID cardID : target.getTargets()) { Card card = controller.getLibrary().getCard(cardID, game); diff --git a/Mage.Sets/src/mage/sets/planeshift/SleepingPotion.java b/Mage.Sets/src/mage/sets/planeshift/SleepingPotion.java index ad0cacc5e64..3f794c585de 100644 --- a/Mage.Sets/src/mage/sets/planeshift/SleepingPotion.java +++ b/Mage.Sets/src/mage/sets/planeshift/SleepingPotion.java @@ -32,7 +32,6 @@ import mage.abilities.Ability; import mage.abilities.common.BecomesTargetAttachedTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect; import mage.abilities.effects.common.SacrificeSourceEffect; @@ -66,9 +65,7 @@ public class SleepingPotion extends CardImpl { // When Sleeping Potion enters the battlefield, tap enchanted creature. this.addAbility(new EntersBattlefieldTriggeredAbility(new TapEnchantedEffect())); // Enchanted creature doesn't untap during its controller's untap step. - Effect effect = new DontUntapInControllersUntapStepEnchantedEffect(); - effect.setText("Enchanted creature doesn't untap during its controller's untap step"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect())); // When enchanted creature becomes the target of a spell or ability, sacrifice Sleeping Potion. this.addAbility(new BecomesTargetAttachedTriggeredAbility(new SacrificeSourceEffect())); } diff --git a/Mage.Sets/src/mage/sets/planeshift/TrevasRuins.java b/Mage.Sets/src/mage/sets/planeshift/TrevasRuins.java index 64b9eec6c94..d72cc657f27 100644 --- a/Mage.Sets/src/mage/sets/planeshift/TrevasRuins.java +++ b/Mage.Sets/src/mage/sets/planeshift/TrevasRuins.java @@ -29,7 +29,7 @@ package mage.sets.planeshift; import java.util.UUID; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.GreenManaAbility; @@ -59,7 +59,7 @@ public class TrevasRuins extends CardImpl { this.subtype.add("Lair"); // When Treva's Ruins enters the battlefield, sacrifice it unless you return a non-Lair land you control to its owner's hand. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))))); // {tap}: Add {G}, {W}, or {U} to your mana pool. this.addAbility(new GreenManaAbility()); this.addAbility(new WhiteManaAbility()); diff --git a/Mage.Sets/src/mage/sets/portal/AlabasterDragon.java b/Mage.Sets/src/mage/sets/portal/AlabasterDragon.java new file mode 100644 index 00000000000..4d786359483 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/AlabasterDragon.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.ShuffleIntoLibrarySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class AlabasterDragon extends CardImpl { + + public AlabasterDragon(UUID ownerId) { + super(ownerId, 163, "Alabaster Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + this.expansionSetCode = "POR"; + this.subtype.add("Dragon"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Alabaster Dragon dies, shuffle it into its owner's library. + this.addAbility(new DiesTriggeredAbility(new ShuffleIntoLibrarySourceEffect())); } + + public AlabasterDragon(final AlabasterDragon card) { + super(card); + } + + @Override + public AlabasterDragon copy() { + return new AlabasterDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/AlluringScent.java b/Mage.Sets/src/mage/sets/portal/AlluringScent.java index fcd20fda219..7d4ac4d3f08 100644 --- a/Mage.Sets/src/mage/sets/portal/AlluringScent.java +++ b/Mage.Sets/src/mage/sets/portal/AlluringScent.java @@ -42,7 +42,7 @@ import mage.target.common.TargetCreaturePermanent; public class AlluringScent extends CardImpl { public AlluringScent(UUID ownerId) { - super(ownerId, 61, "Alluring Scent", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{G}{G}"); + super(ownerId, 80, "Alluring Scent", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{G}{G}"); this.expansionSetCode = "POR"; // All creatures able to block target creature this turn do so. diff --git a/Mage.Sets/src/mage/sets/portal/Anaconda.java b/Mage.Sets/src/mage/sets/portal/Anaconda1.java similarity index 89% rename from Mage.Sets/src/mage/sets/portal/Anaconda.java rename to Mage.Sets/src/mage/sets/portal/Anaconda1.java index 75c7907736a..1300b5f2988 100644 --- a/Mage.Sets/src/mage/sets/portal/Anaconda.java +++ b/Mage.Sets/src/mage/sets/portal/Anaconda1.java @@ -33,20 +33,20 @@ import java.util.UUID; * * @author Plopman */ -public class Anaconda extends mage.sets.urzassaga.Anaconda { +public class Anaconda1 extends mage.sets.urzassaga.Anaconda { - public Anaconda(UUID ownerId) { + public Anaconda1(UUID ownerId) { super(ownerId); this.cardNumber = 81; this.expansionSetCode = "POR"; } - public Anaconda(final Anaconda card) { + public Anaconda1(final Anaconda1 card) { super(card); } @Override - public Anaconda copy() { - return new Anaconda(this); + public Anaconda1 copy() { + return new Anaconda1(this); } } diff --git a/Mage.Sets/src/mage/sets/portal/Anaconda2.java b/Mage.Sets/src/mage/sets/portal/Anaconda2.java new file mode 100644 index 00000000000..9e01a0beb40 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/Anaconda2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class Anaconda2 extends mage.sets.urzassaga.Anaconda { + + public Anaconda2(UUID ownerId) { + super(ownerId); + this.cardNumber = 82; + this.expansionSetCode = "POR"; + } + + public Anaconda2(final Anaconda2 card) { + super(card); + } + + @Override + public Anaconda2 copy() { + return new Anaconda2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/Blaze.java b/Mage.Sets/src/mage/sets/portal/Blaze1.java similarity index 90% rename from Mage.Sets/src/mage/sets/portal/Blaze.java rename to Mage.Sets/src/mage/sets/portal/Blaze1.java index 29a3fae9042..22f800c0d4c 100644 --- a/Mage.Sets/src/mage/sets/portal/Blaze.java +++ b/Mage.Sets/src/mage/sets/portal/Blaze1.java @@ -33,20 +33,20 @@ import java.util.UUID; * * @author Plopman */ -public class Blaze extends mage.sets.planechase.Blaze { +public class Blaze1 extends mage.sets.planechase.Blaze { - public Blaze(UUID ownerId) { + public Blaze1(UUID ownerId) { super(ownerId); this.cardNumber = 122; this.expansionSetCode = "POR"; } - public Blaze(final Blaze card) { + public Blaze1(final Blaze1 card) { super(card); } @Override - public Blaze copy() { - return new Blaze(this); + public Blaze1 copy() { + return new Blaze1(this); } } diff --git a/Mage.Sets/src/mage/sets/portal/Blaze2.java b/Mage.Sets/src/mage/sets/portal/Blaze2.java new file mode 100644 index 00000000000..1ca245b852d --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/Blaze2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class Blaze2 extends mage.sets.planechase.Blaze { + + public Blaze2(UUID ownerId) { + super(ownerId); + this.cardNumber = 123; + this.expansionSetCode = "POR"; + } + + public Blaze2(final Blaze2 card) { + super(card); + } + + @Override + public Blaze2 copy() { + return new Blaze2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/BreathOfLife.java b/Mage.Sets/src/mage/sets/portal/BreathOfLife.java index abf9b5453ed..2dc1454cf27 100644 --- a/Mage.Sets/src/mage/sets/portal/BreathOfLife.java +++ b/Mage.Sets/src/mage/sets/portal/BreathOfLife.java @@ -1,54 +1,54 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.portal; - +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + import java.util.UUID; -import mage.constants.Rarity; - -/** - * - * @author dustinconrad - */ -public class BreathOfLife extends mage.sets.starter2000.BreathOfLife { - - public BreathOfLife(UUID ownerId) { - super(ownerId); - this.cardNumber = 135; +import mage.constants.Rarity; + +/** + * + * @author dustinconrad + */ +public class BreathOfLife extends mage.sets.starter2000.BreathOfLife { + + public BreathOfLife(UUID ownerId) { + super(ownerId); + this.cardNumber = 172; this.expansionSetCode = "POR"; - this.rarity = Rarity.COMMON; - } - - public BreathOfLife(final BreathOfLife card) { - super(card); - } - - @Override - public BreathOfLife copy() { - return new BreathOfLife(this); - } -} + this.rarity = Rarity.COMMON; + } + + public BreathOfLife(final BreathOfLife card) { + super(card); + } + + @Override + public BreathOfLife copy() { + return new BreathOfLife(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/BurningCloak.java b/Mage.Sets/src/mage/sets/portal/BurningCloak.java new file mode 100644 index 00000000000..497c66567dc --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/BurningCloak.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class BurningCloak extends CardImpl { + + public BurningCloak(UUID ownerId) { + super(ownerId, 125, "Burning Cloak", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}"); + this.expansionSetCode = "POR"; + + // Target creature gets +2/+0 until end of turn. Burning Cloak deals 2 damage to that creature. + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn)); + Effect effect = new DamageTargetEffect(2); + effect.setText("{this} deals 2 damage to that creature"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public BurningCloak(final BurningCloak card) { + super(card); + } + + @Override + public BurningCloak copy() { + return new BurningCloak(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/ChargingBandits.java b/Mage.Sets/src/mage/sets/portal/ChargingBandits.java new file mode 100644 index 00000000000..c688412ea0a --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/ChargingBandits.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ChargingBandits extends CardImpl { + + public ChargingBandits(UUID ownerId) { + super(ownerId, 6, "Charging Bandits", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "POR"; + this.subtype.add("Human"); + this.subtype.add("Rogue"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Charging Bandits attacks, it gets +2/+0 until end of turn. + Effect effect = new BoostSourceEffect(2, 0, Duration.EndOfTurn); + effect.setText("it gets +2/+2 until end of turn"); + this.addAbility(new AttacksTriggeredAbility(effect, false)); + } + + public ChargingBandits(final ChargingBandits card) { + super(card); + } + + @Override + public ChargingBandits copy() { + return new ChargingBandits(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/CloakOfFeathers.java b/Mage.Sets/src/mage/sets/portal/CloakOfFeathers.java new file mode 100644 index 00000000000..428646d6765 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/CloakOfFeathers.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class CloakOfFeathers extends CardImpl { + + public CloakOfFeathers(UUID ownerId) { + super(ownerId, 45, "Cloak of Feathers", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); + this.expansionSetCode = "POR"; + + // Target creature gains flying until end of turn. + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public CloakOfFeathers(final CloakOfFeathers card) { + super(card); + } + + @Override + public CloakOfFeathers copy() { + return new CloakOfFeathers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/CloudPirates.java b/Mage.Sets/src/mage/sets/portal/CloudPirates.java new file mode 100644 index 00000000000..56354955163 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/CloudPirates.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CloudPirates extends CardImpl { + + public CloudPirates(UUID ownerId) { + super(ownerId, 47, "Cloud Pirates", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "POR"; + this.subtype.add("Human"); + this.subtype.add("Pirate"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Cloud Pirates can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + } + + public CloudPirates(final CloudPirates card) { + super(card); + } + + @Override + public CloudPirates copy() { + return new CloudPirates(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/CravenKnight.java b/Mage.Sets/src/mage/sets/portal/CravenKnight.java new file mode 100644 index 00000000000..e5e017e286c --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/CravenKnight.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CantBlockAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class CravenKnight extends CardImpl { + + public CravenKnight(UUID ownerId) { + super(ownerId, 7, "Craven Knight", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "POR"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Craven Knight can't block. + this.addAbility(new CantBlockAbility()); + } + + public CravenKnight(final CravenKnight card) { + super(card); + } + + @Override + public CravenKnight copy() { + return new CravenKnight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/DejaVu.java b/Mage.Sets/src/mage/sets/portal/DejaVu.java new file mode 100644 index 00000000000..bac41715fb9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/DejaVu.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LoneFox + */ +public class DejaVu extends CardImpl { + + public static final FilterCard filter = new FilterCard("sorcery card from your graveyard"); + + static { + filter.add(new CardTypePredicate(CardType.SORCERY)); + } + + public DejaVu(UUID ownerId) { + super(ownerId, 53, "Deja Vu", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "POR"; + + // Return target sorcery card from your graveyard to your hand. + this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); + } + + public DejaVu(final DejaVu card) { + super(card); + } + + @Override + public DejaVu copy() { + return new DejaVu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/DreadReaper.java b/Mage.Sets/src/mage/sets/portal/DreadReaper.java new file mode 100644 index 00000000000..d00d26c5bce --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/DreadReaper.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DreadReaper extends mage.sets.starter1999.DreadReaper { + + public DreadReaper(UUID ownerId) { + super(ownerId); + this.cardNumber = 11; + this.expansionSetCode = "POR"; + } + + public DreadReaper(final DreadReaper card) { + super(card); + } + + @Override + public DreadReaper copy() { + return new DreadReaper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/EbonDragon.java b/Mage.Sets/src/mage/sets/portal/EbonDragon.java new file mode 100644 index 00000000000..805a8930784 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/EbonDragon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EbonDragon extends mage.sets.ftvdragons.EbonDragon { + + public EbonDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "POR"; + } + + public EbonDragon(final EbonDragon card) { + super(card); + } + + @Override + public EbonDragon copy() { + return new EbonDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/EliteCatWarrior.java b/Mage.Sets/src/mage/sets/portal/EliteCatWarrior1.java similarity index 90% rename from Mage.Sets/src/mage/sets/portal/EliteCatWarrior.java rename to Mage.Sets/src/mage/sets/portal/EliteCatWarrior1.java index 3c484adc889..6f3c3fd8763 100644 --- a/Mage.Sets/src/mage/sets/portal/EliteCatWarrior.java +++ b/Mage.Sets/src/mage/sets/portal/EliteCatWarrior1.java @@ -38,9 +38,9 @@ import mage.constants.Rarity; * * @author Plopman */ -public class EliteCatWarrior extends CardImpl { +public class EliteCatWarrior1 extends CardImpl { - public EliteCatWarrior(UUID ownerId) { + public EliteCatWarrior1(UUID ownerId) { super(ownerId, 87, "Elite Cat Warrior", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.expansionSetCode = "POR"; this.subtype.add("Cat"); @@ -53,12 +53,12 @@ public class EliteCatWarrior extends CardImpl { this.addAbility(new ForestwalkAbility()); } - public EliteCatWarrior(final EliteCatWarrior card) { + public EliteCatWarrior1(final EliteCatWarrior1 card) { super(card); } @Override - public EliteCatWarrior copy() { - return new EliteCatWarrior(this); + public EliteCatWarrior1 copy() { + return new EliteCatWarrior1(this); } } diff --git a/Mage.Sets/src/mage/sets/portal/EliteCatWarrior2.java b/Mage.Sets/src/mage/sets/portal/EliteCatWarrior2.java new file mode 100644 index 00000000000..11f0782259f --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/EliteCatWarrior2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class EliteCatWarrior2 extends mage.sets.portal.EliteCatWarrior1 { + + public EliteCatWarrior2(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + } + + public EliteCatWarrior2(final EliteCatWarrior2 card) { + super(card); + } + + @Override + public EliteCatWarrior2 copy() { + return new EliteCatWarrior2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/Exhaustion.java b/Mage.Sets/src/mage/sets/portal/Exhaustion.java index 8987df56403..82a1e0be2d4 100644 --- a/Mage.Sets/src/mage/sets/portal/Exhaustion.java +++ b/Mage.Sets/src/mage/sets/portal/Exhaustion.java @@ -1,52 +1,52 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.portal; - -import java.util.UUID; - -/** - * - * @author emerald000 - */ -public class Exhaustion extends mage.sets.portalthreekingdoms.Exhaustion { - - public Exhaustion(UUID ownerId) { - super(ownerId); - this.cardNumber = 42; - this.expansionSetCode = "POR"; - } - - public Exhaustion(final Exhaustion card) { - super(card); - } - - @Override - public Exhaustion copy() { - return new Exhaustion(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class Exhaustion extends mage.sets.portalthreekingdoms.Exhaustion { + + public Exhaustion(UUID ownerId) { + super(ownerId); + this.cardNumber = 55; + this.expansionSetCode = "POR"; + } + + public Exhaustion(final Exhaustion card) { + super(card); + } + + @Override + public Exhaustion copy() { + return new Exhaustion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/FinalStrike.java b/Mage.Sets/src/mage/sets/portal/FinalStrike.java new file mode 100644 index 00000000000..a557e32bd09 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/FinalStrike.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class FinalStrike extends CardImpl { + + public FinalStrike(UUID ownerId) { + super(ownerId, 16, "Final Strike", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); + this.expansionSetCode = "POR"; + + // As an additional cost to cast Final Strike, sacrifice a creature. + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + + // Final Strike deals damage to target opponent equal to the sacrificed creature's power. + Effect effect = new DamageTargetEffect(new SacrificeCostCreaturesPower()); + effect.setText("{this} deals damage to target opponent equal to the sacrificed creature's power"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public FinalStrike(final FinalStrike card) { + super(card); + } + + @Override + public FinalStrike copy() { + return new FinalStrike(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/FireDragon.java b/Mage.Sets/src/mage/sets/portal/FireDragon.java new file mode 100644 index 00000000000..a4814964ad4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/FireDragon.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class FireDragon extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("for each Mountain you control"); + + static { + filter.add(new SubtypePredicate("Mountain")); + } + + public FireDragon(UUID ownerId) { + super(ownerId, 130, "Fire Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{R}{R}{R}"); + this.expansionSetCode = "POR"; + this.subtype.add("Dragon"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Fire Dragon enters the battlefield, it deals damage equal to the number of Mountains you control to target creature. + Effect effect = new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter)); + effect.setText("it deals damage equal to the number of Mountains you control to target creature"); + Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FireDragon(final FireDragon card) { + super(card); + } + + @Override + public FireDragon copy() { + return new FireDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/FireSnake.java b/Mage.Sets/src/mage/sets/portal/FireSnake.java new file mode 100644 index 00000000000..86f58ce15a5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/FireSnake.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author fireshoes + */ +public class FireSnake extends CardImpl { + + public FireSnake(UUID ownerId) { + super(ownerId, 132, "Fire Snake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "POR"; + this.subtype.add("Snake"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // When Fire Snake dies, destroy target land. + Ability ability = new DiesTriggeredAbility(new DestroyTargetEffect(), false); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + } + + public FireSnake(final FireSnake card) { + super(card); + } + + @Override + public FireSnake copy() { + return new FireSnake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/FleetFootedMonk.java b/Mage.Sets/src/mage/sets/portal/FleetFootedMonk.java new file mode 100644 index 00000000000..2fdb7a96a20 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/FleetFootedMonk.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; + +/** + * + * @author fireshoes + */ +public class FleetFootedMonk extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with power 2 or greater"); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 1)); + } + + public FleetFootedMonk(UUID ownerId) { + super(ownerId, 177, "Fleet-Footed Monk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "POR"; + this.subtype.add("Human"); + this.subtype.add("Monk"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Fleet-Footed Monk can't be blocked by creatures with power 2 or greater. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + } + + public FleetFootedMonk(final FleetFootedMonk card) { + super(card); + } + + @Override + public FleetFootedMonk copy() { + return new FleetFootedMonk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/Fruition.java b/Mage.Sets/src/mage/sets/portal/Fruition.java new file mode 100644 index 00000000000..43ed21c5e6f --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/Fruition.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author fireshoes + */ +public class Fruition extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("for each Forest on the battlefield"); + + static { + filter.add(new SubtypePredicate("Forest")); + } + + public Fruition(UUID ownerId) { + super(ownerId, 91, "Fruition", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{G}"); + this.expansionSetCode = "POR"; + + // You gain 1 life for each Forest on the battlefield. + this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter))); + } + + public Fruition(final Fruition card) { + super(card); + } + + @Override + public Fruition copy() { + return new Fruition(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/HandOfDeath.java b/Mage.Sets/src/mage/sets/portal/HandOfDeath1.java similarity index 85% rename from Mage.Sets/src/mage/sets/portal/HandOfDeath.java rename to Mage.Sets/src/mage/sets/portal/HandOfDeath1.java index 65f858f7b1c..8cc4b9e9b5f 100644 --- a/Mage.Sets/src/mage/sets/portal/HandOfDeath.java +++ b/Mage.Sets/src/mage/sets/portal/HandOfDeath1.java @@ -1,52 +1,52 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.portal; - -import java.util.UUID; - -/** - * - * @author anonymous - */ -public class HandOfDeath extends mage.sets.starter2000.HandOfDeath { - - public HandOfDeath(UUID ownerId) { - super(ownerId); - this.cardNumber = 14; - this.expansionSetCode = "POR"; - } - - public HandOfDeath(final HandOfDeath card) { - super(card); - } - - @Override - public HandOfDeath copy() { - return new HandOfDeath(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class HandOfDeath1 extends mage.sets.starter2000.HandOfDeath { + + public HandOfDeath1(UUID ownerId) { + super(ownerId); + this.cardNumber = 18; + this.expansionSetCode = "POR"; + } + + public HandOfDeath1(final HandOfDeath1 card) { + super(card); + } + + @Override + public HandOfDeath1 copy() { + return new HandOfDeath1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/HandOfDeath2.java b/Mage.Sets/src/mage/sets/portal/HandOfDeath2.java new file mode 100644 index 00000000000..1ccf01bbc15 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/HandOfDeath2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class HandOfDeath2 extends mage.sets.starter2000.HandOfDeath { + + public HandOfDeath2(UUID ownerId) { + super(ownerId); + this.cardNumber = 19; + this.expansionSetCode = "POR"; + } + + public HandOfDeath2(final HandOfDeath2 card) { + super(card); + } + + @Override + public HandOfDeath2 copy() { + return new HandOfDeath2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/IngeniousThief.java b/Mage.Sets/src/mage/sets/portal/IngeniousThief.java new file mode 100644 index 00000000000..37e244c39e5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/IngeniousThief.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.LookAtTargetPlayerHandEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class IngeniousThief extends CardImpl { + + public IngeniousThief(UUID ownerId) { + super(ownerId, 59, "Ingenious Thief", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "POR"; + this.subtype.add("Human"); + this.subtype.add("Rogue"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Ingenious Thief enters the battlefield, look at target player's hand. + Ability ability = new EntersBattlefieldTriggeredAbility(new LookAtTargetPlayerHandEffect(), false); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public IngeniousThief(final IngeniousThief card) { + super(card); + } + + @Override + public IngeniousThief copy() { + return new IngeniousThief(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/LastChance.java b/Mage.Sets/src/mage/sets/portal/LastChance.java new file mode 100644 index 00000000000..629b96cd8eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/LastChance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class LastChance extends mage.sets.masterseditioniv.LastChance { + + public LastChance(UUID ownerId) { + super(ownerId); + this.cardNumber = 141; + this.expansionSetCode = "POR"; + } + + public LastChance(final LastChance card) { + super(card); + } + + @Override + public LastChance copy() { + return new LastChance(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/MindKnives.java b/Mage.Sets/src/mage/sets/portal/MindKnives.java new file mode 100644 index 00000000000..fcfb7dc7dc6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/MindKnives.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class MindKnives extends CardImpl { + + public MindKnives(UUID ownerId) { + super(ownerId, 23, "Mind Knives", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{B}"); + this.expansionSetCode = "POR"; + + // Target opponent discards a card at random. + this.getSpellAbility().addEffect(new DiscardTargetEffect(1, true)); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public MindKnives(final MindKnives card) { + super(card); + } + + @Override + public MindKnives copy() { + return new MindKnives(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/Mobilize.java b/Mage.Sets/src/mage/sets/portal/Mobilize.java new file mode 100644 index 00000000000..91b84ebb252 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/Mobilize.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.effects.common.UntapAllControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Mobilize extends CardImpl { + + private static final String rule = "untap all creatures you control"; + + public Mobilize(UUID ownerId) { + super(ownerId, 97, "Mobilize", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{G}"); + this.expansionSetCode = "POR"; + + // Untap all creatures you control. + this.getSpellAbility().addEffect(new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), rule)); + } + + public Mobilize(final Mobilize card) { + super(card); + } + + @Override + public Mobilize copy() { + return new Mobilize(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/MonstrousGrowth.java b/Mage.Sets/src/mage/sets/portal/MonstrousGrowth1.java similarity index 87% rename from Mage.Sets/src/mage/sets/portal/MonstrousGrowth.java rename to Mage.Sets/src/mage/sets/portal/MonstrousGrowth1.java index 2a4a89c39be..24188f146e8 100644 --- a/Mage.Sets/src/mage/sets/portal/MonstrousGrowth.java +++ b/Mage.Sets/src/mage/sets/portal/MonstrousGrowth1.java @@ -33,20 +33,20 @@ import java.util.UUID; * * @author Plopman */ -public class MonstrousGrowth extends mage.sets.seventhedition.MonstrousGrowth { +public class MonstrousGrowth1 extends mage.sets.seventhedition.MonstrousGrowth { - public MonstrousGrowth(UUID ownerId) { + public MonstrousGrowth1(UUID ownerId) { super(ownerId); this.cardNumber = 98; this.expansionSetCode = "POR"; } - public MonstrousGrowth(final MonstrousGrowth card) { + public MonstrousGrowth1(final MonstrousGrowth1 card) { super(card); } @Override - public MonstrousGrowth copy() { - return new MonstrousGrowth(this); + public MonstrousGrowth1 copy() { + return new MonstrousGrowth1(this); } } diff --git a/Mage.Sets/src/mage/sets/portal/MonstrousGrowth2.java b/Mage.Sets/src/mage/sets/portal/MonstrousGrowth2.java new file mode 100644 index 00000000000..eb54028cfa7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/MonstrousGrowth2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class MonstrousGrowth2 extends mage.sets.seventhedition.MonstrousGrowth { + + public MonstrousGrowth2(UUID ownerId) { + super(ownerId); + this.cardNumber = 99; + this.expansionSetCode = "POR"; + } + + public MonstrousGrowth2(final MonstrousGrowth2 card) { + super(card); + } + + @Override + public MonstrousGrowth2 copy() { + return new MonstrousGrowth2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/MysticDenial.java b/Mage.Sets/src/mage/sets/portal/MysticDenial.java new file mode 100644 index 00000000000..94dc18ea422 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/MysticDenial.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + */ +public class MysticDenial extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("creature or sorcery spell"); + + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.SORCERY))); + } + + public MysticDenial(UUID ownerId) { + super(ownerId, 62, "Mystic Denial", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); + this.expansionSetCode = "POR"; + + // Counter target creature or sorcery spell. + this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + } + + public MysticDenial(final MysticDenial card) { + super(card); + } + + @Override + public MysticDenial copy() { + return new MysticDenial(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/NaturesCloak.java b/Mage.Sets/src/mage/sets/portal/NaturesCloak.java new file mode 100644 index 00000000000..747aacad573 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/NaturesCloak.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class NaturesCloak extends mage.sets.starter1999.NaturesCloak { + + public NaturesCloak(UUID ownerId) { + super(ownerId); + this.cardNumber = 103; + this.expansionSetCode = "POR"; + } + + public NaturesCloak(final NaturesCloak card) { + super(card); + } + + @Override + public NaturesCloak copy() { + return new NaturesCloak(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/NoxiousToad.java b/Mage.Sets/src/mage/sets/portal/NoxiousToad.java new file mode 100644 index 00000000000..f899da2f659 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/NoxiousToad.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author fireshoes + */ +public class NoxiousToad extends CardImpl { + + public NoxiousToad(UUID ownerId) { + super(ownerId, 27, "Noxious Toad", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "POR"; + this.subtype.add("Frog"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Noxious Toad dies, each opponent discards a card. + this.addAbility(new DiesTriggeredAbility(new DiscardEachPlayerEffect(TargetController.OPPONENT), false)); + } + + public NoxiousToad(final NoxiousToad card) { + super(card); + } + + @Override + public NoxiousToad copy() { + return new NoxiousToad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/Omen.java b/Mage.Sets/src/mage/sets/portal/Omen.java new file mode 100644 index 00000000000..9ecc65472b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/Omen.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LookLibraryControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Omen extends CardImpl { + + public Omen(UUID ownerId) { + super(ownerId, 63, "Omen", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{U}"); + this.expansionSetCode = "POR"; + + // Look at the top three cards of your library, then put them back in any order. You may shuffle your library. + this.getSpellAbility().addEffect(new LookLibraryControllerEffect(3, true)); + + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public Omen(final Omen card) { + super(card); + } + + @Override + public Omen copy() { + return new Omen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/RagingGoblin.java b/Mage.Sets/src/mage/sets/portal/RagingGoblin1.java similarity index 88% rename from Mage.Sets/src/mage/sets/portal/RagingGoblin.java rename to Mage.Sets/src/mage/sets/portal/RagingGoblin1.java index a3e2bf5ce58..e43a721f054 100644 --- a/Mage.Sets/src/mage/sets/portal/RagingGoblin.java +++ b/Mage.Sets/src/mage/sets/portal/RagingGoblin1.java @@ -33,20 +33,20 @@ import java.util.UUID; * * @author Plopman */ -public class RagingGoblin extends mage.sets.tenthedition.RagingGoblin { +public class RagingGoblin1 extends mage.sets.tenthedition.RagingGoblin { - public RagingGoblin(UUID ownerId) { + public RagingGoblin1(UUID ownerId) { super(ownerId); this.cardNumber = 150; this.expansionSetCode = "POR"; } - public RagingGoblin(final RagingGoblin card) { + public RagingGoblin1(final RagingGoblin1 card) { super(card); } @Override - public RagingGoblin copy() { - return new RagingGoblin(this); + public RagingGoblin1 copy() { + return new RagingGoblin1(this); } } diff --git a/Mage.Sets/src/mage/sets/portal/RagingGoblin2.java b/Mage.Sets/src/mage/sets/portal/RagingGoblin2.java new file mode 100644 index 00000000000..84361fc83ce --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/RagingGoblin2.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author Plopman + */ +public class RagingGoblin2 extends mage.sets.tenthedition.RagingGoblin { + + public RagingGoblin2(UUID ownerId) { + super(ownerId); + this.cardNumber = 151; + this.expansionSetCode = "POR"; + } + + public RagingGoblin2(final RagingGoblin2 card) { + super(card); + } + + @Override + public RagingGoblin2 copy() { + return new RagingGoblin2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/RenewingDawn.java b/Mage.Sets/src/mage/sets/portal/RenewingDawn.java new file mode 100644 index 00000000000..7d1d1c4056c --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/RenewingDawn.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.MultipliedValue; +import mage.abilities.dynamicvalue.common.PermanentsTargetOpponentControlsCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class RenewingDawn extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Mountain"); + + static { + filter.add(new SubtypePredicate("Mountain")); + } + + public RenewingDawn(UUID ownerId) { + super(ownerId, 185, "Renewing Dawn", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{W}"); + this.expansionSetCode = "POR"; + + // You gain 2 life for each Mountain target opponent controls. + DynamicValue amount = new MultipliedValue(new PermanentsTargetOpponentControlsCount(filter), 2); + Effect effect = new GainLifeEffect(amount); + effect.setText("You gain 2 life for each Mountain target opponent controls"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public RenewingDawn(final RenewingDawn card) { + super(card); + } + + @Override + public RenewingDawn copy() { + return new RenewingDawn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/SacredKnight.java b/Mage.Sets/src/mage/sets/portal/SacredKnight.java new file mode 100644 index 00000000000..2b74e7b460a --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/SacredKnight.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author fireshoes + */ +public class SacredKnight extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("black and/or red creatures"); + + static { + filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK), + (new ColorPredicate(ObjectColor.RED)))); + } + + public SacredKnight(UUID ownerId) { + super(ownerId, 186, "Sacred Knight", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "POR"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Sacred Knight can't be blocked by black and/or red creatures. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + } + + public SacredKnight(final SacredKnight card) { + super(card); + } + + @Override + public SacredKnight copy() { + return new SacredKnight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/ScorchingSpear.java b/Mage.Sets/src/mage/sets/portal/ScorchingSpear.java new file mode 100644 index 00000000000..b19a5211c78 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/ScorchingSpear.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ScorchingSpear extends mage.sets.starter1999.ScorchingSpear { + + public ScorchingSpear(UUID ownerId) { + super(ownerId); + this.cardNumber = 154; + this.expansionSetCode = "POR"; + } + + public ScorchingSpear(final ScorchingSpear card) { + super(card); + } + + @Override + public ScorchingSpear copy() { + return new ScorchingSpear(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/SerpentAssassin.java b/Mage.Sets/src/mage/sets/portal/SerpentAssassin.java new file mode 100644 index 00000000000..bda795bbe89 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/SerpentAssassin.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class SerpentAssassin extends CardImpl { + + public static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public SerpentAssassin(UUID ownerId) { + super(ownerId, 31, "Serpent Assassin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "POR"; + this.subtype.add("Snake"); + this.subtype.add("Assassin"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Serpent Assassin enters the battlefield, you may destroy target nonblack creature. + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public SerpentAssassin(final SerpentAssassin card) { + super(card); + } + + @Override + public SerpentAssassin copy() { + return new SerpentAssassin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/SorcerousSight.java b/Mage.Sets/src/mage/sets/portal/SorcerousSight.java new file mode 100644 index 00000000000..ebe908a5389 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/SorcerousSight.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LookAtTargetPlayerHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class SorcerousSight extends CardImpl { + + public SorcerousSight(UUID ownerId) { + super(ownerId, 69, "Sorcerous Sight", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); + this.expansionSetCode = "POR"; + + // Look at target opponent's hand. + Effect effect = new LookAtTargetPlayerHandEffect(); + effect.setText("Look at target opponent's hand"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetOpponent()); + + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public SorcerousSight(final SorcerousSight card) { + super(card); + } + + @Override + public SorcerousSight copy() { + return new SorcerousSight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/SoulShred.java b/Mage.Sets/src/mage/sets/portal/SoulShred.java new file mode 100644 index 00000000000..b357ce6ecfc --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/SoulShred.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SoulShred extends mage.sets.masterseditioniv.SoulShred { + + public SoulShred(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "POR"; + } + + public SoulShred(final SoulShred card) { + super(card); + } + + @Override + public SoulShred copy() { + return new SoulShred(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/SpiritualGuardian.java b/Mage.Sets/src/mage/sets/portal/SpiritualGuardian.java new file mode 100644 index 00000000000..04df7d20122 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/SpiritualGuardian.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class SpiritualGuardian extends CardImpl { + + public SpiritualGuardian(UUID ownerId) { + super(ownerId, 189, "Spiritual Guardian", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "POR"; + this.subtype.add("Spirit"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // When Spiritual Guardian enters the battlefield, you gain 4 life. + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4), false)); + } + + public SpiritualGuardian(final SpiritualGuardian card) { + super(card); + } + + @Override + public SpiritualGuardian copy() { + return new SpiritualGuardian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/Steadfastness.java b/Mage.Sets/src/mage/sets/portal/Steadfastness.java new file mode 100644 index 00000000000..ee102d439b4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/Steadfastness.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Steadfastness extends mage.sets.starter1999.Steadfastness { + + public Steadfastness(UUID ownerId) { + super(ownerId); + this.cardNumber = 193; + this.expansionSetCode = "POR"; + } + + public Steadfastness(final Steadfastness card) { + super(card); + } + + @Override + public Steadfastness copy() { + return new Steadfastness(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/SymbolOfUnsummoning.java b/Mage.Sets/src/mage/sets/portal/SymbolOfUnsummoning.java new file mode 100644 index 00000000000..271b7bb144b --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/SymbolOfUnsummoning.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author nigelzor + */ +public class SymbolOfUnsummoning extends CardImpl { + + public SymbolOfUnsummoning(UUID ownerId) { + super(ownerId, 71, "Symbol of Unsummoning", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "POR"; + + // Return target creature to its owner's hand. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public SymbolOfUnsummoning(final SymbolOfUnsummoning card) { + super(card); + } + + @Override + public SymbolOfUnsummoning copy() { + return new SymbolOfUnsummoning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/ThingFromTheDeep.java b/Mage.Sets/src/mage/sets/portal/ThingFromTheDeep.java new file mode 100644 index 00000000000..89b110e6d30 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/ThingFromTheDeep.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ThingFromTheDeep extends mage.sets.masterseditioniv.ThingFromTheDeep { + + public ThingFromTheDeep(UUID ownerId) { + super(ownerId); + this.cardNumber = 74; + this.expansionSetCode = "POR"; + } + + public ThingFromTheDeep(final ThingFromTheDeep card) { + super(card); + } + + @Override + public ThingFromTheDeep copy() { + return new ThingFromTheDeep(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/ThunderingWurm.java b/Mage.Sets/src/mage/sets/portal/ThunderingWurm.java new file mode 100644 index 00000000000..bbb6fc0ad62 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/ThunderingWurm.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandCard; + +/** + * + * @author fireshoes + */ +public class ThunderingWurm extends CardImpl { + + public ThunderingWurm(UUID ownerId) { + super(ownerId, 115, "Thundering Wurm", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "POR"; + this.subtype.add("Wurm"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // When Thundering Wurm enters the battlefield, sacrifice it unless you discard a land card. + Effect effect = new SacrificeSourceUnlessPaysEffect(new DiscardCardCost(new FilterLandCard("a land card"))); + effect.setText("sacrifice it unless you discard a land card"); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); + } + + public ThunderingWurm(final ThunderingWurm card) { + super(card); + } + + @Override + public ThunderingWurm copy() { + return new ThunderingWurm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/Thundermare.java b/Mage.Sets/src/mage/sets/portal/Thundermare.java new file mode 100644 index 00000000000..51a6fb7b48a --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/Thundermare.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.TapAllEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LoneFox + */ +public class Thundermare extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("other creatures"); + + static { + filter.add(new AnotherPredicate()); + } + + public Thundermare(UUID ownerId) { + super(ownerId, 158, "Thundermare", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}"); + this.expansionSetCode = "POR"; + this.subtype.add("Elemental"); + this.subtype.add("Horse"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // When Thundermare enters the battlefield, tap all other creatures. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TapAllEffect(filter))); + } + + public Thundermare(final Thundermare card) { + super(card); + } + + @Override + public Thundermare copy() { + return new Thundermare(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/TouchOfBrilliance.java b/Mage.Sets/src/mage/sets/portal/TouchOfBrilliance.java new file mode 100644 index 00000000000..9ae563b566c --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/TouchOfBrilliance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class TouchOfBrilliance extends mage.sets.portalsecondage.TouchOfBrilliance { + + public TouchOfBrilliance(UUID ownerId) { + super(ownerId); + this.cardNumber = 77; + this.expansionSetCode = "POR"; + } + + public TouchOfBrilliance(final TouchOfBrilliance card) { + super(card); + } + + @Override + public TouchOfBrilliance copy() { + return new TouchOfBrilliance(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/UndyingBeast.java b/Mage.Sets/src/mage/sets/portal/UndyingBeast.java new file mode 100644 index 00000000000..9489ba1f77c --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/UndyingBeast.java @@ -0,0 +1,97 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class UndyingBeast extends CardImpl { + + public UndyingBeast(UUID ownerId) { + super(ownerId, 36, "Undying Beast", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "POR"; + this.subtype.add("Beast"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // When Undying Beast dies, put it on top of its owner's library. + this.addAbility(new DiesTriggeredAbility(new UndyingBeastEffect())); + } + + public UndyingBeast(final UndyingBeast card) { + super(card); + } + + @Override + public UndyingBeast copy() { + return new UndyingBeast(this); + } +} + +class UndyingBeastEffect extends OneShotEffect { + + public UndyingBeastEffect() { + super(Outcome.ReturnToHand); + staticText = "put it on top of its owner's library"; + } + + public UndyingBeastEffect(final UndyingBeastEffect effect) { + super(effect); + } + + @Override + public UndyingBeastEffect copy() { + return new UndyingBeastEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(source.getSourceId()); + if (card != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { + Player owner = game.getPlayer(card.getOwnerId()); + owner.getGraveyard().remove(card); + return card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/portal/ValorousCharge.java b/Mage.Sets/src/mage/sets/portal/ValorousCharge.java new file mode 100644 index 00000000000..475cd987add --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/ValorousCharge.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author fireshoes + */ +public class ValorousCharge extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public ValorousCharge(UUID ownerId) { + super(ownerId, 196, "Valorous Charge", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{W}{W}"); + this.expansionSetCode = "POR"; + + // White creatures get +2/+0 until end of turn. + this.getSpellAbility().addEffect(new BoostAllEffect(2, 0, Duration.EndOfTurn, filter, false)); + } + + public ValorousCharge(final ValorousCharge card) { + super(card); + } + + @Override + public ValorousCharge copy() { + return new ValorousCharge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/VampiricFeast.java b/Mage.Sets/src/mage/sets/portal/VampiricFeast.java new file mode 100644 index 00000000000..6cb232c8037 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/VampiricFeast.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class VampiricFeast extends CardImpl { + + public VampiricFeast(UUID ownerId) { + super(ownerId, 37, "Vampiric Feast", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{5}{B}{B}"); + this.expansionSetCode = "POR"; + + // Vampiric Feast deals 4 damage to target creature or player and you gain 4 life. + Effect effect = new DamageTargetEffect(4); + effect.setText("{this} deals 4 damage to target creature or player"); + this.getSpellAbility().addEffect(effect); + // and you gain 4 life. + effect = new GainLifeEffect(4); + effect.setText("and you gain 4 life"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public VampiricFeast(final VampiricFeast card) { + super(card); + } + + @Override + public VampiricFeast copy() { + return new VampiricFeast(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/VampiricTouch.java b/Mage.Sets/src/mage/sets/portal/VampiricTouch.java new file mode 100644 index 00000000000..e1bf82c771b --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/VampiricTouch.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class VampiricTouch extends CardImpl { + + public VampiricTouch(UUID ownerId) { + super(ownerId, 38, "Vampiric Touch", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}"); + this.expansionSetCode = "POR"; + + // Vampiric Touch deals 2 damage to target opponent and you gain 2 life. + Effect effect = new DamageTargetEffect(2); + effect.setText("{this} deals 2 damage to target opponent"); + this.getSpellAbility().addEffect(effect); + effect = new GainLifeEffect(2); + effect.setText("and you gain 2 life"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public VampiricTouch(final VampiricTouch card) { + super(card); + } + + @Override + public VampiricTouch copy() { + return new VampiricTouch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/WarriorsCharge1.java b/Mage.Sets/src/mage/sets/portal/WarriorsCharge1.java new file mode 100644 index 00000000000..d98e1e52736 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/WarriorsCharge1.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class WarriorsCharge1 extends CardImpl { + + public WarriorsCharge1(UUID ownerId) { + super(ownerId, 200, "Warrior's Charge", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "POR"; + + // Creatures you control get +1/+1 until end of turn. + this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); + } + + public WarriorsCharge1(final WarriorsCharge1 card) { + super(card); + } + + @Override + public WarriorsCharge1 copy() { + return new WarriorsCharge1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/WarriorsCharge2.java b/Mage.Sets/src/mage/sets/portal/WarriorsCharge2.java new file mode 100644 index 00000000000..9c3d686cba1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/WarriorsCharge2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WarriorsCharge2 extends mage.sets.portal.WarriorsCharge1 { + + public WarriorsCharge2(UUID ownerId) { + super(ownerId); + this.cardNumber = 201; + } + + public WarriorsCharge2(final WarriorsCharge2 card) { + super(card); + } + + @Override + public WarriorsCharge2 copy() { + return new WarriorsCharge2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/WickedPact.java b/Mage.Sets/src/mage/sets/portal/WickedPact.java new file mode 100644 index 00000000000..814ac4a641a --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/WickedPact.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portal; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class WickedPact extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public WickedPact(UUID ownerId) { + super(ownerId, 40, "Wicked Pact", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); + this.expansionSetCode = "POR"; + + // Destroy two target nonblack creatures. You lose 5 life. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, filter, false)); + this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(5)); + } + + public WickedPact(final WickedPact card) { + super(card); + } + + @Override + public WickedPact copy() { + return new WickedPact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/AbyssalNightstalker.java b/Mage.Sets/src/mage/sets/portalsecondage/AbyssalNightstalker.java new file mode 100644 index 00000000000..9514f3b27e3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/AbyssalNightstalker.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; + +/** + * + * @author LoneFox + */ +public class AbyssalNightstalker extends CardImpl { + + public AbyssalNightstalker(UUID ownerId) { + super(ownerId, 1, "Abyssal Nightstalker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "PO2"; + this.subtype.add("Nightstalker"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Abyssal Nightstalker attacks and isn't blocked, defending player discards a card. + Effect effect = new DiscardTargetEffect(1); + effect.setText("defending player discards a card"); + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(effect, false, true)); + } + + public AbyssalNightstalker(final AbyssalNightstalker card) { + super(card); + } + + @Override + public AbyssalNightstalker copy() { + return new AbyssalNightstalker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/AngelOfFury.java b/Mage.Sets/src/mage/sets/portalsecondage/AngelOfFury.java new file mode 100644 index 00000000000..4b439141963 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/AngelOfFury.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.ShuffleIntoLibrarySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class AngelOfFury extends CardImpl { + + public AngelOfFury(UUID ownerId) { + super(ownerId, 127, "Angel of Fury", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + this.expansionSetCode = "PO2"; + this.subtype.add("Angel"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Angel of Fury is put into your graveyard from the battlefield, you may shuffle it into your library. + this.addAbility(new DiesTriggeredAbility(new ShuffleIntoLibrarySourceEffect(), true)); + } + + public AngelOfFury(final AngelOfFury card) { + super(card); + } + + @Override + public AngelOfFury copy() { + return new AngelOfFury(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/DakmorPlague.java b/Mage.Sets/src/mage/sets/portalsecondage/DakmorPlague.java new file mode 100644 index 00000000000..aba3368403b --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/DakmorPlague.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DakmorPlague extends mage.sets.starter1999.DakmorPlague { + + public DakmorPlague(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "PO2"; + } + + public DakmorPlague(final DakmorPlague card) { + super(card); + } + + @Override + public DakmorPlague copy() { + return new DakmorPlague(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/DeathcoilWurm.java b/Mage.Sets/src/mage/sets/portalsecondage/DeathcoilWurm.java new file mode 100644 index 00000000000..88383036963 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/DeathcoilWurm.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DamageAsThoughNotBlockedAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author nigelzor + */ +public class DeathcoilWurm extends CardImpl { + + public DeathcoilWurm(UUID ownerId) { + super(ownerId, 65, "Deathcoil Wurm", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{G}{G}"); + this.expansionSetCode = "PO2"; + this.subtype.add("Wurm"); + this.power = new MageInt(7); + this.toughness = new MageInt(6); + + // You may have Deathcoil Wurm assign its combat damage as though it weren't blocked. + this.addAbility(DamageAsThoughNotBlockedAbility.getInstance()); + } + + public DeathcoilWurm(final DeathcoilWurm card) { + super(card); + } + + @Override + public DeathcoilWurm copy() { + return new DeathcoilWurm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/DejaVu.java b/Mage.Sets/src/mage/sets/portalsecondage/DejaVu.java new file mode 100644 index 00000000000..86e3c48c098 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/DejaVu.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DejaVu extends mage.sets.portal.DejaVu { + + public DejaVu(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "PO2"; + } + + public DejaVu(final DejaVu card) { + super(card); + } + + @Override + public DejaVu copy() { + return new DejaVu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/DenizenOfTheDeep.java b/Mage.Sets/src/mage/sets/portalsecondage/DenizenOfTheDeep.java new file mode 100644 index 00000000000..6a651acbe73 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/DenizenOfTheDeep.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DenizenOfTheDeep extends mage.sets.tenthedition.DenizenOfTheDeep { + + public DenizenOfTheDeep(UUID ownerId) { + super(ownerId); + this.cardNumber = 36; + this.expansionSetCode = "PO2"; + } + + public DenizenOfTheDeep(final DenizenOfTheDeep card) { + super(card); + } + + @Override + public DenizenOfTheDeep copy() { + return new DenizenOfTheDeep(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/Extinguish.java b/Mage.Sets/src/mage/sets/portalsecondage/Extinguish.java new file mode 100644 index 00000000000..4ce95004029 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/Extinguish.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + */ +public class Extinguish extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("sorcery spell"); + + static { + filter.add(new CardTypePredicate(CardType.SORCERY)); + } + + public Extinguish(UUID ownerId) { + super(ownerId, 38, "Extinguish", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "PO2"; + + // Counter target sorcery spell. + this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + } + + public Extinguish(final Extinguish card) { + super(card); + } + + @Override + public Extinguish copy() { + return new Extinguish(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/JaggedLightning.java b/Mage.Sets/src/mage/sets/portalsecondage/JaggedLightning.java new file mode 100644 index 00000000000..e3288cd2418 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/JaggedLightning.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class JaggedLightning extends mage.sets.urzassaga.JaggedLightning { + + public JaggedLightning(UUID ownerId) { + super(ownerId); + this.cardNumber = 106; + this.expansionSetCode = "PO2"; + } + + public JaggedLightning(final JaggedLightning card) { + super(card); + } + + @Override + public JaggedLightning copy() { + return new JaggedLightning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/MysticDenial.java b/Mage.Sets/src/mage/sets/portalsecondage/MysticDenial.java new file mode 100644 index 00000000000..c814123cb55 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/MysticDenial.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MysticDenial extends mage.sets.portal.MysticDenial { + + public MysticDenial(UUID ownerId) { + super(ownerId); + this.cardNumber = 41; + this.expansionSetCode = "PO2"; + } + + public MysticDenial(final MysticDenial card) { + super(card); + } + + @Override + public MysticDenial copy() { + return new MysticDenial(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/SylvanYeti.java b/Mage.Sets/src/mage/sets/portalsecondage/SylvanYeti.java new file mode 100644 index 00000000000..afd4a6b14be --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/SylvanYeti.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SylvanYeti extends mage.sets.starter1999.SylvanYeti { + + public SylvanYeti(UUID ownerId) { + super(ownerId); + this.cardNumber = 87; + this.expansionSetCode = "PO2"; + } + + public SylvanYeti(final SylvanYeti card) { + super(card); + } + + @Override + public SylvanYeti copy() { + return new SylvanYeti(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/TouchOfBrilliance.java b/Mage.Sets/src/mage/sets/portalsecondage/TouchOfBrilliance.java new file mode 100644 index 00000000000..cfe638a689b --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/TouchOfBrilliance.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalsecondage; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TouchOfBrilliance extends CardImpl { + + public TouchOfBrilliance(UUID ownerId) { + super(ownerId, 58, "Touch of Brilliance", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{U}"); + this.expansionSetCode = "PO2"; + + // Draw two cards. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2)); + } + + public TouchOfBrilliance(final TouchOfBrilliance card) { + super(card); + } + + @Override + public TouchOfBrilliance copy() { + return new TouchOfBrilliance(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/BarbarianGeneral.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/BarbarianGeneral.java new file mode 100644 index 00000000000..87abf4b050b --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/BarbarianGeneral.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class BarbarianGeneral extends CardImpl { + + public BarbarianGeneral(UUID ownerId) { + super(ownerId, 100, "Barbarian General", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Barbarian"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + } + + public BarbarianGeneral(final BarbarianGeneral card) { + super(card); + } + + @Override + public BarbarianGeneral copy() { + return new BarbarianGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/BorrowingTheEastWind.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/BorrowingTheEastWind.java new file mode 100644 index 00000000000..31ccf10a387 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/BorrowingTheEastWind.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class BorrowingTheEastWind extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with horsemanship"); + + static { + filter.add(new AbilityPredicate(HorsemanshipAbility.class)); + } + + public BorrowingTheEastWind(UUID ownerId) { + super(ownerId, 133, "Borrowing the East Wind", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{G}{G}"); + this.expansionSetCode = "PTK"; + + // Borrowing the East Wind deals X damage to each creature with horsemanship and each player. + this.getSpellAbility().addEffect(new DamageEverythingEffect(new ManacostVariableValue(), filter)); } + + public BorrowingTheEastWind(final BorrowingTheEastWind card) { + super(card); + } + + @Override + public BorrowingTheEastWind copy() { + return new BorrowingTheEastWind(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/BrokenDam.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/BrokenDam.java new file mode 100644 index 00000000000..698ebcd5b1d --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/BrokenDam.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class BrokenDam extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.add(Predicates.not(new AbilityPredicate(HorsemanshipAbility.class))); + } + + public BrokenDam(UUID ownerId) { + super(ownerId, 37, "Broken Dam", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); + this.expansionSetCode = "PTK"; + + // Tap one or two target creatures without horsemanship. + this.getSpellAbility().addEffect(new TapTargetEffect("one or two target creatures without horsemanship")); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(1, 2, filter, false)); + } + + public BrokenDam(final BrokenDam card) { + super(card); + } + + @Override + public BrokenDam copy() { + return new BrokenDam(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/BurningFields.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/BurningFields.java new file mode 100644 index 00000000000..402d09f0305 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/BurningFields.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author LoneFox + */ +public class BurningFields extends CardImpl { + + public BurningFields(UUID ownerId) { + super(ownerId, 103, "Burning Fields", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{R}"); + this.expansionSetCode = "PTK"; + + // Burning Fields deals 5 damage to target opponent. + this.getSpellAbility().addTarget(new TargetOpponent()); + this.getSpellAbility().addEffect(new DamageTargetEffect(5)); + } + + public BurningFields(final BurningFields card) { + super(card); + } + + @Override + public BurningFields copy() { + return new BurningFields(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/CaoRenWeiCommander.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/CaoRenWeiCommander.java new file mode 100644 index 00000000000..8bf4749d878 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/CaoRenWeiCommander.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CaoRenWeiCommander extends CardImpl { + + public CaoRenWeiCommander(UUID ownerId) { + super(ownerId, 69, "Cao Ren, Wei Commander", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // When Cao Ren, Wei Commander enters the battlefield, you lose 3 life. + this.addAbility(new EntersBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(3))); + } + + public CaoRenWeiCommander(final CaoRenWeiCommander card) { + super(card); + } + + @Override + public CaoRenWeiCommander copy() { + return new CaoRenWeiCommander(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/CorruptCourtOfficial.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/CorruptCourtOfficial.java new file mode 100644 index 00000000000..9f2a8abf50d --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/CorruptCourtOfficial.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author LoneFox + */ +public class CorruptCourtOfficial extends CardImpl { + + public CorruptCourtOfficial(UUID ownerId) { + super(ownerId, 71, "Corrupt Court Official", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Advisor"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Corrupt Court Official enters the battlefield, target opponent discards a card. + Ability ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1)); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public CorruptCourtOfficial(final CorruptCourtOfficial card) { + super(card); + } + + @Override + public CorruptCourtOfficial copy() { + return new CorruptCourtOfficial(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/CorruptEunuchs.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/CorruptEunuchs.java new file mode 100644 index 00000000000..f3177279c15 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/CorruptEunuchs.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CorruptEunuchs extends mage.sets.masterseditioniii.CorruptEunuchs { + + public CorruptEunuchs(UUID ownerId) { + super(ownerId); + this.cardNumber = 106; + this.expansionSetCode = "PTK"; + } + + public CorruptEunuchs(final CorruptEunuchs card) { + super(card); + } + + @Override + public CorruptEunuchs copy() { + return new CorruptEunuchs(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/CouncilOfAdvisors.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/CouncilOfAdvisors.java new file mode 100644 index 00000000000..3d2eeda876b --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/CouncilOfAdvisors.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CouncilOfAdvisors extends CardImpl { + + public CouncilOfAdvisors(UUID ownerId) { + super(ownerId, 40, "Council of Advisors", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Advisor"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Council of Advisors enters the battlefield, draw a card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); + } + + public CouncilOfAdvisors(final CouncilOfAdvisors card) { + super(card); + } + + @Override + public CouncilOfAdvisors copy() { + return new CouncilOfAdvisors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/DesertSandstorm.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/DesertSandstorm.java new file mode 100644 index 00000000000..88e0093051f --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/DesertSandstorm.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.DamageAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DesertSandstorm extends CardImpl { + + public DesertSandstorm(UUID ownerId) { + super(ownerId, 107, "Desert Sandstorm", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{R}"); + this.expansionSetCode = "PTK"; + + // Desert Sandstorm deals 1 damage to each creature. + this.getSpellAbility().addEffect(new DamageAllEffect(1, new FilterCreaturePermanent())); + } + + public DesertSandstorm(final DesertSandstorm card) { + super(card); + } + + @Override + public DesertSandstorm copy() { + return new DesertSandstorm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/DesperateCharge.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/DesperateCharge.java new file mode 100644 index 00000000000..d5fcab16d6d --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/DesperateCharge.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class DesperateCharge extends CardImpl { + + public DesperateCharge(UUID ownerId) { + super(ownerId, 74, "Desperate Charge", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{B}"); + this.expansionSetCode = "PTK"; + + // Creatures you control get +2/+0 until end of turn. + this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Duration.EndOfTurn)); + } + + public DesperateCharge(final DesperateCharge card) { + super(card); + } + + @Override + public DesperateCharge copy() { + return new DesperateCharge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/DongZhouTheTyrant.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/DongZhouTheTyrant.java new file mode 100644 index 00000000000..6fc74eb1296 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/DongZhouTheTyrant.java @@ -0,0 +1,114 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class DongZhouTheTyrant extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public DongZhouTheTyrant(UUID ownerId) { + super(ownerId, 109, "Dong Zhou, the Tyrant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Dong Zhou, the Tyrant enters the battlefield, target creature an opponent controls deals damage equal to its power to that player. + Ability ability = new EntersBattlefieldTriggeredAbility(new DongZhouTheTyrantEffect(), false); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public DongZhouTheTyrant(final DongZhouTheTyrant card) { + super(card); + } + + @Override + public DongZhouTheTyrant copy() { + return new DongZhouTheTyrant(this); + } +} + +class DongZhouTheTyrantEffect extends OneShotEffect { + + public DongZhouTheTyrantEffect() { + super(Outcome.Damage); + staticText = "target creature an opponent controls deals damage equal to its power to that player"; + } + + public DongZhouTheTyrantEffect(final DongZhouTheTyrantEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanent(source.getFirstTarget()); + if (creature != null) { + int amount = creature.getPower().getValue(); + Player controller = game.getPlayer(creature.getControllerId()); + if (controller != null) { + controller.damage(amount, creature.getId(), game, false, true); + return true; + } + } + return false; + } + + @Override + public DongZhouTheTyrantEffect copy() { + return new DongZhouTheTyrantEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/Extinguish.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/Extinguish.java new file mode 100644 index 00000000000..796af8ca00f --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/Extinguish.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Extinguish extends mage.sets.portalsecondage.Extinguish { + + public Extinguish(UUID ownerId) { + super(ownerId); + this.cardNumber = 43; + this.expansionSetCode = "PTK"; + } + + public Extinguish(final Extinguish card) { + super(card); + } + + @Override + public Extinguish copy() { + return new Extinguish(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/FalseMourning.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/FalseMourning.java new file mode 100644 index 00000000000..5f33ccffb45 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/FalseMourning.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LoneFox + */ +public class FalseMourning extends CardImpl { + + public FalseMourning(UUID ownerId) { + super(ownerId, 134, "False Mourning", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{G}"); + this.expansionSetCode = "PTK"; + + // Put target card from your graveyard on top of your library. + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard()); + } + + public FalseMourning(final FalseMourning card) { + super(card); + } + + @Override + public FalseMourning copy() { + return new FalseMourning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/FlankingTroops.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/FlankingTroops.java new file mode 100644 index 00000000000..d6c3305c138 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/FlankingTroops.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FlankingTroops extends CardImpl { + + public FlankingTroops(UUID ownerId) { + super(ownerId, 5, "Flanking Troops", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Flanking Troops attacks, you may tap target creature. + Ability ability = new AttacksTriggeredAbility(new TapTargetEffect(), true); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FlankingTroops(final FlankingTroops card) { + super(card); + } + + @Override + public FlankingTroops copy() { + return new FlankingTroops(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ForcedRetreat.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ForcedRetreat.java new file mode 100644 index 00000000000..21f5c31634e --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ForcedRetreat.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ForcedRetreat extends mage.sets.masterseditioniii.ForcedRetreat { + + public ForcedRetreat(UUID ownerId) { + super(ownerId); + this.cardNumber = 44; + this.expansionSetCode = "PTK"; + } + + public ForcedRetreat(final ForcedRetreat card) { + super(card); + } + + @Override + public ForcedRetreat copy() { + return new ForcedRetreat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/GhostlyVisit.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/GhostlyVisit.java new file mode 100644 index 00000000000..7f481d21d42 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/GhostlyVisit.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class GhostlyVisit extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public GhostlyVisit(UUID ownerId) { + super(ownerId, 76, "Ghostly Visit", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}"); + this.expansionSetCode = "PTK"; + + // Destroy target nonblack creature. + this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + } + + public GhostlyVisit(final GhostlyVisit card) { + super(card); + } + + @Override + public GhostlyVisit copy() { + return new GhostlyVisit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYuSaintedWarrior.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYuSaintedWarrior.java new file mode 100644 index 00000000000..a5ad17bba71 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYuSaintedWarrior.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class GuanYuSaintedWarrior extends mage.sets.masterseditioniii.GuanYuSaintedWarrior { + + public GuanYuSaintedWarrior(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "PTK"; + this.rarity = Rarity.RARE; + } + + public GuanYuSaintedWarrior(final GuanYuSaintedWarrior card) { + super(card); + } + + @Override + public GuanYuSaintedWarrior copy() { + return new GuanYuSaintedWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYus1000LiMarch.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYus1000LiMarch.java new file mode 100644 index 00000000000..8f6b260b422 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYus1000LiMarch.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class GuanYus1000LiMarch extends mage.sets.masterseditioniii.GuanYus1000LiMarch { + + public GuanYus1000LiMarch(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "PTK"; + } + + public GuanYus1000LiMarch(final GuanYus1000LiMarch card) { + super(card); + } + + @Override + public GuanYus1000LiMarch copy() { + return new GuanYus1000LiMarch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/HuntingCheetah.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/HuntingCheetah.java new file mode 100644 index 00000000000..b7df3c83fbf --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/HuntingCheetah.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToOpponentTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LoneFox + */ +public class HuntingCheetah extends CardImpl { + + private static final FilterCard filter = new FilterCard("Forest card"); + + static { + filter.add(new SubtypePredicate("Forest")); + } + + public HuntingCheetah(UUID ownerId) { + super(ownerId, 138, "Hunting Cheetah", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Cat"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Whenever Hunting Cheetah deals damage to an opponent, you may search your library for a Forest card, reveal that card, put it into your hand, then shuffle your library. + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true), true)); + } + + public HuntingCheetah(final HuntingCheetah card) { + super(card); + } + + @Override + public HuntingCheetah copy() { + return new HuntingCheetah(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/LadyZhurongWarriorQueen.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/LadyZhurongWarriorQueen.java new file mode 100644 index 00000000000..fd5918fba0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/LadyZhurongWarriorQueen.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LadyZhurongWarriorQueen extends CardImpl { + + public LadyZhurongWarriorQueen(UUID ownerId) { + super(ownerId, 139, "Lady Zhurong, Warrior Queen", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + } + + public LadyZhurongWarriorQueen(final LadyZhurongWarriorQueen card) { + super(card); + } + + @Override + public LadyZhurongWarriorQueen copy() { + return new LadyZhurongWarriorQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/LiuBeiLordOfShu.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/LiuBeiLordOfShu.java new file mode 100644 index 00000000000..104fa35252f --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/LiuBeiLordOfShu.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.NamePredicate; + +/** + * + * @author LoneFox + */ +public class LiuBeiLordOfShu extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent(); + + static { + filter.add(Predicates.or(new NamePredicate("Guan Yu, Sainted Warrior"), + new NamePredicate("Zhang Fei, Fierce Warrior"))); + } + + public LiuBeiLordOfShu(UUID ownerId) { + super(ownerId, 11, "Liu Bei, Lord of Shu", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Liu Bei, Lord of Shu gets +2/+2 as long as you control a permanent named Guan Yu, Sainted Warrior or a permanent named Zhang Fei, Fierce Warrior. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), + new PermanentsOnTheBattlefieldCondition(filter), + "{this} gets +2/+2 as long as you control a permanent named Guan Yu, Sainted Warrior or a permanent named Zhang Fei, Fierce Warrior"))); + } + + public LiuBeiLordOfShu(final LiuBeiLordOfShu card) { + super(card); + } + + @Override + public LiuBeiLordOfShu copy() { + return new LiuBeiLordOfShu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/LuMengWuGeneral.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/LuMengWuGeneral.java new file mode 100644 index 00000000000..1692ad121d6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/LuMengWuGeneral.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LuMengWuGeneral extends CardImpl { + + public LuMengWuGeneral(UUID ownerId) { + super(ownerId, 46, "Lu Meng, Wu General", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + } + + public LuMengWuGeneral(final LuMengWuGeneral card) { + super(card); + } + + @Override + public LuMengWuGeneral copy() { + return new LuMengWuGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/MaChaoWesternWarrior.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/MaChaoWesternWarrior.java new file mode 100644 index 00000000000..02d3e2c645a --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/MaChaoWesternWarrior.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class MaChaoWesternWarrior extends CardImpl { + + public MaChaoWesternWarrior(UUID ownerId) { + super(ownerId, 116, "Ma Chao, Western Warrior", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Whenever Ma Chao, Western Warrior attacks alone, it can't be blocked this combat. + Effect effect = new CantBeBlockedSourceEffect(Duration.EndOfCombat); + effect.setText("it can't be blocked this combat"); + this.addAbility(new AttacksAloneTriggeredAbility(effect)); + } + + public MaChaoWesternWarrior(final MaChaoWesternWarrior card) { + super(card); + } + + @Override + public MaChaoWesternWarrior copy() { + return new MaChaoWesternWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/MysticDenial.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/MysticDenial.java new file mode 100644 index 00000000000..242b23636e8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/MysticDenial.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MysticDenial extends mage.sets.portal.MysticDenial { + + public MysticDenial(UUID ownerId) { + super(ownerId); + this.cardNumber = 49; + this.expansionSetCode = "PTK"; + } + + public MysticDenial(final MysticDenial card) { + super(card); + } + + @Override + public MysticDenial copy() { + return new MysticDenial(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/PoisonArrow.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/PoisonArrow.java new file mode 100644 index 00000000000..a2c2617a16f --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/PoisonArrow.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class PoisonArrow extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public PoisonArrow(UUID ownerId) { + super(ownerId, 80, "Poison Arrow", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{B}{B}"); + this.expansionSetCode = "PTK"; + + // Destroy target nonblack creature. You gain 3 life. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addEffect(new GainLifeEffect(3)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + } + + public PoisonArrow(final PoisonArrow card) { + super(card); + } + + @Override + public PoisonArrow copy() { + return new PoisonArrow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ReturnToBattle.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ReturnToBattle.java new file mode 100644 index 00000000000..b383044698b --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ReturnToBattle.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LoneFox + */ +public class ReturnToBattle extends CardImpl { + + public ReturnToBattle(UUID ownerId) { + super(ownerId, 81, "Return to Battle", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}"); + this.expansionSetCode = "PTK"; + + // Return target creature card from your graveyard to your hand. + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + } + + public ReturnToBattle(final ReturnToBattle card) { + super(card); + } + + @Override + public ReturnToBattle copy() { + return new ReturnToBattle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/RidingRedHare.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/RidingRedHare.java new file mode 100644 index 00000000000..3a946867abc --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/RidingRedHare.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class RidingRedHare extends CardImpl { + + public RidingRedHare(UUID ownerId) { + super(ownerId, 18, "Riding Red Hare", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "PTK"; + + // Target creature gets +3/+3 and gains horsemanship until end of turn. + Effect effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn); + effect.setText("Target creature gets +3/+3"); + this.getSpellAbility().addEffect(effect); + effect = new GainAbilityTargetEffect(HorsemanshipAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains horsemanship until end of turn"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public RidingRedHare(final RidingRedHare card) { + super(card); + } + + @Override + public RidingRedHare copy() { + return new RidingRedHare(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/RidingTheDiluHorse.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/RidingTheDiluHorse.java new file mode 100644 index 00000000000..12887868cab --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/RidingTheDiluHorse.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class RidingTheDiluHorse extends mage.sets.masterseditioniii.RidingTheDiluHorse { + + public RidingTheDiluHorse(UUID ownerId) { + super(ownerId); + this.cardNumber = 144; + this.expansionSetCode = "PTK"; + this.rarity = Rarity.RARE; + } + + public RidingTheDiluHorse(final RidingTheDiluHorse card) { + super(card); + } + + @Override + public RidingTheDiluHorse copy() { + return new RidingTheDiluHorse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/RockslideAmbush.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/RockslideAmbush.java new file mode 100644 index 00000000000..528a5f5016e --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/RockslideAmbush.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class RockslideAmbush extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Mountain you control"); + + static { + filter.add(new SubtypePredicate("Mountain")); + } + + public RockslideAmbush(UUID ownerId) { + super(ownerId, 121, "Rockslide Ambush", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); + this.expansionSetCode = "PTK"; + + // Rockslide Ambush deals damage to target creature equal to the number of Mountains you control. + this.getSpellAbility().addEffect(new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter))); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public RockslideAmbush(final RockslideAmbush card) { + super(card); + } + + @Override + public RockslideAmbush copy() { + return new RockslideAmbush(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/SagesKnowledge.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/SagesKnowledge.java new file mode 100644 index 00000000000..2ede43fdb7d --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/SagesKnowledge.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LoneFox + */ +public class SagesKnowledge extends CardImpl { + + public static final FilterCard filter = new FilterCard("sorcery card from your graveyard"); + + static { + filter.add(new CardTypePredicate(CardType.SORCERY)); + } + + public SagesKnowledge(UUID ownerId) { + super(ownerId, 52, "Sage's Knowledge", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "PTK"; + + // Return target sorcery card from your graveyard to your hand. + this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); + } + + public SagesKnowledge(final SagesKnowledge card) { + super(card); + } + + @Override + public SagesKnowledge copy() { + return new SagesKnowledge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuCavalry.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuCavalry.java new file mode 100644 index 00000000000..70b8f85a5a2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuCavalry.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ShuCavalry extends mage.sets.masterseditioniii.ShuCavalry { + + public ShuCavalry(UUID ownerId) { + super(ownerId); + this.cardNumber = 19; + this.expansionSetCode = "PTK"; + } + + public ShuCavalry(final ShuCavalry card) { + super(card); + } + + @Override + public ShuCavalry copy() { + return new ShuCavalry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuDefender.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuDefender.java new file mode 100644 index 00000000000..30532cf1f45 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuDefender.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ShuDefender extends CardImpl { + + public ShuDefender(UUID ownerId) { + super(ownerId, 20, "Shu Defender", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Shu Defender blocks, it gets +0/+2 until end of turn. + this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(0, 2, Duration.EndOfTurn), false)); + } + + public ShuDefender(final ShuDefender card) { + super(card); + } + + @Override + public ShuDefender copy() { + return new ShuDefender(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuEliteCompanions.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuEliteCompanions.java new file mode 100644 index 00000000000..5b00f9e97a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuEliteCompanions.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ShuEliteCompanions extends mage.sets.masterseditioniii.ShuEliteCompanions { + + public ShuEliteCompanions(UUID ownerId) { + super(ownerId); + this.cardNumber = 21; + this.expansionSetCode = "PTK"; + this.rarity = Rarity.UNCOMMON; + } + + public ShuEliteCompanions(final ShuEliteCompanions card) { + super(card); + } + + @Override + public ShuEliteCompanions copy() { + return new ShuEliteCompanions(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuGeneral.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuGeneral.java new file mode 100644 index 00000000000..8e507e1eb9f --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuGeneral.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ShuGeneral extends CardImpl { + + public ShuGeneral(UUID ownerId) { + super(ownerId, 25, "Shu General", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Vigilance; horsemanship + this.addAbility(VigilanceAbility.getInstance()); + this.addAbility(HorsemanshipAbility.getInstance()); + } + + public ShuGeneral(final ShuGeneral card) { + super(card); + } + + @Override + public ShuGeneral copy() { + return new ShuGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuGrainCaravan.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuGrainCaravan.java new file mode 100644 index 00000000000..965843b0092 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuGrainCaravan.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ShuGrainCaravan extends CardImpl { + + public ShuGrainCaravan(UUID ownerId) { + super(ownerId, 26, "Shu Grain Caravan", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Shu Grain Caravan enters the battlefield, you gain 2 life. + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(2))); + } + + public ShuGrainCaravan(final ShuGrainCaravan card) { + super(card); + } + + @Override + public ShuGrainCaravan copy() { + return new ShuGrainCaravan(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuSoldierFarmers.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuSoldierFarmers.java new file mode 100644 index 00000000000..d039e4d206a --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuSoldierFarmers.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ShuSoldierFarmers extends CardImpl { + + public ShuSoldierFarmers(UUID ownerId) { + super(ownerId, 27, "Shu Soldier-Farmers", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // When Shu Soldier-Farmers enters the battlefield, you gain 4 life. + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4))); + } + + public ShuSoldierFarmers(final ShuSoldierFarmers card) { + super(card); + } + + @Override + public ShuSoldierFarmers copy() { + return new ShuSoldierFarmers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/SimaYiWeiFieldMarshal.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/SimaYiWeiFieldMarshal.java new file mode 100644 index 00000000000..1080daa8204 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/SimaYiWeiFieldMarshal.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class SimaYiWeiFieldMarshal extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Swamps you control"); + + static{ + filter.add(new SubtypePredicate("Swamp")); + } + + public SimaYiWeiFieldMarshal(UUID ownerId) { + super(ownerId, 82, "Sima Yi, Wei Field Marshal", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Sima Yi, Wei Field Marshal's power is equal to the number of Swamps you control. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); } + + public SimaYiWeiFieldMarshal(final SimaYiWeiFieldMarshal card) { + super(card); + } + + @Override + public SimaYiWeiFieldMarshal copy() { + return new SimaYiWeiFieldMarshal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/SlashingTiger.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/SlashingTiger.java new file mode 100644 index 00000000000..fa80e8677c5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/SlashingTiger.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SlashingTiger extends CardImpl { + + public SlashingTiger(UUID ownerId) { + super(ownerId, 145, "Slashing Tiger", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Cat"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Slashing Tiger becomes blocked, it gets +2/+2 until end of turn. + this.addAbility(new BecomesBlockedTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false)); + } + + public SlashingTiger(final SlashingTiger card) { + super(card); + } + + @Override + public SlashingTiger copy() { + return new SlashingTiger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/SpringOfEternalPeace.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/SpringOfEternalPeace.java new file mode 100644 index 00000000000..c088936511b --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/SpringOfEternalPeace.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SpringOfEternalPeace extends CardImpl { + + public SpringOfEternalPeace(UUID ownerId) { + super(ownerId, 148, "Spring of Eternal Peace", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); + this.expansionSetCode = "PTK"; + + // You gain 8 life. + this.getSpellAbility().addEffect(new GainLifeEffect(8)); + } + + public SpringOfEternalPeace(final SpringOfEternalPeace card) { + super(card); + } + + @Override + public SpringOfEternalPeace copy() { + return new SpringOfEternalPeace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/StolenGrain.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/StolenGrain.java new file mode 100644 index 00000000000..794a7c58930 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/StolenGrain.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class StolenGrain extends mage.sets.masterseditioniii.StolenGrain { + + public StolenGrain(UUID ownerId) { + super(ownerId); + this.cardNumber = 83; + this.expansionSetCode = "PTK"; + } + + public StolenGrain(final StolenGrain card) { + super(card); + } + + @Override + public StolenGrain copy() { + return new StolenGrain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/SunCeYoungConquerer.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/SunCeYoungConquerer.java new file mode 100644 index 00000000000..da5fcfdebcf --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/SunCeYoungConquerer.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SunCeYoungConquerer extends mage.sets.masterseditioniii.SunCeYoungConquerer { + + public SunCeYoungConquerer(UUID ownerId) { + super(ownerId); + this.cardNumber = 55; + this.expansionSetCode = "PTK"; + this.rarity = Rarity.RARE; + } + + public SunCeYoungConquerer(final SunCeYoungConquerer card) { + super(card); + } + + @Override + public SunCeYoungConquerer copy() { + return new SunCeYoungConquerer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/TaoistMystic.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/TaoistMystic.java new file mode 100644 index 00000000000..655f5825eb1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/TaoistMystic.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class TaoistMystic extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with horsemanship"); + + static { + filter.add(new AbilityPredicate(HorsemanshipAbility.class)); + } + + public TaoistMystic(UUID ownerId) { + super(ownerId, 151, "Taoist Mystic", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Mystic"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Taoist Mystic can't be blocked by creatures with horsemanship. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + } + + public TaoistMystic(final TaoistMystic card) { + super(card); + } + + @Override + public TaoistMystic copy() { + return new TaoistMystic(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/TrainedCheetah.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/TrainedCheetah.java new file mode 100644 index 00000000000..51fe695f0c8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/TrainedCheetah.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TrainedCheetah extends CardImpl { + + public TrainedCheetah(UUID ownerId) { + super(ownerId, 154, "Trained Cheetah", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Cat"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Trained Cheetah becomes blocked, it gets +1/+1 until end of turn. + this.addAbility(new BecomesBlockedTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false)); + } + + public TrainedCheetah(final TrainedCheetah card) { + super(card); + } + + @Override + public TrainedCheetah copy() { + return new TrainedCheetah(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/TripWire.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/TripWire.java new file mode 100644 index 00000000000..ee30216aae1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/TripWire.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TripWire extends mage.sets.masterseditioniii.TripWire { + + public TripWire(UUID ownerId) { + super(ownerId); + this.cardNumber = 156; + this.expansionSetCode = "PTK"; + this.rarity = Rarity.UNCOMMON; + } + + public TripWire(final TripWire card) { + super(card); + } + + @Override + public TripWire copy() { + return new TripWire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/VirtuousCharge.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/VirtuousCharge.java new file mode 100644 index 00000000000..ba2a99e8a7d --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/VirtuousCharge.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class VirtuousCharge extends CardImpl { + + public VirtuousCharge(UUID ownerId) { + super(ownerId, 29, "Virtuous Charge", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "PTK"; + + // Creatures you control get +1/+1 until end of turn. + this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); + } + + public VirtuousCharge(final VirtuousCharge card) { + super(card); + } + + @Override + public VirtuousCharge copy() { + return new VirtuousCharge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WarriorsOath.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WarriorsOath.java new file mode 100644 index 00000000000..99f7170b29d --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WarriorsOath.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WarriorsOath extends CardImpl { + + public WarriorsOath(UUID ownerId) { + super(ownerId, 124, "Warrior's Oath", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{R}{R}"); + this.expansionSetCode = "PTK"; + + // Take an extra turn after this one. At the beginning of that turn's end step, you lose the game. + this.getSpellAbility().addEffect(new AddExtraTurnControllerEffect(true)); + } + + public WarriorsOath(final WarriorsOath card) { + super(card); + } + + @Override + public WarriorsOath copy() { + return new WarriorsOath(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiAmbushForce.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiAmbushForce.java new file mode 100644 index 00000000000..6b5af019f7b --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiAmbushForce.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WeiAmbushForce extends CardImpl { + + public WeiAmbushForce(UUID ownerId) { + super(ownerId, 85, "Wei Ambush Force", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Wei Ambush Force attacks, it gets +2/+0 until end of turn. + this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn), false)); + } + + public WeiAmbushForce(final WeiAmbushForce card) { + super(card); + } + + @Override + public WeiAmbushForce copy() { + return new WeiAmbushForce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiEliteCompanions.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiEliteCompanions.java new file mode 100644 index 00000000000..667ef3c730e --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiEliteCompanions.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WeiEliteCompanions extends mage.sets.masterseditioniii.WeiEliteCompanions { + + public WeiEliteCompanions(UUID ownerId) { + super(ownerId); + this.cardNumber = 87; + this.expansionSetCode = "PTK"; + this.rarity = Rarity.UNCOMMON; + } + + public WeiEliteCompanions(final WeiEliteCompanions card) { + super(card); + } + + @Override + public WeiEliteCompanions copy() { + return new WeiEliteCompanions(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java new file mode 100644 index 00000000000..4d3b709a32f --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToOpponentTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WeiNightRaiders extends CardImpl { + + public WeiNightRaiders(UUID ownerId) { + super(ownerId, 89, "Wei Night Raiders", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Whenever Wei Night Raiders deals damage to an opponent, that player discards a card. + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1), false, false, true)); + } + + public WeiNightRaiders(final WeiNightRaiders card) { + super(card); + } + + @Override + public WeiNightRaiders copy() { + return new WeiNightRaiders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiScout.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiScout.java new file mode 100644 index 00000000000..41435c2fc79 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiScout.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WeiScout extends CardImpl { + + public WeiScout(UUID ownerId) { + super(ownerId, 90, "Wei Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Scout"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + } + + public WeiScout(final WeiScout card) { + super(card); + } + + @Override + public WeiScout copy() { + return new WeiScout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiStrikeForce.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiStrikeForce.java new file mode 100644 index 00000000000..4dad25498cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiStrikeForce.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WeiStrikeForce extends CardImpl { + + public WeiStrikeForce(UUID ownerId) { + super(ownerId, 91, "Wei Strike Force", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + } + + public WeiStrikeForce(final WeiStrikeForce card) { + super(card); + } + + @Override + public WeiStrikeForce copy() { + return new WeiStrikeForce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WieldingTheGreenDragon.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WieldingTheGreenDragon.java new file mode 100644 index 00000000000..9e6f56d4b96 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WieldingTheGreenDragon.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class WieldingTheGreenDragon extends CardImpl { + + public WieldingTheGreenDragon(UUID ownerId) { + super(ownerId, 157, "Wielding the Green Dragon", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); + this.expansionSetCode = "PTK"; + + // Target creature gets +4/+4 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(4, 4, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public WieldingTheGreenDragon(final WieldingTheGreenDragon card) { + super(card); + } + + @Override + public WieldingTheGreenDragon copy() { + return new WieldingTheGreenDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WolfPack.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WolfPack.java new file mode 100644 index 00000000000..89dd5e32a52 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WolfPack.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WolfPack extends mage.sets.masterseditionii.WolfPack { + + public WolfPack(UUID ownerId) { + super(ownerId); + this.cardNumber = 158; + this.expansionSetCode = "PTK"; + } + + public WolfPack(final WolfPack card) { + super(card); + } + + @Override + public WolfPack copy() { + return new WolfPack(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WuAdmiral.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WuAdmiral.java new file mode 100644 index 00000000000..9d732edec3a --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WuAdmiral.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LoneFox + */ +public class WuAdmiral extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent(); + + static { + filter.add(new SubtypePredicate("Island")); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public WuAdmiral(UUID ownerId) { + super(ownerId, 57, "Wu Admiral", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Wu Admiral gets +1/+1 as long as an opponent controls an Island. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0, false), + "{this} gets +1/+1 as long as an opponent controls an Island"))); + } + + public WuAdmiral(final WuAdmiral card) { + super(card); + } + + @Override + public WuAdmiral copy() { + return new WuAdmiral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WuEliteCavalry.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WuEliteCavalry.java new file mode 100644 index 00000000000..105baab9092 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WuEliteCavalry.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WuEliteCavalry extends CardImpl { + + public WuEliteCavalry(UUID ownerId) { + super(ownerId, 58, "Wu Elite Cavalry", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + } + + public WuEliteCavalry(final WuEliteCavalry card) { + super(card); + } + + @Override + public WuEliteCavalry copy() { + return new WuEliteCavalry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WuLightCavalry.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WuLightCavalry.java new file mode 100644 index 00000000000..7b134a16aad --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WuLightCavalry.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WuLightCavalry extends CardImpl { + + public WuLightCavalry(UUID ownerId) { + super(ownerId, 60, "Wu Light Cavalry", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + } + + public WuLightCavalry(final WuLightCavalry card) { + super(card); + } + + @Override + public WuLightCavalry copy() { + return new WuLightCavalry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WuScout.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WuScout.java new file mode 100644 index 00000000000..9e21e745d98 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WuScout.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.LookAtTargetPlayerHandEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author LoneFox + */ +public class WuScout extends CardImpl { + + public WuScout(UUID ownerId) { + super(ownerId, 62, "Wu Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Scout"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // When Wu Scout enters the battlefield, look at target opponent's hand. + Effect effect = new LookAtTargetPlayerHandEffect(); + effect.setText("look at target opponent's hand"); + Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public WuScout(final WuScout card) { + super(card); + } + + @Override + public WuScout copy() { + return new WuScout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/YellowScarvesCavalry.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/YellowScarvesCavalry.java new file mode 100644 index 00000000000..b1467c910a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/YellowScarvesCavalry.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CantBlockAbility; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class YellowScarvesCavalry extends CardImpl { + + public YellowScarvesCavalry(UUID ownerId) { + super(ownerId, 125, "Yellow Scarves Cavalry", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Yellow Scarves Cavalry can't block. + this.addAbility(new CantBlockAbility()); + } + + public YellowScarvesCavalry(final YellowScarvesCavalry card) { + super(card); + } + + @Override + public YellowScarvesCavalry copy() { + return new YellowScarvesCavalry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/YellowScarvesGeneral.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/YellowScarvesGeneral.java new file mode 100644 index 00000000000..4d7c59888e0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/YellowScarvesGeneral.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CantBlockAbility; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class YellowScarvesGeneral extends CardImpl { + + public YellowScarvesGeneral(UUID ownerId) { + super(ownerId, 126, "Yellow Scarves General", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Yellow Scarves General can't block. + this.addAbility(new CantBlockAbility()); + } + + public YellowScarvesGeneral(final YellowScarvesGeneral card) { + super(card); + } + + @Override + public YellowScarvesGeneral copy() { + return new YellowScarvesGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/YellowScarvesTroops.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/YellowScarvesTroops.java new file mode 100644 index 00000000000..123664560a7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/YellowScarvesTroops.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CantBlockAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class YellowScarvesTroops extends CardImpl { + + public YellowScarvesTroops(UUID ownerId) { + super(ownerId, 127, "Yellow Scarves Troops", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Yellow Scarves Troops can't block. + this.addAbility(new CantBlockAbility()); + } + + public YellowScarvesTroops(final YellowScarvesTroops card) { + super(card); + } + + @Override + public YellowScarvesTroops copy() { + return new YellowScarvesTroops(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/YoungWeiRecruits.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/YoungWeiRecruits.java new file mode 100644 index 00000000000..83bf0b49464 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/YoungWeiRecruits.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class YoungWeiRecruits extends mage.sets.masterseditioniii.YoungWeiRecruits { + + public YoungWeiRecruits(UUID ownerId) { + super(ownerId); + this.cardNumber = 94; + this.expansionSetCode = "PTK"; + } + + public YoungWeiRecruits(final YoungWeiRecruits card) { + super(card); + } + + @Override + public YoungWeiRecruits copy() { + return new YoungWeiRecruits(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/YuanShaosInfantry.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/YuanShaosInfantry.java new file mode 100644 index 00000000000..7b082db19ce --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/YuanShaosInfantry.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class YuanShaosInfantry extends CardImpl { + + public YuanShaosInfantry(UUID ownerId) { + super(ownerId, 129, "Yuan Shao's Infantry", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Yuan Shao's Infantry attacks alone, Yuan Shao's Infantry can't be blocked this combat. + Effect effect = new CantBeBlockedSourceEffect(Duration.EndOfCombat); + effect.setText("it can't be blocked this combat"); + this.addAbility(new AttacksAloneTriggeredAbility(effect)); + } + + public YuanShaosInfantry(final YuanShaosInfantry card) { + super(card); + } + + @Override + public YuanShaosInfantry copy() { + return new YuanShaosInfantry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangFeiFierceWarrior.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangFeiFierceWarrior.java new file mode 100644 index 00000000000..75a46a4b62d --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangFeiFierceWarrior.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZhangFeiFierceWarrior extends mage.sets.masterseditioniii.ZhangFeiFierceWarrior { + + public ZhangFeiFierceWarrior(UUID ownerId) { + super(ownerId); + this.cardNumber = 32; + this.expansionSetCode = "PTK"; + this.rarity = Rarity.RARE; + } + + public ZhangFeiFierceWarrior(final ZhangFeiFierceWarrior card) { + super(card); + } + + @Override + public ZhangFeiFierceWarrior copy() { + return new ZhangFeiFierceWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangHeWeiGeneral.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangHeWeiGeneral.java new file mode 100644 index 00000000000..21d68409404 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangHeWeiGeneral.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ZhangHeWeiGeneral extends CardImpl { + + public ZhangHeWeiGeneral(UUID ownerId) { + super(ownerId, 95, "Zhang He, Wei General", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(4); + this.toughness = new MageInt(2); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Whenever Zhang He, Wei General attacks, each other creature you control gets +1/+0 until end of turn. + this.addAbility(new AttacksTriggeredAbility(new BoostControlledEffect(1, 0, Duration.EndOfTurn, + new FilterCreaturePermanent(), true), false)); + } + + public ZhangHeWeiGeneral(final ZhangHeWeiGeneral card) { + super(card); + } + + @Override + public ZhangHeWeiGeneral copy() { + return new ZhangHeWeiGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java new file mode 100644 index 00000000000..da66b3b4b90 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToOpponentTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZhangLiaoHeroOfHefei extends CardImpl { + + public ZhangLiaoHeroOfHefei(UUID ownerId) { + super(ownerId, 96, "Zhang Liao, Hero of Hefei", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Zhang Liao, Hero of Hefei deals damage to an opponent, that opponent discards a card. + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1), false, false, true)); + } + + public ZhangLiaoHeroOfHefei(final ZhangLiaoHeroOfHefei card) { + super(card); + } + + @Override + public ZhangLiaoHeroOfHefei copy() { + return new ZhangLiaoHeroOfHefei(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhaoZilongTigerGeneral.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhaoZilongTigerGeneral.java new file mode 100644 index 00000000000..221dd7ec38c --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhaoZilongTigerGeneral.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZhaoZilongTigerGeneral extends CardImpl { + + public ZhaoZilongTigerGeneral(UUID ownerId) { + super(ownerId, 33, "Zhao Zilong, Tiger General", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Whenever Zhao Zilong, Tiger General blocks, it gets +1/+1 until end of turn. + this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false)); + } + + public ZhaoZilongTigerGeneral(final ZhaoZilongTigerGeneral card) { + super(card); + } + + @Override + public ZhaoZilongTigerGeneral copy() { + return new ZhaoZilongTigerGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZodiacDragon.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZodiacDragon.java new file mode 100644 index 00000000000..3b6459ec951 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZodiacDragon.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZodiacDragon extends CardImpl { + + public ZodiacDragon(UUID ownerId) { + super(ownerId, 131, "Zodiac Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{7}{R}{R}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Dragon"); + this.power = new MageInt(8); + this.toughness = new MageInt(8); + + // When Zodiac Dragon is put into your graveyard from the battlefield, you may return it to your hand. + this.addAbility(new DiesTriggeredAbility(new ReturnToHandSourceEffect(), true)); + } + + public ZodiacDragon(final ZodiacDragon card) { + super(card); + } + + @Override + public ZodiacDragon copy() { + return new ZodiacDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZuoCiTheMockingSage.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZuoCiTheMockingSage.java new file mode 100644 index 00000000000..a85f7893719 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZuoCiTheMockingSage.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.keyword.HexproofAbility; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class ZuoCiTheMockingSage extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with horsemanship"); + + static { + filter.add(new AbilityPredicate(HorsemanshipAbility.class)); + } + + public ZuoCiTheMockingSage(UUID ownerId) { + super(ownerId, 165, "Zuo Ci, the Mocking Sage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Advisor"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Hexproof + this.addAbility(HexproofAbility.getInstance()); + // Zuo Ci, the Mocking Sage can't be blocked by creatures with horsemanship. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + } + + public ZuoCiTheMockingSage(final ZuoCiTheMockingSage card) { + super(card); + } + + @Override + public ZuoCiTheMockingSage copy() { + return new ZuoCiTheMockingSage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prereleaseevents/QuestingPhelddagrif.java b/Mage.Sets/src/mage/sets/prereleaseevents/QuestingPhelddagrif.java index 1aee4f8fb02..30f15d65b72 100644 --- a/Mage.Sets/src/mage/sets/prereleaseevents/QuestingPhelddagrif.java +++ b/Mage.Sets/src/mage/sets/prereleaseevents/QuestingPhelddagrif.java @@ -65,7 +65,7 @@ public class QuestingPhelddagrif extends CardImpl { } public QuestingPhelddagrif(UUID ownerId) { - super(ownerId, 13, "Questing Phelddagrif", Rarity.SPECIAL, new CardType[]{CardType.CREATURE}, "{1}{W}{U}{G}"); + super(ownerId, 13, "Questing Phelddagrif", Rarity.SPECIAL, new CardType[]{CardType.CREATURE}, "{1}{G}{W}{U}"); this.expansionSetCode = "PTC"; this.subtype.add("Phelddagrif"); this.power = new MageInt(4); diff --git a/Mage.Sets/src/mage/sets/prophecy/AlexisCloak.java b/Mage.Sets/src/mage/sets/prophecy/AlexisCloak.java new file mode 100644 index 00000000000..f2616d74fd2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/AlexisCloak.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlashAbility; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class AlexisCloak extends CardImpl { + + public AlexisCloak(UUID ownerId) { + super(ownerId, 29, "Alexi's Cloak", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Aura"); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature has shroud. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), AttachmentType.AURA))); + } + + public AlexisCloak(final AlexisCloak card) { + super(card); + } + + @Override + public AlexisCloak copy() { + return new AlexisCloak(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/AvatarOfMight.java b/Mage.Sets/src/mage/sets/prophecy/AvatarOfMight.java new file mode 100644 index 00000000000..8008f96f3df --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/AvatarOfMight.java @@ -0,0 +1,122 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.CostModificationType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class AvatarOfMight extends CardImpl { + + public AvatarOfMight(UUID ownerId) { + super(ownerId, 109, "Avatar of Might", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{G}{G}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Avatar"); + this.power = new MageInt(8); + this.toughness = new MageInt(8); + + // If an opponent controls at least four more creatures than you, Avatar of Might costs {6} less to cast. + this.addAbility(new SimpleStaticAbility(Zone.STACK, new AvatarOfMightCostReductionEffect())); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + } + + public AvatarOfMight(final AvatarOfMight card) { + super(card); + } + + @Override + public AvatarOfMight copy() { + return new AvatarOfMight(this); + } +} + +class AvatarOfMightCostReductionEffect extends CostModificationEffectImpl { + + AvatarOfMightCostReductionEffect() { + super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST); + staticText = "If an opponent controls at least four more creatures than you, {this} will costs {6} less to cast"; + } + + AvatarOfMightCostReductionEffect(final AvatarOfMightCostReductionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + Mana mana = spellAbility.getManaCostsToPay().getMana(); + if (mana.getColorless() > 0) { + int newCount = mana.getColorless() - 6; + if (newCount < 0) { + newCount = 0; + } + mana.setColorless(newCount); + spellAbility.getManaCostsToPay().load(mana.toString()); + return true; + } + return false; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + int creatures = game.getBattlefield().countAll(new FilterCreaturePermanent(), source.getControllerId(), game); + for (UUID playerId : game.getOpponents(source.getControllerId())) { + Player opponent = game.getPlayer(playerId); + if (opponent != null && game.getBattlefield().countAll(new FilterCreaturePermanent(), opponent.getId(), game) >= creatures + 4) { + return true; + } + } + return false; + } + + @Override + public AvatarOfMightCostReductionEffect copy() { + return new AvatarOfMightCostReductionEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/AvatarOfWill.java b/Mage.Sets/src/mage/sets/prophecy/AvatarOfWill.java new file mode 100644 index 00000000000..2dbd76b18b1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/AvatarOfWill.java @@ -0,0 +1,120 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.CostModificationType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class AvatarOfWill extends CardImpl { + + public AvatarOfWill(UUID ownerId) { + super(ownerId, 30, "Avatar of Will", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}{U}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Avatar"); + this.power = new MageInt(5); + this.toughness = new MageInt(6); + + // If an opponent has no cards in hand, Avatar of Will costs {6} less to cast. + this.addAbility(new SimpleStaticAbility(Zone.STACK, new AvatarOfWillCostReductionEffect())); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + } + + public AvatarOfWill(final AvatarOfWill card) { + super(card); + } + + @Override + public AvatarOfWill copy() { + return new AvatarOfWill(this); + } +} + +class AvatarOfWillCostReductionEffect extends CostModificationEffectImpl { + + AvatarOfWillCostReductionEffect() { + super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST); + staticText = "If an opponent has no cards in hand, {this} will costs {6} less to cast"; + } + + AvatarOfWillCostReductionEffect(final AvatarOfWillCostReductionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + Mana mana = spellAbility.getManaCostsToPay().getMana(); + if (mana.getColorless() > 0) { + int newCount = mana.getColorless() - 6; + if (newCount < 0) { + newCount = 0; + } + mana.setColorless(newCount); + spellAbility.getManaCostsToPay().load(mana.toString()); + return true; + } + return false; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + for (UUID playerId : game.getOpponents(source.getControllerId())) { + Player opponent = game.getPlayer(playerId); + if (opponent != null && opponent.getHand().isEmpty()) { + return true; + } + } + return false; + } + + @Override + public AvatarOfWillCostReductionEffect copy() { + return new AvatarOfWillCostReductionEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/BarbedField.java b/Mage.Sets/src/mage/sets/prophecy/BarbedField.java new file mode 100644 index 00000000000..794f5688e29 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/BarbedField.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreatureOrPlayer; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class BarbedField extends CardImpl { + + public BarbedField(UUID ownerId) { + super(ownerId, 83, "Barbed Field", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{R}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Aura"); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted land has "{tap}: This land deals 1 damage to target creature or player." + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + Effect effect = new GainAbilityAttachedEffect(ability, AttachmentType.AURA); + effect.setText("Enchanted land has \"{T}: This land deals 1 damage to target creature or player.\""); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public BarbedField(final BarbedField card) { + super(card); + } + + @Override + public BarbedField copy() { + return new BarbedField(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/ChillingApparition.java b/Mage.Sets/src/mage/sets/prophecy/ChillingApparition.java new file mode 100644 index 00000000000..816f89bac48 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/ChillingApparition.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class ChillingApparition extends CardImpl { + + public ChillingApparition(UUID ownerId) { + super(ownerId, 59, "Chilling Apparition", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Spirit"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {B}: Regenerate Chilling Apparition. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); + // Whenever Chilling Apparition deals combat damage to a player, that player discards a card. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1), false, true)); + } + + public ChillingApparition(final ChillingApparition card) { + super(card); + } + + @Override + public ChillingApparition copy() { + return new ChillingApparition(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/ChimericIdol.java b/Mage.Sets/src/mage/sets/prophecy/ChimericIdol.java index d5ec0ab43c3..166d82e9fb6 100644 --- a/Mage.Sets/src/mage/sets/prophecy/ChimericIdol.java +++ b/Mage.Sets/src/mage/sets/prophecy/ChimericIdol.java @@ -53,7 +53,7 @@ public class ChimericIdol extends CardImpl { this.expansionSetCode = "PCY"; // {0}: Tap all lands you control. Chimeric Idol becomes a 3/3 Turtle artifact creature until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapAllEffect(new FilterControlledLandPermanent("all lands you control")), new ManaCostsImpl("{0}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapAllEffect(new FilterControlledLandPermanent("lands you control")), new ManaCostsImpl("{0}")); ability.addEffect(new BecomesCreatureSourceEffect(new ChimericIdolToken(), "", Duration.EndOfTurn)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/prophecy/Darba.java b/Mage.Sets/src/mage/sets/prophecy/Darba.java new file mode 100644 index 00000000000..1b38dc0a470 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/Darba.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class Darba extends CardImpl { + + public Darba(UUID ownerId) { + super(ownerId, 111, "Darba", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Bird"); + this.subtype.add("Beast"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // At the beginning of your upkeep, sacrifice Darba unless you pay {G}{G}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{G}{G}")), TargetController.YOU, false)); + } + + public Darba(final Darba card) { + super(card); + } + + @Override + public Darba copy() { + return new Darba(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/Despoil.java b/Mage.Sets/src/mage/sets/prophecy/Despoil.java new file mode 100644 index 00000000000..9213946c2ef --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/Despoil.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.LoseLifeTargetControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class Despoil extends CardImpl { + + public Despoil(UUID ownerId) { + super(ownerId, 62, "Despoil", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{B}"); + this.expansionSetCode = "PCY"; + + // Destroy target land. Its controller loses 2 life. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addEffect(new LoseLifeTargetControllerEffect(2)); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + } + + public Despoil(final Despoil card) { + super(card); + } + + @Override + public Despoil copy() { + return new Despoil(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/Devastate.java b/Mage.Sets/src/mage/sets/prophecy/Devastate.java new file mode 100644 index 00000000000..20068f5e1bd --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/Devastate.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class Devastate extends CardImpl { + + public Devastate(UUID ownerId) { + super(ownerId, 87, "Devastate", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "PCY"; + + // Destroy target land. Devastate deals 1 damage to each creature and each player. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addEffect(new DamageEverythingEffect(1)); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + } + + public Devastate(final Devastate card) { + super(card); + } + + @Override + public Devastate copy() { + return new Devastate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/FenStalker.java b/Mage.Sets/src/mage/sets/prophecy/FenStalker.java new file mode 100644 index 00000000000..9a573268b67 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/FenStalker.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FearAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; + +/** + * + * @author LoneFox + */ +public class FenStalker extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent(); + + static { + filter.add(Predicates.not(new TappedPredicate())); + } + + public FenStalker(UUID ownerId) { + super(ownerId, 64, "Fen Stalker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Nightstalker"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Fen Stalker has fear as long as you control no untapped lands. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new GainAbilitySourceEffect(FearAbility.getInstance(), + Duration.WhileOnBattlefield), new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter)), + "{this} has fear as long as you control no untapped lands"))); + } + + public FenStalker(final FenStalker card) { + super(card); + } + + @Override + public FenStalker copy() { + return new FenStalker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/Flameshot.java b/Mage.Sets/src/mage/sets/prophecy/Flameshot.java new file mode 100644 index 00000000000..b4ff94e68b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/Flameshot.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.costs.AlternativeCostSourceAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.effects.common.DamageMultiEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetCreaturePermanentAmount; + +/** + * + * @author fireshoes + */ +public class Flameshot extends CardImpl { + + private static final FilterCard filter = new FilterCard("a Mountain card"); + + static { + filter.add(new SubtypePredicate("Mountain")); + } + + public Flameshot(UUID ownerId) { + super(ownerId, 90, "Flameshot", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); + this.expansionSetCode = "PCY"; + + // You may discard a Mountain card rather than pay Flameshot's mana cost. + this.addAbility(new AlternativeCostSourceAbility(new DiscardTargetCost(new TargetCardInHand(filter)))); + + // Flameshot deals 3 damage divided as you choose among one, two, or three target creatures. + this.getSpellAbility().addEffect(new DamageMultiEffect(3)); + this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(3)); + } + + public Flameshot(final Flameshot card) { + super(card); + } + + @Override + public Flameshot copy() { + return new Flameshot(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/FloweringField.java b/Mage.Sets/src/mage/sets/prophecy/FloweringField.java new file mode 100644 index 00000000000..87415a3e34b --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/FloweringField.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreatureOrPlayer; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class FloweringField extends CardImpl { + + public FloweringField(UUID ownerId) { + super(ownerId, 9, "Flowering Field", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Aura"); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted land has "{T}: Prevent the next 1 damage that would be dealt to target creature or player this turn." + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + Effect effect = new GainAbilityAttachedEffect(ability, AttachmentType.AURA); + effect.setText("Enchanted land has \"{T}: Prevent the next 1 damage that would be dealt to target creature or player this turn.\""); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public FloweringField(final FloweringField card) { + super(card); + } + + @Override + public FloweringField copy() { + return new FloweringField(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/HeightenedAwareness.java b/Mage.Sets/src/mage/sets/prophecy/HeightenedAwareness.java new file mode 100644 index 00000000000..777baabd404 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/HeightenedAwareness.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.common.BeginningOfDrawTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.discard.DiscardHandControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class HeightenedAwareness extends CardImpl { + + public HeightenedAwareness(UUID ownerId) { + super(ownerId, 37, "Heightened Awareness", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}"); + this.expansionSetCode = "PCY"; + + // As Heightened Awareness enters the battlefield, discard your hand. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DiscardHandControllerEffect())); + // At the beginning of your draw step, draw an additional card. + this.addAbility(new BeginningOfDrawTriggeredAbility(new DrawCardSourceControllerEffect(1), + TargetController.YOU, false)); + } + + public HeightenedAwareness(final HeightenedAwareness card) { + super(card); + } + + @Override + public HeightenedAwareness copy() { + return new HeightenedAwareness(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/InfernalGenesis.java b/Mage.Sets/src/mage/sets/prophecy/InfernalGenesis.java index 166bde321cf..9bcd7e97784 100644 --- a/Mage.Sets/src/mage/sets/prophecy/InfernalGenesis.java +++ b/Mage.Sets/src/mage/sets/prophecy/InfernalGenesis.java @@ -31,7 +31,6 @@ import java.util.UUID; import mage.constants.*; import mage.MageInt; -import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -51,7 +50,6 @@ public class InfernalGenesis extends CardImpl { super(ownerId, 68, "Infernal Genesis", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}{B}"); this.expansionSetCode = "PCY"; - // At the beginning of each player's upkeep, that player puts the top card of his or her library into his or her graveyard. Then he or she puts X 1/1 black Minion creature tokens onto the battlefield, where X is that card's converted mana cost. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new InfernalGenesisEffect(), TargetController.ANY, false)); } @@ -81,9 +79,9 @@ class InfernalGenesisEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); if (player != null) { - Card card = player.getLibrary().removeFromTop(game); + Card card = player.getLibrary().getFromTop(game); if (card != null) { - if (player.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game)) { + if (player.moveCards(card, Zone.GRAVEYARD, source, game)) { int cmc = card.getManaCost().convertedManaCost(); MinionToken token = new MinionToken(); token.putOntoBattlefield(cmc, game, source.getSourceId(), player.getId()); diff --git a/Mage.Sets/src/mage/sets/prophecy/JolraelEmpressOfBeasts.java b/Mage.Sets/src/mage/sets/prophecy/JolraelEmpressOfBeasts.java index b2c681bde0f..835d2329344 100644 --- a/Mage.Sets/src/mage/sets/prophecy/JolraelEmpressOfBeasts.java +++ b/Mage.Sets/src/mage/sets/prophecy/JolraelEmpressOfBeasts.java @@ -45,7 +45,7 @@ import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.FilterPermanent; import mage.filter.common.FilterLandPermanent; -import mage.filter.predicate.other.PlayerIdPredicate; +import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.permanent.token.Token; import mage.players.Player; @@ -106,7 +106,7 @@ class JolraelEmpressOfBeastsEffect extends OneShotEffect { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (targetPlayer != null) { FilterPermanent filter = new FilterLandPermanent(); - filter.add(new PlayerIdPredicate(targetPlayer.getId())); + filter.add(new ControllerIdPredicate(targetPlayer.getId())); game.addEffect(new BecomesCreatureAllEffect(new JolraelLandsToken(), "lands", filter, Duration.EndOfTurn), source); return true; } diff --git a/Mage.Sets/src/mage/sets/prophecy/LatullaKeldonOverseer.java b/Mage.Sets/src/mage/sets/prophecy/LatullaKeldonOverseer.java new file mode 100644 index 00000000000..5d7ca6f1de7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/LatullaKeldonOverseer.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class LatullaKeldonOverseer extends CardImpl { + + public LatullaKeldonOverseer(UUID ownerId) { + super(ownerId, 95, "Latulla, Keldon Overseer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "PCY"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {X}{R}, {tap}, Discard two cards: Latulla, Keldon Overseer deals X damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}{R}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, 2, new FilterCard("two cards")))); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public LatullaKeldonOverseer(final LatullaKeldonOverseer card) { + super(card); + } + + @Override + public LatullaKeldonOverseer copy() { + return new LatullaKeldonOverseer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/LivingTerrain.java b/Mage.Sets/src/mage/sets/prophecy/LivingTerrain.java index 2430cec8be6..1e2a615e112 100644 --- a/Mage.Sets/src/mage/sets/prophecy/LivingTerrain.java +++ b/Mage.Sets/src/mage/sets/prophecy/LivingTerrain.java @@ -80,7 +80,7 @@ class TreefolkToken extends Token { super("Treefolk", "5/6 green Treefolk creature"); cardType.add(CardType.CREATURE); this.color.setGreen(true); - subtype.add("Spirit"); + subtype.add("Treefolk"); power = new MageInt(5); toughness = new MageInt(6); } diff --git a/Mage.Sets/src/mage/sets/prophecy/MagetaTheLion.java b/Mage.Sets/src/mage/sets/prophecy/MagetaTheLion.java new file mode 100644 index 00000000000..d8bdc6221f7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/MagetaTheLion.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetCardInHand; + +/** + * + * @author fireshoes + */ +public class MagetaTheLion extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("creatures except for {this}"); + + static { + filter.add(new CardTypePredicate(CardType.CREATURE)); + filter.add(new AnotherPredicate()); + } + + public MagetaTheLion(UUID ownerId) { + super(ownerId, 13, "Mageta the Lion", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "PCY"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Spellshaper"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {2}{W}{W}, {tap}, Discard two cards: Destroy all creatures except for Mageta the Lion. Those creatures can't be regenerated. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyAllEffect(filter, true), new ManaCostsImpl("{2}{W}{W}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(2,2, new FilterCard("two cards")))); + this.addAbility(ability); + } + + public MagetaTheLion(final MagetaTheLion card) { + super(card); + } + + @Override + public MagetaTheLion copy() { + return new MagetaTheLion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/MagetasBoon.java b/Mage.Sets/src/mage/sets/prophecy/MagetasBoon.java new file mode 100644 index 00000000000..5d793edf443 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/MagetasBoon.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MagetasBoon extends CardImpl { + + public MagetasBoon(UUID ownerId) { + super(ownerId, 14, "Mageta's Boon", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Aura"); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +1/+2. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 2, Duration.WhileOnBattlefield))); + } + + public MagetasBoon(final MagetasBoon card) { + super(card); + } + + @Override + public MagetasBoon copy() { + return new MagetasBoon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/MercenaryInformer.java b/Mage.Sets/src/mage/sets/prophecy/MercenaryInformer.java new file mode 100644 index 00000000000..551ee698f35 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/MercenaryInformer.java @@ -0,0 +1,94 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CantBeTargetedSourceEffect; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterObject; +import mage.filter.FilterPermanent; +import mage.filter.FilterStackObject; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class MercenaryInformer extends CardImpl { + + private static final FilterObject filterBlack = new FilterStackObject("black spells or abilities from black sources"); + private static final FilterPermanent filterMercenary = new FilterPermanent("nontoken Mercenary"); + + static { + filterBlack.add(new ColorPredicate(ObjectColor.BLACK)); + filterMercenary.add(Predicates.not(new TokenPredicate())); + filterMercenary.add(new SubtypePredicate("Mercenary")); + } + + public MercenaryInformer(UUID ownerId) { + super(ownerId, 15, "Mercenary Informer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Human"); + this.subtype.add("Rebel"); + this.subtype.add("Mercenary"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Mercenary Informer can't be the target of black spells or abilities from black sources. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeTargetedSourceEffect(filterBlack, Duration.WhileOnBattlefield))); + + // {2}{W}: Put target nontoken Mercenary on the bottom of its owner's library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(false), new ManaCostsImpl("{2}{W}")); + ability.addTarget(new TargetPermanent(filterMercenary)); + this.addAbility(ability); + } + + public MercenaryInformer(final MercenaryInformer card) { + super(card); + } + + @Override + public MercenaryInformer copy() { + return new MercenaryInformer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/MineBearer.java b/Mage.Sets/src/mage/sets/prophecy/MineBearer.java new file mode 100644 index 00000000000..f74f6b1f0b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/MineBearer.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetAttackingCreature; + +/** + * + * @author LoneFox + */ +public class MineBearer extends CardImpl { + + public MineBearer(UUID ownerId) { + super(ownerId, 16, "Mine Bearer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}, Sacrifice Mine Bearer: Destroy target attacking creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetAttackingCreature()); + this.addAbility(ability); + } + + public MineBearer(final MineBearer card) { + super(card); + } + + @Override + public MineBearer copy() { + return new MineBearer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/NoxiousField.java b/Mage.Sets/src/mage/sets/prophecy/NoxiousField.java new file mode 100644 index 00000000000..e3aa9bf82c0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/NoxiousField.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class NoxiousField extends CardImpl { + + public NoxiousField(UUID ownerId) { + super(ownerId, 70, "Noxious Field", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{B}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Aura"); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted land has "{tap}: This land deals 1 damage to each creature and each player." + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEverythingEffect(1), new TapSourceCost()); + Effect effect = new GainAbilityAttachedEffect(ability, AttachmentType.AURA); + effect.setText("Enchanted land has \"{T}: This land deals 1 damage to each creature and each player.\""); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public NoxiousField(final NoxiousField card) { + super(card); + } + + @Override + public NoxiousField copy() { + return new NoxiousField(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/Outbreak.java b/Mage.Sets/src/mage/sets/prophecy/Outbreak.java new file mode 100644 index 00000000000..aa0473be3c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/Outbreak.java @@ -0,0 +1,123 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.AlternativeCostSourceAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.cards.repository.CardRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInHand; + +/** + * + * @author fireshoes + */ +public class Outbreak extends CardImpl { + + private static final FilterCard filterLand = new FilterCard("a Swamp card"); + + static { + filterLand.add(new SubtypePredicate("Swamp")); + } + + public Outbreak(UUID ownerId) { + super(ownerId, 71, "Outbreak", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}"); + this.expansionSetCode = "PCY"; + + // You may discard a Swamp card rather than pay Outbreak's mana cost. + this.addAbility(new AlternativeCostSourceAbility(new DiscardTargetCost(new TargetCardInHand(filterLand)))); + + // Choose a creature type. All creatures of that type get -1/-1 until end of turn. + this.getSpellAbility().addEffect(new OutbreakEffect()); + } + + public Outbreak(final Outbreak card) { + super(card); + } + + @Override + public Outbreak copy() { + return new Outbreak(this); + } +} + +class OutbreakEffect extends OneShotEffect { + + public OutbreakEffect() { + super(Outcome.UnboostCreature); + staticText = "Choose a creature type. All creatures of that type get -1/-1 until end of turn"; + } + + public OutbreakEffect(final OutbreakEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + Choice typeChoice = new ChoiceImpl(true); + typeChoice.setMessage("Choose a creature type:"); + typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); + while (!player.choose(outcome, typeChoice, game)) { + if (!player.canRespond()) { + return false; + } + } + if (typeChoice.getChoice() != null) { + game.informPlayers(player.getLogName() + " has chosen " + typeChoice.getChoice()); + } + FilterCreaturePermanent filter = new FilterCreaturePermanent("All creatures of the chosen type"); + filter.add(new SubtypePredicate(typeChoice.getChoice())); + ContinuousEffect effect = new BoostAllEffect(-1, -1, Duration.WhileOnBattlefield, filter, false); + game.addEffect(effect, source); + } + return false; + } + + @Override + public OutbreakEffect copy() { + return new OutbreakEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/QuicksilverWall.java b/Mage.Sets/src/mage/sets/prophecy/QuicksilverWall.java new file mode 100644 index 00000000000..21a43d9f3c0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/QuicksilverWall.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class QuicksilverWall extends CardImpl { + + public QuicksilverWall(UUID ownerId) { + super(ownerId, 41, "Quicksilver Wall", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Wall"); + this.power = new MageInt(1); + this.toughness = new MageInt(6); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // {4}: Return Quicksilver Wall to its owner's hand. Any player may activate this ability. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new ReturnToHandSourceEffect(true), new ManaCostsImpl("{4}")); + ability.setMayActivate(TargetController.ANY); + ability.addEffect(new InfoEffect("Any player may activate this ability")); + this.addAbility(ability); + } + + public QuicksilverWall(final QuicksilverWall card) { + super(card); + } + + @Override + public QuicksilverWall copy() { + return new QuicksilverWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/RebelInformer.java b/Mage.Sets/src/mage/sets/prophecy/RebelInformer.java new file mode 100644 index 00000000000..3522832f5a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/RebelInformer.java @@ -0,0 +1,94 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CantBeTargetedSourceEffect; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterObject; +import mage.filter.FilterPermanent; +import mage.filter.FilterStackObject; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class RebelInformer extends CardImpl { + + private static final FilterObject filterWhite = new FilterStackObject("white spells or abilities from white sources"); + private static final FilterPermanent filterRebel = new FilterPermanent("nontoken Rebel"); + + static { + filterWhite.add(new ColorPredicate(ObjectColor.WHITE)); + filterRebel.add(Predicates.not(new TokenPredicate())); + filterRebel.add(new SubtypePredicate("Rebel")); + } + + public RebelInformer(UUID ownerId) { + super(ownerId, 75, "Rebel Informer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Human"); + this.subtype.add("Mercenary"); + this.subtype.add("Rebel"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Rebel Informer can't be the target of white spells or abilities from white sources. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeTargetedSourceEffect(filterWhite, Duration.WhileOnBattlefield))); + + // {3}: Put target nontoken Rebel on the bottom of its owner's library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(false), new GenericManaCost(3)); + ability.addTarget(new TargetPermanent(filterRebel)); + this.addAbility(ability); + } + + public RebelInformer(final RebelInformer card) { + super(card); + } + + @Override + public RebelInformer copy() { + return new RebelInformer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/RibbonSnake.java b/Mage.Sets/src/mage/sets/prophecy/RibbonSnake.java new file mode 100644 index 00000000000..4e4829f4dc6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/RibbonSnake.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.continuous.LoseAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class RibbonSnake extends CardImpl { + + public RibbonSnake(UUID ownerId) { + super(ownerId, 46, "Ribbon Snake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Snake"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {2}: Ribbon Snake loses flying until end of turn. Any player may activate this ability. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseAbilitySourceEffect( + FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{2}")); + ability.setMayActivate(TargetController.ANY); + ability.addEffect(new InfoEffect("Any player may activate this ability")); + this.addAbility(ability); + } + + public RibbonSnake(final RibbonSnake card) { + super(card); + } + + @Override + public RibbonSnake copy() { + return new RibbonSnake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/ScoriaCat.java b/Mage.Sets/src/mage/sets/prophecy/ScoriaCat.java new file mode 100644 index 00000000000..1d7e4438ddf --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/ScoriaCat.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; + +/** + * + * @author LoneFox + */ +public class ScoriaCat extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent(); + + static { + filter.add(Predicates.not(new TappedPredicate())); + } + + public ScoriaCat(UUID ownerId) { + super(ownerId, 101, "Scoria Cat", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Cat"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Scoria Cat gets +3/+3 as long as you control no untapped lands. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield), + new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter)), + "{this} gets +3/+3 as long as you control no untapped lands"))); + } + + public ScoriaCat(final ScoriaCat card) { + super(card); + } + + @Override + public ScoriaCat copy() { + return new ScoriaCat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/SiltCrawler.java b/Mage.Sets/src/mage/sets/prophecy/SiltCrawler.java new file mode 100644 index 00000000000..177b90a0871 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/SiltCrawler.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.TapAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledLandPermanent; + +/** + * + * @author LoneFox + */ +public class SiltCrawler extends CardImpl { + + public SiltCrawler(UUID ownerId) { + super(ownerId, 123, "Silt Crawler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Beast"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Silt Crawler enters the battlefield, tap all lands you control. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TapAllEffect(new FilterControlledLandPermanent("lands you control")), false)); + } + + public SiltCrawler(final SiltCrawler card) { + super(card); + } + + @Override + public SiltCrawler copy() { + return new SiltCrawler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/SpiketailDrake.java b/Mage.Sets/src/mage/sets/prophecy/SpiketailDrake.java new file mode 100644 index 00000000000..d63e858fa3d --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/SpiketailDrake.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + */ +public class SpiketailDrake extends CardImpl { + + public SpiketailDrake(UUID ownerId) { + super(ownerId, 48, "Spiketail Drake", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Drake"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Sacrifice Spiketail Drake: Counter target spell unless its controller pays {3}. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new ManaCostsImpl("{3}")), new SacrificeSourceCost()); ability.addTarget(new TargetSpell()); this.addAbility(ability); + } + + public SpiketailDrake(final SpiketailDrake card) { + super(card); + } + + @Override + public SpiketailDrake copy() { + return new SpiketailDrake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/SpurGrappler.java b/Mage.Sets/src/mage/sets/prophecy/SpurGrappler.java new file mode 100644 index 00000000000..204a883999c --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/SpurGrappler.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; + +/** + * + * @author LoneFox + */ +public class SpurGrappler extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent(); + + static { + filter.add(Predicates.not(new TappedPredicate())); + } + + public SpurGrappler(UUID ownerId) { + super(ownerId, 104, "Spur Grappler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Beast"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Spur Grappler gets +2/+1 as long as you control no untapped lands. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new BoostSourceEffect(2, 1, Duration.WhileOnBattlefield), + new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter)), + "{this} gets +2/+1 as long as you control no untapped lands"))); + } + + public SpurGrappler(final SpurGrappler card) { + super(card); + } + + @Override + public SpurGrappler copy() { + return new SpurGrappler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/StealStrength.java b/Mage.Sets/src/mage/sets/prophecy/StealStrength.java new file mode 100644 index 00000000000..c0dc42b53d9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/StealStrength.java @@ -0,0 +1,99 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class StealStrength extends CardImpl { + + public StealStrength(UUID ownerId) { + super(ownerId, 79, "Steal Strength", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{B}"); + this.expansionSetCode = "PCY"; + + // Target creature gets +1/+1 until end of turn. Another target creature gets -1/-1 until end of turn. + this.getSpellAbility().addEffect(new StealStrengthEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2)); + } + + public StealStrength(final StealStrength card) { + super(card); + } + + @Override + public StealStrength copy() { + return new StealStrength(this); + } +} + +class StealStrengthEffect extends ContinuousEffectImpl { + + public StealStrengthEffect() { + super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); + this.staticText = "Target creature gets +1/+1 until end of turn. Another target creature gets -1/-1 until end of turn"; + } + + public StealStrengthEffect(final StealStrengthEffect effect) { + super(effect); + } + + @Override + public StealStrengthEffect copy() { + return new StealStrengthEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + permanent.addPower(1); + permanent.addToughness(1); + } + permanent = game.getPermanent(source.getTargets().get(0).getTargets().get(1)); + if (permanent != null) { + permanent.addPower(-1); + permanent.addToughness(-1); + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/prophecy/SunkenField.java b/Mage.Sets/src/mage/sets/prophecy/SunkenField.java new file mode 100644 index 00000000000..fca2a0bc868 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/SunkenField.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.TargetSpell; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class SunkenField extends CardImpl { + + public SunkenField(UUID ownerId) { + super(ownerId, 51, "Sunken Field", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Aura"); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted land has "{T}: Counter target spell unless its controller pays {1}." + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new ManaCostsImpl("{1}")), new TapSourceCost()); + ability.addTarget(new TargetSpell()); + Effect effect = new GainAbilityAttachedEffect(ability, AttachmentType.AURA); + effect.setText("Enchanted land has \"{T}: Counter target spell unless its controller pays {1}.\""); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public SunkenField(final SunkenField card) { + super(card); + } + + @Override + public SunkenField copy() { + return new SunkenField(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/TroublesomeSpirit.java b/Mage.Sets/src/mage/sets/prophecy/TroublesomeSpirit.java new file mode 100644 index 00000000000..f3a6f6c58ce --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/TroublesomeSpirit.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.effects.common.TapAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledLandPermanent; + +/** + * + * @author LoneFox + */ +public class TroublesomeSpirit extends CardImpl { + + public TroublesomeSpirit(UUID ownerId) { + super(ownerId, 52, "Troublesome Spirit", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Spirit"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // At the beginning of your end step, tap all lands you control. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new TapAllEffect(new FilterControlledLandPermanent("lands you control")), TargetController.YOU, false)); + } + + public TroublesomeSpirit(final TroublesomeSpirit card) { + super(card); + } + + @Override + public TroublesomeSpirit copy() { + return new TroublesomeSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/VintaraElephant.java b/Mage.Sets/src/mage/sets/prophecy/VintaraElephant.java new file mode 100644 index 00000000000..1e70c6836b7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/VintaraElephant.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.continuous.LoseAbilitySourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class VintaraElephant extends CardImpl { + + public VintaraElephant(UUID ownerId) { + super(ownerId, 131, "Vintara Elephant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Elephant"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // {3}: Vintara Elephant loses trample until end of turn. Any player may activate this ability. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseAbilitySourceEffect( + TrampleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{3}")); + ability.setMayActivate(TargetController.ANY); + ability.addEffect(new InfoEffect("Any player may activate this ability")); + this.addAbility(ability); + } + + public VintaraElephant(final VintaraElephant card) { + super(card); + } + + @Override + public VintaraElephant copy() { + return new VintaraElephant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/VintaraSnapper.java b/Mage.Sets/src/mage/sets/prophecy/VintaraSnapper.java new file mode 100644 index 00000000000..ba9f95908b0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/VintaraSnapper.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; + +/** + * + * @author LoneFox + */ +public class VintaraSnapper extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent(); + + static { + filter.add(Predicates.not(new TappedPredicate())); + } + + public VintaraSnapper(UUID ownerId) { + super(ownerId, 132, "Vintara Snapper", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}{G}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Turtle"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Vintara Snapper has shroud as long as you control no untapped lands. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new GainAbilitySourceEffect(ShroudAbility.getInstance(), + Duration.WhileOnBattlefield), new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter)), + "{this} has shroud as long as you control no untapped lands"))); + } + + public VintaraSnapper(final VintaraSnapper card) { + super(card); + } + + @Override + public VintaraSnapper copy() { + return new VintaraSnapper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/WellOfDiscovery.java b/Mage.Sets/src/mage/sets/prophecy/WellOfDiscovery.java new file mode 100644 index 00000000000..d13f785e997 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/WellOfDiscovery.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; + +/** + * + * @author LoneFox + */ +public class WellOfDiscovery extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent(); + + static { + filter.add(Predicates.not(new TappedPredicate())); + } + + public WellOfDiscovery(UUID ownerId) { + super(ownerId, 140, "Well of Discovery", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{6}"); + this.expansionSetCode = "PCY"; + + // At the beginning of your end step, if you control no untapped lands, draw a card. + this.addAbility(new ConditionalTriggeredAbility(new BeginningOfEndStepTriggeredAbility( + new DrawCardSourceControllerEffect(1), TargetController.YOU, false), + new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter)), + "At the beginning of your end step, if you control no untapped lands, draw a card.")); + } + + public WellOfDiscovery(final WellOfDiscovery card) { + super(card); + } + + @Override + public WellOfDiscovery copy() { + return new WellOfDiscovery(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/WellOfLife.java b/Mage.Sets/src/mage/sets/prophecy/WellOfLife.java new file mode 100644 index 00000000000..82a2e24ad43 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/WellOfLife.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; + +/** + * + * @author LoneFox + */ +public class WellOfLife extends CardImpl { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent(); + + static { + filter.add(Predicates.not(new TappedPredicate())); + } + + public WellOfLife(UUID ownerId) { + super(ownerId, 141, "Well of Life", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "PCY"; + + // At the beginning of your end step, if you control no untapped lands, you gain 2 life. + this.addAbility(new ConditionalTriggeredAbility(new BeginningOfEndStepTriggeredAbility( + new GainLifeEffect(2), TargetController.YOU, false), new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter)), + "At the beginning of your end step, if you control no untapped lands, you gain 2 life.")); + } + + public WellOfLife(final WellOfLife card) { + super(card); + } + + @Override + public WellOfLife copy() { + return new WellOfLife(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/WhipSergeant.java b/Mage.Sets/src/mage/sets/prophecy/WhipSergeant.java new file mode 100644 index 00000000000..60678399313 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/WhipSergeant.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class WhipSergeant extends CardImpl { + + public WhipSergeant(UUID ownerId) { + super(ownerId, 107, "Whip Sergeant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // {R}: Target creature gains haste until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{R}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public WhipSergeant(final WhipSergeant card) { + super(card); + } + + @Override + public WhipSergeant copy() { + return new WhipSergeant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/WhipstitchedZombie.java b/Mage.Sets/src/mage/sets/prophecy/WhipstitchedZombie.java new file mode 100644 index 00000000000..632598ce5ba --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/WhipstitchedZombie.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class WhipstitchedZombie extends CardImpl { + + public WhipstitchedZombie(UUID ownerId) { + super(ownerId, 81, "Whipstitched Zombie", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // At the beginning of your upkeep, sacrifice Whipstitched Zombie unless you pay {B}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{B}")), TargetController.YOU, false)); + } + + public WhipstitchedZombie(final WhipstitchedZombie card) { + super(card); + } + + @Override + public WhipstitchedZombie copy() { + return new WhipstitchedZombie(this); + } +} diff --git a/Mage.Sets/src/mage/sets/prophecy/ZerapaMinotaur.java b/Mage.Sets/src/mage/sets/prophecy/ZerapaMinotaur.java new file mode 100644 index 00000000000..6000fde3df3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/prophecy/ZerapaMinotaur.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.prophecy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.continuous.LoseAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class ZerapaMinotaur extends CardImpl { + + public ZerapaMinotaur(UUID ownerId) { + super(ownerId, 108, "Zerapa Minotaur", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "PCY"; + this.subtype.add("Minotaur"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // {2}: Zerapa Minotaur loses first strike until end of turn. Any player may activate this ability. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseAbilitySourceEffect( + FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{2}")); + ability.setMayActivate(TargetController.ANY); + ability.addEffect(new InfoEffect("Any player may activate this ability")); + this.addAbility(ability); + } + + public ZerapaMinotaur(final ZerapaMinotaur card) { + super(card); + } + + @Override + public ZerapaMinotaur copy() { + return new ZerapaMinotaur(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/Blockbuster.java b/Mage.Sets/src/mage/sets/ravnica/Blockbuster.java index 0a3520ac9b0..d00e6549334 100644 --- a/Mage.Sets/src/mage/sets/ravnica/Blockbuster.java +++ b/Mage.Sets/src/mage/sets/ravnica/Blockbuster.java @@ -28,7 +28,10 @@ package mage.sets.ravnica; import java.util.UUID; + +import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DamageEverythingEffect; import mage.cards.CardImpl; @@ -55,7 +58,9 @@ public class Blockbuster extends CardImpl { this.expansionSetCode = "RAV"; // {1}{R}, Sacrifice Blockbuster: Blockbuster deals 3 damage to each tapped creature and each player. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEverythingEffect(3, filter), new ManaCostsImpl("{1}{R}"))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEverythingEffect(3, filter), new ManaCostsImpl("{1}{R}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); } public Blockbuster(final Blockbuster card) { diff --git a/Mage.Sets/src/mage/sets/ravnica/Brainspoil.java b/Mage.Sets/src/mage/sets/ravnica/Brainspoil.java new file mode 100644 index 00000000000..0ecbcfd747b --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/Brainspoil.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.TransmuteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.EnchantedPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Brainspoil extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that isn't enchanted"); + + static { + filter.add(Predicates.not(new EnchantedPredicate())); + } + + public Brainspoil(UUID ownerId) { + super(ownerId, 78, "Brainspoil", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); + this.expansionSetCode = "RAV"; + + // Destroy target creature that isn't enchanted. It can't be regenerated. + this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + + // Transmute {1}{B}{B} + this.addAbility(new TransmuteAbility("{1}{B}{B}")); + } + + public Brainspoil(final Brainspoil card) { + super(card); + } + + @Override + public Brainspoil copy() { + return new Brainspoil(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/ChordOfCalling.java b/Mage.Sets/src/mage/sets/ravnica/ChordOfCalling.java index b605b87f8b5..4a499e1aa25 100644 --- a/Mage.Sets/src/mage/sets/ravnica/ChordOfCalling.java +++ b/Mage.Sets/src/mage/sets/ravnica/ChordOfCalling.java @@ -28,15 +28,14 @@ package mage.sets.ravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.ConvokeAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.Filter; import mage.filter.FilterCard; @@ -56,8 +55,7 @@ public class ChordOfCalling extends CardImpl { super(ownerId, 156, "Chord of Calling", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{G}{G}{G}"); this.expansionSetCode = "RAV"; - - // Convoke + // Convoke (Your creatures can help cast this spell. Each creature you tap while casting this spell pays for {1} or one mana of that creature's color.) this.addAbility(new ConvokeAbility()); // Search your library for a creature card with converted mana cost X or less and put it onto the battlefield. Then shuffle your library. @@ -97,7 +95,7 @@ class ChordofCallingSearchEffect extends OneShotEffect { filter.add(new CardTypePredicate(CardType.CREATURE)); //Set the mana cost one higher to 'emulate' a less than or equal to comparison. filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, xCost + 1)); - TargetCardInLibrary target = new TargetCardInLibrary(0,1,filter); + TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter); if (player.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { Card card = player.getLibrary().getCard(target.getFirstTarget(), game); diff --git a/Mage.Sets/src/mage/sets/ravnica/ClutchOfTheUndercity.java b/Mage.Sets/src/mage/sets/ravnica/ClutchOfTheUndercity.java index 0c0f2447614..e17da5e0726 100644 --- a/Mage.Sets/src/mage/sets/ravnica/ClutchOfTheUndercity.java +++ b/Mage.Sets/src/mage/sets/ravnica/ClutchOfTheUndercity.java @@ -35,7 +35,7 @@ import mage.abilities.effects.common.LoseLifeTargetControllerEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.TransmuteAbility; import mage.cards.CardImpl; -import mage.target.common.TargetCreaturePermanent; +import mage.target.TargetPermanent; /** * @author Loki @@ -50,7 +50,7 @@ public class ClutchOfTheUndercity extends CardImpl { // Return target permanent to its owner's hand. Its controller loses 3 life. this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellAbility().addEffect(new LoseLifeTargetControllerEffect(3)); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addTarget(new TargetPermanent()); // Transmute {1}{U}{B} this.addAbility(new TransmuteAbility("{1}{U}{B}")); } diff --git a/Mage.Sets/src/mage/sets/ravnica/ConcertedEffort.java b/Mage.Sets/src/mage/sets/ravnica/ConcertedEffort.java new file mode 100644 index 00000000000..f4998a9b5b1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/ConcertedEffort.java @@ -0,0 +1,165 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.abilities.keyword.FearAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.LandwalkAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author emerald000 + */ +public class ConcertedEffort extends CardImpl { + + public ConcertedEffort(UUID ownerId) { + super(ownerId, 8, "Concerted Effort", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); + this.expansionSetCode = "RAV"; + + // At the beginning of each upkeep, creatures you control gain flying until end of turn if a creature you control has flying. The same is true for fear, first strike, double strike, landwalk, protection, trample, and vigilance. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ConcertedEffortEffect(), TargetController.ANY, false)); + } + + public ConcertedEffort(final ConcertedEffort card) { + super(card); + } + + @Override + public ConcertedEffort copy() { + return new ConcertedEffort(this); + } +} + +class ConcertedEffortEffect extends OneShotEffect { + + private static final FilterControlledCreaturePermanent filterFlying = new FilterControlledCreaturePermanent(); + private static final FilterControlledCreaturePermanent filterFear = new FilterControlledCreaturePermanent(); + private static final FilterControlledCreaturePermanent filterFirstStrike = new FilterControlledCreaturePermanent(); + private static final FilterControlledCreaturePermanent filterDoubleStrike = new FilterControlledCreaturePermanent(); + private static final FilterControlledCreaturePermanent filterLandwalk = new FilterControlledCreaturePermanent(); + private static final FilterControlledCreaturePermanent filterProtection = new FilterControlledCreaturePermanent(); + private static final FilterControlledCreaturePermanent filterTrample = new FilterControlledCreaturePermanent(); + private static final FilterControlledCreaturePermanent filterVigilance = new FilterControlledCreaturePermanent(); + + static { + filterFlying.add(new AbilityPredicate(FlyingAbility.class)); + filterFear.add(new AbilityPredicate(FearAbility.class)); + filterFirstStrike.add(new AbilityPredicate(FirstStrikeAbility.class)); + filterDoubleStrike.add(new AbilityPredicate(DoubleStrikeAbility.class)); + filterLandwalk.add(new AbilityPredicate(LandwalkAbility.class)); + filterProtection.add(new AbilityPredicate(ProtectionAbility.class)); + filterTrample.add(new AbilityPredicate(TrampleAbility.class)); + filterVigilance.add(new AbilityPredicate(VigilanceAbility.class)); + } + + ConcertedEffortEffect() { + super(Outcome.BoostCreature); + this.staticText = "creatures you control gain flying until end of turn if a creature you control has flying. The same is true for fear, first strike, double strike, landwalk, protection, trample, and vigilance"; + } + + ConcertedEffortEffect(final ConcertedEffortEffect effect) { + super(effect); + } + + @Override + public ConcertedEffortEffect copy() { + return new ConcertedEffortEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + // Flying + if (game.getBattlefield().contains(filterFlying, source.getControllerId(), 1, game)) { + game.addEffect(new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), source); + } + + // Fear + if (game.getBattlefield().contains(filterFear, source.getControllerId(), 1, game)) { + game.addEffect(new GainAbilityControlledEffect(FearAbility.getInstance(), Duration.EndOfTurn), source); + } + + // First strike + if (game.getBattlefield().contains(filterFirstStrike, source.getControllerId(), 1, game)) { + game.addEffect(new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), source); + } + + // Double strike + if (game.getBattlefield().contains(filterDoubleStrike, source.getControllerId(), 1, game)) { + game.addEffect(new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn), source); + } + + // Landwalk + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filterLandwalk, source.getControllerId(), game)) { + for (Ability ability : permanent.getAbilities(game)) { + if (ability instanceof LandwalkAbility) { + game.addEffect(new GainAbilityControlledEffect(ability, Duration.EndOfTurn), source); + } + } + } + + // Protection + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filterProtection, source.getControllerId(), game)) { + for (Ability ability : permanent.getAbilities(game)) { + if (ability instanceof ProtectionAbility) { + game.addEffect(new GainAbilityControlledEffect(ability, Duration.EndOfTurn), source); + } + } + } + + // Trample + if (game.getBattlefield().contains(filterTrample, source.getControllerId(), 1, game)) { + game.addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), source); + } + + // Vigilance + if (game.getBattlefield().contains(filterVigilance, source.getControllerId(), 1, game)) { + game.addEffect(new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn), source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/CopyEnchantment.java b/Mage.Sets/src/mage/sets/ravnica/CopyEnchantment.java index f8c469ed658..e1a02355e1b 100644 --- a/Mage.Sets/src/mage/sets/ravnica/CopyEnchantment.java +++ b/Mage.Sets/src/mage/sets/ravnica/CopyEnchantment.java @@ -30,16 +30,14 @@ package mage.sets.ravnica; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.SpellAbility; -import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.common.FilterEnchantmentPermanent; import mage.game.Game; @@ -58,13 +56,8 @@ public class CopyEnchantment extends CardImpl { super(ownerId, 42, "Copy Enchantment", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); this.expansionSetCode = "RAV"; - // You may have Copy Enchantment enter the battlefield as a copy of any enchantment on the battlefield. - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( - new CopyEnchantmentEffect(new FilterEnchantmentPermanent()), - "You may have {this} enter the battlefield as a copy of any enchantment on the battlefield", - true)); - this.addAbility(ability); + this.addAbility(new EntersBattlefieldAbility(new CopyEnchantmentEffect(new FilterEnchantmentPermanent("any enchantment")), true)); } public CopyEnchantment(final CopyEnchantment card) { @@ -82,15 +75,15 @@ class CopyEnchantmentEffect extends CopyPermanentEffect { public CopyEnchantmentEffect(FilterPermanent filter) { super(filter, new EmptyApplyToPermanent()); } - + public CopyEnchantmentEffect(final CopyEnchantmentEffect effect) { super(effect); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + Permanent sourcePermanent = game.getPermanentEntering(source.getSourceId()); if (controller != null && sourcePermanent != null) { if (super.apply(game, source)) { Permanent permanentToCopy = getBluePrintPermanent(); @@ -98,9 +91,10 @@ class CopyEnchantmentEffect extends CopyPermanentEffect { if (permanentToCopy.getSubtype().contains("Aura")) { Target target = getBluePrintPermanent().getSpellAbility().getTargets().get(0); Outcome auraOutcome = Outcome.BoostCreature; - Ability: for (Ability ability: getBluePrintPermanent().getAbilities()) { + Ability: + for (Ability ability : getBluePrintPermanent().getAbilities()) { if (ability instanceof SpellAbility) { - for (Effect effect: ability.getEffects()) { + for (Effect effect : ability.getEffects()) { if (effect instanceof AttachEffect) { auraOutcome = effect.getOutcome(); break Ability; @@ -108,6 +102,7 @@ class CopyEnchantmentEffect extends CopyPermanentEffect { } } } + target.setNotTarget(true); if (controller.choose(auraOutcome, target, source.getSourceId(), game)) { UUID targetId = target.getFirstTarget(); Permanent targetPermanent = game.getPermanent(targetId); @@ -127,10 +122,10 @@ class CopyEnchantmentEffect extends CopyPermanentEffect { } return false; } - + @Override public CopyEnchantmentEffect copy() { return new CopyEnchantmentEffect(this); } - + } diff --git a/Mage.Sets/src/mage/sets/ravnica/Disembowel.java b/Mage.Sets/src/mage/sets/ravnica/Disembowel.java new file mode 100644 index 00000000000..f9ca7d1503d --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/Disembowel.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Disembowel extends CardImpl { + + public Disembowel(UUID ownerId) { + super(ownerId, 85, "Disembowel", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{X}{B}"); + this.expansionSetCode = "RAV"; + + // Destroy target creature with converted mana cost X. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with converted mana cost X"))); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if(ability instanceof SpellAbility) { + ability.getTargets().clear(); + int xValue = ability.getManaCostsToPay().getX(); + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost X"); + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, xValue)); + ability.addTarget(new TargetCreaturePermanent(filter)); + } + } + + public Disembowel(final Disembowel card) { + super(card); + } + + @Override + public Disembowel copy() { + return new Disembowel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java b/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java index 4ab45ecce4c..76703050bb3 100644 --- a/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java +++ b/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java @@ -30,8 +30,10 @@ package mage.sets.ravnica; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.OnEventTriggeredAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -40,15 +42,14 @@ import mage.constants.Rarity; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; -import mage.util.CardUtil; +import mage.target.targetpointer.FixedTarget; /** * * @author LoneFox - + * */ public class FollowedFootsteps extends CardImpl { @@ -99,10 +100,9 @@ class FollowedFootstepsEffect extends OneShotEffect { Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); Permanent target = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo()); if (target != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(target); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; + Effect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); + effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo())); + return effect.apply(game, source); } return false; } diff --git a/Mage.Sets/src/mage/sets/ravnica/GoblinFireFiend.java b/Mage.Sets/src/mage/sets/ravnica/GoblinFireFiend.java new file mode 100644 index 00000000000..1c7d12327e0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/GoblinFireFiend.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; + +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author BursegSardaukar + */ +public class GoblinFireFiend extends CardImpl { + + public GoblinFireFiend(UUID ownerId) { + super(ownerId, 127, "Goblin Fire Fiend", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Goblin"); + this.subtype.add("Berserker"); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + //Haste + this.addAbility(HasteAbility.getInstance()); + + //Goblin Fire Fiend must be blocked if able. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBeBlockedByAtLeastOneSourceEffect())); + + //{R}: Goblin Fire Fiend gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public GoblinFireFiend(final GoblinFireFiend card) { + super(card); + } + + @Override + public GoblinFireFiend copy() { + return new GoblinFireFiend(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/GolgariGraveTroll.java b/Mage.Sets/src/mage/sets/ravnica/GolgariGraveTroll.java index 1673b718af2..d0c851b05b3 100644 --- a/Mage.Sets/src/mage/sets/ravnica/GolgariGraveTroll.java +++ b/Mage.Sets/src/mage/sets/ravnica/GolgariGraveTroll.java @@ -28,10 +28,6 @@ package mage.sets.ravnica; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; @@ -42,6 +38,10 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.abilities.keyword.DredgeAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -104,7 +104,7 @@ class GolgariGraveTrollEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (permanent != null && player != null) { int amount = player.getGraveyard().count(filter, game); if (amount > 0) { diff --git a/Mage.Sets/src/mage/sets/ravnica/Grozoth.java b/Mage.Sets/src/mage/sets/ravnica/Grozoth.java new file mode 100644 index 00000000000..275279bbff5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/Grozoth.java @@ -0,0 +1,138 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.SearchEffect; +import mage.abilities.effects.common.continuous.LoseAbilitySourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.TransmuteAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author fireshoes + */ +public class Grozoth extends CardImpl { + + public Grozoth(UUID ownerId) { + super(ownerId, 53, "Grozoth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}{U}{U}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Leviathan"); + this.power = new MageInt(9); + this.toughness = new MageInt(9); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // When Grozoth enters the battlefield, you may search your library for any number of cards that have converted mana cost 9, reveal them, and put them into your hand. If you do, shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new GrozothEffect(), true)); + + // {4}: Grozoth loses defender until end of turn. + this.addAbility(new SimpleActivatedAbility( + Zone.BATTLEFIELD, + new LoseAbilitySourceEffect(DefenderAbility.getInstance(), Duration.EndOfTurn), + new ManaCostsImpl("{4}"))); + + // Transmute {1}{U}{U} + this.addAbility(new TransmuteAbility("{1}{U}{U}")); + } + + public Grozoth(final Grozoth card) { + super(card); + } + + @Override + public Grozoth copy() { + return new Grozoth(this); + } +} + +class GrozothEffect extends SearchEffect { + + private static final FilterCard filter = new FilterCard(); + + static { + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, 9)); + } + + public GrozothEffect() { + super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Outcome.DrawCard); + staticText = "you may search your library for any number of cards that have converted mana cost 9, reveal them, and put them into your hand. If you do, shuffle your library"; + } + + public GrozothEffect(final GrozothEffect effect) { + super(effect); + } + + @Override + public GrozothEffect copy() { + return new GrozothEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Card sourceCard = game.getCard(source.getSourceId()); + if (sourceCard != null && player != null && player.searchLibrary(target, game)) { + if (target.getTargets().size() > 0) { + Cards cards = new CardsImpl(); + for (UUID cardId : target.getTargets()) { + Card card = player.getLibrary().remove(cardId, game); + if (card != null) { + cards.add(card); + } + } + player.revealCards(sourceCard.getIdName(), cards, game); + player.moveCards(cards, Zone.LIBRARY, Zone.HAND, source, game); + } + player.shuffleLibrary(game); + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/ravnica/HammerfistGiant.java b/Mage.Sets/src/mage/sets/ravnica/HammerfistGiant.java new file mode 100644 index 00000000000..db5d3e5df1d --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/HammerfistGiant.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author fireshoes + */ +public class HammerfistGiant extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("each creature without flying"); + + static { + filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + + public HammerfistGiant(UUID ownerId) { + super(ownerId, 130, "Hammerfist Giant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Giant"); + this.subtype.add("Warrior"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // {tap}: Hammerfist Giant deals 4 damage to each creature without flying and each player. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEverythingEffect(4, filter), new TapSourceCost())); + } + + public HammerfistGiant(final HammerfistGiant card) { + super(card); + } + + @Override + public HammerfistGiant copy() { + return new HammerfistGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/IvyDancer.java b/Mage.Sets/src/mage/sets/ravnica/IvyDancer.java index 189daa2b9f4..a8b1512d852 100644 --- a/Mage.Sets/src/mage/sets/ravnica/IvyDancer.java +++ b/Mage.Sets/src/mage/sets/ravnica/IvyDancer.java @@ -1,74 +1,75 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.ravnica; - -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.keyword.ForestwalkAbility; -import mage.cards.CardImpl; -import mage.constants.Duration; -import mage.constants.Zone; -import mage.target.common.TargetCreaturePermanent; - -/** - * - * @author Loki - */ -public class IvyDancer extends CardImpl { - - public IvyDancer(UUID ownerId) { - super(ownerId, 171, "Ivy Dancer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); - this.expansionSetCode = "RAV"; - this.subtype.add("Dryad"); - this.subtype.add("Shaman"); - - this.power = new MageInt(1); - this.toughness = new MageInt(2); - - // {tap}: Target creature gains forestwalk until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new ForestwalkAbility(), Duration.EndOfTurn), new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(ability); - } - - public IvyDancer(final IvyDancer card) { - super(card); - } - - @Override - public IvyDancer copy() { - return new IvyDancer(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Loki + */ +public class IvyDancer extends CardImpl { + + public IvyDancer(UUID ownerId) { + super(ownerId, 171, "Ivy Dancer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Dryad"); + this.subtype.add("Shaman"); + + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {tap}: Target creature gains forestwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new ForestwalkAbility(false), Duration.EndOfTurn), + new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public IvyDancer(final IvyDancer card) { + super(card); + } + + @Override + public IvyDancer copy() { + return new IvyDancer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/LoxodonGatekeeper.java b/Mage.Sets/src/mage/sets/ravnica/LoxodonGatekeeper.java index 5b4297fba72..b11584bdd31 100644 --- a/Mage.Sets/src/mage/sets/ravnica/LoxodonGatekeeper.java +++ b/Mage.Sets/src/mage/sets/ravnica/LoxodonGatekeeper.java @@ -30,20 +30,20 @@ package mage.sets.ravnica; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; - /** * * @author fireshoes @@ -75,6 +75,7 @@ public class LoxodonGatekeeper extends CardImpl { } class LoxodonGatekeeperTapEffect extends ReplacementEffectImpl { + LoxodonGatekeeperTapEffect() { super(Duration.WhileOnBattlefield, Outcome.Tap); staticText = "Artifacts, creatures, and lands your opponents control enter the battlefield tapped"; @@ -86,26 +87,26 @@ class LoxodonGatekeeperTapEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent target = game.getPermanent(event.getTargetId()); + Permanent target = ((EntersTheBattlefieldEvent) event).getTarget(); if (target != null) { target.setTapped(true); } return false; } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && - (permanent.getCardType().contains(CardType.CREATURE) || - permanent.getCardType().contains(CardType.LAND) || - permanent.getCardType().contains(CardType.ARTIFACT))) { + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); + if (permanent != null + && (permanent.getCardType().contains(CardType.CREATURE) + || permanent.getCardType().contains(CardType.LAND) + || permanent.getCardType().contains(CardType.ARTIFACT))) { return true; } } diff --git a/Mage.Sets/src/mage/sets/ravnica/PsychicDrain.java b/Mage.Sets/src/mage/sets/ravnica/PsychicDrain.java new file mode 100644 index 00000000000..153217668e7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/PsychicDrain.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author LoneFox + */ +public class PsychicDrain extends CardImpl { + + public PsychicDrain(UUID ownerId) { + super(ownerId, 220, "Psychic Drain", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{U}{B}"); + this.expansionSetCode = "RAV"; + + // Target player puts the top X cards of his or her library into his or her graveyard and you gain X life. + this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addTarget(new TargetPlayer()); + Effect effect = new GainLifeEffect(new ManacostVariableValue()); + effect.setText("and you gain X life"); + this.getSpellAbility().addEffect(effect); + } + + public PsychicDrain(final PsychicDrain card) { + super(card); + } + + @Override + public PsychicDrain copy() { + return new PsychicDrain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/SavraQueenOfTheGolgari.java b/Mage.Sets/src/mage/sets/ravnica/SavraQueenOfTheGolgari.java new file mode 100644 index 00000000000..a3521d9cbdc --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/SavraQueenOfTheGolgari.java @@ -0,0 +1,194 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class SavraQueenOfTheGolgari extends CardImpl { + + public SavraQueenOfTheGolgari(UUID ownerId) { + super(ownerId, 225, "Savra, Queen of the Golgari", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{G}"); + this.expansionSetCode = "RAV"; + this.supertype.add("Legendary"); + this.subtype.add("Elf"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever you sacrifice a black creature, you may pay 2 life. If you do, each other player sacrifices a creature. + this.addAbility(new SavraSacrificeBlackCreatureAbility()); + + // Whenever you sacrifice a green creature, you may gain 2 life. + this.addAbility(new SavraSacrificeGreenCreatureAbility()); + } + + public SavraQueenOfTheGolgari(final SavraQueenOfTheGolgari card) { + super(card); + } + + @Override + public SavraQueenOfTheGolgari copy() { + return new SavraQueenOfTheGolgari(this); + } +} + +class SavraSacrificeBlackCreatureAbility extends TriggeredAbilityImpl { + + public SavraSacrificeBlackCreatureAbility() { + super(Zone.BATTLEFIELD, new DoIfCostPaid(new SavraSacrificeEffect(), new PayLifeCost(2))); + this.addTarget(new TargetCreatureOrPlayer()); + } + + public SavraSacrificeBlackCreatureAbility(final SavraSacrificeBlackCreatureAbility ability) { + super(ability); + } + + @Override + public SavraSacrificeBlackCreatureAbility copy() { + return new SavraSacrificeBlackCreatureAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SACRIFICED_PERMANENT; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(this.getControllerId()) + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE) + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getColor(game).isBlack(); + } + + @Override + public String getRule() { + return "Whenever you sacrifice a black creature, " + super.getRule(); + } +} + +class SavraSacrificeEffect extends OneShotEffect { + + public SavraSacrificeEffect() { + super(Outcome.Sacrifice); + this.staticText = "each other player sacrifices a creature"; + } + + public SavraSacrificeEffect(final SavraSacrificeEffect effect) { + super(effect); + } + + @Override + public SavraSacrificeEffect copy() { + return new SavraSacrificeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + List perms = new ArrayList<>(); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : controller.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null && !playerId.equals(source.getControllerId())) { + TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(); + target.setNotTarget(true); + if (target.canChoose(player.getId(), game)) { + player.chooseTarget(Outcome.Sacrifice, target, source, game); + perms.addAll(target.getTargets()); + } + } + } + for (UUID permID : perms) { + Permanent permanent = game.getPermanent(permID); + if (permanent != null) { + permanent.sacrifice(source.getSourceId(), game); + } + } + return true; + } + return false; + } +} + +class SavraSacrificeGreenCreatureAbility extends TriggeredAbilityImpl { + + public SavraSacrificeGreenCreatureAbility() { + super(Zone.BATTLEFIELD, new GainLifeEffect(2)); + } + + public SavraSacrificeGreenCreatureAbility(final SavraSacrificeGreenCreatureAbility ability) { + super(ability); + } + + @Override + public SavraSacrificeGreenCreatureAbility copy() { + return new SavraSacrificeGreenCreatureAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SACRIFICED_PERMANENT; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(this.getControllerId()) + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE) + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getColor(game).isGreen(); + } + + @Override + public String getRule() { + return "Whenever you sacrifice a green creature, " + super.getRule(); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/SelesnyaSagittars.java b/Mage.Sets/src/mage/sets/ravnica/SelesnyaSagittars.java new file mode 100644 index 00000000000..bb827afb961 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/SelesnyaSagittars.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureEffect; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author nigelzor + */ +public class SelesnyaSagittars extends CardImpl { + + public SelesnyaSagittars(UUID ownerId) { + super(ownerId, 229, "Selesnya Sagittars", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{W}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Elf"); + this.subtype.add("Archer"); + this.power = new MageInt(2); + this.toughness = new MageInt(5); + + // Reach + this.addAbility(ReachAbility.getInstance()); + // Selesnya Sagittars can block an additional creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAdditionalCreatureEffect())); + } + + public SelesnyaSagittars(final SelesnyaSagittars card) { + super(card); + } + + @Override + public SelesnyaSagittars copy() { + return new SelesnyaSagittars(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/SinsOfThePast.java b/Mage.Sets/src/mage/sets/ravnica/SinsOfThePast.java index a199e0cfe0c..ba8dd13ec2c 100644 --- a/Mage.Sets/src/mage/sets/ravnica/SinsOfThePast.java +++ b/Mage.Sets/src/mage/sets/ravnica/SinsOfThePast.java @@ -131,7 +131,7 @@ class SinsOfThePastCastFromGraveyardEffect extends AsThoughEffectImpl { public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (sourceId.equals(this.getTargetPointer().getFirst(game, source)) && affectedControllerId.equals(source.getControllerId())) { Player player = game.getPlayer(affectedControllerId); - player.setCastSourceIdWithAlternateMana(sourceId, null); + player.setCastSourceIdWithAlternateMana(sourceId, null, null); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/ravnica/SistersOfStoneDeath.java b/Mage.Sets/src/mage/sets/ravnica/SistersOfStoneDeath.java index 200188ec098..13fa2e682d0 100644 --- a/Mage.Sets/src/mage/sets/ravnica/SistersOfStoneDeath.java +++ b/Mage.Sets/src/mage/sets/ravnica/SistersOfStoneDeath.java @@ -43,7 +43,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.permanent.BlockedByIdPredicate; @@ -101,7 +101,7 @@ public class SistersOfStoneDeath extends CardImpl { class SistersOfStoneDeathEffect extends OneShotEffect { - private UUID exileId; + private final UUID exileId; public SistersOfStoneDeathEffect(UUID exileId) { super(Outcome.PutCreatureInPlay); @@ -117,19 +117,19 @@ class SistersOfStoneDeathEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { CardsImpl cardsInExile = new CardsImpl(); - TargetCard target = new TargetCard(Zone.PICK, new FilterCard()); - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { + TargetCard target = new TargetCard(Zone.EXILED, new FilterCreatureCard()); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { ExileZone exile = game.getExile().getExileZone(exileId); if (exile != null) { - LinkedList cards = new LinkedList(exile); + LinkedList cards = new LinkedList<>(exile); for (UUID cardId : cards) { Card card = game.getCard(cardId); cardsInExile.add(card); } - if (you.choose(Outcome.PutCreatureInPlay, cardsInExile, target, game)) { + if (controller.choose(Outcome.PutCreatureInPlay, cardsInExile, target, game)) { Card chosenCard = game.getCard(target.getFirstTarget()); - return you.putOntoBattlefieldWithInfo(chosenCard, game, Zone.EXILED, source.getSourceId()); + return controller.moveCards(chosenCard, Zone.BATTLEFIELD, source, game); } } } diff --git a/Mage.Sets/src/mage/sets/ravnica/StoneSeederHierophant.java b/Mage.Sets/src/mage/sets/ravnica/StoneSeederHierophant.java index b6aeee6f40c..8f33f38ad1b 100644 --- a/Mage.Sets/src/mage/sets/ravnica/StoneSeederHierophant.java +++ b/Mage.Sets/src/mage/sets/ravnica/StoneSeederHierophant.java @@ -58,8 +58,8 @@ public class StoneSeederHierophant extends CardImpl { this.toughness = new MageInt(1); // Whenever a land enters the battlefield under your control, untap Stone-Seeder Hierophant. - this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new FilterLandPermanent("a land"), false)); - + this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new FilterLandPermanent("a land"), false, null, true)); + // {tap}: Untap target land. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost()); Target target = new TargetLandPermanent(); diff --git a/Mage.Sets/src/mage/sets/ravnica/SunhomeEnforcer.java b/Mage.Sets/src/mage/sets/ravnica/SunhomeEnforcer.java new file mode 100644 index 00000000000..4ea3335350a --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/SunhomeEnforcer.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.DamagedEvent; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; + +/** + * + * @author fireshoes + */ +public class SunhomeEnforcer extends CardImpl { + + public SunhomeEnforcer(UUID ownerId) { + super(ownerId, 233, "Sunhome Enforcer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{W}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Giant"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Whenever Sunhome Enforcer deals combat damage, you gain that much life. + this.addAbility(new SunhomeEnforcerTriggeredAbility()); + + // {1}{R}: Sunhome Enforcer gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{1}{R}"))); + } + + public SunhomeEnforcer(final SunhomeEnforcer card) { + super(card); + } + + @Override + public SunhomeEnforcer copy() { + return new SunhomeEnforcer(this); + } +} + +class SunhomeEnforcerTriggeredAbility extends TriggeredAbilityImpl { + + public SunhomeEnforcerTriggeredAbility() { + super(Zone.BATTLEFIELD, null); + } + + public SunhomeEnforcerTriggeredAbility(final SunhomeEnforcerTriggeredAbility ability) { + super(ability); + } + + @Override + public SunhomeEnforcerTriggeredAbility copy() { + return new SunhomeEnforcerTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE + || event.getType() == EventType.DAMAGED_PLAYER + || event.getType() == EventType.DAMAGED_PLANESWALKER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + DamagedEvent damageEvent = (DamagedEvent) event; + if (damageEvent.isCombatDamage()) { + if (event.getSourceId().equals(this.sourceId)) { + this.getEffects().clear(); + this.getEffects().add(new GainLifeEffect(damageEvent.getAmount())); + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} deals combat damage, you gain that much life."; + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/SuppressionField.java b/Mage.Sets/src/mage/sets/ravnica/SuppressionField.java index 7c4142711e2..ae8f16d7458 100644 --- a/Mage.Sets/src/mage/sets/ravnica/SuppressionField.java +++ b/Mage.Sets/src/mage/sets/ravnica/SuppressionField.java @@ -29,11 +29,8 @@ package mage.sets.ravnica; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.ActivatedAbility; -import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.cost.CostModificationEffectImpl; -import mage.abilities.mana.ManaAbility; import mage.cards.CardImpl; import mage.constants.AbilityType; import mage.constants.CardType; @@ -55,9 +52,8 @@ public class SuppressionField extends CardImpl { super(ownerId, 31, "Suppression Field", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); this.expansionSetCode = "RAV"; - // Activated abilities cost {2} more to activate unless they're mana abilities. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SuppressionFieldCostReductionEffect() )); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SuppressionFieldCostReductionEffect())); } public SuppressionField(final SuppressionField card) { @@ -72,7 +68,7 @@ public class SuppressionField extends CardImpl { class SuppressionFieldCostReductionEffect extends CostModificationEffectImpl { - SuppressionFieldCostReductionEffect ( ) { + SuppressionFieldCostReductionEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST); staticText = "Activated abilities cost {2} more to activate unless they're mana abilities"; } @@ -89,10 +85,7 @@ class SuppressionFieldCostReductionEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED)) { - return true; - } - return false; + return abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED); } @Override diff --git a/Mage.Sets/src/mage/sets/ravnica/Terraformer.java b/Mage.Sets/src/mage/sets/ravnica/Terraformer.java index 13e12446010..9e1325f9297 100644 --- a/Mage.Sets/src/mage/sets/ravnica/Terraformer.java +++ b/Mage.Sets/src/mage/sets/ravnica/Terraformer.java @@ -27,7 +27,6 @@ */ package mage.sets.ravnica; -import java.util.Set; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; @@ -41,7 +40,8 @@ import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.choices.ChoiceImpl; +import mage.choices.Choice; +import mage.choices.ChoiceBasicLandType; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -103,15 +103,9 @@ class TerraformerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - ChoiceImpl choices = new ChoiceImpl(true); - Set choicesSet = choices.getChoices(); - choicesSet.add("Forest"); - choicesSet.add("Plains"); - choicesSet.add("Mountain"); - choicesSet.add("Island"); - choicesSet.add("Swamp"); - if (player.choose(Outcome.Neutral, choices, game)) { - game.getState().setValue(source.getSourceId().toString() + "_Terraformer", choices.getChoice()); + Choice choice = new ChoiceBasicLandType(); + if (player.choose(Outcome.Neutral, choice, game)) { + game.getState().setValue(source.getSourceId().toString() + "_Terraformer", choice.getChoice()); } game.addEffect(new TerraformerContinuousEffect(), source); return true; diff --git a/Mage.Sets/src/mage/sets/ravnica/Transluminant.java b/Mage.Sets/src/mage/sets/ravnica/Transluminant.java new file mode 100644 index 00000000000..cfdf4b4ac02 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/Transluminant.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.SpiritWhiteToken; + +/** + * + * @author LoneFox + */ +public class Transluminant extends CardImpl { + + public Transluminant(UUID ownerId) { + super(ownerId, 186, "Transluminant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Dryad"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {W}, Sacrifice Transluminant: Put a 1/1 white Spirit creature token with flying onto the battlefield at the beginning of the next end step. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken()))), + new ManaCostsImpl("{W}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public Transluminant(final Transluminant card) { + super(card); + } + + @Override + public Transluminant copy() { + return new Transluminant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/VoyagerStaff.java b/Mage.Sets/src/mage/sets/ravnica/VoyagerStaff.java new file mode 100644 index 00000000000..fb3eb5ab80c --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/VoyagerStaff.java @@ -0,0 +1,109 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnFromExileEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class VoyagerStaff extends CardImpl { + + public VoyagerStaff(UUID ownerId) { + super(ownerId, 274, "Voyager Staff", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "RAV"; + + // {2}, Sacrifice Voyager Staff: Exile target creature. Return the exiled card to the battlefield under its owner's control at the beginning of the next end step. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new VoyagerStaffEffect(), new GenericManaCost(2)); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public VoyagerStaff(final VoyagerStaff card) { + super(card); + } + + @Override + public VoyagerStaff copy() { + return new VoyagerStaff(this); + } +} + +class VoyagerStaffEffect extends OneShotEffect { + + public VoyagerStaffEffect() { + super(Outcome.Detriment); + staticText = "exile target creature. Return the exiled card to the battlefield under its owner's control at the beginning of the next end step"; + } + + public VoyagerStaffEffect(final VoyagerStaffEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanent(source.getFirstTarget()); + Player controller = game.getPlayer(source.getControllerId()); + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (controller != null && creature != null && sourcePermanent != null) { + if (controller.moveCardToExileWithInfo(creature, source.getSourceId(), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true)) { + //create delayed triggered ability + AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, false)); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + } + return false; + } + + @Override + public VoyagerStaffEffect copy() { + return new VoyagerStaffEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/ravnica/WizenedSnitches.java b/Mage.Sets/src/mage/sets/ravnica/WizenedSnitches.java new file mode 100644 index 00000000000..ae7d34724e7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/WizenedSnitches.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.ravnica; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.PlayWithTheTopCardRevealedEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class WizenedSnitches extends CardImpl { + + public WizenedSnitches(UUID ownerId) { + super(ownerId, 75, "Wizened Snitches", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Faerie"); + this.subtype.add("Rogue"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Players play with the top card of their libraries revealed. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect(true))); + } + + public WizenedSnitches(final WizenedSnitches card) { + super(card); + } + + @Override + public WizenedSnitches copy() { + return new WizenedSnitches(this); + } +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/AnnihilatingFire.java b/Mage.Sets/src/mage/sets/returntoravnica/AnnihilatingFire.java index 9ec377e67ea..402a1df1aa6 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/AnnihilatingFire.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/AnnihilatingFire.java @@ -37,6 +37,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.target.common.TargetCreatureOrPlayer; +import mage.watchers.common.DamagedByWatcher; /** * @@ -45,20 +46,20 @@ import mage.target.common.TargetCreatureOrPlayer; public class AnnihilatingFire extends CardImpl { public AnnihilatingFire(UUID ownerId) { - super(ownerId, 85, "Annihilating Fire", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}{R}"); - this.expansionSetCode = "RTR"; + super(ownerId, 85, "Annihilating Fire", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}{R}"); + this.expansionSetCode = "RTR"; + // Annihilating Fire deals 3 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - // Annihilating Fire deals 3 damage to target creature or player. - this.getSpellAbility().addEffect(new DamageTargetEffect(3)); - this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + // If a creature dealt damage this way would die this turn, exile it instead. + this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn)); + this.getSpellAbility().addWatcher(new DamagedByWatcher()); + } - // If a creature dealt damage this way would die this turn, exile it instead. - this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn)); - } - - public AnnihilatingFire(final AnnihilatingFire card) { - super(card); + public AnnihilatingFire(final AnnihilatingFire card) { + super(card); } @Override diff --git a/Mage.Sets/src/mage/sets/returntoravnica/ArmadaWurm.java b/Mage.Sets/src/mage/sets/returntoravnica/ArmadaWurm.java index 4aa5f82ae24..dc031cefc92 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/ArmadaWurm.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/ArmadaWurm.java @@ -38,7 +38,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.WurmToken2; /** * @@ -59,7 +59,7 @@ public class ArmadaWurm extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // When Armada Wurm enters the battlefield, put a 5/5 green Wurm creature token with trample onto the battlefield. - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ArmadaWurmToken()), false)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WurmToken2()), false)); } @@ -71,18 +71,4 @@ public class ArmadaWurm extends CardImpl { public ArmadaWurm copy() { return new ArmadaWurm(this); } - - private class ArmadaWurmToken extends Token { - - private ArmadaWurmToken() { - super("Wurm", "a 5/5 green Wurm creature token with trample"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Wurm"); - power = new MageInt(5); - toughness = new MageInt(5); - addAbility(TrampleAbility.getInstance()); - } - - } } diff --git a/Mage.Sets/src/mage/sets/returntoravnica/CentaursHerald.java b/Mage.Sets/src/mage/sets/returntoravnica/CentaursHerald.java index 92c32cd12fa..6d3819d0672 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/CentaursHerald.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/CentaursHerald.java @@ -29,8 +29,6 @@ package mage.sets.returntoravnica; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; @@ -39,8 +37,10 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.CentaurToken; /** * @@ -58,7 +58,7 @@ public class CentaursHerald extends CardImpl { this.toughness = new MageInt(1); // {2}{G}, Sacrifice Centaur's Herald: Put a 3/3 green Centaur creature token onto the battlefield. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new CentaursHeraldToken()), new ManaCostsImpl("{2}{G}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new CentaurToken()), new ManaCostsImpl("{2}{G}")); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); } @@ -71,16 +71,4 @@ public class CentaursHerald extends CardImpl { public CentaursHerald copy() { return new CentaursHerald(this); } - - private class CentaursHeraldToken extends Token { - - public CentaursHeraldToken() { - super("Centaur", "3/3 green Centaur creature token"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Centaur"); - power = new MageInt(3); - toughness = new MageInt(3); - } - } } diff --git a/Mage.Sets/src/mage/sets/returntoravnica/ChromaticLantern.java b/Mage.Sets/src/mage/sets/returntoravnica/ChromaticLantern.java index f17b07b1179..7f402061824 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/ChromaticLantern.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/ChromaticLantern.java @@ -28,14 +28,13 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterLandPermanent; @@ -51,7 +50,6 @@ public class ChromaticLantern extends CardImpl { // Lands you control have "{T}: Add one mana of any color to your mana pool." this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new AnyColorManaAbility(), Duration.WhileOnBattlefield, new FilterLandPermanent("Lands"), false))); - // {T}: Add one mana of any color to your mana pool. this.addAbility(new AnyColorManaAbility()); @@ -66,4 +64,3 @@ public class ChromaticLantern extends CardImpl { return new ChromaticLantern(this); } } - diff --git a/Mage.Sets/src/mage/sets/returntoravnica/CorpsejackMenace.java b/Mage.Sets/src/mage/sets/returntoravnica/CorpsejackMenace.java index 91dd5a1a86c..58085795567 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/CorpsejackMenace.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/CorpsejackMenace.java @@ -28,30 +28,30 @@ package mage.sets.returntoravnica; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; /** - * http://www.wizards.com/magic/magazine/article.aspx?x=mtg/faq/rtr + * http://www.wizards.com/magic/magazine/article.aspx?x=mtg/faq/rtr * - * If a creature you control would enter the battlefield with a number of +1/+1 - * counters on it, it enters with twice that many instead. + * If a creature you control would enter the battlefield with a number of +1/+1 + * counters on it, it enters with twice that many instead. * - * If you control two Corpsejack Menaces, the number of +1/+1 counters placed - * is four times the original number. Three Corpsejack Menaces multiplies the - * original number by eight, and so on. + * If you control two Corpsejack Menaces, the number of +1/+1 counters placed is + * four times the original number. Three Corpsejack Menaces multiplies the + * original number by eight, and so on. * * @author LevelX2 */ @@ -80,8 +80,8 @@ public class CorpsejackMenace extends CardImpl { } } - class CorpsejackMenaceReplacementEffect extends ReplacementEffectImpl { + CorpsejackMenaceReplacementEffect() { super(Duration.WhileOnBattlefield, Outcome.BoostCreature, false); staticText = "If one or more +1/+1 counters would be placed on a creature you control, twice that many +1/+1 counters are placed on it instead"; @@ -93,24 +93,24 @@ class CorpsejackMenaceReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent p = game.getPermanent(event.getTargetId()); - if (p != null) { - p.addCounters(CounterType.P1P1.createInstance(event.getAmount()*2), game, event.getAppliedEffects()); - } - return true; + event.setAmount(event.getAmount() * 2); + return false; } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ADD_COUNTERS; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getData().equals(CounterType.P1P1.getName())) { - Permanent target = game.getPermanent(event.getTargetId()); - if (target != null && target.getControllerId().equals(source.getControllerId()) - && target.getCardType().contains(CardType.CREATURE)) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent == null) { + permanent = game.getPermanentEntering(event.getTargetId()); + } + if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) + && permanent.getCardType().contains(CardType.CREATURE)) { return true; } } diff --git a/Mage.Sets/src/mage/sets/returntoravnica/DeviantGlee.java b/Mage.Sets/src/mage/sets/returntoravnica/DeviantGlee.java index 8aaa3abe553..2470858d5d4 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/DeviantGlee.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/DeviantGlee.java @@ -1,88 +1,88 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ - -package mage.sets.returntoravnica; - -import java.util.UUID; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.continuous.BoostEnchantedEffect; -import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; -import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.keyword.EnchantAbility; -import mage.abilities.keyword.TrampleAbility; -import mage.cards.CardImpl; -import mage.target.TargetPermanent; -import mage.target.common.TargetCreaturePermanent; - -/** - * - * @author LevelX2 - */ -public class DeviantGlee extends CardImpl { - - static final String rule = "and has \"{R}: This creature gains trample until end of turn"; - - public DeviantGlee (UUID ownerId) { - super(ownerId, 65, "Deviant Glee", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); - this.expansionSetCode = "RTR"; - this.subtype.add("Aura"); - this.color.setBlack(true); - - // Enchant creature - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - - // Enchanted creature gets +2/+1 and has "{R}: This creature gains trample until end of turn." - SimpleStaticAbility ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 1, Duration.WhileOnBattlefield)); - Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(TrampleAbility.getInstance(),Duration.EndOfTurn),new ManaCostsImpl("{R}")); - ability2.addEffect(new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, rule)); - this.addAbility(ability2); - } - - public DeviantGlee (final DeviantGlee card) { - super(card); - } - - @Override - public DeviantGlee copy() { - return new DeviantGlee(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.sets.returntoravnica; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class DeviantGlee extends CardImpl { + + static final String rule = "and has \"{R}: This creature gains trample until end of turn.\""; + + public DeviantGlee (UUID ownerId) { + super(ownerId, 65, "Deviant Glee", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); + this.expansionSetCode = "RTR"; + this.subtype.add("Aura"); + this.color.setBlack(true); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets +2/+1 and has "{R}: This creature gains trample until end of turn." + SimpleStaticAbility ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 1, Duration.WhileOnBattlefield)); + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(TrampleAbility.getInstance(),Duration.EndOfTurn),new ManaCostsImpl("{R}")); + ability2.addEffect(new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, rule)); + this.addAbility(ability2); + } + + public DeviantGlee (final DeviantGlee card) { + super(card); + } + + @Override + public DeviantGlee copy() { + return new DeviantGlee(this); + } +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/EpicExperiment.java b/Mage.Sets/src/mage/sets/returntoravnica/EpicExperiment.java index e656a073fb3..1014b5d1a2a 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/EpicExperiment.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/EpicExperiment.java @@ -27,26 +27,26 @@ */ package mage.sets.returntoravnica; -import java.util.ArrayList; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.Filter; import mage.filter.FilterCard; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterInstantOrSorceryCard; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.game.ExileZone; import mage.game.Game; import mage.players.Player; -import mage.target.common.TargetCardInExile; +import mage.target.TargetCard; /** * @@ -76,13 +76,6 @@ public class EpicExperiment extends CardImpl { class EpicExperimentEffect extends OneShotEffect { - private static final FilterCard filterStatic = new FilterCard(); - - static { - filterStatic.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), - new CardTypePredicate(CardType.SORCERY))); - } - public EpicExperimentEffect() { super(Outcome.PlayForFree); staticText = "Exile the top X cards of your library. For each instant and sorcery card with converted mana cost X or less among them, you may cast that card without paying its mana cost. Then put all cards exiled this way that weren't cast into your graveyard"; @@ -95,38 +88,38 @@ class EpicExperimentEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - MageObject sourceObject = source.getSourceObject(game); + MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { // move cards from library to exile - for (int i = 0; i < source.getManaCostsToPay().getX(); i++) { - if (controller.getLibrary().size() > 0) { - Card topCard = controller.getLibrary().getFromTop(game); - controller.moveCardToExileWithInfo(topCard, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true); - } - } + controller.moveCardsToExile(controller.getLibrary().getTopCards(game, source.getManaCostsToPay().getX()), source, game, true, source.getSourceId(), sourceObject.getIdName()); // cast the possible cards without paying the mana ExileZone epicExperimentExileZone = game.getExile().getExileZone(source.getSourceId()); - FilterCard filter = filterStatic.copy(); + FilterCard filter = new FilterInstantOrSorceryCard(); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, source.getManaCostsToPay().getX() + 1)); - filter.setMessage("instant and sorcery cards with converted mana cost "+ source.getManaCostsToPay().getX() +" or less"); - while (epicExperimentExileZone != null && epicExperimentExileZone.count(filter, game) > 0 - && controller.chooseUse(Outcome.PlayForFree, "Cast cards exiled with " + sourceObject.getLogName() + " without paying its mana cost?", source, game)) { - TargetCardInExile target = new TargetCardInExile(filter, source.getSourceId()); - while (epicExperimentExileZone.count(filter, game) > 0 && controller.choose(Outcome.PlayForFree, epicExperimentExileZone, target, game)) { - Card card = game.getCard(target.getFirstTarget()); - if (card != null) { - if (controller.cast(card.getSpellAbility(), game, true)) { - game.getExile().removeCard(card, game); - } + filter.setMessage("instant and sorcery cards with converted mana cost " + source.getManaCostsToPay().getX() + " or less"); + Cards cardsToCast = new CardsImpl(); + if (epicExperimentExileZone == null) { + return true; + } + cardsToCast.addAll(epicExperimentExileZone.getCards(filter, source.getSourceId(), source.getControllerId(), game)); + while (cardsToCast.size() > 0) { + if (!controller.chooseUse(Outcome.PlayForFree, "Cast (another) a card exiled with " + sourceObject.getLogName() + " without paying its mana cost?", source, game)) { + break; + } + TargetCard targetCard = new TargetCard(1, Zone.EXILED, new FilterCard("instant or sorcery card to cast for free")); + if (controller.choose(Outcome.PlayForFree, cardsToCast, targetCard, game)) { + Card card = game.getCard(targetCard.getFirstTarget()); + if (card != null) { + if (controller.cast(card.getSpellAbility(), game, true)) { + cardsToCast.remove(card); + } else { + game.informPlayer(controller, "You're not able to cast " + card.getIdName() + " or you canceled the casting."); } - target.clearChosen(); + } } } // move cards not cast to graveyard - ExileZone exile = game.getExile().getExileZone(source.getSourceId()); - if (exile != null) { - controller.moveCards(exile, Zone.EXILED, Zone.GRAVEYARD, source, game); - } + controller.moveCards(game.getExile().getExileZone(source.getSourceId()).getCards(game), Zone.GRAVEYARD, source, game); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/returntoravnica/EyesInTheSkies.java b/Mage.Sets/src/mage/sets/returntoravnica/EyesInTheSkies.java index 4529c5edf72..d94927b40ed 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/EyesInTheSkies.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/EyesInTheSkies.java @@ -28,14 +28,12 @@ package mage.sets.returntoravnica; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.PopulateEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.BirdToken; /** * @@ -47,7 +45,6 @@ public class EyesInTheSkies extends CardImpl { super(ownerId, 10, "Eyes in the Skies", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{W}"); this.expansionSetCode = "RTR"; - // Put a 1/1 white Bird creature token with flying onto the battlefield, then populate. // (Put a token onto the battlefield that's a copy of a creature token you control.) this.getSpellAbility().addEffect(new CreateTokenEffect(new BirdToken())); @@ -62,17 +59,5 @@ public class EyesInTheSkies extends CardImpl { public EyesInTheSkies copy() { return new EyesInTheSkies(this); } - private class BirdToken extends Token { - - public BirdToken() { - super("Bird", "1/1 white Bird creature token with flying"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Bird"); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(FlyingAbility.getInstance()); - } - } } diff --git a/Mage.Sets/src/mage/sets/returntoravnica/IzzetStaticaster.java b/Mage.Sets/src/mage/sets/returntoravnica/IzzetStaticaster.java index 9b151e75285..321e056a6c0 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/IzzetStaticaster.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/IzzetStaticaster.java @@ -27,7 +27,6 @@ */ package mage.sets.returntoravnica; -import java.util.List; import java.util.UUID; import mage.constants.CardType; @@ -61,7 +60,6 @@ public class IzzetStaticaster extends CardImpl { this.subtype.add("Human"); this.subtype.add("Wizard"); - this.power = new MageInt(0); this.toughness = new MageInt(3); diff --git a/Mage.Sets/src/mage/sets/returntoravnica/JaceArchitectOfThought.java b/Mage.Sets/src/mage/sets/returntoravnica/JaceArchitectOfThought.java index 93753306a08..cdce3f264d5 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/JaceArchitectOfThought.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/JaceArchitectOfThought.java @@ -34,11 +34,10 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; @@ -48,7 +47,6 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.common.FilterNonlandCard; import mage.game.ExileZone; @@ -76,7 +74,7 @@ public class JaceArchitectOfThought extends CardImpl { this.expansionSetCode = "RTR"; this.subtype.add("Jace"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Until your next turn, whenever a creature an opponent controls attacks, it gets -1/-0 until end of turn. this.addAbility(new LoyaltyAbility(new JaceArchitectOfThoughtStartEffect1(), 1)); diff --git a/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java b/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java index 570c89917f2..7eed6965be2 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java @@ -30,8 +30,8 @@ package mage.sets.returntoravnica; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.DamagePlayersEffect; import mage.abilities.effects.common.UntapSourceEffect; @@ -41,10 +41,8 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; /** * @@ -52,6 +50,12 @@ import mage.game.stack.Spell; */ public class LobberCrew extends CardImpl { + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + public LobberCrew (UUID ownerId) { super(ownerId, 99, "Lobber Crew", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.expansionSetCode = "RTR"; @@ -66,7 +70,7 @@ public class LobberCrew extends CardImpl { // {T}: Lobber Crew deals 1 damage to each opponent. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamagePlayersEffect(1, TargetController.OPPONENT), new TapSourceCost())); // Whenever you cast a multicolored spell, untap Lobber Crew. - this.addAbility(new LobberCrewTriggeredAbility()); + this.addAbility(new SpellCastControllerTriggeredAbility(new UntapSourceEffect(), filter, false)); } public LobberCrew (final LobberCrew card) { @@ -78,37 +82,3 @@ public class LobberCrew extends CardImpl { return new LobberCrew(this); } } - -class LobberCrewTriggeredAbility extends TriggeredAbilityImpl { - public LobberCrewTriggeredAbility() { - super(Zone.BATTLEFIELD, new UntapSourceEffect()); - } - - public LobberCrewTriggeredAbility(final LobberCrewTriggeredAbility ability) { - super(ability); - } - - @Override - public LobberCrewTriggeredAbility copy() { - return new LobberCrewTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) { - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever you cast a multicolored spell, untap {this}."; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java b/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java index 7bccbedcf04..87a8f09f4b8 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java @@ -25,33 +25,26 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.TriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.common.SourceHasCounterCondition; import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AddManaOfAnyColorEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.mana.ActivateOncePerTurnManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.TargetController; +import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -61,13 +54,12 @@ public class ManaBloom extends CardImpl { static final String rule = "with X charge counters on it"; - public ManaBloom (UUID ownerId) { + public ManaBloom(UUID ownerId) { super(ownerId, 130, "Mana Bloom", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{X}{G}"); this.expansionSetCode = "RTR"; - // Mana Bloom enters the battlefield with X charge counters on it. - this.addAbility(new EntersBattlefieldAbility(new ManaBloomEffect(),rule)); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.CHARGE.createInstance()))); // Remove a charge counter from Mana Bloom: Add one mana of any color to your mana pool. Activate this ability only once each turn. Ability ability = new ActivateOncePerTurnManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); @@ -75,11 +67,11 @@ public class ManaBloom extends CardImpl { // At the beginning of your upkeep, if Mana Bloom has no charge counters on it, return it to its owner's hand. TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(new ReturnToHandSourceEffect(true), TargetController.YOU, false); - this.addAbility(new ConditionalTriggeredAbility(triggeredAbility, new SourceHasCounterCondition(CounterType.CHARGE, 0,0), "At the beginning of your upkeep, if Mana Bloom has no charge counters on it, return it to its owner's hand.")); + this.addAbility(new ConditionalTriggeredAbility(triggeredAbility, new SourceHasCounterCondition(CounterType.CHARGE, 0, 0), "At the beginning of your upkeep, if Mana Bloom has no charge counters on it, return it to its owner's hand.")); } - public ManaBloom (final ManaBloom card) { + public ManaBloom(final ManaBloom card) { super(card); } @@ -88,36 +80,3 @@ public class ManaBloom extends CardImpl { return new ManaBloom(this); } } - -class ManaBloomEffect extends OneShotEffect { - public ManaBloomEffect() { - super(Outcome.Benefit); - } - - public ManaBloomEffect(final ManaBloomEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); - return true; - } - } - } - return true; - } - - @Override - public ManaBloomEffect copy() { - return new ManaBloomEffect(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/PackRat.java b/Mage.Sets/src/mage/sets/returntoravnica/PackRat.java index 266521195b0..2d32fcf5aaf 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/PackRat.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/PackRat.java @@ -28,11 +28,6 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.abilities.effects.CopyCardEffect; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -40,32 +35,37 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.DiscardCardCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; /** * * The token will copy Pack Rat's two abilities. Its power and toughness will be - * equal to the number of Rats you control (not the number of Rats you controlled - * when the token entered the battlefield). It will also be able to create copies - * of itself. + * equal to the number of Rats you control (not the number of Rats you + * controlled when the token entered the battlefield). It will also be able to + * create copies of itself. * - * The token won't copy counters on Pack Rat, nor will it copy other effects that - * have changed Pack Rat's power, toughness, types, color, or so on. Normally, - * this means the token will simply be a Pack Rat. But if any copy effects have - * affected that Pack Rat, they're taken into account. + * The token won't copy counters on Pack Rat, nor will it copy other effects + * that have changed Pack Rat's power, toughness, types, color, or so on. + * Normally, this means the token will simply be a Pack Rat. But if any copy + * effects have affected that Pack Rat, they're taken into account. * - * If Pack Rat leaves the battlefield before its activated ability resolves, - * the token will still enter the battlefield as a copy of Pack Rat, using - * Pack Rat's copiable values from when it was last on the battlefield. + * If Pack Rat leaves the battlefield before its activated ability resolves, the + * token will still enter the battlefield as a copy of Pack Rat, using Pack + * Rat's copiable values from when it was last on the battlefield. * * * @author LevelX2 */ public class PackRat extends CardImpl { + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Rats you control"); static { @@ -83,7 +83,7 @@ public class PackRat extends CardImpl { // Pack Rat's power and toughness are each equal to the number of Rats you control. this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame))); // {2}{B}, Discard a card: Put a token onto the battlefield that's a copy of Pack Rat. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CopyCardEffect(this, 1), new ManaCostsImpl("{2}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutTokenOntoBattlefieldCopySourceEffect(), new ManaCostsImpl("{2}{B}")); ability.addCost(new DiscardCardCost()); this.addAbility(ability); } @@ -97,4 +97,3 @@ public class PackRat extends CardImpl { return new PackRat(this); } } - diff --git a/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java b/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java index a001e95d098..c29cdab9dac 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java @@ -29,16 +29,14 @@ package mage.sets.returntoravnica; import java.util.UUID; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; import mage.target.common.TargetCreatureOrPlayer; /** @@ -47,13 +45,20 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class Pyroconvergence extends CardImpl { + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + public Pyroconvergence(UUID ownerId) { super(ownerId, 103, "Pyroconvergence", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{4}{R}"); this.expansionSetCode = "RTR"; - // Whenever you cast a multicolored spell, Pyroconvergence deals 2 damage to target creature or player. - this.addAbility(new PyroconvergenceTriggeredAbility()); + Ability ability = new SpellCastControllerTriggeredAbility(new DamageTargetEffect(2), filter, false); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); } public Pyroconvergence(final Pyroconvergence card) { @@ -65,35 +70,3 @@ public class Pyroconvergence extends CardImpl { return new Pyroconvergence(this); } } -class PyroconvergenceTriggeredAbility extends TriggeredAbilityImpl { - public PyroconvergenceTriggeredAbility() { - super(Zone.BATTLEFIELD, new DamageTargetEffect(2)); - TargetCreatureOrPlayer target = new TargetCreatureOrPlayer(); - this.addTarget(target); - } - - public PyroconvergenceTriggeredAbility(final PyroconvergenceTriggeredAbility ability) { - super(ability); - } - - @Override - public PyroconvergenceTriggeredAbility copy() { - return new PyroconvergenceTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId()); - } - - @Override - public String getRule() { - return "Whenever you cast a multicolored spell, {this} deals 2 damage to target creature or player."; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/SellerOfSongbirds.java b/Mage.Sets/src/mage/sets/returntoravnica/SellerOfSongbirds.java index b4209fc67cc..b56d095548d 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/SellerOfSongbirds.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/SellerOfSongbirds.java @@ -28,14 +28,14 @@ package mage.sets.returntoravnica; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.BirdToken; /** * @author LevelX2 @@ -63,17 +63,4 @@ public class SellerOfSongbirds extends CardImpl { public SellerOfSongbirds copy() { return new SellerOfSongbirds(this); } - - private class BirdToken extends Token { - - public BirdToken() { - super("Bird", "1/1 white Bird creature token with flying"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Bird"); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(FlyingAbility.getInstance()); - } - } } diff --git a/Mage.Sets/src/mage/sets/returntoravnica/SoulTithe.java b/Mage.Sets/src/mage/sets/returntoravnica/SoulTithe.java index 753401fbf69..3c20ab8aee8 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/SoulTithe.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/SoulTithe.java @@ -30,13 +30,6 @@ package mage.sets.returntoravnica; import java.util.UUID; import mage.MageObject; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -47,6 +40,13 @@ import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -76,9 +76,7 @@ public class SoulTithe extends CardImpl { // At the beginning of the upkeep of enchanted permanent's controller, // that player sacrifices it unless he or she pays {X}, // where X is its converted mana cost. - Ability gainedAbility = new BeginningOfUpkeepTriggeredAbility(new SoulTitheSacrificeSourceUnlessPaysEffect(), TargetController.YOU, false); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, rule))); - + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SoulTitheEffect(), TargetController.CONTROLLER_ATTACHED_TO, false)); } public SoulTithe (final SoulTithe card) { @@ -91,38 +89,42 @@ public class SoulTithe extends CardImpl { } } -class SoulTitheSacrificeSourceUnlessPaysEffect extends OneShotEffect { +class SoulTitheEffect extends OneShotEffect { - public SoulTitheSacrificeSourceUnlessPaysEffect() { + public SoulTitheEffect() { super(Outcome.Sacrifice); staticText = "that player sacrifices it unless he or she pays {X}, where X is its converted mana cost"; } - public SoulTitheSacrificeSourceUnlessPaysEffect(final SoulTitheSacrificeSourceUnlessPaysEffect effect) { + public SoulTitheEffect(final SoulTitheEffect effect) { super(effect); } @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - MageObject sourceObject = source.getSourceObject(game); - if (player != null && permanent != null && sourceObject != null) { - int cmc = permanent.getManaCost().convertedManaCost(); - if (player.chooseUse(Outcome.Benefit, "Pay {" + cmc + "} for " + permanent.getName() + "? (otherwise you sacrifice it)", source, game)) { - Cost cost = new GenericManaCost(cmc); - if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { + Permanent aura = game.getPermanent(source.getSourceId()); + if(aura != null) { + Permanent permanent = game.getPermanent(aura.getAttachedTo()); + if(permanent != null) { + Player player = game.getPlayer(permanent.getControllerId()); + if(player != null) { + int cmc = permanent.getManaCost().convertedManaCost(); + if (player.chooseUse(Outcome.Benefit, "Pay {" + cmc + "} for " + permanent.getName() + "? (otherwise you sacrifice it)", source, game)) { + Cost cost = new GenericManaCost(cmc); + if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) { + return true; + } + } + permanent.sacrifice(source.getSourceId(), game); return true; } } - permanent.sacrifice(source.getSourceId(), game); - return true; } return false; } @Override - public SoulTitheSacrificeSourceUnlessPaysEffect copy() { - return new SoulTitheSacrificeSourceUnlessPaysEffect(this); + public SoulTitheEffect copy() { + return new SoulTitheEffect(this); } } diff --git a/Mage.Sets/src/mage/sets/returntoravnica/SphinxOfTheChimes.java b/Mage.Sets/src/mage/sets/returntoravnica/SphinxOfTheChimes.java index aba60a810f2..21055514d8d 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/SphinxOfTheChimes.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/SphinxOfTheChimes.java @@ -61,7 +61,7 @@ public class SphinxOfTheChimes extends CardImpl { public SphinxOfTheChimes(UUID ownerId) { super(ownerId, 52, "Sphinx of the Chimes", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); this.expansionSetCode = "RTR"; - this.subtype.add("Bird"); + this.subtype.add("Sphinx"); this.power = new MageInt(5); this.toughness = new MageInt(6); diff --git a/Mage.Sets/src/mage/sets/returntoravnica/SupremeVerdict.java b/Mage.Sets/src/mage/sets/returntoravnica/SupremeVerdict.java index 3ea105437d5..08dc6f8febb 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/SupremeVerdict.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/SupremeVerdict.java @@ -25,20 +25,15 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.returntoravnica; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.CantBeCounteredAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.Effect; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.abilities.effects.common.CantBeCounteredSourceEffect; import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; -import mage.constants.Zone; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; /** @@ -47,21 +42,20 @@ import mage.filter.common.FilterCreaturePermanent; */ public class SupremeVerdict extends CardImpl { - public SupremeVerdict (UUID ownerId) { + public SupremeVerdict(UUID ownerId) { super(ownerId, 201, "Supreme Verdict", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{W}{W}{U}"); this.expansionSetCode = "RTR"; - // Supreme Verdict can't be countered. Ability ability = new CantBeCounteredAbility(); ability.setRuleAtTheTop(true); this.addAbility(ability); - // Destroy all creatures. + // Destroy all creatures. this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterCreaturePermanent())); } - public SupremeVerdict (final SupremeVerdict card) { + public SupremeVerdict(final SupremeVerdict card) { super(card); } @@ -69,4 +63,4 @@ public class SupremeVerdict extends CardImpl { public SupremeVerdict copy() { return new SupremeVerdict(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/Syncopate.java b/Mage.Sets/src/mage/sets/returntoravnica/Syncopate.java index e275c8a853f..aa20cacdeb1 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/Syncopate.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/Syncopate.java @@ -40,7 +40,6 @@ import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; @@ -56,7 +55,6 @@ public class Syncopate extends CardImpl { super(ownerId, 54, "Syncopate", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{X}{U}"); this.expansionSetCode = "RTR"; - // Counter target spell unless its controller pays {X}. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. this.getSpellAbility().addEffect(new SyncopateCounterUnlessPaysEffect()); this.getSpellAbility().addTarget(new TargetSpell()); @@ -90,27 +88,19 @@ class SyncopateCounterUnlessPaysEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(game, source)); - if (spell != null) { - Player player = game.getPlayer(spell.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (spell != null && (spell instanceof Spell) && sourceObject != null) { Player controller = game.getPlayer(source.getControllerId()); - if (player != null && controller != null) { - + if (controller != null) { int amount = source.getManaCostsToPay().getX(); if (amount > 0) { GenericManaCost cost = new GenericManaCost(amount); if (!cost.pay(source, game, spell.getControllerId(), spell.getControllerId(), false)) { - StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); if (stackObject != null && !game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, source.getFirstTarget(), source.getSourceId(), stackObject.getControllerId()))) { - game.informPlayers("Syncopate: cost wasn't payed - countering " + stackObject.getName()); - if (stackObject instanceof Spell) { - game.rememberLKI(source.getFirstTarget(), Zone.STACK, (Spell) stackObject); - } - game.getStack().remove(stackObject); - MageObject card = game.getObject(stackObject.getSourceId()); - if (card instanceof Card) { - ((Card) card).moveToZone(Zone.EXILED, source.getSourceId(), game, false); - } + game.informPlayers(sourceObject.getIdName() + ": cost wasn't payed - countering " + stackObject.getName()); + game.rememberLKI(source.getFirstTarget(), Zone.STACK, (Spell) stackObject); + controller.moveCards((Spell) spell, null, Zone.EXILED, source, game); game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, source.getFirstTarget(), source.getSourceId(), stackObject.getControllerId())); return true; } @@ -127,4 +117,4 @@ class SyncopateCounterUnlessPaysEffect extends OneShotEffect { return "Counter target spell unless its controller pays {X}. If that spell is countered this way, exile it instead of putting it into its owner's graveyard"; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/TabletOfTheGuilds.java b/Mage.Sets/src/mage/sets/returntoravnica/TabletOfTheGuilds.java index ffe0df331bd..5d838ca5ddd 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/TabletOfTheGuilds.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/TabletOfTheGuilds.java @@ -28,10 +28,6 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; @@ -39,6 +35,9 @@ import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.choices.ChoiceColor; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.filter.FilterSpell; import mage.game.Game; import mage.game.permanent.Permanent; @@ -59,7 +58,7 @@ public class TabletOfTheGuilds extends CardImpl { this.addAbility(new AsEntersBattlefieldAbility(new TabletOfTheGuildsEntersBattlefieldEffect())); // Whenever you cast a spell, if it's at least one of the chosen colors, you gain 1 life for each of the chosen colors it is. - this.addAbility(new SpellCastControllerTriggeredAbility(new TabletOfTheGuildsGainLifeEffect(), new FilterSpell("a spell"), false, true )); + this.addAbility(new SpellCastControllerTriggeredAbility(new TabletOfTheGuildsGainLifeEffect(), new FilterSpell("a spell"), false, true)); } public TabletOfTheGuilds(final TabletOfTheGuilds card) { @@ -86,7 +85,7 @@ class TabletOfTheGuildsEntersBattlefieldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (player != null && permanent != null) { String colors; ChoiceColor colorChoice = new ChoiceColor(); @@ -101,7 +100,7 @@ class TabletOfTheGuildsEntersBattlefieldEffect extends OneShotEffect { colorChoice.getChoices().remove(colorChoice.getChoice()); colorChoice.setMessage("Choose the second color"); - while (!player.choose(Outcome.GainLife, colorChoice, game) && player.canRespond()) { + while (!player.choose(Outcome.GainLife, colorChoice, game) && player.canRespond()) { game.debugMessage("player canceled choosing type. retrying."); } game.getState().setValue(permanent.getId() + "_color2", colorChoice.getColor().toString()); @@ -157,4 +156,4 @@ class TabletOfTheGuildsGainLifeEffect extends OneShotEffect { public TabletOfTheGuildsGainLifeEffect copy() { return new TabletOfTheGuildsGainLifeEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/VolatileRig.java b/Mage.Sets/src/mage/sets/returntoravnica/VolatileRig.java index cc804adcfad..8a43a92c249 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/VolatileRig.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/VolatileRig.java @@ -195,7 +195,7 @@ class VolatileRigEffect2 extends OneShotEffect { for (Permanent permanent: permanents) { permanent.damage(4, source.getSourceId(), game, false, true); } - for (UUID playerId: player.getInRange()) { + for (UUID playerId: game.getState().getPlayersInRange(player.getId(), game)) { Player damageToPlayer = game.getPlayer(playerId); if (damageToPlayer != null) { damageToPlayer.damage(4, source.getSourceId(), game, false, true); diff --git a/Mage.Sets/src/mage/sets/returntoravnica/VraskaTheUnseen.java b/Mage.Sets/src/mage/sets/returntoravnica/VraskaTheUnseen.java index e04c58658c0..776fd85498b 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/VraskaTheUnseen.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/VraskaTheUnseen.java @@ -33,13 +33,12 @@ import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.LoseGameTargetPlayerEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -48,7 +47,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.counters.CounterType; import mage.game.Game; import mage.game.events.DamagedPlaneswalkerEvent; import mage.game.events.GameEvent; @@ -66,7 +64,7 @@ import mage.target.targetpointer.FixedTarget; * Each Assassin token's triggered ability will trigger whenever it deals combat * damage to any player, including you. * - * + * * @author LevelX2 */ public class VraskaTheUnseen extends CardImpl { @@ -76,11 +74,10 @@ public class VraskaTheUnseen extends CardImpl { this.expansionSetCode = "RTR"; this.subtype.add("Vraska"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); // +1: Until your next turn, whenever a creature deals combat damage to Vraska the Unseen, destroy that creature. - this.addAbility(new LoyaltyAbility(new VraskaTheUnseenGainAbilityEffect(new VraskaTheUnseenTriggeredAbility()),1)); + this.addAbility(new LoyaltyAbility(new VraskaTheUnseenGainAbilityEffect(new VraskaTheUnseenTriggeredAbility()), 1)); // -3: Destroy target nonland permanent. LoyaltyAbility ability = new LoyaltyAbility(new DestroyTargetEffect(), -3); @@ -101,7 +98,6 @@ public class VraskaTheUnseen extends CardImpl { } } - class VraskaTheUnseenGainAbilityEffect extends ContinuousEffectImpl { protected Ability ability; @@ -142,8 +138,7 @@ class VraskaTheUnseenGainAbilityEffect extends ContinuousEffectImpl { @Override public boolean isInactive(Ability source, Game game) { - if (startingTurn != 0 && game.getTurnNum() != startingTurn) - { + if (startingTurn != 0 && game.getTurnNum() != startingTurn) { if (game.getActivePlayerId().equals(source.getControllerId())) { return true; } @@ -153,6 +148,7 @@ class VraskaTheUnseenGainAbilityEffect extends ContinuousEffectImpl { } class AssassinToken extends Token { + AssassinToken() { super("Assassin", "1/1 black Assassin creature tokens with \"Whenever this creature deals combat damage to a player, that player loses the game.\""); cardType.add(CardType.CREATURE); @@ -160,7 +156,7 @@ class AssassinToken extends Token { subtype.add("Assassin"); power = new MageInt(1); toughness = new MageInt(1); - addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new LoseGameTargetPlayerEffect(),false, true)); + addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new LoseGameTargetPlayerEffect(), false, true)); } } @@ -186,7 +182,7 @@ class VraskaTheUnseenTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (((DamagedPlaneswalkerEvent) event).isCombatDamage() && event.getTargetId() == sourceId) { + if (((DamagedPlaneswalkerEvent) event).isCombatDamage() && getSourceId().equals(event.getTargetId())) { Permanent sourceOfDamage = game.getPermanent(event.getSourceId()); if (sourceOfDamage != null && sourceOfDamage.getCardType().contains(CardType.CREATURE)) { Effect effect = this.getEffects().get(0); @@ -202,4 +198,4 @@ class VraskaTheUnseenTriggeredAbility extends TriggeredAbilityImpl { return "Until your next turn, whenever a creature deals combat damage to {this}, destroy that creature"; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/WorldspineWurm.java b/Mage.Sets/src/mage/sets/returntoravnica/WorldspineWurm.java index a2927db3387..33d9e8cd311 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/WorldspineWurm.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/WorldspineWurm.java @@ -37,7 +37,7 @@ import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.WurmToken2; /** * @@ -55,10 +55,10 @@ public class WorldspineWurm extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); - + // When Worldspine Wurm dies, put three 5/5 green Wurm creature tokens with trample onto the battlefield. - this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new WorldspineWurmToken(), 3))); - + this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new WurmToken2(), 3))); + // When Worldspine Wurm is put into a graveyard from anywhere, shuffle it into its owner's library. this.addAbility(new PutIntoGraveFromAnywhereSourceTriggeredAbility(new ShuffleIntoLibrarySourceEffect())); } @@ -72,17 +72,3 @@ public class WorldspineWurm extends CardImpl { return new WorldspineWurm(this); } } - -class WorldspineWurmToken extends Token { - - public WorldspineWurmToken() { - super("Wurm", "5/5 green Wurm creature tokens with trample"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Wurm"); - power = new MageInt(5); - toughness = new MageInt(5); - - this.addAbility(TrampleAbility.getInstance()); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/revisededition/Chaoslace.java b/Mage.Sets/src/mage/sets/revisededition/Chaoslace.java new file mode 100644 index 00000000000..247ae5fe06d --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Chaoslace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Chaoslace extends mage.sets.fourthedition.Chaoslace { + + public Chaoslace(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + this.expansionSetCode = "3ED"; + } + + public Chaoslace(final Chaoslace card) { + super(card); + } + + @Override + public Chaoslace copy() { + return new Chaoslace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Conversion.java b/Mage.Sets/src/mage/sets/revisededition/Conversion.java new file mode 100644 index 00000000000..d5ad6eb5c9e --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Conversion.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 198; + this.expansionSetCode = "3ED"; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Crumble.java b/Mage.Sets/src/mage/sets/revisededition/Crumble.java new file mode 100644 index 00000000000..9e5ba1fb290 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Crumble.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Crumble extends mage.sets.masterseditioniv.Crumble { + + public Crumble(UUID ownerId) { + super(ownerId); + this.cardNumber = 98; + this.expansionSetCode = "3ED"; + this.rarity = Rarity.UNCOMMON; + } + + public Crumble(final Crumble card) { + super(card); + } + + @Override + public Crumble copy() { + return new Crumble(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/CursedLand.java b/Mage.Sets/src/mage/sets/revisededition/CursedLand.java new file mode 100644 index 00000000000..bae229c5d22 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "3ED"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Deathgrip.java b/Mage.Sets/src/mage/sets/revisededition/Deathgrip.java new file mode 100644 index 00000000000..220647d3079 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Deathgrip.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class Deathgrip extends mage.sets.limitedbeta.Deathgrip { + + public Deathgrip(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "3ED"; + } + + public Deathgrip(final Deathgrip card) { + super(card); + } + + @Override + public Deathgrip copy() { + return new Deathgrip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Deathlace.java b/Mage.Sets/src/mage/sets/revisededition/Deathlace.java new file mode 100644 index 00000000000..55e0d3a6a95 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Deathlace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Deathlace extends mage.sets.limitedbeta.Deathlace { + + public Deathlace(UUID ownerId) { + super(ownerId); + this.cardNumber = 10; + this.expansionSetCode = "3ED"; + } + + public Deathlace(final Deathlace card) { + super(card); + } + + @Override + public Deathlace copy() { + return new Deathlace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/DwarvenWeaponsmith.java b/Mage.Sets/src/mage/sets/revisededition/DwarvenWeaponsmith.java new file mode 100644 index 00000000000..e3ebea81631 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/DwarvenWeaponsmith.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.common.IsStepCondition; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledArtifactPermanent; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DwarvenWeaponsmith extends CardImpl { + + public DwarvenWeaponsmith(UUID ownerId) { + super(ownerId, 144, "Dwarven Weaponsmith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "3ED"; + this.subtype.add("Dwarf"); + this.subtype.add("Artificer"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}, Sacrifice an artifact: Put a +1/+1 counter on target creature. Activate this ability only during your upkeep. + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()), + new TapSourceCost(), new IsStepCondition(PhaseStep.UPKEEP), null); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact")))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public DwarvenWeaponsmith(final DwarvenWeaponsmith card) { + super(card); + } + + @Override + public DwarvenWeaponsmith copy() { + return new DwarvenWeaponsmith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Feedback.java b/Mage.Sets/src/mage/sets/revisededition/Feedback.java new file mode 100644 index 00000000000..31cd18bffbe --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "3ED"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/GraniteGargoyle.java b/Mage.Sets/src/mage/sets/revisededition/GraniteGargoyle.java new file mode 100644 index 00000000000..3191c635ce3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/GraniteGargoyle.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class GraniteGargoyle extends CardImpl { + + public GraniteGargoyle(UUID ownerId) { + super(ownerId, 155, "Granite Gargoyle", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "3ED"; + this.subtype.add("Gargoyle"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {R}: Granite Gargoyle gets +0/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public GraniteGargoyle(final GraniteGargoyle card) { + super(card); + } + + @Override + public GraniteGargoyle copy() { + return new GraniteGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/IslandFishJasconius.java b/Mage.Sets/src/mage/sets/revisededition/IslandFishJasconius.java new file mode 100644 index 00000000000..a3174bbcb7a --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/IslandFishJasconius.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class IslandFishJasconius extends mage.sets.fourthedition.IslandFishJasconius { + + public IslandFishJasconius(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "3ED"; + } + + public IslandFishJasconius(final IslandFishJasconius card) { + super(card); + } + + @Override + public IslandFishJasconius copy() { + return new IslandFishJasconius(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Lifeforce.java b/Mage.Sets/src/mage/sets/revisededition/Lifeforce.java new file mode 100644 index 00000000000..e5328eb3b10 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Lifeforce.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Lifeforce extends mage.sets.masterseditioniv.Lifeforce { + + public Lifeforce(UUID ownerId) { + super(ownerId); + this.cardNumber = 114; + this.expansionSetCode = "3ED"; + this.rarity = Rarity.UNCOMMON; + } + + public Lifeforce(final Lifeforce card) { + super(card); + } + + @Override + public Lifeforce copy() { + return new Lifeforce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Lifelace.java b/Mage.Sets/src/mage/sets/revisededition/Lifelace.java new file mode 100644 index 00000000000..3012b263eb7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Lifelace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Lifelace extends mage.sets.limitedalpha.Lifelace { + + public Lifelace(UUID ownerId) { + super(ownerId); + this.cardNumber = 115; + this.expansionSetCode = "3ED"; + } + + public Lifelace(final Lifelace card) { + super(card); + } + + @Override + public Lifelace copy() { + return new Lifelace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Lifetap.java b/Mage.Sets/src/mage/sets/revisededition/Lifetap.java new file mode 100644 index 00000000000..fecddb4c9e3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Lifetap.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Lifetap extends mage.sets.fifthedition.Lifetap { + + public Lifetap(UUID ownerId) { + super(ownerId); + this.cardNumber = 63; + this.expansionSetCode = "3ED"; + } + + public Lifetap(final Lifetap card) { + super(card); + } + + @Override + public Lifetap copy() { + return new Lifetap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/LivingArtifact.java b/Mage.Sets/src/mage/sets/revisededition/LivingArtifact.java new file mode 100644 index 00000000000..11f4e77781d --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/LivingArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class LivingArtifact extends mage.sets.fifthedition.LivingArtifact { + + public LivingArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 116; + this.expansionSetCode = "3ED"; + } + + public LivingArtifact(final LivingArtifact card) { + super(card); + } + + @Override + public LivingArtifact copy() { + return new LivingArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Purelace.java b/Mage.Sets/src/mage/sets/revisededition/Purelace.java new file mode 100644 index 00000000000..35bf375c635 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Purelace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Purelace extends mage.sets.unlimitededition.Purelace { + + public Purelace(UUID ownerId) { + super(ownerId); + this.cardNumber = 216; + this.expansionSetCode = "3ED"; + } + + public Purelace(final Purelace card) { + super(card); + } + + @Override + public Purelace copy() { + return new Purelace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Sacrifice.java b/Mage.Sets/src/mage/sets/revisededition/Sacrifice.java new file mode 100644 index 00000000000..acce4e3f6e8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Sacrifice.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Sacrifice extends mage.sets.unlimitededition.Sacrifice { + + public Sacrifice(UUID ownerId) { + super(ownerId); + this.cardNumber = 34; + this.expansionSetCode = "3ED"; + } + + public Sacrifice(final Sacrifice card) { + super(card); + } + + @Override + public Sacrifice copy() { + return new Sacrifice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/ScavengingGhoul.java b/Mage.Sets/src/mage/sets/revisededition/ScavengingGhoul.java new file mode 100644 index 00000000000..2fcc75753e8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/ScavengingGhoul.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ScavengingGhoul extends mage.sets.limitedalpha.ScavengingGhoul { + + public ScavengingGhoul(UUID ownerId) { + super(ownerId); + this.cardNumber = 36; + this.expansionSetCode = "3ED"; + } + + public ScavengingGhoul(final ScavengingGhoul card) { + super(card); + } + + @Override + public ScavengingGhoul copy() { + return new ScavengingGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java b/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java new file mode 100644 index 00000000000..c8bdbd5ed3b --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class SorceressQueen extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature other than {this}"); + + static { + filter.add(new AnotherPredicate()); + } + + public SorceressQueen(UUID ownerId) { + super(ownerId, 39, "Sorceress Queen", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "3ED"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Target creature other than Sorceress Queen becomes 0/2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetPowerToughnessTargetEffect(0, 2, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + + } + + public SorceressQueen(final SorceressQueen card) { + super(card); + } + + @Override + public SorceressQueen copy() { + return new SorceressQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/SunglassesOfUrza.java b/Mage.Sets/src/mage/sets/revisededition/SunglassesOfUrza.java new file mode 100644 index 00000000000..a9bb3451932 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/SunglassesOfUrza.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SunglassesOfUrza extends mage.sets.limitedalpha.SunglassesOfUrza { + + public SunglassesOfUrza(UUID ownerId) { + super(ownerId); + this.cardNumber = 276; + this.expansionSetCode = "3ED"; + } + + public SunglassesOfUrza(final SunglassesOfUrza card) { + super(card); + } + + @Override + public SunglassesOfUrza copy() { + return new SunglassesOfUrza(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Thoughtlace.java b/Mage.Sets/src/mage/sets/revisededition/Thoughtlace.java new file mode 100644 index 00000000000..a0415d3b7e2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Thoughtlace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Thoughtlace extends mage.sets.limitedbeta.Thoughtlace { + + public Thoughtlace(UUID ownerId) { + super(ownerId); + this.cardNumber = 85; + this.expansionSetCode = "3ED"; + } + + public Thoughtlace(final Thoughtlace card) { + super(card); + } + + @Override + public Thoughtlace copy() { + return new Thoughtlace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/revisededition/VesuvanDoppelganger.java new file mode 100644 index 00000000000..f47eda8e13d --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/VesuvanDoppelganger.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class VesuvanDoppelganger extends mage.sets.unlimitededition.VesuvanDoppelganger { + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "3ED"; + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Wanderlust.java b/Mage.Sets/src/mage/sets/revisededition/Wanderlust.java new file mode 100644 index 00000000000..522ce6f4bf6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 134; + this.expansionSetCode = "3ED"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/WarpArtifact.java b/Mage.Sets/src/mage/sets/revisededition/WarpArtifact.java new file mode 100644 index 00000000000..d0db483889a --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.revisededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 43; + this.expansionSetCode = "3ED"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AwakeningZone.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AwakeningZone.java index 6eaa7d2c8be..25ce8d98831 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AwakeningZone.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AwakeningZone.java @@ -29,12 +29,12 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; -import mage.abilities.common.OnEventTriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.events.GameEvent.EventType; +import mage.constants.TargetController; import mage.game.permanent.token.EldraziSpawnToken; /** @@ -46,7 +46,7 @@ public class AwakeningZone extends CardImpl { public AwakeningZone(UUID ownerId) { super(ownerId, 176, "Awakening Zone", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); this.expansionSetCode = "ROE"; - this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new CreateTokenEffect(new EldraziSpawnToken()), true)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new EldraziSpawnToken()), TargetController.YOU, false)); } public AwakeningZone(final AwakeningZone card) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ContaminatedGround.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ContaminatedGround.java index 98dbcb72f86..d7b41894cb8 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ContaminatedGround.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ContaminatedGround.java @@ -29,11 +29,10 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BecomesTappedAttachedTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.LoseLifeControllerAttachedEffect; import mage.abilities.effects.common.continuous.BecomesBasicLandEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; @@ -41,13 +40,8 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; -import mage.target.targetpointer.FixedTarget; /** * @author Loki @@ -69,9 +63,9 @@ public class ContaminatedGround extends CardImpl { // Enchanted land is a Swamp. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect("Swamp"))); - + // Whenever enchanted land becomes tapped, its controller loses 2 life. - this.addAbility(new ContaminatedGroundAbility()); + this.addAbility(new BecomesTappedAttachedTriggeredAbility(new LoseLifeControllerAttachedEffect(2), "enchanted land")); } public ContaminatedGround(final ContaminatedGround card) { @@ -83,44 +77,3 @@ public class ContaminatedGround extends CardImpl { return new ContaminatedGround(this); } } - -class ContaminatedGroundAbility extends TriggeredAbilityImpl { - ContaminatedGroundAbility() { - super(Zone.BATTLEFIELD, new LoseLifeTargetEffect(2)); - } - - ContaminatedGroundAbility(final ContaminatedGroundAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent source = game.getPermanent(this.sourceId); - if (source != null && source.getAttachedTo().equals(event.getTargetId())) { - Permanent attached = game.getPermanent(source.getAttachedTo()); - if (attached != null) { - - for (Effect e : getEffects()) { - e.setTargetPointer(new FixedTarget(attached.getControllerId())); - } - return true; - } - } - return false; - } - - @Override - public ContaminatedGroundAbility copy() { - return new ContaminatedGroundAbility(this); - } - - @Override - public String getRule() { - return "Whenever enchanted land becomes tapped, its controller loses 2 life."; - } -} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java index bd4d6e4b53f..db2d0e39027 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java @@ -29,13 +29,11 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; import mage.ObjectColor; -import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.AsEntersBattlefieldAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseColorEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; -import mage.choices.ChoiceColor; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -45,7 +43,6 @@ import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; -import mage.players.Player; import mage.target.targetpointer.FixedTarget; /** @@ -57,9 +54,8 @@ public class CurseOfWizardry extends CardImpl { super(ownerId, 104, "Curse of Wizardry", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); this.expansionSetCode = "ROE"; - // As Curse of Wizardry enters the battlefield, choose a color. - this.addAbility(new AsEntersBattlefieldAbility(new CurseOfWizardryChooseColorEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral))); // Whenever a player casts a spell of the chosen color, that player loses 1 life. this.addAbility(new CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility()); @@ -76,38 +72,6 @@ public class CurseOfWizardry extends CardImpl { } } -class CurseOfWizardryChooseColorEffect extends OneShotEffect { - - public CurseOfWizardryChooseColorEffect() { - super(Outcome.Detriment); - staticText = "choose a color"; - } - - public CurseOfWizardryChooseColorEffect(final CurseOfWizardryChooseColorEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent curseOfWizardry = game.getPermanent(source.getSourceId()); - if (player != null && curseOfWizardry != null) { - ChoiceColor colorChoice = new ChoiceColor(); - if (player.choose(Outcome.Detriment, colorChoice, game)) { - game.informPlayers(curseOfWizardry.getName() + ": " + player.getLogName() + " has chosen " + colorChoice.getChoice()); - game.getState().setValue(curseOfWizardry.getId() + "_color", colorChoice.getColor()); - curseOfWizardry.addInfo("chosen color", "Chosen color: " + colorChoice.getColor().getDescription() + "", game); - } - } - return false; - } - - @Override - public CurseOfWizardryChooseColorEffect copy() { - return new CurseOfWizardryChooseColorEffect(this); - } -} - class CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility extends TriggeredAbilityImpl { public CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility() { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DemonicAppetite.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DemonicAppetite.java index d467a009fb5..efaaf2c58a8 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/DemonicAppetite.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/DemonicAppetite.java @@ -25,20 +25,25 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.riseoftheeldrazi; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -48,29 +53,27 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class DemonicAppetite extends CardImpl { - public DemonicAppetite (UUID ownerId) { + public DemonicAppetite(UUID ownerId) { super(ownerId, 106, "Demonic Appetite", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); this.expansionSetCode = "ROE"; this.subtype.add("Aura"); - + // Enchant creature you control TargetPermanent auraTarget = new TargetControlledCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); + + // Enchanted creature gets +3/+3. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield))); - ability = new BeginningOfUpkeepTriggeredAbility( - new DemonicAppetiteEffect(), - TargetController.YOU, - false); - ability.addTarget(new TargetControlledCreaturePermanent()); - this.addAbility(ability); + // At the beginning of your upkeep, sacrifice a creature. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent("a creature"), 1, ""), + TargetController.YOU, false)); } - public DemonicAppetite (final DemonicAppetite card) { + public DemonicAppetite(final DemonicAppetite card) { super(card); } @@ -80,16 +83,16 @@ public class DemonicAppetite extends CardImpl { } } - class DemonicAppetiteEffect extends SacrificeTargetEffect { +class DemonicAppetiteEffect extends SacrificeTargetEffect { - DemonicAppetiteEffect() { - super(); - staticText = "sacrifice a creature"; - } + DemonicAppetiteEffect() { + super(); + staticText = "sacrifice a creature"; + } - @Override - public DemonicAppetiteEffect copy() { - return new DemonicAppetiteEffect(); - } + @Override + public DemonicAppetiteEffect copy() { + return new DemonicAppetiteEffect(); + } -} +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java index afa39d5afc2..773a63bab34 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java @@ -31,7 +31,7 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledLandPermanent; @@ -52,7 +52,7 @@ public class Deprive extends CardImpl { this.expansionSetCode = "ROE"; // As an additional cost to cast Deprive, return a land you control to its owner's hand. - this.getSpellAbility().addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + this.getSpellAbility().addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); // Counter target spell. this.getSpellAbility().addTarget(new TargetSpell()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java index 11b0df213d7..81f7d3e5c6d 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java @@ -29,30 +29,20 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.CantBeCounteredAbility; import mage.abilities.common.PutIntoGraveFromAnywhereSourceTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; +import mage.abilities.effects.common.ShuffleIntoLibraryGraveOfSourceOwnerEffect; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; import mage.abilities.keyword.AnnihilatorAbility; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ProtectionAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.FilterSpell; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorlessPredicate; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; -import mage.game.turn.TurnMod; -import mage.players.Player; - /** * @author Loki @@ -72,17 +62,18 @@ public class EmrakulTheAeonsTorn extends CardImpl { this.subtype.add("Eldrazi"); this.power = new MageInt(15); this.toughness = new MageInt(15); - + // Emrakul, the Aeons Torn can't be countered. this.addAbility(new CantBeCounteredAbility()); - // When you cast Emrakul, take an extra turn after this one. - this.addAbility(new EmrakulTheAeonsTornOnCastAbility()); + // When you cast Emrakul, take an extra turn after this one. + this.addAbility(new CastSourceTriggeredAbility(new AddExtraTurnControllerEffect())); + // Flying, protection from colored spells, annihilator 6 this.addAbility(FlyingAbility.getInstance()); this.addAbility(new ProtectionAbility(filter)); this.addAbility(new AnnihilatorAbility(6)); // When Emrakul is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library. - this.addAbility(new PutIntoGraveFromAnywhereSourceTriggeredAbility(new EmrakulTheAeonsTornEffect(), false)); + this.addAbility(new PutIntoGraveFromAnywhereSourceTriggeredAbility(new ShuffleIntoLibraryGraveOfSourceOwnerEffect(), false)); } public EmrakulTheAeonsTorn(final EmrakulTheAeonsTorn card) { @@ -94,89 +85,3 @@ public class EmrakulTheAeonsTorn extends CardImpl { return new EmrakulTheAeonsTorn(this); } } -class EmrakulTheAeonsTornOnCastAbility extends TriggeredAbilityImpl { - - private static final String abilityText = "When you cast {this}, take an extra turn after this one"; - - EmrakulTheAeonsTornOnCastAbility() { - super(Zone.STACK, new EmrakulExtraTurnEffect()); - } - - EmrakulTheAeonsTornOnCastAbility(EmrakulTheAeonsTornOnCastAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = (Spell) game.getObject(event.getTargetId()); - return this.getSourceId().equals(spell.getSourceId()); - } - - @Override - public EmrakulTheAeonsTornOnCastAbility copy() { - return new EmrakulTheAeonsTornOnCastAbility(this); - } - - @Override - public String getRule() { - return abilityText; - } -} - -class EmrakulTheAeonsTornEffect extends OneShotEffect { - - EmrakulTheAeonsTornEffect() { - super(Outcome.Benefit); - staticText = "its owner shuffles his or her graveyard into his or her library"; - } - - EmrakulTheAeonsTornEffect(final EmrakulTheAeonsTornEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - for (Card card: player.getGraveyard().getCards(game)) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - player.shuffleLibrary(game); - return true; - } - return false; - } - - @Override - public EmrakulTheAeonsTornEffect copy() { - return new EmrakulTheAeonsTornEffect(this); - } -} - -class EmrakulExtraTurnEffect extends OneShotEffect { - - EmrakulExtraTurnEffect() { - super(Outcome.ExtraTurn); - staticText = "take an extra turn after this one"; - } - - EmrakulExtraTurnEffect(final EmrakulExtraTurnEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), false)); - return true; - } - - @Override - public EmrakulExtraTurnEffect copy() { - return new EmrakulExtraTurnEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java index d01d66c5968..52140b5319a 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,32 +20,29 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.riseoftheeldrazi; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.TurnPhase; import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.RequirementEffect; -import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.PreventAllDamageToSourceEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; import mage.cards.CardImpl; -import mage.counters.CounterType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TurnPhase; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; @@ -71,9 +68,8 @@ public class GideonJura extends CardImpl { this.expansionSetCode = "ROE"; this.subtype.add("Gideon"); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6)); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), false)); - // +2: During target opponent's next turn, creatures that player controls attack Gideon Jura if able. LoyaltyAbility ability1 = new LoyaltyAbility(new GideonJuraEffect(), 2); ability1.addTarget(new TargetOpponent()); @@ -148,9 +144,9 @@ class GideonJuraEffect extends RequirementEffect { @Override public boolean isInactive(Ability source, Game game) { - return (startingTurn != game.getTurnNum() && - (game.getPhase().getType() == TurnPhase.END && - game.getActivePlayerId().equals(source.getFirstTarget()))) + return (startingTurn != game.getTurnNum() + && (game.getPhase().getType() == TurnPhase.END + && game.getActivePlayerId().equals(source.getFirstTarget()))) || // 6/15/2010: If a creature controlled by the affected player can't attack Gideon Jura (because he's no longer on the battlefield, for example), that player may have it attack you, another one of your planeswalkers, or nothing at all. creatingPermanent.getPermanent(game) == null; } @@ -169,4 +165,4 @@ class GideonJuraEffect extends RequirementEffect { public boolean mustBlock(Game game) { return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GrotagSiegeRunner.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GrotagSiegeRunner.java index 4c8578d6096..e3407fb0dec 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GrotagSiegeRunner.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GrotagSiegeRunner.java @@ -28,24 +28,21 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetControllerEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.AbilityPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetCreaturePermanent; /** @@ -70,10 +67,12 @@ public class GrotagSiegeRunner extends CardImpl { this.toughness = new MageInt(1); // {R}, Sacrifice Grotag Siege-Runner: Destroy target creature with defender. Grotag Siege-Runner deals 2 damage to that creature's controller. - SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{R}")); ability.addCost(new SacrificeSourceCost()); + Effect effect = new DamageTargetControllerEffect(2); + effect.setText("{this} deals 2 damage to that creature's controller"); + ability.addEffect(effect); ability.addTarget(new TargetCreaturePermanent(filter)); - ability.addEffect(new GrotageSiegeRunnerEffect()); this.addAbility(ability); } @@ -86,31 +85,3 @@ public class GrotagSiegeRunner extends CardImpl { return new GrotagSiegeRunner(this); } } - -class GrotageSiegeRunnerEffect extends OneShotEffect { - - public GrotageSiegeRunnerEffect() { - super(Outcome.Damage); - this.staticText = "{this} deals 2 damage to that creature's controller"; - } - - public GrotageSiegeRunnerEffect(final GrotageSiegeRunnerEffect effect) { - super(effect); - } - - @Override - public GrotageSiegeRunnerEffect copy() { - return new GrotageSiegeRunnerEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); - if (permanent != null) { - Player controller = game.getPlayer(permanent.getControllerId()); - controller.damage(2, source.getSourceId(), game, false, true); - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/InduceDespair.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/InduceDespair.java index 24b5f55f6af..5719b94007d 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/InduceDespair.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/InduceDespair.java @@ -28,33 +28,35 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.RevealTargetFromHandCost; +import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetCardInHand; import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; /** * * @author jeffwadsworth */ public class InduceDespair extends CardImpl { - + private static final FilterCreatureCard filter = new FilterCreatureCard("creature card from your hand"); public InduceDespair(UUID ownerId) { super(ownerId, 114, "Induce Despair", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{B}"); this.expansionSetCode = "ROE"; - // As an additional cost to cast Induce Despair, reveal a creature card from your hand. // Target creature gets -X/-X until end of turn, where X is the revealed card's converted mana cost. this.getSpellAbility().addEffect(new InduceDespairEffect()); @@ -87,13 +89,14 @@ class InduceDespairEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { RevealTargetFromHandCost cost = (RevealTargetFromHandCost) source.getCosts().get(0); Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); - if (cost != null) { - int CMC = -1 * cost.convertedManaCosts; - if (creature != null) { - creature.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(CMC, CMC, Duration.EndOfTurn)), source.getSourceId(), game, false); - } + if (cost != null && creature != null) { + int cmcBoost = -1 * cost.convertedManaCosts; + ContinuousEffect effect = new BoostTargetEffect(cmcBoost, cmcBoost, Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(creature.getId(), creature.getZoneChangeCounter(game))); + game.addEffect(effect, source); + return true; } - return true; + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/KozilekButcherOfTruth.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/KozilekButcherOfTruth.java index 81f0622ac4c..00a59b921e3 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/KozilekButcherOfTruth.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/KozilekButcherOfTruth.java @@ -25,28 +25,18 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.riseoftheeldrazi; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.PutIntoGraveFromAnywhereSourceTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ShuffleIntoLibraryGraveOfSourceOwnerEffect; import mage.abilities.keyword.AnnihilatorAbility; -import mage.cards.Card; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.stack.Spell; -import mage.players.Player; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -54,25 +44,25 @@ import mage.players.Player; */ public class KozilekButcherOfTruth extends CardImpl { - public KozilekButcherOfTruth (UUID ownerId) { + public KozilekButcherOfTruth(UUID ownerId) { super(ownerId, 6, "Kozilek, Butcher of Truth", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{10}"); this.expansionSetCode = "ROE"; this.supertype.add("Legendary"); this.subtype.add("Eldrazi"); this.power = new MageInt(12); this.toughness = new MageInt(12); - - // When you cast Kozilek, Butcher of Truth, draw four cards. - this.addAbility(new KozilekButcherOfTruthOnCastAbility()); - + + // When you cast Kozilek, Butcher of Truth, draw four cards. + this.addAbility(new CastSourceTriggeredAbility(new DrawCardSourceControllerEffect(4))); + // Annihilator 4 (Whenever this creature attacks, defending player sacrifices four permanents.) this.addAbility(new AnnihilatorAbility(4)); - + // When Kozilek is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library. - this.addAbility(new PutIntoGraveFromAnywhereSourceTriggeredAbility(new KozilekButcherOfTruthEffect(), false)); + this.addAbility(new PutIntoGraveFromAnywhereSourceTriggeredAbility(new ShuffleIntoLibraryGraveOfSourceOwnerEffect(), false)); } - public KozilekButcherOfTruth (final KozilekButcherOfTruth card) { + public KozilekButcherOfTruth(final KozilekButcherOfTruth card) { super(card); } @@ -82,67 +72,3 @@ public class KozilekButcherOfTruth extends CardImpl { } } - -class KozilekButcherOfTruthOnCastAbility extends TriggeredAbilityImpl { - - private static final String abilityText = "When you cast {this}, draw four cards"; - - KozilekButcherOfTruthOnCastAbility() { - super(Zone.STACK, new DrawCardSourceControllerEffect(4)); - } - - KozilekButcherOfTruthOnCastAbility(final KozilekButcherOfTruthOnCastAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = (Spell) game.getObject(event.getTargetId()); - return this.getSourceId().equals(spell.getSourceId()); - } - - @Override - public KozilekButcherOfTruthOnCastAbility copy() { - return new KozilekButcherOfTruthOnCastAbility(this); - } - - @Override - public String getRule() { - return abilityText; - } -} - -class KozilekButcherOfTruthEffect extends OneShotEffect { - KozilekButcherOfTruthEffect() { - super(Outcome.Benefit); - staticText = "its owner shuffles his or her graveyard into his or her library"; - } - - KozilekButcherOfTruthEffect(final KozilekButcherOfTruthEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - for (Card card: controller.getGraveyard().getCards(game)) { - controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true); - } - controller.shuffleLibrary(game); - return true; - } - return false; - } - - @Override - public KozilekButcherOfTruthEffect copy() { - return new KozilekButcherOfTruthEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java index 9271b8d212a..8018972095c 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.riseoftheeldrazi; import java.util.UUID; @@ -33,20 +32,17 @@ import mage.MageInt; import mage.abilities.Abilities; import mage.abilities.AbilitiesImpl; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.condition.common.NotMyTurnCondition; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; import mage.abilities.keyword.LevelUpAbility; import mage.abilities.keyword.LevelerCardBuilder; import mage.cards.LevelerCard; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.TargetController; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.turn.TurnMod; /** * @@ -54,7 +50,7 @@ import mage.game.turn.TurnMod; */ public class LighthouseChronologist extends LevelerCard { - public LighthouseChronologist (UUID ownerId) { + public LighthouseChronologist(UUID ownerId) { super(ownerId, 75, "Lighthouse Chronologist", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.expansionSetCode = "ROE"; this.subtype.add("Human"); @@ -73,7 +69,8 @@ public class LighthouseChronologist extends LevelerCard { // 3/5 // At the beginning of each end step, if it's not your turn, take an extra turn after this one. Abilities abilities2 = new AbilitiesImpl<>(); - abilities2.add(new LighthouseChronologistAbility()); + abilities2.add(new BeginningOfEndStepTriggeredAbility( + Zone.BATTLEFIELD, new AddExtraTurnControllerEffect(false), TargetController.ANY, NotMyTurnCondition.getInstance(), false)); this.addAbilities(LevelerCardBuilder.construct( new LevelerCardBuilder.LevelAbility(4, 6, abilities1, 2, 4), @@ -82,7 +79,7 @@ public class LighthouseChronologist extends LevelerCard { setMaxLevelCounters(7); } - public LighthouseChronologist (final LighthouseChronologist card) { + public LighthouseChronologist(final LighthouseChronologist card) { super(card); } @@ -92,57 +89,3 @@ public class LighthouseChronologist extends LevelerCard { } } - -class LighthouseChronologistAbility extends TriggeredAbilityImpl { - - public LighthouseChronologistAbility() { - super(Zone.BATTLEFIELD, new LighthouseChronologistEffect(), false); - } - - public LighthouseChronologistAbility(final LighthouseChronologistAbility ability) { - super(ability); - } - - @Override - public LighthouseChronologistAbility copy() { - return new LighthouseChronologistAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.END_TURN_STEP_PRE; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return !game.getActivePlayerId().equals(this.controllerId); - } - - @Override - public String getRule() { - return "At the beginning of each end step, if it's not your turn, take an extra turn after this one."; - } -} - -class LighthouseChronologistEffect extends OneShotEffect { - - public LighthouseChronologistEffect() { - super(Outcome.ExtraTurn); - } - - public LighthouseChronologistEffect(final LighthouseChronologistEffect effect) { - super(effect); - } - - @Override - public LighthouseChronologistEffect copy() { - return new LighthouseChronologistEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), false)); - return true; - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LinvalaKeeperOfSilence.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LinvalaKeeperOfSilence.java index a0940028901..d67a300c38b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LinvalaKeeperOfSilence.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LinvalaKeeperOfSilence.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.riseoftheeldrazi; import java.util.UUID; @@ -48,7 +47,7 @@ import mage.game.permanent.Permanent; */ public class LinvalaKeeperOfSilence extends CardImpl { - public LinvalaKeeperOfSilence (UUID ownerId) { + public LinvalaKeeperOfSilence(UUID ownerId) { super(ownerId, 33, "Linvala, Keeper of Silence", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); this.expansionSetCode = "ROE"; this.supertype.add("Legendary"); @@ -57,12 +56,14 @@ public class LinvalaKeeperOfSilence extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(4); + // Flying this.addAbility(FlyingAbility.getInstance()); - + + // Activated abilities of creatures your opponents control can't be activated. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LinvalaKeeperOfSilenceCantActivateEffect())); } - public LinvalaKeeperOfSilence (final LinvalaKeeperOfSilence card) { + public LinvalaKeeperOfSilence(final LinvalaKeeperOfSilence card) { super(card); } @@ -98,4 +99,4 @@ class LinvalaKeeperOfSilenceCantActivateEffect extends RestrictionEffect { return new LinvalaKeeperOfSilenceCantActivateEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LustForWar.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LustForWar.java index 0f72528f309..9526e526681 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LustForWar.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LustForWar.java @@ -64,7 +64,7 @@ public class LustForWar extends CardImpl { this.addAbility(ability); // Whenever enchanted creature becomes tapped, Lust for War deals 3 damage to that creature's controller. - this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DamageAttachedControllerEffect(3), false)); + this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DamageAttachedControllerEffect(3), "enchanted creature")); // Enchanted creature attacks each turn if able. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java index 27d3eca54aa..a38db325a64 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java @@ -1,147 +1,118 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.riseoftheeldrazi; - -import java.util.UUID; -import mage.MageInt; -import mage.Mana; -import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.targetpointer.FixedTarget; - -/** - * - * @author jeffwadsworth - */ -public class NirkanaRevenant extends CardImpl { - - public NirkanaRevenant(UUID ownerId) { - super(ownerId, 120, "Nirkana Revenant", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); - this.expansionSetCode = "ROE"; - this.subtype.add("Vampire"); - this.subtype.add("Shade"); - - this.power = new MageInt(4); - this.toughness = new MageInt(4); - - // Whenever you tap a Swamp for mana, add {B} to your mana pool. - this.addAbility(new NirkanaRevenantTriggeredAbility()); - - // {B}: Nirkana Revenant gets +1/+1 until end of turn. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); - } - - public NirkanaRevenant(final NirkanaRevenant card) { - super(card); - } - - @Override - public NirkanaRevenant copy() { - return new NirkanaRevenant(this); - } -} - -class NirkanaRevenantTriggeredAbility extends TriggeredAbilityImpl { - - public NirkanaRevenantTriggeredAbility() { - super(Zone.BATTLEFIELD, new NirkanaRevenantEffect()); - } - - public NirkanaRevenantTriggeredAbility(final NirkanaRevenantTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED_FOR_MANA; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); - } - if (permanent != null && permanent.getSubtype().contains("Swamp") && permanent.getControllerId().equals(this.controllerId)) { - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - return true; - } - return false; - } - - @Override - public NirkanaRevenantTriggeredAbility copy() { - return new NirkanaRevenantTriggeredAbility(this); - } - - @Override - public String getRule() { - return "Whenever you tap a Swamp for mana, add {B} to your mana pool."; - } -} - -class NirkanaRevenantEffect extends OneShotEffect { - - NirkanaRevenantEffect() { - super(Outcome.PutManaInPool); - } - - NirkanaRevenantEffect(final NirkanaRevenantEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.getManaPool().addMana(Mana.BlackMana, game, source); - return true; - } - return false; - } - - @Override - public NirkanaRevenantEffect copy() { - return new NirkanaRevenantEffect(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.riseoftheeldrazi; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.mana.TriggeredManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; + +/** + * + * @author jeffwadsworth + */ +public class NirkanaRevenant extends CardImpl { + + public NirkanaRevenant(UUID ownerId) { + super(ownerId, 120, "Nirkana Revenant", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Vampire"); + this.subtype.add("Shade"); + + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever you tap a Swamp for mana, add {B} to your mana pool. + this.addAbility(new NirkanaRevenantTriggeredAbility()); + + // {B}: Nirkana Revenant gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + } + + public NirkanaRevenant(final NirkanaRevenant card) { + super(card); + } + + @Override + public NirkanaRevenant copy() { + return new NirkanaRevenant(this); + } +} + +class NirkanaRevenantTriggeredAbility extends TriggeredManaAbility { + + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("Swamp"); + static { + filter.add(new SubtypePredicate("Swamp")); + } + + public NirkanaRevenantTriggeredAbility() { + super(Zone.BATTLEFIELD, new BasicManaEffect(Mana.BlackMana), false); + this.usesStack = false; + } + + public NirkanaRevenantTriggeredAbility(NirkanaRevenantTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent land = game.getPermanent(event.getTargetId()); + return land != null && filter.match(land, this.getSourceId(), this.getControllerId(), game); + } + + @Override + public NirkanaRevenantTriggeredAbility copy() { + return new NirkanaRevenantTriggeredAbility(this); + } + + @Override + public String getRule() { + return "Whenever you tap a Swamp for mana, add {B} to your mana pool."; + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NomadsAssembly.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NomadsAssembly.java index 7dd99c31499..12b1af89ef3 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NomadsAssembly.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NomadsAssembly.java @@ -35,7 +35,7 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.ReboundAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; -import mage.game.permanent.token.SoldierToken; +import mage.game.permanent.token.KorSoldierToken; /** * @@ -50,7 +50,7 @@ public class NomadsAssembly extends CardImpl { this.expansionSetCode = "ROE"; - this.getSpellAbility().addEffect(new CreateTokenEffect(new SoldierToken(), new PermanentsOnBattlefieldCount(filter))); + this.getSpellAbility().addEffect(new CreateTokenEffect(new KorSoldierToken(), new PermanentsOnBattlefieldCount(filter))); this.addAbility(new ReboundAbility()); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java index 558d240f739..ba19a176b1b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java @@ -60,8 +60,7 @@ import mage.target.Targets; public class NotOfThisWorld extends CardImpl { public NotOfThisWorld(UUID ownerId) { - super(ownerId, 8, "Not of This World", Rarity.UNCOMMON, - new CardType[]{CardType.TRIBAL, CardType.INSTANT}, "{7}"); + super(ownerId, 8, "Not of This World", Rarity.UNCOMMON, new CardType[]{CardType.TRIBAL, CardType.INSTANT}, "{7}"); this.expansionSetCode = "ROE"; this.subtype.add("Eldrazi"); @@ -85,7 +84,6 @@ public class NotOfThisWorld extends CardImpl { class TargetStackObjectTargetingControlledPermanent extends TargetObject { - public TargetStackObjectTargetingControlledPermanent() { this.minNumberOfTargets = 1; this.maxNumberOfTargets = 1; @@ -105,10 +103,7 @@ class TargetStackObjectTargetingControlledPermanent extends TargetObject { @Override public boolean canTarget(UUID id, Ability source, Game game) { StackObject stackObject = game.getStack().getStackObject(id); - if ((stackObject instanceof Spell) || (stackObject instanceof StackAbility)) { - return true; - } - return false; + return (stackObject instanceof Spell) || (stackObject instanceof StackAbility); } @Override @@ -121,7 +116,7 @@ class TargetStackObjectTargetingControlledPermanent extends TargetObject { for (StackObject stackObject : game.getStack()) { if ((stackObject instanceof Spell) || (stackObject instanceof StackAbility)) { Targets objectTargets = stackObject.getStackAbility().getTargets(); - if(!objectTargets.isEmpty()) { + if (!objectTargets.isEmpty()) { for (Target target : objectTargets) { for (UUID targetId : target.getTargets()) { Permanent targetedPermanent = game.getPermanentOrLKIBattlefield(targetId); @@ -129,9 +124,9 @@ class TargetStackObjectTargetingControlledPermanent extends TargetObject { return true; } } - } + } } - } + } } return false; } @@ -148,7 +143,7 @@ class TargetStackObjectTargetingControlledPermanent extends TargetObject { for (StackObject stackObject : game.getStack()) { if ((stackObject instanceof Spell) || (stackObject instanceof StackAbility)) { Targets objectTargets = stackObject.getStackAbility().getTargets(); - if(!objectTargets.isEmpty()) { + if (!objectTargets.isEmpty()) { for (Target target : objectTargets) { for (UUID targetId : target.getTargets()) { Permanent targetedPermanent = game.getPermanentOrLKIBattlefield(targetId); @@ -156,10 +151,10 @@ class TargetStackObjectTargetingControlledPermanent extends TargetObject { possibleTargets.add(stackObject.getId()); } } - } + } } - } - } + } + } return possibleTargets; } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PestilenceDemon.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PestilenceDemon.java index 69e7612cb17..0256675d651 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PestilenceDemon.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PestilenceDemon.java @@ -25,13 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.riseoftheeldrazi; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,7 +35,9 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; @@ -51,7 +49,7 @@ import mage.players.Player; */ public class PestilenceDemon extends CardImpl { - public PestilenceDemon (UUID ownerId) { + public PestilenceDemon(UUID ownerId) { super(ownerId, 124, "Pestilence Demon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}{B}"); this.expansionSetCode = "ROE"; this.subtype.add("Demon"); @@ -62,7 +60,7 @@ public class PestilenceDemon extends CardImpl { this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PestilenceDemonEffect(), new ManaCostsImpl("{B}"))); } - public PestilenceDemon (final PestilenceDemon card) { + public PestilenceDemon(final PestilenceDemon card) { super(card); } @@ -74,6 +72,7 @@ public class PestilenceDemon extends CardImpl { } class PestilenceDemonEffect extends OneShotEffect { + PestilenceDemonEffect() { super(Outcome.Damage); staticText = "{this} deals 1 damage to each creature and each player"; @@ -94,7 +93,7 @@ class PestilenceDemonEffect extends OneShotEffect { for (UUID playerId : game.getPlayerList()) { Player p = game.getPlayer(playerId); if (p != null) { - p.damage(1, source.getSourceId(), game, true, false); + p.damage(1, source.getSourceId(), game, false, true); } } return true; @@ -105,4 +104,4 @@ class PestilenceDemonEffect extends OneShotEffect { return new PestilenceDemonEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java index 2f8202380d3..07b9a9ac94a 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java @@ -46,7 +46,6 @@ import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; import mage.util.functions.EmptyApplyToPermanent; - /** * * @author North @@ -142,7 +141,7 @@ class RenegadeDoppelgangerEffect extends OneShotEffect { return false; } - game.copyPermanent(Duration.EndOfTurn, targetCreature, permanent, source, new EmptyApplyToPermanent()); + game.copyPermanent(Duration.EndOfTurn, targetCreature, permanent.getId(), source, new EmptyApplyToPermanent()); return false; } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java index 9124f195994..8252432060e 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java @@ -29,21 +29,19 @@ package mage.sets.riseoftheeldrazi; import java.util.List; import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.counters.CounterType; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -65,8 +63,7 @@ public class SarkhanTheMad extends CardImpl { super(ownerId, 214, "Sarkhan the Mad", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{R}"); this.expansionSetCode = "ROE"; this.subtype.add("Sarkhan"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(7)), false)); - + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(7)); this.addAbility(new LoyaltyAbility(new SarkhanTheMadRevealAndDrawEffect(), 0)); @@ -94,29 +91,28 @@ class SarkhanTheMadRevealAndDrawEffect extends OneShotEffect { private static final String effectText = "Reveal the top card of your library and put it into your hand. {this} deals damage to himself equal to that card's converted mana cost"; - SarkhanTheMadRevealAndDrawEffect ( ) { + SarkhanTheMadRevealAndDrawEffect() { super(Outcome.DrawCard); staticText = effectText; } - SarkhanTheMadRevealAndDrawEffect ( SarkhanTheMadRevealAndDrawEffect effect ) { + SarkhanTheMadRevealAndDrawEffect(SarkhanTheMadRevealAndDrawEffect effect) { super(effect); } @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null && player.getLibrary().size() > 0) { - Card card = player.getLibrary().removeFromTop(game); - Permanent permanent = game.getPermanent(source.getSourceId()); + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + Card card = controller.getLibrary().getFromTop(game); + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (card != null) { - card.moveToZone(Zone.HAND, source.getSourceId(), game, false); - permanent.damage(card.getManaCost().convertedManaCost(), this.getId(), game, false, false); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards("Sarkhan the Mad", cards, game); - return true; + controller.moveCards(card, null, Zone.HAND, source, game); + sourcePermanent.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, false); + controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); } + return true; } return false; } @@ -132,19 +128,19 @@ class SarkhanTheMadSacEffect extends OneShotEffect { private static final String effectText = "Target creature's controller sacrifices it, then that player puts a 5/5 red Dragon creature token with flying onto the battlefield"; - SarkhanTheMadSacEffect ( ) { + SarkhanTheMadSacEffect() { super(Outcome.Sacrifice); staticText = effectText; } - SarkhanTheMadSacEffect ( SarkhanTheMadSacEffect effect ) { + SarkhanTheMadSacEffect(SarkhanTheMadSacEffect effect) { super(effect); } @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); - if ( permanent != null ) { + if (permanent != null) { Player player = game.getPlayer(permanent.getControllerId()); permanent.sacrifice(this.getId(), game); Token dragonToken = new DragonToken(); @@ -171,12 +167,12 @@ class SarkhanTheMadDragonDamageEffect extends OneShotEffect { filter.add(new SubtypePredicate("Dragon")); } - SarkhanTheMadDragonDamageEffect ( ) { + SarkhanTheMadDragonDamageEffect() { super(Outcome.Damage); staticText = effectText; } - SarkhanTheMadDragonDamageEffect ( SarkhanTheMadDragonDamageEffect effect ) { + SarkhanTheMadDragonDamageEffect(SarkhanTheMadDragonDamageEffect effect) { super(effect); } @@ -184,8 +180,8 @@ class SarkhanTheMadDragonDamageEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { List dragons = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game); Player player = game.getPlayer(source.getTargets().getFirstTarget()); - if ( player != null && dragons != null && !dragons.isEmpty() ) { - for ( Permanent dragon : dragons ) { + if (player != null && dragons != null && !dragons.isEmpty()) { + for (Permanent dragon : dragons) { player.damage(dragon.getPower().getValue(), dragon.getId(), game, true, false); } return true; @@ -202,7 +198,8 @@ class SarkhanTheMadDragonDamageEffect extends OneShotEffect { } class DragonToken extends mage.game.permanent.token.DragonToken { - DragonToken ( ) { + + DragonToken() { super(); this.power = new MageInt(5); this.toughness = new MageInt(5); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SoulsurgeElemental.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SoulsurgeElemental.java index 227628209b9..0e049447a51 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SoulsurgeElemental.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SoulsurgeElemental.java @@ -28,19 +28,16 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; -import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.SetPowerSourceEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; @@ -50,7 +47,6 @@ import mage.filter.common.FilterControlledCreaturePermanent; */ public class SoulsurgeElemental extends CardImpl { - public SoulsurgeElemental(UUID ownerId) { super(ownerId, 163, "Soulsurge Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.expansionSetCode = "ROE"; diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SplinterTwin.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SplinterTwin.java index f3025d07eb1..ee1aa00718b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SplinterTwin.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SplinterTwin.java @@ -28,11 +28,6 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -42,17 +37,20 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; -import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; -import mage.util.CardUtil; /** * @@ -65,7 +63,6 @@ public class SplinterTwin extends CardImpl { this.expansionSetCode = "ROE"; this.subtype.add("Aura"); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -107,19 +104,18 @@ class SplinterTwinEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (permanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - - token.addAbility(HasteAbility.getInstance()); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, true); + effect.setTargetPointer(new FixedTarget(permanent, game)); + effect.apply(game, source); + for (Permanent addedToken : effect.getAddedPermanent()) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(addedToken, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } return true; } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/TrainingGrounds.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/TrainingGrounds.java index d1aeb9882d5..9919547c67c 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/TrainingGrounds.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/TrainingGrounds.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.riseoftheeldrazi; import java.util.LinkedHashSet; @@ -33,6 +32,7 @@ import java.util.Set; import java.util.UUID; import mage.Mana; import mage.abilities.Ability; +import mage.abilities.ActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.cost.CostModificationEffectImpl; import mage.cards.CardImpl; @@ -56,14 +56,14 @@ import mage.util.CardUtil; */ public class TrainingGrounds extends CardImpl { - public TrainingGrounds (UUID ownerId) { + public TrainingGrounds(UUID ownerId) { super(ownerId, 91, "Training Grounds", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{U}"); this.expansionSetCode = "ROE"; this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TrainingGroundsEffect())); } - public TrainingGrounds (final TrainingGrounds card) { + public TrainingGrounds(final TrainingGrounds card) { super(card); } @@ -74,7 +74,7 @@ public class TrainingGrounds extends CardImpl { } class TrainingGroundsEffect extends CostModificationEffectImpl { - + private static final String effectText = "Activated abilities of creatures you control cost up to {2} less to activate. This effect can't reduce the amount of mana an ability costs to activate to less than one mana"; private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); @@ -90,41 +90,42 @@ class TrainingGroundsEffect extends CostModificationEffectImpl { @Override public boolean apply(Game game, Ability source, Ability abilityToModify) { Player controller = game.getPlayer(abilityToModify.getControllerId()); - if (controller != null){ + if (controller != null) { Mana mana = abilityToModify.getManaCostsToPay().getMana(); int reduceMax = mana.getColorless(); - if (reduceMax > 0 && mana.count() == mana.getColorless()){ + if (reduceMax > 0 && mana.count() == mana.getColorless()) { reduceMax--; } - if (reduceMax > 2){ + if (reduceMax > 2) { reduceMax = 2; } if (reduceMax > 0) { ChoiceImpl choice = new ChoiceImpl(true); Set set = new LinkedHashSet<>(); - for(int i = 0; i <= reduceMax; i++){ + for (int i = 0; i <= reduceMax; i++) { set.add(String.valueOf(i)); } choice.setChoices(set); choice.setMessage("Reduce ability cost"); - if(controller.choose(Outcome.Benefit, choice, game)){ + if (controller.choose(Outcome.Benefit, choice, game)) { int reduce = Integer.parseInt(choice.getChoice()); CardUtil.reduceCost(abilityToModify, reduce); } } return true; } - return false; + return false; } @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED)) { + if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED) + || (abilityToModify.getAbilityType().equals(AbilityType.MANA) && (abilityToModify instanceof ActivatedAbility))) { //Activated abilities of creatures you control Permanent permanent = game.getPermanent(abilityToModify.getSourceId()); if (permanent != null && filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) { - return true; + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java index cbf82ffea26..4a25d967f60 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java @@ -30,24 +30,15 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.PutIntoGraveFromAnywhereSourceTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.ShuffleIntoLibraryGraveOfSourceOwnerEffect; import mage.abilities.keyword.AnnihilatorAbility; import mage.abilities.keyword.IndestructibleAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; -import mage.game.stack.Spell; -import mage.players.Player; import mage.target.TargetPermanent; /** @@ -64,15 +55,18 @@ public class UlamogTheInfiniteGyre extends CardImpl { this.power = new MageInt(10); this.toughness = new MageInt(10); - + // When you cast Ulamog, the Infinite Gyre, destroy target permanent. - this.addAbility(new UlamogTheInfiniteGyreDestroyOnCastAbility()); + Ability ability = new CastSourceTriggeredAbility(new DestroyTargetEffect()); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + // Annihilator 4 (Whenever this creature attacks, defending player sacrifices four permanents.) this.addAbility(new AnnihilatorAbility(4)); // Indestructible this.addAbility(IndestructibleAbility.getInstance()); // When Ulamog is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library. - this.addAbility(new PutIntoGraveFromAnywhereSourceTriggeredAbility(new UlamogTheInfiniteGyreEnterGraveyardEffect(), false)); + this.addAbility(new PutIntoGraveFromAnywhereSourceTriggeredAbility(new ShuffleIntoLibraryGraveOfSourceOwnerEffect(), false)); } public UlamogTheInfiniteGyre(final UlamogTheInfiniteGyre card) { @@ -84,77 +78,3 @@ public class UlamogTheInfiniteGyre extends CardImpl { return new UlamogTheInfiniteGyre(this); } } - -class UlamogTheInfiniteGyreDestroyOnCastAbility extends TriggeredAbilityImpl { - - UlamogTheInfiniteGyreDestroyOnCastAbility ( ) { - super(Zone.STACK, new DestroyTargetEffect()); - this.addTarget(new TargetPermanent()); - } - - UlamogTheInfiniteGyreDestroyOnCastAbility(UlamogTheInfiniteGyreDestroyOnCastAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = (Spell) game.getObject(event.getTargetId()); - return this.getSourceId().equals(spell.getSourceId()); - } - - @Override - public UlamogTheInfiniteGyreDestroyOnCastAbility copy() { - return new UlamogTheInfiniteGyreDestroyOnCastAbility(this); - } - - @Override - public String getRule() { - return new StringBuilder("When you cast {this}, ").append(super.getRule()).toString(); - } -} - -class UlamogTheInfiniteGyreEnterGraveyardEffect extends OneShotEffect { - - UlamogTheInfiniteGyreEnterGraveyardEffect ( ) { - super(Outcome.Benefit); - staticText = "its owner shuffles his or her graveyard into his or her library"; - } - - UlamogTheInfiniteGyreEnterGraveyardEffect(UlamogTheInfiniteGyreEnterGraveyardEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - UUID ownerId = null; - Card card = game.getCard(source.getSourceId()); - if (card != null) { - ownerId = card.getOwnerId(); - } - if (ownerId == null) { - Permanent permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - if (permanent != null) { - ownerId = permanent.getOwnerId(); - } - } - Player player = game.getPlayer(ownerId); - if (player != null) { - for (Card cardToMove: player.getGraveyard().getCards(game)) { - cardToMove.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - player.shuffleLibrary(game); - return true; - } - return false; - } - - @Override - public UlamogTheInfiniteGyreEnterGraveyardEffect copy() { - return new UlamogTheInfiniteGyreEnterGraveyardEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/WallOfOmens.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/WallOfOmens.java index 2b68b4fc8c4..67375b8e9c8 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/WallOfOmens.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/WallOfOmens.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,22 +20,21 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.riseoftheeldrazi; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -51,7 +50,10 @@ public class WallOfOmens extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(4); + // Defender this.addAbility(DefenderAbility.getInstance()); + + // When Wall of Omens enters the battlefield, draw a card. this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/BloodClock.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/BloodClock.java index 6beffb21683..cc29c54cda9 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/BloodClock.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/BloodClock.java @@ -41,7 +41,6 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; -import mage.target.TargetPermanent; import mage.target.common.TargetControlledPermanent; /** diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ElderPineOfJukai.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ElderPineOfJukai.java index 860c187ec2f..91e83fce440 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ElderPineOfJukai.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ElderPineOfJukai.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; -import mage.abilities.common.SpellCastAllTriggeredAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.SoulshiftAbility; import mage.cards.Card; @@ -61,7 +61,7 @@ public class ElderPineOfJukai extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast a Spirit or Arcane spell, reveal the top three cards of your library. Put all land cards revealed this way into your hand and the rest on the bottom of your library in any order. - this.addAbility(new SpellCastAllTriggeredAbility(new ElderPineOfJukaiEffect(), new FilterSpiritOrArcaneCard(), false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new ElderPineOfJukaiEffect(), new FilterSpiritOrArcaneCard(), false)); // Soulshift 2 this.addAbility(new SoulshiftAbility(2)); diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EnduringIdeal.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EnduringIdeal.java index b3483485a0a..02c4cf52ea5 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EnduringIdeal.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EnduringIdeal.java @@ -46,7 +46,7 @@ import mage.target.common.TargetCardInLibrary; /** * * @author jeffwadsworth - + * */ public class EnduringIdeal extends CardImpl { @@ -54,13 +54,12 @@ public class EnduringIdeal extends CardImpl { super(ownerId, 9, "Enduring Ideal", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{W}{W}"); this.expansionSetCode = "SOK"; - // Search your library for an enchantment card and put it onto the battlefield. Then shuffle your library. this.getSpellAbility().addEffect(new EnduringIdealEffect()); - + // Epic this.getSpellAbility().addEffect(new EpicEffect()); - + } public EnduringIdeal(final EnduringIdeal card) { @@ -74,9 +73,9 @@ public class EnduringIdeal extends CardImpl { } class EnduringIdealEffect extends OneShotEffect { - + private static final FilterCard filter = new FilterCard(); - + static { filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } @@ -93,16 +92,16 @@ class EnduringIdealEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { boolean applied = false; - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { TargetCardInLibrary target = new TargetCardInLibrary(filter); - you.searchLibrary(target, game); + controller.searchLibrary(target, game); Card targetCard = game.getCard(target.getFirstTarget()); if (targetCard == null) { applied = false; - } else{ - applied = you.putOntoBattlefieldWithInfo(targetCard, game, Zone.LIBRARY, source.getSourceId()); - you.shuffleLibrary(game); + } else { + applied = controller.moveCards(targetCard, Zone.BATTLEFIELD, source, game); + controller.shuffleLibrary(game); } } return applied; diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EternalDominion.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EternalDominion.java index cd5d754421b..7b63cd400fe 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EternalDominion.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EternalDominion.java @@ -56,12 +56,11 @@ public class EternalDominion extends CardImpl { super(ownerId, 36, "Eternal Dominion", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{7}{U}{U}{U}"); this.expansionSetCode = "SOK"; - // Search target opponent's library for an artifact, creature, enchantment, or land card. // Put that card onto the battlefield under your control. Then that player shuffles his or her library. this.getSpellAbility().addEffect(new EternalDominionEffect()); this.getSpellAbility().addTarget(new TargetOpponent()); - + // Epic this.getSpellAbility().addEffect(new EpicEffect()); @@ -78,9 +77,9 @@ public class EternalDominion extends CardImpl { } class EternalDominionEffect extends OneShotEffect { - + private static final FilterCard filter = new FilterCard("an artifact, creature, enchantment, or land card"); - + static { filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE), @@ -101,13 +100,13 @@ class EternalDominionEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { boolean applied = false; Player opponent = game.getPlayer(source.getFirstTarget()); - Player you = game.getPlayer(source.getControllerId()); - if (opponent != null && you != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (opponent != null && controller != null) { TargetCardInLibrary target = new TargetCardInLibrary(filter); - you.searchLibrary(target, game, opponent.getId()); + controller.searchLibrary(target, game, opponent.getId()); Card targetCard = game.getCard(target.getFirstTarget()); if (targetCard != null) { - applied = you.putOntoBattlefieldWithInfo(targetCard, game, Zone.LIBRARY, source.getSourceId()); + applied = controller.moveCards(targetCard, Zone.BATTLEFIELD, source, game); } opponent.shuffleLibrary(game); } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/FeralLightning.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/FeralLightning.java index ea95bd89163..36af9e621c8 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/FeralLightning.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/FeralLightning.java @@ -42,6 +42,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -56,7 +57,6 @@ public class FeralLightning extends CardImpl { super(ownerId, 97, "Feral Lightning", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}{R}"); this.expansionSetCode = "SOK"; - // Put three 3/1 red Elemental creature tokens with haste onto the battlefield. Exile them at the beginning of the next end step. this.getSpellAbility().addEffect(new FeralLightningEffect()); @@ -95,13 +95,16 @@ class FeralLightningEffect extends OneShotEffect { CreateTokenEffect effect = new CreateTokenEffect(new FeralLightningElementalToken(), 3); effect.apply(game, source); for (UUID tokenId : effect.getLastAddedTokenIds()) { - ExileTargetEffect exileEffect = new ExileTargetEffect(null,"",Zone.BATTLEFIELD); - exileEffect.setTargetPointer(new FixedTarget(tokenId)); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } } return true; } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/FootstepsOfTheGoryo.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/FootstepsOfTheGoryo.java index d558731be79..1fe60da5cad 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/FootstepsOfTheGoryo.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/FootstepsOfTheGoryo.java @@ -28,22 +28,18 @@ package mage.sets.saviorsofkamigawa; import java.util.UUID; - import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; -import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; -import mage.abilities.effects.common.ExileTargetEffect; -import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.abilities.effects.common.SacrificeTargetEffect; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.keyword.HasteAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.permanent.Permanent; @@ -62,7 +58,6 @@ public class FootstepsOfTheGoryo extends CardImpl { this.expansionSetCode = "SOK"; this.subtype.add("Arcane"); - // Return target creature card from your graveyard to the battlefield. Sacrifice that creature at the beginning of the next end step. this.getSpellAbility().addEffect(new FootstepsOfTheGoryoEffect()); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); @@ -100,22 +95,21 @@ class FootstepsOfTheGoryoEffect extends OneShotEffect { if (controller != null) { Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null) { - if (controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) { + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { // Sacrifice it at end of turn - Effect sacrificeEffect = new SacrificeTargetEffect("Sacrifice that creature at the beginning of next end step"); - sacrificeEffect.setTargetPointer(new FixedTarget(card.getId())); + Effect sacrificeEffect = new SacrificeTargetEffect("Sacrifice that creature at the beginning of next end step", source.getControllerId()); + sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setControllerId(source.getControllerId()); delayedAbility.setSourceObject(source.getSourceObject(game), game); game.addDelayedTriggeredAbility(delayedAbility); - return true; - } } } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/GodosIrregulars.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/GodosIrregulars.java index ed5fe602c33..1abf24633d2 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/GodosIrregulars.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/GodosIrregulars.java @@ -34,16 +34,11 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.constants.AbilityType; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.BlockingAttackerIdPredicate; -import mage.filter.predicate.permanent.BlockingPredicate; -import mage.game.Game; -import mage.target.Target; import mage.target.common.TargetCreaturePermanent; /** @@ -52,11 +47,6 @@ import mage.target.common.TargetCreaturePermanent; */ public class GodosIrregulars extends CardImpl { - private static final FilterCreaturePermanent basicFilter = new FilterCreaturePermanent("creature blocking it"); - static { - basicFilter.add(new BlockingPredicate()); - } - public GodosIrregulars(UUID ownerId) { super(ownerId, 101, "Godo's Irregulars", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{R}"); this.expansionSetCode = "SOK"; @@ -68,21 +58,12 @@ public class GodosIrregulars extends CardImpl { // {R}: Godo's Irregulars deals 1 damage to target creature blocking it. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R")); - ability.addTarget(new TargetCreaturePermanent()); + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking it"); + filter.add(new BlockingAttackerIdPredicate(this.getId())); + ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } - @Override - public void adjustTargets(Ability ability, Game game) { - if (ability.getAbilityType().equals(AbilityType.ACTIVATED)) { - ability.getTargets().clear(); - FilterCreaturePermanent filter = basicFilter.copy(); - filter.add(new BlockingAttackerIdPredicate(this.getId())); - Target target = new TargetCreaturePermanent(filter); - ability.addTarget(target); - } - } - public GodosIrregulars(final GodosIrregulars card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/HailOfArrows.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/HailOfArrows.java index 337d1870e76..23e8f6e6058 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/HailOfArrows.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/HailOfArrows.java @@ -34,7 +34,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.filter.common.FilterAttackingCreature; -import mage.target.common.TargetAttackingCreature; +import mage.target.common.TargetCreaturePermanentAmount; /** * @@ -46,10 +46,9 @@ public class HailOfArrows extends CardImpl { super(ownerId, 11, "Hail of Arrows", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{X}{W}"); this.expansionSetCode = "SOK"; - // Hail of Arrows deals X damage divided as you choose among any number of target attacking creatures. this.getSpellAbility().addEffect(new DamageMultiEffect(new ManacostVariableValue())); - this.getSpellAbility().addTarget(new TargetAttackingCreature(0, Integer.MAX_VALUE, new FilterAttackingCreature(), true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(new ManacostVariableValue(), new FilterAttackingCreature())); } public HailOfArrows(final HailOfArrows card) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/InameAsOne.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/InameAsOne.java index 395a947b44a..ddb5f7a790f 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/InameAsOne.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/InameAsOne.java @@ -35,21 +35,23 @@ import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.CastFromHandCondition; import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileSourceEffect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.common.FilterPermanentCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetpointer.FixedTarget; import mage.watchers.common.CastFromHandWatcher; /** @@ -75,9 +77,9 @@ public class InameAsOne extends CardImpl { // When Iname as One enters the battlefield, if you cast it from your hand, you may search your library for a Spirit permanent card, put it onto the battlefield, then shuffle your library. Ability ability = new EntersBattlefieldTriggeredAbility( new ConditionalOneShotEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 1, filter), false), - new CastFromHandCondition())); + new CastFromHandCondition())); this.addAbility(ability, new CastFromHandWatcher()); - + // When Iname as One dies, you may exile it. If you do, return target Spirit permanent card from your graveyard to the battlefield. ability = new DiesTriggeredAbility(new InameAsOneEffect(), false); ability.addTarget(new TargetCardInYourGraveyard(filter)); @@ -114,15 +116,18 @@ class InameAsOneEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); - if (controller != null && sourceObject != null) { + Card targetCard = game.getCard(getTargetPointer().getFirst(game, source)); + if (controller != null && sourceObject != null && targetCard != null) { if (controller.chooseUse(outcome, "Exile " + sourceObject.getLogName() + " to return Spirit card?", source, game)) { // In a Commander game, you may send Iname to the Command Zone instead of exiling it during the resolution - // of its ability. If you do, its ability still works. Iname's ability only requires that you attempted to - // exile it, not that it actually gets to the exile zone. This is similar to how destroying a creature + // of its ability. If you do, its ability still works. Iname's ability only requires that you attempted to + // exile it, not that it actually gets to the exile zone. This is similar to how destroying a creature // (with, for example, Rest in Peace) doesn't necessarily ensure that creature will end up in the graveyard; // it just so happens that the action of exiling something and the exile zone both use the same word: "exile". + Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect(); + effect.setTargetPointer(new FixedTarget(targetCard.getId(), targetCard.getZoneChangeCounter(game))); new ExileSourceEffect().apply(game, source); - return new ReturnFromGraveyardToBattlefieldTargetEffect().apply(game, source); + return effect.apply(game, source); } return true; } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/IvoryCraneNetsuke.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/IvoryCraneNetsuke.java index 0ab2b4e3fdb..313615c5fae 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/IvoryCraneNetsuke.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/IvoryCraneNetsuke.java @@ -1,67 +1,67 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.saviorsofkamigawa; - -import java.util.UUID; -import mage.abilities.TriggeredAbility; -import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.condition.common.CardsInHandCondition; -import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.effects.common.GainLifeEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.constants.Zone; - -/** - * - * @author LevelX2 - */ -public class IvoryCraneNetsuke extends CardImpl { - - public IvoryCraneNetsuke(UUID ownerId) { - super(ownerId, 155, "Ivory Crane Netsuke", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); - this.expansionSetCode = "SOK"; - - // At the beginning of your upkeep, if you have seven or more cards in hand, you gain 4 life. - TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(4), TargetController.YOU, false); - CardsInHandCondition contition = new CardsInHandCondition(CardsInHandCondition.CountType.MORE_THAN, 6); - this.addAbility(new ConditionalTriggeredAbility(ability, contition, "At the beginning of your upkeep, if you have seven or more cards in hand, you gain 4 life.")); - - } - - public IvoryCraneNetsuke(final IvoryCraneNetsuke card) { - super(card); - } - - @Override - public IvoryCraneNetsuke copy() { - return new IvoryCraneNetsuke(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.saviorsofkamigawa; + +import java.util.UUID; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.common.CardsInHandCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class IvoryCraneNetsuke extends CardImpl { + + public IvoryCraneNetsuke(UUID ownerId) { + super(ownerId, 155, "Ivory Crane Netsuke", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "SOK"; + + // At the beginning of your upkeep, if you have seven or more cards in hand, you gain 4 life. + TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(4), TargetController.YOU, false); + CardsInHandCondition condition = new CardsInHandCondition(CardsInHandCondition.CountType.MORE_THAN, 6); + this.addAbility(new ConditionalTriggeredAbility(ability, condition, "At the beginning of your upkeep, if you have seven or more cards in hand, you gain 4 life.")); + + } + + public IvoryCraneNetsuke(final IvoryCraneNetsuke card) { + super(card); + } + + @Override + public IvoryCraneNetsuke copy() { + return new IvoryCraneNetsuke(this); + } +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java index cde762b0dac..ac4e94bcef7 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java @@ -30,20 +30,15 @@ package mage.sets.saviorsofkamigawa; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.dynamicvalue.common.CountersCount; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.TargetPlayer; /** @@ -63,7 +58,7 @@ public class MagaTraitorToMortals extends CardImpl { this.toughness = new MageInt(0); // Maga, Traitor to Mortals enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new MagaTraitorToMortalsEnterBattlefieldEffect())); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // When Maga enters the battlefield, target player loses life equal to the number of +1/+1 counters on it. Ability ability = new EntersBattlefieldTriggeredAbility( @@ -81,36 +76,3 @@ public class MagaTraitorToMortals extends CardImpl { return new MagaTraitorToMortals(this); } } - -class MagaTraitorToMortalsEnterBattlefieldEffect extends OneShotEffect { - - public MagaTraitorToMortalsEnterBattlefieldEffect() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - public MagaTraitorToMortalsEnterBattlefieldEffect(final MagaTraitorToMortalsEnterBattlefieldEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public MagaTraitorToMortalsEnterBattlefieldEffect copy() { - return new MagaTraitorToMortalsEnterBattlefieldEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MatsuTribeBirdstalker.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MatsuTribeBirdstalker.java index 34fed8bc030..0ba6ed34b44 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MatsuTribeBirdstalker.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MatsuTribeBirdstalker.java @@ -55,6 +55,7 @@ public class MatsuTribeBirdstalker extends CardImpl { this.expansionSetCode = "SOK"; this.subtype.add("Snake"); this.subtype.add("Warrior"); + this.subtype.add("Archer"); this.power = new MageInt(2); this.toughness = new MageInt(2); diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MoonbowIllusionist.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MoonbowIllusionist.java index ef110170247..d41c6240d87 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MoonbowIllusionist.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MoonbowIllusionist.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; import mage.abilities.keyword.FlyingAbility; @@ -63,7 +63,7 @@ public class MoonbowIllusionist extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // {2}, Return a land you control to its owner's hand: Target land becomes the basic land type of your choice until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.EndOfTurn), new GenericManaCost(2)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(new FilterControlledLandPermanent("land")))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(new FilterControlledLandPermanent("land")))); ability.addTarget(new TargetLandPermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroBreezecaller.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroBreezecaller.java index c3f406d50ff..9578e96727f 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroBreezecaller.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroBreezecaller.java @@ -34,7 +34,7 @@ import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.keyword.FlyingAbility; @@ -66,7 +66,7 @@ public class OboroBreezecaller extends CardImpl { // {2}, Return a land you control to its owner's hand: Untap target land. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new GenericManaCost(2)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetLandPermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroEnvoy.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroEnvoy.java index 4ed03c26ba5..1c1e54e47aa 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroEnvoy.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroEnvoy.java @@ -31,7 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; @@ -68,7 +68,7 @@ public class OboroEnvoy extends CardImpl { Effect effect = new BoostTargetEffect(new SignInversionDynamicValue(new CardsInControllerHandCount()), new StaticValue(-0), Duration.EndOfTurn); effect.setText("Target creature gets -X/-0 until end of turn, where X is the number of cards in your hand"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land")))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land")))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/PithingNeedle.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/PithingNeedle.java index 8edb0491e20..c219622eba1 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/PithingNeedle.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/PithingNeedle.java @@ -56,7 +56,7 @@ public class PithingNeedle extends CardImpl { // As Pithing Needle enters the battlefield, name a card. this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.ALL))); - + // Activated abilities of sources with the chosen name can't be activated unless they're mana abilities. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PithingNeedleEffect())); } @@ -92,16 +92,19 @@ class PithingNeedleEffect extends ContinuousRuleModifyingEffectImpl { return true; } + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ACTIVATE_ABILITY; + } + @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) { - MageObject object = game.getObject(event.getSourceId()); - Ability ability = game.getAbility(event.getTargetId(), event.getSourceId()); - if (ability != null && object != null) { - if (ability.getAbilityType() != AbilityType.MANA && - object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { - return true; - } + MageObject object = game.getObject(event.getSourceId()); + Ability ability = game.getAbility(event.getTargetId(), event.getSourceId()); + if (ability != null && object != null) { + if (!ability.getAbilityType().equals(AbilityType.MANA) + && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/PureIntentions.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/PureIntentions.java index 7a1ccdf9675..e3ae09ccbe2 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/PureIntentions.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/PureIntentions.java @@ -92,11 +92,12 @@ class PureIntentionsAllTriggeredAbility extends DelayedTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) && - StackObject.class.isInstance(game.getObject(event.getSourceId()))) { + StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); + if (stackObject != null + && game.getOpponents(this.getControllerId()).contains(stackObject.getControllerId())) { Card card = game.getCard(event.getTargetId()); if (card != null && card.getOwnerId().equals(getControllerId())) { - for(Effect effect : getEffects()) { + for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } return true; @@ -116,7 +117,6 @@ class PureIntentionsAllTriggeredAbility extends DelayedTriggeredAbility { } } - class PureIntentionsTriggeredAbility extends TriggeredAbilityImpl { public PureIntentionsTriggeredAbility() { @@ -140,9 +140,17 @@ class PureIntentionsTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) && - StackObject.class.isInstance(game.getObject(event.getSourceId())) && - event.getTargetId().equals(getSourceId()); + if (getSourceId().equals(event.getTargetId())) { + StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); + if (stackObject != null + && game.getOpponents(this.getControllerId()).contains(stackObject.getControllerId())) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + } + return true; + } + } + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/RuneTailKitsuneAscendant.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/RuneTailKitsuneAscendant.java index ed256a39876..a1b8c7dd419 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/RuneTailKitsuneAscendant.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/RuneTailKitsuneAscendant.java @@ -61,7 +61,6 @@ public class RuneTailKitsuneAscendant extends CardImpl { this.toughness = new MageInt(2); this.flipCard = true; this.flipCardName = "Rune-Tail's Essence"; - // When you have 30 or more life, flip Rune-Tail, Kitsune Ascendant. this.addAbility(new RuneTailKitsuneAscendantFlipAbility()); @@ -103,22 +102,22 @@ class RuneTailKitsuneAscendantFlipAbility extends StateTriggeredAbility { @Override public String getRule() { - return "When you have 30 or more life, flip {this}"; + return "When you have 30 or more life, flip {this}."; } } class RuneTailEssence extends Token { - RuneTailEssence() { super("Rune-Tail's Essence", ""); supertype.add("Legendary"); cardType.add(CardType.ENCHANTMENT); - + color.setWhite(true); // Prevent all damage that would be dealt to creatures you control. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventAllDamageToAllEffect(Duration.WhileOnBattlefield, new FilterControlledCreatureInPlay()))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new PreventAllDamageToAllEffect(Duration.WhileOnBattlefield, new FilterControlledCreatureInPlay("creatures you control")))); } } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakashimaTheImpostor.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakashimaTheImpostor.java index 5e769b0a006..f468e0e748b 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakashimaTheImpostor.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakashimaTheImpostor.java @@ -29,26 +29,22 @@ package mage.sets.saviorsofkamigawa; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; +import mage.MageObject; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CopyPermanentEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.Target; -import mage.target.TargetPermanent; import mage.util.functions.ApplyToPermanent; /** @@ -57,8 +53,6 @@ import mage.util.functions.ApplyToPermanent; */ public class SakashimaTheImpostor extends CardImpl { - private static final String abilityText = "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except its name is still Sakashima the Impostor, it's legendary in addition to its other types, and it gains \"{2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step.\""; - public SakashimaTheImpostor(UUID ownerId) { super(ownerId, 53, "Sakashima the Impostor", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); this.expansionSetCode = "SOK"; @@ -69,9 +63,9 @@ public class SakashimaTheImpostor extends CardImpl { this.toughness = new MageInt(1); // You may have Sakashima the Impostor enter the battlefield as a copy of any creature on the battlefield, except its name is still Sakashima the Impostor, it's legendary in addition to its other types, and it gains "{2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step." - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( - new SakashimaTheImpostorCopyEffect(), abilityText, true)); - this.addAbility(ability); + Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new SakashimaTheImpostorApplier()); + effect.setText("as a copy of any creature on the battlefield, except its name is still Sakashima the Impostor, it's legendary in addition to its other types, and it gains \"{2}{U}{U}: Return {this} to its owner's hand at the beginning of the next end step.\""); + this.addAbility(new EntersBattlefieldAbility(effect, true)); } public SakashimaTheImpostor(final SakashimaTheImpostor card) { @@ -84,52 +78,34 @@ public class SakashimaTheImpostor extends CardImpl { } } -class SakashimaTheImpostorCopyEffect extends OneShotEffect { - - public SakashimaTheImpostorCopyEffect() { - super(Outcome.Copy); - } - - public SakashimaTheImpostorCopyEffect(final SakashimaTheImpostorCopyEffect effect) { - super(effect); - } +class SakashimaTheImpostorApplier extends ApplyToPermanent { @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (player != null && sourcePermanent != null) { - Target target = new TargetPermanent(new FilterCreaturePermanent()); - target.setNotTarget(true); - if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { - player.choose(Outcome.Copy, target, source.getSourceId(), game); - Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget()); - if (copyFromPermanent != null) { - game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() { - @Override - public Boolean apply(Game game, Permanent permanent) { - if (!permanent.getSupertype().contains("Legendary")) { - permanent.getSubtype().add("Legendary"); - } - permanent.setName("Sakashima the Impostor"); - // {2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step - permanent.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)), false), - new ManaCostsImpl("{2}{U}{U}") - ), game); - return true; - } - }); - - return true; - } - } + public Boolean apply(Game game, Permanent permanent) { + if (!permanent.getSupertype().contains("Legendary")) { + permanent.getSubtype().add("Legendary"); } - return false; + permanent.setName("Sakashima the Impostor"); + // {2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step + permanent.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)), false), + new ManaCostsImpl("{2}{U}{U}") + ), game); + return true; } @Override - public SakashimaTheImpostorCopyEffect copy() { - return new SakashimaTheImpostorCopyEffect(this); + public Boolean apply(Game game, MageObject mageObject) { + if (!mageObject.getSupertype().contains("Legendary")) { + mageObject.getSubtype().add("Legendary"); + } + mageObject.setName("Sakashima the Impostor"); + // {2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step + mageObject.getAbilities().add(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)), false), + new ManaCostsImpl("{2}{U}{U}") + )); + return true; } + } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SasayaOrochiAscendant.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SasayaOrochiAscendant.java index 3bc2a38c378..3804d61c11c 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SasayaOrochiAscendant.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SasayaOrochiAscendant.java @@ -202,22 +202,22 @@ class SasayasEssenceManaEffectEffect extends ManaEffect { } switch (choice.getChoice()) { case "Black": - newMana.addBlack(); + newMana.increaseBlack(); break; case "Blue": - newMana.addBlue(); + newMana.increaseBlue(); break; case "Red": - newMana.addRed(); + newMana.increaseRed(); break; case "Green": - newMana.addGreen(); + newMana.increaseGreen(); break; case "White": - newMana.addWhite(); + newMana.increaseWhite(); break; case "Colorless": - newMana.addColorless(); + newMana.increaseColorless(); break; } } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ShapeStealer.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ShapeStealer.java index 51cddc6978c..8ce0408692b 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ShapeStealer.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ShapeStealer.java @@ -39,6 +39,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -56,14 +57,13 @@ public class ShapeStealer extends CardImpl { this.subtype.add("Spirit"); this.power = new MageInt(1); this.toughness = new MageInt(1); - - // This ability triggers once for each creature blocked by or blocking Shape Stealer. + + // This ability triggers once for each creature blocked by or blocking Shape Stealer. // If multiple creatures block it, Shape Stealer's power and toughness will change for // each one in succession. The first trigger put on the stack will be the last to resolve, // so that will set Shape Stealer's final power and toughness. - // Whenever Shape Stealer blocks or becomes blocked by a creature, change Shape Stealer's base power and toughness to that creature's power and toughness until end of turn. - this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new ShapeStealerEffect(), false)); + this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new ShapeStealerEffect(), false)); } public ShapeStealer(final ShapeStealer card) { @@ -77,28 +77,28 @@ public class ShapeStealer extends CardImpl { } class ShapeStealerEffect extends OneShotEffect { - + public ShapeStealerEffect() { super(Outcome.Detriment); this.staticText = "change {this}'s base power and toughness to that creature's power and toughness until end of turn"; } - + public ShapeStealerEffect(final ShapeStealerEffect effect) { super(effect); } - + @Override public ShapeStealerEffect copy() { return new ShapeStealerEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); if (permanent != null) { - ContinuousEffect effect = new SetPowerToughnessSourceEffect(permanent.getPower().getValue(), permanent.getToughness().getValue(), Duration.EndOfTurn); + ContinuousEffect effect = new SetPowerToughnessSourceEffect(permanent.getPower().getValue(), permanent.getToughness().getValue(), Duration.EndOfTurn, SubLayer.SetPT_7b); game.addEffect(effect, source); return true; } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SkyfireKirin.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SkyfireKirin.java index 7fce2704922..8cbed9fd441 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SkyfireKirin.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SkyfireKirin.java @@ -35,9 +35,7 @@ import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainControlTargetEffect; import mage.abilities.keyword.FlyingAbility; -import mage.cards.Card; import mage.cards.CardImpl; -import mage.constants.AbilityType; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -60,6 +58,8 @@ import mage.target.targetpointer.FixedTarget; */ public class SkyfireKirin extends CardImpl { + private final UUID originalId; + public SkyfireKirin(UUID ownerId) { super(ownerId, 113, "Skyfire Kirin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); this.expansionSetCode = "SOK"; @@ -75,12 +75,13 @@ public class SkyfireKirin extends CardImpl { // Whenever you cast a Spirit or Arcane spell, you may gain control of target creature with that spell's converted mana cost until end of turn. Ability ability = new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new SkyfireKirinEffect(), new FilterSpiritOrArcaneCard(), true, true); ability.addTarget(new TargetCreaturePermanent()); + originalId = ability.getOriginalId(); this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability.getAbilityType().equals(AbilityType.TRIGGERED)) { + if (ability.getOriginalId().equals(originalId)) { Spell spell = game.getStack().getSpell(ability.getEffects().get(0).getTargetPointer().getFirst(game, ability)); if (spell != null) { int cmc = spell.getConvertedManaCost(); @@ -94,6 +95,7 @@ public class SkyfireKirin extends CardImpl { public SkyfireKirin(final SkyfireKirin card) { super(card); + this.originalId = card.originalId; } @Override @@ -121,7 +123,7 @@ class SkyfireKirinEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent targetCreature = null; - for(Target target: source.getTargets()) { + for (Target target : source.getTargets()) { if (target instanceof TargetPermanent) { targetCreature = game.getPermanent(target.getFirstTarget()); } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SoramaroFirstToDream.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SoramaroFirstToDream.java index a4134bda06e..6ea5106fd85 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SoramaroFirstToDream.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SoramaroFirstToDream.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; @@ -70,7 +70,7 @@ public class SoramaroFirstToDream extends CardImpl { // {4}, Return a land you control to its owner's hand: Draw a card. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(4)); - ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land")))); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(new FilterControlledLandPermanent("a land")))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/WineOfBloodAndIron.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/WineOfBloodAndIron.java index 2a831a03a06..bfe6007c45b 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/WineOfBloodAndIron.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/WineOfBloodAndIron.java @@ -30,23 +30,19 @@ package mage.sets.saviorsofkamigawa; import java.util.UUID; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.TargetPermanentPowerCount; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; -import mage.game.Game; import mage.target.common.TargetCreaturePermanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -62,7 +58,10 @@ public class WineOfBloodAndIron extends CardImpl { SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(new TargetPermanentPowerCount(), new StaticValue(0), Duration.EndOfTurn, true), new GenericManaCost(4)); - ability.addEffect(new WineOfBloodAndIronEffect()); + Effect effect = new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect()), false); + effect.setText("Sacrifice {this} at the beginning of the next end step"); + ability.addEffect(effect); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } @@ -76,32 +75,3 @@ public class WineOfBloodAndIron extends CardImpl { return new WineOfBloodAndIron(this); } } - -class WineOfBloodAndIronEffect extends OneShotEffect { - - public WineOfBloodAndIronEffect() { - super(Outcome.Sacrifice); - this.staticText = "Sacrifice {this} at the beginning of the next end step"; - } - - public WineOfBloodAndIronEffect(final WineOfBloodAndIronEffect effect) { - super(effect); - } - - @Override - public WineOfBloodAndIronEffect copy() { - return new WineOfBloodAndIronEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this"); - sacrificeEffect.setTargetPointer(new FixedTarget(source.getSourceId())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } -} diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentSphinx.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentSphinx.java index 3863832e516..aa0a0daaabd 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentSphinx.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentSphinx.java @@ -31,14 +31,15 @@ import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.ActivateIfConditionActivatedAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; -import mage.abilities.costs.common.MetalcraftCost; +import mage.abilities.condition.common.MetalcraftCondition; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ReturnFromExileEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.AbilityWord; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -59,9 +60,13 @@ public class ArgentSphinx extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(3); + + // Flying this.addAbility(FlyingAbility.getInstance()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ArgentSphinxEffect(), new ManaCostsImpl("{U}")); - ability.addCost(new MetalcraftCost()); + + // Metalcraft - {U}: Exile Argent Sphinx. Return it to the battlefield under your control at the beginning of the next end step. Activate this ability only if you control three or more artifacts. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ArgentSphinxEffect(), new ManaCostsImpl("{U}"), MetalcraftCondition.getInstance()); + ability.setAbilityWord(AbilityWord.METALCRAFT); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentumArmor.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentumArmor.java index bcf45fb822a..3063cec871f 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentumArmor.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ArgentumArmor.java @@ -25,23 +25,21 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.AttacksAttachedTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; /** @@ -50,18 +48,24 @@ import mage.target.TargetPermanent; */ public class ArgentumArmor extends CardImpl { - public ArgentumArmor (UUID ownerId) { + public ArgentumArmor(UUID ownerId) { super(ownerId, 137, "Argentum Armor", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{6}"); this.expansionSetCode = "SOM"; this.subtype.add("Equipment"); + + // Equipped creature gets +6/+6. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(6, 6))); + + // Whenever equipped creature attacks, destroy target permanent. Ability ability = new AttacksAttachedTriggeredAbility(new DestroyTargetEffect()); ability.addTarget(new TargetPermanent()); this.addAbility(ability); + + // Equip {6} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(6))); } - public ArgentumArmor (final ArgentumArmor card) { + public ArgentumArmor(final ArgentumArmor card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java index 33beef31b35..c18638982bd 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java @@ -25,21 +25,20 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.Condition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.common.FilterLandPermanent; /** @@ -50,18 +49,18 @@ public class BlackcleaveCliffs extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); - public BlackcleaveCliffs (UUID ownerId) { + public BlackcleaveCliffs(UUID ownerId) { super(ownerId, 224, "Blackcleave Cliffs", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; - Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 4)); + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 3)); String abilityText = "tapped unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new BlackManaAbility()); this.addAbility(new RedManaAbility()); } - public BlackcleaveCliffs (final BlackcleaveCliffs card) { + public BlackcleaveCliffs(final BlackcleaveCliffs card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Blistergrub.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Blistergrub.java index 4d091c48df8..ea6f1bd8ca9 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Blistergrub.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Blistergrub.java @@ -30,16 +30,13 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.abilities.keyword.SwampwalkAbility; import mage.constants.CardType; import mage.constants.Rarity; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.DiesTriggeredAbility; -import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.constants.Outcome; -import mage.game.Game; -import mage.players.Player; /** * @@ -54,7 +51,11 @@ public class Blistergrub extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new DiesTriggeredAbility(new BlistergrubEffect(), false)); + + // Swampwalk (This creature can't be blocked as long as defending player controls a Swamp.) + this.addAbility(new SwampwalkAbility()); + // When Blistergrub dies, each opponent loses 2 life. + this.addAbility(new DiesTriggeredAbility(new LoseLifeOpponentsEffect(2), false)); } public Blistergrub (final Blistergrub card) { @@ -66,30 +67,3 @@ public class Blistergrub extends CardImpl { return new Blistergrub(this); } } - -class BlistergrubEffect extends OneShotEffect { - - public BlistergrubEffect() { - super(Outcome.Damage); - staticText = "each opponent loses 2 life"; - } - - public BlistergrubEffect(final BlistergrubEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - for (UUID opp : game.getOpponents(source.getControllerId())) { - Player opponent = game.getPlayer(opp); - if (opponent != null) - opponent.loseLife(2, game); - } - return true; - } - - @Override - public BlistergrubEffect copy() { - return new BlistergrubEffect(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CarrionCall.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CarrionCall.java index 6e230d5b0a5..230f49814f1 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CarrionCall.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CarrionCall.java @@ -29,13 +29,12 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.MageInt; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.InfectAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.InsectInfectToken; /** * @@ -48,7 +47,7 @@ public class CarrionCall extends CardImpl { this.expansionSetCode = "SOM"; // Put two 1/1 green Insect creature tokens with infect onto the battlefield. (They deal damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.) - this.getSpellAbility().addEffect(new CreateTokenEffect(new CarrionCallInsectToken(), 2)); + this.getSpellAbility().addEffect(new CreateTokenEffect(new InsectInfectToken(), 2)); } public CarrionCall (final CarrionCall card) { @@ -60,19 +59,3 @@ public class CarrionCall extends CardImpl { return new CarrionCall(this); } } - -class CarrionCallInsectToken extends Token { - - public CarrionCallInsectToken() { - super("Insect", "1/1 green Insect creature tokens with infect"); - setOriginalExpansionSetCode("SOM"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Insect"); - power = new MageInt(1); - toughness = new MageInt(1); - - addAbility(InfectAbility.getInstance()); - } -} - diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java index fe2675c496e..ed95ec8d7af 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,38 +20,31 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets.scarsofmirrodin; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; +import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.CountersCount; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; -import java.util.UUID; - /** * @author BetaSteward_at_googlemail.com */ @@ -60,10 +53,10 @@ public class ChimericMass extends CardImpl { public ChimericMass(UUID ownerId) { super(ownerId, 141, "Chimeric Mass", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{X}"); this.expansionSetCode = "SOM"; - + // Chimeric Mass enters the battlefield with X charge counters on it. - this.addAbility(new EntersBattlefieldAbility(new ChimericMassEffect(), "{this} enters the battlefield with X charge counters on it")); - + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.CHARGE.createInstance()))); + // {1}: Until end of turn, Chimeric Mass becomes a Construct artifact creature with "This creature's power and toughness are each equal to the number of charge counters on it." this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new ChimericMassToken(), "", Duration.EndOfTurn), new GenericManaCost(1))); } @@ -79,38 +72,6 @@ public class ChimericMass extends CardImpl { } -class ChimericMassEffect extends OneShotEffect { - public ChimericMassEffect() { - super(Outcome.Benefit); - } - - public ChimericMassEffect(final ChimericMassEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public ChimericMassEffect copy() { - return new ChimericMassEffect(this); - } -} - class ChimericMassToken extends Token { public ChimericMassToken() { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CloneShell.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CloneShell.java index 4f984aaf754..68eae298900 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CloneShell.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CloneShell.java @@ -27,8 +27,8 @@ */ package mage.sets.scarsofmirrodin; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.List; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.DiesTriggeredAbility; @@ -38,7 +38,9 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; @@ -46,9 +48,6 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetCard; -import java.util.List; -import java.util.UUID; - /** * @author nantuko */ @@ -161,19 +160,22 @@ class CloneShellDiesEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - if (permanent != null) { - List imprinted = permanent.getImprinted(); - if (imprinted.size() > 0) { - Card imprintedCard = game.getCard(imprinted.get(0)); - imprintedCard.setFaceDown(false, game); - if (imprintedCard.getCardType().contains(CardType.CREATURE)) { - imprintedCard.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Permanent permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); + if (permanent != null) { + List imprinted = permanent.getImprinted(); + if (imprinted.size() > 0) { + Card imprintedCard = game.getCard(imprinted.get(0)); + imprintedCard.setFaceDown(false, game); + if (imprintedCard.getCardType().contains(CardType.CREATURE)) { + controller.moveCards(imprintedCard, Zone.BATTLEFIELD, source, game); + } } } + return true; } - - return true; + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperlineGorge.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperlineGorge.java index 7a0f5ed0907..6c5a7eb2f84 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperlineGorge.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperlineGorge.java @@ -25,21 +25,20 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.Condition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.common.FilterLandPermanent; /** @@ -50,19 +49,19 @@ public class CopperlineGorge extends CardImpl { private static FilterLandPermanent filter = new FilterLandPermanent(); - public CopperlineGorge (UUID ownerId) { + public CopperlineGorge(UUID ownerId) { super(ownerId, 225, "Copperline Gorge", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; // Copperline Gorge enters the battlefield tapped unless you control two or fewer other lands. - Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 4)); + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 3)); String abilityText = "tapped unless you control two or fewer other lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new RedManaAbility()); this.addAbility(new GreenManaAbility()); } - public CopperlineGorge (final CopperlineGorge card) { + public CopperlineGorge(final CopperlineGorge card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ElspethTirel.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ElspethTirel.java index 9de094b78e4..893edc2be14 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ElspethTirel.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ElspethTirel.java @@ -25,20 +25,18 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; -import mage.counters.CounterType; +import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -46,28 +44,25 @@ import mage.game.permanent.PermanentToken; import mage.game.permanent.token.SoldierToken; import mage.players.Player; -import java.util.UUID; - /** * * @author Loki */ public class ElspethTirel extends CardImpl { - public ElspethTirel (UUID ownerId) { + public ElspethTirel(UUID ownerId) { super(ownerId, 6, "Elspeth Tirel", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{W}{W}"); this.expansionSetCode = "SOM"; this.subtype.add("Elspeth"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); - + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); this.addAbility(new LoyaltyAbility(new ElspethTirelFirstEffect(), 2)); this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new SoldierToken(), 3), -2)); this.addAbility(new LoyaltyAbility(new ElspethTirelThirdEffect(), -5)); } - public ElspethTirel (final ElspethTirel card) { + public ElspethTirel(final ElspethTirel card) { super(card); } @@ -78,6 +73,7 @@ public class ElspethTirel extends CardImpl { } class ElspethTirelFirstEffect extends OneShotEffect { + public ElspethTirelFirstEffect() { super(Outcome.GainLife); staticText = "You gain 1 life for each creature you control"; @@ -105,6 +101,7 @@ class ElspethTirelFirstEffect extends OneShotEffect { } class ElspethTirelThirdEffect extends OneShotEffect { + public ElspethTirelThirdEffect() { super(Outcome.DestroyPermanent); staticText = "Destroy all other permanents except for lands and tokens"; @@ -116,9 +113,10 @@ class ElspethTirelThirdEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - for (Permanent perm: game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { - if (!perm.getId().equals(source.getSourceId()) && !(perm instanceof PermanentToken) && ! (perm.getCardType().contains(CardType.LAND))) + for (Permanent perm : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) { + if (!perm.getId().equals(source.getSourceId()) && !(perm instanceof PermanentToken) && !(perm.getCardType().contains(CardType.LAND))) { perm.destroy(source.getSourceId(), game, false); + } } return true; } @@ -128,4 +126,4 @@ class ElspethTirelThirdEffect extends OneShotEffect { return new ElspethTirelThirdEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GenesisWave.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GenesisWave.java index b20a7cfe247..c8224d6d27e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GenesisWave.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GenesisWave.java @@ -27,6 +27,8 @@ */ package mage.sets.scarsofmirrodin; +import java.util.LinkedHashSet; +import java.util.Set; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; @@ -115,13 +117,15 @@ class GenesisWaveEffect extends OneShotEffect { target1.setRequired(false); controller.choose(Outcome.PutCardInPlay, cards, target1, game); + Set toBattlefield = new LinkedHashSet<>(); for (UUID cardId : target1.getTargets()) { Card card = cards.get(cardId, game); if (card != null) { cards.remove(card); - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + toBattlefield.add(card); } } + controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, false, false, null); controller.moveCards(cards, Zone.LIBRARY, Zone.GRAVEYARD, source, game); } return true; diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GethLordOfTheVault.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GethLordOfTheVault.java index 28f18c2e72b..789abba3b4d 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GethLordOfTheVault.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GethLordOfTheVault.java @@ -25,14 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -41,6 +36,10 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.IntimidateAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; @@ -57,7 +56,9 @@ import mage.target.common.TargetCardInOpponentsGraveyard; */ public class GethLordOfTheVault extends CardImpl { - public GethLordOfTheVault (UUID ownerId) { + private final UUID originalId; + + public GethLordOfTheVault(UUID ownerId) { super(ownerId, 64, "Geth, Lord of the Vault", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); this.expansionSetCode = "SOM"; this.supertype.add("Legendary"); @@ -71,27 +72,29 @@ public class GethLordOfTheVault extends CardImpl { // {X}{B}: Put target artifact or creature card with converted mana cost X from an opponent's graveyard onto the battlefield under your control tapped. // Then that player puts the top X cards of his or her library into his or her graveyard. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GethLordOfTheVaultEffect(), new ManaCostsImpl("{X}{B}")); + originalId = ability.getOriginalId(); ability.addTarget(new TargetCardInOpponentsGraveyard(new FilterCard("artifact or creature card with converted mana cost X from an opponent's graveyard"))); this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SimpleActivatedAbility) { + if (ability.getOriginalId().equals(originalId)) { int xValue = ability.getManaCostsToPay().getX(); ability.getTargets().clear(); - FilterCard filter = new FilterCard(new StringBuilder("artifact or creature card with converted mana cost ").append(xValue).append(" from an opponent's graveyard").toString()); + FilterCard filter = new FilterCard("artifact or creature card with converted mana cost " + xValue + " from an opponent's graveyard"); filter.add(Predicates.or( - new CardTypePredicate(CardType.ARTIFACT), - new CardTypePredicate(CardType.CREATURE))); + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, xValue)); Target target = new TargetCardInOpponentsGraveyard(filter); ability.addTarget(target); } } - public GethLordOfTheVault (final GethLordOfTheVault card) { + public GethLordOfTheVault(final GethLordOfTheVault card) { super(card); + this.originalId = card.originalId; } @Override @@ -100,6 +103,7 @@ public class GethLordOfTheVault extends CardImpl { } } + class GethLordOfTheVaultEffect extends OneShotEffect { public GethLordOfTheVaultEffect() { @@ -113,15 +117,19 @@ class GethLordOfTheVaultEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Card card = game.getCard(getTargetPointer().getFirst(game, source)); - if (card != null) { - card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId(), true); - Player player = game.getPlayer(card.getOwnerId()); - if (player != null) { - player.moveCards(player.getLibrary().getTopCards(game, card.getManaCost().convertedManaCost()), Zone.LIBRARY, Zone.GRAVEYARD, source, game); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Card card = game.getCard(getTargetPointer().getFirst(game, source)); + if (card != null) { + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); + Player player = game.getPlayer(card.getOwnerId()); + if (player != null) { + player.moveCards(player.getLibrary().getTopCards(game, card.getManaCost().convertedManaCost()), Zone.GRAVEYARD, source, game); + } } + return true; } - return true; + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GoldenUrn.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GoldenUrn.java index 96a83ffbe4d..b05de39496e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GoldenUrn.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GoldenUrn.java @@ -30,23 +30,20 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; -import mage.constants.Outcome; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.TargetController; +import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; /** * @@ -58,7 +55,7 @@ public class GoldenUrn extends CardImpl { super(ownerId, 158, "Golden Urn", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); this.expansionSetCode = "SOM"; this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), TargetController.YOU, true)); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GoldenUrnEffect(), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(new CountersCount(CounterType.CHARGE)), new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); } @@ -73,34 +70,3 @@ public class GoldenUrn extends CardImpl { } } - -class GoldenUrnEffect extends OneShotEffect { - public GoldenUrnEffect() { - super(Outcome.GainLife); - staticText = "You gain life equal to the number of charge counters on {this}"; - } - - public GoldenUrnEffect(final GoldenUrnEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent p = game.getBattlefield().getPermanent(source.getSourceId()); - Player player = game.getPlayer(source.getControllerId()); - if (p == null) { - p = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - } - if (p != null && player != null) { - player.gainLife(p.getCounters().getCount(CounterType.CHARGE), game); - return true; - } - return false; - } - - @Override - public GoldenUrnEffect copy() { - return new GoldenUrnEffect(this); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KembaKhaRegent.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KembaKhaRegent.java index 91e4e6d7672..acbfb13f318 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KembaKhaRegent.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KembaKhaRegent.java @@ -38,7 +38,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.dynamicvalue.common.EquipmentAttachedCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.CatToken; /** * @@ -69,16 +69,3 @@ public class KembaKhaRegent extends CardImpl { return new KembaKhaRegent(this); } } - -class CatToken extends Token { - - public CatToken() { - super("Cat", "a 2/2 white Cat creature token"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Cat"); - power = new MageInt(2); - toughness = new MageInt(2); - } -} diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java index c9c727992b0..dd9e569ac98 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; @@ -33,7 +32,7 @@ import mage.MageInt; import mage.Mana; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.TapSourceCost; @@ -44,7 +43,6 @@ import mage.abilities.effects.common.DynamicManaEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -54,7 +52,6 @@ import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.TargetController; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.ControllerPredicate; @@ -70,25 +67,24 @@ import mage.target.common.TargetLandPermanent; * @author Loki, North */ public class KothOfTheHammer extends CardImpl { + static final FilterLandPermanent filter = new FilterLandPermanent("Mountain"); private static final FilterLandPermanent filterCount = new FilterLandPermanent("Mountain you control"); static { filter.add(new SubtypePredicate("Mountain")); - filter.add(new ControllerPredicate(TargetController.YOU)); + filterCount.add(new SubtypePredicate("Mountain")); filterCount.add(new ControllerPredicate(TargetController.YOU)); } - public KothOfTheHammer (UUID ownerId) { + public KothOfTheHammer(UUID ownerId) { super(ownerId, 94, "Koth of the Hammer", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{R}{R}"); this.expansionSetCode = "SOM"; this.subtype.add("Koth"); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); - // +1: Untap target Mountain. It becomes a 4/4 red Elemental creature until end of turn. It's still a land. Ability ability = new LoyaltyAbility(new UntapTargetEffect(), 1); ability.addEffect(new BecomesCreatureTargetEffect(new KothOfTheHammerToken(), false, true, Duration.EndOfTurn)); @@ -102,7 +98,7 @@ public class KothOfTheHammer extends CardImpl { this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new KothOfTheHammerEmblem()), -5)); } - public KothOfTheHammer (final KothOfTheHammer card) { + public KothOfTheHammer(final KothOfTheHammer card) { super(card); } @@ -111,6 +107,7 @@ public class KothOfTheHammer extends CardImpl { return new KothOfTheHammer(this); } } + class KothOfTheHammerToken extends Token { public KothOfTheHammerToken() { @@ -125,7 +122,9 @@ class KothOfTheHammerToken extends Token { } class KothOfTheHammerEmblem extends Emblem { + // "Mountains you control have '{T}: This land deals 1 damage to target creature or player.'" + public KothOfTheHammerEmblem() { this.setName("EMBLEM: Koth of the Hammer"); this.getAbilities().add(new SimpleStaticAbility(Zone.COMMAND, new KothOfTheHammerThirdEffect())); @@ -133,6 +132,7 @@ class KothOfTheHammerEmblem extends Emblem { } class KothOfTheHammerThirdEffect extends ContinuousEffectImpl { + public KothOfTheHammerThirdEffect() { super(Duration.EndOfGame, Outcome.AddAbility); staticText = "You get an emblem with \"Mountains you control have '{T}: This land deals 1 damage to target creature or player.'\""; diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MeltTerrain.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MeltTerrain.java index 8c95d5de0b3..0524d95acd6 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MeltTerrain.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MeltTerrain.java @@ -29,18 +29,12 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetControllerEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.constants.Outcome; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.target.common.TargetLandPermanent; /** @@ -53,8 +47,11 @@ public class MeltTerrain extends CardImpl { super(ownerId, 97, "Melt Terrain", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{R}{R}"); this.expansionSetCode = "SOM"; + // Destroy target land. Melt Terrain deals 2 damage to that land's controller. this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addEffect(new MeltTerrainEffect()); + Effect effect = new DamageTargetControllerEffect(2); + effect.setText("{this} deals 2 damage to that land's controller"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetLandPermanent()); } @@ -66,37 +63,4 @@ public class MeltTerrain extends CardImpl { public MeltTerrain copy() { return new MeltTerrain(this); } - } - -class MeltTerrainEffect extends OneShotEffect { - MeltTerrainEffect() { - super(Outcome.Damage); - staticText = "{this} deals 2 damage to that land's controller"; - } - - MeltTerrainEffect(final MeltTerrainEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent p = game.getBattlefield().getPermanent(source.getFirstTarget()); - if (p == null) { - p = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); - } - if (p != null) { - Player player = game.getPlayer(p.getControllerId()); - if (player != null) { - player.damage(2, source.getSourceId(), game, false, true); - } - } - return false; - } - - @Override - public MeltTerrainEffect copy() { - return new MeltTerrainEffect(this); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java index 2a24c0196ea..324ecd84756 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java @@ -37,7 +37,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileTargetEffect; -import mage.abilities.keyword.HasteAbility; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; @@ -50,10 +50,8 @@ import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; -import mage.game.permanent.token.EmptyToken; import mage.players.Player; import mage.target.targetpointer.FixedTarget; -import mage.util.CardUtil; /** * @author nantuko @@ -204,19 +202,18 @@ class MimicVatCreateTokenEffect extends OneShotEffect { if (permanent.getImprinted().size() > 0) { Card card = game.getCard(permanent.getImprinted().get(0)); if (card != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(card); - - token.addAbility(HasteAbility.getInstance()); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, true); + effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); + effect.apply(game, source); + for (Permanent addedToken : effect.getAddedPermanent()) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(addedToken, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } return true; } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java index 9b944c42689..1b522322159 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -28,18 +28,18 @@ package mage.sets.scarsofmirrodin; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import java.util.Map.Entry; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.condition.common.MetalcraftCondition; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.WatcherScope; -import mage.abilities.Ability; -import mage.abilities.condition.common.MetalcraftCondition; -import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.CardImpl; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; @@ -56,7 +56,6 @@ public class MoltenPsyche extends CardImpl { super(ownerId, 98, "Molten Psyche", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); this.expansionSetCode = "SOM"; - // Each player shuffles the cards from his or her hand into his or her library, then draws that many cards. // Metalcraft - If you control three or more artifacts, Molten Psyche deals damage to each opponent equal to the number of cards that player has drawn this turn. this.getSpellAbility().addEffect(new MoltenPsycheEffect()); @@ -78,8 +77,8 @@ class MoltenPsycheEffect extends OneShotEffect { public MoltenPsycheEffect() { super(Outcome.Neutral); - staticText = "Each player shuffles the cards from his or her hand into his or her library, then draws that many cards.\n" + - "Metalcraft - If you control three or more artifacts, {this} deals damage to each opponent equal to the number of cards that player has drawn this turn."; + staticText = "Each player shuffles the cards from his or her hand into his or her library, then draws that many cards.\n" + + "Metalcraft - If you control three or more artifacts, {this} deals damage to each opponent equal to the number of cards that player has drawn this turn."; } public MoltenPsycheEffect(final MoltenPsycheEffect effect) { @@ -88,27 +87,46 @@ class MoltenPsycheEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player sourcePlayer = game.getPlayer(source.getControllerId()); - for (UUID playerId: sourcePlayer.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { - int count = player.getHand().size(); - for (Card card: player.getHand().getCards(game)) { - if (card != null) { - player.removeFromHand(card, game); - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Map cardsToDraw = new LinkedHashMap<>(); + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + int cardsInHand = player.getHand().size(); + if (cardsInHand > 0) { + cardsToDraw.put(playerId, cardsInHand); } - } - game.informPlayers(player.getLogName() + " shuffles the cards from his or her hand into his or her library"); - player.shuffleLibrary(game); - player.drawCards(count, game); - if (MetalcraftCondition.getInstance().apply(game, source) && !playerId.equals(source.getControllerId())) { - MoltenPsycheWatcher watcher = (MoltenPsycheWatcher) game.getState().getWatchers().get("CardsDrawn"); - player.damage(watcher.getDraws(playerId), source.getSourceId(), game, false, true); + player.moveCards(player.getHand(), Zone.HAND, Zone.LIBRARY, source, game); + player.shuffleLibrary(game); } } + + game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw action + + for (UUID playerId : cardsToDraw.keySet()) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.drawCards(cardsToDraw.get(playerId), game); + if (MetalcraftCondition.getInstance().apply(game, source) && !playerId.equals(source.getControllerId())) { + MoltenPsycheWatcher watcher = (MoltenPsycheWatcher) game.getState().getWatchers().get("CardsDrawn"); + player.damage(watcher.getDraws(playerId), source.getSourceId(), game, false, true); + } + } + } + if (MetalcraftCondition.getInstance().apply(game, source)) { + MoltenPsycheWatcher watcher = (MoltenPsycheWatcher) game.getState().getWatchers().get("CardsDrawn"); + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.damage(watcher.getDraws(playerId), source.getSourceId(), game, false, true); + } + } + } + return true; } - return true; + + return false; } @Override @@ -128,7 +146,7 @@ class MoltenPsycheWatcher extends Watcher { public MoltenPsycheWatcher(final MoltenPsycheWatcher watcher) { super(watcher); - for (Entry entry: watcher.draws.entrySet()) { + for (Entry entry : watcher.draws.entrySet()) { draws.put(entry.getKey(), entry.getValue()); } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoxOpal.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoxOpal.java index d6e2c90023f..dc3280e7fb3 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoxOpal.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoxOpal.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,26 +20,23 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.costs.common.MetalcraftCost; -import mage.cards.CardImpl; - import java.util.UUID; +import mage.abilities.Ability; import mage.abilities.condition.common.MetalcraftCondition; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.AddManaOfAnyColorEffect; import mage.abilities.mana.ActivateIfConditionManaAbility; +import mage.cards.CardImpl; import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; /** @@ -54,8 +51,8 @@ public class MoxOpal extends CardImpl { this.expansionSetCode = "SOM"; Ability ability = new ActivateIfConditionManaAbility( - Zone.BATTLEFIELD, - new AddManaOfAnyColorEffect(), + Zone.BATTLEFIELD, + new AddManaOfAnyColorEffect(), new TapSourceCost(), MetalcraftCondition.getInstance()); ability.setAbilityWord(AbilityWord.METALCRAFT); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrPropagator.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrPropagator.java index 83037aeec91..ed639b1d68f 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrPropagator.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrPropagator.java @@ -27,24 +27,17 @@ */ package mage.sets.scarsofmirrodin; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect; import mage.cards.CardImpl; -import mage.constants.Outcome; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; -import mage.util.CardUtil; - -import java.util.UUID; -import mage.MageObject; /** * @@ -61,7 +54,7 @@ public class MyrPropagator extends CardImpl { this.toughness = new MageInt(1); // {3}, {tap}: Put a token that's a copy of Myr Propagator onto the battlefield. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MyrPropagatorCreateTokenEffect(), new GenericManaCost(3)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutTokenOntoBattlefieldCopySourceEffect(), new GenericManaCost(3)); ability.addCost(new TapSourceCost()); this.addAbility(ability); } @@ -75,41 +68,3 @@ public class MyrPropagator extends CardImpl { return new MyrPropagator(this); } } - -class MyrPropagatorCreateTokenEffect extends OneShotEffect { - - public MyrPropagatorCreateTokenEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "Put a token that's a copy of {this} onto the battlefield"; - } - - public MyrPropagatorCreateTokenEffect(final MyrPropagatorCreateTokenEffect effect) { - super(effect); - } - - @Override - public MyrPropagatorCreateTokenEffect copy() { - return new MyrPropagatorCreateTokenEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - MageObject thisCard = game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - if (thisCard != null && thisCard instanceof Permanent) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from((Permanent)thisCard); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } else { // maybe it's token - Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); - if (permanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } - } - return false; - } - -} diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java index 7e1ebce026c..845fe559621 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java @@ -36,9 +36,8 @@ import mage.abilities.Ability; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.constants.Outcome; import mage.filter.common.FilterArtifactSpell; import mage.game.Game; import mage.game.permanent.token.MyrToken; @@ -71,9 +70,9 @@ public class Myrsmith extends CardImpl { } } -class MyrsmithEffect extends OneShotEffect { +class MyrsmithEffect extends CreateTokenEffect { public MyrsmithEffect() { - super(Outcome.PutCreatureInPlay); + super(new MyrToken()); staticText = "you may pay {1}. If you do, put a 1/1 colorless Myr artifact creature token onto the battlefield"; } @@ -86,7 +85,7 @@ class MyrsmithEffect extends OneShotEffect { Cost cost = new GenericManaCost(1); cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { - new MyrToken().putOntoBattlefield(1, game, source.getControllerId(), source.getControllerId()); + super.apply(game, source); } return true; } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java index 65d7927c47c..e49932fcb04 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,14 +20,25 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets.scarsofmirrodin; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.ActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -35,16 +46,10 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.ActivatedAbility; -import mage.abilities.StaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.cards.Card; -import mage.cards.CardImpl; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import mage.sets.futuresight.YixlidJailer; /** * @@ -60,7 +65,8 @@ public class NecroticOoze extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(3); - this.addAbility(new NecroticOozeAbility()); + // As long as Necrotic Ooze is on the battlefield, it has all activated abilities of all creature cards in all graveyards + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NecroticOozeEffect())); } public NecroticOoze(final NecroticOoze card) { @@ -72,48 +78,27 @@ public class NecroticOoze extends CardImpl { return new NecroticOoze(this); } -} + class NecroticOozeEffect extends ContinuousEffectImpl { -class NecroticOozeAbility extends StaticAbility { + public NecroticOozeEffect() { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + staticText = "As long as {this} is on the battlefield, it has all activated abilities of all creature cards in all graveyards"; + } - public NecroticOozeAbility() { - super(Zone.BATTLEFIELD, new NecroticOozeEffect()); - } + public NecroticOozeEffect(final NecroticOozeEffect effect) { + super(effect); + } - public NecroticOozeAbility(final NecroticOozeAbility ability) { - super(ability); - } - - @Override - public NecroticOozeAbility copy() { - return new NecroticOozeAbility(this); - } - -} - -class NecroticOozeEffect extends ContinuousEffectImpl { - - public NecroticOozeEffect() { - super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - staticText = "As long as {this} is on the battlefield, it has all activated abilities of all creature cards in all graveyards"; - } - - public NecroticOozeEffect(final NecroticOozeEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { + @Override + public boolean apply(Game game, Ability source) { Permanent perm = game.getPermanent(source.getSourceId()); if (perm != null) { - for (UUID playerId: controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card: player.getGraveyard().getCards(game)) { + for (Card card : player.getGraveyard().getCards(game)) { if (card.getCardType().contains(CardType.CREATURE)) { - for (Ability ability: card.getAbilities()) { + for (Ability ability : card.getAbilities()) { if (ability instanceof ActivatedAbility) { perm.addAbility(ability, game); } @@ -122,15 +107,31 @@ class NecroticOozeEffect extends ContinuousEffectImpl { } } } + return true; } - return true; + return false; + } + + @Override + public NecroticOozeEffect copy() { + return new NecroticOozeEffect(this); + } + + @Override + public Set isDependentTo(List allEffectsInLayer) { + // the dependent classes needs to be an enclosed class for dependent check of continuous effects + Set dependentTo = null; + for (ContinuousEffect effect : allEffectsInLayer) { + // http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/285211-yixlid-jailer-vs-necrotic-ooze + if (YixlidJailer.class.equals(effect.getClass().getEnclosingClass())) { + if (dependentTo == null) { + dependentTo = new HashSet<>(); + } + dependentTo.add(effect.getId()); + } + } + return dependentTo; } - return false; } - @Override - public NecroticOozeEffect copy() { - return new NecroticOozeEffect(this); - } - -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java index 45f8b9878cc..0de1da15612 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java @@ -113,18 +113,8 @@ class NimDeathmantleTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - // make sure card is on battlefield - UUID sourceId = getSourceId(); - if (game.getPermanent(sourceId) == null) { - // or it is being removed - if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) { - return false; - } - } - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; Permanent permanent = zEvent.getTarget(); - if (permanent != null && permanent.getControllerId().equals(this.controllerId) && zEvent.getToZone() == Zone.GRAVEYARD @@ -159,29 +149,28 @@ class NimDeathmantleEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); Permanent equipment = game.getPermanent(source.getSourceId()); - if (player != null && equipment != null) { - if (player.chooseUse(Outcome.Benefit, equipment.getName() + " - Pay " + cost.getText() + "?", source, game)) { + if (controller != null && equipment != null) { + if (controller.chooseUse(Outcome.Benefit, equipment.getName() + " - Pay " + cost.getText() + "?", source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { UUID target = targetPointer.getFirst(game, source); - if (target != null && equipment != null) { + if (target != null) { Card card = game.getCard(target); // check if it's still in graveyard if (card != null && game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { - Player owner = game.getPlayer(card.getOwnerId()); - if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId())) { + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { permanent.addAttachment(equipment.getId(), game); - return true; } } } } } } + return true; } return false; diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaDaredevil.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaDaredevil.java index 834ecd9a51d..65a8259d5bd 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaDaredevil.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaDaredevil.java @@ -58,9 +58,12 @@ public class OxiddaDaredevil extends CardImpl { public OxiddaDaredevil (UUID ownerId) { super(ownerId, 100, "Oxidda Daredevil", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.expansionSetCode = "SOM"; - this.color.setRed(true); + this.subtype.add("Goblin"); + this.subtype.add("Artificer"); + this.power = new MageInt(2); this.toughness = new MageInt(1); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledPermanent(filter)))); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/QuicksilverGargantuan.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/QuicksilverGargantuan.java index a02bb9ccda7..c7c1f7b3bcb 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/QuicksilverGargantuan.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/QuicksilverGargantuan.java @@ -25,27 +25,20 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.cards.Card; +import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.target.common.TargetCreaturePermanent; - -import java.util.UUID; -import mage.target.Target; +import mage.util.functions.ApplyToPermanent; /** * @author ayratn @@ -60,11 +53,8 @@ public class QuicksilverGargantuan extends CardImpl { this.power = new MageInt(7); this.toughness = new MageInt(7); - Ability ability = new EntersBattlefieldAbility(new QuicksilverGargantuanCopyEffect(), + Ability ability = new EntersBattlefieldAbility(new CopyPermanentEffect(new QuicksilverGargantuanApplyToPermanent()), "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except it's still 7/7"); - Target target = new TargetCreaturePermanent(); - target.setNotTarget(true); - ability.addTarget(target); this.addAbility(ability); } @@ -76,52 +66,22 @@ public class QuicksilverGargantuan extends CardImpl { public QuicksilverGargantuan copy() { return new QuicksilverGargantuan(this); } +} - private class QuicksilverGargantuanCopyEffect extends ContinuousEffectImpl { +class QuicksilverGargantuanApplyToPermanent extends ApplyToPermanent { - public QuicksilverGargantuanCopyEffect() { - super(Duration.WhileOnBattlefield, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature); - staticText = "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except it's still 7/7"; - } - - public QuicksilverGargantuanCopyEffect(final QuicksilverGargantuanCopyEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Card card = game.getCard(source.getFirstTarget()); - Permanent permanent = game.getPermanent(source.getSourceId()); - permanent.setName(card.getName()); - permanent.getColor(game).setColor(card.getColor(game)); - permanent.getManaCost().clear(); - permanent.getManaCost().add(card.getManaCost()); - permanent.getCardType().clear(); - for (CardType type : card.getCardType()) { - permanent.getCardType().add(type); - } - permanent.getSubtype().clear(); - for (String type : card.getSubtype()) { - permanent.getSubtype().add(type); - } - permanent.getSupertype().clear(); - for (String type : card.getSupertype()) { - permanent.getSupertype().add(type); - } - permanent.setExpansionSetCode(card.getExpansionSetCode()); - permanent.getAbilities().clear(); - for (Ability ability : card.getAbilities()) { - permanent.addAbility(ability, game); - } - - return true; - } - - @Override - public QuicksilverGargantuanCopyEffect copy() { - return new QuicksilverGargantuanCopyEffect(this); - } + @Override + public Boolean apply(Game game, Permanent permanent) { + permanent.getPower().initValue(7); + permanent.getToughness().initValue(7); + return true; + } + @Override + public Boolean apply(Game game, MageObject mageObject) { + mageObject.getPower().initValue(7); + mageObject.getToughness().initValue(7); + return true; } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorvergeThicket.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorvergeThicket.java index ae33a638f33..0cf9a06debf 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorvergeThicket.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorvergeThicket.java @@ -25,21 +25,20 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.Condition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.common.FilterLandPermanent; /** @@ -50,18 +49,19 @@ public class RazorvergeThicket extends CardImpl { private static FilterLandPermanent filter = new FilterLandPermanent(); - public RazorvergeThicket (UUID ownerId) { + public RazorvergeThicket(UUID ownerId) { super(ownerId, 228, "Razorverge Thicket", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; - Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 4)); + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 3)); String abilityText = "tap it unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new GreenManaAbility()); this.addAbility(new WhiteManaAbility()); } - public RazorvergeThicket (final RazorvergeThicket card) { + public RazorvergeThicket(final RazorvergeThicket card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RevokeExistence.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RevokeExistence.java index 554cefc08b4..1186f719aec 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RevokeExistence.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RevokeExistence.java @@ -25,25 +25,24 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.effects.common.ExileTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; -import java.util.UUID; - /** * * @author Loki */ public class RevokeExistence extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { @@ -52,15 +51,16 @@ public class RevokeExistence extends CardImpl { new CardTypePredicate(CardType.ENCHANTMENT))); } - public RevokeExistence (UUID ownerId) { + public RevokeExistence(UUID ownerId) { super(ownerId, 18, "Revoke Existence", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{W}"); this.expansionSetCode = "SOM"; + // Exile target artifact or enchantment. this.getSpellAbility().addEffect(new ExileTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(filter)); } - public RevokeExistence (final RevokeExistence card) { + public RevokeExistence(final RevokeExistence card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RustTick.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RustTick.java index db24b404062..213dc1eb43e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RustTick.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RustTick.java @@ -30,22 +30,17 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.Mode; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SkipUntapOptionalAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.common.TargetArtifactPermanent; +import mage.abilities.effects.common.DontUntapAsLongAsSourceTappedEffect; /** * @author nantuko @@ -64,12 +59,11 @@ public class RustTick extends CardImpl { this.addAbility(new SkipUntapOptionalAbility()); // {1}, {tap}: Tap target artifact. It doesn't untap during its controller's untap step for as long as Rust Tick remains tapped. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RustTickTapTargetEffect(), new GenericManaCost(1)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new GenericManaCost(1)); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetArtifactPermanent()); + ability.addEffect(new DontUntapAsLongAsSourceTappedEffect()); this.addAbility(ability); - - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new RustTickRestrictionEffect())); } public RustTick(final RustTick card) { @@ -81,79 +75,3 @@ public class RustTick extends CardImpl { return new RustTick(this); } } - -class RustTickTapTargetEffect extends TapTargetEffect { - - public RustTickTapTargetEffect() { - super(); - staticText = "Tap target artifact. It doesn't untap during its controller's untap step for as long as Rust Tick remains tapped"; - } - - public RustTickTapTargetEffect(final RustTickTapTargetEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent rustTick = game.getPermanent(source.getSourceId()); - if (rustTick != null) { - rustTick.clearConnectedCards("RustTick"); - } - for (UUID target : targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(target); - if (permanent != null) { - rustTick.addConnectedCard("RustTick", permanent.getId()); - permanent.tap(game); - } else { - return false; - } - } - return true; - } - - @Override - public RustTickTapTargetEffect copy() { - return new RustTickTapTargetEffect(this); - } - - @Override - public String getText(Mode mode) { - return staticText; - } -} - -class RustTickRestrictionEffect extends RestrictionEffect { - - public RustTickRestrictionEffect() { - super(Duration.WhileOnBattlefield); - } - - public RustTickRestrictionEffect(final RustTickRestrictionEffect effect) { - super(effect); - } - - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - Permanent rustTick = game.getPermanent(source.getSourceId()); - if (rustTick != null && rustTick.isTapped()) { - if (rustTick.getConnectedCards("RustTick").size() > 0) { - UUID target = rustTick.getConnectedCards("RustTick").get(0); - if (target != null && target.equals(permanent.getId())) { - return true; - } - } - } - return false; - } - - @Override - public boolean canBeUntapped(Permanent permanent, Ability source, Game game) { - return false; - } - - @Override - public RustTickRestrictionEffect copy() { - return new RustTickRestrictionEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SeachromeCoast.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SeachromeCoast.java index 2aca41fbcf8..6f98e8a9366 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SeachromeCoast.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SeachromeCoast.java @@ -25,21 +25,20 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.Condition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.common.FilterLandPermanent; /** @@ -50,18 +49,21 @@ public class SeachromeCoast extends CardImpl { private static FilterLandPermanent filter = new FilterLandPermanent(); - public SeachromeCoast (UUID ownerId) { + public SeachromeCoast(UUID ownerId) { super(ownerId, 229, "Seachrome Coast", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; - Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 4)); + // Seachrome Coast enters the battlefield tapped unless you control two or fewer other lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 3)); String abilityText = "tap it unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + + // {T}: Add {W} or {U} to your mana pool. this.addAbility(new WhiteManaAbility()); this.addAbility(new BlueManaAbility()); } - public SeachromeCoast (final SeachromeCoast card) { + public SeachromeCoast(final SeachromeCoast card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ShapeAnew.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ShapeAnew.java index cef5f23b882..c42e48fa8e1 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ShapeAnew.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ShapeAnew.java @@ -25,13 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.SacrificeTargetEffect; @@ -39,7 +35,9 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -60,16 +58,19 @@ public class ShapeAnew extends CardImpl { filter.add(new CardTypePredicate(CardType.ARTIFACT)); } - public ShapeAnew (UUID ownerId) { + public ShapeAnew(UUID ownerId) { super(ownerId, 43, "Shape Anew", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}"); this.expansionSetCode = "SOM"; - this.getSpellAbility().addEffect(new SacrificeTargetEffect()); + // The controller of target artifact sacrifices it, then reveals cards from the top + // of his or her library until he or she reveals an artifact card. That player puts + // that card onto the battlefield, then shuffles all other cards revealed this way into his or her library. + this.getSpellAbility().addEffect(new SacrificeTargetEffect("The controller of target artifact sacrifices it")); this.getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellAbility().addEffect(new ShapeAnewEffect()); } - public ShapeAnew (final ShapeAnew card) { + public ShapeAnew(final ShapeAnew card) { super(card); } @@ -82,7 +83,7 @@ public class ShapeAnew extends CardImpl { public ShapeAnewEffect() { super(Outcome.PutCardInPlay); - staticText = "Then reveals cards from the top of his or her library until he or she reveals an artifact card. That player puts that card onto the battlefield, then shuffles all other cards revealed this way into his or her library"; + staticText = ", then reveals cards from the top of his or her library until he or she reveals an artifact card. That player puts that card onto the battlefield, then shuffles all other cards revealed this way into his or her library"; } public ShapeAnewEffect(ShapeAnewEffect effect) { @@ -102,9 +103,9 @@ public class ShapeAnew extends CardImpl { Cards revealed = new CardsImpl(); Card artifactCard = null; Cards nonArtifactCards = new CardsImpl(); - Player player = game.getPlayer(sourcePermanent.getControllerId()); - while (artifactCard == null && player.getLibrary().size() > 0) { - Card card = player.getLibrary().removeFromTop(game); + Player targetController = game.getPlayer(sourcePermanent.getControllerId()); + while (artifactCard == null && targetController.getLibrary().size() > 0) { + Card card = targetController.getLibrary().removeFromTop(game); revealed.add(card); if (card.getCardType().contains(CardType.ARTIFACT)) { artifactCard = card; @@ -112,14 +113,12 @@ public class ShapeAnew extends CardImpl { nonArtifactCards.add(card); } } - player.revealCards("Shape Anew", revealed, game); + targetController.revealCards(sourcePermanent.getIdName(), revealed, game); if (artifactCard != null) { - artifactCard.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId()); + targetController.moveCards(artifactCard, Zone.BATTLEFIELD, source, game); } - for (Card cardToMove: nonArtifactCards.getCards(game)) { - cardToMove.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - player.shuffleLibrary(game); + targetController.putCardsOnTopOfLibrary(nonArtifactCards, game, source, false); + targetController.shuffleLibrary(game); return true; } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TunnelIgnus.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TunnelIgnus.java index 0b2216e27f9..806759e787d 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TunnelIgnus.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TunnelIgnus.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.HashMap; @@ -76,7 +75,8 @@ public class TunnelIgnus extends CardImpl { } class TunnelIgnusWatcher extends Watcher { - protected Map counts = new HashMap(); + + protected Map counts = new HashMap<>(); public TunnelIgnusWatcher() { super("LandPlayedCount", WatcherScope.PLAYER); @@ -84,7 +84,7 @@ class TunnelIgnusWatcher extends Watcher { public TunnelIgnusWatcher(final TunnelIgnusWatcher watcher) { super(watcher); - for (Entry entry: watcher.counts.entrySet()) { + for (Entry entry : watcher.counts.entrySet()) { counts.put(entry.getKey(), entry.getValue()); } } @@ -116,6 +116,7 @@ class TunnelIgnusWatcher extends Watcher { } class TunnelIgnusTriggeredAbility extends TriggeredAbilityImpl { + TunnelIgnusTriggeredAbility() { super(Zone.BATTLEFIELD, new DamageTargetEffect(3)); } @@ -153,4 +154,4 @@ class TunnelIgnusTriggeredAbility extends TriggeredAbilityImpl { public String getRule() { return "Whenever a land enters the battlefield under an opponent's control, if that player had another land enter the battlefield under his or her control this turn, {this} deals 3 damage to that player."; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TurnAside.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TurnAside.java index f6f9cb5c4c9..a878638f92d 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TurnAside.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TurnAside.java @@ -28,40 +28,35 @@ package mage.sets.scarsofmirrodin; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.abilities.Ability; +import java.util.UUID; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; -import mage.constants.Zone; -import mage.filter.Filter; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.FilterSpell; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.stack.Spell; -import mage.game.stack.StackObject; -import mage.target.TargetObject; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.other.TargetsPermanentPredicate; +import mage.target.TargetSpell; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; -import mage.target.Target; /** * @author ayratn */ public class TurnAside extends CardImpl { - private static FilterSpell filter = new FilterSpell("spell that targets a permanent you control"); + private final static FilterSpell filter = new FilterSpell("spell that targets a permanent you control"); + + static { + filter.add(new TargetsPermanentPredicate(new FilterControlledPermanent())); + } public TurnAside(UUID ownerId) { super(ownerId, 49, "Turn Aside", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); this.expansionSetCode = "SOM"; - // Counter target spell that targets a permanent you control. this.getSpellAbility().addEffect(new CounterTargetEffect()); - this.getSpellAbility().addTarget(new CustomTargetSpell(filter)); + this.getSpellAbility().addTarget(new TargetSpell(filter)); } public TurnAside(final TurnAside card) { @@ -72,109 +67,4 @@ public class TurnAside extends CardImpl { public TurnAside copy() { return new TurnAside(this); } - - private class CustomTargetSpell extends TargetObject { - - protected FilterSpell filter; - - public CustomTargetSpell() { - this(1, 1, new FilterSpell()); - } - - public CustomTargetSpell(FilterSpell filter) { - this(1, 1, filter); - } - - public CustomTargetSpell(int numTargets, FilterSpell filter) { - this(numTargets, numTargets, filter); - } - - public CustomTargetSpell(int minNumTargets, int maxNumTargets, FilterSpell filter) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Zone.STACK; - this.filter = filter; - this.targetName = filter.getMessage(); - } - - public CustomTargetSpell(final CustomTargetSpell target) { - super(target); - this.filter = target.filter.copy(); - } - - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - return canChoose(sourceControllerId, game); - } - - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - return possibleTargets(sourceControllerId, game); - } - - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - if (super.canTarget(id, source, game)) { - if (targetsMyPermanent(id, source.getControllerId(), game)) { - return true; - } - } - return false; - } - - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - int count = 0; - for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match((Spell) stackObject, game)) { - if (targetsMyPermanent(stackObject.getId(), sourceControllerId, game)) { - count++; - if (count >= this.minNumberOfTargets) - return true; - } - } - } - return false; - } - - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match((Spell) stackObject, game)) { - if (targetsMyPermanent(stackObject.getId(), sourceControllerId, game)) { - - possibleTargets.add(stackObject.getId()); - } - } - } - return possibleTargets; - } - - @Override - public Filter getFilter() { - return filter; - } - - private boolean targetsMyPermanent(UUID id, UUID controllerId, Game game) { - StackObject spell = game.getStack().getStackObject(id); - if (spell != null) { - Ability ability = spell.getStackAbility(); - for (Target target : ability.getTargets()) { - for (UUID permanentId : target.getTargets()) { - Permanent permanent = game.getPermanent(permanentId); - if (permanent != null && permanent.getControllerId().equals(controllerId)) { - return true; - } - } - } - } - return false; - } - - @Override - public CustomTargetSpell copy() { - return new CustomTargetSpell(this); - } - } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java index 2f4def3ecfd..b3d27b48775 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java @@ -32,7 +32,7 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; @@ -40,7 +40,6 @@ import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.ReturnFromExileEffect; import mage.abilities.effects.common.combat.CantBeBlockedAllEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -48,7 +47,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.FilterSpell; import mage.filter.common.FilterCreaturePermanent; @@ -80,7 +78,7 @@ public class VenserTheSojourner extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Venser"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +2: Exile target permanent you own. Return it to the battlefield under your control at the beginning of the next end step. LoyaltyAbility ability1 = new LoyaltyAbility(new VenserTheSojournerEffect(), 2); diff --git a/Mage.Sets/src/mage/sets/scourge/AcceleratedMutation.java b/Mage.Sets/src/mage/sets/scourge/AcceleratedMutation.java new file mode 100644 index 00000000000..297a2b16752 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/AcceleratedMutation.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; + +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.HighestConvertedManaCostValue; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author nigelzor + */ +public class AcceleratedMutation extends CardImpl { + + public AcceleratedMutation(UUID ownerId) { + super(ownerId, 109, "Accelerated Mutation", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{G}{G}"); + this.expansionSetCode = "SCG"; + + // Target creature gets +X/+X until end of turn, where X is the highest converted mana cost among permanents you control. + DynamicValue amount = new HighestConvertedManaCostValue(); + this.getSpellAbility().addEffect(new BoostTargetEffect(amount, amount, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public AcceleratedMutation(final AcceleratedMutation card) { + super(card); + } + + @Override + public AcceleratedMutation copy() { + return new AcceleratedMutation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/AvenFarseer.java b/Mage.Sets/src/mage/sets/scourge/AvenFarseer.java new file mode 100644 index 00000000000..b4c80304688 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/AvenFarseer.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.TurnedFaceUpAllTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; + +/** + * + * @author LoneFox + */ +public class AvenFarseer extends CardImpl { + + public AvenFarseer(UUID ownerId) { + super(ownerId, 3, "Aven Farseer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Whenever a permanent is turned face up, put a +1/+1 counter on Aven Farseer. + this.addAbility(new TurnedFaceUpAllTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new FilterPermanent("a permanent"))); + } + + public AvenFarseer(final AvenFarseer card) { + super(card); + } + + @Override + public AvenFarseer copy() { + return new AvenFarseer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/CabalConditioning.java b/Mage.Sets/src/mage/sets/scourge/CabalConditioning.java new file mode 100644 index 00000000000..4bb0d6dedc2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/CabalConditioning.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; + +import mage.abilities.dynamicvalue.common.HighestConvertedManaCostValue; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author nigelzor + */ +public class CabalConditioning extends CardImpl { + + public CabalConditioning(UUID ownerId) { + super(ownerId, 56, "Cabal Conditioning", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{6}{B}"); + this.expansionSetCode = "SCG"; + + // Any number of target players each discard a number of cards equal to the highest converted mana cost among permanents you control. + this.getSpellAbility().addEffect(new DiscardTargetEffect(new HighestConvertedManaCostValue())); + this.getSpellAbility().addTarget(new TargetPlayer(0, Integer.MAX_VALUE, false)); + } + + public CabalConditioning(final CabalConditioning card) { + super(card); + } + + @Override + public CabalConditioning copy() { + return new CabalConditioning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/CoastWatcher.java b/Mage.Sets/src/mage/sets/scourge/CoastWatcher.java new file mode 100644 index 00000000000..3f188798384 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/CoastWatcher.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class CoastWatcher extends CardImpl { + + private static final FilterCard filter = new FilterCard("green"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public CoastWatcher(UUID ownerId) { + super(ownerId, 30, "Coast Watcher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // protection from green + this.addAbility(new ProtectionAbility(filter)); + } + + public CoastWatcher(final CoastWatcher card) { + super(card); + } + + @Override + public CoastWatcher copy() { + return new CoastWatcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/DayOfTheDragons.java b/Mage.Sets/src/mage/sets/scourge/DayOfTheDragons.java index 4c442ac3611..3f3303be3c5 100644 --- a/Mage.Sets/src/mage/sets/scourge/DayOfTheDragons.java +++ b/Mage.Sets/src/mage/sets/scourge/DayOfTheDragons.java @@ -27,18 +27,21 @@ */ package mage.sets.scourge; +import java.util.HashSet; +import java.util.Set; import java.util.UUID; - -import mage.constants.*; -import mage.MageInt; -import mage.ObjectColor; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -46,7 +49,10 @@ import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.ExileZone; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.Token; +import mage.game.permanent.PermanentToken; +import mage.game.permanent.token.DragonToken2; +import mage.players.Player; +import mage.util.CardUtil; /** * @@ -58,7 +64,6 @@ public class DayOfTheDragons extends CardImpl { super(ownerId, 31, "Day of the Dragons", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{U}{U}{U}"); this.expansionSetCode = "SCG"; - // When Day of the Dragons enters the battlefield, exile all creatures you control. Then put that many 5/5 red Dragon creature tokens with flying onto the battlefield. this.addAbility(new EntersBattlefieldTriggeredAbility(new DayOfTheDragonsEntersEffect(), false)); @@ -96,18 +101,17 @@ class DayOfTheDragonsEntersEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - UUID exileId = source.getSourceId(); - int creaturesExiled = 0; - if (exileId != null) { - for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { - if (creature != null) { - if (creature.moveToExile(exileId, "Day of the Dragons", source.getSourceId(), game)) { - creaturesExiled++; - } - } + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + Set toExile = new HashSet<>(); + toExile.addAll(game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)); + if (!toExile.isEmpty()) { + UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); + controller.moveCardsToExile(toExile, source, game, true, exileId, sourceObject.getIdName()); + DragonToken2 token = new DragonToken2(); + token.putOntoBattlefield(toExile.size(), game, source.getSourceId(), source.getControllerId()); } - DragonToken token = new DragonToken(); - token.putOntoBattlefield(creaturesExiled, game, source.getSourceId(), source.getControllerId()); return true; } return false; @@ -139,20 +143,22 @@ class DayOfTheDragonsLeavesEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - UUID exileId = source.getSourceId(); - for (Permanent dragon : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { - if (dragon != null) { - dragon.sacrifice(source.getSourceId(), game); + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null) { + for (Permanent dragon : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + if (dragon != null) { + dragon.sacrifice(source.getSourceId(), game); + } } - } - ExileZone exile = game.getExile().getExileZone(exileId); - if (exile != null) { - exile = exile.copy(); - for (UUID cardId : exile) { - Card card = game.getCard(cardId); - card.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), source.getControllerId()); + int zoneChangeCounter = source.getSourceObjectZoneChangeCounter(); + if (zoneChangeCounter > 0 && !(sourceObject instanceof PermanentToken)) { + zoneChangeCounter--; + } + ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter)); + if (exile != null) { + controller.moveCards(exile, Zone.BATTLEFIELD, source, game); } - game.getExile().getExileZone(exileId).clear(); return true; } return false; @@ -163,16 +169,3 @@ class DayOfTheDragonsLeavesEffect extends OneShotEffect { return new DayOfTheDragonsLeavesEffect(this); } } - -class DragonToken extends Token { - - public DragonToken() { - super("Dragon", "5/5 red Dragon creature token with flying"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add("Dragon"); - power = new MageInt(5); - toughness = new MageInt(5); - addAbility(FlyingAbility.getInstance()); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scourge/DispersalShield.java b/Mage.Sets/src/mage/sets/scourge/DispersalShield.java new file mode 100644 index 00000000000..d35c015d0f0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/DispersalShield.java @@ -0,0 +1,95 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.HighestConvertedManaCostValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.target.TargetSpell; + +/** + * + * @author nigelzor + */ +public class DispersalShield extends CardImpl { + + public DispersalShield(UUID ownerId) { + super(ownerId, 33, "Dispersal Shield", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "SCG"; + + // Counter target spell if its converted mana cost is less than or equal to the highest converted mana cost among permanents you control. + this.getSpellAbility().addEffect(new DispersalShieldEffect()); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + public DispersalShield(final DispersalShield card) { + super(card); + } + + @Override + public DispersalShield copy() { + return new DispersalShield(this); + } +} + +class DispersalShieldEffect extends OneShotEffect { + + public DispersalShieldEffect() { + super(Outcome.Detriment); + staticText = "Counter target spell if its converted mana cost is less than or equal to the highest converted mana cost among permanents you control"; + } + + public DispersalShieldEffect(DispersalShieldEffect effect) { + super(effect); + } + + @Override + public Effect copy() { + return new DispersalShieldEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + DynamicValue amount = new HighestConvertedManaCostValue(); + Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); + if (spell != null && spell.getConvertedManaCost() <= amount.calculate(game, source, this)) { + return game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/DragonBreath.java b/Mage.Sets/src/mage/sets/scourge/DragonBreath.java new file mode 100644 index 00000000000..5b4c0d988c4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/DragonBreath.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; + +/** + * + * @author emerald000 + */ +public class DragonBreath extends mage.sets.archenemy.DragonBreath { + + public DragonBreath(UUID ownerId) { + super(ownerId); + this.cardNumber = 86; + this.expansionSetCode = "SCG"; + } + + public DragonBreath(final DragonBreath card) { + super(card); + } + + @Override + public DragonBreath copy() { + return new DragonBreath(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/DragonTyrant.java b/Mage.Sets/src/mage/sets/scourge/DragonTyrant.java new file mode 100644 index 00000000000..a38f487903e --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/DragonTyrant.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class DragonTyrant extends CardImpl { + + public DragonTyrant(UUID ownerId) { + super(ownerId, 88, "Dragon Tyrant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{8}{R}{R}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Dragon"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Double strike + this.addAbility(DoubleStrikeAbility.getInstance()); + // At the beginning of your upkeep, sacrifice Dragon Tyrant unless you pay {R}{R}{R}{R}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{R}{R}{R}{R}")), TargetController.YOU, false)); + // {R}: Dragon Tyrant gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public DragonTyrant(final DragonTyrant card) { + super(card); + } + + @Override + public DragonTyrant copy() { + return new DragonTyrant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/FatalMutation.java b/Mage.Sets/src/mage/sets/scourge/FatalMutation.java new file mode 100644 index 00000000000..65205011891 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/FatalMutation.java @@ -0,0 +1,115 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FatalMutation extends CardImpl { + + public FatalMutation(UUID ownerId) { + super(ownerId, 66, "Fatal Mutation", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // When enchanted creature is turned face up, destroy it. It can't be regenerated. + this.addAbility(new FatalMutationAbility(new DestroyAttachedEffect("it", true))); + } + + public FatalMutation(final FatalMutation card) { + super(card); + } + + @Override + public FatalMutation copy() { + return new FatalMutation(this); + } +} + +class FatalMutationAbility extends TriggeredAbilityImpl { + + public FatalMutationAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect, false); + } + + public FatalMutationAbility(final FatalMutationAbility ability) { + super(ability); + } + + @Override + public FatalMutationAbility copy() { + return new FatalMutationAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.TURNEDFACEUP; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent attachment = game.getPermanent(this.getSourceId()); + if(attachment != null && event.getTargetId().equals(attachment.getAttachedTo())) { + return true; + } + return false; + + } + + @Override + public String getRule() { + return "Whenever enchanted creature is turned face up, " + super.getRule(); + } + +} + diff --git a/Mage.Sets/src/mage/sets/scourge/FinalPunishment.java b/Mage.Sets/src/mage/sets/scourge/FinalPunishment.java new file mode 100644 index 00000000000..6fe0446b51b --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/FinalPunishment.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.Game; +import mage.target.TargetPlayer; +import mage.watchers.common.AmountOfDamageAPlayerReceivedThisTurnWatcher; + +/** + * + * @author LoneFox + */ +public class FinalPunishment extends CardImpl { + + public FinalPunishment(UUID ownerId) { + super(ownerId, 67, "Final Punishment", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); + this.expansionSetCode = "SCG"; + + // Target player loses life equal to the damage already dealt to him or her this turn. + Effect effect = new LoseLifeTargetEffect(new FinalPunishmentAmount()); + effect.setText("target player loses life equal to the damage already dealt to him or her this turn"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addWatcher(new AmountOfDamageAPlayerReceivedThisTurnWatcher()); + } + + public FinalPunishment(final FinalPunishment card) { + super(card); + } + + @Override + public FinalPunishment copy() { + return new FinalPunishment(this); + } +} + +class FinalPunishmentAmount implements DynamicValue { + + @Override + public int calculate(Game game, Ability source, Effect effect) { + AmountOfDamageAPlayerReceivedThisTurnWatcher watcher + = (AmountOfDamageAPlayerReceivedThisTurnWatcher) game.getState().getWatchers().get("AmountOfDamageReceivedThisTurn"); + if(watcher != null) { + return watcher.getAmountOfDamageReceivedThisTurn(source.getFirstTarget()); + } + return 0; + } + + @Override + public FinalPunishmentAmount copy() { + return new FinalPunishmentAmount(); + } + + @Override + public String getMessage() { + return "the damage already dealt to him or her this turn"; + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/ForgottenAncient.java b/Mage.Sets/src/mage/sets/scourge/ForgottenAncient.java new file mode 100644 index 00000000000..b6ad87f8e20 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/ForgottenAncient.java @@ -0,0 +1,158 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.ArrayList; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SpellCastAllTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Blinke + */ +public class ForgottenAncient extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); + static { + filter.add(new AnotherPredicate()); + } + + public ForgottenAncient(UUID ownerId) { + super(ownerId, 120, "Forgotten Ancient", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Elemental"); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Whenever a player casts a spell, you may put a +1/+1 counter on Forgotten Ancient. + Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance()); + Ability ability = new SpellCastAllTriggeredAbility(effect, true); + this.addAbility(ability); + + // At the beginning of your upkeep, you may move any number of +1/+1 counters from Forgotten Ancient onto other creatures. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new ForgottenAncientEffect(), TargetController.YOU, true)); + } + + public ForgottenAncient(final ForgottenAncient card) { + super(card); + } + + @Override + public ForgottenAncient copy() { + return new ForgottenAncient(this); + } + + class CounterMovement { + public UUID target; + public int counters; + } + + class ForgottenAncientEffect extends OneShotEffect { + + public ForgottenAncientEffect() { + super(Outcome.Benefit); + this.staticText = "you may move any number of +1/+1 counters from {this} onto other creatures."; + } + + public ForgottenAncientEffect(final ForgottenAncientEffect effect) { + super(effect); + } + + @Override + public ForgottenAncientEffect copy() { + return new ForgottenAncientEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + + if(controller == null || sourcePermanent == null) { + return false; + } + + int numCounters = sourcePermanent.getCounters().getCount(CounterType.P1P1); + ArrayList counterMovements = new ArrayList<>(); + + do { + Target target = new TargetCreaturePermanent(1, 1, filter, true); + if(numCounters == 0 || !target.choose(Outcome.Benefit, source.getControllerId(), source.getSourceId(), game)) { + continue; + } + + int amountToMove = controller.getAmount(0, numCounters, "How many counters do you want to move? " + "(" + numCounters + ")" + " counters remaining.", game); + if(amountToMove > 0) + { + boolean previouslyChosen = false; + for (CounterMovement cm : counterMovements) { + if(cm.target.equals(target.getFirstTarget())) + { + cm.counters += amountToMove; + previouslyChosen = true; + } + } + if(!previouslyChosen) { + CounterMovement cm = new CounterMovement(); + cm.target = target.getFirstTarget(); + cm.counters = amountToMove; + counterMovements.add(cm); + } + + numCounters -= amountToMove; + } + } while(numCounters > 0 && controller.chooseUse(Outcome.Benefit, "Move additonal counters?", source, game)); + + //Move all the counters for each chosen creature + for(CounterMovement cm: counterMovements) { + sourcePermanent.removeCounters(CounterType.P1P1.createInstance(cm.counters), game); + game.getPermanent(cm.target).addCounters(CounterType.P1P1.createInstance(cm.counters), game); + } + return true; + } + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/FrozenSolid.java b/Mage.Sets/src/mage/sets/scourge/FrozenSolid.java new file mode 100644 index 00000000000..b90cf27b90b --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/FrozenSolid.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class FrozenSolid extends mage.sets.coldsnap.FrozenSolid { + + public FrozenSolid(UUID ownerId) { + super(ownerId); + this.cardNumber = 36; + this.expansionSetCode = "SCG"; + } + + public FrozenSolid(final FrozenSolid card) { + super(card); + } + + @Override + public FrozenSolid copy() { + return new FrozenSolid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/GoblinWarchief.java b/Mage.Sets/src/mage/sets/scourge/GoblinWarchief.java index 0d62d55ccd7..298f2be5c4a 100644 --- a/Mage.Sets/src/mage/sets/scourge/GoblinWarchief.java +++ b/Mage.Sets/src/mage/sets/scourge/GoblinWarchief.java @@ -60,6 +60,7 @@ public class GoblinWarchief extends CardImpl { super(ownerId, 97, "Goblin Warchief", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); this.expansionSetCode = "SCG"; this.subtype.add("Goblin"); + this.subtype.add("Warrior"); this.power = new MageInt(2); this.toughness = new MageInt(2); diff --git a/Mage.Sets/src/mage/sets/scourge/HuntingPack.java b/Mage.Sets/src/mage/sets/scourge/HuntingPack.java index f099f4f25fb..81e75636f1f 100644 --- a/Mage.Sets/src/mage/sets/scourge/HuntingPack.java +++ b/Mage.Sets/src/mage/sets/scourge/HuntingPack.java @@ -30,12 +30,10 @@ package mage.sets.scourge; import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; -import mage.MageInt; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.StormAbility; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; - +import mage.game.permanent.token.BeastToken2; /** * @@ -47,9 +45,8 @@ public class HuntingPack extends CardImpl { super(ownerId, 121, "Hunting Pack", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{5}{G}{G}"); this.expansionSetCode = "SCG"; - // Put a 4/4 green Beast creature token onto the battlefield. - this.getSpellAbility().addEffect(new CreateTokenEffect(new HuntingPackToken(), 1)); + this.getSpellAbility().addEffect(new CreateTokenEffect(new BeastToken2(), 1)); // Storm this.addAbility(new StormAbility()); } @@ -63,15 +60,3 @@ public class HuntingPack extends CardImpl { return new HuntingPack(this); } } - -class HuntingPackToken extends Token { - - public HuntingPackToken() { - super("Beast", "4/4 green Beast creature token"); - cardType.add(CardType.CREATURE); - subtype.add("Beast"); - this.color.setGreen(true); - power = new MageInt(4); - toughness = new MageInt(4); - } -} diff --git a/Mage.Sets/src/mage/sets/scourge/PemminsAura.java b/Mage.Sets/src/mage/sets/scourge/PemminsAura.java new file mode 100644 index 00000000000..82fb31f25e7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/PemminsAura.java @@ -0,0 +1,144 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.UntapEnchantedEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class PemminsAura extends CardImpl { + + public PemminsAura(UUID ownerId) { + super(ownerId, 45, "Pemmin's Aura", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // {U}: Untap enchanted creature. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapEnchantedEffect(), new ManaCostsImpl("{U}"))); + + // {U}: Enchanted creature gains flying until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), + AttachmentType.AURA, Duration.EndOfTurn), new ManaCostsImpl("{U}"))); + + // {U}: Enchanted creature gains shroud until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), + AttachmentType.AURA, Duration.EndOfTurn), new ManaCostsImpl("{U}"))); + + // {1}: Enchanted creature gets +1/-1 or -1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PemminsAuraBoostEnchantedEffect(), new ManaCostsImpl("U"))); + } + + public PemminsAura(final PemminsAura card) { + super(card); + } + + @Override + public PemminsAura copy() { + return new PemminsAura(this); + } +} + +class PemminsAuraBoostEnchantedEffect extends OneShotEffect { + + private static String CHOICE_1 = "+1/-1"; + private static String CHOICE_2 = "-1/+1"; + + public PemminsAuraBoostEnchantedEffect() { + super(Outcome.BoostCreature); + this.staticText = "Enchanted creature gets +1/-1 or -1/+1 until end of turn"; + } + + public PemminsAuraBoostEnchantedEffect(final PemminsAuraBoostEnchantedEffect effect) { + super(effect); + } + + @Override + public PemminsAuraBoostEnchantedEffect copy() { + return new PemminsAuraBoostEnchantedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent enchantment = game.getPermanent(source.getSourceId()); + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (controller != null && creature != null) { + Choice choice = new ChoiceImpl(true); + choice.setMessage("Select how to boost"); + choice.getChoices().add(CHOICE_1); + choice.getChoices().add(CHOICE_2); + while (!choice.isChosen()) { + if (!controller.canRespond()) { + return false; + } + controller.choose(outcome, choice, game); + } + if (choice.getChoice().equals(CHOICE_1)) { + game.addEffect(new BoostEnchantedEffect(+1, -1, Duration.EndOfTurn), source); + } else { + game.addEffect(new BoostEnchantedEffect(-1, +1, Duration.EndOfTurn), source); + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scourge/PutridRaptor.java b/Mage.Sets/src/mage/sets/scourge/PutridRaptor.java new file mode 100644 index 00000000000..1efb8f7687e --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/PutridRaptor.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class PutridRaptor extends CardImpl { + + private static final FilterCard filter = new FilterCard("a Zombie card"); + + static { + filter.add(new SubtypePredicate("Zombie")); + } + + public PutridRaptor(UUID ownerId) { + super(ownerId, 71, "Putrid Raptor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Zombie"); + this.subtype.add("Lizard"); + this.subtype.add("Beast"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Morph-Discard a Zombie card. + this.addAbility(new MorphAbility(this, new DiscardCardCost(filter))); + } + + public PutridRaptor(final PutridRaptor card) { + super(card); + } + + @Override + public PutridRaptor copy() { + return new PutridRaptor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/RavenGuildMaster.java b/Mage.Sets/src/mage/sets/scourge/RavenGuildMaster.java new file mode 100644 index 00000000000..e6c35248d15 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/RavenGuildMaster.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ExileCardsFromTopOfLibraryTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class RavenGuildMaster extends CardImpl { + + public RavenGuildMaster(UUID ownerId) { + super(ownerId, 47, "Raven Guild Master", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.subtype.add("Mutant"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Raven Guild Master deals combat damage to a player, that player exiles the top ten cards of his or her library. + this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new ExileCardsFromTopOfLibraryTargetEffect(10, "that player"), false, true)); + + // Morph {2}{U}{U} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{U}{U}"))); + } + + public RavenGuildMaster(final RavenGuildMaster card) { + super(card); + } + + @Override + public RavenGuildMaster copy() { + return new RavenGuildMaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/RewardTheFaithful.java b/Mage.Sets/src/mage/sets/scourge/RewardTheFaithful.java new file mode 100644 index 00000000000..93d1b92440b --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/RewardTheFaithful.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; + +import mage.abilities.dynamicvalue.common.HighestConvertedManaCostValue; +import mage.abilities.effects.common.GainLifeTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author nigelzor + */ +public class RewardTheFaithful extends CardImpl { + + public RewardTheFaithful(UUID ownerId) { + super(ownerId, 22, "Reward the Faithful", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "SCG"; + + // Any number of target players each gain life equal to the highest converted mana cost among permanents you control. + this.getSpellAbility().addEffect(new GainLifeTargetEffect(new HighestConvertedManaCostValue())); + this.getSpellAbility().addTarget(new TargetPlayer(0, Integer.MAX_VALUE, false)); + } + + public RewardTheFaithful(final RewardTheFaithful card) { + super(card); + } + + @Override + public RewardTheFaithful copy() { + return new RewardTheFaithful(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/RootElemental.java b/Mage.Sets/src/mage/sets/scourge/RootElemental.java new file mode 100644 index 00000000000..46d93c2732c --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/RootElemental.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; + +/** + * + * @author LoneFox + */ +public class RootElemental extends CardImpl { + + public RootElemental(UUID ownerId) { + super(ownerId, 127, "Root Elemental", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Elemental"); + this.power = new MageInt(6); + this.toughness = new MageInt(5); + + // Morph {5}{G}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{5}{G}{G}"))); + // When Root Elemental is turned face up, you may put a creature card from your hand onto the battlefield. + this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new PutPermanentOnBattlefieldEffect(new FilterCreatureCard("a creature card")))); + } + + public RootElemental(final RootElemental card) { + super(card); + } + + @Override + public RootElemental copy() { + return new RootElemental(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/ScornfulEgotist.java b/Mage.Sets/src/mage/sets/scourge/ScornfulEgotist.java new file mode 100644 index 00000000000..f5957b2a372 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/ScornfulEgotist.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ScornfulEgotist extends CardImpl { + + public ScornfulEgotist(UUID ownerId) { + super(ownerId, 50, "Scornful Egotist", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{7}{U}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Morph {U} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{U}"))); + } + + public ScornfulEgotist(final ScornfulEgotist card) { + super(card); + } + + @Override + public ScornfulEgotist copy() { + return new ScornfulEgotist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/SkirkVolcanist.java b/Mage.Sets/src/mage/sets/scourge/SkirkVolcanist.java new file mode 100644 index 00000000000..383c25f0006 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/SkirkVolcanist.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageMultiEffect; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanentAmount; + +/** + * + * @author fireshoes + */ +public class SkirkVolcanist extends CardImpl { + + private static final FilterControlledLandPermanent filterSacrifice = new FilterControlledLandPermanent("two Mountains"); + + static { + filterSacrifice.add(new SubtypePredicate("Mountain")); + } + + public SkirkVolcanist(UUID ownerId) { + super(ownerId, 104, "Skirk Volcanist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Goblin"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Morph-Sacrifice two Mountains. + this.addAbility(new MorphAbility(this, new SacrificeTargetCost(new TargetControlledPermanent(2,2, filterSacrifice, false)))); + + // When Skirk Volcanist is turned face up, it deals 3 damage divided as you choose among one, two, or three target creatures. + Effect effect = new DamageMultiEffect(3); + effect.setText("it deals 3 damage divided as you choose among one, two, or three target creatures"); + Ability ability = new TurnedFaceUpSourceTriggeredAbility(effect); + ability.addTarget(new TargetCreaturePermanentAmount(3)); + this.addAbility(ability); + } + + public SkirkVolcanist(final SkirkVolcanist card) { + super(card); + } + + @Override + public SkirkVolcanist copy() { + return new SkirkVolcanist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/TitanicBulvox.java b/Mage.Sets/src/mage/sets/scourge/TitanicBulvox.java new file mode 100644 index 00000000000..aab3a38e808 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/TitanicBulvox.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TitanicBulvox extends CardImpl { + + public TitanicBulvox(UUID ownerId) { + super(ownerId, 129, "Titanic Bulvox", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{6}{G}{G}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Beast"); + this.power = new MageInt(7); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Morph {4}{G}{G}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{4}{G}{G}{G}"))); + } + + public TitanicBulvox(final TitanicBulvox card) { + super(card); + } + + @Override + public TitanicBulvox copy() { + return new TitanicBulvox(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/TorrentOfFire.java b/Mage.Sets/src/mage/sets/scourge/TorrentOfFire.java new file mode 100644 index 00000000000..6d6cda15ed3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/TorrentOfFire.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; + +import mage.abilities.dynamicvalue.common.HighestConvertedManaCostValue; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author nigelzor + */ +public class TorrentOfFire extends CardImpl { + + public TorrentOfFire(UUID ownerId) { + super(ownerId, 107, "Torrent of Fire", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "SCG"; + + // Torrent of Fire deals damage equal to the highest converted mana cost among permanents you control to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(new HighestConvertedManaCostValue())); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public TorrentOfFire(final TorrentOfFire card) { + super(card); + } + + @Override + public TorrentOfFire copy() { + return new TorrentOfFire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/UncontrolledInfestation.java b/Mage.Sets/src/mage/sets/scourge/UncontrolledInfestation.java new file mode 100644 index 00000000000..6f51b0716af --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/UncontrolledInfestation.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BecomesTappedAttachedTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class UncontrolledInfestation extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("nonbasic land"); + + static{ + filter.add(Predicates.not(new SupertypePredicate("Basic"))); + } + + public UncontrolledInfestation(UUID ownerId) { + super(ownerId, 108, "Uncontrolled Infestation", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Aura"); + + // Enchant nonbasic land + TargetPermanent auraTarget = new TargetLandPermanent(filter); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // When enchanted land becomes tapped, destroy it. + this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DestroyAttachedEffect("it"), "enchanted land")); + } + + public UncontrolledInfestation(final UncontrolledInfestation card) { + super(card); + } + + @Override + public UncontrolledInfestation copy() { + return new UncontrolledInfestation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/VengefulDead.java b/Mage.Sets/src/mage/sets/scourge/VengefulDead.java new file mode 100644 index 00000000000..702ee27ee90 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/VengefulDead.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author fireshoes + */ +public class VengefulDead extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("{this} or another Zombie"); + + static { + filter.add(new SubtypePredicate("Zombie")); + } + + public VengefulDead(UUID ownerId) { + super(ownerId, 80, "Vengeful Dead", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Zombie"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever Vengeful Dead or another Zombie dies, each opponent loses 1 life. + this.addAbility(new DiesThisOrAnotherCreatureTriggeredAbility(new LoseLifeOpponentsEffect(1), false, filter)); + } + + public VengefulDead(final VengefulDead card) { + super(card); + } + + @Override + public VengefulDead copy() { + return new VengefulDead(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/WirewoodSymbiote.java b/Mage.Sets/src/mage/sets/scourge/WirewoodSymbiote.java index 8bc500b1c35..3c676c3bdb7 100644 --- a/Mage.Sets/src/mage/sets/scourge/WirewoodSymbiote.java +++ b/Mage.Sets/src/mage/sets/scourge/WirewoodSymbiote.java @@ -34,7 +34,7 @@ import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.UntapTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; @@ -63,7 +63,7 @@ public class WirewoodSymbiote extends CardImpl { this.toughness = new MageInt(1); // Return an Elf you control to its owner's hand: Untap target creature. Activate this ability only once each turn. - Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/scourge/Woodcloaker.java b/Mage.Sets/src/mage/sets/scourge/Woodcloaker.java new file mode 100644 index 00000000000..0fc2a523f84 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/Woodcloaker.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.MorphAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; + +/** + * + * @author LoneFox + */ +public class Woodcloaker extends CardImpl { + + public Woodcloaker(UUID ownerId) { + super(ownerId, 134, "Woodcloaker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{G}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Elf"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Morph {2}{G}{G} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{G}{G}"))); + // When Woodcloaker is turned face up, target creature gains trample until end of turn. + Ability ability = new TurnedFaceUpSourceTriggeredAbility(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public Woodcloaker(final Woodcloaker card) { + super(card); + } + + @Override + public Woodcloaker copy() { + return new Woodcloaker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/ZealousInquisitor.java b/Mage.Sets/src/mage/sets/scourge/ZealousInquisitor.java new file mode 100644 index 00000000000..bc7954686e4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/ZealousInquisitor.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ZealousInquisitor extends mage.sets.ninthedition.ZealousInquisitor { + + public ZealousInquisitor(UUID ownerId) { + super(ownerId); + this.cardNumber = 27; + this.expansionSetCode = "SCG"; + this.rarity = Rarity.COMMON; + } + + public ZealousInquisitor(final ZealousInquisitor card) { + super(card); + } + + @Override + public ZealousInquisitor copy() { + return new ZealousInquisitor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/ZombieCutthroat.java b/Mage.Sets/src/mage/sets/scourge/ZombieCutthroat.java new file mode 100644 index 00000000000..df1c6374f4b --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/ZombieCutthroat.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZombieCutthroat extends CardImpl { + + public ZombieCutthroat(UUID ownerId) { + super(ownerId, 81, "Zombie Cutthroat", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Zombie"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Morph-Pay 5 life. + this.addAbility(new MorphAbility(this, new PayLifeCost(5))); + } + + public ZombieCutthroat(final ZombieCutthroat card) { + super(card); + } + + @Override + public ZombieCutthroat copy() { + return new ZombieCutthroat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/seventhedition/CityOfBrass.java b/Mage.Sets/src/mage/sets/seventhedition/CityOfBrass.java index 6071037d519..35bb06cb880 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/CityOfBrass.java +++ b/Mage.Sets/src/mage/sets/seventhedition/CityOfBrass.java @@ -30,7 +30,7 @@ package mage.sets.seventhedition; import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; -import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; import mage.abilities.effects.common.DamageControllerEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.cards.CardImpl; @@ -46,7 +46,7 @@ public class CityOfBrass extends CardImpl { this.expansionSetCode = "7ED"; // Whenever City of Brass becomes tapped, it deals 1 damage to you. - this.addAbility(new BecomesTappedTriggeredAbility(new DamageControllerEffect(1))); + this.addAbility(new BecomesTappedSourceTriggeredAbility(new DamageControllerEffect(1))); // {tap}: Add one mana of any color to your mana pool. this.addAbility(new AnyColorManaAbility()); diff --git a/Mage.Sets/src/mage/sets/seventhedition/Compost.java b/Mage.Sets/src/mage/sets/seventhedition/Compost.java index 2b1b44ee3c8..feaf9284a64 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/Compost.java +++ b/Mage.Sets/src/mage/sets/seventhedition/Compost.java @@ -54,10 +54,9 @@ public class Compost extends CardImpl { super(ownerId, 235, "Compost", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); this.expansionSetCode = "7ED"; - // Whenever a black card is put into an opponent's graveyard from anywhere, you may draw a card. this.addAbility(new PutCardIntoGraveFromAnywhereAllTriggeredAbility( - new DrawCardSourceControllerEffect(1), true, TargetController.OPPONENT)); + new DrawCardSourceControllerEffect(1), true, filter, TargetController.OPPONENT)); } public Compost(final Compost card) { diff --git a/Mage.Sets/src/mage/sets/seventhedition/FinalFortune.java b/Mage.Sets/src/mage/sets/seventhedition/FinalFortune.java index 14f568597d3..128b12bccd5 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/FinalFortune.java +++ b/Mage.Sets/src/mage/sets/seventhedition/FinalFortune.java @@ -28,19 +28,10 @@ package mage.sets.seventhedition; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.turn.TurnMod; -import mage.players.Player; /** * @@ -52,9 +43,8 @@ public class FinalFortune extends CardImpl { super(ownerId, 182, "Final Fortune", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{R}{R}"); this.expansionSetCode = "7ED"; - // Take an extra turn after this one. At the beginning of that turn's end step, you lose the game. - this.getSpellAbility().addEffect(new FinalFortuneEffect()); + this.getSpellAbility().addEffect(new AddExtraTurnControllerEffect(true)); } public FinalFortune(final FinalFortune card) { @@ -66,103 +56,3 @@ public class FinalFortune extends CardImpl { return new FinalFortune(this); } } - -class FinalFortuneEffect extends OneShotEffect { - - public FinalFortuneEffect() { - super(Outcome.AIDontUseIt); - this.staticText = "Take an extra turn after this one. At the beginning of that turn's end step, you lose the game."; - } - - public FinalFortuneEffect(final FinalFortuneEffect effect) { - super(effect); - } - - @Override - public FinalFortuneEffect copy() { - return new FinalFortuneEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - // Take an extra turn after this one - TurnMod extraTurn = new TurnMod(source.getControllerId(), false); - game.getState().getTurnMods().add(extraTurn); - - FinalFortuneLoseDelayedTriggeredAbility delayedTriggeredAbility = new FinalFortuneLoseDelayedTriggeredAbility(); - delayedTriggeredAbility.setSourceId(source.getSourceId()); - delayedTriggeredAbility.setControllerId(source.getControllerId()); - delayedTriggeredAbility.setConnectedTurnMod(extraTurn.getId()); - game.addDelayedTriggeredAbility(delayedTriggeredAbility); - - return true; - } - -} - -class FinalFortuneLoseDelayedTriggeredAbility extends DelayedTriggeredAbility { - - private UUID connectedTurnMod; - - public FinalFortuneLoseDelayedTriggeredAbility() { - super(new FinalFortuneLoseEffect(), Duration.EndOfGame); - } - - public FinalFortuneLoseDelayedTriggeredAbility(final FinalFortuneLoseDelayedTriggeredAbility ability) { - super(ability); - this.connectedTurnMod = ability.connectedTurnMod; - } - - @Override - public FinalFortuneLoseDelayedTriggeredAbility copy() { - return new FinalFortuneLoseDelayedTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.END_TURN_STEP_PRE; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return connectedTurnMod != null && connectedTurnMod.equals(game.getState().getTurnId()); - } - - public void setConnectedTurnMod(UUID connectedTurnMod) { - this.connectedTurnMod = connectedTurnMod; - } - - @Override - public String getRule() { - return "At the beginning of that turn's end step, you lose the game"; - } - -} - -class FinalFortuneLoseEffect extends OneShotEffect { - - public FinalFortuneLoseEffect() { - super(Outcome.Detriment); - this.staticText = "You lose the game"; - } - - public FinalFortuneLoseEffect(final FinalFortuneLoseEffect effect) { - super(effect); - } - - @Override - public FinalFortuneLoseEffect copy() { - return new FinalFortuneLoseEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.lost(game); - return true; - } - return false; - } - -} diff --git a/Mage.Sets/src/mage/sets/seventhedition/Thoughtleech.java b/Mage.Sets/src/mage/sets/seventhedition/Thoughtleech.java index 2354dc80e48..1650ce93e7e 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/Thoughtleech.java +++ b/Mage.Sets/src/mage/sets/seventhedition/Thoughtleech.java @@ -28,16 +28,15 @@ package mage.sets.seventhedition; import java.util.UUID; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BecomesTappedTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent.EventType; -import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -46,12 +45,19 @@ import mage.game.permanent.Permanent; */ public class Thoughtleech extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent("an Island an opponent controls"); + + static { + filter.add(new SubtypePredicate("Island")); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + public Thoughtleech(UUID ownerId) { super(ownerId, 274, "Thoughtleech", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}{G}"); this.expansionSetCode = "7ED"; // Whenever an Island an opponent controls becomes tapped, you may gain 1 life. - this.addAbility(new ThoughtleechTriggeredAbility()); + this.addAbility(new BecomesTappedTriggeredAbility(new GainLifeEffect(1), true, filter)); } public Thoughtleech(final Thoughtleech card) { @@ -63,39 +69,3 @@ public class Thoughtleech extends CardImpl { return new Thoughtleech(this); } } - -class ThoughtleechTriggeredAbility extends TriggeredAbilityImpl { - - ThoughtleechTriggeredAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } - - ThoughtleechTriggeredAbility(final ThoughtleechTriggeredAbility ability) { - super(ability); - } - - @Override - public ThoughtleechTriggeredAbility copy() { - return new ThoughtleechTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent p = game.getPermanent(event.getTargetId()); - if(p != null && p.getSubtype().contains("Island")) { - if(game.getOpponents(this.controllerId).contains(p.getControllerId())) - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever an Island an opponent controls becomes tapped, " + modes.getText(); - } -} diff --git a/Mage.Sets/src/mage/sets/seventhedition/WallOfWonder.java b/Mage.Sets/src/mage/sets/seventhedition/WallOfWonder.java index 8626e9783a1..bf3c94bce28 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/WallOfWonder.java +++ b/Mage.Sets/src/mage/sets/seventhedition/WallOfWonder.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; @@ -60,7 +60,7 @@ public class WallOfWonder extends CardImpl { // {2}{U}{U}: Wall of Wonder gets +4/-4 until end of turn and can attack this turn as though it didn't have defender. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(4, -4, Duration.EndOfTurn), new ManaCostsImpl("{2}{U}{U}")); - ability.addEffect(new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.EndOfTurn)); + ability.addEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/AEthertow.java b/Mage.Sets/src/mage/sets/shadowmoor/AEthertow.java index 2e384acbeb9..14e313f4a57 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/AEthertow.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/AEthertow.java @@ -58,7 +58,7 @@ public class AEthertow extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); // Conspire - this.addAbility(new ConspireAbility(this)); + this.addAbility(new ConspireAbility(getId(), ConspireAbility.ConspireTargets.ONE)); } public AEthertow(final AEthertow card) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/AphoticWisps.java b/Mage.Sets/src/mage/sets/shadowmoor/AphoticWisps.java index 20096cb783e..588154614b0 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/AphoticWisps.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/AphoticWisps.java @@ -25,20 +25,19 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.shadowmoor; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.ObjectColor; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.FearAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.target.common.TargetCreaturePermanent; /** @@ -47,19 +46,25 @@ import mage.target.common.TargetCreaturePermanent; */ public class AphoticWisps extends CardImpl { - public AphoticWisps (UUID ownerId) { + public AphoticWisps(UUID ownerId) { super(ownerId, 55, "Aphotic Wisps", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}"); this.expansionSetCode = "SHM"; - // Target creature becomes black and gains fear until end of turn. (It can't be blocked except by artifact creatures and/or black creatures.) + // Target creature becomes black and gains fear until end of turn. (It can't be blocked except by artifact creatures and/or black creatures.) this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FearAbility.getInstance(), Duration.EndOfTurn)); + Effect effect = new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.EndOfTurn); + effect.setText("Target creature becomes black"); + this.getSpellAbility().addEffect(effect); + effect = new GainAbilityTargetEffect(FearAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains fear until end of turn"); + this.getSpellAbility().addEffect(effect); // Draw a card. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + effect = new DrawCardSourceControllerEffect(1); + effect.setText("
Draw a card"); + this.getSpellAbility().addEffect(effect); } - public AphoticWisps (final AphoticWisps card) { + public AphoticWisps(final AphoticWisps card) { super(card); } @@ -69,4 +74,3 @@ public class AphoticWisps extends CardImpl { } } - diff --git a/Mage.Sets/src/mage/sets/shadowmoor/BarkshellBlessing.java b/Mage.Sets/src/mage/sets/shadowmoor/BarkshellBlessing.java index 7916a18bfec..db328a78993 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/BarkshellBlessing.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/BarkshellBlessing.java @@ -41,7 +41,7 @@ import mage.target.common.TargetCreaturePermanent; * @author jeffwadsworth */ public class BarkshellBlessing extends CardImpl { - + public BarkshellBlessing(UUID ownerId) { super(ownerId, 224, "Barkshell Blessing", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G/W}"); this.expansionSetCode = "SHM"; @@ -51,13 +51,13 @@ public class BarkshellBlessing extends CardImpl { this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); // Conspire - this.addAbility(new ConspireAbility(this)); + this.addAbility(new ConspireAbility(getId(), ConspireAbility.ConspireTargets.ONE)); } - + public BarkshellBlessing(final BarkshellBlessing card) { super(card); } - + @Override public BarkshellBlessing copy() { return new BarkshellBlessing(this); diff --git a/Mage.Sets/src/mage/sets/shadowmoor/BurnTrail.java b/Mage.Sets/src/mage/sets/shadowmoor/BurnTrail.java index 0e4a193204d..1a0e264ca32 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/BurnTrail.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/BurnTrail.java @@ -48,9 +48,9 @@ public class BurnTrail extends CardImpl { // Burn Trail deals 3 damage to target creature or player. this.getSpellAbility().addEffect(new DamageTargetEffect(3)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - + // Conspire - this.addAbility(new ConspireAbility(this)); + this.addAbility(new ConspireAbility(getId(), ConspireAbility.ConspireTargets.ONE)); } public BurnTrail(final BurnTrail card) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/CemeteryPuca.java b/Mage.Sets/src/mage/sets/shadowmoor/CemeteryPuca.java index e3bc6c33655..f97b818c753 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/CemeteryPuca.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/CemeteryPuca.java @@ -99,7 +99,7 @@ class CemeteryPucaEffect extends OneShotEffect { if (copyToCreature != null) { Permanent copyFromCreature = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.BATTLEFIELD); if (copyFromCreature != null) { - game.copyPermanent(Duration.WhileOnBattlefield, copyFromCreature, copyToCreature, source, new EmptyApplyToPermanent()); + game.copyPermanent(Duration.WhileOnBattlefield, copyFromCreature, copyToCreature.getId(), source, new EmptyApplyToPermanent()); ContinuousEffect effect = new GainAbilityTargetEffect(new DiesCreatureTriggeredAbility(new DoIfCostPaid(new CemeteryPucaEffect(), new ManaCostsImpl("{1}")), false, new FilterCreaturePermanent("a creature"), true), Duration.WhileOnBattlefield); effect.setTargetPointer(new FixedTarget(copyToCreature.getId())); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/sets/shadowmoor/DemigodOfRevenge.java b/Mage.Sets/src/mage/sets/shadowmoor/DemigodOfRevenge.java index e64a220bb48..73181fa222e 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/DemigodOfRevenge.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/DemigodOfRevenge.java @@ -30,11 +30,10 @@ package mage.sets.shadowmoor; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CastSourceTriggeredAbility; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.HasteAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -43,8 +42,6 @@ import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.NamePredicate; import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.players.Player; /** @@ -64,10 +61,12 @@ public class DemigodOfRevenge extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); + // Haste this.addAbility(HasteAbility.getInstance()); + // When you cast Demigod of Revenge, return all cards named Demigod of Revenge from your graveyard to the battlefield. - this.addAbility(new DemigodOfRevengeTriggeredAbility()); + this.addAbility(new CastSourceTriggeredAbility(new DemigodOfRevengeReturnEffect())); } public DemigodOfRevenge(final DemigodOfRevenge card) { @@ -80,40 +79,10 @@ public class DemigodOfRevenge extends CardImpl { } } -class DemigodOfRevengeTriggeredAbility extends TriggeredAbilityImpl { - - public DemigodOfRevengeTriggeredAbility() { - super(Zone.STACK, new DemigodOfRevengeReturnEffect(), false); - } - - public DemigodOfRevengeTriggeredAbility(final DemigodOfRevengeTriggeredAbility ability) { - super(ability); - } - - @Override - public DemigodOfRevengeTriggeredAbility copy() { - return new DemigodOfRevengeTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return event.getSourceId().equals(this.getSourceId()); - } - - @Override - public String getRule() { - return "When you cast {this}, " + super.getRule(); - } -} - class DemigodOfRevengeReturnEffect extends OneShotEffect { private static final FilterCard filter = new FilterCard(); + static { filter.add(new NamePredicate("Demigod of Revenge")); } @@ -136,10 +105,7 @@ class DemigodOfRevengeReturnEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (Card creature : controller.getGraveyard().getCards(filter, game)) { - creature.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId()); - } - return true; + return controller.moveCards(controller.getGraveyard().getCards(filter, game), Zone.BATTLEFIELD, source, game); } return false; } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/DisturbingPlot.java b/Mage.Sets/src/mage/sets/shadowmoor/DisturbingPlot.java index 5e22bf9f40f..9d7cf445939 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/DisturbingPlot.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/DisturbingPlot.java @@ -51,7 +51,7 @@ public class DisturbingPlot extends CardImpl { this.getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard"))); // Conspire - this.addAbility(new ConspireAbility(this)); + this.addAbility(new ConspireAbility(getId(), ConspireAbility.ConspireTargets.ONE)); } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/DrownerInitiate.java b/Mage.Sets/src/mage/sets/shadowmoor/DrownerInitiate.java index e2c04a54d62..67b9eda3099 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/DrownerInitiate.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/DrownerInitiate.java @@ -45,12 +45,12 @@ import mage.target.TargetPlayer; /** * * @author jeffwadsworth - + * */ public class DrownerInitiate extends CardImpl { - + private static final FilterSpell filter = new FilterSpell("a blue spell"); - + static { filter.add(new ColorPredicate(ObjectColor.BLUE)); } @@ -65,10 +65,10 @@ public class DrownerInitiate extends CardImpl { this.toughness = new MageInt(1); // Whenever a player casts a blue spell, you may pay {1}. If you do, target player puts the top two cards of his or her library into his or her graveyard. - Ability ability = new SpellCastAllTriggeredAbility(new DoIfCostPaid(new PutLibraryIntoGraveTargetEffect(2), new ManaCostsImpl("{1}")), filter, true); + Ability ability = new SpellCastAllTriggeredAbility(new DoIfCostPaid(new PutLibraryIntoGraveTargetEffect(2), new ManaCostsImpl("{1}")), filter, false); ability.addTarget(new TargetPlayer()); this.addAbility(ability); - + } public DrownerInitiate(final DrownerInitiate card) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ElementalMastery.java b/Mage.Sets/src/mage/sets/shadowmoor/ElementalMastery.java index 7d06f996307..13c125f5bfc 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ElementalMastery.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ElementalMastery.java @@ -30,7 +30,6 @@ package mage.sets.shadowmoor; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; @@ -65,7 +64,6 @@ public class ElementalMastery extends CardImpl { this.expansionSetCode = "SHM"; this.subtype.add("Aura"); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -110,16 +108,17 @@ class ElementalMasteryEffect extends OneShotEffect { Permanent creatureAttached = game.getPermanent(source.getSourceId()); if (creatureAttached != null) { int power = creatureAttached.getPower().getValue(); - for (int i = 0; i < power; i++) { + if (power > 0) { ElementalToken token = new ElementalToken(); - token.putOntoBattlefield(1, game, creatureAttached.getId(), creatureAttached.getControllerId()); - ExileTargetEffect exileEffect = new ExileTargetEffect("exile the token"); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + token.putOntoBattlefield(power, game, creatureAttached.getId(), creatureAttached.getControllerId()); + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source); + } + } } return true; } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ElsewhereFlask.java b/Mage.Sets/src/mage/sets/shadowmoor/ElsewhereFlask.java index ae8d945447e..b370c7dc878 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ElsewhereFlask.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ElsewhereFlask.java @@ -27,7 +27,6 @@ */ package mage.sets.shadowmoor; -import java.util.Set; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -42,7 +41,8 @@ import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.choices.ChoiceImpl; +import mage.choices.Choice; +import mage.choices.ChoiceBasicLandType; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -103,15 +103,9 @@ class ElsewhereFlaskEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - ChoiceImpl choices = new ChoiceImpl(true); - Set choicesSet = choices.getChoices(); - choicesSet.add("Forest"); - choicesSet.add("Plains"); - choicesSet.add("Mountain"); - choicesSet.add("Island"); - choicesSet.add("Swamp"); - if (player.choose(Outcome.Neutral, choices, game)) { - game.getState().setValue(source.getSourceId().toString() + "_ElsewhereFlask", choices.getChoice()); + Choice choice = new ChoiceBasicLandType(); + if (player.choose(Outcome.Neutral, choice, game)) { + game.getState().setValue(source.getSourceId().toString() + "_ElsewhereFlask", choice.getChoice()); } game.addEffect(new ElsewhereFlaskContinuousEffect(), source); return true; diff --git a/Mage.Sets/src/mage/sets/shadowmoor/EnchantedEvening.java b/Mage.Sets/src/mage/sets/shadowmoor/EnchantedEvening.java index f90471ad704..5c81a272512 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/EnchantedEvening.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/EnchantedEvening.java @@ -34,6 +34,7 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; @@ -54,7 +55,6 @@ public class EnchantedEvening extends CardImpl { super(ownerId, 140, "Enchanted Evening", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W/U}{W/U}"); this.expansionSetCode = "SHM"; - // All permanents are enchantments in addition to their other types. Effect effect = new EnchangedEveningEffect(CardType.ENCHANTMENT, Duration.WhileOnBattlefield, new FilterPermanent()); effect.setText("All permanents are enchantments in addition to their other types"); @@ -70,37 +70,39 @@ public class EnchantedEvening extends CardImpl { public EnchantedEvening copy() { return new EnchantedEvening(this); } -} -class EnchangedEveningEffect extends ContinuousEffectImpl { + // need to be enclosed class for dependent check of continuous effects + class EnchangedEveningEffect extends ContinuousEffectImpl { - private final CardType addedCardType; - private final FilterPermanent filter; + private final CardType addedCardType; + private final FilterPermanent filter; - public EnchangedEveningEffect(CardType addedCardType, Duration duration, FilterPermanent filter) { - super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); - this.addedCardType = addedCardType; - this.filter = filter; - } - - public EnchangedEveningEffect(final EnchangedEveningEffect effect) { - super(effect); - this.addedCardType = effect.addedCardType; - this.filter = effect.filter; - } - - @Override - public boolean apply(Game game, Ability source) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) { - if (permanent != null && !permanent.getCardType().contains(addedCardType)) { - permanent.getCardType().add(addedCardType); - } + public EnchangedEveningEffect(CardType addedCardType, Duration duration, FilterPermanent filter) { + super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); + this.addedCardType = addedCardType; + this.filter = filter; + this.dependencyTypes.add(DependencyType.EnchantmentAddingRemoving); } - return true; - } - @Override - public EnchangedEveningEffect copy() { - return new EnchangedEveningEffect(this); + public EnchangedEveningEffect(final EnchangedEveningEffect effect) { + super(effect); + this.addedCardType = effect.addedCardType; + this.filter = effect.filter; + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) { + if (permanent != null && !permanent.getCardType().contains(addedCardType)) { + permanent.getCardType().add(addedCardType); + } + } + return true; + } + + @Override + public EnchangedEveningEffect copy() { + return new EnchangedEveningEffect(this); + } } } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/FateTransfer.java b/Mage.Sets/src/mage/sets/shadowmoor/FateTransfer.java index dcfe9b5a38b..811237a3b48 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/FateTransfer.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/FateTransfer.java @@ -53,7 +53,6 @@ public class FateTransfer extends CardImpl { super(ownerId, 161, "Fate Transfer", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U/B}"); this.expansionSetCode = "SHM"; - // Move all counters from target creature onto another target creature. this.getSpellAbility().addEffect(new FateTransferEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); @@ -96,9 +95,8 @@ class FateTransferEffect extends OneShotEffect { && creatureToMoveCountersTo != null) { Permanent copyCreature = creatureToMoveCountersFrom.copy(); for (Counter counter : copyCreature.getCounters().values()) { - Counter newCounterTest = new Counter(counter.getName(), counter.getCount()); - creatureToMoveCountersFrom.removeCounters(newCounterTest, game); - creatureToMoveCountersTo.addCounters(newCounterTest, game); + creatureToMoveCountersFrom.removeCounters(counter, game); + creatureToMoveCountersTo.addCounters(counter, game); } return true; } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/FlourishingDefenses.java b/Mage.Sets/src/mage/sets/shadowmoor/FlourishingDefenses.java index 43423eb386c..c18b7e9d8e5 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/FlourishingDefenses.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/FlourishingDefenses.java @@ -51,7 +51,6 @@ public class FlourishingDefenses extends CardImpl { super(ownerId, 114, "Flourishing Defenses", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{4}{G}"); this.expansionSetCode = "SHM"; - // Whenever a -1/-1 counter is placed on a creature, you may put a 1/1 green Elf Warrior creature token onto the battlefield. this.addAbility(new FlourishingDefensesTriggeredAbility()); @@ -91,7 +90,7 @@ class FlourishingDefensesTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getData().equals(CounterType.M1M1.getName())) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (permanent.getCardType().contains(CardType.CREATURE)) { + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { return true; } } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/GhastlyDiscovery.java b/Mage.Sets/src/mage/sets/shadowmoor/GhastlyDiscovery.java index 2b317197e3b..2ba3dd8d915 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/GhastlyDiscovery.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/GhastlyDiscovery.java @@ -52,7 +52,7 @@ public class GhastlyDiscovery extends CardImpl { this.getSpellAbility().addEffect(new GhastlyDiscoveryEffect()); // Conspire - this.addAbility(new ConspireAbility(this)); + this.addAbility(new ConspireAbility(getId(), ConspireAbility.ConspireTargets.NONE)); } public GhastlyDiscovery(final GhastlyDiscovery card) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/Giantbaiting.java b/Mage.Sets/src/mage/sets/shadowmoor/Giantbaiting.java index 43ca95f1ffa..38482fdf379 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/Giantbaiting.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/Giantbaiting.java @@ -30,7 +30,6 @@ package mage.sets.shadowmoor; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileTargetEffect; @@ -41,6 +40,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.target.targetpointer.FixedTarget; @@ -58,7 +58,7 @@ public class Giantbaiting extends CardImpl { this.getSpellAbility().addEffect(new GiantbaitingEffect()); // Conspire - this.addAbility(new ConspireAbility(this)); + this.addAbility(new ConspireAbility(getId(), ConspireAbility.ConspireTargets.NONE)); } @@ -92,13 +92,14 @@ class GiantbaitingEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Token token = new GiantWarriorToken(); if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) { - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source); + } + } return true; } return false; diff --git a/Mage.Sets/src/mage/sets/shadowmoor/GlamerSpinners.java b/Mage.Sets/src/mage/sets/shadowmoor/GlamerSpinners.java index e94e6b2e98e..1f031527630 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/GlamerSpinners.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/GlamerSpinners.java @@ -126,7 +126,8 @@ class GlamerSpinnersEffect extends OneShotEffect { LinkedList auras = new LinkedList<>(); auras.addAll(targetPermanent.getAttachments()); - if (controller.choose(Outcome.Neutral, chosenPermanentToAttachAuras, source.getSourceId(), game)) { + if (chosenPermanentToAttachAuras.canChoose(source.getSourceId(), source.getControllerId(), game) + && controller.choose(Outcome.Neutral, chosenPermanentToAttachAuras, source.getSourceId(), game)) { Permanent permanentToAttachAuras = game.getPermanent(chosenPermanentToAttachAuras.getFirstTarget()); if (permanentToAttachAuras != null) { for (UUID auraId : auras) { @@ -163,7 +164,7 @@ class GlamerSpinnersEffect extends OneShotEffect { } return true; } - + return false; } } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/GleefulSabotage.java b/Mage.Sets/src/mage/sets/shadowmoor/GleefulSabotage.java index 16869be8383..faf02584055 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/GleefulSabotage.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/GleefulSabotage.java @@ -49,9 +49,9 @@ public class GleefulSabotage extends CardImpl { // Destroy target artifact or enchantment. this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent())); - + // Conspire - this.addAbility(new ConspireAbility(this)); + this.addAbility(new ConspireAbility(getId(), ConspireAbility.ConspireTargets.ONE)); } public GleefulSabotage(final GleefulSabotage card) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/GloomwidowsFeast.java b/Mage.Sets/src/mage/sets/shadowmoor/GloomwidowsFeast.java index f2b8a590bef..018b0eebfd0 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/GloomwidowsFeast.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/GloomwidowsFeast.java @@ -1,126 +1,111 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.keyword.FlyingAbility; -import mage.abilities.keyword.ReachAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.AbilityPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.Token; -import mage.target.TargetPermanent; - -/** - * - * @author jeffwadsworth - */ -public class GloomwidowsFeast extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target creature with flying"); - - static { - filter.add(new AbilityPredicate(FlyingAbility.class)); - } - - public GloomwidowsFeast(UUID ownerId) { - super(ownerId, 118, "Gloomwidow's Feast", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{G}"); - this.expansionSetCode = "SHM"; - - - // Destroy target creature with flying. If that creature was blue or black, put a 1/2 green Spider creature token with reach onto the battlefield. - this.getSpellAbility().addEffect(new GloomwidowsFeastEffect()); - this.getSpellAbility().addTarget(new TargetPermanent(filter)); - - } - - public GloomwidowsFeast(final GloomwidowsFeast card) { - super(card); - } - - @Override - public GloomwidowsFeast copy() { - return new GloomwidowsFeast(this); - } -} - -class GloomwidowsFeastEffect extends OneShotEffect { - - boolean applied = false; - - public GloomwidowsFeastEffect() { - super(Outcome.DestroyPermanent); - this.staticText = "Destroy target creature with flying. If that creature was blue or black, put a 1/2 green Spider creature token with reach onto the battlefield"; - } - - public GloomwidowsFeastEffect(final GloomwidowsFeastEffect effect) { - super(effect); - } - - @Override - public GloomwidowsFeastEffect copy() { - return new GloomwidowsFeastEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent targetCreature = game.getPermanent(source.getFirstTarget()); - if (targetCreature != null) { - targetCreature.destroy(source.getSourceId(), game, false); - Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); - if (destroyedCreature.getColor(game).isBlue() - || destroyedCreature.getColor(game).isBlack()) { - SpiderToken token = new SpiderToken(); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - return true; - } - } - return false; - } -} - -class SpiderToken extends Token { - - public SpiderToken() { - super("Spider", "1/2 green Spider creature token with reach"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Spider"); - power = new MageInt(1); - toughness = new MageInt(2); - addAbility(ReachAbility.getInstance()); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.SpiderToken; +import mage.target.TargetPermanent; + +/** + * + * @author jeffwadsworth + */ +public class GloomwidowsFeast extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target creature with flying"); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public GloomwidowsFeast(UUID ownerId) { + super(ownerId, 118, "Gloomwidow's Feast", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{G}"); + this.expansionSetCode = "SHM"; + + + // Destroy target creature with flying. If that creature was blue or black, put a 1/2 green Spider creature token with reach onto the battlefield. + this.getSpellAbility().addEffect(new GloomwidowsFeastEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + + } + + public GloomwidowsFeast(final GloomwidowsFeast card) { + super(card); + } + + @Override + public GloomwidowsFeast copy() { + return new GloomwidowsFeast(this); + } +} + +class GloomwidowsFeastEffect extends OneShotEffect { + + boolean applied = false; + + public GloomwidowsFeastEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Destroy target creature with flying. If that creature was blue or black, put a 1/2 green Spider creature token with reach onto the battlefield"; + } + + public GloomwidowsFeastEffect(final GloomwidowsFeastEffect effect) { + super(effect); + } + + @Override + public GloomwidowsFeastEffect copy() { + return new GloomwidowsFeastEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent targetCreature = game.getPermanent(source.getFirstTarget()); + if (targetCreature != null) { + targetCreature.destroy(source.getSourceId(), game, false); + Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); + if (destroyedCreature.getColor(game).isBlue() + || destroyedCreature.getColor(game).isBlack()) { + SpiderToken token = new SpiderToken(); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ImpromptuRaid.java b/Mage.Sets/src/mage/sets/shadowmoor/ImpromptuRaid.java index 95e71547286..de9ede0bc2d 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ImpromptuRaid.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ImpromptuRaid.java @@ -52,6 +52,7 @@ import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -116,17 +117,20 @@ class ImpromptuRaidEffect extends OneShotEffect { controller.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); return true; } - if (controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId())) { - ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); - effect.setTargetPointer(new FixedTarget(card.getId())); - game.addEffect(effect, source); - SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect(); - sacrificeEffect.setTargetPointer(new FixedTarget(card.getId())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { + Permanent permanent = game.getPermanent(card.getId()); + if (permanent != null) { + ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(permanent, game)); + game.addEffect(effect, source); + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("", source.getControllerId()); + sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } return true; } } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/KnacksawClique.java b/Mage.Sets/src/mage/sets/shadowmoor/KnacksawClique.java index 24e5ea3e54c..a0d6be1d305 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/KnacksawClique.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/KnacksawClique.java @@ -29,11 +29,13 @@ package mage.sets.shadowmoor; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.UntapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; @@ -45,14 +47,14 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.players.Library; import mage.players.Player; import mage.target.common.TargetOpponent; -import mage.util.CardUtil; +import mage.target.targetpointer.FixedTarget; /** * * @author jeffwadsworth - */ public class KnacksawClique extends CardImpl { @@ -104,16 +106,17 @@ class KnacksawCliqueEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player opponent = game.getPlayer(source.getFirstTarget()); - if (opponent != null) { - Player you = game.getPlayer(source.getControllerId()); - UUID exileId = CardUtil.getCardExileZoneId(game, source); - Card card = opponent.getLibrary().getFromTop(game); - if (card != null - && you != null) { - card.moveToExile(exileId, "Knacksaw Clique", source.getSourceId(), game); - if (card.getSpellAbility() != null) { - game.addEffect(new KnacksawCliqueCastFromExileEffect(card.getId(), exileId), source); + Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (sourceObject != null && opponent != null) { + if (opponent.getLibrary().size() > 0) { + Library library = opponent.getLibrary(); + Card card = library.getFromTop(game); + if (card != null) { + opponent.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getName(), source.getSourceId(), game, Zone.LIBRARY, true); + ContinuousEffect effect = new KnacksawCliqueCastFromExileEffect(); + effect.setTargetPointer(new FixedTarget(card.getId())); + game.addEffect(effect, source); } } return true; @@ -124,20 +127,13 @@ class KnacksawCliqueEffect extends OneShotEffect { class KnacksawCliqueCastFromExileEffect extends AsThoughEffectImpl { - private final UUID cardId; - private final UUID exileId; - - public KnacksawCliqueCastFromExileEffect(UUID cardId, UUID exileId) { + public KnacksawCliqueCastFromExileEffect() { super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "Until end of turn, you may play that card"; - this.cardId = cardId; - this.exileId = exileId; } public KnacksawCliqueCastFromExileEffect(final KnacksawCliqueCastFromExileEffect effect) { super(effect); - this.cardId = effect.cardId; - this.exileId = effect.exileId; } @Override @@ -152,12 +148,8 @@ class KnacksawCliqueCastFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (sourceId.equals(this.cardId) && source.getControllerId().equals(affectedControllerId)) { - Card card = game.getCard(this.cardId); - if (card != null && game.getState().getExile().getExileZone(exileId).contains(cardId)) { - return true; - } - } - return false; + return source.getControllerId().equals(affectedControllerId) + && sourceId.equals(getTargetPointer().getFirst(game, source)); + } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/LeechBonder.java b/Mage.Sets/src/mage/sets/shadowmoor/LeechBonder.java index 623580db2d0..7e6f922d10d 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/LeechBonder.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/LeechBonder.java @@ -72,7 +72,7 @@ public class LeechBonder extends CardImpl { // Leech Bonder enters the battlefield with two -1/-1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(2)))); - // {U}, {untap}: Move a counter from target creature onto a second target creature. + // {U}, {untap}: Move a counter from target creature onto another target creature. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LeechBonderEffect(), new ManaCostsImpl("{U}")); ability.addCost(new UntapSourceCost()); ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature to remove counter from"))); diff --git a/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java b/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java index fdbce5bbd6d..900fb98760c 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java @@ -1,148 +1,123 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.Mana; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTappedAbility; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.CostImpl; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.mana.SimpleManaAbility; -import mage.cards.CardImpl; -import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.Game; -import mage.players.Player; -import mage.players.Players; - -/** - * - * @author jeffwadsworth - */ -public class LeechriddenSwamp extends CardImpl { - - public LeechriddenSwamp(UUID ownerId) { - super(ownerId, 273, "Leechridden Swamp", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "SHM"; - this.subtype.add("Swamp"); - - // ({tap}: Add {B} to your mana pool.) - this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.BlackMana, new TapSourceCost())); - - // Leechridden Swamp enters the battlefield tapped. - this.addAbility(new EntersBattlefieldTappedAbility()); - - // {B}, {tap}: Each opponent loses 1 life. Activate this ability only if you control two or more black permanents. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LeechriddenSwampLoseLifeEffect(), new ManaCostsImpl("{B}")); - ability.addCost(new TapSourceCost()); - ability.addCost(new ControlTwoOrMoreBlackPermanentsCost()); - this.addAbility(ability); - } - - public LeechriddenSwamp(final LeechriddenSwamp card) { - super(card); - } - - @Override - public LeechriddenSwamp copy() { - return new LeechriddenSwamp(this); - } -} - -class ControlTwoOrMoreBlackPermanentsCost extends CostImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent(); - - static { - filter.add(new ColorPredicate(ObjectColor.BLACK)); - } - - public ControlTwoOrMoreBlackPermanentsCost() { - this.text = "Activate this ability only if you control two or more black permanents"; - } - - public ControlTwoOrMoreBlackPermanentsCost(final ControlTwoOrMoreBlackPermanentsCost cost) { - super(cost); - } - - @Override - public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - return game.getBattlefield().contains(filter, controllerId, 2, game); - } - - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } - - @Override - public ControlTwoOrMoreBlackPermanentsCost copy() { - return new ControlTwoOrMoreBlackPermanentsCost(this); - } -} - -class LeechriddenSwampLoseLifeEffect extends OneShotEffect { - - private static final String effectText = "each opponent loses 1 life"; - - LeechriddenSwampLoseLifeEffect ( ) { - super(Outcome.Damage); - staticText = effectText; - } - - LeechriddenSwampLoseLifeEffect ( LeechriddenSwampLoseLifeEffect effect ) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Players players = game.getPlayers(); - for ( Player player : players.values() ) { - if ( !player.getId().equals(source.getControllerId()) ) { - player.loseLife(1, game); - } - } - return true; - } - - @Override - public LeechriddenSwampLoseLifeEffect copy() { - return new LeechriddenSwampLoseLifeEffect(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.Mana; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.players.Players; + +/** + * + * @author jeffwadsworth + */ +public class LeechriddenSwamp extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control two or more black permanents"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public LeechriddenSwamp(UUID ownerId) { + super(ownerId, 273, "Leechridden Swamp", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "SHM"; + this.subtype.add("Swamp"); + + // ({tap}: Add {B} to your mana pool.) + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.BlackMana, new TapSourceCost())); + + // Leechridden Swamp enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {B}, {tap}: Each opponent loses 1 life. Activate this ability only if you control two or more black permanents. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new LeechriddenSwampLoseLifeEffect(), + new ManaCostsImpl("{B}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public LeechriddenSwamp(final LeechriddenSwamp card) { + super(card); + } + + @Override + public LeechriddenSwamp copy() { + return new LeechriddenSwamp(this); + } +} + +class LeechriddenSwampLoseLifeEffect extends OneShotEffect { + + private static final String effectText = "each opponent loses 1 life"; + + LeechriddenSwampLoseLifeEffect ( ) { + super(Outcome.Damage); + staticText = effectText; + } + + LeechriddenSwampLoseLifeEffect ( LeechriddenSwampLoseLifeEffect effect ) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Players players = game.getPlayers(); + for ( Player player : players.values() ) { + if ( !player.getId().equals(source.getControllerId()) ) { + player.loseLife(1, game); + } + } + return true; + } + + @Override + public LeechriddenSwampLoseLifeEffect copy() { + return new LeechriddenSwampLoseLifeEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/LureboundScarecrow.java b/Mage.Sets/src/mage/sets/shadowmoor/LureboundScarecrow.java index fc6cd8c6cef..ba232975d03 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/LureboundScarecrow.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/LureboundScarecrow.java @@ -30,14 +30,11 @@ package mage.sets.shadowmoor; import java.util.UUID; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.Ability; import mage.abilities.StateTriggeredAbility; import mage.abilities.common.AsEntersBattlefieldAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseColorEffect; import mage.abilities.effects.common.SacrificeSourceEffect; -import mage.cards.Card; import mage.cards.CardImpl; -import mage.choices.ChoiceColor; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -45,8 +42,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; -import mage.game.stack.StackObject; -import mage.players.Player; /** * @@ -63,7 +58,7 @@ public class LureboundScarecrow extends CardImpl { this.toughness = new MageInt(4); // As Lurebound Scarecrow enters the battlefield, choose a color. - this.addAbility(new AsEntersBattlefieldAbility(new LureboundScarecrowChooseColorEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Detriment))); // When you control no permanents of the chosen color, sacrifice Lurebound Scarecrow. this.addAbility(new LureboundScarecrowTriggeredAbility()); @@ -79,40 +74,6 @@ public class LureboundScarecrow extends CardImpl { } } -class LureboundScarecrowChooseColorEffect extends OneShotEffect { - - public LureboundScarecrowChooseColorEffect() { - super(Outcome.BoostCreature); - staticText = "choose a color"; - } - - public LureboundScarecrowChooseColorEffect(final LureboundScarecrowChooseColorEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - StackObject sourceStackObject = game.getStack().getStackObject(source.getSourceId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && sourceStackObject != null && permanent != null) { - ChoiceColor colorChoice = new ChoiceColor(); - if (player.choose(Outcome.BoostCreature, colorChoice, game)) { - game.informPlayers(sourceStackObject.getName() + ": " + player.getLogName() + " has chosen " + colorChoice.getChoice()); - game.getState().setValue(permanent.getId() + "_color", colorChoice.getColor()); - permanent.addInfo("chosen color", new StringBuilder("Chosen color: ").append(colorChoice.getColor().getDescription()).append("").toString(), game); - } - } - return false; - } - - @Override - public LureboundScarecrowChooseColorEffect copy() { - return new LureboundScarecrowChooseColorEffect(this); - } - -} - class LureboundScarecrowTriggeredAbility extends StateTriggeredAbility { private static final String staticText = "When you control no permanents of the chosen color, sacrifice {this}."; @@ -127,20 +88,16 @@ class LureboundScarecrowTriggeredAbility extends StateTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE || event.getType() == GameEvent.EventType.LOST_CONTROL - || event.getType() == GameEvent.EventType.COLOR_CHANGED - || event.getType() == GameEvent.EventType.SPELL_CAST) { - Card card = game.getCard(this.getSourceId()); - if (card != null) { - ObjectColor color = (ObjectColor) game.getState().getValue(card.getId() + "_color"); - if (color != null) { - for (Permanent perm : game.getBattlefield().getAllActivePermanents(controllerId)) { - if (perm.getColor(game).contains(color)) { - return false; - } + Permanent permanent = game.getPermanent(getSourceId()); + if (permanent != null) { + ObjectColor color = (ObjectColor) game.getState().getValue(getSourceId() + "_color"); + if (color != null) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(controllerId)) { + if (perm.getColor(game).contains(color)) { + return false; } - return true; } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MadblindMountain.java b/Mage.Sets/src/mage/sets/shadowmoor/MadblindMountain.java index eb94b65c287..b106cfe9c93 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/MadblindMountain.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/MadblindMountain.java @@ -1,86 +1,89 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTappedAbility; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalActivatedAbility; -import mage.abilities.effects.common.ShuffleLibrarySourceEffect; -import mage.abilities.mana.RedManaAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.ColorPredicate; - -/** - * - * @author jeffwadsworth - */ -public class MadblindMountain extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more red permanents"); - - static { - filter.add(new ColorPredicate(ObjectColor.RED)); - } - - public MadblindMountain(UUID ownerId) { - super(ownerId, 274, "Madblind Mountain", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "SHM"; - this.subtype.add("Mountain"); - - // ({tap}: Add {R} to your mana pool.) - this.addAbility(new RedManaAbility()); - - // Madblind Mountain enters the battlefield tapped. - this.addAbility(new EntersBattlefieldTappedAbility()); - - // {R}, {tap}: Shuffle your library. Activate this ability only if you control two or more red permanents. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new ShuffleLibrarySourceEffect(), new ManaCostsImpl("{R}"), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); - - } - - public MadblindMountain(final MadblindMountain card) { - super(card); - } - - @Override - public MadblindMountain copy() { - return new MadblindMountain(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.ShuffleLibrarySourceEffect; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author jeffwadsworth + */ +public class MadblindMountain extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more red permanents"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public MadblindMountain(UUID ownerId) { + super(ownerId, 274, "Madblind Mountain", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "SHM"; + this.subtype.add("Mountain"); + + // ({tap}: Add {R} to your mana pool.) + this.addAbility(new RedManaAbility()); + + // Madblind Mountain enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {R}, {tap}: Shuffle your library. Activate this ability only if you control two or more red permanents. + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + new ShuffleLibrarySourceEffect(), + new ManaCostsImpl("{R}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + } + + public MadblindMountain(final MadblindMountain card) { + super(card); + } + + @Override + public MadblindMountain copy() { + return new MadblindMountain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ManaforgeCinder.java b/Mage.Sets/src/mage/sets/shadowmoor/ManaforgeCinder.java index c650a49008d..5501ab9aded 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ManaforgeCinder.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ManaforgeCinder.java @@ -114,10 +114,10 @@ class ManaforgeCinderManaEffect extends OneShotEffect { } switch (manaChoice.getChoice()) { case "Black": - mana.addBlack(); + mana.increaseBlack(); break; case "Red": - mana.addRed(); + mana.increaseRed(); break; } controller.getManaPool().addMana(mana, game, source); diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MedicineRunner.java b/Mage.Sets/src/mage/sets/shadowmoor/MedicineRunner.java index 002c393ef77..5c122ca7ae3 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/MedicineRunner.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/MedicineRunner.java @@ -27,29 +27,19 @@ */ package mage.sets.shadowmoor; -import java.util.HashSet; -import java.util.Set; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.RemoveCounterTargetEffect; import mage.cards.CardImpl; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.counters.Counter; -import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.TargetPermanent; /** * - * @author jeffwadsworth using code from LevelX + * @author jeffwadsworth */ public class MedicineRunner extends CardImpl { @@ -77,75 +67,3 @@ public class MedicineRunner extends CardImpl { return new MedicineRunner(this); } } - -class RemoveCounterTargetEffect extends OneShotEffect { - - private CounterType counterTypeToRemove; - - public RemoveCounterTargetEffect() { - super(Outcome.Detriment); - this.staticText = "remove a counter from target permanent"; - } - - public RemoveCounterTargetEffect(CounterType counterTypeToRemove) { - super(Outcome.Detriment); - this.staticText = "remove a " + counterTypeToRemove.getName() + " counter from target permanent"; - this.counterTypeToRemove = counterTypeToRemove; - } - - public RemoveCounterTargetEffect(final RemoveCounterTargetEffect effect) { - super(effect); - this.counterTypeToRemove = effect.counterTypeToRemove; - } - - @Override - public RemoveCounterTargetEffect copy() { - return new RemoveCounterTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - boolean result = false; - Player controller = game.getPlayer(source.getControllerId()); - for (UUID targetId : getTargetPointer().getTargets(game, source)) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null) { - if (permanent.getCounters().size() > 0 && (counterTypeToRemove == null || permanent.getCounters().containsKey(counterTypeToRemove))) { - String counterName = null; - if (counterTypeToRemove != null) { - counterName = counterTypeToRemove.getName(); - } else { - if (permanent.getCounters().size() > 1 && counterTypeToRemove == null) { - Choice choice = new ChoiceImpl(true); - Set choices = new HashSet<>(); - for (Counter counter : permanent.getCounters().values()) { - if (permanent.getCounters().getCount(counter.getName()) > 0) { - choices.add(counter.getName()); - } - } - choice.setChoices(choices); - choice.setMessage("Choose a counter type to remove from " + permanent.getName()); - controller.choose(Outcome.Detriment, choice, game); - counterName = choice.getChoice(); - } else { - for (Counter counter : permanent.getCounters().values()) { - if (counter.getCount() > 0) { - counterName = counter.getName(); - } - } - } - } - if (counterName != null) { - permanent.removeCounters(counterName, 1, game); - if (permanent.getCounters().getCount(counterName) == 0) { - permanent.getCounters().removeCounter(counterName); - } - result |= true; - game.informPlayers(new StringBuilder(controller.getLogName()).append(" removes a ").append(counterName).append(" counter from ").append(permanent.getName()).toString()); - } - } - } - } - return result; - } -} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MemorySluice.java b/Mage.Sets/src/mage/sets/shadowmoor/MemorySluice.java index 61329fd77ad..80c47736dd1 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/MemorySluice.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/MemorySluice.java @@ -48,10 +48,10 @@ public class MemorySluice extends CardImpl { // Target player puts the top four cards of his or her library into his or her graveyard. this.getSpellAbility().addEffect(new PutLibraryIntoGraveTargetEffect(4)); this.getSpellAbility().addTarget(new TargetPlayer()); - + // Conspire - this.addAbility(new ConspireAbility(this)); - + this.addAbility(new ConspireAbility(getId(), ConspireAbility.ConspireTargets.ONE)); + } public MemorySluice(final MemorySluice card) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MineExcavation.java b/Mage.Sets/src/mage/sets/shadowmoor/MineExcavation.java index b26e24c4b13..4b5484404e1 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/MineExcavation.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/MineExcavation.java @@ -43,9 +43,9 @@ import mage.target.common.TargetCardInGraveyard; * @author jeffwadsworth */ public class MineExcavation extends CardImpl { - + private static final FilterCard filter = new FilterCard("artifact or enchantment card in a graveyard"); - + static { filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.ENCHANTMENT))); @@ -58,9 +58,9 @@ public class MineExcavation extends CardImpl { // Return target artifact or enchantment card from a graveyard to its owner's hand. this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); this.getSpellAbility().addTarget(new TargetCardInGraveyard(filter)); - + // Conspire - this.addAbility(new ConspireAbility(this)); + this.addAbility(new ConspireAbility(getId(), ConspireAbility.ConspireTargets.ONE)); } public MineExcavation(final MineExcavation card) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/Mirrorweave.java b/Mage.Sets/src/mage/sets/shadowmoor/Mirrorweave.java index fa2ecb5d7c0..571cf64174a 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/Mirrorweave.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/Mirrorweave.java @@ -61,7 +61,6 @@ public class Mirrorweave extends CardImpl { super(ownerId, 143, "Mirrorweave", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{W/U}{W/U}"); this.expansionSetCode = "SHM"; - // Each other creature becomes a copy of target nonlegendary creature until end of turn. this.getSpellAbility().addEffect(new MirrorWeaveEffect()); this.getSpellAbility().addTarget(new TargetPermanent(filter)); @@ -105,7 +104,7 @@ class MirrorWeaveEffect extends OneShotEffect { filter.add(Predicates.not(new PermanentIdPredicate(copyFromCreature.getId()))); for (Permanent copyToCreature : game.getBattlefield().getAllActivePermanents(filter, game)) { if (copyToCreature != null) { - game.copyPermanent(Duration.EndOfTurn, copyFromCreature, copyToCreature, source, new EmptyApplyToPermanent()); + game.copyPermanent(Duration.EndOfTurn, copyFromCreature, copyToCreature.getId(), source, new EmptyApplyToPermanent()); } } } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MoonringIsland.java b/Mage.Sets/src/mage/sets/shadowmoor/MoonringIsland.java index 4f087d879c2..4dc1458dcbf 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/MoonringIsland.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/MoonringIsland.java @@ -1,88 +1,91 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTappedAbility; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalActivatedAbility; -import mage.abilities.effects.common.LookLibraryTopCardTargetPlayerEffect; -import mage.abilities.mana.BlueManaAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.ColorPredicate; -import mage.target.TargetPlayer; - -/** - * - * @author jeffwadsworth - */ -public class MoonringIsland extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more blue permanents"); - - static { - filter.add(new ColorPredicate(ObjectColor.BLUE)); - } - - public MoonringIsland(UUID ownerId) { - super(ownerId, 276, "Moonring Island", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "SHM"; - this.subtype.add("Island"); - - // ({tap}: Add {U} to your mana pool.) - this.addAbility(new BlueManaAbility()); - - // Moonring Island enters the battlefield tapped. - this.addAbility(new EntersBattlefieldTappedAbility()); - - // {U}, {tap}: Look at the top card of target player's library. Activate this ability only if you control two or more blue permanents. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new LookLibraryTopCardTargetPlayerEffect(), new ManaCostsImpl("{U}"), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetPlayer()); - this.addAbility(ability); - - } - - public MoonringIsland(final MoonringIsland card) { - super(card); - } - - @Override - public MoonringIsland copy() { - return new MoonringIsland(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.LookLibraryTopCardTargetPlayerEffect; +import mage.abilities.mana.BlueManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.TargetPlayer; + +/** + * + * @author jeffwadsworth + */ +public class MoonringIsland extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more blue permanents"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public MoonringIsland(UUID ownerId) { + super(ownerId, 276, "Moonring Island", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "SHM"; + this.subtype.add("Island"); + + // ({tap}: Add {U} to your mana pool.) + this.addAbility(new BlueManaAbility()); + + // Moonring Island enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {U}, {tap}: Look at the top card of target player's library. Activate this ability only if you control two or more blue permanents. + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + new LookLibraryTopCardTargetPlayerEffect(), + new ManaCostsImpl("{U}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + + } + + public MoonringIsland(final MoonringIsland card) { + super(card); + } + + @Override + public MoonringIsland copy() { + return new MoonringIsland(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MossbridgeTroll.java b/Mage.Sets/src/mage/sets/shadowmoor/MossbridgeTroll.java index 539b8f9d3d0..bc44a0a95d4 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/MossbridgeTroll.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/MossbridgeTroll.java @@ -56,7 +56,7 @@ import mage.target.common.TargetControlledCreaturePermanent; * @author jeffwadsworth */ public class MossbridgeTroll extends CardImpl { - + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creatures you control"); static { @@ -78,7 +78,7 @@ public class MossbridgeTroll extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(20, 20, Duration.EndOfTurn), new MossbridgeTrollCost()); ability.setAdditionalCostsRuleVisible(false); this.addAbility(ability); - + } public MossbridgeTroll(final MossbridgeTroll card) { @@ -115,10 +115,11 @@ class MossbridgeTrollReplacementEffect extends ReplacementEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.DESTROY_PERMANENT; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - return event.getTargetId() == source.getSourceId(); + return event.getTargetId() != null + && event.getTargetId().equals(source.getSourceId()); } @Override @@ -150,7 +151,7 @@ class MossbridgeTrollCost extends CostImpl { public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { int sumPower = 0; if (targets.choose(Outcome.Tap, controllerId, sourceId, game)) { - for (UUID targetId: targets.get(0).getTargets()) { + for (UUID targetId : targets.get(0).getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null && permanent.tap(game)) { sumPower += permanent.getPower().getValue(); @@ -165,7 +166,7 @@ class MossbridgeTrollCost extends CostImpl { @Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { int sumPower = 0; - for (Permanent permanent :game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controllerId, game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controllerId, game)) { if (!permanent.getId().equals(sourceId)) { sumPower += permanent.getPower().getValue(); } @@ -178,4 +179,3 @@ class MossbridgeTrollCost extends CostImpl { return new MossbridgeTrollCost(this); } } - diff --git a/Mage.Sets/src/mage/sets/shadowmoor/PaintersServant.java b/Mage.Sets/src/mage/sets/shadowmoor/PaintersServant.java index 10364727e8c..8ec07fbc98f 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/PaintersServant.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/PaintersServant.java @@ -35,10 +35,9 @@ import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseColorEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.choices.ChoiceColor; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -68,7 +67,7 @@ public class PaintersServant extends CardImpl { this.toughness = new MageInt(3); // As Painter's Servant enters the battlefield, choose a color. - this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Detriment))); // All cards that aren't on the battlefield, spells, and permanents are the chosen color in addition to their other colors. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PaintersServantEffect())); @@ -84,40 +83,6 @@ public class PaintersServant extends CardImpl { } } -class ChooseColorEffect extends OneShotEffect { - - public ChooseColorEffect() { - super(Outcome.Detriment); - staticText = "choose a color"; - } - - public ChooseColorEffect(final ChooseColorEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - ChoiceColor colorChoice = new ChoiceColor(); - if (player.choose(Outcome.Neutral, colorChoice, game)) { - game.informPlayers(new StringBuilder(permanent.getName()).append(": ").append(player.getLogName()).append(" has chosen ").append(colorChoice.getChoice()).toString()); - game.getState().setValue(source.getSourceId() + "_color", colorChoice.getColor()); - permanent.addInfo("chosen color", "Chosen color: " + colorChoice.getColor().getDescription() + "", game); - } - return true; - } - return false; - } - - @Override - public ChooseColorEffect copy() { - return new ChooseColorEffect(this); - } - -} - class PaintersServantEffect extends ContinuousEffectImpl { public PaintersServantEffect() { @@ -175,10 +140,10 @@ class PaintersServantEffect extends ContinuousEffectImpl { } return false; } - + protected static void setCardColor(Card card, String colorString, Game game) { ObjectColor color = game.getState().getCreateCardAttribute(card).getColor(); - switch (colorString) { + switch (colorString) { case "W": color.setWhite(true); break; diff --git a/Mage.Sets/src/mage/sets/shadowmoor/PoisonTheWell.java b/Mage.Sets/src/mage/sets/shadowmoor/PoisonTheWell.java index cb515b66693..1b8d897cfed 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/PoisonTheWell.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/PoisonTheWell.java @@ -28,15 +28,12 @@ package mage.sets.shadowmoor; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetControllerEffect; +import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetLandPermanent; /** @@ -50,7 +47,10 @@ public class PoisonTheWell extends CardImpl { this.expansionSetCode = "SHM"; // Destroy target land. Poison the Well deals 2 damage to that land's controller. - this.getSpellAbility().addEffect(new PoisonTheWellEffect()); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + Effect effect = new DamageTargetControllerEffect(2); + effect.setText("{this} deals 2 damage to that land's controller"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetLandPermanent()); } @@ -63,34 +63,3 @@ public class PoisonTheWell extends CardImpl { return new PoisonTheWell(this); } } - -class PoisonTheWellEffect extends OneShotEffect { - - public PoisonTheWellEffect() { - super(Outcome.DestroyPermanent); - this.staticText = "Destroy target land. {this} deals 2 damage to that land's controller"; - } - - public PoisonTheWellEffect(final PoisonTheWellEffect effect) { - super(effect); - } - - @Override - public PoisonTheWellEffect copy() { - return new PoisonTheWellEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent targetedLand = game.getPermanent(source.getFirstTarget()); - if (targetedLand != null) { - targetedLand.destroy(source.getSourceId(), game, true); - Player controller = game.getPlayer(targetedLand.getControllerId()); - if (controller != null) { - controller.damage(2, source.getSourceId(), game, false, true); - } - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/PrismaticOmen.java b/Mage.Sets/src/mage/sets/shadowmoor/PrismaticOmen.java index f3e7e5bc716..73b5b6ee1b3 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/PrismaticOmen.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/PrismaticOmen.java @@ -30,13 +30,6 @@ package mage.sets.shadowmoor; import java.util.ArrayList; import java.util.Arrays; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -48,6 +41,13 @@ import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -62,7 +62,6 @@ public class PrismaticOmen extends CardImpl { super(ownerId, 126, "Prismatic Omen", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); this.expansionSetCode = "SHM"; - // Lands you control are every basic land type in addition to their other types. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandTypeAllEffect("Swamp", "Mountain", "Forest", "Island", "Plains"))); } @@ -109,11 +108,11 @@ class BecomesBasicLandTypeAllEffect extends ContinuousEffectImpl { switch (layer) { case AbilityAddingRemovingEffects_6: Mana mana = new Mana(); - for (Ability ability : land.getAbilities()){ + for (Ability ability : land.getAbilities()) { if (ability instanceof BasicManaAbility) { - for (Mana netMana: ((BasicManaAbility)ability ).getNetMana(game)) { + for (Mana netMana : ((BasicManaAbility) ability).getNetMana(game)) { mana.add(netMana); - } + } } } if (mana.getGreen() == 0 && landTypes.contains("Forest")) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/PuppeteerClique.java b/Mage.Sets/src/mage/sets/shadowmoor/PuppeteerClique.java index 3fb47b66b54..c0568cfaf3a 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/PuppeteerClique.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/PuppeteerClique.java @@ -116,16 +116,16 @@ class PuppeteerCliqueEffect extends OneShotEffect { boolean result = false; Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null) { - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { - if (you.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); - hasteEffect.setTargetPointer(new FixedTarget(permanent.getId())); + hasteEffect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(hasteEffect, source); ExileTargetEffect exileEffect = new ExileTargetEffect("exile " + permanent.getLogName()); - exileEffect.setTargetPointer(new FixedTarget(card.getId())); + exileEffect.setTargetPointer(new FixedTarget(permanent, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect, TargetController.YOU); delayedAbility.setSourceId(source.getSourceId()); delayedAbility.setControllerId(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/shadowmoor/RattleblazeScarecrow.java b/Mage.Sets/src/mage/sets/shadowmoor/RattleblazeScarecrow.java index 41bcbcbe978..3bbba8d7fe0 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/RattleblazeScarecrow.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/RattleblazeScarecrow.java @@ -50,9 +50,10 @@ import mage.filter.predicate.mageobject.ColorPredicate; * @author jeffwadsworth */ public class RattleblazeScarecrow extends CardImpl { - + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a black creature"); private static final FilterControlledCreaturePermanent filter2 = new FilterControlledCreaturePermanent("a red creature"); + static { filter.add(new ColorPredicate(ObjectColor.BLACK)); filter2.add(new ColorPredicate(ObjectColor.RED)); @@ -60,7 +61,7 @@ public class RattleblazeScarecrow extends CardImpl { private static final String rule = "{this} has persist as long as you control a black creature"; private static final String rule2 = "{this} has haste as long as you control a red creature"; - + public RattleblazeScarecrow(UUID ownerId) { super(ownerId, 259, "Rattleblaze Scarecrow", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); this.expansionSetCode = "SHM"; @@ -71,11 +72,11 @@ public class RattleblazeScarecrow extends CardImpl { // Rattleblaze Scarecrow has persist as long as you control a black creature. ContinuousEffect effect = new GainAbilitySourceEffect(new PersistAbility(), Duration.WhileOnBattlefield); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect, new PermanentsOnTheBattlefieldCondition(filter), rule))); - + // Rattleblaze Scarecrow has haste as long as you control a red creature. ContinuousEffect effect2 = new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect2, new PermanentsOnTheBattlefieldCondition(filter), rule2))); - + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(effect2, new PermanentsOnTheBattlefieldCondition(filter2), rule2))); + } public RattleblazeScarecrow(final RattleblazeScarecrow card) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/RhysTheRedeemed.java b/Mage.Sets/src/mage/sets/shadowmoor/RhysTheRedeemed.java index c66ba3594b3..14d5e8ab7c1 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/RhysTheRedeemed.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/RhysTheRedeemed.java @@ -35,6 +35,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -45,10 +46,9 @@ import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.permanent.TokenPredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.game.permanent.token.Token; import mage.players.Player; -import mage.util.CardUtil; +import mage.target.targetpointer.FixedTarget; /** * @@ -113,13 +113,13 @@ class RhysTheRedeemedEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player you = game.getPlayer(source.getControllerId()); - if (you != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) { if (permanent.getControllerId().equals(source.getControllerId())) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); + effect.setTargetPointer(new FixedTarget(permanent, game)); + effect.apply(game, source); } } return true; diff --git a/Mage.Sets/src/mage/sets/shadowmoor/RosheenMeanderer.java b/Mage.Sets/src/mage/sets/shadowmoor/RosheenMeanderer.java index 80bc63dda1a..6907063e21f 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/RosheenMeanderer.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/RosheenMeanderer.java @@ -37,6 +37,7 @@ import mage.abilities.condition.Condition; import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.mana.BasicManaAbility; import mage.cards.CardImpl; +import mage.constants.AbilityType; import mage.constants.CardType; import mage.constants.Rarity; import mage.game.Game; @@ -56,9 +57,9 @@ public class RosheenMeanderer extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(4); - // {tap}: Add {4} to your mana pool. Spend this mana only on costs that contain {X}. + // {T}: Add {4} to your mana pool. Spend this mana only on costs that contain {X}. this.addAbility(new RosheenMeandererManaAbility()); - + } public RosheenMeanderer(final RosheenMeanderer card) { @@ -75,7 +76,7 @@ class RosheenMeandererManaAbility extends BasicManaAbility { RosheenMeandererManaAbility() { super(new BasicManaEffect(new RosheenMeandererConditionalMana())); - this.netMana.add(new Mana(0,0,0,0,0,4,0)); + this.netMana.add(new Mana(0, 0, 0, 0, 0, 4, 0)); } RosheenMeandererManaAbility(RosheenMeandererManaAbility ability) { @@ -98,10 +99,16 @@ class RosheenMeandererConditionalMana extends ConditionalMana { } class RosheenMeandererManaCondition implements Condition { + @Override public boolean apply(Game game, Ability source) { - MageObject object = game.getObject(source.getSourceId()); - return object != null - && object.getManaCost().getText().contains("X"); + if (AbilityType.SPELL.equals(source.getAbilityType())) { + MageObject object = game.getObject(source.getSourceId()); + return object != null + && object.getManaCost().getText().contains("X"); + + } else { + return source.getManaCosts().getText().contains("X"); + } } } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/RunedHalo.java b/Mage.Sets/src/mage/sets/shadowmoor/RunedHalo.java index df76fd6ff8a..a89115c7d3a 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/RunedHalo.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/RunedHalo.java @@ -85,7 +85,7 @@ class RunedHaloSetProtectionEffect extends OneShotEffect { public RunedHaloSetProtectionEffect() { super(Outcome.Protect); - staticText = "

You have protection from the chosen name (You can't be targeted, dealt damage, or enchanted by anything with that name.)"; + staticText = "

You have protection from the chosen name (You can't be targeted, dealt damage, or enchanted by anything with that name.)"; } public RunedHaloSetProtectionEffect(final RunedHaloSetProtectionEffect effect) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/SapseepForest.java b/Mage.Sets/src/mage/sets/shadowmoor/SapseepForest.java index 9ae7bb434cb..96f78b9329b 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/SapseepForest.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/SapseepForest.java @@ -1,86 +1,89 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTappedAbility; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalActivatedAbility; -import mage.abilities.effects.common.GainLifeEffect; -import mage.abilities.mana.GreenManaAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.ColorPredicate; - -/** - * - * @author jeffwadsworth - */ -public class SapseepForest extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more green permanents"); - - static { - filter.add(new ColorPredicate(ObjectColor.GREEN)); - } - - public SapseepForest(UUID ownerId) { - super(ownerId, 279, "Sapseep Forest", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "SHM"; - this.subtype.add("Forest"); - - // ({tap}: Add {G} to your mana pool.) - this.addAbility(new GreenManaAbility()); - - // Sapseep Forest enters the battlefield tapped. - this.addAbility(new EntersBattlefieldTappedAbility()); - - // {G}, {tap}: You gain 1 life. Activate this ability only if you control two or more green permanents. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new ManaCostsImpl("{G}"), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); - - } - - public SapseepForest(final SapseepForest card) { - super(card); - } - - @Override - public SapseepForest copy() { - return new SapseepForest(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author jeffwadsworth + */ +public class SapseepForest extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more green permanents"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public SapseepForest(UUID ownerId) { + super(ownerId, 279, "Sapseep Forest", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "SHM"; + this.subtype.add("Forest"); + + // ({tap}: Add {G} to your mana pool.) + this.addAbility(new GreenManaAbility()); + + // Sapseep Forest enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {G}, {tap}: You gain 1 life. Activate this ability only if you control two or more green permanents. + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + new GainLifeEffect(1), + new ManaCostsImpl("{G}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + } + + public SapseepForest(final SapseepForest card) { + super(card); + } + + @Override + public SapseepForest copy() { + return new SapseepForest(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ScarscaleRitual.java b/Mage.Sets/src/mage/sets/shadowmoor/ScarscaleRitual.java index 242203fede3..8e955f022ff 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ScarscaleRitual.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ScarscaleRitual.java @@ -33,11 +33,13 @@ import mage.abilities.costs.CostImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Outcome; import mage.constants.Rarity; import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.players.Player; import mage.target.Target; import mage.target.common.TargetControlledCreaturePermanent; @@ -52,14 +54,11 @@ public class ScarscaleRitual extends CardImpl { this.expansionSetCode = "SHM"; // As an additional cost to cast Scarscale Ritual, put a -1/-1 counter on a creature you control. - Target target = new TargetControlledCreaturePermanent(); - target.setNotTarget(true); - this.getSpellAbility().addTarget(target); this.getSpellAbility().addCost(new ScarscaleRitualCost()); - + // Draw two cards. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2)); - + } public ScarscaleRitual(final ScarscaleRitual card) { @@ -84,7 +83,7 @@ class ScarscaleRitualCost extends CostImpl { @Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - for (Permanent permanent :game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controllerId, game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controllerId, game)) { return permanent != null; } return false; @@ -92,10 +91,18 @@ class ScarscaleRitualCost extends CostImpl { @Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - Permanent permanent = game.getPermanent(ability.getFirstTarget()); - if (permanent != null) { - permanent.addCounters(CounterType.M1M1.createInstance(), game); - this.paid = true; + Player controller = game.getPlayer(ability.getControllerId()); + if (controller != null) { + Target target = new TargetControlledCreaturePermanent(); + target.setNotTarget(true); + controller.chooseTarget(Outcome.UnboostCreature, target, ability, game); + Permanent permanent = game.getPermanent(target.getFirstTarget()); + if (permanent != null) { + permanent.addCounters(CounterType.M1M1.createInstance(), game); + game.informPlayers(controller.getLogName() + " puts a -1/-1 counter on " + permanent.getLogName()); + this.paid = true; + } + } return paid; } @@ -104,4 +111,4 @@ class ScarscaleRitualCost extends CostImpl { public ScarscaleRitualCost copy() { return new ScarscaleRitualCost(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/SmashToSmithereens.java b/Mage.Sets/src/mage/sets/shadowmoor/SmashToSmithereens.java index 98ff75dc2bc..113b83d9f7e 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/SmashToSmithereens.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/SmashToSmithereens.java @@ -28,17 +28,12 @@ package mage.sets.shadowmoor; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetControllerEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.target.common.TargetArtifactPermanent; /** @@ -52,9 +47,11 @@ public class SmashToSmithereens extends CardImpl { this.expansionSetCode = "SHM"; // Destroy target artifact. Smash to Smithereens deals 3 damage to that artifact's controller. - this.getSpellAbility().addTarget(new TargetArtifactPermanent()); this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addEffect(new SmashToSmithereensEffect()); + Effect effect = new DamageTargetControllerEffect(3); + effect.setText("{this} deals 3 damage to that artifact's controller"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetArtifactPermanent()); } public SmashToSmithereens(final SmashToSmithereens card) { @@ -66,35 +63,3 @@ public class SmashToSmithereens extends CardImpl { return new SmashToSmithereens(this); } } - -class SmashToSmithereensEffect extends OneShotEffect { - - SmashToSmithereensEffect() { - super(Outcome.Damage); - staticText = "{this} deals 3 damage to that artifact's controller"; - } - - SmashToSmithereensEffect(final SmashToSmithereensEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getBattlefield().getPermanent(source.getFirstTarget()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); - } - if (permanent != null) { - Player player = game.getPlayer(permanent.getControllerId()); - if (player != null) { - player.damage(3, source.getSourceId(), game, false, true); - } - } - return false; - } - - @Override - public SmashToSmithereensEffect copy() { - return new SmashToSmithereensEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/Tatterkite.java b/Mage.Sets/src/mage/sets/shadowmoor/Tatterkite.java index 781d2d7608f..27c846f33a5 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/Tatterkite.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/Tatterkite.java @@ -32,7 +32,6 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.common.ruleModifying.CantRegenerateTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -59,10 +58,10 @@ public class Tatterkite extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // Tatterkite can't have counters placed on it. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantHaveCountersSourceEffect(Duration.WhileOnBattlefield, "it"))); - + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantHaveCountersSourceEffect(Duration.WhileOnBattlefield))); + } public Tatterkite(final Tatterkite card) { @@ -77,7 +76,7 @@ public class Tatterkite extends CardImpl { class CantHaveCountersSourceEffect extends ContinuousRuleModifyingEffectImpl { - public CantHaveCountersSourceEffect(Duration duration, String objectText) { + public CantHaveCountersSourceEffect(Duration duration) { super(duration, Outcome.Detriment); staticText = "{this} can't have counters placed on it"; } @@ -91,14 +90,9 @@ class CantHaveCountersSourceEffect extends ContinuousRuleModifyingEffectImpl { return new CantHaveCountersSourceEffect(this); } - @Override - public boolean apply(Game game, Ability source) { - return true; - } - @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType() == EventType.ADD_COUNTER; + return event.getType() == EventType.ADD_COUNTERS; } @Override @@ -109,4 +103,4 @@ class CantHaveCountersSourceEffect extends ContinuousRuleModifyingEffectImpl { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/TattermungeDuo.java b/Mage.Sets/src/mage/sets/shadowmoor/TattermungeDuo.java index 834c2477a36..7e9554c4e27 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/TattermungeDuo.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/TattermungeDuo.java @@ -1,82 +1,83 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.MageInt; -import mage.ObjectColor; -import mage.abilities.common.SpellCastControllerTriggeredAbility; -import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.keyword.ForestwalkAbility; -import mage.cards.CardImpl; -import mage.filter.FilterSpell; -import mage.filter.predicate.mageobject.ColorPredicate; - -/** - * - * @author North - */ -public class TattermungeDuo extends CardImpl { - - private static final FilterSpell redFilter = new FilterSpell("a red spell"); - private static final FilterSpell greenFilter = new FilterSpell("a green spell"); - - static { - redFilter.add(new ColorPredicate(ObjectColor.RED)); - greenFilter.add(new ColorPredicate(ObjectColor.GREEN)); - } - - public TattermungeDuo(UUID ownerId) { - super(ownerId, 218, "Tattermunge Duo", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R/G}"); - this.expansionSetCode = "SHM"; - this.subtype.add("Goblin"); - this.subtype.add("Warrior"); - this.subtype.add("Shaman"); - - this.power = new MageInt(2); - this.toughness = new MageInt(3); - - // Whenever you cast a red spell, Tattermunge Duo gets +1/+1 until end of turn. - this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), redFilter, false)); - // Whenever you cast a green spell, Tattermunge Duo gains forestwalk until end of turn. - this.addAbility(new SpellCastControllerTriggeredAbility(new GainAbilitySourceEffect(new ForestwalkAbility(), Duration.EndOfTurn), greenFilter, false)); - } - - public TattermungeDuo(final TattermungeDuo card) { - super(card); - } - - @Override - public TattermungeDuo copy() { - return new TattermungeDuo(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author North + */ +public class TattermungeDuo extends CardImpl { + + private static final FilterSpell redFilter = new FilterSpell("a red spell"); + private static final FilterSpell greenFilter = new FilterSpell("a green spell"); + + static { + redFilter.add(new ColorPredicate(ObjectColor.RED)); + greenFilter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public TattermungeDuo(UUID ownerId) { + super(ownerId, 218, "Tattermunge Duo", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R/G}"); + this.expansionSetCode = "SHM"; + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + this.subtype.add("Shaman"); + + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Whenever you cast a red spell, Tattermunge Duo gets +1/+1 until end of turn. + this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), redFilter, false)); + // Whenever you cast a green spell, Tattermunge Duo gains forestwalk until end of turn. + this.addAbility(new SpellCastControllerTriggeredAbility(new GainAbilitySourceEffect(new ForestwalkAbility(false), + Duration.EndOfTurn), greenFilter, false)); + } + + public TattermungeDuo(final TattermungeDuo card) { + super(card); + } + + @Override + public TattermungeDuo copy() { + return new TattermungeDuo(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ThoughtweftGambit.java b/Mage.Sets/src/mage/sets/shadowmoor/ThoughtweftGambit.java index f6c0b113a1d..5246fd44592 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ThoughtweftGambit.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ThoughtweftGambit.java @@ -50,7 +50,6 @@ public class ThoughtweftGambit extends CardImpl { super(ownerId, 154, "Thoughtweft Gambit", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{W/U}{W/U}"); this.expansionSetCode = "SHM"; - // Tap all creatures your opponents control and untap all creatures you control. this.getSpellAbility().addEffect(new ThoughtweftGambitEffect()); @@ -94,7 +93,7 @@ class ThoughtweftGambitEffect extends OneShotEffect { } if (controller != null) { for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { - if (controller.getId() == creature.getControllerId()) { + if (controller.getId().equals(creature.getControllerId())) { creature.untap(game); } } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/TraitorsRoar.java b/Mage.Sets/src/mage/sets/shadowmoor/TraitorsRoar.java index 90021a3dbbf..df7145b391c 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/TraitorsRoar.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/TraitorsRoar.java @@ -64,7 +64,7 @@ public class TraitorsRoar extends CardImpl { this.getSpellAbility().addEffect(new TraitorsRoarEffect()); // Conspire - this.addAbility(new ConspireAbility(this)); + this.addAbility(new ConspireAbility(getId(), ConspireAbility.ConspireTargets.ONE)); } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/WheelOfSunAndMoon.java b/Mage.Sets/src/mage/sets/shadowmoor/WheelOfSunAndMoon.java index e41ad1b2148..e67788dccc8 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/WheelOfSunAndMoon.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/WheelOfSunAndMoon.java @@ -85,7 +85,7 @@ public class WheelOfSunAndMoon extends CardImpl { class WheelOfSunAndMoonEffect extends ReplacementEffectImpl { public WheelOfSunAndMoonEffect() { - super(Duration.WhileOnBattlefield, Outcome.Damage); + super(Duration.WhileOnBattlefield, Outcome.Detriment); staticText = "If a card would be put into enchanted player's graveyard from anywhere, instead that card is revealed and put on the bottom of that player's library"; } @@ -126,10 +126,9 @@ class WheelOfSunAndMoonEffect extends ReplacementEffectImpl { if (controller != null && sourceObject != null) { Card card = game.getCard(event.getTargetId()); if (card != null) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; Cards cards = new CardsImpl(card); controller.revealCards(sourceObject.getIdName(), cards, game); - controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, zEvent.getFromZone(), false, true); + controller.putCardsOnBottomOfLibrary(cards, game, source, false); return true; } } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/WickerWarcrawler.java b/Mage.Sets/src/mage/sets/shadowmoor/WickerWarcrawler.java index 4ea92e72079..597a65871af 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/WickerWarcrawler.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/WickerWarcrawler.java @@ -29,19 +29,16 @@ package mage.sets.shadowmoor; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.AttacksOrBlocksTriggeredAbility; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -57,7 +54,10 @@ public class WickerWarcrawler extends CardImpl { this.toughness = new MageInt(6); // Whenever Wicker Warcrawler attacks or blocks, put a -1/-1 counter on it at end of combat. - this.addAbility(new AttacksOrBlocksTriggeredAbility(new WickerWarcrawlerEffect(), false)); + Effect effect = new AddCountersSourceEffect(CounterType.M1M1.createInstance(), true); + effect.setText("put a -1/-1 counter on it at end of combat"); + DelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(effect); + this.addAbility(new AttacksOrBlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(ability, false, false), false)); } @@ -70,35 +70,3 @@ public class WickerWarcrawler extends CardImpl { return new WickerWarcrawler(this); } } - -class WickerWarcrawlerEffect extends OneShotEffect { - - WickerWarcrawlerEffect() { - super(Outcome.Detriment); - staticText = "put a -1/-1 counter on {this} at the end of combat"; - } - - WickerWarcrawlerEffect(final WickerWarcrawlerEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent wickerWarcrawler = game.getPermanent(source.getSourceId()); - if (wickerWarcrawler != null) { - AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance())); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(source.getSourceId())); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - return false; - } - - @Override - public WickerWarcrawlerEffect copy() { - return new WickerWarcrawlerEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/WildSwing.java b/Mage.Sets/src/mage/sets/shadowmoor/WildSwing.java index b7737a78b8a..260029f8b84 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/WildSwing.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/WildSwing.java @@ -27,7 +27,9 @@ */ package mage.sets.shadowmoor; +import java.util.Random; import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -39,6 +41,7 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.target.Target; import mage.target.TargetPermanent; /** @@ -46,9 +49,9 @@ import mage.target.TargetPermanent; * @author jeffwadsworth */ public class WildSwing extends CardImpl { - + private static final FilterPermanent filter = new FilterPermanent("target nonenchantment permanents"); - + static { filter.add(Predicates.not(new CardTypePredicate(CardType.ENCHANTMENT))); } @@ -57,11 +60,10 @@ public class WildSwing extends CardImpl { super(ownerId, 108, "Wild Swing", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); this.expansionSetCode = "SHM"; - // Choose three target nonenchantment permanents. Destroy one of them at random. this.getSpellAbility().addEffect(new WildSwingEffect()); this.getSpellAbility().addTarget(new TargetPermanent(3, filter)); - + } public WildSwing(final WildSwing card) { @@ -92,11 +94,18 @@ class WildSwingEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int randomNumber = (int)(Math.random() * 3); - Permanent target = game.getPermanent(source.getTargets().get(randomNumber).getFirstTarget()); - if (target != null) { - game.informPlayers("Wild Swing: The randomly chosen target to destroy is " + target.getName()); - return target.destroy(source.getSourceId(), game, false); + MageObject sourceObject = source.getSourceObject(game); + if (!source.getTargets().isEmpty() && sourceObject != null) { + Target target = source.getTargets().get(0); + if (target != null && !target.getTargets().isEmpty()) { + Random rnd = new Random(); + Permanent targetPermanent = game.getPermanent(target.getTargets().get(rnd.nextInt(target.getTargets().size()))); + if (targetPermanent != null) { + game.informPlayers(sourceObject.getLogName() + ": The randomly chosen target to destroy is " + targetPermanent.getLogName()); + targetPermanent.destroy(source.getSourceId(), game, false); + } + return true; + } } return false; } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/WitherscaleWurm.java b/Mage.Sets/src/mage/sets/shadowmoor/WitherscaleWurm.java index bc3e1f3d06c..9f8ba6c97d4 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/WitherscaleWurm.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/WitherscaleWurm.java @@ -29,21 +29,17 @@ package mage.sets.shadowmoor; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility; import mage.abilities.common.DealsDamageToOpponentTriggeredAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.RemoveAllCountersSourceEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.WitherAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -65,7 +61,7 @@ public class WitherscaleWurm extends CardImpl { this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, false)); // Whenever Witherscale Wurm deals damage to an opponent, remove all -1/-1 counters from it. - this.addAbility(new DealsDamageToOpponentTriggeredAbility(new WitherscaleWurmEffect(), false)); + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new RemoveAllCountersSourceEffect(CounterType.M1M1), false)); } @@ -78,32 +74,3 @@ public class WitherscaleWurm extends CardImpl { return new WitherscaleWurm(this); } } - -class WitherscaleWurmEffect extends OneShotEffect { - - public WitherscaleWurmEffect() { - super(Outcome.Benefit); - staticText = "remove all -1/-1 counters from it"; - } - - public WitherscaleWurmEffect(WitherscaleWurmEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent witherscaleWurm = game.getPermanent(source.getSourceId()); - if (witherscaleWurm != null - && witherscaleWurm.getCounters().containsKey(CounterType.M1M1)) { - int M1M1Counters = witherscaleWurm.getCounters().getCount(CounterType.M1M1); - witherscaleWurm.getCounters().removeCounter(CounterType.M1M1, M1M1Counters); - return true; - } - return false; - } - - @Override - public WitherscaleWurmEffect copy() { - return new WitherscaleWurmEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/WortTheRaidmother.java b/Mage.Sets/src/mage/sets/shadowmoor/WortTheRaidmother.java new file mode 100644 index 00000000000..d44ba058135 --- /dev/null +++ b/Mage.Sets/src/mage/sets/shadowmoor/WortTheRaidmother.java @@ -0,0 +1,139 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.ConspireAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.filter.common.FilterInstantOrSorcerySpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.game.stack.Spell; +import mage.game.stack.StackObject; + +/** + * + * @author LevelX2 + */ +public class WortTheRaidmother extends CardImpl { + + public WortTheRaidmother(UUID ownerId) { + super(ownerId, 223, "Wort, the Raidmother", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R/G}{R/G}"); + this.expansionSetCode = "SHM"; + this.supertype.add("Legendary"); + this.subtype.add("Goblin"); + this.subtype.add("Shaman"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Wort, the Raidmother enters the battlefield, put two 1/1 red and green Goblin Warrior creature tokens onto the battlefield. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WortTheRaidmotherToken(), 2), false)); + + // Each red or green instant or sorcery spell you cast has conspire. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WortGainConspireEffect())); + } + + public WortTheRaidmother(final WortTheRaidmother card) { + super(card); + } + + @Override + public WortTheRaidmother copy() { + return new WortTheRaidmother(this); + } +} + +class WortGainConspireEffect extends ContinuousEffectImpl { + + private final static FilterInstantOrSorcerySpell filter = new FilterInstantOrSorcerySpell(); + + static { + filter.add(Predicates.or(new ColorPredicate(ObjectColor.RED), new ColorPredicate(ObjectColor.GREEN))); + } + private final ConspireAbility conspireAbility; + + public WortGainConspireEffect() { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + staticText = "Each red or green instant or sorcery spell you cast has conspire. (As you cast the spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose new targets for the copy.)"; + conspireAbility = new ConspireAbility(getId(), ConspireAbility.ConspireTargets.MORE); + } + + public WortGainConspireEffect(final WortGainConspireEffect effect) { + super(effect); + this.conspireAbility = new ConspireAbility(getId(), ConspireAbility.ConspireTargets.MORE); + } + + @Override + public WortGainConspireEffect copy() { + return new WortGainConspireEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (StackObject stackObject : game.getStack()) { + // only spells cast, so no copies of spells + if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.getControllerId().equals(source.getControllerId())) { + Spell spell = (Spell) stackObject; + if (filter.match(stackObject, game)) { + game.getState().addOtherAbility(spell.getCard(), conspireAbility); + } + } + } + return true; + } +} + +class WortTheRaidmotherToken extends Token { + + public WortTheRaidmotherToken() { + super("Goblin Warrior", "1/1 red and green Goblin Warrior creature token"); + cardType.add(CardType.CREATURE); + color.setRed(true); + color.setGreen(true); + subtype.add("Goblin"); + subtype.add("Warrior"); + power = new MageInt(1); + toughness = new MageInt(1); + } +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/AjaniVengeant.java b/Mage.Sets/src/mage/sets/shardsofalara/AjaniVengeant.java index ee4ee7cc2ca..a21eeaa672c 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/AjaniVengeant.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/AjaniVengeant.java @@ -1,46 +1,43 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.Effects; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DestroyAllControlledTargetEffect; -import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; -import mage.counters.CounterType; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; @@ -52,7 +49,7 @@ import mage.target.common.TargetCreatureOrPlayer; * @author BetaSteward_at_googlemail.com */ public class AjaniVengeant extends CardImpl { - + private static final FilterPermanent filter = new FilterPermanent("lands"); static { @@ -64,8 +61,7 @@ public class AjaniVengeant extends CardImpl { this.expansionSetCode = "ALA"; this.subtype.add("Ajani"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +1: Target permanent doesn't untap during its controller's next untap step. LoyaltyAbility ability1 = new LoyaltyAbility(new DontUntapInControllersNextUntapStepTargetEffect(), 1); @@ -85,7 +81,6 @@ public class AjaniVengeant extends CardImpl { ability3.addTarget(new TargetPlayer()); this.addAbility(ability3); - } public AjaniVengeant(final AjaniVengeant card) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/BoneSplinters.java b/Mage.Sets/src/mage/sets/shardsofalara/BoneSplinters.java index c499cc268e0..77ac4cc3a49 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/BoneSplinters.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/BoneSplinters.java @@ -28,11 +28,13 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -46,12 +48,11 @@ public class BoneSplinters extends CardImpl { super(ownerId, 67, "Bone Splinters", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}"); this.expansionSetCode = "ALA"; - // As an additional cost to cast Bone Splinters, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); // Destroy target creature. - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (to destoy)"))); + this.getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target creature")); } public BoneSplinters(final BoneSplinters card) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/BrilliantUltimatum.java b/Mage.Sets/src/mage/sets/shardsofalara/BrilliantUltimatum.java index 1f7020d8412..795c79dea3e 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/BrilliantUltimatum.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/BrilliantUltimatum.java @@ -30,6 +30,7 @@ package mage.sets.shardsofalara; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; @@ -56,11 +57,8 @@ public class BrilliantUltimatum extends CardImpl { super(ownerId, 159, "Brilliant Ultimatum", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{W}{W}{U}{U}{U}{B}{B}"); this.expansionSetCode = "ALA"; - // Exile the top five cards of your library. An opponent separates those cards into two piles. You may play any number of cards from one of those piles without paying their mana costs. this.getSpellAbility().addEffect(new BrilliantUltimatumEffect()); - this.getSpellAbility().addTarget(new TargetOpponent(true)); - } public BrilliantUltimatum(final BrilliantUltimatum card) { @@ -91,22 +89,19 @@ class BrilliantUltimatumEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player you = game.getPlayer(source.getControllerId()); - if (you == null) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller == null || sourceObject == null) { return false; } Cards pile2 = new CardsImpl(); - int max = Math.min(you.getLibrary().size(), 5); - for (int i = 0; i < max; i++) { - Card card = you.getLibrary().removeFromTop(game); - if (card != null) { - card.moveToExile(source.getSourceId(), "Brilliant Ultimatum", source.getSourceId(), game); - pile2.add(card); - } - } + pile2.addAll(controller.getLibrary().getTopCards(game, 5)); + controller.moveCardsToExile(pile2.getCards(game), source, game, true, source.getSourceId(), sourceObject.getIdName()); - Player opponent = game.getPlayer(source.getFirstTarget()); + TargetOpponent targetOpponent = new TargetOpponent(true); + targetOpponent.choose(outcome, source.getControllerId(), source.getSourceId(), game); + Player opponent = game.getPlayer(targetOpponent.getFirstTarget()); if (opponent != null) { TargetCard target = new TargetCard(0, pile2.size(), Zone.EXILED, new FilterCard("cards to put in the first pile")); target.setRequired(false); @@ -123,55 +118,32 @@ class BrilliantUltimatumEffect extends OneShotEffect { } } } - for (UUID cardID : pile1) { - Card card = pile1.get(cardID, game); - pileOne.add(card); - } - for (UUID cardId : pile2) { - Card card = pile2.get(cardId, game); - pileTwo.add(card); - } - - you.revealCards("Pile 1 (Brilliant Ultimatum)", pile1, game); - you.revealCards("Pile 2 (Brilliant Ultimatum)", pile2, game); - - boolean choice = you.choosePile(Outcome.PlayForFree, "Which pile (play for free)?", pileOne, pileTwo, game); + pileOne.addAll(pile1.getCards(game)); + pileTwo.addAll(pile2.getCards(game)); + controller.revealCards("Pile 1 - " + sourceObject.getIdName(), pile1, game); + controller.revealCards("Pile 2 - " + sourceObject.getIdName(), pile2, game); + + boolean choice = controller.choosePile(Outcome.PlayForFree, "Which pile (play for free)?", pileOne, pileTwo, game); + String selectedPileName; + List selectedPileCards; + Cards selectedPile; if (choice) { - game.informPlayer(you, you.getLogName() + " chose Pile 1."); - while (!pileOne.isEmpty() && you.chooseUse(Outcome.PlayForFree, "Do you want to play a card from Pile 1?", source, game)) { - TargetCard targetExiledCard = new TargetCard(Zone.EXILED, new FilterCard()); - if (you.chooseTarget(Outcome.PlayForFree, pile1, targetExiledCard, source, game)) { - Card card = pile1.get(targetExiledCard.getFirstTarget(), game); - if (card != null) { - if (card.getCardType().contains(CardType.LAND)) { - you.playLand(card, game); - pileOne.remove(card); - pile1.remove(card); - } else { - you.cast(card.getSpellAbility(), game, true); - pileOne.remove(card); - pile1.remove(card); - } - } - } - } + selectedPileName = "pile 1"; + selectedPileCards = pileOne; + selectedPile = pile1; } else { - game.informPlayer(you, you.getLogName() + " chose Pile 2."); - while (!pileTwo.isEmpty() && you.chooseUse(Outcome.PlayForFree, "Do you want to play a card from Pile 2?", source, game)) { - TargetCard targetExiledCard = new TargetCard(Zone.EXILED, new FilterCard()); - if (you.chooseTarget(Outcome.PlayForFree, pile2, targetExiledCard, source, game)) { - Card card = pile2.get(targetExiledCard.getFirstTarget(), game); - if (card != null) { - if (card.getCardType().contains(CardType.LAND)) { - you.playLand(card, game); - pileTwo.remove(card); - pile2.remove(card); - } else { - you.cast(card.getSpellAbility(), game, true); - pileTwo.remove(card); - pile2.remove(card); - } - } + selectedPileName = "pile 2"; + selectedPileCards = pileTwo; + selectedPile = pile2; + } + game.informPlayers(controller.getLogName() + " chose " + selectedPileName + "."); + while (!selectedPileCards.isEmpty() && controller.chooseUse(Outcome.PlayForFree, "Do you want to play a card for free from " + selectedPileName + "?", source, game)) { + TargetCard targetExiledCard = new TargetCard(Zone.EXILED, new FilterCard()); + if (controller.chooseTarget(Outcome.PlayForFree, selectedPile, targetExiledCard, source, game)) { + Card card = selectedPile.get(targetExiledCard.getFirstTarget(), game); + if (controller.playCard(card, game, true, true)) { + selectedPileCards.remove(card); + selectedPile.remove(card); } } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ClarionUltimatum.java b/Mage.Sets/src/mage/sets/shardsofalara/ClarionUltimatum.java index 180c48059a7..86ba12cbe9c 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/ClarionUltimatum.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/ClarionUltimatum.java @@ -28,16 +28,18 @@ package mage.sets.shardsofalara; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.NamePredicate; import mage.game.Game; @@ -56,7 +58,6 @@ public class ClarionUltimatum extends CardImpl { super(ownerId, 163, "Clarion Ultimatum", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{G}{G}{W}{W}{W}{U}{U}"); this.expansionSetCode = "ALA"; - // Choose five permanents you control. For each of those permanents, you may search your library for a card with the same name as that permanent. Put those cards onto the battlefield tapped, then shuffle your library. this.getSpellAbility().addEffect(new ClarionUltimatumEffect()); } @@ -90,32 +91,28 @@ class ClarionUltimatumEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); int permanentsCount = game.getBattlefield().getAllActivePermanents(source.getControllerId()).size(); - if (player == null || permanentsCount < 1) { + if (controller == null || permanentsCount < 1) { return false; } TargetControlledPermanent permanentsTarget = new TargetControlledPermanent(Math.min(permanentsCount, 5)); - player.choose(Outcome.Benefit, permanentsTarget, source.getSourceId(), game); + controller.choose(Outcome.Benefit, permanentsTarget, source.getSourceId(), game); - List chosenCards = new ArrayList(); - List namesFiltered = new ArrayList(); + Set chosenCards = new LinkedHashSet<>(); + List namesFiltered = new ArrayList<>(); List permanents = permanentsTarget.getTargets(); for (UUID permanentId : permanents) { Permanent permanent = game.getPermanent(permanentId); final String cardName = permanent.getName(); if (!namesFiltered.contains(cardName)) { - StringBuilder sb = new StringBuilder(); - sb.append("Search for ").append(cardName).append(" in your library?"); - - if (player.chooseUse(Outcome.PutCardInPlay, sb.toString(), source, game)) { + if (controller.chooseUse(Outcome.PutCardInPlay, "Search for " + cardName + " in your library?", source, game)) { FilterCard filter = new FilterCard("card named " + cardName); filter.add(new NamePredicate(cardName)); TargetCardInLibrary target = new TargetCardInLibrary(filter); - - if (player.searchLibrary(target, game)) { - Card card = player.getLibrary().getCard(target.getFirstTarget(), game); + if (controller.searchLibrary(target, game)) { + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) { chosenCards.add(card); } @@ -126,14 +123,8 @@ class ClarionUltimatumEffect extends OneShotEffect { } } - for (Card card : chosenCards) { - card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId()); - Permanent permanent = game.getPermanent(card.getId()); - if (permanent != null) { - permanent.setTapped(true); - } - } - player.shuffleLibrary(game); + controller.moveCards(chosenCards, Zone.BATTLEFIELD, source, game, true, false, false, null); + controller.shuffleLibrary(game); return true; } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ComaVeil.java b/Mage.Sets/src/mage/sets/shardsofalara/ComaVeil.java index bfbf3aacebe..9aea990c51f 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/ComaVeil.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/ComaVeil.java @@ -53,7 +53,7 @@ public class ComaVeil extends CardImpl { new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE))); } - + public ComaVeil(UUID ownerId) { super(ownerId, 36, "Coma Veil", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{4}{U}"); this.expansionSetCode = "ALA"; @@ -66,7 +66,7 @@ public class ComaVeil extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); // Enchanted permanent doesn't untap during its controller's untap step. EnchantAbility ability = new EnchantAbility(auraTarget.getTargetName()); - ability.addEffect(new DontUntapInControllersUntapStepEnchantedEffect()); + ability.addEffect(new DontUntapInControllersUntapStepEnchantedEffect("permanent")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/CouriersCapsule.java b/Mage.Sets/src/mage/sets/shardsofalara/CouriersCapsule.java index 903cf74c23b..8aab811a414 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/CouriersCapsule.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/CouriersCapsule.java @@ -29,6 +29,8 @@ package mage.sets.shardsofalara; import java.util.UUID; + +import mage.abilities.costs.common.TapSourceCost; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; @@ -51,6 +53,7 @@ public class CouriersCapsule extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(2), new ManaCostsImpl("{1}{U}")); + ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ElspethKnightErrant.java b/Mage.Sets/src/mage/sets/shardsofalara/ElspethKnightErrant.java index b37b88c0d95..6cd0c9bdef5 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/ElspethKnightErrant.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/ElspethKnightErrant.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,21 +20,16 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.Effects; @@ -43,11 +38,13 @@ import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; -import mage.counters.CounterType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -67,8 +64,7 @@ public class ElspethKnightErrant extends CardImpl { this.expansionSetCode = "ALA"; this.subtype.add("Elspeth"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Put a 1/1 white Soldier creature token onto the battlefield. Token token = new SoldierToken(); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/FeralHydra.java b/Mage.Sets/src/mage/sets/shardsofalara/FeralHydra.java index f4d54f31c0e..5eed25187ea 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/FeralHydra.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/FeralHydra.java @@ -28,25 +28,19 @@ package mage.sets.shardsofalara; import java.util.UUID; -import static javax.xml.bind.JAXBIntrospector.getValue; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.InfoEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -64,9 +58,10 @@ public class FeralHydra extends CardImpl { this.toughness = new MageInt(0); // Feral Hydra enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new FeralHydraEffect(), true)); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); + // {3}: Put a +1/+1 counter on Feral Hydra. Any player may activate this ability. - SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()) , new ManaCostsImpl("{3}")); + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{3}")); ability.setMayActivate(TargetController.ANY); ability.addEffect(new InfoEffect("Any player may activate this ability")); this.addAbility(ability); @@ -81,38 +76,3 @@ public class FeralHydra extends CardImpl { return new FeralHydra(this); } } - - -class FeralHydraEffect extends OneShotEffect { - - public FeralHydraEffect() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - public FeralHydraEffect(final FeralHydraEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility)obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public FeralHydraEffect copy() { - return new FeralHydraEffect(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/shardsofalara/GatherSpecimens.java b/Mage.Sets/src/mage/sets/shardsofalara/GatherSpecimens.java index 1287b0fc327..f33ff12365e 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/GatherSpecimens.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/GatherSpecimens.java @@ -52,10 +52,8 @@ public class GatherSpecimens extends CardImpl { super(ownerId, 45, "Gather Specimens", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{U}{U}{U}"); this.expansionSetCode = "ALA"; - // If a creature would enter the battlefield under an opponent's control this turn, it enters the battlefield under your control instead. this.getSpellAbility().addEffect(new GatherSpecimensReplacementEffect()); - } public GatherSpecimens(final GatherSpecimens card) { @@ -114,7 +112,7 @@ class GatherSpecimensReplacementEffect extends ReplacementEffectImpl { } return false; } - + @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); @@ -122,5 +120,5 @@ class GatherSpecimensReplacementEffect extends ReplacementEffectImpl { event.setPlayerId(controller.getId()); } return false; - } + } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/GoblinAssault.java b/Mage.Sets/src/mage/sets/shardsofalara/GoblinAssault.java index 43ca9f54978..9cd15845e5e 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/GoblinAssault.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/GoblinAssault.java @@ -28,22 +28,20 @@ package mage.sets.shardsofalara; import java.util.UUID; - -import mage.constants.*; -import mage.MageInt; -import mage.ObjectColor; -import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.RequirementEffect; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.HasteAbility; +import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinTokenWithHaste; +import mage.watchers.common.AttackedThisTurnWatcher; /** * @@ -51,15 +49,21 @@ import mage.game.permanent.token.Token; */ public class GoblinAssault extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + public GoblinAssault(UUID ownerId) { super(ownerId, 101, "Goblin Assault", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); this.expansionSetCode = "ALA"; - // At the beginning of your upkeep, put a 1/1 red Goblin creature token with haste onto the battlefield. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new GoblinAssaultToken()), TargetController.YOU, false)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new GoblinTokenWithHaste()), TargetController.YOU, false)); + // Goblin creatures attack each turn if able. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GoblinAssaultEffect())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter, Duration.WhileOnBattlefield)), new AttackedThisTurnWatcher()); } public GoblinAssault(final GoblinAssault card) { @@ -71,59 +75,3 @@ public class GoblinAssault extends CardImpl { return new GoblinAssault(this); } } - - -class GoblinAssaultEffect extends RequirementEffect { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures"); - static { - filter.add(new SubtypePredicate("Goblin")); - } - - public GoblinAssaultEffect() { - super(Duration.WhileOnBattlefield); - staticText = "Goblin creatures attack each turn if able"; - } - - public GoblinAssaultEffect(final GoblinAssaultEffect effect) { - super(effect); - } - - @Override - public GoblinAssaultEffect copy() { - return new GoblinAssaultEffect(this); - } - - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) { - return true; - } - return false; - } - - @Override - public boolean mustAttack(Game game) { - return true; - } - - @Override - public boolean mustBlock(Game game) { - return false; - } - -} - -class GoblinAssaultToken extends Token { - - public GoblinAssaultToken() { - super("Goblin", "1/1 red Goblin creature token with haste"); - cardType.add(CardType.CREATURE); - subtype.add("Goblin"); - - color.setRed(true); - power = new MageInt(1); - toughness = new MageInt(1); - this.addAbility(HasteAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/HinderingLight.java b/Mage.Sets/src/mage/sets/shardsofalara/HinderingLight.java index cd0dbc8e7f7..7726f3ab806 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/HinderingLight.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/HinderingLight.java @@ -28,11 +28,12 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; +import mage.abilities.Mode; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.FilterSpell; import mage.filter.predicate.ObjectPlayer; import mage.filter.predicate.ObjectPlayerPredicate; @@ -58,7 +59,6 @@ public class HinderingLight extends CardImpl { super(ownerId, 173, "Hindering Light", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}{U}"); this.expansionSetCode = "ALA"; - // Counter target spell that targets you or a permanent you control. this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addTarget(new TargetSpell(filter)); @@ -84,9 +84,8 @@ class HinderingLightPredicate implements ObjectPlayerPredicate permanents = game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), source.getSourceId(), game); - for (Permanent permanent: permanents) { + for (Permanent permanent : permanents) { permanent.moveToExile(source.getSourceId(), "Realm Razer", source.getSourceId(), game); } return true; @@ -103,7 +102,6 @@ class ExileAllEffect extends OneShotEffect { } - class RealmRazerEffect extends OneShotEffect { public RealmRazerEffect() { @@ -122,17 +120,14 @@ class RealmRazerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - ExileZone exZone = game.getExile().getExileZone(source.getSourceId()); - if (exZone != null) { - for (Card card : exZone.getCards(game)) { - if (card != null) { - if(card.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), card.getOwnerId())){ - game.getPermanent(card.getId()).setTapped(true); - } - } + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + ExileZone exZone = game.getExile().getExileZone(source.getSourceId()); + if (exZone != null) { + return controller.moveCards(exZone.getCards(game), Zone.BATTLEFIELD, source, game, true, false, false, null); } return true; } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java b/Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java index 4377e3fb628..43196e13e7b 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/SarkhanVol.java @@ -1,50 +1,47 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.sets.shardsofalara; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.abilities.effects.common.continuous.BoostControlledEffect; import java.util.UUID; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.effects.Effects; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.Effects; -import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; -import mage.abilities.effects.common.continuous.GainControlTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.abilities.effects.common.UntapTargetEffect; -import mage.abilities.keyword.HasteAbility; -import mage.cards.CardImpl; -import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.game.permanent.token.DragonToken; import mage.target.common.TargetCreaturePermanent; @@ -62,8 +59,7 @@ public class SarkhanVol extends CardImpl { this.expansionSetCode = "ALA"; this.subtype.add("Sarkhan"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Creatures you control get +1/+1 and gain haste until end of turn. Effects effects1 = new Effects(); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java b/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java index d7cb633473a..d390ef3ac8c 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java @@ -25,29 +25,22 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.dynamicvalue.common.CountersCount; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; - /** * @author Loki @@ -60,7 +53,7 @@ public class SigilOfDistinction extends CardImpl { this.subtype.add("Equipment"); // Sigil of Distinction enters the battlefield with X charge counters on it. - this.addAbility(new EntersBattlefieldAbility(new SigilOfDistinctionEffect(), "{this} enters the battlefield with X charge counters on it")); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.CHARGE.createInstance()))); // Equipped creature gets +1/+1 for each charge counter on Sigil of Distinction. BoostEquippedEffect effect = new BoostEquippedEffect(new CountersCount(CounterType.CHARGE), new CountersCount(CounterType.CHARGE)); @@ -80,36 +73,3 @@ public class SigilOfDistinction extends CardImpl { return new SigilOfDistinction(this); } } - -class SigilOfDistinctionEffect extends OneShotEffect { - public SigilOfDistinctionEffect() { - super(Outcome.Benefit); - } - - public SigilOfDistinctionEffect(final SigilOfDistinctionEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); - return true; - } - } - } - return true; - } - - @Override - public SigilOfDistinctionEffect copy() { - return new SigilOfDistinctionEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Skeletonize.java b/Mage.Sets/src/mage/sets/shardsofalara/Skeletonize.java index f9000f459ea..18cf0faca35 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Skeletonize.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Skeletonize.java @@ -152,7 +152,7 @@ class SkeletonToken extends Token { super("Skeleton", "1/1 black Skeleton creature token with \"{B}: Regenerate this creature.\""); this.cardType.add(CardType.CREATURE); this.color = ObjectColor.BLACK; - this.subtype.add("Bat"); + this.subtype.add("Skeleton"); this.power = new MageInt(1); this.toughness = new MageInt(1); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/TezzeretTheSeeker.java b/Mage.Sets/src/mage/sets/shardsofalara/TezzeretTheSeeker.java index 9cae9ec46d7..d4a44c46efb 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/TezzeretTheSeeker.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/TezzeretTheSeeker.java @@ -31,13 +31,12 @@ import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.UntapTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; @@ -47,7 +46,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.Filter.ComparisonType; import mage.filter.common.FilterArtifactCard; import mage.filter.common.FilterArtifactPermanent; @@ -69,7 +67,7 @@ public class TezzeretTheSeeker extends CardImpl { this.expansionSetCode = "ALA"; this.subtype.add("Tezzeret"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Untap up to two target artifacts. LoyaltyAbility ability = new LoyaltyAbility(new UntapTargetEffect(), 1); @@ -109,8 +107,8 @@ class TezzeretTheSeekerEffect2 extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } @@ -125,15 +123,15 @@ class TezzeretTheSeekerEffect2 extends OneShotEffect { filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, cmc + 1)); TargetCardInLibrary target = new TargetCardInLibrary(filter); - if (player.searchLibrary(target, game)) { - Card card = player.getLibrary().getCard(target.getFirstTarget(), game); + if (controller.searchLibrary(target, game)) { + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return true; } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return false; } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/TidehollowSculler.java b/Mage.Sets/src/mage/sets/shardsofalara/TidehollowSculler.java index e667e1d7cd6..3f728872269 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/TidehollowSculler.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/TidehollowSculler.java @@ -114,7 +114,7 @@ class TidehollowScullerExileEffect extends OneShotEffect { if (controller.choose(Outcome.Exile, opponent.getHand(), target, game)) { Card card = opponent.getHand().get(target.getFirstTarget(), game); if (card != null) { - controller.moveCardToExileWithInfo(card, CardUtil.getObjectExileZoneId(game, sourcePermanent), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.HAND, true); + controller.moveCardToExileWithInfo(card, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.HAND, true); } } diff --git a/Mage.Sets/src/mage/sets/speedvscunning/AquamorphEntity.java b/Mage.Sets/src/mage/sets/speedvscunning/AquamorphEntity.java index 803b119ff50..c286fd7ffbe 100644 --- a/Mage.Sets/src/mage/sets/speedvscunning/AquamorphEntity.java +++ b/Mage.Sets/src/mage/sets/speedvscunning/AquamorphEntity.java @@ -44,6 +44,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -65,11 +66,10 @@ public class AquamorphEntity extends CardImpl { this.toughness = new MageInt(0); // As Aquamorph Entity enters the battlefield or is turned face up, it becomes your choice of 5/1 or 1/5. - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new AquamorphEntityReplacementEffect()); + Ability ability = new SimpleStaticAbility(Zone.ALL, new AquamorphEntityReplacementEffect()); ability.setWorksFaceDown(true); this.addAbility(ability); - // Morph {2}{U} this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{U}"))); } @@ -84,7 +84,6 @@ public class AquamorphEntity extends CardImpl { } } - class AquamorphEntityReplacementEffect extends ReplacementEffectImpl { private final String choice51 = "a 5/1 creature"; @@ -101,7 +100,7 @@ class AquamorphEntityReplacementEffect extends ReplacementEffectImpl { @Override public boolean checksEventType(GameEvent event, Game game) { - switch(event.getType()) { + switch (event.getType()) { case ENTERS_THE_BATTLEFIELD: case TURNFACEUP: return true; @@ -114,7 +113,7 @@ class AquamorphEntityReplacementEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) { if (event.getTargetId().equals(source.getSourceId())) { - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + Permanent sourcePermanent = ((EntersTheBattlefieldEvent) event).getTarget();; if (sourcePermanent != null && !sourcePermanent.isFaceDown(game)) { return true; } @@ -135,7 +134,7 @@ class AquamorphEntityReplacementEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); if (permanent != null) { Choice choice = new ChoiceImpl(true); choice.setMessage("Choose what the creature becomes to"); @@ -143,7 +142,7 @@ class AquamorphEntityReplacementEffect extends ReplacementEffectImpl { choice.getChoices().add(choice15); Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - while(!choice.isChosen()) { + while (!choice.isChosen()) { controller.choose(Outcome.Neutral, choice, game); if (!controller.canRespond()) { return false; @@ -168,7 +167,7 @@ class AquamorphEntityReplacementEffect extends ReplacementEffectImpl { } } return false; - + } @Override diff --git a/Mage.Sets/src/mage/sets/starter1999/CinderStorm.java b/Mage.Sets/src/mage/sets/starter1999/CinderStorm.java new file mode 100644 index 00000000000..e930ab1839c --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/CinderStorm.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; + +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author nigelzor + */ +public class CinderStorm extends CardImpl { + + public CinderStorm(UUID ownerId) { + super(ownerId, 93, "Cinder Storm", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{6}{R}"); + this.expansionSetCode = "S99"; + + // Cinder Storm deals 7 damage to target creature or player. + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + this.getSpellAbility().addEffect(new DamageTargetEffect(7)); + } + + public CinderStorm(final CinderStorm card) { + super(card); + } + + @Override + public CinderStorm copy() { + return new CinderStorm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/DakmorGhoul.java b/Mage.Sets/src/mage/sets/starter1999/DakmorGhoul.java new file mode 100644 index 00000000000..db966dd5818 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/DakmorGhoul.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class DakmorGhoul extends CardImpl { + + public DakmorGhoul(UUID ownerId) { + super(ownerId, 70, "Dakmor Ghoul", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "S99"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Dakmor Ghoul enters the battlefield, target opponent loses 2 life and you gain 2 life. + Effect effect = new GainLifeEffect(2); + effect.setText("and you gain 2 life"); + Ability ability = new EntersBattlefieldTriggeredAbility(new LoseLifeTargetEffect(2), false); + ability.addTarget(new TargetOpponent()); + ability.addEffect(effect); + this.addAbility(ability); + } + + public DakmorGhoul(final DakmorGhoul card) { + super(card); + } + + @Override + public DakmorGhoul copy() { + return new DakmorGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/DakmorPlague.java b/Mage.Sets/src/mage/sets/starter1999/DakmorPlague.java new file mode 100644 index 00000000000..4d3150c9e0f --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/DakmorPlague.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class DakmorPlague extends CardImpl { + + public DakmorPlague(UUID ownerId) { + super(ownerId, 72, "Dakmor Plague", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); + this.expansionSetCode = "S99"; + + // Dakmor Plague deals 3 damage to each creature and each player. + this.getSpellAbility().addEffect(new DamageEverythingEffect(3)); + } + + public DakmorPlague(final DakmorPlague card) { + super(card); + } + + @Override + public DakmorPlague copy() { + return new DakmorPlague(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/DenizenOfTheDeep.java b/Mage.Sets/src/mage/sets/starter1999/DenizenOfTheDeep.java new file mode 100644 index 00000000000..fe93c5366f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/DenizenOfTheDeep.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DenizenOfTheDeep extends mage.sets.tenthedition.DenizenOfTheDeep { + + public DenizenOfTheDeep(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "S99"; + } + + public DenizenOfTheDeep(final DenizenOfTheDeep card) { + super(card); + } + + @Override + public DenizenOfTheDeep copy() { + return new DenizenOfTheDeep(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/DevoutMonk.java b/Mage.Sets/src/mage/sets/starter1999/DevoutMonk.java new file mode 100644 index 00000000000..0c29947555b --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/DevoutMonk.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class DevoutMonk extends CardImpl { + + public DevoutMonk(UUID ownerId) { + super(ownerId, 14, "Devout Monk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "S99"; + this.subtype.add("Human"); + this.subtype.add("Monk"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Devout Monk enters the battlefield, you gain 1 life. + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(1), false)); + } + + public DevoutMonk(final DevoutMonk card) { + super(card); + } + + @Override + public DevoutMonk copy() { + return new DevoutMonk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/DreadReaper.java b/Mage.Sets/src/mage/sets/starter1999/DreadReaper.java new file mode 100644 index 00000000000..9c38640442b --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/DreadReaper.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class DreadReaper extends CardImpl { + + public DreadReaper(UUID ownerId) { + super(ownerId, 76, "Dread Reaper", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); + this.expansionSetCode = "S99"; + this.subtype.add("Horror"); + this.power = new MageInt(6); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Dread Reaper enters the battlefield, you lose 5 life. + this.addAbility(new EntersBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(5), false)); + } + + public DreadReaper(final DreadReaper card) { + super(card); + } + + @Override + public DreadReaper copy() { + return new DreadReaper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/Extinguish.java b/Mage.Sets/src/mage/sets/starter1999/Extinguish.java new file mode 100644 index 00000000000..50f758d1e78 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/Extinguish.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Extinguish extends mage.sets.portalsecondage.Extinguish { + + public Extinguish(UUID ownerId) { + super(ownerId); + this.cardNumber = 37; + this.expansionSetCode = "S99"; + } + + public Extinguish(final Extinguish card) { + super(card); + } + + @Override + public Extinguish copy() { + return new Extinguish(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/HulkingOgre.java b/Mage.Sets/src/mage/sets/starter1999/HulkingOgre.java new file mode 100644 index 00000000000..f80a7b480c1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/HulkingOgre.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CantBlockAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class HulkingOgre extends CardImpl { + + public HulkingOgre(UUID ownerId) { + super(ownerId, 108, "Hulking Ogre", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "S99"; + this.subtype.add("Ogre"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Hulking Ogre can't block. + this.addAbility(new CantBlockAbility()); + } + + public HulkingOgre(final HulkingOgre card) { + super(card); + } + + @Override + public HulkingOgre copy() { + return new HulkingOgre(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/IngeniousThief.java b/Mage.Sets/src/mage/sets/starter1999/IngeniousThief.java new file mode 100644 index 00000000000..5adce61ef91 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/IngeniousThief.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class IngeniousThief extends mage.sets.portal.IngeniousThief { + + public IngeniousThief(UUID ownerId) { + super(ownerId); + this.cardNumber = 40; + this.expansionSetCode = "S99"; + this.rarity = Rarity.COMMON; + } + + public IngeniousThief(final IngeniousThief card) { + super(card); + } + + @Override + public IngeniousThief copy() { + return new IngeniousThief(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/JaggedLightning.java b/Mage.Sets/src/mage/sets/starter1999/JaggedLightning.java new file mode 100644 index 00000000000..26853ac7abd --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/JaggedLightning.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class JaggedLightning extends mage.sets.urzassaga.JaggedLightning { + + public JaggedLightning(UUID ownerId) { + super(ownerId); + this.cardNumber = 109; + this.expansionSetCode = "S99"; + } + + public JaggedLightning(final JaggedLightning card) { + super(card); + } + + @Override + public JaggedLightning copy() { + return new JaggedLightning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/LastChance.java b/Mage.Sets/src/mage/sets/starter1999/LastChance.java new file mode 100644 index 00000000000..57860b5a28f --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/LastChance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class LastChance extends mage.sets.masterseditioniv.LastChance { + + public LastChance(UUID ownerId) { + super(ownerId); + this.cardNumber = 110; + this.expansionSetCode = "S99"; + } + + public LastChance(final LastChance card) { + super(card); + } + + @Override + public LastChance copy() { + return new LastChance(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/NaturesCloak.java b/Mage.Sets/src/mage/sets/starter1999/NaturesCloak.java new file mode 100644 index 00000000000..ef7f12e84db --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/NaturesCloak.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author fireshoes + */ +public class NaturesCloak extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Green creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public NaturesCloak(UUID ownerId) { + super(ownerId, 135, "Nature's Cloak", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{G}"); + this.expansionSetCode = "S99"; + + // Green creatures you control gain forestwalk until end of turn. + this.getSpellAbility().addEffect(new GainAbilityControlledEffect( + new ForestwalkAbility(false), Duration.EndOfTurn, filter)); + } + + public NaturesCloak(final NaturesCloak card) { + super(card); + } + + @Override + public NaturesCloak copy() { + return new NaturesCloak(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/RoyalTrooper.java b/Mage.Sets/src/mage/sets/starter1999/RoyalTrooper.java new file mode 100644 index 00000000000..6f5c36e52e8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/RoyalTrooper.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class RoyalTrooper extends CardImpl { + + public RoyalTrooper(UUID ownerId) { + super(ownerId, 25, "Royal Trooper", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "S99"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Royal Trooper blocks, it gets +2/+2 until end of turn. + Effect effect = new BoostSourceEffect(2, 2, Duration.EndOfTurn); + effect.setText("it gets +2/+2 until end of turn"); + this.addAbility(new BlocksTriggeredAbility(effect, false)); + } + + public RoyalTrooper(final RoyalTrooper card) { + super(card); + } + + @Override + public RoyalTrooper copy() { + return new RoyalTrooper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/ScorchingSpear.java b/Mage.Sets/src/mage/sets/starter1999/ScorchingSpear.java new file mode 100644 index 00000000000..2535439b4ee --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/ScorchingSpear.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class ScorchingSpear extends CardImpl { + + public ScorchingSpear(UUID ownerId) { + super(ownerId, 116, "Scorching Spear", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}"); + this.expansionSetCode = "S99"; + + // Scorching Spear deals 1 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(1)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public ScorchingSpear(final ScorchingSpear card) { + super(card); + } + + @Override + public ScorchingSpear copy() { + return new ScorchingSpear(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/ShriekingSpecter.java b/Mage.Sets/src/mage/sets/starter1999/ShriekingSpecter.java new file mode 100644 index 00000000000..ec22bc1372e --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/ShriekingSpecter.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; + +/** + * + * @author fireshoes + */ +public class ShriekingSpecter extends CardImpl { + + public ShriekingSpecter(UUID ownerId) { + super(ownerId, 89, "Shrieking Specter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{B}"); + this.expansionSetCode = "S99"; + this.subtype.add("Specter"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever Shrieking Specter attacks, defending player discards a card. + this.addAbility(new AttacksTriggeredAbility(new DiscardTargetEffect(1), false, "Whenever {this} attacks, defending player discards a card.", SetTargetPointer.PLAYER)); + } + + public ShriekingSpecter(final ShriekingSpecter card) { + super(card); + } + + @Override + public ShriekingSpecter copy() { + return new ShriekingSpecter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/Steadfastness.java b/Mage.Sets/src/mage/sets/starter1999/Steadfastness.java new file mode 100644 index 00000000000..8770120e836 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/Steadfastness.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class Steadfastness extends CardImpl { + + public Steadfastness(UUID ownerId) { + super(ownerId, 27, "Steadfastness", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{W}"); + this.expansionSetCode = "S99"; + + // Creatures you control get +0/+3 until end of turn. + this.getSpellAbility().addEffect(new BoostControlledEffect(0, 3, Duration.EndOfTurn)); + } + + public Steadfastness(final Steadfastness card) { + super(card); + } + + @Override + public Steadfastness copy() { + return new Steadfastness(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/StreamOfAcid.java b/Mage.Sets/src/mage/sets/starter1999/StreamOfAcid.java new file mode 100644 index 00000000000..24608a61646 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/StreamOfAcid.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class StreamOfAcid extends CardImpl { + + public static final FilterPermanent filter = new FilterPermanent("land or nonblack creature"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.LAND), + Predicates.and( + Predicates.not(new ColorPredicate(ObjectColor.BLACK)), + new CardTypePredicate(CardType.CREATURE)))); + } + + public StreamOfAcid(UUID ownerId) { + super(ownerId, 91, "Stream of Acid", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); + this.expansionSetCode = "S99"; + + // Destroy target land or nonblack creature. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + public StreamOfAcid(final StreamOfAcid card) { + super(card); + } + + @Override + public StreamOfAcid copy() { + return new StreamOfAcid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/SylvanYeti.java b/Mage.Sets/src/mage/sets/starter1999/SylvanYeti.java new file mode 100644 index 00000000000..501a0dbc171 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/SylvanYeti.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.CardsInControllerHandCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class SylvanYeti extends CardImpl { + + public SylvanYeti(UUID ownerId) { + super(ownerId, 146, "Sylvan Yeti", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "S99"; + this.subtype.add("Yeti"); + this.power = new MageInt(0); + this.toughness = new MageInt(4); + + // Sylvan Yeti's power is equal to the number of cards in your hand. + Effect effect = new SetPowerSourceEffect(new CardsInControllerHandCount(), Duration.EndOfGame); + this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); + } + + public SylvanYeti(final SylvanYeti card) { + super(card); + } + + @Override + public SylvanYeti copy() { + return new SylvanYeti(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/TouchOfBrilliance.java b/Mage.Sets/src/mage/sets/starter1999/TouchOfBrilliance.java new file mode 100644 index 00000000000..03234776a57 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/TouchOfBrilliance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class TouchOfBrilliance extends mage.sets.portalsecondage.TouchOfBrilliance { + + public TouchOfBrilliance(UUID ownerId) { + super(ownerId); + this.cardNumber = 57; + this.expansionSetCode = "S99"; + } + + public TouchOfBrilliance(final TouchOfBrilliance card) { + super(card); + } + + @Override + public TouchOfBrilliance copy() { + return new TouchOfBrilliance(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/WickedPact.java b/Mage.Sets/src/mage/sets/starter1999/WickedPact.java new file mode 100644 index 00000000000..0812593a4eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/WickedPact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.starter1999; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WickedPact extends mage.sets.portal.WickedPact { + + public WickedPact(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "S99"; + } + + public WickedPact(final WickedPact card) { + super(card); + } + + @Override + public WickedPact copy() { + return new WickedPact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/Amok.java b/Mage.Sets/src/mage/sets/stronghold/Amok.java new file mode 100644 index 00000000000..730748afe88 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/Amok.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Amok extends CardImpl { + + public Amok(UUID ownerId) { + super(ownerId, 76, "Amok", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "STH"; + + // {1}, Discard a card at random: Put a +1/+1 counter on target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{1}")); + ability.addCost(new DiscardCardCost(true)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public Amok(final Amok card) { + super(card); + } + + @Override + public Amok copy() { + return new Amok(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/BrushWithDeath.java b/Mage.Sets/src/mage/sets/stronghold/BrushWithDeath.java new file mode 100644 index 00000000000..9e7e567a4f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/BrushWithDeath.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.keyword.BuybackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author LoneFox + */ +public class BrushWithDeath extends CardImpl { + + public BrushWithDeath(UUID ownerId) { + super(ownerId, 2, "Brush with Death", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}"); + this.expansionSetCode = "STH"; + + // Buyback {2}{B}{B} + this.addAbility(new BuybackAbility("{2}{B}{B}")); + // Target opponent loses 2 life. You gain 2 life. + this.getSpellAbility().addEffect(new LoseLifeTargetEffect(2)); + this.getSpellAbility().addEffect(new GainLifeEffect(2)); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public BrushWithDeath(final BrushWithDeath card) { + super(card); + } + + @Override + public BrushWithDeath copy() { + return new BrushWithDeath(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/Bullwhip.java b/Mage.Sets/src/mage/sets/stronghold/Bullwhip.java new file mode 100644 index 00000000000..f63732f299f --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/Bullwhip.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.combat.AttacksIfAbleTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Bullwhip extends CardImpl { + + public Bullwhip(UUID ownerId) { + super(ownerId, 126, "Bullwhip", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "STH"; + + // {2}, {tap}: Bullwhip deals 1 damage to target creature. That creature attacks this turn if able. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{2}")); + Effect effect = new AttacksIfAbleTargetEffect(Duration.EndOfTurn); + effect.setText("that creature attacks this turn if able"); + ability.addEffect(effect); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public Bullwhip(final Bullwhip card) { + super(card); + } + + @Override + public Bullwhip copy() { + return new Bullwhip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/CalmingLicid.java b/Mage.Sets/src/mage/sets/stronghold/CalmingLicid.java new file mode 100644 index 00000000000..2f3b09634eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/CalmingLicid.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LicidAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.combat.CantAttackAttachedEffect; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author emerald000 + */ +public class CalmingLicid extends CardImpl { + + public CalmingLicid(UUID ownerId) { + super(ownerId, 102, "Calming Licid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "STH"; + this.subtype.add("Licid"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {W}, {tap}: Calming Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {W} to end this effect. + this.addAbility(new LicidAbility(new ColoredManaCost(ColoredManaSymbol.W), new ColoredManaCost(ColoredManaSymbol.W))); + + // Enchanted creature can't attack. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackAttachedEffect(AttachmentType.AURA))); + } + + public CalmingLicid(final CalmingLicid card) { + super(card); + } + + @Override + public CalmingLicid copy() { + return new CalmingLicid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/ChangeOfHeart.java b/Mage.Sets/src/mage/sets/stronghold/ChangeOfHeart.java new file mode 100644 index 00000000000..37bda326618 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/ChangeOfHeart.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.effects.common.combat.CantAttackTargetEffect; +import mage.abilities.keyword.BuybackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ChangeOfHeart extends CardImpl { + + public ChangeOfHeart(UUID ownerId) { + super(ownerId, 103, "Change of Heart", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "STH"; + + // Buyback {3} + this.addAbility(new BuybackAbility("{3}")); + // Target creature can't attack this turn. + this.getSpellAbility().addEffect(new CantAttackTargetEffect(Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public ChangeOfHeart(final ChangeOfHeart card) { + super(card); + } + + @Override + public ChangeOfHeart copy() { + return new ChangeOfHeart(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/Contemplation.java b/Mage.Sets/src/mage/sets/stronghold/Contemplation.java new file mode 100644 index 00000000000..62520909369 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/Contemplation.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Contemplation extends CardImpl { + + public Contemplation(UUID ownerId) { + super(ownerId, 104, "Contemplation", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); + this.expansionSetCode = "STH"; + + // Whenever you cast a spell, you gain 1 life. + this.addAbility(new SpellCastControllerTriggeredAbility(new GainLifeEffect(1), false)); + } + + public Contemplation(final Contemplation card) { + super(card); + } + + @Override + public Contemplation copy() { + return new Contemplation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/Conviction.java b/Mage.Sets/src/mage/sets/stronghold/Conviction.java index 4cb431c4808..fe1d2a67de2 100644 --- a/Mage.Sets/src/mage/sets/stronghold/Conviction.java +++ b/Mage.Sets/src/mage/sets/stronghold/Conviction.java @@ -62,12 +62,12 @@ public class Conviction extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - + // Enchanted creature gets +1/+3. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 3, Duration.WhileOnBattlefield))); - + // {W}: Return Conviction to its owner's hand. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("U"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("W"))); } public Conviction(final Conviction card) { diff --git a/Mage.Sets/src/mage/sets/stronghold/ConvulsingLicid.java b/Mage.Sets/src/mage/sets/stronghold/ConvulsingLicid.java new file mode 100644 index 00000000000..ebb349d1880 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/ConvulsingLicid.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LicidAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.combat.CantBlockAttachedEffect; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author emerald000 + */ +public class ConvulsingLicid extends CardImpl { + + public ConvulsingLicid(UUID ownerId) { + super(ownerId, 77, "Convulsing Licid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "STH"; + this.subtype.add("Licid"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {R}, {tap}: Convulsing Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {R} to end this effect. + this.addAbility(new LicidAbility(new ColoredManaCost(ColoredManaSymbol.R), new ColoredManaCost(ColoredManaSymbol.R))); + + // Enchanted creature can't block. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBlockAttachedEffect(AttachmentType.AURA))); + } + + public ConvulsingLicid(final ConvulsingLicid card) { + super(card); + } + + @Override + public ConvulsingLicid copy() { + return new ConvulsingLicid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/CorruptingLicid.java b/Mage.Sets/src/mage/sets/stronghold/CorruptingLicid.java new file mode 100644 index 00000000000..081b7a3a61f --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/CorruptingLicid.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LicidAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.FearAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author emerald000 + */ +public class CorruptingLicid extends CardImpl { + + public CorruptingLicid(UUID ownerId) { + super(ownerId, 4, "Corrupting Licid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "STH"; + this.subtype.add("Licid"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {B}, {tap}: Corrupting Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {B} to end this effect. + this.addAbility(new LicidAbility(new ColoredManaCost(ColoredManaSymbol.B), new ColoredManaCost(ColoredManaSymbol.B))); + + // Enchanted creature has fear. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FearAbility.getInstance(), AttachmentType.AURA))); + } + + public CorruptingLicid(final CorruptingLicid card) { + super(card); + } + + @Override + public CorruptingLicid copy() { + return new CorruptingLicid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/CrossbowAmbush.java b/Mage.Sets/src/mage/sets/stronghold/CrossbowAmbush.java new file mode 100644 index 00000000000..e6b7a06173d --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/CrossbowAmbush.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class CrossbowAmbush extends CardImpl { + + public CrossbowAmbush(UUID ownerId) { + super(ownerId, 55, "Crossbow Ambush", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "STH"; + + // Creatures you control gain reach until end of turn. + this.getSpellAbility().addEffect(new GainAbilityControlledEffect(ReachAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent("Creatures"))); + } + + public CrossbowAmbush(final CrossbowAmbush card) { + super(card); + } + + @Override + public CrossbowAmbush copy() { + return new CrossbowAmbush(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/DuctCrawler.java b/Mage.Sets/src/mage/sets/stronghold/DuctCrawler.java new file mode 100644 index 00000000000..7bf0bd84f6b --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/DuctCrawler.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CantBeBlockedByTargetSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author anonymous + */ +public class DuctCrawler extends CardImpl { + + public DuctCrawler(UUID ownerId) { + super(ownerId, 79, "Duct Crawler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "STH"; + this.subtype.add("Insect"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{R}: Target creature can't block Duct Crawler this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedByTargetSourceEffect(Duration.EndOfTurn), + new ManaCostsImpl("{1}{R}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public DuctCrawler(final DuctCrawler card) { + super(card); + } + + @Override + public DuctCrawler copy() { + return new DuctCrawler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/FlowstoneShambler.java b/Mage.Sets/src/mage/sets/stronghold/FlowstoneShambler.java new file mode 100644 index 00000000000..b64a081c058 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/FlowstoneShambler.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class FlowstoneShambler extends mage.sets.ninthedition.FlowstoneShambler { + + public FlowstoneShambler(UUID ownerId) { + super(ownerId); + this.cardNumber = 86; + this.expansionSetCode = "STH"; + } + + public FlowstoneShambler(final FlowstoneShambler card) { + super(card); + } + + @Override + public FlowstoneShambler copy() { + return new FlowstoneShambler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/FurnaceSpirit.java b/Mage.Sets/src/mage/sets/stronghold/FurnaceSpirit.java new file mode 100644 index 00000000000..1463d52a822 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/FurnaceSpirit.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FurnaceSpirit extends CardImpl { + + public FurnaceSpirit(UUID ownerId) { + super(ownerId, 87, "Furnace Spirit", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "STH"; + this.subtype.add("Spirit"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // {R}: Furnace Spirit gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public FurnaceSpirit(final FurnaceSpirit card) { + super(card); + } + + @Override + public FurnaceSpirit copy() { + return new FurnaceSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/GlidingLicid.java b/Mage.Sets/src/mage/sets/stronghold/GlidingLicid.java new file mode 100644 index 00000000000..6f9a8feffb3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/GlidingLicid.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LicidAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author emerald000 + */ +public class GlidingLicid extends CardImpl { + + public GlidingLicid(UUID ownerId) { + super(ownerId, 31, "Gliding Licid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "STH"; + this.subtype.add("Licid"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {U}, {tap}: Gliding Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {U} to end this effect. + this.addAbility(new LicidAbility(new ColoredManaCost(ColoredManaSymbol.U), new ColoredManaCost(ColoredManaSymbol.U))); + + // Enchanted creature has flying. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA))); + } + + public GlidingLicid(final GlidingLicid card) { + super(card); + } + + @Override + public GlidingLicid copy() { + return new GlidingLicid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/Heartstone.java b/Mage.Sets/src/mage/sets/stronghold/Heartstone.java index 4b4af5e2c9a..0d530dfacd3 100644 --- a/Mage.Sets/src/mage/sets/stronghold/Heartstone.java +++ b/Mage.Sets/src/mage/sets/stronghold/Heartstone.java @@ -30,6 +30,7 @@ package mage.sets.stronghold; import java.util.UUID; import mage.Mana; import mage.abilities.Ability; +import mage.abilities.ActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.cost.CostModificationEffectImpl; import mage.cards.CardImpl; @@ -99,7 +100,8 @@ class HeartstoneEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED)) { + if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED) + || (abilityToModify.getAbilityType().equals(AbilityType.MANA) && (abilityToModify instanceof ActivatedAbility))) { // Activated abilities of creatures Permanent permanent = game.getPermanent(abilityToModify.getSourceId()); if (permanent != null && filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) { diff --git a/Mage.Sets/src/mage/sets/stronghold/Hesitation.java b/Mage.Sets/src/mage/sets/stronghold/Hesitation.java new file mode 100644 index 00000000000..da704679fb5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/Hesitation.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.common.SpellCastAllTriggeredAbility; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.filter.FilterSpell; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; + +/** + * + * @author LoneFox + */ +public class Hesitation extends CardImpl { + + public Hesitation(UUID ownerId) { + super(ownerId, 33, "Hesitation", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "STH"; + + // When a player casts a spell, sacrifice Hesitation and counter that spell. + Ability ability = new SpellCastAllTriggeredAbility(new SacrificeSourceEffect(), new FilterSpell("a spell"), false, SetTargetPointer.SPELL); + Effect effect = new CounterTargetEffect(); + effect.setText("and counter that spell"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public Hesitation(final Hesitation card) { + super(card); + } + + @Override + public Hesitation copy() { + return new Hesitation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/IntruderAlarm.java b/Mage.Sets/src/mage/sets/stronghold/IntruderAlarm.java index 2fe7b279841..83e4c1a291b 100644 --- a/Mage.Sets/src/mage/sets/stronghold/IntruderAlarm.java +++ b/Mage.Sets/src/mage/sets/stronghold/IntruderAlarm.java @@ -28,18 +28,17 @@ package mage.sets.stronghold; import java.util.UUID; - -import mage.constants.*; -import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; +import mage.abilities.effects.common.UntapAllEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; /** * @@ -53,9 +52,9 @@ public class IntruderAlarm extends CardImpl { // Creatures don't untap during their controllers' untap steps. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, new FilterCreaturePermanent("Creatures")))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, new FilterCreaturePermanent("creatures")))); // Whenever a creature enters the battlefield, untap all creatures. - this.addAbility(new EntersBattlefieldAllTriggeredAbility(new UntapAllCreatureEffect(), new FilterCreaturePermanent())); + this.addAbility(new EntersBattlefieldAllTriggeredAbility(new UntapAllEffect(new FilterCreaturePermanent("creatures")), new FilterCreaturePermanent("a creature"))); } public IntruderAlarm(final IntruderAlarm card) { @@ -67,33 +66,3 @@ public class IntruderAlarm extends CardImpl { return new IntruderAlarm(this); } } - -class UntapAllCreatureEffect extends OneShotEffect { - - public UntapAllCreatureEffect() { - super(Outcome.Untap); - staticText = "untap all creatures"; - } - - public UntapAllCreatureEffect(final UntapAllCreatureEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - for (Permanent land: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { - land.untap(game); - } - return true; - } - return false; - } - - @Override - public UntapAllCreatureEffect copy() { - return new UntapAllCreatureEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/stronghold/LancersEnKor.java b/Mage.Sets/src/mage/sets/stronghold/LancersEnKor.java new file mode 100644 index 00000000000..45b9ceefb42 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/LancersEnKor.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.RedirectDamageFromSourceToTargetEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class LancersEnKor extends CardImpl { + + public LancersEnKor(UUID ownerId) { + super(ownerId, 108, "Lancers en-Kor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "STH"; + this.subtype.add("Kor"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // {0}: The next 1 damage that would be dealt to Lancers en-Kor this turn is dealt to target creature you control instead. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RedirectDamageFromSourceToTargetEffect(Duration.EndOfTurn, 1, true), new GenericManaCost(0)); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + public LancersEnKor(final LancersEnKor card) { + super(card); + } + + @Override + public LancersEnKor copy() { + return new LancersEnKor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/Leap.java b/Mage.Sets/src/mage/sets/stronghold/Leap.java new file mode 100644 index 00000000000..2ad2988484e --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/Leap.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Leap extends CardImpl { + + public Leap(UUID ownerId) { + super(ownerId, 35, "Leap", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "STH"; + + // Target creature gains flying until end of turn. + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public Leap(final Leap card) { + super(card); + } + + @Override + public Leap copy() { + return new Leap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/MindGames.java b/Mage.Sets/src/mage/sets/stronghold/MindGames.java new file mode 100644 index 00000000000..4c8062a91ee --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/MindGames.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.BuybackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class MindGames extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or land"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); + } + + public MindGames(UUID ownerId) { + super(ownerId, 38, "Mind Games", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "STH"; + + // Buyback {2}{U} + this.addAbility(new BuybackAbility("{3}")); + + // Tap target artifact, creature, or land. + this.getSpellAbility().addEffect(new TapTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + public MindGames(final MindGames card) { + super(card); + } + + @Override + public MindGames copy() { + return new MindGames(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/Mindwarper.java b/Mage.Sets/src/mage/sets/stronghold/Mindwarper.java new file mode 100644 index 00000000000..336d9dcf743 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/Mindwarper.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.TargetPlayer; + +/** + * + * @author LoneFox + */ +public class Mindwarper extends CardImpl { + + public Mindwarper(UUID ownerId) { + super(ownerId, 14, "Mindwarper", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "STH"; + this.subtype.add("Spirit"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Mindwarper enters the battlefield with three +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it")); + // {2}{B}, Remove a +1/+1 counter from Mindwarper: Target player discards a card. Activate this ability only any time you could cast a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1), new ManaCostsImpl("{2}{B}")); + ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance())); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public Mindwarper(final Mindwarper card) { + super(card); + } + + @Override + public Mindwarper copy() { + return new Mindwarper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/MobJustice.java b/Mage.Sets/src/mage/sets/stronghold/MobJustice.java new file mode 100644 index 00000000000..d2acb4c934c --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/MobJustice.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.target.TargetPlayer; + +/** + * + * @author LoneFox + */ +public class MobJustice extends CardImpl { + + public MobJustice(UUID ownerId) { + super(ownerId, 90, "Mob Justice", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); + this.expansionSetCode = "STH"; + + // Mob Justice deals damage to target player equal to the number of creatures you control. + Effect effect = new DamageTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent())); + effect.setText("{this} deals damage to target player equal to the number of creatures you control"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + public MobJustice(final MobJustice card) { + super(card); + } + + @Override + public MobJustice copy() { + return new MobJustice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/MorgueThrull.java b/Mage.Sets/src/mage/sets/stronghold/MorgueThrull.java new file mode 100644 index 00000000000..2a6eff55e7d --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/MorgueThrull.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class MorgueThrull extends CardImpl { + + public MorgueThrull(UUID ownerId) { + super(ownerId, 15, "Morgue Thrull", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "STH"; + this.subtype.add("Thrull"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Sacrifice Morgue Thrull: Put the top three cards of your library into your graveyard. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutTopCardOfLibraryIntoGraveControllerEffect(3), new SacrificeSourceCost())); + } + + public MorgueThrull(final MorgueThrull card) { + super(card); + } + + @Override + public MorgueThrull copy() { + return new MorgueThrull(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/NomadsEnKor.java b/Mage.Sets/src/mage/sets/stronghold/NomadsEnKor.java index 2c2bf9a230f..1c3d0aa8da8 100644 --- a/Mage.Sets/src/mage/sets/stronghold/NomadsEnKor.java +++ b/Mage.Sets/src/mage/sets/stronghold/NomadsEnKor.java @@ -32,8 +32,10 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.RedirectDamageFromSourceToTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; import mage.target.common.TargetControlledCreaturePermanent; @@ -55,7 +57,7 @@ public class NomadsEnKor extends CardImpl { this.toughness = new MageInt(1); // {0}: The next 1 damage that would be dealt to Nomads en-Kor this turn is dealt to target creature you control instead. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ShamanEnKorPreventionEffect(), new GenericManaCost(0)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RedirectDamageFromSourceToTargetEffect(Duration.EndOfTurn, 1, true), new GenericManaCost(0)); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); } @@ -68,4 +70,4 @@ public class NomadsEnKor extends CardImpl { public NomadsEnKor copy() { return new NomadsEnKor(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/stronghold/PursuitOfKnowledge.java b/Mage.Sets/src/mage/sets/stronghold/PursuitOfKnowledge.java new file mode 100644 index 00000000000..4a8c05ed398 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/PursuitOfKnowledge.java @@ -0,0 +1,123 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author LoneFox + */ +public class PursuitOfKnowledge extends CardImpl { + + public PursuitOfKnowledge(UUID ownerId) { + super(ownerId, 110, "Pursuit of Knowledge", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "STH"; + + // If you would draw a card, you may put a study counter on Pursuit of Knowledge instead. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PursuitOfKnowledgeEffect())); + // Remove three study counters from Pursuit of Knowledge, Sacrifice Pursuit of Knowledge: Draw seven cards. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(7), + new RemoveCountersSourceCost(CounterType.STUDY.createInstance(3))); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public PursuitOfKnowledge(final PursuitOfKnowledge card) { + super(card); + } + + @Override + public PursuitOfKnowledge copy() { + return new PursuitOfKnowledge(this); + } +} + +class PursuitOfKnowledgeEffect extends ReplacementEffectImpl { + + public PursuitOfKnowledgeEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "If you would draw a card, you may put a study counter on {this} instead"; + } + + public PursuitOfKnowledgeEffect(final PursuitOfKnowledgeEffect effect) { + super(effect); + } + + @Override + public PursuitOfKnowledgeEffect copy() { + return new PursuitOfKnowledgeEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DRAW_CARD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getPlayerId().equals(source.getControllerId()); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Player controller = game.getPlayer(event.getPlayerId()); + if(controller != null) { + if(controller.chooseUse(Outcome.Benefit, "Add a study counter instead of drawing a card?", source, game)) { + new AddCountersSourceEffect(CounterType.STUDY.createInstance()).apply(game, source); + return true; + } + } + return false; + } +} + diff --git a/Mage.Sets/src/mage/sets/stronghold/RabidRats.java b/Mage.Sets/src/mage/sets/stronghold/RabidRats.java new file mode 100644 index 00000000000..628d6224f67 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/RabidRats.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterBlockingCreature; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class RabidRats extends CardImpl { + + public RabidRats(UUID ownerId) { + super(ownerId, 17, "Rabid Rats", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "STH"; + this.subtype.add("Rat"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Target blocking creature gets -1/-1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-1, -1, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(new FilterBlockingCreature())); + this.addAbility(ability); + } + + public RabidRats(final RabidRats card) { + super(card); + } + + @Override + public RabidRats copy() { + return new RabidRats(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/ReinsOfPower.java b/Mage.Sets/src/mage/sets/stronghold/ReinsOfPower.java new file mode 100644 index 00000000000..98c5bcd4548 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/ReinsOfPower.java @@ -0,0 +1,133 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.UntapAllEffect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetOpponent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author emerald000 + */ +public class ReinsOfPower extends CardImpl { + + public ReinsOfPower(UUID ownerId) { + super(ownerId, 41, "Reins of Power", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); + this.expansionSetCode = "STH"; + + // Untap all creatures you control and all creatures target opponent controls. You and that opponent each gain control of all creatures the other controls until end of turn. Those creatures gain haste until end of turn. + this.getSpellAbility().addEffect(new ReinsOfPowerEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public ReinsOfPower(final ReinsOfPower card) { + super(card); + } + + @Override + public ReinsOfPower copy() { + return new ReinsOfPower(this); + } +} + +class ReinsOfPowerEffect extends OneShotEffect { + + ReinsOfPowerEffect() { + super(Outcome.Benefit); + this.staticText = "Untap all creatures you control and all creatures target opponent controls. You and that opponent each gain control of all creatures the other controls until end of turn. Those creatures gain haste until end of turn"; + } + + ReinsOfPowerEffect(final ReinsOfPowerEffect effect) { + super(effect); + } + + @Override + public ReinsOfPowerEffect copy() { + return new ReinsOfPowerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID opponentId = this.getTargetPointer().getFirst(game, source); + if (opponentId != null) { + // Untap all creatures you control and all creatures target opponent controls. + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + filter.add(Predicates.or(new ControllerIdPredicate(source.getControllerId()), new ControllerIdPredicate(opponentId))); + new UntapAllEffect(filter).apply(game, source); + + // You and that opponent each gain control of all creatures the other controls until end of turn. + Set yourCreatures = new HashSet<>(); + Set opponentCreatures = new HashSet<>(); + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + yourCreatures.add(permanent.getId()); + } + FilterCreaturePermanent filterOpponent = new FilterCreaturePermanent(); + filterOpponent.add(new ControllerIdPredicate(opponentId)); + for (Permanent permanent : game.getBattlefield().getActivePermanents(filterOpponent, source.getControllerId(), source.getSourceId(), game)) { + opponentCreatures.add(permanent.getId()); + } + for (UUID creatureId : yourCreatures) { + ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, opponentId); + effect.setTargetPointer(new FixedTarget(creatureId)); + game.addEffect(effect, source); + } + for (UUID creatureId : opponentCreatures) { + ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn); + effect.setTargetPointer(new FixedTarget(creatureId)); + game.addEffect(effect, source); + } + + // Those creatures gain haste until end of turn. + game.addEffect(new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.EndOfTurn, filter), source); + + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/RollingStones.java b/Mage.Sets/src/mage/sets/stronghold/RollingStones.java index a37bc80bbe7..f60560ec5c6 100644 --- a/Mage.Sets/src/mage/sets/stronghold/RollingStones.java +++ b/Mage.Sets/src/mage/sets/stronghold/RollingStones.java @@ -29,7 +29,7 @@ package mage.sets.stronghold; import java.util.UUID; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderAllEffect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderAllEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -56,7 +56,7 @@ public class RollingStones extends CardImpl { // Wall creatures can attack as though they didn't have defender. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughtItDidntHaveDefenderAllEffect(Duration.WhileOnBattlefield, filter))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderAllEffect(Duration.WhileOnBattlefield, filter))); } public RollingStones(final RollingStones card) { diff --git a/Mage.Sets/src/mage/sets/stronghold/ShamanEnKor.java b/Mage.Sets/src/mage/sets/stronghold/ShamanEnKor.java index 97c5d5349e0..e112c7f7821 100644 --- a/Mage.Sets/src/mage/sets/stronghold/ShamanEnKor.java +++ b/Mage.Sets/src/mage/sets/stronghold/ShamanEnKor.java @@ -29,14 +29,13 @@ package mage.sets.stronghold; import java.util.UUID; import mage.MageInt; -import mage.MageObject; +import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.PreventionEffectData; -import mage.abilities.effects.PreventionEffectImpl; -import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.RedirectionEffect; +import mage.abilities.effects.common.RedirectDamageFromSourceToTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -44,11 +43,10 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; -import mage.game.events.DamageEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.players.Player; +import mage.target.TargetPermanent; import mage.target.TargetSource; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -70,12 +68,13 @@ public class ShamanEnKor extends CardImpl { this.toughness = new MageInt(2); // {0}: The next 1 damage that would be dealt to Shaman en-Kor this turn is dealt to target creature you control instead. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ShamanEnKorPreventionEffect(), new GenericManaCost(0)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new RedirectDamageFromSourceToTargetEffect(Duration.EndOfTurn, 1, true), new GenericManaCost(0)); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); - + // {1}{W}: The next time a source of your choice would deal damage to target creature this turn, that damage is dealt to Shaman en-Kor instead. - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ShamanEnKorReplacementEffect(), new ManaCostsImpl("{1}{W}")); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ShamanEnKorRedirectFromTargetEffect(), new ManaCostsImpl("{1}{W}")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } @@ -90,129 +89,43 @@ public class ShamanEnKor extends CardImpl { } } -class ShamanEnKorPreventionEffect extends PreventionEffectImpl { - - ShamanEnKorPreventionEffect() { - super(Duration.EndOfTurn, 1, false); - staticText = "The next 1 damage that would be dealt to {this} this turn is dealt to target creature you control instead."; - } - - ShamanEnKorPreventionEffect(final ShamanEnKorPreventionEffect effect) { - super(effect); - } - - @Override - public ShamanEnKorPreventionEffect copy() { - return new ShamanEnKorPreventionEffect(this); - } - - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - PreventionEffectData preventionResult = preventDamageAction(event, source, game); - if (preventionResult.getPreventedDamage() > 0) { - Permanent redirectTo = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (redirectTo != null) { - game.informPlayers("Dealing " + preventionResult.getPreventedDamage() + " to " + redirectTo.getName() + " instead."); - DamageEvent damageEvent = (DamageEvent) event; - redirectTo.damage(preventionResult.getPreventedDamage(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects()); - } - } - return false; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (!this.used && super.applies(event, source, game)) { - if (event.getTargetId().equals(source.getSourceId())) { - return game.getPermanent(getTargetPointer().getFirst(game, source)) != null; - } - } - return false; - } -} +class ShamanEnKorRedirectFromTargetEffect extends RedirectionEffect { -class ShamanEnKorReplacementEffect extends ReplacementEffectImpl { - - protected TargetSource targetSource; + protected MageObjectReference sourceObject; - ShamanEnKorReplacementEffect() { - super(Duration.EndOfTurn, Outcome.RedirectDamage); + ShamanEnKorRedirectFromTargetEffect() { + super(Duration.EndOfTurn, Integer.MAX_VALUE, true); staticText = "The next time a source of your choice would deal damage to target creature this turn, that damage is dealt to {this} instead"; } - ShamanEnKorReplacementEffect(final ShamanEnKorReplacementEffect effect) { + ShamanEnKorRedirectFromTargetEffect(final ShamanEnKorRedirectFromTargetEffect effect) { super(effect); - targetSource = effect.targetSource; + sourceObject = effect.sourceObject; } @Override public void init(Ability source, Game game) { Player player = game.getPlayer(source.getControllerId()); - TargetSource target = new TargetSource(); - target.setNotTarget(true); if (player != null) { + TargetSource target = new TargetSource(); target.choose(Outcome.PreventDamage, player.getId(), source.getSourceId(), game); - this.targetSource = target; + this.sourceObject = new MageObjectReference(target.getFirstTarget(), game); + } else { + discard(); } } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.DAMAGE_CREATURE; } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (!this.used) { - if (targetSource != null) { - if (event.getSourceId().equals(targetSource.getFirstTarget())) { - // check source - MageObject object = game.getObject(event.getSourceId()); - if (object == null) { - game.informPlayers("Couldn't find source of damage"); - return false; - } - else { - if (event.getTargetId().equals(source.getFirstTarget())) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - return true; - } - } - } - } - } - } - return false; - } @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - DamageEvent damageEvent = (DamageEvent)event; - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (sourcePermanent != null) { - // get name of old target - Permanent targetPermanent = game.getPermanent(event.getTargetId()); - StringBuilder message = new StringBuilder(); - message.append(sourcePermanent.getName()).append(": gets "); - message.append(damageEvent.getAmount()).append(" damage redirected from "); - if (targetPermanent != null) { - message.append(targetPermanent.getName()); - } - else { - Player targetPlayer = game.getPlayer(event.getTargetId()); - if (targetPlayer != null) { - message.append(targetPlayer.getLogName()); - } - else { - message.append("unknown"); - } - } - game.informPlayers(message.toString()); - // redirect damage - this.used = true; - sourcePermanent.damage(damageEvent.getAmount(), damageEvent.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects()); - return true; + public boolean applies(GameEvent event, Ability source, Game game) { + if (sourceObject.equals(new MageObjectReference(event.getSourceId(), game))) { + redirectTarget = new TargetPermanent(); + redirectTarget.add(source.getSourceId(), game); + return event.getTargetId().equals(getTargetPointer().getFirst(game, source)); } return false; } @@ -223,7 +136,7 @@ class ShamanEnKorReplacementEffect extends ReplacementEffectImpl { } @Override - public ShamanEnKorReplacementEffect copy() { - return new ShamanEnKorReplacementEffect(this); + public ShamanEnKorRedirectFromTargetEffect copy() { + return new ShamanEnKorRedirectFromTargetEffect(this); } } diff --git a/Mage.Sets/src/mage/sets/stronghold/ShiftingWall.java b/Mage.Sets/src/mage/sets/stronghold/ShiftingWall.java new file mode 100644 index 00000000000..ec925d98134 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/ShiftingWall.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + */ +public class ShiftingWall extends CardImpl { + + public ShiftingWall(UUID ownerId) { + super(ownerId, 134, "Shifting Wall", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{X}"); + this.expansionSetCode = "STH"; + this.subtype.add("Wall"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Shifting Wall enters the battlefield with X +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); + } + + public ShiftingWall(final ShiftingWall card) { + super(card); + } + + @Override + public ShiftingWall copy() { + return new ShiftingWall(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/SkyshroudArcher.java b/Mage.Sets/src/mage/sets/stronghold/SkyshroudArcher.java new file mode 100644 index 00000000000..10d3bd2ee1e --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/SkyshroudArcher.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SkyshroudArcher extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public SkyshroudArcher(UUID ownerId) { + super(ownerId, 64, "Skyshroud Archer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "STH"; + this.subtype.add("Elf"); + this.subtype.add("Archer"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Target creature with flying gets -1/-1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-1, -1, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public SkyshroudArcher(final SkyshroudArcher card) { + super(card); + } + + @Override + public SkyshroudArcher copy() { + return new SkyshroudArcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/SkyshroudTroopers.java b/Mage.Sets/src/mage/sets/stronghold/SkyshroudTroopers.java new file mode 100644 index 00000000000..7bcca637571 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/SkyshroudTroopers.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.mana.GreenManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SkyshroudTroopers extends CardImpl { + + public SkyshroudTroopers(UUID ownerId) { + super(ownerId, 65, "Skyshroud Troopers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "STH"; + this.subtype.add("Elf"); + this.subtype.add("Druid"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {tap}: Add {G} to your mana pool. + this.addAbility(new GreenManaAbility()); + } + + public SkyshroudTroopers(final SkyshroudTroopers card) { + super(card); + } + + @Override + public SkyshroudTroopers copy() { + return new SkyshroudTroopers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/SliverQueen.java b/Mage.Sets/src/mage/sets/stronghold/SliverQueen.java index a7d7b7c7273..c5218656fc1 100644 --- a/Mage.Sets/src/mage/sets/stronghold/SliverQueen.java +++ b/Mage.Sets/src/mage/sets/stronghold/SliverQueen.java @@ -36,7 +36,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SliverToken; /** * @@ -66,14 +66,3 @@ public class SliverQueen extends CardImpl { return new SliverQueen(this); } } - -class SliverToken extends Token { - - public SliverToken() { - super("Sliver", "1/1 colorless Sliver creature token"); - cardType.add(CardType.CREATURE); - subtype.add("Sliver"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/stronghold/SpikeSoldier.java b/Mage.Sets/src/mage/sets/stronghold/SpikeSoldier.java new file mode 100644 index 00000000000..503276d58e9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/SpikeSoldier.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SpikeSoldier extends CardImpl { + + public SpikeSoldier(UUID ownerId) { + super(ownerId, 69, "Spike Soldier", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "STH"; + this.subtype.add("Spike"); + this.subtype.add("Soldier"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Spike Soldier enters the battlefield with three +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it")); + // {2}, Remove a +1/+1 counter from Spike Soldier: Put a +1/+1 counter on target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{2}")); + ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance())); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + // Remove a +1/+1 counter from Spike Soldier: Spike Soldier gets +2/+2 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), + new RemoveCountersSourceCost(CounterType.P1P1.createInstance()))); + } + + public SpikeSoldier(final SpikeSoldier card) { + super(card); + } + + @Override + public SpikeSoldier copy() { + return new SpikeSoldier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/SpikeWorker.java b/Mage.Sets/src/mage/sets/stronghold/SpikeWorker.java new file mode 100644 index 00000000000..ae078c7b71a --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/SpikeWorker.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SpikeWorker extends CardImpl { + + public SpikeWorker(UUID ownerId) { + super(ownerId, 70, "Spike Worker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "STH"; + this.subtype.add("Spike"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Spike Worker enters the battlefield with two +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), "with two +1/+1 counters on it")); + // {2}, Remove a +1/+1 counter from Spike Worker: Put a +1/+1 counter on target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl("{2}")); + ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance())); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public SpikeWorker(final SpikeWorker card) { + super(card); + } + + @Override + public SpikeWorker copy() { + return new SpikeWorker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/SpindriftDrake.java b/Mage.Sets/src/mage/sets/stronghold/SpindriftDrake.java new file mode 100644 index 00000000000..85e148eca4a --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/SpindriftDrake.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class SpindriftDrake extends CardImpl { + + public SpindriftDrake(UUID ownerId) { + super(ownerId, 44, "Spindrift Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "STH"; + this.subtype.add("Drake"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // At the beginning of your upkeep, sacrifice Spindrift Drake unless you pay {U}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{U}")), TargetController.YOU, false)); + } + + public SpindriftDrake(final SpindriftDrake card) { + super(card); + } + + @Override + public SpindriftDrake copy() { + return new SpindriftDrake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/TemptingLicid.java b/Mage.Sets/src/mage/sets/stronghold/TemptingLicid.java new file mode 100644 index 00000000000..7666b868b92 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/TemptingLicid.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LicidAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.combat.MustBeBlockedByAllAttachedEffect; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author emerald000 + */ +public class TemptingLicid extends CardImpl { + + public TemptingLicid(UUID ownerId) { + super(ownerId, 72, "Tempting Licid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "STH"; + this.subtype.add("Licid"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {G}, {tap}: Tempting Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {G} to end this effect. + this.addAbility(new LicidAbility(new ColoredManaCost(ColoredManaSymbol.G), new ColoredManaCost(ColoredManaSymbol.G))); + + // All creatures able to block enchanted creature do so. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBeBlockedByAllAttachedEffect(AttachmentType.AURA))); + } + + public TemptingLicid(final TemptingLicid card) { + super(card); + } + + @Override + public TemptingLicid copy() { + return new TemptingLicid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/ThalakosDeceiver.java b/Mage.Sets/src/mage/sets/stronghold/ThalakosDeceiver.java new file mode 100644 index 00000000000..bc0506ebca0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/ThalakosDeceiver.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ThalakosDeceiver extends CardImpl { + + public ThalakosDeceiver(UUID ownerId) { + super(ownerId, 45, "Thalakos Deceiver", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "STH"; + this.subtype.add("Thalakos"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // Whenever Thalakos Deceiver attacks and isn't blocked, you may sacrifice it. If you do, gain control of target creature. + Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(new DoIfCostPaid(new GainControlTargetEffect(Duration.EndOfGame), new SacrificeSourceCost())); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ThalakosDeceiver(final ThalakosDeceiver card) { + super(card); + } + + @Override + public ThalakosDeceiver copy() { + return new ThalakosDeceiver(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/Torment.java b/Mage.Sets/src/mage/sets/stronghold/Torment.java new file mode 100644 index 00000000000..42f2de23cf2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/Torment.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Torment extends CardImpl { + + public Torment(UUID ownerId) { + super(ownerId, 23, "Torment", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "STH"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets -3/-0. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(-3, 0, Duration.WhileOnBattlefield))); + } + + public Torment(final Torment card) { + super(card); + } + + @Override + public Torment copy() { + return new Torment(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/TorturedExistence.java b/Mage.Sets/src/mage/sets/stronghold/TorturedExistence.java new file mode 100644 index 00000000000..8c9bb1aea4f --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/TorturedExistence.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author fireshoes + */ +public class TorturedExistence extends CardImpl { + + public TorturedExistence(UUID ownerId) { + super(ownerId, 24, "Tortured Existence", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); + this.expansionSetCode = "STH"; + + // {B}, Discard a creature card: Return target creature card from your graveyard to your hand. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToHandTargetEffect(), new ManaCostsImpl("{B}")); + ability.addCost(new DiscardCardCost(new FilterCreatureCard())); + ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + this.addAbility(ability); + } + + public TorturedExistence(final TorturedExistence card) { + super(card); + } + + @Override + public TorturedExistence copy() { + return new TorturedExistence(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/ApesOfRath.java b/Mage.Sets/src/mage/sets/tempest/ApesOfRath.java new file mode 100644 index 00000000000..9716244bdb9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/ApesOfRath.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ApesOfRath extends CardImpl { + + public ApesOfRath(UUID ownerId) { + super(ownerId, 108, "Apes of Rath", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Ape"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Whenever Apes of Rath attacks, it doesn't untap during its controller's next untap step. + this.addAbility(new AttacksTriggeredAbility(new DontUntapInControllersNextUntapStepSourceEffect(), false)); + } + + public ApesOfRath(final ApesOfRath card) { + super(card); + } + + @Override + public ApesOfRath copy() { + return new ApesOfRath(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/Apocalypse.java b/Mage.Sets/src/mage/sets/tempest/Apocalypse.java new file mode 100644 index 00000000000..ec63ce33d58 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/Apocalypse.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author markedagain + */ +public class Apocalypse extends CardImpl { + + public Apocalypse(UUID ownerId) { + super(ownerId, 162, "Apocalypse", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{R}{R}{R}"); + this.expansionSetCode = "TMP"; + + // Exile all permanents. You discard your hand. + this.getSpellAbility().addEffect(new ApocalypseExileAllPermanentsEffect()); + this.getSpellAbility().addEffect(new ApocalypseDiscardEffect()); + } + + public Apocalypse(final Apocalypse card) { + super(card); + } + + @Override + public Apocalypse copy() { + return new Apocalypse(this); + } +} +class ApocalypseDiscardEffect extends OneShotEffect { + + public ApocalypseDiscardEffect() { + super(Outcome.Discard); + this.staticText = "Discard your hand"; + } + + public ApocalypseDiscardEffect(final ApocalypseDiscardEffect effect) { + super(effect); + } + + @Override + public ApocalypseDiscardEffect copy() { + return new ApocalypseDiscardEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + for (Card card : player.getHand().getCards(game)) { + player.discard(card, source, game); + } + return true; + } + return false; + } +} +class ApocalypseExileAllPermanentsEffect extends OneShotEffect { + + public ApocalypseExileAllPermanentsEffect() { + super(Outcome.Exile); + staticText = "Exile all permanents"; + } + + public ApocalypseExileAllPermanentsEffect(final ApocalypseExileAllPermanentsEffect effect) { + super(effect); + } + + @Override + public ApocalypseExileAllPermanentsEffect copy() { + return new ApocalypseExileAllPermanentsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents()) { + permanent.moveToExile(null, null, source.getSourceId(), game); + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tempest/BloodFrenzy.java b/Mage.Sets/src/mage/sets/tempest/BloodFrenzy.java new file mode 100644 index 00000000000..14096501176 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/BloodFrenzy.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.common.DestroyTargetAtBeginningOfNextEndStepEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.TurnPhase; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.common.TargetAttackingOrBlockingCreature; + +/** + * + * @author LoneFox + */ +public class BloodFrenzy extends CardImpl { + + public BloodFrenzy(UUID ownerId) { + super(ownerId, 164, "Blood Frenzy", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "TMP"; + + // Cast Blood Frenzy only before the combat damage step. + Ability ability = new SimpleStaticAbility(Zone.ALL, new BloodFrenzyCastRestriction()); + ability.setRuleAtTheTop(true); + this.addAbility(ability); + // Target attacking or blocking creature gets +4/+0 until end of turn. Destroy that creature at the beginning of the next end step. + this.getSpellAbility().addEffect(new BoostTargetEffect(4, 0, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new DestroyTargetAtBeginningOfNextEndStepEffect()); + this.getSpellAbility().addTarget(new TargetAttackingOrBlockingCreature()); + } + + public BloodFrenzy(final BloodFrenzy card) { + super(card); + } + + @Override + public BloodFrenzy copy() { + return new BloodFrenzy(this); + } +} + + +class BloodFrenzyCastRestriction extends ContinuousRuleModifyingEffectImpl { + + BloodFrenzyCastRestriction() { + super(Duration.EndOfGame, Outcome.Detriment); + staticText = "Cast {this} only before the combat damage step"; + } + + BloodFrenzyCastRestriction(final BloodFrenzyCastRestriction effect) { + super(effect); + } + + @Override + public BloodFrenzyCastRestriction copy() { + return new BloodFrenzyCastRestriction(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType().equals(GameEvent.EventType.CAST_SPELL); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if(event.getSourceId().equals(source.getSourceId())) { + if(game.getPhase().getType().equals(TurnPhase.COMBAT) + // There cannot be a legal target before declare attackers, + // so in practice it is limited to these two steps. + && (game.getStep().getType().equals(PhaseStep.DECLARE_ATTACKERS) + || game.getStep().getType().equals(PhaseStep.DECLARE_BLOCKERS))) { + return false; + } + return true; + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/BountyHunter.java b/Mage.Sets/src/mage/sets/tempest/BountyHunter.java new file mode 100644 index 00000000000..d73314cfd38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/BountyHunter.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.permanent.CounterPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class BountyHunter extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature with a bounty counter on it"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + filter2.add(new CounterPredicate(CounterType.BOUNTY)); + } + + public BountyHunter(UUID ownerId) { + super(ownerId, 4, "Bounty Hunter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Human"); + this.subtype.add("Archer"); + this.subtype.add("Minion"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {tap}: Put a bounty counter on target nonblack creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.BOUNTY.createInstance()), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + // {tap}: Destroy target creature with a bounty counter on it. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter2)); + this.addAbility(ability); + } + + public BountyHunter(final BountyHunter card) { + super(card); + } + + @Override + public BountyHunter copy() { + return new BountyHunter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/CanyonDrake.java b/Mage.Sets/src/mage/sets/tempest/CanyonDrake.java new file mode 100644 index 00000000000..8cdbe60df54 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/CanyonDrake.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class CanyonDrake extends CardImpl { + + public CanyonDrake(UUID ownerId) { + super(ownerId, 166, "Canyon Drake", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Drake"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {1}, Discard a card at random: Canyon Drake gets +2/+0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Duration.EndOfTurn), new ManaCostsImpl("{1}")); + ability.addCost(new DiscardCardCost(true)); + this.addAbility(ability); + } + + public CanyonDrake(final CanyonDrake card) { + super(card); + } + + @Override + public CanyonDrake copy() { + return new CanyonDrake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/CircleOfProtectionShadow.java b/Mage.Sets/src/mage/sets/tempest/CircleOfProtectionShadow.java new file mode 100644 index 00000000000..195c8378d33 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/CircleOfProtectionShadow.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventNextDamageFromChosenSourceToYouEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class CircleOfProtectionShadow extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature of your choice with shadow"); + + static { + filter.add(new AbilityPredicate(ShadowAbility.class)); + } + + public CircleOfProtectionShadow(UUID ownerId) { + super(ownerId, 224, "Circle of Protection: Shadow", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "TMP"; + + // {1}: The next time a creature of your choice with shadow would deal damage to you this turn, prevent that damage. + Effect effect = new PreventNextDamageFromChosenSourceToYouEffect(Duration.EndOfTurn, filter); + effect.setText("The next time a creature of your choice with shadow would deal damage to you this turn, prevent that damage"); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("1"))); + } + + public CircleOfProtectionShadow(final CircleOfProtectionShadow card) { + super(card); + } + + @Override + public CircleOfProtectionShadow copy() { + return new CircleOfProtectionShadow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/CommanderGrevenIlVec.java b/Mage.Sets/src/mage/sets/tempest/CommanderGrevenIlVec.java index 1ca56981e19..b7e5293c30a 100644 --- a/Mage.Sets/src/mage/sets/tempest/CommanderGrevenIlVec.java +++ b/Mage.Sets/src/mage/sets/tempest/CommanderGrevenIlVec.java @@ -31,12 +31,11 @@ import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; import mage.abilities.keyword.FearAbility; import mage.cards.CardImpl; -import mage.target.common.TargetControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; /** * @@ -53,10 +52,12 @@ public class CommanderGrevenIlVec extends CardImpl { this.power = new MageInt(7); this.toughness = new MageInt(5); - Ability ability = new EntersBattlefieldTriggeredAbility(new SacrificeTargetEffect(), false); - ability.addTarget(new TargetControlledCreaturePermanent()); - this.addAbility(ability); + + // Fear (This creature can't be blocked except by artifact creatures and/or black creatures.) this.addAbility(FearAbility.getInstance()); + + // When Commander Greven il-Vec enters the battlefield, sacrifice a creature. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, ""), false)); } public CommanderGrevenIlVec(final CommanderGrevenIlVec card) { diff --git a/Mage.Sets/src/mage/sets/tempest/CorpseDance.java b/Mage.Sets/src/mage/sets/tempest/CorpseDance.java index a7589fdc5c7..0087bb59d0c 100644 --- a/Mage.Sets/src/mage/sets/tempest/CorpseDance.java +++ b/Mage.Sets/src/mage/sets/tempest/CorpseDance.java @@ -45,6 +45,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -58,7 +59,6 @@ public class CorpseDance extends CardImpl { super(ownerId, 10, "Corpse Dance", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{B}"); this.expansionSetCode = "TMP"; - // Buyback {2} this.addAbility(new BuybackAbility("{2}")); @@ -97,26 +97,29 @@ class CorpseDanceEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card lastCreatureCard = null; - for (Card card :controller.getGraveyard().getCards(game)) { + for (Card card : controller.getGraveyard().getCards(game)) { if (card.getCardType().contains(CardType.CREATURE)) { lastCreatureCard = card; } } if (lastCreatureCard != null) { - if (controller.putOntoBattlefieldWithInfo(lastCreatureCard, game, Zone.GRAVEYARD, source.getSourceId())) { - FixedTarget fixedTarget = new FixedTarget(lastCreatureCard.getId()); - // Gains Haste - ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); - hasteEffect.setTargetPointer(fixedTarget); - game.addEffect(hasteEffect, source); - // Exile it at end of turn - ExileTargetEffect exileEffect = new ExileTargetEffect(null,"",Zone.BATTLEFIELD); - exileEffect.setTargetPointer(fixedTarget); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + if (controller.moveCards(lastCreatureCard, Zone.BATTLEFIELD, source, game)) { + Permanent creature = game.getPermanent(lastCreatureCard.getId()); + if (creature != null) { + FixedTarget fixedTarget = new FixedTarget(creature, game); + // Gains Haste + ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); + hasteEffect.setTargetPointer(fixedTarget); + game.addEffect(hasteEffect, source); + // Exile it at end of turn + ExileTargetEffect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD); + exileEffect.setTargetPointer(fixedTarget); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } } } return true; diff --git a/Mage.Sets/src/mage/sets/tempest/CursedScroll.java b/Mage.Sets/src/mage/sets/tempest/CursedScroll.java index 110111ffe08..2f2c326a895 100644 --- a/Mage.Sets/src/mage/sets/tempest/CursedScroll.java +++ b/Mage.Sets/src/mage/sets/tempest/CursedScroll.java @@ -29,9 +29,6 @@ package mage.sets.tempest; import java.util.UUID; import mage.MageObject; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; @@ -42,7 +39,9 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; @@ -91,15 +90,15 @@ class CursedScrollEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player you = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); - if (sourceObject != null && you != null && cardName != null && !cardName.isEmpty()) { - if (you.getHand().size() > 0) { + if (sourceObject != null && controller != null && cardName != null && !cardName.isEmpty()) { + if (controller.getHand().size() > 0) { Cards revealed = new CardsImpl(); - Card card = you.getHand().getRandom(game); + Card card = controller.getHand().getRandom(game); revealed.add(card); - you.revealCards(sourceObject.getName(), revealed, game); + controller.revealCards(sourceObject.getIdName(), revealed, game); if (card.getName().equals(cardName)) { Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); if (creature != null) { diff --git a/Mage.Sets/src/mage/sets/tempest/DauthiGhoul.java b/Mage.Sets/src/mage/sets/tempest/DauthiGhoul.java new file mode 100644 index 00000000000..8b81a6833e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/DauthiGhoul.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class DauthiGhoul extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature with shadow"); + + static { + filter.add(new AbilityPredicate(ShadowAbility.class)); + } + + public DauthiGhoul(UUID ownerId) { + super(ownerId, 15, "Dauthi Ghoul", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Dauthi"); + this.subtype.add("Zombie"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // Whenever a creature with shadow dies, put a +1/+1 counter on Dauthi Ghoul. + this.addAbility(new DiesCreatureTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, filter)); + } + + public DauthiGhoul(final DauthiGhoul card) { + super(card); + } + + @Override + public DauthiGhoul copy() { + return new DauthiGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/DauthiMindripper.java b/Mage.Sets/src/mage/sets/tempest/DauthiMindripper.java new file mode 100644 index 00000000000..f988e67daef --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/DauthiMindripper.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class DauthiMindripper extends CardImpl { + + public DauthiMindripper(UUID ownerId) { + super(ownerId, 19, "Dauthi Mindripper", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Dauthi"); + this.subtype.add("Minion"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // Whenever Dauthi Mindripper attacks and isn't blocked, you may sacrifice it. If you do, defending player discards three cards. + Effect effect = new DiscardTargetEffect(3); + effect.setText("defending player discards three cards"); + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(new DoIfCostPaid(effect, new SacrificeSourceCost()), false, true)); + } + + public DauthiMindripper(final DauthiMindripper card) { + super(card); + } + + @Override + public DauthiMindripper copy() { + return new DauthiMindripper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/DeathPitsOfRath.java b/Mage.Sets/src/mage/sets/tempest/DeathPitsOfRath.java index 1af8d3cb656..897eed3c58b 100644 --- a/Mage.Sets/src/mage/sets/tempest/DeathPitsOfRath.java +++ b/Mage.Sets/src/mage/sets/tempest/DeathPitsOfRath.java @@ -28,13 +28,12 @@ package mage.sets.tempest; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; @@ -86,7 +85,7 @@ class DeathPitsOfRathTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - for(Effect effect : this.getEffects()) { + for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } return true; @@ -94,6 +93,6 @@ class DeathPitsOfRathTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Whenever a creature is dealt damage, destroy it. It can't be regenerated"; + return "Whenever a creature is dealt damage, destroy it. It can't be regenerated."; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/tempest/Dracoplasm.java b/Mage.Sets/src/mage/sets/tempest/Dracoplasm.java index a53c41a32c6..914dd47cd6d 100644 --- a/Mage.Sets/src/mage/sets/tempest/Dracoplasm.java +++ b/Mage.Sets/src/mage/sets/tempest/Dracoplasm.java @@ -44,10 +44,12 @@ import mage.constants.ColoredManaSymbol; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -69,10 +71,10 @@ public class Dracoplasm extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // As Dracoplasm enters the battlefield, sacrifice any number of creatures. Dracoplasm's power becomes the total power of those creatures and its toughness becomes their total toughness. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DracoplasmEffect())); - + this.addAbility(new SimpleStaticAbility(Zone.ALL, new DracoplasmEffect())); + // {R}: Dracoplasm gets +1/+0 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.R))); } @@ -88,41 +90,41 @@ public class Dracoplasm extends CardImpl { } class DracoplasmEffect extends ReplacementEffectImpl { - + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); - + static { filter.add(new AnotherPredicate()); } - + public DracoplasmEffect() { - super(Duration.WhileOnBattlefield, Outcome.BoostCreature); + super(Duration.EndOfGame, Outcome.BoostCreature); this.staticText = "As {this} enters the battlefield, sacrifice any number of creatures. {this}'s power becomes the total power of those creatures and its toughness becomes their total toughness"; } - + public DracoplasmEffect(final DracoplasmEffect effect) { super(effect); } - + @Override public DracoplasmEffect copy() { return new DracoplasmEffect(this); } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - return event.getTargetId().equals(source.getSourceId()); + return event.getTargetId().equals(source.getSourceId()); } - + @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getTargetId()); + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); Player controller = game.getPlayer(source.getControllerId()); if (creature != null && controller != null) { Target target = new TargetControlledPermanent(0, Integer.MAX_VALUE, filter, true); @@ -133,18 +135,18 @@ class DracoplasmEffect extends ReplacementEffectImpl { if (target.getTargets().size() > 0) { int power = 0; int toughness = 0; - for (UUID targetId: target.getTargets()) { + for (UUID targetId : target.getTargets()) { Permanent targetCreature = game.getPermanent(targetId); if (targetCreature != null && targetCreature.sacrifice(source.getSourceId(), game)) { power += targetCreature.getPower().getValue(); toughness += targetCreature.getToughness().getValue(); } } - ContinuousEffect effect = new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom); + ContinuousEffect effect = new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom, SubLayer.SetPT_7b); game.addEffect(effect, source); } } return false; } - + } diff --git a/Mage.Sets/src/mage/sets/tempest/DreamCache.java b/Mage.Sets/src/mage/sets/tempest/DreamCache.java index 6d223175be0..0aa934b4bf7 100644 --- a/Mage.Sets/src/mage/sets/tempest/DreamCache.java +++ b/Mage.Sets/src/mage/sets/tempest/DreamCache.java @@ -30,12 +30,13 @@ package mage.sets.tempest; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; +import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInHand; @@ -50,7 +51,6 @@ public class DreamCache extends CardImpl { super(ownerId, 59, "Dream Cache", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); this.expansionSetCode = "TMP"; - // Draw three cards, then put two cards from your hand both on top of your library or both on the bottom of your library. this.getSpellAbility().addEffect(new DreamCacheEffect()); } @@ -71,7 +71,7 @@ class DreamCacheEffect extends OneShotEffect { super(Outcome.DrawCard); this.staticText = "Draw three cards, then put two cards from your hand both on top of your library or both on the bottom of your library."; } - + public DreamCacheEffect(final DreamCacheEffect effect) { super(effect); } @@ -80,33 +80,26 @@ class DreamCacheEffect extends OneShotEffect { public DreamCacheEffect copy() { return new DreamCacheEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.drawCards(3, game); - - boolean putOnTop = player.chooseUse(Outcome.Neutral, "Put cards on top?", source, game); - putInLibrary(player, source, game, putOnTop); - putInLibrary(player, source, game, putOnTop); - + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.drawCards(3, game); + boolean putOnTop = controller.chooseUse(Outcome.Neutral, "Put cards on top?", source, game); + TargetCardInHand target = new TargetCardInHand(2, 2, new FilterCard()); + controller.chooseTarget(Outcome.Detriment, target, source, game); + Cards cardsToLibrary = new CardsImpl(target.getTargets()); + if (!cardsToLibrary.isEmpty()) { + if (putOnTop) { + controller.putCardsOnTopOfLibrary(cardsToLibrary, game, source, false); + } else { + controller.putCardsOnBottomOfLibrary(cardsToLibrary, game, source, false); + } + } return true; } return false; } - - private boolean putInLibrary(Player player, Ability source, Game game, boolean putOnTop) { - if (player.getHand().size() > 0) { - TargetCardInHand target = new TargetCardInHand(); - player.chooseTarget(Outcome.Detriment, target, source, game); - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - player.getHand().remove(card); - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, putOnTop); - return true; - } - } - return false; - } + } diff --git a/Mage.Sets/src/mage/sets/tempest/EndlessScream.java b/Mage.Sets/src/mage/sets/tempest/EndlessScream.java new file mode 100644 index 00000000000..0b9e96f4228 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/EndlessScream.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class EndlessScream extends CardImpl { + + public EndlessScream(UUID ownerId) { + super(ownerId, 26, "Endless Scream", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{X}{B}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Endless Scream enters the battlefield with X scream counters on it. + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.SCREAM.createInstance()))); + // Enchanted creature gets +1/+0 for each scream counter on Endless Scream. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(new CountersCount(CounterType.SCREAM), new StaticValue(0), Duration.WhileOnBattlefield))); + } + + public EndlessScream(final EndlessScream card) { + super(card); + } + + @Override + public EndlessScream copy() { + return new EndlessScream(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/Extinction.java b/Mage.Sets/src/mage/sets/tempest/Extinction.java new file mode 100644 index 00000000000..e7a8e8b49b6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/Extinction.java @@ -0,0 +1,112 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.repository.CardRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class Extinction extends CardImpl { + + public Extinction(UUID ownerId) { + super(ownerId, 29, "Extinction", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}"); + this.expansionSetCode = "TMP"; + + // Destroy all creatures of the creature type of your choice. + this.getSpellAbility().addEffect(new ExtinctionEffect()); + } + + public Extinction(final Extinction card) { + super(card); + } + + @Override + public Extinction copy() { + return new Extinction(this); + } +} + +class ExtinctionEffect extends OneShotEffect { + + public ExtinctionEffect() { + super(Outcome.UnboostCreature); + staticText = "Destroy all creatures of the creature type of your choice"; + } + + public ExtinctionEffect(final ExtinctionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (player != null) { + Choice typeChoice = new ChoiceImpl(true); + typeChoice.setMessage("Choose a creature type:"); + typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); + while (!player.choose(outcome, typeChoice, game)) { + if (!player.canRespond()) { + return false; + } + } + if (typeChoice.getChoice() != null) { + game.informPlayers(sourceObject.getLogName() + " chosen type: " + typeChoice.getChoice()); + } + FilterCreaturePermanent filterCreaturePermanent = new FilterCreaturePermanent(); + filterCreaturePermanent.add(new SubtypePredicate(typeChoice.getChoice())); + for (Permanent creature : game.getBattlefield().getActivePermanents(filterCreaturePermanent, source.getSourceId(), game)) { + creature.destroy(source.getSourceId(), game, true); + } + return true; + } + return false; + } + + @Override + public ExtinctionEffect copy() { + return new ExtinctionEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/FlowstoneSalamander.java b/Mage.Sets/src/mage/sets/tempest/FlowstoneSalamander.java new file mode 100644 index 00000000000..15ffce46037 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/FlowstoneSalamander.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.BlockingAttackerIdPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FlowstoneSalamander extends CardImpl { + + public FlowstoneSalamander(UUID ownerId) { + super(ownerId, 175, "Flowstone Salamander", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Salamander"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // {R}: Flowstone Salamander deals 1 damage to target creature blocking it. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R")); + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking it"); + filter.add(new BlockingAttackerIdPredicate(this.getId())); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public FlowstoneSalamander(final FlowstoneSalamander card) { + super(card); + } + + @Override + public FlowstoneSalamander copy() { + return new FlowstoneSalamander(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/FlowstoneSculpture.java b/Mage.Sets/src/mage/sets/tempest/FlowstoneSculpture.java new file mode 100644 index 00000000000..cc468438c4d --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/FlowstoneSculpture.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class FlowstoneSculpture extends mage.sets.vintagemasters.FlowstoneSculpture { + + public FlowstoneSculpture(UUID ownerId) { + super(ownerId); + this.cardNumber = 278; + this.expansionSetCode = "TMP"; + } + + public FlowstoneSculpture(final FlowstoneSculpture card) { + super(card); + } + + @Override + public FlowstoneSculpture copy() { + return new FlowstoneSculpture(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/FoolsTome.java b/Mage.Sets/src/mage/sets/tempest/FoolsTome.java new file mode 100644 index 00000000000..0e242c64b75 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/FoolsTome.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.condition.common.HellbentCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class FoolsTome extends CardImpl { + + public FoolsTome(UUID ownerId) { + super(ownerId, 279, "Fool's Tome", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "TMP"; + + // {2}, {tap}: Draw a card. Activate this ability only if you have no cards in hand. + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), + new ManaCostsImpl("{2}"), HellbentCondition.getInstance()); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public FoolsTome(final FoolsTome card) { + super(card); + } + + @Override + public FoolsTome copy() { + return new FoolsTome(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/FugitiveDruid.java b/Mage.Sets/src/mage/sets/tempest/FugitiveDruid.java new file mode 100644 index 00000000000..a2811d685bb --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/FugitiveDruid.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesTargetTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author LoneFox + */ +public class FugitiveDruid extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("an Aura spell"); + + static { + filter.add(new SubtypePredicate("Aura")); + } + + public FugitiveDruid(UUID ownerId) { + super(ownerId, 123, "Fugitive Druid", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Human"); + this.subtype.add("Druid"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever Fugitive Druid becomes the target of an Aura spell, you draw a card. + this.addAbility(new BecomesTargetTriggeredAbility(new DrawCardSourceControllerEffect(1), filter)); + } + + public FugitiveDruid(final FugitiveDruid card) { + super(card); + } + + @Override + public FugitiveDruid copy() { + return new FugitiveDruid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/Fylamarid.java b/Mage.Sets/src/mage/sets/tempest/Fylamarid.java new file mode 100644 index 00000000000..38c20f6172a --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/Fylamarid.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Fylamarid extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blue creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public Fylamarid(UUID ownerId) { + super(ownerId, 64, "Fylamarid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Squid"); + this.subtype.add("Beast"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Fylamarid can't be blocked by blue creatures. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + // {U}: Target creature becomes blue until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorTargetEffect(ObjectColor.BLUE, + Duration.EndOfTurn), new ManaCostsImpl("{U}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public Fylamarid(final Fylamarid card) { + super(card); + } + + @Override + public Fylamarid copy() { + return new Fylamarid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/HandToHand.java b/Mage.Sets/src/mage/sets/tempest/HandToHand.java new file mode 100644 index 00000000000..d3e4984f674 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/HandToHand.java @@ -0,0 +1,118 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.mana.ManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TurnPhase; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author fireshoes + */ +public class HandToHand extends CardImpl { + + public HandToHand(UUID ownerId) { + super(ownerId, 180, "Hand to Hand", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "TMP"; + + // During combat, players can't cast instant spells or activate abilities that aren't mana abilities. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HandToHandEffect())); + } + + public HandToHand(final HandToHand card) { + super(card); + } + + @Override + public HandToHand copy() { + return new HandToHand(this); + } +} + +class HandToHandEffect extends ContinuousRuleModifyingEffectImpl { + + public HandToHandEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "During combat, players can't cast instant spells or activate abilities that aren't mana abilities"; + } + + public HandToHandEffect(final HandToHandEffect effect) { + super(effect); + } + + @Override + public HandToHandEffect copy() { + return new HandToHandEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public String getInfoMessage(Ability source, GameEvent event, Game game) { + MageObject mageObject = game.getObject(source.getSourceId()); + if (mageObject != null) { + return "During combat, players can't cast instant spells or activate abilities that aren't mana abilities (" + mageObject.getIdName() + ")."; + } + return null; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (game.getPhase().getType() == TurnPhase.COMBAT) { + MageObject object = game.getObject(event.getSourceId()); + if (event.getType() == GameEvent.EventType.CAST_SPELL) { + if (object.getCardType().contains(CardType.INSTANT)) { + return true; + } + } + if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) { + Ability ability = game.getAbility(event.getTargetId(), event.getSourceId()); + if (ability != null && !(ability instanceof ManaAbility)) { + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/Havoc.java b/Mage.Sets/src/mage/sets/tempest/Havoc.java new file mode 100644 index 00000000000..9fa6a6ae8ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/Havoc.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class Havoc extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("a white spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public Havoc(UUID ownerId) { + super(ownerId, 181, "Havoc", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "TMP"; + + // Whenever an opponent casts a white spell, he or she loses 2 life. + Effect effect = new LoseLifeTargetEffect(2); + effect.setText("he or she loses 2 life"); + this.addAbility(new SpellCastOpponentTriggeredAbility(Zone.BATTLEFIELD, effect, filter, false, SetTargetPointer.PLAYER)); + } + + public Havoc(final Havoc card) { + super(card); + } + + @Override + public Havoc copy() { + return new Havoc(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/HelmOfPossession.java b/Mage.Sets/src/mage/sets/tempest/HelmOfPossession.java index f80c7843013..b20810eabfc 100644 --- a/Mage.Sets/src/mage/sets/tempest/HelmOfPossession.java +++ b/Mage.Sets/src/mage/sets/tempest/HelmOfPossession.java @@ -59,7 +59,7 @@ public class HelmOfPossession extends CardImpl { // You may choose not to untap Helm of Possession during your untap step. this.addAbility(new SkipUntapOptionalAbility()); - + // {2}, {tap}, Sacrifice a creature: Gain control of target creature for as long as you control Helm of Possession and Helm of Possession remains tapped. ConditionalContinuousEffect effect = new ConditionalContinuousEffect( new GainControlTargetEffect(Duration.Custom), @@ -92,11 +92,11 @@ class HelmOfPossessionCondition implements Condition { controllerId = source.getControllerId(); } Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId()); - if (permanent != null){ - if (permanent.isTapped()){ - return controllerId == source.getControllerId(); + if (permanent != null) { + if (permanent.isTapped()) { + return controllerId.equals(source.getControllerId()); } } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/tempest/ImpsTaunt.java b/Mage.Sets/src/mage/sets/tempest/ImpsTaunt.java new file mode 100644 index 00000000000..19e76245e1e --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/ImpsTaunt.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.abilities.effects.common.combat.AttacksIfAbleTargetEffect; +import mage.abilities.keyword.BuybackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ImpsTaunt extends CardImpl { + + public ImpsTaunt(UUID ownerId) { + super(ownerId, 32, "Imps' Taunt", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{B}"); + this.expansionSetCode = "TMP"; + + // Buyback {3} + this.addAbility(new BuybackAbility("{3}")); + // Target creature attacks this turn if able. + this.getSpellAbility().addEffect(new AttacksIfAbleTargetEffect(Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public ImpsTaunt(final ImpsTaunt card) { + super(card); + } + + @Override + public ImpsTaunt copy() { + return new ImpsTaunt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/KnightOfDawn.java b/Mage.Sets/src/mage/sets/tempest/KnightOfDawn.java new file mode 100644 index 00000000000..d03181f9334 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/KnightOfDawn.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainProtectionFromColorSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class KnightOfDawn extends CardImpl { + + public KnightOfDawn(UUID ownerId) { + super(ownerId, 238, "Knight of Dawn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // {W}{W}: Knight of Dawn gains protection from the color of your choice until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainProtectionFromColorSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{W}{W}"))); + } + + public KnightOfDawn(final KnightOfDawn card) { + super(card); + } + + @Override + public KnightOfDawn copy() { + return new KnightOfDawn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/Krakilin.java b/Mage.Sets/src/mage/sets/tempest/Krakilin.java index 08f6c057475..4f1cb03d1bd 100644 --- a/Mage.Sets/src/mage/sets/tempest/Krakilin.java +++ b/Mage.Sets/src/mage/sets/tempest/Krakilin.java @@ -29,21 +29,16 @@ package mage.sets.tempest; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -59,8 +54,8 @@ public class Krakilin extends CardImpl { this.toughness = new MageInt(0); // Krakilin enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new KrakilinEffect())); - + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); + // {1}{G}: Regenerate Krakilin. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{G}"))); } @@ -74,37 +69,3 @@ public class Krakilin extends CardImpl { return new Krakilin(this); } } - -class KrakilinEffect extends OneShotEffect { - - public KrakilinEffect() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - public KrakilinEffect(final KrakilinEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility)obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public KrakilinEffect copy() { - return new KrakilinEffect(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tempest/LeechingLicid.java b/Mage.Sets/src/mage/sets/tempest/LeechingLicid.java new file mode 100644 index 00000000000..cdd9dc5ce26 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/LeechingLicid.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.LicidAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author emerald000 + */ +public class LeechingLicid extends CardImpl { + + public LeechingLicid(UUID ownerId) { + super(ownerId, 35, "Leeching Licid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Licid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {B}, {tap}: Leeching Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {B} to end this effect. + this.addAbility(new LicidAbility(new ColoredManaCost(ColoredManaSymbol.B), new ColoredManaCost(ColoredManaSymbol.B))); + + // At the beginning of the upkeep of enchanted creature's controller, Leeching Licid deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public LeechingLicid(final LeechingLicid card) { + super(card); + } + + @Override + public LeechingLicid copy() { + return new LeechingLicid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/LegacysAllure.java b/Mage.Sets/src/mage/sets/tempest/LegacysAllure.java index 902a7442732..88294061de6 100644 --- a/Mage.Sets/src/mage/sets/tempest/LegacysAllure.java +++ b/Mage.Sets/src/mage/sets/tempest/LegacysAllure.java @@ -54,6 +54,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class LegacysAllure extends CardImpl { + private final UUID originalId; + public LegacysAllure(UUID ownerId) { super(ownerId, 71, "Legacy's Allure", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}"); this.expansionSetCode = "TMP"; @@ -62,18 +64,20 @@ public class LegacysAllure extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(new Counter("treasure")), TargetController.YOU, true)); // Sacrifice Legacy's Allure: Gain control of target creature with power less than or equal to the number of treasure counters on Legacy's Allure. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.EndOfGame, true),new SacrificeSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.EndOfGame, true), new SacrificeSourceCost()); ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with power less than or equal to the number of treasure counters on " + getLogName()))); + originalId = ability.getOriginalId(); this.addAbility(ability); } public LegacysAllure(final LegacysAllure card) { super(card); + this.originalId = card.originalId; } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SimpleActivatedAbility) { + if (ability.getOriginalId().equals(originalId)) { Permanent sourcePermanent = game.getPermanent(ability.getSourceId()); if (sourcePermanent != null) { int numbCounters = sourcePermanent.getCounters().getCount("treasure"); diff --git a/Mage.Sets/src/mage/sets/tempest/LivingDeath.java b/Mage.Sets/src/mage/sets/tempest/LivingDeath.java index fd01450856a..1980018d64a 100644 --- a/Mage.Sets/src/mage/sets/tempest/LivingDeath.java +++ b/Mage.Sets/src/mage/sets/tempest/LivingDeath.java @@ -27,6 +27,9 @@ */ package mage.sets.tempest; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; @@ -39,10 +42,10 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; -import mage.game.ExileZone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; + /** * * @author Plopman @@ -53,7 +56,6 @@ public class LivingDeath extends CardImpl { super(ownerId, 36, "Living Death", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); this.expansionSetCode = "TMP"; - // Each player exiles all creature cards from his or her graveyard, then sacrifices all creatures he or she controls, then puts all cards he or she exiled this way onto the battlefield. this.getSpellAbility().addEffect(new LivingDeathEffect()); } @@ -67,6 +69,7 @@ public class LivingDeath extends CardImpl { return new LivingDeath(this); } } + class LivingDeathEffect extends OneShotEffect { public LivingDeathEffect() { @@ -88,26 +91,31 @@ class LivingDeathEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { + Map> exiledCards = new HashMap<>(); // move creature cards from graveyard to exile - for (UUID playerId: controller.getInRange()){ + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card :player.getGraveyard().getCards(new FilterCreatureCard(), game)) { - controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.GRAVEYARD, true); + Set cardsPlayer = player.getGraveyard().getCards(new FilterCreatureCard(), game); + if (!cardsPlayer.isEmpty()) { + exiledCards.put(player.getId(), cardsPlayer); + player.moveCards(cardsPlayer, Zone.EXILED, source, game); } } } + game.applyEffects(); // sacrifice all creatures - for (Permanent permanent :game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { permanent.sacrifice(source.getSourceId(), game); } + game.applyEffects(); // put exiled cards to battlefield - ExileZone exileZone = game.getState().getExile().getExileZone(source.getSourceId()); - if (exileZone != null) { - for (Card card : exileZone.getCards(game)) { - Player player = game.getPlayer(card.getOwnerId()); - if (player != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + Set cardsPlayer = exiledCards.get(playerId); + if (cardsPlayer != null && !cardsPlayer.isEmpty()) { + player.moveCards(cardsPlayer, Zone.BATTLEFIELD, source, game, false, false, false, null); } } } diff --git a/Mage.Sets/src/mage/sets/tempest/Lobotomy.java b/Mage.Sets/src/mage/sets/tempest/Lobotomy.java index f96e3c8b7bb..e666c50d0ec 100644 --- a/Mage.Sets/src/mage/sets/tempest/Lobotomy.java +++ b/Mage.Sets/src/mage/sets/tempest/Lobotomy.java @@ -46,8 +46,8 @@ import mage.filter.predicate.mageobject.NamePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.game.Game; import mage.players.Player; +import mage.target.TargetCard; import mage.target.TargetPlayer; -import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInLibrary; /** @@ -100,13 +100,13 @@ class LobotomyEffect extends OneShotEffect { if (targetPlayer != null && sourceObject != null && controller != null) { // reveal hand of target player - targetPlayer.revealCards(sourceObject.getName(), targetPlayer.getHand(), game); + targetPlayer.revealCards(sourceObject.getIdName(), targetPlayer.getHand(), game); // You choose card other than a basic land card - TargetCardInHand target = new TargetCardInHand(filter); + TargetCard target = new TargetCard(Zone.HAND, filter); target.setNotTarget(true); Card chosenCard = null; - if (controller.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) { + if (controller.chooseTarget(Outcome.Benefit, targetPlayer.getHand(), target, source, game)) { chosenCard = game.getCard(target.getFirstTarget()); } @@ -115,6 +115,7 @@ class LobotomyEffect extends OneShotEffect { FilterCard filterNamedCards = new FilterCard(); if (chosenCard != null) { filterNamedCards.add(new NamePredicate(chosenCard.getName())); + filterNamedCards.setMessage("cards named " + chosenCard.getName()); } else { filterNamedCards.add(new NamePredicate("----")); // so no card matches } @@ -129,8 +130,8 @@ class LobotomyEffect extends OneShotEffect { } } // search cards in hand - TargetCardInHand targetCardsHand = new TargetCardInHand(0, Integer.MAX_VALUE, filterNamedCards); - controller.chooseTarget(outcome, targetPlayer.getGraveyard(), targetCardsHand, source, game); + TargetCard targetCardsHand = new TargetCard(0, Integer.MAX_VALUE, Zone.HAND, filterNamedCards); + controller.chooseTarget(outcome, targetPlayer.getHand(), targetCardsHand, source, game); for (UUID cardId : targetCardsHand.getTargets()) { Card card = game.getCard(cardId); if (card != null) { @@ -153,7 +154,7 @@ class LobotomyEffect extends OneShotEffect { } if (!cardsToExile.isEmpty()) { - controller.moveCards(cardsToExile, null, Zone.EXILED, source, game, true); + controller.moveCards(cardsToExile, null, Zone.EXILED, source, game); } targetPlayer.shuffleLibrary(game); return true; diff --git a/Mage.Sets/src/mage/sets/tempest/MarbleTitan.java b/Mage.Sets/src/mage/sets/tempest/MarbleTitan.java new file mode 100644 index 00000000000..77aca3a45da --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/MarbleTitan.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; + +/** + * + * @author LoneFox + */ +public class MarbleTitan extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures with power 3 or greater"); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 2)); + } + + public MarbleTitan(UUID ownerId) { + super(ownerId, 240, "Marble Titan", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Giant"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Creatures with power 3 or greater don't untap during their controllers' untap steps. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, filter))); + } + + public MarbleTitan(final MarbleTitan card) { + super(card); + } + + @Override + public MarbleTitan copy() { + return new MarbleTitan(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/MoggCannon.java b/Mage.Sets/src/mage/sets/tempest/MoggCannon.java new file mode 100644 index 00000000000..45a20e8f8f8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/MoggCannon.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetAtBeginningOfNextEndStepEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MoggCannon extends CardImpl { + + public MoggCannon(UUID ownerId) { + super(ownerId, 288, "Mogg Cannon", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "TMP"; + + // {tap}: Target creature you control gets +1/+0 and gains flying until end of turn. Destroy that creature at the beginning of the next end step. + Effect effect = new BoostTargetEffect(1, 0, Duration.EndOfTurn); + effect.setText("target creature you control gets +1/+0"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); + effect = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains flying until end of turn"); + ability.addEffect(effect); + ability.addEffect(new DestroyTargetAtBeginningOfNextEndStepEffect()); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + public MoggCannon(final MoggCannon card) { + super(card); + } + + @Override + public MoggCannon copy() { + return new MoggCannon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/MoggSquad.java b/Mage.Sets/src/mage/sets/tempest/MoggSquad.java new file mode 100644 index 00000000000..1bc3a474e7e --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/MoggSquad.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author BursegSardaukar + */ +public class MoggSquad extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("each other creature on the battlefield"); + + static { + filter.add(new AnotherPredicate()); + } + + public MoggSquad(UUID ownerId) { + super(ownerId, 192, "Mogg Squad", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Goblin"); + + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Mogg Squad gets -1/-1 for each other creature on the battlefield. + DynamicValue amount = new SignInversionDynamicValue(new PermanentsOnBattlefieldCount(filter)); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield)); + this.addAbility(ability); + } + + public MoggSquad(final MoggSquad card) { + super(card); + } + + @Override + public MoggSquad copy() { + return new MoggSquad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/NurturingLicid.java b/Mage.Sets/src/mage/sets/tempest/NurturingLicid.java new file mode 100644 index 00000000000..e2dafd29a94 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/NurturingLicid.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LicidAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.RegenerateAttachedEffect; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author emerald000 + */ +public class NurturingLicid extends CardImpl { + + public NurturingLicid(UUID ownerId) { + super(ownerId, 136, "Nurturing Licid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Licid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {G}, {tap}: Nurturing Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {G} to end this effect. + this.addAbility(new LicidAbility(new ColoredManaCost(ColoredManaSymbol.G), new ColoredManaCost(ColoredManaSymbol.G))); + + // {G}: Regenerate enchanted creature. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateAttachedEffect(AttachmentType.AURA), new ColoredManaCost(ColoredManaSymbol.G))); + } + + public NurturingLicid(final NurturingLicid card) { + super(card); + } + + @Override + public NurturingLicid copy() { + return new NurturingLicid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/PegasusRefuge.java b/Mage.Sets/src/mage/sets/tempest/PegasusRefuge.java new file mode 100644 index 00000000000..483a7e1925a --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/PegasusRefuge.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.PegasusToken; + +/** + * + * @author LoneFox + */ +public class PegasusRefuge extends CardImpl { + + public PegasusRefuge(UUID ownerId) { + super(ownerId, 247, "Pegasus Refuge", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "TMP"; + + // {2}, Discard a card: Put a 1/1 white Pegasus creature token with flying onto the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new PegasusToken()), new ManaCostsImpl("{2}")); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public PegasusRefuge(final PegasusRefuge card) { + super(card); + } + + @Override + public PegasusRefuge copy() { + return new PegasusRefuge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/PitImp.java b/Mage.Sets/src/mage/sets/tempest/PitImp.java new file mode 100644 index 00000000000..c2ed9d8b2f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/PitImp.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class PitImp extends CardImpl { + + public PitImp(UUID ownerId) { + super(ownerId, 42, "Pit Imp", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Imp"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {B}: Pit Imp gets +1/+0 until end of turn. Activate this ability no more than twice each turn. + this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0,Duration.EndOfTurn), new ManaCostsImpl("{B}"), 2)); + } + + public PitImp(final PitImp card) { + super(card); + } + + @Override + public PitImp copy() { + return new PitImp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/QuickeningLicid.java b/Mage.Sets/src/mage/sets/tempest/QuickeningLicid.java new file mode 100644 index 00000000000..1fa9cc30c09 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/QuickeningLicid.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LicidAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author emerald000 + */ +public class QuickeningLicid extends CardImpl { + + public QuickeningLicid(UUID ownerId) { + super(ownerId, 248, "Quickening Licid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Licid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{W}, {tap}: Quickening Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {W} to end this effect. + this.addAbility(new LicidAbility(new ManaCostsImpl<>("{1}{W}"), new ColoredManaCost(ColoredManaSymbol.W))); + + // Enchanted creature has first strike. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.AURA))); + } + + public QuickeningLicid(final QuickeningLicid card) { + super(card); + } + + @Override + public QuickeningLicid copy() { + return new QuickeningLicid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/RootMaze.java b/Mage.Sets/src/mage/sets/tempest/RootMaze.java index 36109448c25..eb573226647 100644 --- a/Mage.Sets/src/mage/sets/tempest/RootMaze.java +++ b/Mage.Sets/src/mage/sets/tempest/RootMaze.java @@ -38,6 +38,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -67,6 +68,7 @@ public class RootMaze extends CardImpl { } class RootMazeEffect extends ReplacementEffectImpl { + RootMazeEffect() { super(Duration.WhileOnBattlefield, Outcome.Tap); staticText = "Artifacts and lands enter the battlefield tapped"; @@ -78,21 +80,21 @@ class RootMazeEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent target = game.getPermanent(event.getTargetId()); + Permanent target = ((EntersTheBattlefieldEvent) event).getTarget(); if (target != null) { target.setTapped(true); } return false; } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(event.getTargetId()); + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); return permanent != null && (permanent.getCardType().contains(CardType.LAND) || permanent.getCardType().contains(CardType.ARTIFACT)); } diff --git a/Mage.Sets/src/mage/sets/tempest/RootwaterMatriarch.java b/Mage.Sets/src/mage/sets/tempest/RootwaterMatriarch.java index 39d3449e1f7..88a5d986851 100644 --- a/Mage.Sets/src/mage/sets/tempest/RootwaterMatriarch.java +++ b/Mage.Sets/src/mage/sets/tempest/RootwaterMatriarch.java @@ -28,9 +28,6 @@ package mage.sets.tempest; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,7 +36,9 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.common.continuous.GainControlTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; import mage.target.common.TargetCreaturePermanent; @@ -56,9 +55,10 @@ public class RootwaterMatriarch extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(3); - - // {TAP}: Gain control of target creature for as long as that creature is enchanted - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.OneUse), EnchantedTargetCondition.getInstance(), "Gain control of target creature for as long as that creature is enchanted"); + + // {T}: Gain control of target creature for as long as that creature is enchanted + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), EnchantedTargetCondition.getInstance(), + "Gain control of target creature for as long as that creature is enchanted"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/tempest/SadisticGlee.java b/Mage.Sets/src/mage/sets/tempest/SadisticGlee.java index 48386fc4bf3..85d1496ca5c 100644 --- a/Mage.Sets/src/mage/sets/tempest/SadisticGlee.java +++ b/Mage.Sets/src/mage/sets/tempest/SadisticGlee.java @@ -30,13 +30,10 @@ package mage.sets.tempest; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.DiesCreatureTriggeredAbility; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.counter.AddCountersAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; -import mage.constants.AttachmentType; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -61,11 +58,9 @@ public class SadisticGlee extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - // Whenever a creature dies, put a +1/+1 counter on enchanted creature. - Effect effect = new GainAbilityAttachedEffect(new DiesCreatureTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false), AttachmentType.AURA); - ability.addEffect(effect); - effect.setText("Whenever a creature dies, put a +1/+1 counter on enchanted creature."); + this.addAbility(new DiesCreatureTriggeredAbility(new AddCountersAttachedEffect( + CounterType.P1P1.createInstance(), "enchanted creature"), false)); } public SadisticGlee(final SadisticGlee card) { diff --git a/Mage.Sets/src/mage/sets/tempest/Safeguard.java b/Mage.Sets/src/mage/sets/tempest/Safeguard.java new file mode 100644 index 00000000000..0b8df614879 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/Safeguard.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Safeguard extends CardImpl { + + public Safeguard(UUID ownerId) { + super(ownerId, 251, "Safeguard", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{W}"); + this.expansionSetCode = "TMP"; + + // {2}{W}: Prevent all combat damage that would be dealt by target creature this turn. + Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true); + effect.setText("Prevent all combat damage that would be dealt by target creature this turn."); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{W}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public Safeguard(final Safeguard card) { + super(card); + } + + @Override + public Safeguard copy() { + return new Safeguard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/ScaldingTongs.java b/Mage.Sets/src/mage/sets/tempest/ScaldingTongs.java new file mode 100644 index 00000000000..fd52fed1e12 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/ScaldingTongs.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.common.CardsInHandCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class ScaldingTongs extends CardImpl { + + public ScaldingTongs(UUID ownerId) { + super(ownerId, 297, "Scalding Tongs", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "TMP"; + + // At the beginning of your upkeep, if you have three or fewer cards in hand, Scalding Tongs deals 1 damage to target opponent. + TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), TargetController.YOU, false); + ability.addTarget(new TargetOpponent()); + CardsInHandCondition condition = new CardsInHandCondition(CardsInHandCondition.CountType.FEWER_THAN, 4); + this.addAbility(new ConditionalTriggeredAbility(ability, condition, "At the beginning of your upkeep, if you have three or fewer cards in hand, {this} deals 1 damage to target opponent.")); + } + + public ScaldingTongs(final ScaldingTongs card) { + super(card); + } + + @Override + public ScaldingTongs copy() { + return new ScaldingTongs(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/ScrollRack.java b/Mage.Sets/src/mage/sets/tempest/ScrollRack.java index 4d5ece41394..6e792063af6 100644 --- a/Mage.Sets/src/mage/sets/tempest/ScrollRack.java +++ b/Mage.Sets/src/mage/sets/tempest/ScrollRack.java @@ -110,7 +110,7 @@ class ScrollRackEffect extends OneShotEffect { } // Put that many cards from the top of your library into your hand. if (amountExiled > 0) { - controller.moveCards(controller.getLibrary().getTopCards(game, amountExiled), null, Zone.HAND, source, game, false); + controller.moveCards(controller.getLibrary().getTopCards(game, amountExiled), Zone.HAND, source, game); } // Then look at the exiled cards and put them on top of your library in any order controller.putCardsOnTopOfLibrary(game.getExile().getExileZone(source.getSourceId()), game, source, true); diff --git a/Mage.Sets/src/mage/sets/tempest/SereneOffering.java b/Mage.Sets/src/mage/sets/tempest/SereneOffering.java new file mode 100644 index 00000000000..c0d9c5746b2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/SereneOffering.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.TargetConvertedManaCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author LoneFox + */ +public class SereneOffering extends CardImpl { + + public SereneOffering(UUID ownerId) { + super(ownerId, 252, "Serene Offering", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "TMP"; + + // Destroy target enchantment. You gain life equal to its converted mana cost. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + Effect effect = new GainLifeEffect(new TargetConvertedManaCost()); + effect.setText("You gain life equal to its converted mana cost"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetEnchantmentPermanent()); + } + + public SereneOffering(final SereneOffering card) { + super(card); + } + + @Override + public SereneOffering copy() { + return new SereneOffering(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/ServantOfVolrath.java b/Mage.Sets/src/mage/sets/tempest/ServantOfVolrath.java index ac860ea4ce9..7010697b90d 100644 --- a/Mage.Sets/src/mage/sets/tempest/ServantOfVolrath.java +++ b/Mage.Sets/src/mage/sets/tempest/ServantOfVolrath.java @@ -29,13 +29,12 @@ package mage.sets.tempest; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.LeavesBattlefieldTriggeredAbility; -import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.target.common.TargetControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; /** * @@ -51,11 +50,9 @@ public class ServantOfVolrath extends CardImpl { this.toughness = new MageInt(3); // When Servant of Volrath leaves the battlefield, sacrifice a creature. - Ability ability = new LeavesBattlefieldTriggeredAbility(new SacrificeTargetEffect(), false); - ability.addTarget(new TargetControlledCreaturePermanent()); - this.addAbility(ability); + this.addAbility(new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, ""), false)); } - + public ServantOfVolrath(final ServantOfVolrath card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/tempest/SkyshroudCondor.java b/Mage.Sets/src/mage/sets/tempest/SkyshroudCondor.java new file mode 100644 index 00000000000..79ba487f4d7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/SkyshroudCondor.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.ruleModifying.CastOnlyIfYouHaveCastAnotherSpellEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class SkyshroudCondor extends CardImpl { + + public SkyshroudCondor(UUID ownerId) { + super(ownerId, 88, "Skyshroud Condor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Cast Skyshroud Condor only if you've cast another spell this turn. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastOnlyIfYouHaveCastAnotherSpellEffect())); + } + + public SkyshroudCondor(final SkyshroudCondor card) { + super(card); + } + + @Override + public SkyshroudCondor copy() { + return new SkyshroudCondor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/SoltariCrusader.java b/Mage.Sets/src/mage/sets/tempest/SoltariCrusader.java new file mode 100644 index 00000000000..18f8c63619c --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/SoltariCrusader.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class SoltariCrusader extends CardImpl { + + public SoltariCrusader(UUID ownerId) { + super(ownerId, 253, "Soltari Crusader", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Soltari"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // {1}{W}: Soltari Crusader gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{1}{W}"))); + } + + public SoltariCrusader(final SoltariCrusader card) { + super(card); + } + + @Override + public SoltariCrusader copy() { + return new SoltariCrusader(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/SoltariFootSoldier.java b/Mage.Sets/src/mage/sets/tempest/SoltariFootSoldier.java new file mode 100644 index 00000000000..f0b128975ec --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/SoltariFootSoldier.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SoltariFootSoldier extends CardImpl { + + public SoltariFootSoldier(UUID ownerId) { + super(ownerId, 255, "Soltari Foot Soldier", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Soltari"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + } + + public SoltariFootSoldier(final SoltariFootSoldier card) { + super(card); + } + + @Override + public SoltariFootSoldier copy() { + return new SoltariFootSoldier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/StaunchDefenders.java b/Mage.Sets/src/mage/sets/tempest/StaunchDefenders.java index 39fe7dbece7..cfaeaa21ead 100644 --- a/Mage.Sets/src/mage/sets/tempest/StaunchDefenders.java +++ b/Mage.Sets/src/mage/sets/tempest/StaunchDefenders.java @@ -28,12 +28,12 @@ package mage.sets.tempest; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -49,6 +49,8 @@ public class StaunchDefenders extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(4); + + // When Staunch Defenders enters the battlefield, you gain 4 life. this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4), false)); } diff --git a/Mage.Sets/src/mage/sets/tempest/StingingLicid.java b/Mage.Sets/src/mage/sets/tempest/StingingLicid.java new file mode 100644 index 00000000000..7703fd35bb4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/StingingLicid.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesTappedAttachedTriggeredAbility; +import mage.abilities.common.LicidAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageAttachedControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; + +/** + * + * @author emerald000 + */ +public class StingingLicid extends CardImpl { + + public StingingLicid(UUID ownerId) { + super(ownerId, 91, "Stinging Licid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Licid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{U}, {tap}: Stinging Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {U} to end this effect. + this.addAbility(new LicidAbility(new ManaCostsImpl<>("{1}{U}"), new ColoredManaCost(ColoredManaSymbol.U))); + + // Whenever enchanted creature becomes tapped, Stinging Licid deals 2 damage to that creature's controller. + this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DamageAttachedControllerEffect(2), "enchanted creature")); + } + + public StingingLicid(final StingingLicid card) { + super(card); + } + + @Override + public StingingLicid copy() { + return new StingingLicid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/Stun.java b/Mage.Sets/src/mage/sets/tempest/Stun.java index 82cc6f5cb77..ecaa81eac69 100644 --- a/Mage.Sets/src/mage/sets/tempest/Stun.java +++ b/Mage.Sets/src/mage/sets/tempest/Stun.java @@ -28,9 +28,6 @@ package mage.sets.tempest; import java.util.UUID; -import mage.abilities.common.EntersBattlefieldTriggeredAbility; - -import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.combat.CantBlockTargetEffect; import mage.cards.CardImpl; @@ -50,10 +47,8 @@ public class Stun extends CardImpl { this.expansionSetCode = "TMP"; // Target creature can't block this turn. - Effect effect = new CantBlockTargetEffect(Duration.EndOfTurn); - effect.setText("Target creature can't block this turn."); - this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new CantBlockTargetEffect(Duration.EndOfTurn)); // Draw a card. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); diff --git a/Mage.Sets/src/mage/sets/tempest/ThalakosDreamsower.java b/Mage.Sets/src/mage/sets/tempest/ThalakosDreamsower.java new file mode 100644 index 00000000000..53640306085 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/ThalakosDreamsower.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsDamageToOpponentTriggeredAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.effects.common.DontUntapAsLongAsSourceTappedEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ThalakosDreamsower extends CardImpl { + + public ThalakosDreamsower(UUID ownerId) { + super(ownerId, 92, "Thalakos Dreamsower", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Thalakos"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // You may choose not to untap Thalakos Dreamsower during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // Whenever Thalakos Dreamsower deals damage to an opponent, tap target creature. That creature doesn't untap during its controller's untap step for as long as Thalakos Dreamsower remains tapped. + Ability ability = new DealsDamageToOpponentTriggeredAbility(new TapTargetEffect(), false); + ability.addTarget(new TargetCreaturePermanent()); + ability.addEffect(new DontUntapAsLongAsSourceTappedEffect()); + this.addAbility(ability); + } + + public ThalakosDreamsower(final ThalakosDreamsower card) { + super(card); + } + + @Override + public ThalakosDreamsower copy() { + return new ThalakosDreamsower(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/ThalakosMistfolk.java b/Mage.Sets/src/mage/sets/tempest/ThalakosMistfolk.java new file mode 100644 index 00000000000..d13503cf7ed --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/ThalakosMistfolk.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PutOnLibrarySourceEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class ThalakosMistfolk extends CardImpl { + + public ThalakosMistfolk(UUID ownerId) { + super(ownerId, 93, "Thalakos Mistfolk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Thalakos"); + this.subtype.add("Illusion"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // {U}: Put Thalakos Mistfolk on top of its owner's library. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibrarySourceEffect(true), new ManaCostsImpl("{U}"))); + } + + public ThalakosMistfolk(final ThalakosMistfolk card) { + super(card); + } + + @Override + public ThalakosMistfolk copy() { + return new ThalakosMistfolk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/ThalakosSentry.java b/Mage.Sets/src/mage/sets/tempest/ThalakosSentry.java new file mode 100644 index 00000000000..1385e54002d --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/ThalakosSentry.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ThalakosSentry extends CardImpl { + + public ThalakosSentry(UUID ownerId) { + super(ownerId, 95, "Thalakos Sentry", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Thalakos"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + } + + public ThalakosSentry(final ThalakosSentry card) { + super(card); + } + + @Override + public ThalakosSentry copy() { + return new ThalakosSentry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/Thumbscrews.java b/Mage.Sets/src/mage/sets/tempest/Thumbscrews.java new file mode 100644 index 00000000000..0d43d04e3ce --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/Thumbscrews.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.common.CardsInHandCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class Thumbscrews extends CardImpl { + + public Thumbscrews(UUID ownerId) { + super(ownerId, 302, "Thumbscrews", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "TMP"; + + // At the beginning of your upkeep, if you have five or more cards in hand, Thumbscrews deals 1 damage to target opponent. + TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, + new DamageTargetEffect(1), TargetController.YOU, false); + ability.addTarget(new TargetOpponent()); + CardsInHandCondition condition = new CardsInHandCondition(CardsInHandCondition.CountType.MORE_THAN, 4); + this.addAbility(new ConditionalTriggeredAbility(ability, condition, "At the beginning of your upkeep, if you have five or more cards in hand, {this} deals 1 damage to target opponent.")); + } + + public Thumbscrews(final Thumbscrews card) { + super(card); + } + + @Override + public Thumbscrews copy() { + return new Thumbscrews(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/VerdantForce.java b/Mage.Sets/src/mage/sets/tempest/VerdantForce.java index 4377abe9c5b..b383f7df446 100644 --- a/Mage.Sets/src/mage/sets/tempest/VerdantForce.java +++ b/Mage.Sets/src/mage/sets/tempest/VerdantForce.java @@ -28,13 +28,12 @@ package mage.sets.tempest; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.TargetController; import mage.game.permanent.token.SaprolingToken; @@ -51,6 +50,8 @@ public class VerdantForce extends CardImpl { this.power = new MageInt(7); this.toughness = new MageInt(7); + + // At the beginning of each upkeep, put a 1/1 green Saproling creature token onto the battlefield. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new SaprolingToken()), TargetController.ANY, false)); } diff --git a/Mage.Sets/src/mage/sets/tempestremastered/Deadshot.java b/Mage.Sets/src/mage/sets/tempestremastered/Deadshot.java index e2fd17d8826..1aa0222736a 100644 --- a/Mage.Sets/src/mage/sets/tempestremastered/Deadshot.java +++ b/Mage.Sets/src/mage/sets/tempestremastered/Deadshot.java @@ -36,29 +36,39 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AnotherTargetPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.SecondTargetPointer; /** * * @author fireshoes */ public class Deadshot extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another target creature"); + static { + filter.add(new AnotherTargetPredicate(2)); + } + public Deadshot(UUID ownerId) { super(ownerId, 129, "Deadshot", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); this.expansionSetCode = "TPR"; // Tap target creature. this.getSpellAbility().addEffect(new TapTargetEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - + TargetCreaturePermanent target = new TargetCreaturePermanent(); + target.setTargetTag(1); + this.getSpellAbility().addTarget(target); + // It deals damage equal to its power to another target creature. this.getSpellAbility().addEffect(new DeadshotDamageEffect()); - this.getSpellAbility().addTarget(new DeadshotTargetCreaturePermanent(filter)); + target = new TargetCreaturePermanent(filter); + target.setTargetTag(2); + this.getSpellAbility().addTarget(target); } public Deadshot(final Deadshot card) { @@ -80,6 +90,7 @@ class DeadshotDamageEffect extends OneShotEffect { public DeadshotDamageEffect(final DeadshotDamageEffect effect) { super(effect); + this.setTargetPointer(new SecondTargetPointer()); } @Override @@ -89,10 +100,10 @@ class DeadshotDamageEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent ownCreature = game.getPermanent(source.getFirstTarget()); + Permanent ownCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); if (ownCreature != null) { int damage = ownCreature.getPower().getValue(); - Permanent targetCreature = game.getPermanent(source.getTargets().get(1).getFirstTarget()); + Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetCreature != null) { targetCreature.damage(damage, ownCreature.getId(), game, false, true); return true; @@ -101,27 +112,3 @@ class DeadshotDamageEffect extends OneShotEffect { return false; } } - -class DeadshotTargetCreaturePermanent extends TargetCreaturePermanent { - - public DeadshotTargetCreaturePermanent(FilterCreaturePermanent filter) { - super(filter); - } - - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - if (source.getTargets().getFirstTarget().equals(id)) { - return false; - } - return super.canTarget(id, source, game); - } - - @Override - public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { - if (source.getTargets().getFirstTarget().equals(id)) { - return false; - } - return super.canTarget(controllerId, id, source, game); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tempestremastered/FieldOfSouls.java b/Mage.Sets/src/mage/sets/tempestremastered/FieldOfSouls.java index b74ed27145d..9afdd7e1acd 100644 --- a/Mage.Sets/src/mage/sets/tempestremastered/FieldOfSouls.java +++ b/Mage.Sets/src/mage/sets/tempestremastered/FieldOfSouls.java @@ -57,7 +57,7 @@ public class FieldOfSouls extends CardImpl { this.expansionSetCode = "TPR"; // Whenever a nontoken creature is put into your graveyard from the battlefield, put a 1/1 white Spirit creature token with flying onto the battlefield. - this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken("KTK")), false, filter)); + this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken()), false, filter)); } public FieldOfSouls(final FieldOfSouls card) { diff --git a/Mage.Sets/src/mage/sets/tempestremastered/SoltariLancer.java b/Mage.Sets/src/mage/sets/tempestremastered/SoltariLancer.java index 45b9b6bde0e..cd106458ba2 100644 --- a/Mage.Sets/src/mage/sets/tempestremastered/SoltariLancer.java +++ b/Mage.Sets/src/mage/sets/tempestremastered/SoltariLancer.java @@ -46,8 +46,8 @@ import mage.filter.common.FilterAttackingCreature; * @author fireshoes */ public class SoltariLancer extends CardImpl { - - private static final String rule = "Spirit of the Night has first strike as long as it's attacking"; + + private static final String rule = "{this} has first strike as long as it's attacking"; public SoltariLancer(UUID ownerId) { super(ownerId, 30, "Soltari Lancer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); @@ -59,7 +59,7 @@ public class SoltariLancer extends CardImpl { // Shadow this.addAbility(ShadowAbility.getInstance()); - + // Soltari Lancer has first strike as long as it's attacking. ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()), new SourceMatchesFilterCondition(new FilterAttackingCreature()), rule); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/sets/tempestremastered/SpiritEnKor.java b/Mage.Sets/src/mage/sets/tempestremastered/SpiritEnKor.java index e07c177ea74..4b4998f4949 100644 --- a/Mage.Sets/src/mage/sets/tempestremastered/SpiritEnKor.java +++ b/Mage.Sets/src/mage/sets/tempestremastered/SpiritEnKor.java @@ -32,18 +32,13 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.PreventionEffectData; -import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.common.RedirectDamageFromSourceToTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.DamageEvent; -import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -62,9 +57,10 @@ public class SpiritEnKor extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // {0}: The next 1 damage that would be dealt to Spirit en-Kor this turn is dealt to target creature you control instead. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SpiritEnKorPreventionEffect(), new GenericManaCost(0)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new RedirectDamageFromSourceToTargetEffect(Duration.EndOfTurn, 1, true), new GenericManaCost(0)); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); } @@ -78,44 +74,3 @@ public class SpiritEnKor extends CardImpl { return new SpiritEnKor(this); } } - -class SpiritEnKorPreventionEffect extends PreventionEffectImpl { - - SpiritEnKorPreventionEffect() { - super(Duration.EndOfTurn, 1, false); - staticText = "The next 1 damage that would be dealt to {this} this turn is dealt to target creature you control instead."; - } - - SpiritEnKorPreventionEffect(final SpiritEnKorPreventionEffect effect) { - super(effect); - } - - @Override - public SpiritEnKorPreventionEffect copy() { - return new SpiritEnKorPreventionEffect(this); - } - - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - PreventionEffectData preventionResult = preventDamageAction(event, source, game); - if (preventionResult.getPreventedDamage() > 0) { - Permanent redirectTo = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (redirectTo != null) { - game.informPlayers("Dealing " + preventionResult.getPreventedDamage() + " to " + redirectTo.getName() + " instead."); - DamageEvent damageEvent = (DamageEvent) event; - redirectTo.damage(preventionResult.getPreventedDamage(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects()); - } - } - return false; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (!this.used && super.applies(event, source, game)) { - if (event.getTargetId().equals(source.getSourceId())) { - return game.getPermanent(getTargetPointer().getFirst(game, source)) != null; - } - } - return false; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tempestremastered/VolrathsLaboratory.java b/Mage.Sets/src/mage/sets/tempestremastered/VolrathsLaboratory.java index 10b1208bbe7..70f4a27f8c7 100644 --- a/Mage.Sets/src/mage/sets/tempestremastered/VolrathsLaboratory.java +++ b/Mage.Sets/src/mage/sets/tempestremastered/VolrathsLaboratory.java @@ -35,6 +35,7 @@ import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ChooseColorEffect; import mage.abilities.effects.common.ChooseCreatureTypeEffect; @@ -57,10 +58,12 @@ public class VolrathsLaboratory extends CardImpl { this.expansionSetCode = "TPR"; // As Volrath's Laboratory enters the battlefield, choose a color and a creature type. - Ability ability = new EntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral), null, true, "As Volrath's Laboratory enters the battlefield, choose a color and a creature type.", ""); + Ability ability = new EntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral)); + Effect effect = new ChooseColorEffect(Outcome.Neutral); + effect.setText("and a creature type"); ability.addEffect(new ChooseCreatureTypeEffect(Outcome.Neutral)); this.addAbility(ability); - + // {5}, {T}: Put a 2/2 creature token of the chosen color and type onto the battlefield. ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new VolrathsLaboratoryEffect(), new GenericManaCost(5)); ability.addCost(new TapSourceCost()); @@ -78,21 +81,21 @@ public class VolrathsLaboratory extends CardImpl { } class VolrathsLaboratoryEffect extends OneShotEffect { - + VolrathsLaboratoryEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "Put a 2/2 creature token of the chosen color and type onto the battlefield"; } - + VolrathsLaboratoryEffect(final VolrathsLaboratoryEffect effect) { super(effect); } - + @Override public VolrathsLaboratoryEffect copy() { return new VolrathsLaboratoryEffect(this); } - + @Override public boolean apply(Game game, Ability source) { ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); diff --git a/Mage.Sets/src/mage/sets/tempestremastered/WarriorEnKor.java b/Mage.Sets/src/mage/sets/tempestremastered/WarriorEnKor.java index 4d991b1b1f0..4587dbd24e6 100644 --- a/Mage.Sets/src/mage/sets/tempestremastered/WarriorEnKor.java +++ b/Mage.Sets/src/mage/sets/tempestremastered/WarriorEnKor.java @@ -32,17 +32,12 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.PreventionEffectData; -import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.common.RedirectDamageFromSourceToTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.DamageEvent; -import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -61,7 +56,8 @@ public class WarriorEnKor extends CardImpl { this.toughness = new MageInt(2); // {0}: The next 1 damage that would be dealt to Warrior en-Kor this turn is dealt to target creature you control instead. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new WarriorEnKorPreventionEffect(), new GenericManaCost(0)); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new RedirectDamageFromSourceToTargetEffect(Duration.EndOfTurn, 1, true), new GenericManaCost(0)); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); } @@ -75,44 +71,3 @@ public class WarriorEnKor extends CardImpl { return new WarriorEnKor(this); } } - -class WarriorEnKorPreventionEffect extends PreventionEffectImpl { - - WarriorEnKorPreventionEffect() { - super(Duration.EndOfTurn, 1, false); - staticText = "The next 1 damage that would be dealt to {this} this turn is dealt to target creature you control instead."; - } - - WarriorEnKorPreventionEffect(final WarriorEnKorPreventionEffect effect) { - super(effect); - } - - @Override - public WarriorEnKorPreventionEffect copy() { - return new WarriorEnKorPreventionEffect(this); - } - - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - PreventionEffectData preventionResult = preventDamageAction(event, source, game); - if (preventionResult.getPreventedDamage() > 0) { - Permanent redirectTo = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (redirectTo != null) { - game.informPlayers("Dealing " + preventionResult.getPreventedDamage() + " to " + redirectTo.getName() + " instead."); - DamageEvent damageEvent = (DamageEvent) event; - redirectTo.damage(preventionResult.getPreventedDamage(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects()); - } - } - return false; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (!this.used && super.applies(event, source, game)) { - if (event.getTargetId().equals(source.getSourceId())) { - return game.getPermanent(getTargetPointer().getFirst(game, source)) != null; - } - } - return false; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tenthedition/AcademyResearchers.java b/Mage.Sets/src/mage/sets/tenthedition/AcademyResearchers.java index febe7582f76..f3d2fec5dd3 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/AcademyResearchers.java +++ b/Mage.Sets/src/mage/sets/tenthedition/AcademyResearchers.java @@ -76,35 +76,35 @@ public class AcademyResearchers extends CardImpl { } class AcademyResearchersEffect extends OneShotEffect { - + AcademyResearchersEffect() { super(Outcome.PutCardInPlay); this.staticText = "you may put an Aura card from your hand onto the battlefield attached to {this}."; } - + AcademyResearchersEffect(final AcademyResearchersEffect effect) { super(effect); } - + @Override public AcademyResearchersEffect copy() { return new AcademyResearchersEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null){ + if (controller != null && permanent != null) { FilterCard filter = new FilterCard(); filter.add(new SubtypePredicate("Aura")); filter.add(new AuraCardCanAttachToPermanentId(permanent.getId())); TargetCardInHand target = new TargetCardInHand(0, 1, filter); - if (player.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) { + if (controller.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) { Card auraInHand = game.getCard(target.getFirstTarget()); if (auraInHand != null) { game.getState().setValue("attachTo:" + auraInHand.getId(), permanent); - if (player.putOntoBattlefieldWithInfo(auraInHand, game, Zone.HAND, source.getSourceId())) { + if (controller.moveCards(auraInHand, Zone.BATTLEFIELD, source, game)) { permanent.addAttachment(auraInHand.getId(), game); } } diff --git a/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java b/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java index c518a21d95d..c9036a60213 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java +++ b/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java @@ -25,20 +25,17 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.tenthedition; import java.util.UUID; -import mage.abilities.TriggeredAbilityImpl; +import mage.ObjectColor; +import mage.abilities.common.SpellCastAllTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -46,10 +43,18 @@ import mage.game.stack.Spell; */ public class AngelsFeather extends CardImpl { + private final static FilterSpell filter = new FilterSpell("a white spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + public AngelsFeather(UUID ownerId) { super(ownerId, 311, "Angel's Feather", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "10E"; - this.addAbility(new AngelsFeatherAbility()); + + // Whenever a player casts a white spell, you may gain 1 life. + this.addAbility(new SpellCastAllTriggeredAbility(new GainLifeEffect(1), filter, true)); } public AngelsFeather(final AngelsFeather card) { @@ -62,36 +67,3 @@ public class AngelsFeather extends CardImpl { } } - -class AngelsFeatherAbility extends TriggeredAbilityImpl { - - public AngelsFeatherAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } - - public AngelsFeatherAbility(final AngelsFeatherAbility ability) { - super(ability); - } - - @Override - public AngelsFeatherAbility copy() { - return new AngelsFeatherAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && spell.getColor(game).isWhite(); - } - - @Override - public String getRule() { - return "Whenever a player casts a white spell, you may gain 1 life."; - } - -} diff --git a/Mage.Sets/src/mage/sets/tenthedition/AvatarOfMight.java b/Mage.Sets/src/mage/sets/tenthedition/AvatarOfMight.java new file mode 100644 index 00000000000..3fb391e2810 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/AvatarOfMight.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tenthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class AvatarOfMight extends mage.sets.prophecy.AvatarOfMight { + + public AvatarOfMight(UUID ownerId) { + super(ownerId); + this.cardNumber = 251; + this.expansionSetCode = "10E"; + } + + public AvatarOfMight(final AvatarOfMight card) { + super(card); + } + + @Override + public AvatarOfMight copy() { + return new AvatarOfMight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/BeaconOfImmortality.java b/Mage.Sets/src/mage/sets/tenthedition/BeaconOfImmortality.java index b9a3ecc2241..b382e323c53 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/BeaconOfImmortality.java +++ b/Mage.Sets/src/mage/sets/tenthedition/BeaconOfImmortality.java @@ -87,9 +87,9 @@ class BeaconOfImmortalityEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getFirstTarget()); if (player != null) { - int amount = game.getLife(); + int amount = player.getLife(); if (amount < 0) { - player.loseLife(amount, game); + player.loseLife(-amount, game); return true; } if (amount > 0) { diff --git a/Mage.Sets/src/mage/sets/tenthedition/Clone.java b/Mage.Sets/src/mage/sets/tenthedition/Clone.java index 2412dacd079..6fa99a23821 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/Clone.java +++ b/Mage.Sets/src/mage/sets/tenthedition/Clone.java @@ -25,19 +25,15 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.tenthedition; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -54,11 +50,7 @@ public class Clone extends CardImpl { this.toughness = new MageInt(0); // You may have Clone enter the battlefield as a copy of any creature on the battlefield. - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( - new CopyPermanentEffect(), - "You may have {this} enter the battlefield as a copy of any creature on the battlefield", - true)); - this.addAbility(ability); + this.addAbility(new EntersBattlefieldAbility(new CopyPermanentEffect(), true)); } public Clone(final Clone card) { diff --git a/Mage.Sets/src/mage/sets/tenthedition/Cryoclasm.java b/Mage.Sets/src/mage/sets/tenthedition/Cryoclasm.java index f76c044baa2..c9c1cff99b5 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/Cryoclasm.java +++ b/Mage.Sets/src/mage/sets/tenthedition/Cryoclasm.java @@ -28,23 +28,15 @@ package mage.sets.tenthedition; import java.util.UUID; - -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetControllerEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetLandPermanent; /** @@ -54,20 +46,20 @@ import mage.target.common.TargetLandPermanent; public class Cryoclasm extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Plains or Island"); + static { - filter.add(Predicates.or( - new SubtypePredicate("Plains"), - new SubtypePredicate("Island"))); + filter.add(Predicates.or(new SubtypePredicate("Plains"), new SubtypePredicate("Island"))); } public Cryoclasm(UUID ownerId) { super(ownerId, 195, "Cryoclasm", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{R}"); this.expansionSetCode = "10E"; - // Destroy target Plains or Island. Cryoclasm deals 3 damage to that land's controller. this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addEffect(new CryoclasmEffect()); + Effect effect = new DamageTargetControllerEffect(3); + effect.setText("{this} deals 3 damage to that land's controller"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetLandPermanent(filter)); } @@ -81,36 +73,3 @@ public class Cryoclasm extends CardImpl { return new Cryoclasm(this); } } - -class CryoclasmEffect extends OneShotEffect { - - public CryoclasmEffect() { - super(Outcome.Damage); - this.staticText = "{this} deals 3 damage to that land's controller"; - } - - public CryoclasmEffect(final CryoclasmEffect effect) { - super(effect); - } - - @Override - public CryoclasmEffect copy() { - return new CryoclasmEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - UUID targetId = getTargetPointer().getFirst(game, source); - if (targetId != null) { - Permanent permanent = game.getPermanentOrLKIBattlefield(targetId); - if (permanent != null) { - Player controller = game.getPlayer(permanent.getControllerId()); - if (controller != null) { - controller.damage(3, source.getSourceId(), game, false, false); - return true; - } - } - } - return false; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tenthedition/DenizenOfTheDeep.java b/Mage.Sets/src/mage/sets/tenthedition/DenizenOfTheDeep.java new file mode 100644 index 00000000000..744f4560a1e --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/DenizenOfTheDeep.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tenthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LoneFox + */ +public class DenizenOfTheDeep extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + + static{ + filter.add(new AnotherPredicate()); + } + + public DenizenOfTheDeep(UUID ownerId) { + super(ownerId, 80, "Denizen of the Deep", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}{U}"); + this.expansionSetCode = "10E"; + this.subtype.add("Serpent"); + this.power = new MageInt(11); + this.toughness = new MageInt(11); + + // When Denizen of the Deep enters the battlefield, return each other creature you control to its owner's hand. + Effect effect = new ReturnToHandFromBattlefieldAllEffect(filter); + effect.setText("return each other creature you control to its owner's hand"); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); + } + + public DenizenOfTheDeep(final DenizenOfTheDeep card) { + super(card); + } + + @Override + public DenizenOfTheDeep copy() { + return new DenizenOfTheDeep(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/DoublingCube.java b/Mage.Sets/src/mage/sets/tenthedition/DoublingCube.java index 86c0ba07ee5..99ea557b4ee 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/DoublingCube.java +++ b/Mage.Sets/src/mage/sets/tenthedition/DoublingCube.java @@ -36,7 +36,6 @@ import mage.abilities.effects.common.ManaEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; @@ -57,7 +56,7 @@ public class DoublingCube extends CardImpl { Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new DoublingCubeEffect(), new ManaCostsImpl("{3}")); ability.addCost(new TapSourceCost()); this.addAbility(ability); - + } public DoublingCube(final DoublingCube card) { @@ -83,11 +82,11 @@ class DoublingCubeEffect extends ManaEffect { @Override public boolean apply(Game game, Ability source) { - Player you = game.getPlayer(source.getControllerId()); - if (you == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } - ManaPool pool = you.getManaPool(); + ManaPool pool = controller.getManaPool(); int blackMana = pool.getBlack(); int whiteMana = pool.getWhite(); int blueMana = pool.getBlue(); @@ -105,10 +104,9 @@ class DoublingCubeEffect extends ManaEffect { return null; } - @Override public DoublingCubeEffect copy() { return new DoublingCubeEffect(this); } - } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/DragonRoost.java b/Mage.Sets/src/mage/sets/tenthedition/DragonRoost.java index 1fbc6d5c431..cdc462101ff 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/DragonRoost.java +++ b/Mage.Sets/src/mage/sets/tenthedition/DragonRoost.java @@ -28,18 +28,15 @@ package mage.sets.tenthedition; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.DragonToken2; /** * @@ -63,16 +60,3 @@ public class DragonRoost extends CardImpl { return new DragonRoost(this); } } - -class DragonToken2 extends Token { - DragonToken2() { - super("Dragon", "5/5 red Dragon creature token with flying"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add("Dragon"); - power = new MageInt(5); - toughness = new MageInt(5); - addAbility(FlyingAbility.getInstance()); - } -} - diff --git a/Mage.Sets/src/mage/sets/tenthedition/DragonsClaw.java b/Mage.Sets/src/mage/sets/tenthedition/DragonsClaw.java index 86a28f2dd3c..918791b2d0f 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/DragonsClaw.java +++ b/Mage.Sets/src/mage/sets/tenthedition/DragonsClaw.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,25 +20,22 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.tenthedition; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.abilities.TriggeredAbilityImpl; +import mage.ObjectColor; +import mage.abilities.common.SpellCastAllTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -46,10 +43,18 @@ import mage.game.stack.Spell; */ public class DragonsClaw extends CardImpl { + private final static FilterSpell filter = new FilterSpell("a red spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + public DragonsClaw(UUID ownerId) { super(ownerId, 322, "Dragon's Claw", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "10E"; - this.addAbility(new DragonsClawAbility()); + + // Whenever a player casts a red spell, you may gain 1 life. + this.addAbility(new SpellCastAllTriggeredAbility(new GainLifeEffect(1), filter, true)); } public DragonsClaw(final DragonsClaw card) { @@ -62,36 +67,3 @@ public class DragonsClaw extends CardImpl { } } - -class DragonsClawAbility extends TriggeredAbilityImpl { - - public DragonsClawAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } - - public DragonsClawAbility(final DragonsClawAbility ability) { - super(ability); - } - - @Override - public DragonsClawAbility copy() { - return new DragonsClawAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && spell.getColor(game).isRed(); - } - - @Override - public String getRule() { - return "Whenever a player casts a red spell, you may gain 1 life."; - } - -} diff --git a/Mage.Sets/src/mage/sets/tenthedition/DuctCrawler.java b/Mage.Sets/src/mage/sets/tenthedition/DuctCrawler.java new file mode 100644 index 00000000000..0998f89be03 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/DuctCrawler.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tenthedition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class DuctCrawler extends mage.sets.stronghold.DuctCrawler { + + public DuctCrawler(UUID ownerId) { + super(ownerId); + this.cardNumber = 198; + this.expansionSetCode = "10E"; + } + + public DuctCrawler(final DuctCrawler card) { + super(card); + } + + @Override + public DuctCrawler copy() { + return new DuctCrawler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/HighGround.java b/Mage.Sets/src/mage/sets/tenthedition/HighGround.java new file mode 100644 index 00000000000..dc2e0954cb2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/HighGround.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tenthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class HighGround extends mage.sets.exodus.HighGround { + + public HighGround(UUID ownerId) { + super(ownerId); + this.cardNumber = 20; + this.expansionSetCode = "10E"; + } + + public HighGround(final HighGround card) { + super(card); + } + + @Override + public HighGround copy() { + return new HighGround(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/HighwayRobber.java b/Mage.Sets/src/mage/sets/tenthedition/HighwayRobber.java index 6937d8e1ef0..6b55da06104 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/HighwayRobber.java +++ b/Mage.Sets/src/mage/sets/tenthedition/HighwayRobber.java @@ -48,7 +48,6 @@ public class HighwayRobber extends CardImpl { super(ownerId, 150, "Highway Robber", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); this.expansionSetCode = "10E"; this.subtype.add("Human"); - this.subtype.add("Rogue"); this.subtype.add("Mercenary"); this.power = new MageInt(2); diff --git a/Mage.Sets/src/mage/sets/tenthedition/KarplusanStrider.java b/Mage.Sets/src/mage/sets/tenthedition/KarplusanStrider.java new file mode 100644 index 00000000000..cdbf27c76be --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/KarplusanStrider.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tenthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class KarplusanStrider extends mage.sets.modernmasters2015.KarplusanStrider { + + public KarplusanStrider(UUID ownerId) { + super(ownerId); + this.cardNumber = 272; + this.expansionSetCode = "10E"; + } + + public KarplusanStrider(final KarplusanStrider card) { + super(card); + } + + @Override + public KarplusanStrider copy() { + return new KarplusanStrider(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/Megrim.java b/Mage.Sets/src/mage/sets/tenthedition/Megrim.java index 0f7b676328e..cd2af2536d1 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/Megrim.java +++ b/Mage.Sets/src/mage/sets/tenthedition/Megrim.java @@ -25,20 +25,15 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.tenthedition; import java.util.UUID; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.DiscardsACardOpponentTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.target.common.TargetOpponent; +import mage.constants.SetTargetPointer; /** * @@ -46,14 +41,15 @@ import mage.target.common.TargetOpponent; */ public class Megrim extends CardImpl { - public Megrim (UUID ownerId) { + public Megrim(UUID ownerId) { super(ownerId, 157, "Megrim", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); this.expansionSetCode = "10E"; - this.addAbility(new MergimTriggeredAbility()); + // Whenever an opponent discards a card, Megrim deals 2 damage to that player. + this.addAbility(new DiscardsACardOpponentTriggeredAbility(new DamageTargetEffect(2, true, "that player"), false, SetTargetPointer.PLAYER)); } - public Megrim (final Megrim card) { + public Megrim(final Megrim card) { super(card); } @@ -63,39 +59,3 @@ public class Megrim extends CardImpl { } } - -class MergimTriggeredAbility extends TriggeredAbilityImpl { - - MergimTriggeredAbility() { - super(Zone.BATTLEFIELD, new DamageTargetEffect(2)); - this.addTarget(new TargetOpponent()); - } - - MergimTriggeredAbility(final MergimTriggeredAbility ability) { - super(ability); - } - - @Override - public MergimTriggeredAbility copy() { - return new MergimTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.DISCARDED_CARD; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { - this.getTargets().get(0).add(event.getPlayerId(), game); - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever an opponent discards a card, {this} deals 2 damage to that player."; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tenthedition/NantukoHusk.java b/Mage.Sets/src/mage/sets/tenthedition/NantukoHusk.java index 473cd6334dd..2f8364c56be 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/NantukoHusk.java +++ b/Mage.Sets/src/mage/sets/tenthedition/NantukoHusk.java @@ -28,16 +28,16 @@ package mage.sets.tenthedition; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -54,7 +54,10 @@ public class NantukoHusk extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + + // Sacrifice a creature: Nantuko Husk gets +2/+2 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))))); } public NantukoHusk(final NantukoHusk card) { diff --git a/Mage.Sets/src/mage/sets/tenthedition/Peek.java b/Mage.Sets/src/mage/sets/tenthedition/Peek.java index b4428101533..01a5efcb2e8 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/Peek.java +++ b/Mage.Sets/src/mage/sets/tenthedition/Peek.java @@ -1,98 +1,64 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.tenthedition; - -import java.util.UUID; -import mage.MageObject; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.cards.CardImpl; -import mage.constants.Outcome; -import mage.game.Game; -import mage.players.Player; -import mage.target.TargetPlayer; - -/** - * - * @author Loki - */ -public class Peek extends CardImpl { - - public Peek(UUID ownerId) { - super(ownerId, 94, "Peek", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); - this.expansionSetCode = "10E"; - - // Look at target player's hand. - this.getSpellAbility().addEffect(new PeekEffect()); - this.getSpellAbility().addTarget(new TargetPlayer()); - - // Draw a card. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); - } - - public Peek(final Peek card) { - super(card); - } - - @Override - public Peek copy() { - return new Peek(this); - } -} - -class PeekEffect extends OneShotEffect { - PeekEffect() { - super(Outcome.Detriment); - staticText = "look at target player's hand"; - } - - PeekEffect(final PeekEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - MageObject sourceObject = source.getSourceObject(game); - if (player != null && controller != null && sourceObject != null) { - controller.lookAtCards(sourceObject.getIdName() + " " + player.getName() + " (" + game.getTurnNum()+"|"+game.getPhase().getType() +")", player.getHand(), game); - } - return true; - } - - @Override - public PeekEffect copy() { - return new PeekEffect(this); - } - -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tenthedition; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.LookAtTargetPlayerHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author Loki + */ +public class Peek extends CardImpl { + + public Peek(UUID ownerId) { + super(ownerId, 94, "Peek", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "10E"; + + // Look at target player's hand. + this.getSpellAbility().addEffect(new LookAtTargetPlayerHandEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public Peek(final Peek card) { + super(card); + } + + @Override + public Peek copy() { + return new Peek(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/PhageTheUntouchable.java b/Mage.Sets/src/mage/sets/tenthedition/PhageTheUntouchable.java index b5123c43f47..61e5130d2e8 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/PhageTheUntouchable.java +++ b/Mage.Sets/src/mage/sets/tenthedition/PhageTheUntouchable.java @@ -1,84 +1,84 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.tenthedition; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.common.DealsCombatDamageToACreatureTriggeredAbility; -import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; -import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.condition.InvertCondition; -import mage.abilities.condition.common.CastFromHandCondition; -import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.effects.common.DestroyTargetEffect; -import mage.abilities.effects.common.LoseGameSourceControllerEffect; -import mage.abilities.effects.common.LoseGameTargetPlayerEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.watchers.common.CastFromHandWatcher; - -/** - * - * @author LevelX2 - */ -public class PhageTheUntouchable extends CardImpl { - - public PhageTheUntouchable(UUID ownerId) { - super(ownerId, 166, "Phage the Untouchable", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}{B}"); - this.expansionSetCode = "10E"; - this.supertype.add("Legendary"); - this.subtype.add("Zombie"); - this.subtype.add("Minion"); - - this.power = new MageInt(4); - this.toughness = new MageInt(4); - - // When Phage the Untouchable enters the battlefield, if you didn't cast it from your hand, you lose the game. - this.addAbility(new ConditionalTriggeredAbility( - new EntersBattlefieldTriggeredAbility(new LoseGameSourceControllerEffect(), false), - new InvertCondition(new CastFromHandCondition()), - "When {this} enters the battlefield, if you didn't cast it from your hand, you lose the game" - ), new CastFromHandWatcher()); - - // Whenever Phage deals combat damage to a creature, destroy that creature. It can't be regenerated. - this.addAbility(new DealsCombatDamageToACreatureTriggeredAbility(new DestroyTargetEffect(true), false, true)); - - // Whenever Phage deals combat damage to a player, that player loses the game. - this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new LoseGameTargetPlayerEffect(), false, true)); - } - - public PhageTheUntouchable(final PhageTheUntouchable card) { - super(card); - } - - @Override - public PhageTheUntouchable copy() { - return new PhageTheUntouchable(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tenthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToACreatureTriggeredAbility; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.CastFromHandCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.LoseGameSourceControllerEffect; +import mage.abilities.effects.common.LoseGameTargetPlayerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.watchers.common.CastFromHandWatcher; + +/** + * + * @author LevelX2 + */ +public class PhageTheUntouchable extends CardImpl { + + public PhageTheUntouchable(UUID ownerId) { + super(ownerId, 166, "Phage the Untouchable", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}{B}"); + this.expansionSetCode = "10E"; + this.supertype.add("Legendary"); + this.subtype.add("Avatar"); + this.subtype.add("Minion"); + + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // When Phage the Untouchable enters the battlefield, if you didn't cast it from your hand, you lose the game. + this.addAbility(new ConditionalTriggeredAbility( + new EntersBattlefieldTriggeredAbility(new LoseGameSourceControllerEffect(), false), + new InvertCondition(new CastFromHandCondition()), + "When {this} enters the battlefield, if you didn't cast it from your hand, you lose the game" + ), new CastFromHandWatcher()); + + // Whenever Phage deals combat damage to a creature, destroy that creature. It can't be regenerated. + this.addAbility(new DealsCombatDamageToACreatureTriggeredAbility(new DestroyTargetEffect(true), false, true)); + + // Whenever Phage deals combat damage to a player, that player loses the game. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new LoseGameTargetPlayerEffect(), false, true)); + } + + public PhageTheUntouchable(final PhageTheUntouchable card) { + super(card); + } + + @Override + public PhageTheUntouchable copy() { + return new PhageTheUntouchable(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/SculptingSteel.java b/Mage.Sets/src/mage/sets/tenthedition/SculptingSteel.java index eb3d8d91876..7edca1e49b4 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/SculptingSteel.java +++ b/Mage.Sets/src/mage/sets/tenthedition/SculptingSteel.java @@ -28,14 +28,11 @@ package mage.sets.tenthedition; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -44,9 +41,9 @@ import mage.filter.predicate.mageobject.CardTypePredicate; * @author jeffwadsworth */ public class SculptingSteel extends CardImpl { - + private static final FilterPermanent filter = new FilterPermanent("artifact"); - + static { filter.add(new CardTypePredicate(CardType.ARTIFACT)); } @@ -56,11 +53,7 @@ public class SculptingSteel extends CardImpl { this.expansionSetCode = "10E"; // You may have Sculpting Steel enter the battlefield as a copy of any artifact on the battlefield. - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( - new CopyPermanentEffect(filter), - "You may have {this} enter the battlefield as a copy of any artifact on the battlefield", - true)); - this.addAbility(ability); + this.addAbility(new EntersBattlefieldAbility(new CopyPermanentEffect(filter), true)); } public SculptingSteel(final SculptingSteel card) { diff --git a/Mage.Sets/src/mage/sets/tenthedition/SerrasEmbrace.java b/Mage.Sets/src/mage/sets/tenthedition/SerrasEmbrace.java index e4e3c20d733..fa86b26eafe 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/SerrasEmbrace.java +++ b/Mage.Sets/src/mage/sets/tenthedition/SerrasEmbrace.java @@ -29,9 +29,10 @@ package mage.sets.tenthedition; import java.util.UUID; -import mage.constants.*; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; @@ -39,6 +40,11 @@ import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -53,14 +59,21 @@ public class SerrasEmbrace extends CardImpl { this.expansionSetCode = "10E"; this.subtype.add("Aura"); + // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.AURA))); + // Enchanted creature gets +2/+2 and has flying and vigilance. + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2)); + Effect effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has flying"); + ability.addEffect(effect); + effect = new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.AURA); + effect.setText("and vigilance"); + ability.addEffect(effect); + this.addAbility(ability); } public SerrasEmbrace(final SerrasEmbrace card) { diff --git a/Mage.Sets/src/mage/sets/tenthedition/VenerableMonk.java b/Mage.Sets/src/mage/sets/tenthedition/VenerableMonk.java index 5b46688a5c9..34c88254698 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/VenerableMonk.java +++ b/Mage.Sets/src/mage/sets/tenthedition/VenerableMonk.java @@ -28,12 +28,12 @@ package mage.sets.tenthedition; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -50,6 +50,8 @@ public class VenerableMonk extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); + + // When Venerable Monk enters the battlefield, you gain 2 life. this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(2))); } diff --git a/Mage.Sets/src/mage/sets/thedark/Amnesia.java b/Mage.Sets/src/mage/sets/thedark/Amnesia.java new file mode 100644 index 00000000000..fb2695e08a6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/Amnesia.java @@ -0,0 +1,101 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class Amnesia extends CardImpl { + + public Amnesia(UUID ownerId) { + super(ownerId, 19, "Amnesia", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{U}{U}{U}"); + this.expansionSetCode = "DRK"; + + // Target player reveals his or her hand and discards all nonland cards. + this.getSpellAbility().addEffect(new AmnesiaEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + } + + public Amnesia(final Amnesia card) { + super(card); + } + + @Override + public Amnesia copy() { + return new Amnesia(this); + } +} + +class AmnesiaEffect extends OneShotEffect { + + public AmnesiaEffect() { + super(Outcome.Discard); + this.staticText = "Target player reveals his or her hand and discards all nonland cards"; + } + + public AmnesiaEffect(final AmnesiaEffect effect) { + super(effect); + } + + @Override + public AmnesiaEffect copy() { + return new AmnesiaEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + Cards hand = player.getHand(); + player.revealCards("Amnesia", hand, game); + Set cards = hand.getCards(game); + for (Card card : cards) { + if (card != null && !card.getCardType().contains(CardType.LAND)) { + player.discard(card, source, game); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/BookOfRass.java b/Mage.Sets/src/mage/sets/thedark/BookOfRass.java new file mode 100644 index 00000000000..ca0a589254f --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/BookOfRass.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author nigelzor + */ +public class BookOfRass extends CardImpl { + + public BookOfRass(UUID ownerId) { + super(ownerId, 95, "Book of Rass", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{6}"); + this.expansionSetCode = "DRK"; + + // {2}, Pay 2 life: Draw a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(2)); + ability.addCost(new PayLifeCost(2)); + this.addAbility(ability); + } + + public BookOfRass(final BookOfRass card) { + super(card); + } + + @Override + public BookOfRass copy() { + return new BookOfRass(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/BrothersOfFire.java b/Mage.Sets/src/mage/sets/thedark/BrothersOfFire.java new file mode 100644 index 00000000000..b13f81ea003 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/BrothersOfFire.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class BrothersOfFire extends mage.sets.fourthedition.BrothersOfFire { + + public BrothersOfFire(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "DRK"; + this.rarity = Rarity.UNCOMMON; + } + + public BrothersOfFire(final BrothersOfFire card) { + super(card); + } + + @Override + public BrothersOfFire copy() { + return new BrothersOfFire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/CavePeople.java b/Mage.Sets/src/mage/sets/thedark/CavePeople.java new file mode 100644 index 00000000000..1bb0eef3cc6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/CavePeople.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class CavePeople extends CardImpl { + + public CavePeople(UUID ownerId) { + super(ownerId, 59, "Cave People", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "DRK"; + this.subtype.add("Human"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Whenever Cave People attacks, it gets +1/-2 until end of turn. + this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(1, -2, Duration.EndOfTurn), false)); + + // {1}{R}{R}, {tap}: Target creature gains mountainwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new MountainwalkAbility(), Duration.EndOfTurn), new ManaCostsImpl("{1}{R}{R}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public CavePeople(final CavePeople card) { + super(card); + } + + @Override + public CavePeople copy() { + return new CavePeople(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/CityOfShadows.java b/Mage.Sets/src/mage/sets/thedark/CityOfShadows.java index 8651daa4ad0..781370f3cec 100644 --- a/Mage.Sets/src/mage/sets/thedark/CityOfShadows.java +++ b/Mage.Sets/src/mage/sets/thedark/CityOfShadows.java @@ -60,7 +60,7 @@ public class CityOfShadows extends CardImpl { // {T}: Add {X} to your mana pool, where X is the number of storage counters on City of Shadows. ability = new DynamicManaAbility(Mana.ColorlessMana, new CountersCount(CounterType.STORAGE), - "{tap}: Add {X} to your mana pool, where X is the number of storage counters on {this}"); + "Add {X} to your mana pool, where X is the number of storage counters on {this}"); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/thedark/DanceOfMany.java b/Mage.Sets/src/mage/sets/thedark/DanceOfMany.java index 758f9baf86d..1b858cc40fa 100644 --- a/Mage.Sets/src/mage/sets/thedark/DanceOfMany.java +++ b/Mage.Sets/src/mage/sets/thedark/DanceOfMany.java @@ -27,6 +27,7 @@ */ package mage.sets.thedark; +import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -36,12 +37,14 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -53,10 +56,9 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.permanent.TokenPredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; +import mage.players.Player; import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; -import mage.util.CardUtil; /** * @@ -82,7 +84,7 @@ public class DanceOfMany extends CardImpl { // When Dance of Many leaves the battlefield, exile the token. // When the token leaves the battlefield, sacrifice Dance of Many. Ability ability2 = new LeavesBattlefieldTriggeredAbility(new DanceOfManyExileTokenEffect(), false); - ability2.addEffect(new InfoEffect("When the token leaves the battlfield, sacrifice {this}")); + ability2.addEffect(new InfoEffect("When the token leaves the battlefield, sacrifice {this}")); this.addAbility(ability2); // At the beginning of your upkeep, sacrifice Dance of Many unless you pay {U}{U}. @@ -113,22 +115,22 @@ class DanceOfManyCreateTokenCopyEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); - } - if (permanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - Permanent permanentToken = game.getPermanent(token.getLastAddedToken()); - game.getState().setValue(source.getSourceId() + "_token", permanentToken); - Effect sacrificeEffect = new SacrificeTargetEffect("sacrifice Dance of Many"); - sacrificeEffect.setTargetPointer(new FixedTarget(game.getPermanent(source.getSourceId()).getId())); - LeavesBattlefieldTriggeredAbility triggerAbility = new LeavesBattlefieldTriggeredAbility(sacrificeEffect, false); - ContinuousEffect effect = new GainAbilityTargetEffect(triggerAbility, Duration.WhileOnBattlefield); - effect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - game.addEffect(effect, source); + Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + Permanent sourceObject = game.getPermanent(source.getSourceId()); + if (permanent != null && sourceObject != null) { + + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); + effect.setTargetPointer(new FixedTarget(permanent, game)); + effect.apply(game, source); + game.getState().setValue(source.getSourceId() + "_token", effect.getAddedPermanent()); + for (Permanent addedToken : effect.getAddedPermanent()) { + Effect sacrificeEffect = new SacrificeTargetEffect("sacrifice Dance of Many"); + sacrificeEffect.setTargetPointer(new FixedTarget(sourceObject, game)); + LeavesBattlefieldTriggeredAbility triggerAbility = new LeavesBattlefieldTriggeredAbility(sacrificeEffect, false); + ContinuousEffect continuousEffect = new GainAbilityTargetEffect(triggerAbility, Duration.WhileOnBattlefield); + continuousEffect.setTargetPointer(new FixedTarget(addedToken, game)); + game.addEffect(continuousEffect, source); + } return true; } return false; @@ -153,11 +155,17 @@ class DanceOfManyExileTokenEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent tokenPermanent = (Permanent) game.getState().getValue(source.getSourceId() + "_token"); - if (tokenPermanent != null) { - Effect effect = new ExileTargetEffect(); - effect.setTargetPointer(new FixedTarget(tokenPermanent.getId())); - return effect.apply(game, source); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + List tokenPermanents = (List) game.getState().getValue(source.getSourceId() + "_token"); + if (tokenPermanents != null) { + Cards cards = new CardsImpl(); + for (Permanent permanent : tokenPermanents) { + cards.add(permanent); + } + controller.moveCards(cards, null, Zone.EXILED, source, game); + return true; + } } return false; } diff --git a/Mage.Sets/src/mage/sets/thedark/DiabolicMachine.java b/Mage.Sets/src/mage/sets/thedark/DiabolicMachine.java new file mode 100644 index 00000000000..5466c2308af --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/DiabolicMachine.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; + +/** + * + * @author nigelzor + */ +public class DiabolicMachine extends mage.sets.fourthedition.DiabolicMachine { + + public DiabolicMachine(UUID ownerId) { + super(ownerId); + this.cardNumber = 98; + this.expansionSetCode = "DRK"; + } + + public DiabolicMachine(final DiabolicMachine card) { + super(card); + } + + @Override + public DiabolicMachine copy() { + return new DiabolicMachine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/Drowned.java b/Mage.Sets/src/mage/sets/thedark/Drowned.java new file mode 100644 index 00000000000..ad60e1e8770 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/Drowned.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class Drowned extends CardImpl { + + public Drowned(UUID ownerId) { + super(ownerId, 23, "Drowned", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "DRK"; + this.subtype.add("Zombie"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {B}: Regenerate Drowned. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); + } + + public Drowned(final Drowned card) { + super(card); + } + + @Override + public Drowned copy() { + return new Drowned(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/Flood.java b/Mage.Sets/src/mage/sets/thedark/Flood.java new file mode 100644 index 00000000000..c1b651ec76c --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/Flood.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Flood extends mage.sets.fourthedition.Flood { + + public Flood(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + this.expansionSetCode = "DRK"; + this.rarity = Rarity.UNCOMMON; + } + + public Flood(final Flood card) { + super(card); + } + + @Override + public Flood copy() { + return new Flood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/GoblinCaves.java b/Mage.Sets/src/mage/sets/thedark/GoblinCaves.java new file mode 100644 index 00000000000..641d77f9a0c --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/GoblinCaves.java @@ -0,0 +1,102 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author nigelzor + */ +public class GoblinCaves extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin", "Goblin creatures"); + + public GoblinCaves(UUID ownerId) { + super(ownerId, 63, "Goblin Caves", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{R}"); + this.expansionSetCode = "DRK"; + this.subtype.add("Aura"); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // As long as enchanted land is a basic Mountain, Goblin creatures get +0/+2. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostAllEffect(0, 2, Duration.WhileOnBattlefield, filter, false), + new AttachedToBasicMountainCondition(), + "As long as enchanted land is a basic Mountain, Goblin creatures get +0/+2" + ))); + } + + public GoblinCaves(final GoblinCaves card) { + super(card); + } + + @Override + public GoblinCaves copy() { + return new GoblinCaves(this); + } +} + +class AttachedToBasicMountainCondition implements Condition { + + @Override + public boolean apply(Game game, Ability source) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null) { + Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); + if (enchanted != null) { + if (enchanted.hasSubtype("Mountain") && enchanted.getSupertype().contains("Basic")) { + return true; + } + } + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/thedark/GoblinWizard.java b/Mage.Sets/src/mage/sets/thedark/GoblinWizard.java new file mode 100644 index 00000000000..32f51bfeabd --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/GoblinWizard.java @@ -0,0 +1,102 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.Target; +import mage.target.TargetPermanent; + +/** + * + * @author BursegSardaukar + */ +public class GoblinWizard extends CardImpl { + + private static final FilterPermanentCard filter = new FilterPermanentCard("Goblin"); + private static final FilterCard protectionFilter = new FilterCard("white"); + private static final FilterPermanent goblinPermanent = new FilterPermanent("Goblin"); + + static { + filter.add(new SubtypePredicate("Goblin")); + goblinPermanent.add(new SubtypePredicate("Goblin")); + protectionFilter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public GoblinWizard(UUID ownerId) { + super(ownerId, 68, "Goblin Wizard", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "DRK"; + this.rarity = Rarity.RARE; + + this.subtype.add("Goblin"); + this.subtype.add("Wizard"); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: You may put a Goblin permanent card from your hand onto the battlefield. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new PutPermanentOnBattlefieldEffect(filter), + new TapSourceCost())); + + // {R}: Target Goblin gains protection from white until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new ProtectionAbility(protectionFilter), Duration.EndOfTurn), new ManaCostsImpl("{R}")); + Target target = new TargetPermanent(goblinPermanent); + ability.addTarget(target); + this.addAbility(ability); + + } + + public GoblinWizard(final GoblinWizard card) { + super(card); + } + + @Override + public GoblinWizard copy() { + return new GoblinWizard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/GoblinsOfTheFlarg.java b/Mage.Sets/src/mage/sets/thedark/GoblinsOfTheFlarg.java new file mode 100644 index 00000000000..c3d1e28e435 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/GoblinsOfTheFlarg.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author fireshoes + */ +public class GoblinsOfTheFlarg extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Dwarf"); + + static { + filter.add(new SubtypePredicate("Dwarf")); + } + + public GoblinsOfTheFlarg(UUID ownerId) { + super(ownerId, 69, "Goblins of the Flarg", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "DRK"; + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Mountainwalk + this.addAbility(new MountainwalkAbility()); + + // When you control a Dwarf, sacrifice Goblins of the Flarg. + this.addAbility(new ControlsPermanentsControllerTriggeredAbility( + filter, Filter.ComparisonType.GreaterThan, 0, + new SacrificeSourceEffect())); + } + + public GoblinsOfTheFlarg(final GoblinsOfTheFlarg card) { + super(card); + } + + @Override + public GoblinsOfTheFlarg copy() { + return new GoblinsOfTheFlarg(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/HiddenPath.java b/Mage.Sets/src/mage/sets/thedark/HiddenPath.java new file mode 100644 index 00000000000..0ca5e8d49cb --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/HiddenPath.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author fireshoes + */ +public class HiddenPath extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Green creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public HiddenPath(UUID ownerId) { + super(ownerId, 41, "Hidden Path", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}{G}{G}"); + this.expansionSetCode = "DRK"; + + // Green creatures have forestwalk. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new GainAbilityAllEffect(new ForestwalkAbility(false), Duration.WhileOnBattlefield, filter))); + } + + public HiddenPath(final HiddenPath card) { + super(card); + } + + @Override + public HiddenPath copy() { + return new HiddenPath(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/ManaVortex.java b/Mage.Sets/src/mage/sets/thedark/ManaVortex.java new file mode 100644 index 00000000000..c14a4934509 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/ManaVortex.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ManaVortex extends mage.sets.masterseditioniii.ManaVortex { + + public ManaVortex(UUID ownerId) { + super(ownerId); + this.cardNumber = 30; + this.expansionSetCode = "DRK"; + } + + public ManaVortex(final ManaVortex card) { + super(card); + } + + @Override + public ManaVortex copy() { + return new ManaVortex(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/MerfolkAssassin.java b/Mage.Sets/src/mage/sets/thedark/MerfolkAssassin.java new file mode 100644 index 00000000000..514698b1f18 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/MerfolkAssassin.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.IslandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class MerfolkAssassin extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with islandwalk"); + + static { + filter.add(new AbilityPredicate(IslandwalkAbility.class)); + } + + public MerfolkAssassin(UUID ownerId) { + super(ownerId, 31, "Merfolk Assassin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{U}{U}"); + this.expansionSetCode = "DRK"; + this.subtype.add("Merfolk"); + this.subtype.add("Assassin"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {tap}: Destroy target creature with islandwalk. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public MerfolkAssassin(final MerfolkAssassin card) { + super(card); + } + + @Override + public MerfolkAssassin copy() { + return new MerfolkAssassin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/MurkDwellers.java b/Mage.Sets/src/mage/sets/thedark/MurkDwellers.java new file mode 100644 index 00000000000..e759ec1c3c6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/MurkDwellers.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MurkDwellers extends mage.sets.fifthedition.MurkDwellers { + + public MurkDwellers(UUID ownerId) { + super(ownerId); + this.cardNumber = 11; + this.expansionSetCode = "DRK"; + } + + public MurkDwellers(final MurkDwellers card) { + super(card); + } + + @Override + public MurkDwellers copy() { + return new MurkDwellers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/Riptide.java b/Mage.Sets/src/mage/sets/thedark/Riptide.java new file mode 100644 index 00000000000..e2fd424ed0f --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/Riptide.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.TapAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class Riptide extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blue creatures"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public Riptide(UUID ownerId) { + super(ownerId, 34, "Riptide", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "DRK"; + + // Tap all blue creatures. + this.getSpellAbility().addEffect(new TapAllEffect(filter)); + } + + public Riptide(final Riptide card) { + super(card); + } + + @Override + public Riptide copy() { + return new Riptide(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/SafeHaven.java b/Mage.Sets/src/mage/sets/thedark/SafeHaven.java new file mode 100644 index 00000000000..d9e0dd30cbf --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/SafeHaven.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.ReturnFromExileEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SafeHaven extends CardImpl { + + public SafeHaven(UUID ownerId) { + super(ownerId, 115, "Safe Haven", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "DRK"; + + // {2}, {tap}: Exile target creature you control. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(this.getId(), + this.getIdName()), new ManaCostsImpl("{2}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + // At the beginning of your upkeep, you may sacrifice Safe Haven. If you do, return each card exiled with Safe Haven to the battlefield under its owner's control. + ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), + TargetController.YOU, true); + ability.addEffect(new ReturnFromExileEffect(this.getId(), Zone.BATTLEFIELD, + "If you do, return each card exiled with {this} to the battlefield under its owner's control")); + this.addAbility(ability); + } + + public SafeHaven(final SafeHaven card) { + super(card); + } + + @Override + public SafeHaven copy() { + return new SafeHaven(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java b/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java new file mode 100644 index 00000000000..823a74756b8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/ScarwoodHag.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.continuous.LoseAbilityTargetEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class ScarwoodHag extends CardImpl { + + public ScarwoodHag(UUID ownerId) { + super(ownerId, 49, "Scarwood Hag", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "DRK"; + this.subtype.add("Hag"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {G}{G}{G}{G}, {tap}: Target creature gains forestwalk until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new ForestwalkAbility(false), Duration.EndOfTurn), + new ManaCostsImpl("{G}{G}{G}{G}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // {tap}: Target creature loses forestwalk until end of turn. + Effect effect = new LoseAbilityTargetEffect(new ForestwalkAbility(true), Duration.EndOfTurn); + effect.setText("Target creature loses forestwalk until end of turn"); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + effect, + new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ScarwoodHag(final ScarwoodHag card) { + super(card); + } + + @Override + public ScarwoodHag copy() { + return new ScarwoodHag(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/SistersOfTheFlame.java b/Mage.Sets/src/mage/sets/thedark/SistersOfTheFlame.java new file mode 100644 index 00000000000..ee6a399d248 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/SistersOfTheFlame.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SistersOfTheFlame extends mage.sets.fourthedition.SistersOfTheFlame { + + public SistersOfTheFlame(UUID ownerId) { + super(ownerId); + this.cardNumber = 73; + this.expansionSetCode = "DRK"; + this.rarity = Rarity.UNCOMMON; + } + + public SistersOfTheFlame(final SistersOfTheFlame card) { + super(card); + } + + @Override + public SistersOfTheFlame copy() { + return new SistersOfTheFlame(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/SkullOfOrm.java b/Mage.Sets/src/mage/sets/thedark/SkullOfOrm.java index dfc74fba39c..d6ca4b86d30 100644 --- a/Mage.Sets/src/mage/sets/thedark/SkullOfOrm.java +++ b/Mage.Sets/src/mage/sets/thedark/SkullOfOrm.java @@ -40,7 +40,7 @@ import mage.cards.CardImpl; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetCardInYourGraveyard; /** * @@ -48,7 +48,7 @@ import mage.target.common.TargetCardInGraveyard; */ public class SkullOfOrm extends CardImpl { - private static final FilterCard filter = new FilterCard("enchantment cards"); + private static final FilterCard filter = new FilterCard("enchantment card from your graveyard"); static { filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); @@ -60,7 +60,7 @@ public class SkullOfOrm extends CardImpl { // {5}, {tap}: Return target enchantment card from your graveyard to your hand. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{5}")); - ability.addTarget(new TargetCardInGraveyard(filter)); + ability.addTarget(new TargetCardInYourGraveyard(filter)); ability.addCost(new TapSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/thedark/SunkenCity.java b/Mage.Sets/src/mage/sets/thedark/SunkenCity.java new file mode 100644 index 00000000000..52d66ec2239 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/SunkenCity.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SunkenCity extends mage.sets.mastersedition.SunkenCity { + + public SunkenCity(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "DRK"; + this.rarity = Rarity.COMMON; + } + + public SunkenCity(final SunkenCity card) { + super(card); + } + + @Override + public SunkenCity copy() { + return new SunkenCity(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/Venom.java b/Mage.Sets/src/mage/sets/thedark/Venom.java index 42eb58e7165..5c736ca71e6 100644 --- a/Mage.Sets/src/mage/sets/thedark/Venom.java +++ b/Mage.Sets/src/mage/sets/thedark/Venom.java @@ -31,8 +31,9 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; @@ -66,7 +67,10 @@ public class Venom extends CardImpl { this.addAbility(ability); // Whenever enchanted creature blocks or becomes blocked by a non-Wall creature, destroy the other creature at end of combat. - this.addAbility(new VenomTriggeredAbility()); + Effect effect = new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); + effect.setText("destroy that creature at end of combat"); + this.addAbility(new VenomTriggeredAbility(effect)); } public Venom(final Venom card) { @@ -81,8 +85,8 @@ public class Venom extends CardImpl { class VenomTriggeredAbility extends TriggeredAbilityImpl { - VenomTriggeredAbility() { - super(Zone.BATTLEFIELD, new VenomEffect()); + VenomTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); } VenomTriggeredAbility(final VenomTriggeredAbility ability) { @@ -128,35 +132,3 @@ class VenomTriggeredAbility extends TriggeredAbilityImpl { return "Whenever enchanted creature blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat."; } } - -class VenomEffect extends OneShotEffect { - - VenomEffect() { - super(Outcome.DestroyPermanent); - staticText = "destroy that creature at end of combat"; - } - - VenomEffect(final VenomEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - if (targetCreature != null) { - AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId())); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - return false; - } - - @Override - public VenomEffect copy() { - return new VenomEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/thedark/WordOfBinding.java b/Mage.Sets/src/mage/sets/thedark/WordOfBinding.java new file mode 100644 index 00000000000..ecd0f63a4b6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/WordOfBinding.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WordOfBinding extends mage.sets.fourthedition.WordOfBinding { + + public WordOfBinding(UUID ownerId) { + super(ownerId); + this.cardNumber = 17; + this.expansionSetCode = "DRK"; + } + + public WordOfBinding(final WordOfBinding card) { + super(card); + } + + @Override + public WordOfBinding copy() { + return new WordOfBinding(this); + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/WormwoodTreefolk.java b/Mage.Sets/src/mage/sets/thedark/WormwoodTreefolk.java new file mode 100644 index 00000000000..a19004a8f30 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/WormwoodTreefolk.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class WormwoodTreefolk extends CardImpl { + + public WormwoodTreefolk(UUID ownerId) { + super(ownerId, 55, "Wormwood Treefolk", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "DRK"; + this.subtype.add("Treefolk"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {G}{G}: Wormwood Treefolk gains forestwalk until end of turn and deals 2 damage to you. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new ForestwalkAbility(false), Duration.EndOfTurn), new ManaCostsImpl("{G}{G}")); + ability.addEffect(new DamageControllerEffect(2)); + this.addAbility(ability); + + // {B}{B}: Wormwood Treefolk gains swampwalk until end of turn and deals 2 damage to you. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new SwampwalkAbility(false), Duration.EndOfTurn), new ManaCostsImpl("{B}{B}")); + ability.addEffect(new DamageControllerEffect(2)); + this.addAbility(ability); + } + + public WormwoodTreefolk(final WormwoodTreefolk card) { + super(card); + } + + @Override + public WormwoodTreefolk copy() { + return new WormwoodTreefolk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/theros/AkroanHorse.java b/Mage.Sets/src/mage/sets/theros/AkroanHorse.java index 014fb58c23a..702daa268df 100644 --- a/Mage.Sets/src/mage/sets/theros/AkroanHorse.java +++ b/Mage.Sets/src/mage/sets/theros/AkroanHorse.java @@ -49,6 +49,7 @@ import mage.constants.TargetController; import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.game.permanent.token.SoldierToken; import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.Target; @@ -175,23 +176,9 @@ class AkroanHorseCreateTokenEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { for (UUID opponentId: game.getOpponents(source.getControllerId())) { - Token token = new AkroanHorseSoldierToken(); + Token token = new SoldierToken(); token.putOntoBattlefield(1, game, source.getSourceId(), opponentId); } return true; } } - -class AkroanHorseSoldierToken extends Token { - - public AkroanHorseSoldierToken() { - super("Soldier", "1/1 white Soldier creature token"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Soldier"); - power = new MageInt(1); - toughness = new MageInt(1); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/theros/ArtisanOfForms.java b/Mage.Sets/src/mage/sets/theros/ArtisanOfForms.java index 87a97f0fdf8..928993b8dd2 100644 --- a/Mage.Sets/src/mage/sets/theros/ArtisanOfForms.java +++ b/Mage.Sets/src/mage/sets/theros/ArtisanOfForms.java @@ -29,6 +29,7 @@ package mage.sets.theros; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CopyPermanentEffect; @@ -77,6 +78,14 @@ public class ArtisanOfForms extends CardImpl { class ArtisanOfFormsApplyToPermanent extends ApplyToPermanent { + @Override + public Boolean apply(Game game, MageObject mageObject) { + Effect effect = new CopyPermanentEffect(new ArtisanOfFormsApplyToPermanent()); + effect.setText("have {this} become a copy of target creature and gain this ability"); + mageObject.getAbilities().add(new HeroicAbility(effect, true)); + return true; + } + @Override public Boolean apply(Game game, Permanent permanent) { Effect effect = new CopyPermanentEffect(new ArtisanOfFormsApplyToPermanent()); @@ -84,4 +93,5 @@ class ArtisanOfFormsApplyToPermanent extends ApplyToPermanent { permanent.addAbility(new HeroicAbility(effect, true), game); return true; } + } diff --git a/Mage.Sets/src/mage/sets/theros/AshiokNightmareWeaver.java b/Mage.Sets/src/mage/sets/theros/AshiokNightmareWeaver.java index f742e0790fb..f9749475e70 100644 --- a/Mage.Sets/src/mage/sets/theros/AshiokNightmareWeaver.java +++ b/Mage.Sets/src/mage/sets/theros/AshiokNightmareWeaver.java @@ -31,12 +31,11 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayVariableLoyaltyCost; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; @@ -48,7 +47,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.common.FilterCreatureCard; @@ -73,8 +71,7 @@ public class AshiokNightmareWeaver extends CardImpl { this.expansionSetCode = "THS"; this.subtype.add("Ashiok"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +2: Exile the top three cards of target opponent's library. LoyaltyAbility ability = new LoyaltyAbility(new AshiokNightmareWeaverExileEffect(), 2); @@ -121,14 +118,9 @@ class AshiokNightmareWeaverExileEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (sourceObject != null && opponent != null && controller != null) { - UUID exileZone = CardUtil.getObjectExileZoneId(game, sourceObject); + UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); if (exileZone != null) { - for (int i = 0; i < 3; i++) { - Card card = opponent.getLibrary().getFromTop(game); - if (card != null) { - controller.moveCardToExileWithInfo(card, exileZone, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true); - } - } + controller.moveCardsToExile(opponent.getLibrary().getTopCards(game, 3), source, game, true, exileZone, sourceObject.getIdName()); return true; } } @@ -167,25 +159,22 @@ class AshiokNightmareWeaverPutIntoPlayEffect extends OneShotEffect { } } - FilterCard filter = new FilterCreatureCard(new StringBuilder("creature card with converted mana cost {").append(cmc).append("} exiled with Ashiok, Nightmare Weaver").toString()); + FilterCard filter = new FilterCreatureCard("creature card with converted mana cost {" + cmc + "} exiled with " + sourceObject.getIdName()); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, cmc)); - - Target target = new TargetCardInExile(filter, CardUtil.getObjectExileZoneId(game, sourceObject)); + Target target = new TargetCardInExile(filter, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter())); if (target.canChoose(source.getSourceId(), controller.getId(), game)) { if (controller.chooseTarget(Outcome.PutCreatureInPlay, target, source, game)) { Card card = game.getCard(target.getFirstTarget()); - if (card != null && controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId())) { - // why is this change of controller neccessary? + if (card != null + && controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { - permanent.changeControllerId(source.getControllerId(), game); + ContinuousEffectImpl effect = new AshiokNightmareWeaverAddTypeEffect(); + effect.setTargetPointer(new FixedTarget(permanent, game)); + game.addEffect(effect, source); } - - ContinuousEffectImpl effect = new AshiokNightmareWeaverAddTypeEffect(); - effect.setTargetPointer(new FixedTarget(card.getId())); - game.addEffect(effect, source); return true; } } @@ -267,7 +256,7 @@ class AshiokNightmareWeaverExileAllEffect extends OneShotEffect { if (exileId == null) { return false; } - for (UUID opponentId: game.getOpponents(source.getControllerId())) { + for (UUID opponentId : game.getOpponents(source.getControllerId())) { Player opponent = game.getPlayer(opponentId); if (opponent != null) { Cards cards = new CardsImpl(); @@ -280,7 +269,7 @@ class AshiokNightmareWeaverExileAllEffect extends OneShotEffect { } cards.clear(); cards.addAll(opponent.getGraveyard()); - for (UUID cardId :cards) { + for (UUID cardId : cards) { Card card = game.getCard(cardId); if (card != null) { controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.GRAVEYARD, true); diff --git a/Mage.Sets/src/mage/sets/theros/ColossusOfAkros.java b/Mage.Sets/src/mage/sets/theros/ColossusOfAkros.java index 9515c4f37d3..02b540a053b 100644 --- a/Mage.Sets/src/mage/sets/theros/ColossusOfAkros.java +++ b/Mage.Sets/src/mage/sets/theros/ColossusOfAkros.java @@ -1,91 +1,91 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.theros; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.common.MonstrousCondition; -import mage.abilities.decorator.ConditionalAsThoughEffect; -import mage.abilities.decorator.ConditionalContinuousEffect; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; -import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.keyword.DefenderAbility; -import mage.abilities.keyword.IndestructibleAbility; -import mage.abilities.keyword.MonstrosityAbility; -import mage.abilities.keyword.TrampleAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; - -/** - * - * @author LevelX2 - */ -public class ColossusOfAkros extends CardImpl { - - public ColossusOfAkros(UUID ownerId) { - super(ownerId, 214, "Colossus of Akros", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{8}"); - this.expansionSetCode = "THS"; - this.subtype.add("Golem"); - - this.power = new MageInt(10); - this.toughness = new MageInt(10); - - // Defender - this.addAbility(DefenderAbility.getInstance()); - // indestructible. - this.addAbility(IndestructibleAbility.getInstance()); - // {10}: Monstrosity 10. - this.addAbility(new MonstrosityAbility("{10}", 10)); - // As long as Colossus of Akros is monstrous, it has trample and can attack as though it didn't have defender. - Ability ability = new SimpleStaticAbility( - Zone.BATTLEFIELD, - new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), - MonstrousCondition.getInstance(), - "As long as {this} is monstrous, it has trample")); - Effect effect = new ConditionalAsThoughEffect(new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), - MonstrousCondition.getInstance()); - effect.setText("and can attack as though it didn't have defender"); - ability.addEffect(effect); - this.addAbility(ability); - } - - public ColossusOfAkros(final ColossusOfAkros card) { - super(card); - } - - @Override - public ColossusOfAkros copy() { - return new ColossusOfAkros(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.theros; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MonstrousCondition; +import mage.abilities.decorator.ConditionalAsThoughEffect; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.abilities.keyword.MonstrosityAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class ColossusOfAkros extends CardImpl { + + public ColossusOfAkros(UUID ownerId) { + super(ownerId, 214, "Colossus of Akros", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{8}"); + this.expansionSetCode = "THS"; + this.subtype.add("Golem"); + + this.power = new MageInt(10); + this.toughness = new MageInt(10); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // indestructible. + this.addAbility(IndestructibleAbility.getInstance()); + // {10}: Monstrosity 10. + this.addAbility(new MonstrosityAbility("{10}", 10)); + // As long as Colossus of Akros is monstrous, it has trample and can attack as though it didn't have defender. + Ability ability = new SimpleStaticAbility( + Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), + MonstrousCondition.getInstance(), + "As long as {this} is monstrous, it has trample")); + Effect effect = new ConditionalAsThoughEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield), + MonstrousCondition.getInstance()); + effect.setText("and can attack as though it didn't have defender"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public ColossusOfAkros(final ColossusOfAkros card) { + super(card); + } + + @Override + public ColossusOfAkros copy() { + return new ColossusOfAkros(this); + } +} diff --git a/Mage.Sets/src/mage/sets/theros/DaxosOfMeletis.java b/Mage.Sets/src/mage/sets/theros/DaxosOfMeletis.java index 555da66687d..d1537527af2 100644 --- a/Mage.Sets/src/mage/sets/theros/DaxosOfMeletis.java +++ b/Mage.Sets/src/mage/sets/theros/DaxosOfMeletis.java @@ -34,6 +34,7 @@ import mage.abilities.Ability; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.SimpleEvasionAbility; import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.AsThoughManaEffect; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; @@ -42,6 +43,7 @@ import mage.cards.CardImpl; import mage.constants.AsThoughEffectType; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.ManaType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; @@ -50,6 +52,7 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.PowerPredicate; import mage.game.ExileZone; import mage.game.Game; +import mage.players.ManaPoolItem; import mage.players.Player; import mage.target.targetpointer.FixedTarget; import mage.util.CardUtil; @@ -181,10 +184,10 @@ class DaxosOfMeletisCastFromExileEffect extends AsThoughEffectImpl { } } -class DaxosOfMeletisSpendAnyManaEffect extends AsThoughEffectImpl { +class DaxosOfMeletisSpendAnyManaEffect extends AsThoughEffectImpl implements AsThoughManaEffect { public DaxosOfMeletisSpendAnyManaEffect() { - super(AsThoughEffectType.SPEND_ANY_MANA, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.SPEND_OTHER_MANA, Duration.EndOfTurn, Outcome.Benefit); staticText = "you may spend mana as though it were mana of any color to cast it"; } @@ -207,6 +210,13 @@ class DaxosOfMeletisSpendAnyManaEffect extends AsThoughEffectImpl { return source.getControllerId().equals(affectedControllerId) && objectId == ((FixedTarget) getTargetPointer()).getTarget() && ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId) + && (((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(objectId)) && game.getState().getZone(objectId).equals(Zone.STACK); } + + @Override + public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) { + return mana.getFirstAvailable(); + } + } diff --git a/Mage.Sets/src/mage/sets/theros/DeathbellowRaider.java b/Mage.Sets/src/mage/sets/theros/DeathbellowRaider.java index f239c663691..a9851f4fe18 100644 --- a/Mage.Sets/src/mage/sets/theros/DeathbellowRaider.java +++ b/Mage.Sets/src/mage/sets/theros/DeathbellowRaider.java @@ -29,14 +29,12 @@ package mage.sets.theros; import java.util.UUID; import mage.MageInt; +import mage.abilities.common.AttacksEachTurnStaticAbility; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.combat.AttacksIfAbleSourceEffect; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; @@ -56,7 +54,8 @@ public class DeathbellowRaider extends CardImpl { this.toughness = new MageInt(3); // Deathbellow Raider attacks each turn if able. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield))); + this.addAbility(new AttacksEachTurnStaticAbility()); + // {2}{B}: Regenerate Deathbellow Raider. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{2}{B}"))); } diff --git a/Mage.Sets/src/mage/sets/theros/ElspethSunsChampion.java b/Mage.Sets/src/mage/sets/theros/ElspethSunsChampion.java index ec4d805c92a..1710de8c1c3 100644 --- a/Mage.Sets/src/mage/sets/theros/ElspethSunsChampion.java +++ b/Mage.Sets/src/mage/sets/theros/ElspethSunsChampion.java @@ -30,21 +30,19 @@ package mage.sets.theros; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.GetEmblemEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.PowerPredicate; @@ -58,6 +56,7 @@ import mage.game.permanent.token.SoldierToken; public class ElspethSunsChampion extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with power 4 or greater"); + static { filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 3)); } @@ -67,8 +66,7 @@ public class ElspethSunsChampion extends CardImpl { this.expansionSetCode = "THS"; this.subtype.add("Elspeth"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +1: Put three 1/1 white Soldier creature tokens onto the battlefield. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new SoldierToken(), 3), 1)); @@ -95,7 +93,7 @@ class ElspethSunsChampionEmblem extends Emblem { public ElspethSunsChampionEmblem() { this.setName("EMBLEM: Elspeth, Sun's Champion"); - Ability ability = new SimpleStaticAbility(Zone.COMMAND, new BoostControlledEffect(2,2, Duration.WhileOnBattlefield, filter, false)); + Ability ability = new SimpleStaticAbility(Zone.COMMAND, new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, filter, false)); ability.addEffect(new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, filter)); this.getAbilities().add(ability); diff --git a/Mage.Sets/src/mage/sets/theros/EvangelOfHeliod.java b/Mage.Sets/src/mage/sets/theros/EvangelOfHeliod.java index 21614846b7b..81b53460c64 100644 --- a/Mage.Sets/src/mage/sets/theros/EvangelOfHeliod.java +++ b/Mage.Sets/src/mage/sets/theros/EvangelOfHeliod.java @@ -37,7 +37,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.ColoredManaSymbol; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SoldierToken; /** * @@ -55,7 +55,7 @@ public class EvangelOfHeliod extends CardImpl { this.toughness = new MageInt(3); // When Evangel of Heliod enters the battlefield, put a number of 1/1 white Soldier creature tokens onto the battlefield equal to your devotion to white. - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EvangelOfHeliodSoldierToken(), new DevotionCount(ColoredManaSymbol.W)))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SoldierToken(), new DevotionCount(ColoredManaSymbol.W)))); } public EvangelOfHeliod(final EvangelOfHeliod card) { @@ -67,17 +67,3 @@ public class EvangelOfHeliod extends CardImpl { return new EvangelOfHeliod(this); } } - -class EvangelOfHeliodSoldierToken extends Token { - - public EvangelOfHeliodSoldierToken() { - super("Soldier", "1/1 white Soldier creature tokens"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Soldier"); - power = new MageInt(1); - toughness = new MageInt(1); - } - -} diff --git a/Mage.Sets/src/mage/sets/theros/MistcutterHydra.java b/Mage.Sets/src/mage/sets/theros/MistcutterHydra.java index d1586f273b6..8ccd965236b 100644 --- a/Mage.Sets/src/mage/sets/theros/MistcutterHydra.java +++ b/Mage.Sets/src/mage/sets/theros/MistcutterHydra.java @@ -30,22 +30,17 @@ package mage.sets.theros; import java.util.UUID; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.CantBeCounteredAbility; import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.counters.CounterType; import mage.filter.FilterObject; import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -54,6 +49,7 @@ import mage.game.permanent.Permanent; public class MistcutterHydra extends CardImpl { private static final FilterObject filter = new FilterObject("from blue"); + static { filter.add(new ColorPredicate(ObjectColor.BLUE)); } @@ -73,7 +69,7 @@ public class MistcutterHydra extends CardImpl { // protection from blue this.addAbility(new ProtectionAbility(filter)); // Mistcutter Hydra enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new MistcutterHydraEffect())); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); } public MistcutterHydra(final MistcutterHydra card) { @@ -85,37 +81,3 @@ public class MistcutterHydra extends CardImpl { return new MistcutterHydra(this); } } - -class MistcutterHydraEffect extends OneShotEffect { - - public MistcutterHydraEffect() { - super(Outcome.BoostCreature); - staticText = "{this} enters the battlefield with X +1/+1 counters on it"; - } - - public MistcutterHydraEffect(final MistcutterHydraEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility)obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public MistcutterHydraEffect copy() { - return new MistcutterHydraEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/theros/PeakEruption.java b/Mage.Sets/src/mage/sets/theros/PeakEruption.java index 4aa27c573a4..0b8e9796eb1 100644 --- a/Mage.Sets/src/mage/sets/theros/PeakEruption.java +++ b/Mage.Sets/src/mage/sets/theros/PeakEruption.java @@ -28,19 +28,14 @@ package mage.sets.theros; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetControllerEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetLandPermanent; /** @@ -50,20 +45,21 @@ import mage.target.common.TargetLandPermanent; public class PeakEruption extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain"); + static{ filter.add(new SubtypePredicate(("Mountain"))); } - - + public PeakEruption(UUID ownerId) { super(ownerId, 132, "Peak Eruption", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{R}"); this.expansionSetCode = "THS"; - // Destroy target Mountain. Peak Eruption deals 3 damage to that land's controller. - this.getSpellAbility().addTarget(new TargetLandPermanent(filter)); this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addEffect(new PeakEruptionEffect()); + Effect effect = new DamageTargetControllerEffect(3); + effect.setText("{this} deals 3 damage to that land's controller"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetLandPermanent(filter)); } public PeakEruption(final PeakEruption card) { @@ -75,36 +71,3 @@ public class PeakEruption extends CardImpl { return new PeakEruption(this); } } - - -class PeakEruptionEffect extends OneShotEffect { - - PeakEruptionEffect() { - super(Outcome.Damage); - staticText = "{this} deals 3 damage to that land's controller"; - } - - PeakEruptionEffect(final PeakEruptionEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getBattlefield().getPermanent(source.getFirstTarget()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); - } - if (permanent != null) { - Player player = game.getPlayer(permanent.getControllerId()); - if (player != null) { - player.damage(3, source.getSourceId(), game, false, true); - } - } - return false; - } - - @Override - public PeakEruptionEffect copy() { - return new PeakEruptionEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/theros/PolisCrusher.java b/Mage.Sets/src/mage/sets/theros/PolisCrusher.java index 2d169d80853..84757edc1f5 100644 --- a/Mage.Sets/src/mage/sets/theros/PolisCrusher.java +++ b/Mage.Sets/src/mage/sets/theros/PolisCrusher.java @@ -64,6 +64,8 @@ public class PolisCrusher extends CardImpl { filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } + private final UUID originalId; + public PolisCrusher(UUID ownerId) { super(ownerId, 198, "Polis Crusher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{G}"); this.expansionSetCode = "THS"; @@ -83,16 +85,18 @@ public class PolisCrusher extends CardImpl { new DealsCombatDamageToAPlayerTriggeredAbility(new DestroyTargetEffect(), false, true), MonstrousCondition.getInstance(), "Whenever {this} deals combat damage to a player, if {this} is monstrous, destroy target enchantment that player controls."); + originalId = ability.getOriginalId(); this.addAbility(ability); } public PolisCrusher(final PolisCrusher card) { super(card); + this.originalId = card.originalId; } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof ConditionalTriggeredAbility) { + if (ability.getOriginalId().equals(originalId)) { for (Effect effect : ability.getEffects()) { if (effect instanceof DestroyTargetEffect) { Player attackedPlayer = game.getPlayer(effect.getTargetPointer().getFirst(game, ability)); diff --git a/Mage.Sets/src/mage/sets/theros/PsychicIntrusion.java b/Mage.Sets/src/mage/sets/theros/PsychicIntrusion.java index 31c62eccfc8..2598d6fab96 100644 --- a/Mage.Sets/src/mage/sets/theros/PsychicIntrusion.java +++ b/Mage.Sets/src/mage/sets/theros/PsychicIntrusion.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.AsThoughManaEffect; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; @@ -38,11 +39,13 @@ import mage.cards.CardImpl; import mage.constants.AsThoughEffectType; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.ManaType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterNonlandCard; import mage.game.Game; +import mage.players.ManaPoolItem; import mage.players.Player; import mage.target.TargetCard; import mage.target.common.TargetOpponent; @@ -59,7 +62,6 @@ public class PsychicIntrusion extends CardImpl { super(ownerId, 200, "Psychic Intrusion", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}{B}"); this.expansionSetCode = "THS"; - // Target opponent reveals his or her hand. You choose a nonland card from that player's graveyard or hand and exile it. // You may cast that card for as long as it remains exiled, and you may spend mana as though it were mana of any color // to cast that spell. @@ -135,7 +137,7 @@ class PsychicIntrusionExileEffect extends OneShotEffect { if (card != null) { // move card to exile UUID exileId = CardUtil.getCardExileZoneId(game, source); - controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, fromHand ? Zone.HAND:Zone.GRAVEYARD, true); + controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, fromHand ? Zone.HAND : Zone.GRAVEYARD, true); // allow to cast the card ContinuousEffect effect = new PsychicIntrusionCastFromExileEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); @@ -178,21 +180,21 @@ class PsychicIntrusionCastFromExileEffect extends AsThoughEffectImpl { if (objectId.equals(getTargetPointer().getFirst(game, source))) { if (affectedControllerId.equals(source.getControllerId())) { return true; - } + } } else { - if (((FixedTarget)getTargetPointer()).getTarget().equals(objectId)) { + if (((FixedTarget) getTargetPointer()).getTarget().equals(objectId)) { // object has moved zone so effect can be discarted this.discard(); } - } + } return false; } } -class PsychicIntrusionSpendAnyManaEffect extends AsThoughEffectImpl { +class PsychicIntrusionSpendAnyManaEffect extends AsThoughEffectImpl implements AsThoughManaEffect { public PsychicIntrusionSpendAnyManaEffect() { - super(AsThoughEffectType.SPEND_ANY_MANA, Duration.Custom, Outcome.Benefit); + super(AsThoughEffectType.SPEND_OTHER_MANA, Duration.Custom, Outcome.Benefit); staticText = "you may spend mana as though it were mana of any color to cast it"; } @@ -212,22 +214,27 @@ class PsychicIntrusionSpendAnyManaEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - if (objectId.equals(((FixedTarget)getTargetPointer()).getTarget()) - && game.getState().getZoneChangeCounter(objectId) <= ((FixedTarget)getTargetPointer()).getZoneChangeCounter() +1) { - - if (affectedControllerId.equals(source.getControllerId())) { + if (objectId.equals(((FixedTarget) getTargetPointer()).getTarget()) + && game.getState().getZoneChangeCounter(objectId) <= ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) { + + if (affectedControllerId.equals(source.getControllerId())) { // if the card moved from exile to spell the zone change counter is increased by 1 - if (game.getState().getZoneChangeCounter(objectId) == ((FixedTarget)getTargetPointer()).getZoneChangeCounter() +1) { + if (game.getState().getZoneChangeCounter(objectId) == ((FixedTarget) getTargetPointer()).getZoneChangeCounter() + 1) { return true; } - } - + } + } else { - if (((FixedTarget)getTargetPointer()).getTarget().equals(objectId)) { + if (((FixedTarget) getTargetPointer()).getTarget().equals(objectId)) { // object has moved zone so effect can be discarted this.discard(); } } return false; } + + @Override + public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) { + return mana.getFirstAvailable(); + } } diff --git a/Mage.Sets/src/mage/sets/theros/PyxisOfPandemonium.java b/Mage.Sets/src/mage/sets/theros/PyxisOfPandemonium.java index ce637215919..ae89cc24db2 100644 --- a/Mage.Sets/src/mage/sets/theros/PyxisOfPandemonium.java +++ b/Mage.Sets/src/mage/sets/theros/PyxisOfPandemonium.java @@ -39,6 +39,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -114,16 +116,14 @@ class PyxisOfPandemoniumExileEffect extends OneShotEffect { Player player = game.getPlayer(playerId); if (player != null) { if (player.getLibrary().size() > 0) { - Card card = player.getLibrary().getFromTop(game); + Card card = player.getLibrary().getFromTop(game); String exileKey = playerId.toString() + CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()).toString(); UUID exileId = exileIds.get(exileKey); if (exileId == null) { exileId = UUID.randomUUID(); exileIds.put(exileKey, exileId); } - player.moveCardToExileWithInfo(card, exileId, - new StringBuilder(sourceObject.getIdName() +" (").append(player.getLogName()).append(")").toString(), - source.getSourceId(), game, Zone.LIBRARY, true); + player.moveCardsToExile(card, source, game, false, exileId, sourceObject.getIdName() + " (" + player.getName() + ")"); card.setFaceDown(true, game); } } @@ -163,8 +163,8 @@ class PyxisOfPandemoniumPutOntoBattlefieldEffect extends OneShotEffect { } else { return true; } - - for (UUID playerId : controller.getInRange()) { + Cards cardsToBringIntoPlay = new CardsImpl(); + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { String exileKey = playerId.toString() + CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()).toString(); @@ -172,16 +172,17 @@ class PyxisOfPandemoniumPutOntoBattlefieldEffect extends OneShotEffect { if (exileId != null) { ExileZone exileZone = game.getState().getExile().getExileZone(exileId); if (exileZone != null) { - for(Card card: exileZone.getCards(game)) { + for (Card card : exileZone.getCards(game)) { card.setFaceDown(false, game); if (CardUtil.isPermanentCard(card)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); + cardsToBringIntoPlay.add(card); } } } } } } + controller.moveCards(cardsToBringIntoPlay.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/theros/RescueFromTheUnderworld.java b/Mage.Sets/src/mage/sets/theros/RescueFromTheUnderworld.java index 6878692be27..d5e83a36b87 100644 --- a/Mage.Sets/src/mage/sets/theros/RescueFromTheUnderworld.java +++ b/Mage.Sets/src/mage/sets/theros/RescueFromTheUnderworld.java @@ -57,20 +57,24 @@ import mage.target.common.TargetControlledCreaturePermanent; /** * - * Once you announce you’re casting Rescue from the Underworld, no player may attempt to - * stop you from casting the spell by removing the creature you want to sacrifice. + * Once you announce you’re casting Rescue from the Underworld, no player may + * attempt to stop you from casting the spell by removing the creature you want + * to sacrifice. * - * If you sacrifice a creature token to cast Rescue from the Underworld, it won’t return - * to the battlefield, although the target creature card will. + * If you sacrifice a creature token to cast Rescue from the Underworld, it + * won’t return to the battlefield, although the target creature card will. * - * If either the sacrificed creature or the target creature card leaves the graveyard - * before the delayed triggered ability resolves during your next upkeep, it won’t return. + * If either the sacrificed creature or the target creature card leaves the + * graveyard before the delayed triggered ability resolves during your next + * upkeep, it won’t return. * - * However, if the sacrificed creature is put into another public zone instead of the graveyard, - * perhaps because it’s your commander or because of another replacement effect, it will return - * to the battlefield from the zone it went to. + * However, if the sacrificed creature is put into another public zone instead + * of the graveyard, perhaps because it’s your commander or because of another + * replacement effect, it will return to the battlefield from the zone it went + * to. * - * Rescue from the Underworld is exiled as it resolves, not later as its delayed trigger resolves. + * Rescue from the Underworld is exiled as it resolves, not later as its delayed + * trigger resolves. * * * @author LevelX2 @@ -81,9 +85,8 @@ public class RescueFromTheUnderworld extends CardImpl { super(ownerId, 102, "Rescue from the Underworld", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{B}"); this.expansionSetCode = "THS"; - // As an additional cost to cast Rescue from the Underworld, sacrifice a creature. - this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1,new FilterControlledCreaturePermanent("a creature"), false))); + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), false))); // Choose target creature card in your graveyard. Return that card and the sacrificed card to the battlefield under your control at the beginning of your next upkeep. Exile Rescue from the Underworld. this.getSpellAbility().addEffect(new RescueFromTheUnderworldTextEffect()); @@ -151,15 +154,15 @@ class RescueFromTheUnderworldCreateDelayedTriggeredAbilityEffect extends OneShot delayedAbility.setControllerId(source.getControllerId()); delayedAbility.setSourceObject(source.getSourceObject(game), game); delayedAbility.getTargets().addAll(source.getTargets()); - for(Effect effect : delayedAbility.getEffects()) { + for (Effect effect : delayedAbility.getEffects()) { effect.getTargetPointer().init(game, source); } // add the sacrificed creature as target - for (Cost cost :source.getCosts()) { + for (Cost cost : source.getCosts()) { if (cost instanceof SacrificeTargetCost) { SacrificeTargetCost sacCost = (SacrificeTargetCost) cost; TargetCardInGraveyard target = new TargetCardInGraveyard(); - for(Permanent permanent : sacCost.getPermanents()) { + for (Permanent permanent : sacCost.getPermanents()) { target.add(permanent.getId(), game); delayedAbility.getTargets().add(target); } @@ -214,20 +217,12 @@ class RescueFromTheUnderworldDelayedTriggeredAbility extends DelayedTriggeredAbi class RescueFromTheUnderworldReturnEffect extends OneShotEffect { - private boolean tapped; - public RescueFromTheUnderworldReturnEffect() { - this(false); - } - - public RescueFromTheUnderworldReturnEffect(boolean tapped) { super(Outcome.PutCreatureInPlay); - this.tapped = tapped; } public RescueFromTheUnderworldReturnEffect(final RescueFromTheUnderworldReturnEffect effect) { super(effect); - this.tapped = effect.tapped; } @Override @@ -237,39 +232,36 @@ class RescueFromTheUnderworldReturnEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - boolean result = false; - // Target card comes only back if in graveyard - for (UUID targetId: getTargetPointer().getTargets(game, source)) { - Card card = game.getCard(targetId); - if (card != null) { - Player player = game.getPlayer(card.getOwnerId()); - if (player != null) { - if(card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId(), tapped)){ - result = true; - } + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + // Target card comes only back if in graveyard + for (UUID targetId : getTargetPointer().getTargets(game, source)) { + Card card = game.getCard(targetId); + if (card != null) { + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } - } - // However, if the sacrificed creature is put into another public zone instead of the graveyard, - // perhaps because it’s your commander or because of another replacement effect, it will return - // to the battlefield from the zone it went to. - if (source.getTargets().get(1) != null) { - for (UUID targetId: ((Target) source.getTargets().get(1)).getTargets()) { - Card card = game.getCard(targetId); - if (card != null && !card.isFaceDown(game)) { - Player player = game.getPlayer(card.getOwnerId()); - if (player != null) { - Zone currentZone = game.getState().getZone(card.getId()); - if (currentZone.equals(Zone.COMMAND) || currentZone.equals(Zone.GRAVEYARD) || currentZone.equals(Zone.EXILED)) { - if(card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId(), false)){ - result = true; + // However, if the sacrificed creature is put into another public zone instead of the graveyard, + // perhaps because it’s your commander or because of another replacement effect, it will return + // to the battlefield from the zone it went to. + if (source.getTargets().get(1) != null) { + for (UUID targetId : ((Target) source.getTargets().get(1)).getTargets()) { + Card card = game.getCard(targetId); + if (card != null && !card.isFaceDown(game)) { + Player player = game.getPlayer(card.getOwnerId()); + if (player != null) { + Zone currentZone = game.getState().getZone(card.getId()); + if (currentZone.equals(Zone.COMMAND) || currentZone.equals(Zone.GRAVEYARD) || currentZone.equals(Zone.EXILED)) { + return player.moveCards(card, Zone.BATTLEFIELD, source, game); } } } } } + return true; } - return result; + return false; + } } diff --git a/Mage.Sets/src/mage/sets/theros/ReturnedPhalanx.java b/Mage.Sets/src/mage/sets/theros/ReturnedPhalanx.java index 8bb0b4f6748..64e218429e7 100644 --- a/Mage.Sets/src/mage/sets/theros/ReturnedPhalanx.java +++ b/Mage.Sets/src/mage/sets/theros/ReturnedPhalanx.java @@ -1,71 +1,71 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.theros; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.combat.CanAttackAsThoughtItDidntHaveDefenderSourceEffect; -import mage.abilities.keyword.DefenderAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; - -/** - * - * @author LevelX2 - */ -public class ReturnedPhalanx extends CardImpl { - - public ReturnedPhalanx(UUID ownerId) { - super(ownerId, 104, "Returned Phalanx", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); - this.expansionSetCode = "THS"; - this.subtype.add("Zombie"); - this.subtype.add("Soldier"); - - this.power = new MageInt(3); - this.toughness = new MageInt(3); - - // Defender - this.addAbility(DefenderAbility.getInstance()); - // {1}{U}: Returned Phalanx can attack this turn as though it didn't have defender. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}{U}"))); - } - - public ReturnedPhalanx(final ReturnedPhalanx card) { - super(card); - } - - @Override - public ReturnedPhalanx copy() { - return new ReturnedPhalanx(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.theros; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class ReturnedPhalanx extends CardImpl { + + public ReturnedPhalanx(UUID ownerId) { + super(ownerId, 104, "Returned Phalanx", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "THS"; + this.subtype.add("Zombie"); + this.subtype.add("Soldier"); + + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // {1}{U}: Returned Phalanx can attack this turn as though it didn't have defender. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}{U}"))); + } + + public ReturnedPhalanx(final ReturnedPhalanx card) { + super(card); + } + + @Override + public ReturnedPhalanx copy() { + return new ReturnedPhalanx(this); + } +} diff --git a/Mage.Sets/src/mage/sets/theros/WhipOfErebos.java b/Mage.Sets/src/mage/sets/theros/WhipOfErebos.java index 6b345fdd021..8d9dd84c469 100644 --- a/Mage.Sets/src/mage/sets/theros/WhipOfErebos.java +++ b/Mage.Sets/src/mage/sets/theros/WhipOfErebos.java @@ -115,19 +115,22 @@ class WhipOfErebosEffect extends OneShotEffect { Card card = game.getCard(this.getTargetPointer().getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); if (controller != null && card != null) { - if (controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) { - // gains haste - ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); - effect.setTargetPointer(new FixedTarget(card.getId())); - game.addEffect(effect, source); - // Exile at begin of next end step - ExileTargetEffect exileEffect = new ExileTargetEffect(null, null, Zone.BATTLEFIELD); - exileEffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { + Permanent creature = game.getPermanent(card.getId()); + if (creature != null) { + // gains haste + ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); + effect.setTargetPointer(new FixedTarget(creature, game)); + game.addEffect(effect, source); + // Exile at begin of next end step + ExileTargetEffect exileEffect = new ExileTargetEffect(null, null, Zone.BATTLEFIELD); + exileEffect.setTargetPointer(new FixedTarget(creature, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } } return true; } diff --git a/Mage.Sets/src/mage/sets/theros/XenagosTheReveler.java b/Mage.Sets/src/mage/sets/theros/XenagosTheReveler.java index 0166753702c..781fe57fdb0 100644 --- a/Mage.Sets/src/mage/sets/theros/XenagosTheReveler.java +++ b/Mage.Sets/src/mage/sets/theros/XenagosTheReveler.java @@ -34,12 +34,10 @@ import mage.MageInt; import mage.Mana; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.HasteAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; @@ -49,7 +47,6 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; @@ -70,20 +67,17 @@ public class XenagosTheReveler extends CardImpl { this.expansionSetCode = "THS"; this.subtype.add("Xenagos"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +1: Add X mana in any combination of {R} and/or {G} to your mana pool, where X is the number of creatures you control. this.addAbility(new LoyaltyAbility(new XenagosManaEffect(), +1)); - + // 0: Put a 2/2 red and green Satyr creature token with haste onto the battlefield. this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new XenagosSatyrToken()), 0)); // -6: Exile the top seven cards of your library. You may put any number of creature and/or land cards from among them onto the battlefield. this.addAbility(new LoyaltyAbility(new XenagosExileEffect(), -6)); - - } public XenagosTheReveler(final XenagosTheReveler card) { @@ -115,7 +109,7 @@ class XenagosManaEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player != null){ + if (player != null) { int x = game.getBattlefield().count(new FilterControlledCreaturePermanent(), source.getSourceId(), source.getControllerId(), game); Choice manaChoice = new ChoiceImpl(); Set choices = new LinkedHashSet<>(); @@ -124,7 +118,7 @@ class XenagosManaEffect extends OneShotEffect { manaChoice.setChoices(choices); manaChoice.setMessage("Select color of mana to add"); - for (int i = 0; i < x; i++){ + for (int i = 0; i < x; i++) { Mana mana = new Mana(); while (!player.choose(Outcome.Benefit, manaChoice, game)) { if (!player.canRespond()) { @@ -136,10 +130,10 @@ class XenagosManaEffect extends OneShotEffect { } switch (manaChoice.getChoice()) { case "Green": - mana.addGreen(); + mana.increaseGreen(); break; case "Red": - mana.addRed(); + mana.increaseRed(); break; } player.getManaPool().addMana(mana, game, source); @@ -150,7 +144,6 @@ class XenagosManaEffect extends OneShotEffect { } } - class XenagosSatyrToken extends Token { public XenagosSatyrToken() { @@ -167,7 +160,6 @@ class XenagosSatyrToken extends Token { } - class XenagosExileEffect extends OneShotEffect { public XenagosExileEffect() { @@ -186,28 +178,19 @@ class XenagosExileEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - Cards cards = new CardsImpl(Zone.EXILED); - int count = Math.min(player.getLibrary().size(), 7); - for (int i = 0; i < count; i++) { - Card card = player.getLibrary().getFromTop(game); - cards.add(card); - card.moveToExile(null, null, source.getSourceId(), game); - } + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Cards exiledCards = new CardsImpl(); + exiledCards.addAll(controller.getLibrary().getTopCards(game, 7)); + controller.moveCards(exiledCards, Zone.EXILED, source, game); FilterCard filter = new FilterCard("creature and/or land cards to put onto the battlefield"); filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), - new CardTypePredicate(CardType.LAND))); + new CardTypePredicate(CardType.LAND))); TargetCard target1 = new TargetCard(0, Integer.MAX_VALUE, Zone.EXILED, filter); - if (cards.size() > 0 + if (exiledCards.size() > 0 && target1.canChoose(source.getSourceId(), source.getControllerId(), game) - && player.choose(Outcome.PutCardInPlay, cards, target1, game)) { - for (UUID targetId: target1.getTargets()) { - Card card = cards.get(targetId, game); - if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); - } - } + && controller.choose(Outcome.PutCardInPlay, exiledCards, target1, game)) { + controller.moveCards(new CardsImpl(target1.getTargets()), Zone.BATTLEFIELD, source, game); } return true; } diff --git a/Mage.Sets/src/mage/sets/timeshifted/AvoidFate.java b/Mage.Sets/src/mage/sets/timeshifted/AvoidFate.java new file mode 100644 index 00000000000..7d4f7d23cfb --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/AvoidFate.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class AvoidFate extends mage.sets.legends.AvoidFate { + + public AvoidFate(UUID ownerId) { + super(ownerId); + this.cardNumber = 73; + this.expansionSetCode = "TSB"; + this.rarity = Rarity.SPECIAL; + } + + public AvoidFate(final AvoidFate card) { + super(card); + } + + @Override + public AvoidFate copy() { + return new AvoidFate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timeshifted/CelestialDawn.java b/Mage.Sets/src/mage/sets/timeshifted/CelestialDawn.java new file mode 100644 index 00000000000..2fd31ec7fe3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/CelestialDawn.java @@ -0,0 +1,284 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timeshifted; + +import java.util.UUID; +import mage.MageObject; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.AsThoughManaEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import static mage.constants.Layer.AbilityAddingRemovingEffects_6; +import static mage.constants.Layer.TypeChangingEffects_4; +import mage.constants.ManaType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.filter.common.FilterNonlandPermanent; +import mage.game.Game; +import mage.game.command.CommandObject; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.ManaPoolItem; +import mage.players.Player; +import mage.sets.Commander; + +/** + * + * @author LevelX2 + */ +public class CelestialDawn extends CardImpl { + + public CelestialDawn(UUID ownerId) { + super(ownerId, 3, "Celestial Dawn", Rarity.SPECIAL, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); + this.expansionSetCode = "TSB"; + + // Lands you control are Plains. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CelestialDawnToPlainsEffect())); + + // Nonland cards you own that aren't on the battlefield, spells you control, and nonland permanents you control are white. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CelestialDawnToWhiteEffect())); + + // You may spend white mana as though it were mana of any color. + // You may spend other mana only as though it were colorless mana. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new CelestialDawnSpendAnyManaEffect()); + ability.addEffect(new CelestialDawnSpendColorlessManaEffect()); + this.addAbility(ability); + + } + + public CelestialDawn(final CelestialDawn card) { + super(card); + } + + @Override + public CelestialDawn copy() { + return new CelestialDawn(this); + } +} + +class CelestialDawnToPlainsEffect extends ContinuousEffectImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + CelestialDawnToPlainsEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + this.staticText = "Lands you control are Plains"; + } + + CelestialDawnToPlainsEffect(final CelestialDawnToPlainsEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public CelestialDawnToPlainsEffect copy() { + return new CelestialDawnToPlainsEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + for (Permanent land : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + land.removeAllAbilities(source.getSourceId(), game); + land.addAbility(new WhiteManaAbility(), source.getSourceId(), game); + break; + case TypeChangingEffects_4: + land.getSubtype().clear(); + land.getSubtype().add("Plains"); + break; + } + } + return true; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; + } + +} + +class CelestialDawnToWhiteEffect extends ContinuousEffectImpl { + + private static final FilterNonlandPermanent filter = new FilterNonlandPermanent(); + + public CelestialDawnToWhiteEffect() { + super(Duration.WhileOnBattlefield, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Benefit); + staticText = "Nonland cards you own that aren't on the battlefield, spells you control, and nonland permanents you control are white"; + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + setColor(perm.getColor(game), game); + } + // Stack + for (MageObject object : game.getStack()) { + if (object instanceof Spell && ((Spell) object).getControllerId().equals(controller.getId())) { + setColor(object.getColor(game), game); + } + } + // Exile + for (Card card : game.getExile().getAllCards(game)) { + if (card.getOwnerId().equals(controller.getId())) { + setColor(card.getColor(game), game); + } + } + // Command + for (CommandObject commandObject : game.getState().getCommand()) { + if (commandObject instanceof Commander) { + if (commandObject.getControllerId().equals(controller.getId())) { + setColor(commandObject.getColor(game), game); + } + } + } + + // Hand + for (Card card : controller.getHand().getCards(game)) { + setColor(card.getColor(game), game); + } + // Library + for (Card card : controller.getLibrary().getCards(game)) { + setColor(card.getColor(game), game); + } + // Graveyard + for (Card card : controller.getGraveyard().getCards(game)) { + setColor(card.getColor(game), game); + } + return true; + } + return false; + } + + protected static void setColor(ObjectColor color, Game game) { + color.setWhite(true); + color.setGreen(false); + color.setBlue(false); + color.setBlack(false); + color.setRed(false); + } + + @Override + public CelestialDawnToWhiteEffect copy() { + return new CelestialDawnToWhiteEffect(this); + } + + private CelestialDawnToWhiteEffect(CelestialDawnToWhiteEffect effect) { + super(effect); + } + +} + +class CelestialDawnSpendAnyManaEffect extends AsThoughEffectImpl implements AsThoughManaEffect { + + public CelestialDawnSpendAnyManaEffect() { + super(AsThoughEffectType.SPEND_OTHER_MANA, Duration.Custom, Outcome.Benefit); + staticText = "You may spend white mana as though it were mana of any color"; + } + + public CelestialDawnSpendAnyManaEffect(final CelestialDawnSpendAnyManaEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public CelestialDawnSpendAnyManaEffect copy() { + return new CelestialDawnSpendAnyManaEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + return affectedControllerId.equals(source.getControllerId()); + } + + @Override + public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) { + if (mana.getWhite() > 0) { + return ManaType.WHITE; + } + return null; + } +} + +class CelestialDawnSpendColorlessManaEffect extends AsThoughEffectImpl implements AsThoughManaEffect { + + public CelestialDawnSpendColorlessManaEffect() { + super(AsThoughEffectType.SPEND_ONLY_MANA, Duration.Custom, Outcome.Detriment); + staticText = "You may spend other mana only as though it were colorless mana"; + } + + public CelestialDawnSpendColorlessManaEffect(final CelestialDawnSpendColorlessManaEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public CelestialDawnSpendColorlessManaEffect copy() { + return new CelestialDawnSpendColorlessManaEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + return affectedControllerId.equals(source.getControllerId()); + } + + @Override + public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) { + if (mana.getWhite() == 0 && !ManaType.COLORLESS.equals(manaType)) { + return null; + } + return manaType; + } +} diff --git a/Mage.Sets/src/mage/sets/timeshifted/CrawGiant.java b/Mage.Sets/src/mage/sets/timeshifted/CrawGiant.java new file mode 100644 index 00000000000..9887bfc3b09 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/CrawGiant.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CrawGiant extends mage.sets.legends.CrawGiant { + + public CrawGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + this.expansionSetCode = "TSB"; + this.rarity = Rarity.SPECIAL; + } + + public CrawGiant(final CrawGiant card) { + super(card); + } + + @Override + public CrawGiant copy() { + return new CrawGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timeshifted/FacelessButcher.java b/Mage.Sets/src/mage/sets/timeshifted/FacelessButcher.java index 3fc17bbe5a5..9ff88812945 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/FacelessButcher.java +++ b/Mage.Sets/src/mage/sets/timeshifted/FacelessButcher.java @@ -32,6 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.ExileTargetForSourceEffect; import mage.abilities.effects.common.ReturnFromExileForSourceEffect; import mage.cards.CardImpl; @@ -56,8 +57,8 @@ public class FacelessButcher extends CardImpl { static { filter.add(new AnotherPredicate()); } - - + + public FacelessButcher(UUID ownerId) { super(ownerId, 43, "Faceless Butcher", Rarity.SPECIAL, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); this.expansionSetCode = "TSB"; @@ -65,10 +66,12 @@ public class FacelessButcher extends CardImpl { this.subtype.add("Horror"); this.power = new MageInt(2); this.toughness = new MageInt(3); - + // When Faceless Butcher enters the battlefield, exile target creature other than Faceless Butcher. - Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect(), false); + Effect effect = new ExileTargetForSourceEffect(); + effect.setText("exile target creature other than {this}"); + Ability ability1 = new EntersBattlefieldTriggeredAbility(effect, false); Target target = new TargetPermanent(filter); ability1.addTarget(target); this.addAbility(ability1); @@ -76,7 +79,7 @@ public class FacelessButcher extends CardImpl { // When Faceless Butcher leaves the battlefield, return the exiled card to the battlefield under its owner's control. Ability ability2 = new LeavesBattlefieldTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD), false); this.addAbility(ability2); - + } public FacelessButcher(final FacelessButcher card) { diff --git a/Mage.Sets/src/mage/sets/timeshifted/GemstoneMine.java b/Mage.Sets/src/mage/sets/timeshifted/GemstoneMine.java index ab0701cce46..60298b92a7e 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/GemstoneMine.java +++ b/Mage.Sets/src/mage/sets/timeshifted/GemstoneMine.java @@ -40,9 +40,6 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.counters.CounterType; -import mage.filter.FilterPermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.permanent.AnotherPredicate; /** * @@ -50,12 +47,6 @@ import mage.filter.predicate.permanent.AnotherPredicate; */ public class GemstoneMine extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent(); - - static { - filter.add(Predicates.not(new AnotherPredicate())); - } - public GemstoneMine(UUID ownerId) { super(ownerId, 119, "Gemstone Mine", Rarity.RARE, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "TSB"; diff --git a/Mage.Sets/src/mage/sets/timeshifted/GoblinSnowman.java b/Mage.Sets/src/mage/sets/timeshifted/GoblinSnowman.java new file mode 100644 index 00000000000..bb2b7516b7e --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/GoblinSnowman.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timeshifted; + +import java.util.UUID; + +/** + * + * @author BursegSardaukar + */ +public class GoblinSnowman extends mage.sets.iceage.GoblinSnowman { + + public GoblinSnowman(UUID ownerId) { + super(ownerId); + this.cardNumber = 64; + this.expansionSetCode = "TSB"; + } + + public GoblinSnowman(final GoblinSnowman card) { + super(card); + } + + @Override + public GoblinSnowman copy() { + return new GoblinSnowman(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java b/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java index 5ae1263948b..cd144347d15 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java +++ b/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java @@ -32,14 +32,12 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.condition.Condition; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.AsThoughEffectType; @@ -71,13 +69,11 @@ public class GrinningTotem extends CardImpl { // {2}, {tap}, Sacrifice Grinning Totem: Search target opponent's library for a card and exile it. Then that player shuffles his or her library. // Until the beginning of your next upkeep, you may play that card. + // At the beginning of your next upkeep, if you haven't played it, put it into its owner's graveyard. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GrinningTotemSearchAndExileEffect(), new ManaCostsImpl("{2}")); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetOpponent()); - // At the beginning of your next upkeep, if you haven't played it, put it into its owner's graveyard. - ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new GrinningTotemDelayedTriggeredAbility())); - this.addAbility(ability); } @@ -95,7 +91,9 @@ class GrinningTotemSearchAndExileEffect extends OneShotEffect { public GrinningTotemSearchAndExileEffect() { super(Outcome.Benefit); - this.staticText = "Search target opponent's library for a card and exile it. Then that player shuffles his or her library. Until the beginning of your next upkeep, you may play that card"; + this.staticText = "Search target opponent's library for a card and exile it. Then that player shuffles his or her library. " + + "Until the beginning of your next upkeep, you may play that card. " + + "At the beginning of your next upkeep, if you haven't played it, put it into its owner's graveyard"; } public GrinningTotemSearchAndExileEffect(final GrinningTotemSearchAndExileEffect effect) { @@ -111,18 +109,21 @@ class GrinningTotemSearchAndExileEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player you = game.getPlayer(source.getControllerId()); Player targetOpponent = game.getPlayer(source.getFirstTarget()); - MageObject sourcObject = game.getObject(source.getSourceId()); + MageObject sourceObject = game.getObject(source.getSourceId()); if (you != null && targetOpponent != null) { if (targetOpponent.getLibrary().size() > 0) { TargetCardInLibrary targetCard = new TargetCardInLibrary(); if (you.searchLibrary(targetCard, game, targetOpponent.getId())) { Card card = targetOpponent.getLibrary().remove(targetCard.getFirstTarget(), game); if (card != null) { - you.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourcObject != null ? sourcObject.getIdName() : "", source.getSourceId(), game, Zone.LIBRARY, true); + UUID exileZoneId = CardUtil.getCardExileZoneId(game, source); + you.moveCardToExileWithInfo(card, exileZoneId, sourceObject != null ? sourceObject.getIdName() : "", source.getSourceId(), game, Zone.LIBRARY, true); ContinuousEffect effect = new GrinningTotemMayPlayEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); - } + + game.addDelayedTriggeredAbility(new GrinningTotemDelayedTriggeredAbility(exileZoneId), source); + } } } targetOpponent.shuffleLibrary(game); @@ -166,27 +167,29 @@ class GrinningTotemMayPlayEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (targetPointer.getTargets(game, source).contains(sourceId)) { - return game.getState().getZone(sourceId).equals(Zone.EXILED); - } - return false; + return source.getControllerId().equals(affectedControllerId) + && sourceId.equals(getTargetPointer().getFirst(game, source)); } } class GrinningTotemDelayedTriggeredAbility extends DelayedTriggeredAbility { - public GrinningTotemDelayedTriggeredAbility() { - super(new GrinningTotemPutIntoGraveyardEffect()); + private final UUID exileZoneId; + + public GrinningTotemDelayedTriggeredAbility(UUID exileZoneId) { + super(new GrinningTotemPutIntoGraveyardEffect(exileZoneId)); + this.exileZoneId = exileZoneId; } public GrinningTotemDelayedTriggeredAbility(final GrinningTotemDelayedTriggeredAbility ability) { super(ability); + this.exileZoneId = ability.exileZoneId; } @Override public boolean checkInterveningIfClause(Game game) { - ExileZone exileZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, this.getSourceId())); + ExileZone exileZone = game.getExile().getExileZone(exileZoneId); return exileZone != null && exileZone.getCards(game).size() > 0; } @@ -211,26 +214,19 @@ class GrinningTotemDelayedTriggeredAbility extends DelayedTriggeredAbility { } } - -class GrinningTotemYouHaveNotPlayedCondition implements Condition { - - @Override - public boolean apply(Game game, Ability source) { - ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)); - return zone.getCards(game).size() > 0; - } - -} - class GrinningTotemPutIntoGraveyardEffect extends OneShotEffect { - public GrinningTotemPutIntoGraveyardEffect() { + private final UUID exileZoneId; + + public GrinningTotemPutIntoGraveyardEffect(UUID exileZoneId) { super(Outcome.Detriment); + this.exileZoneId = exileZoneId; this.staticText = "put it into its owner's graveyard"; } public GrinningTotemPutIntoGraveyardEffect(final GrinningTotemPutIntoGraveyardEffect effect) { super(effect); + this.exileZoneId = effect.exileZoneId; } @Override @@ -241,7 +237,7 @@ class GrinningTotemPutIntoGraveyardEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)); + ExileZone zone = game.getExile().getExileZone(exileZoneId); if (controller != null && zone != null) { return controller.moveCards(zone, Zone.EXILED, Zone.GRAVEYARD, source, game); } diff --git a/Mage.Sets/src/mage/sets/timeshifted/MerfolkAssassin.java b/Mage.Sets/src/mage/sets/timeshifted/MerfolkAssassin.java new file mode 100644 index 00000000000..c0f621caf55 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/MerfolkAssassin.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class MerfolkAssassin extends mage.sets.thedark.MerfolkAssassin { + + public MerfolkAssassin(UUID ownerId) { + super(ownerId); + this.cardNumber = 25; + this.expansionSetCode = "TSB"; + this.rarity = Rarity.SPECIAL; + } + + public MerfolkAssassin(final MerfolkAssassin card) { + super(card); + } + + @Override + public MerfolkAssassin copy() { + return new MerfolkAssassin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timeshifted/MeriekeRiBerit.java b/Mage.Sets/src/mage/sets/timeshifted/MeriekeRiBerit.java new file mode 100644 index 00000000000..a97d6ac8e5c --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/MeriekeRiBerit.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author jeffwadsworth + */ +public class MeriekeRiBerit extends mage.sets.iceage.MeriekeRiBerit { + + public MeriekeRiBerit(UUID ownerId) { + super(ownerId); + this.cardNumber = 95; + this.expansionSetCode = "TSB"; + this.rarity = Rarity.SPECIAL; + } + + public MeriekeRiBerit(final MeriekeRiBerit card) { + super(card); + } + + @Override + public MeriekeRiBerit copy() { + return new MeriekeRiBerit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timeshifted/MysticEnforcer.java b/Mage.Sets/src/mage/sets/timeshifted/MysticEnforcer.java index ed25bec6c7b..2c9a23cb576 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/MysticEnforcer.java +++ b/Mage.Sets/src/mage/sets/timeshifted/MysticEnforcer.java @@ -34,7 +34,10 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.CardsInControllerGraveCondition; import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -72,10 +75,13 @@ public class MysticEnforcer extends CardImpl { Ability thresholdAbility = new SimpleStaticAbility( Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield), - new CardsInControllerGraveCondition(7), - "Threshold - {this} gets +3/+3 as long as seven or more cards are in your graveyard" + new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield), + new CardsInControllerGraveCondition(7), + "Threshold - {this} gets +3/+3 as long as seven or more cards are in your graveyard" )); + Effect effect = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield); + effect.setText("and has flying"); + thresholdAbility.addEffect(effect); this.addAbility(thresholdAbility); } diff --git a/Mage.Sets/src/mage/sets/timeshifted/Pandemonium.java b/Mage.Sets/src/mage/sets/timeshifted/Pandemonium.java index 588ee3e077f..b7e23c7c344 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/Pandemonium.java +++ b/Mage.Sets/src/mage/sets/timeshifted/Pandemonium.java @@ -49,6 +49,8 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class Pandemonium extends CardImpl { + private final UUID originalId; + public Pandemonium(UUID ownerId) { super(ownerId, 68, "Pandemonium", Rarity.SPECIAL, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); this.expansionSetCode = "TSB"; @@ -56,22 +58,24 @@ public class Pandemonium extends CardImpl { // Whenever a creature enters the battlefield, that creature's controller may have it deal damage equal to its power to target creature or player of his or her choice. Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new PandemoniumEffect(), new FilterCreaturePermanent(), false, SetTargetPointer.PERMANENT, ""); ability.addTarget(new TargetCreatureOrPlayer()); + originalId = ability.getOriginalId(); this.addAbility(ability); } public Pandemonium(final Pandemonium card) { super(card); + this.originalId = card.originalId; } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof EntersBattlefieldAllTriggeredAbility) { + if (ability.getOriginalId().equals(originalId)) { UUID creatureId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability); Permanent creature = game.getPermanent(creatureId); if (creature != null) { ability.getTargets().get(0).setTargetController(creature.getControllerId()); } - } + } } @Override @@ -81,21 +85,21 @@ public class Pandemonium extends CardImpl { } class PandemoniumEffect extends OneShotEffect { - + public PandemoniumEffect() { super(Outcome.Benefit); this.staticText = "that creature's controller may have it deal damage equal to its power to target creature or player of his or her choice"; } - + public PandemoniumEffect(final PandemoniumEffect effect) { super(effect); } - + @Override public PandemoniumEffect copy() { return new PandemoniumEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); @@ -106,7 +110,7 @@ class PandemoniumEffect extends OneShotEffect { if (targetPermanent != null) { targetPermanent.damage(enteringCreature.getPower().getValue(), source.getSourceId(), game, false, true); } else { - Player targetPlayer = game.getPlayer(source.getTargets().getFirstTarget()); + Player targetPlayer = game.getPlayer(source.getTargets().getFirstTarget()); if (targetPlayer != null) { targetPlayer.damage(enteringCreature.getPower().getValue(), source.getSourceId(), game, false, true); } diff --git a/Mage.Sets/src/mage/sets/timeshifted/SafeHaven.java b/Mage.Sets/src/mage/sets/timeshifted/SafeHaven.java new file mode 100644 index 00000000000..30cbfa71d1b --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/SafeHaven.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SafeHaven extends mage.sets.thedark.SafeHaven { + + public SafeHaven(UUID ownerId) { + super(ownerId); + this.cardNumber = 121; + this.expansionSetCode = "TSB"; + this.rarity = Rarity.SPECIAL; + } + + public SafeHaven(final SafeHaven card) { + super(card); + } + + @Override + public SafeHaven copy() { + return new SafeHaven(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timeshifted/SwampMosquito.java b/Mage.Sets/src/mage/sets/timeshifted/SwampMosquito.java new file mode 100644 index 00000000000..93773da7604 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/SwampMosquito.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SwampMosquito extends mage.sets.alliances.SwampMosquito1 { + + public SwampMosquito(UUID ownerId) { + super(ownerId); + this.cardNumber = 49; + this.expansionSetCode = "TSB"; + this.rarity = Rarity.SPECIAL; + } + + public SwampMosquito(final SwampMosquito card) { + super(card); + } + + @Override + public SwampMosquito copy() { + return new SwampMosquito(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timeshifted/WhispersOfTheMuse.java b/Mage.Sets/src/mage/sets/timeshifted/WhispersOfTheMuse.java new file mode 100644 index 00000000000..f5b7912261e --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/WhispersOfTheMuse.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class WhispersOfTheMuse extends mage.sets.tempest.WhispersOfTheMuse { + + public WhispersOfTheMuse(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "TSB"; + this.rarity = Rarity.SPECIAL; + } + + public WhispersOfTheMuse(final WhispersOfTheMuse card) { + super(card); + } + + @Override + public WhispersOfTheMuse copy() { + return new WhispersOfTheMuse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/AssemblyWorker.java b/Mage.Sets/src/mage/sets/timespiral/AssemblyWorker.java index 221de05930a..95ad4df2897 100644 --- a/Mage.Sets/src/mage/sets/timespiral/AssemblyWorker.java +++ b/Mage.Sets/src/mage/sets/timespiral/AssemblyWorker.java @@ -32,12 +32,12 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; @@ -63,7 +63,7 @@ public class AssemblyWorker extends CardImpl { this.toughness = new MageInt(2); // {tap}: Target Assembly-Worker creature gets +1/+1 until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, 1, Duration.EndOfTurn), new TapSourceCost()); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/timespiral/BasaltGargoyle.java b/Mage.Sets/src/mage/sets/timespiral/BasaltGargoyle.java new file mode 100644 index 00000000000..b1499a154bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/BasaltGargoyle.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.EchoAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class BasaltGargoyle extends CardImpl { + + public BasaltGargoyle(UUID ownerId) { + super(ownerId, 145, "Basalt Gargoyle", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Gargoyle"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Echo {2}{R} + this.addAbility(new EchoAbility("{2}{R}")); + // {R}: Basalt Gargoyle gets +0/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public BasaltGargoyle(final BasaltGargoyle card) { + super(card); + } + + @Override + public BasaltGargoyle copy() { + return new BasaltGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/BrassGnat.java b/Mage.Sets/src/mage/sets/timespiral/BrassGnat.java new file mode 100644 index 00000000000..ffc42c4e19c --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/BrassGnat.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author nigelzor + */ +public class BrassGnat extends CardImpl { + + public BrassGnat(UUID ownerId) { + super(ownerId, 249, "Brass Gnat", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Insect"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Brass Gnat doesn't untap during your untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepSourceEffect())); + // At the beginning of your upkeep, you may pay {1}. If you do, untap Brass Gnat. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + Zone.BATTLEFIELD, + new DoIfCostPaid(new UntapSourceEffect(), new GenericManaCost(1)), + TargetController.YOU, + false)); + } + + public BrassGnat(final BrassGnat card) { + super(card); + } + + @Override + public BrassGnat copy() { + return new BrassGnat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/CallToTheNetherworld.java b/Mage.Sets/src/mage/sets/timespiral/CallToTheNetherworld.java new file mode 100644 index 00000000000..9c17bb589af --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/CallToTheNetherworld.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; + +import mage.ObjectColor; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.MadnessAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author nigelzor + */ +public class CallToTheNetherworld extends CardImpl { + + private static FilterCreatureCard filter = new FilterCreatureCard("black creature card from your graveyard"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public CallToTheNetherworld(UUID ownerId) { + super(ownerId, 97, "Call to the Netherworld", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}"); + this.expansionSetCode = "TSP"; + + // Return target black creature card from your graveyard to your hand. + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + // Madness {0} + this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{0}"))); + } + + public CallToTheNetherworld(final CallToTheNetherworld card) { + super(card); + } + + @Override + public CallToTheNetherworld copy() { + return new CallToTheNetherworld(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/CastleRaptors.java b/Mage.Sets/src/mage/sets/timespiral/CastleRaptors.java new file mode 100644 index 00000000000..08b2bb0502b --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/CastleRaptors.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class CastleRaptors extends CardImpl { + + public CastleRaptors(UUID ownerId) { + super(ownerId, 5, "Castle Raptors", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // As long as Castle Raptors is untapped, it gets +0/+2. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(0, 2, Duration.WhileOnBattlefield), new InvertCondition(new SourceTappedCondition()), + "As long as {this} is untapped, it gets +0/+2."))); + } + + public CastleRaptors(final CastleRaptors card) { + super(card); + } + + @Override + public CastleRaptors copy() { + return new CastleRaptors(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ChronatogTotem.java b/Mage.Sets/src/mage/sets/timespiral/ChronatogTotem.java index 35c67c7ff64..492a19ee6c9 100644 --- a/Mage.Sets/src/mage/sets/timespiral/ChronatogTotem.java +++ b/Mage.Sets/src/mage/sets/timespiral/ChronatogTotem.java @@ -27,35 +27,29 @@ */ package mage.sets.timespiral; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.condition.Condition; +import mage.abilities.costs.Cost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.Effects; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.turn.SkipNextTurnSourceEffect; import mage.abilities.mana.BlueManaAbility; import mage.cards.CardImpl; -import mage.constants.AbilityType; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.EffectType; import mage.constants.Rarity; -import mage.constants.WatcherScope; import mage.constants.Zone; import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; -import mage.game.stack.StackAbility; -import mage.game.stack.StackObject; -import mage.watchers.Watcher; /** * @@ -74,14 +68,13 @@ public class ChronatogTotem extends CardImpl { this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new ChronatogTotemToken(), "", Duration.EndOfTurn), new ManaCostsImpl<>("{1}{U}"))); // {0}: Chronatog Totem gets +3/+3 until end of turn. You skip your next turn. Activate this ability only once each turn and only if Chronatog Totem is a creature. - Ability ability = new ConditionalActivatedAbility( + Ability ability = new ChronatogTotemAbility( Zone.BATTLEFIELD, new BoostSourceEffect(3, 3, Duration.EndOfTurn), new ManaCostsImpl<>("{0}"), - new ChronatogTotemCondition(), - "{0}: {this} gets +3/+3 until end of turn. You skip your next turn. Activate this ability only once each turn and only if {this} is a creature"); + new ChronatogTotemCondition()); ability.addEffect(new SkipNextTurnSourceEffect()); - this.addAbility(ability, new ActivatedAbilityUsedThisTurnWatcher()); + this.addAbility(ability); } public ChronatogTotem(final ChronatogTotem card) { @@ -94,6 +87,52 @@ public class ChronatogTotem extends CardImpl { } } +class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility { + + private static final Effects emptyEffects = new Effects(); + + private final Condition condition; + + public ChronatogTotemAbility(Zone zone, Effect effect, Cost cost, Condition condition) { + super(zone, effect, cost); + this.condition = condition; + } + + public ChronatogTotemAbility(ChronatogTotemAbility ability) { + super(ability); + this.condition = ability.condition; + } + + @Override + public Effects getEffects(Game game, EffectType effectType) { + if (!condition.apply(game, this)) { + return emptyEffects; + } + return super.getEffects(game, effectType); + } + + @Override + public boolean canActivate(UUID playerId, Game game) { + if (!condition.apply(game, this)) { + return false; + } + return super.canActivate(playerId, game); + } + + @Override + public ChronatogTotemAbility copy() { + return new ChronatogTotemAbility(this); + } + + @Override + public String getRule() { + StringBuilder sb = new StringBuilder(super.getRule()); + sb.deleteCharAt(sb.length() - 1); // remove last '.' + sb.append(" and only if ").append(condition.toString()).append("."); + return sb.toString(); + } +} + class ChronatogTotemToken extends Token { ChronatogTotemToken() { @@ -111,60 +150,15 @@ class ChronatogTotemCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - ActivatedAbilityUsedThisTurnWatcher watcher = (ActivatedAbilityUsedThisTurnWatcher) game.getState().getWatchers().get("ActivatedAbilityUsedThisTurn"); - if (!watcher.getActivatedThisTurn().contains(source.getOriginalId())) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - return permanent.getCardType().contains(CardType.CREATURE); - } + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + return permanent.getCardType().contains(CardType.CREATURE); } return false; } @Override public String toString() { - return "once each turn and only if an opponent controls a flying creature"; + return "{this} is a creature"; } } - -class ActivatedAbilityUsedThisTurnWatcher extends Watcher { - - public Set activatedThisTurn = new HashSet<>(0); - - ActivatedAbilityUsedThisTurnWatcher() { - super("ActivatedAbilityUsedThisTurn", WatcherScope.GAME); - } - - ActivatedAbilityUsedThisTurnWatcher(final ActivatedAbilityUsedThisTurnWatcher watcher) { - super(watcher); - this.activatedThisTurn.addAll(watcher.activatedThisTurn); - } - - @Override - public void watch(GameEvent event, Game game) { - if (event.getType() == EventType.ACTIVATED_ABILITY) { - StackObject stackObject = game.getStack().getStackObject(event.getTargetId()); - if (stackObject != null) { - StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getTargetId()); - if (stackAbility != null && stackAbility.getAbilityType() == AbilityType.ACTIVATED) { - this.activatedThisTurn.add(stackAbility.getOriginalId()); - } - } - } - } - - public Set getActivatedThisTurn() { - return Collections.unmodifiableSet(this.activatedThisTurn); - } - - @Override - public ActivatedAbilityUsedThisTurnWatcher copy() { - return new ActivatedAbilityUsedThisTurnWatcher(this); - } - - @Override - public void reset() { - super.reset(); - this.activatedThisTurn.clear(); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/timespiral/Chronosavant.java b/Mage.Sets/src/mage/sets/timespiral/Chronosavant.java new file mode 100644 index 00000000000..9b503cc133d --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Chronosavant.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; +import mage.abilities.effects.common.turn.SkipNextTurnSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class Chronosavant extends CardImpl { + + public Chronosavant(UUID ownerId) { + super(ownerId, 9, "Chronosavant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{W}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Giant"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // {1}{W}: Return Chronosavant from your graveyard to the battlefield tapped. You skip your next turn. + Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(true), new ManaCostsImpl("{1}{W}")); + ability.addEffect(new SkipNextTurnSourceEffect()); + this.addAbility(ability); + } + + public Chronosavant(final Chronosavant card) { + super(card); + } + + @Override + public Chronosavant copy() { + return new Chronosavant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/CloudchaserKestrel.java b/Mage.Sets/src/mage/sets/timespiral/CloudchaserKestrel.java new file mode 100644 index 00000000000..a7762404cd7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/CloudchaserKestrel.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author LoneFox + */ +public class CloudchaserKestrel extends CardImpl { + + public CloudchaserKestrel(UUID ownerId) { + super(ownerId, 10, "Cloudchaser Kestrel", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Cloudchaser Kestrel enters the battlefield, destroy target enchantment. + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); + ability.addTarget(new TargetEnchantmentPermanent()); + this.addAbility(ability); + // {W}: Target permanent becomes white until end of turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorTargetEffect(ObjectColor.WHITE, Duration.EndOfTurn), new ManaCostsImpl("{W}")); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public CloudchaserKestrel(final CloudchaserKestrel card) { + super(card); + } + + @Override + public CloudchaserKestrel copy() { + return new CloudchaserKestrel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Conflagrate.java b/Mage.Sets/src/mage/sets/timespiral/Conflagrate.java index 1294976b01c..e31f05b7610 100644 --- a/Mage.Sets/src/mage/sets/timespiral/Conflagrate.java +++ b/Mage.Sets/src/mage/sets/timespiral/Conflagrate.java @@ -29,10 +29,12 @@ package mage.sets.timespiral; import java.util.UUID; import mage.abilities.Ability; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.DiscardTargetCost; import mage.abilities.costs.common.DiscardXTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageMultiEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; @@ -40,6 +42,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.TimingRule; import mage.filter.FilterCard; +import mage.game.Game; import mage.target.common.TargetCreatureOrPlayerAmount; /** @@ -52,17 +55,16 @@ public class Conflagrate extends CardImpl { super(ownerId, 151, "Conflagrate", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{X}{R}"); this.expansionSetCode = "TSP"; - // Conflagrate deals X damage divided as you choose among any number of target creatures and/or players. - DynamicValue xValue = new ManacostVariableValue(); + DynamicValue xValue = new ConflagrateVariableValue(); this.getSpellAbility().addEffect(new DamageMultiEffect(xValue)); - this.getSpellAbility().addTarget(new TargetCreatureOrPlayerAmount(xValue)); - + this.getSpellAbility().addTarget(new TargetCreatureOrPlayerAmount(xValue)); + // Flashback-{R}{R}, Discard X cards. Ability ability = new FlashbackAbility(new ManaCostsImpl("{R}{R}"), TimingRule.SORCERY); ability.addCost(new DiscardXTargetCost(new FilterCard("cards"))); this.addAbility(ability); - + } public Conflagrate(final Conflagrate card) { @@ -74,3 +76,31 @@ public class Conflagrate extends CardImpl { return new Conflagrate(this); } } + +class ConflagrateVariableValue implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + for (Cost cost : sourceAbility.getCosts()) { + if (cost instanceof DiscardTargetCost) { + return ((DiscardTargetCost) cost).getCards().size(); + } + } + return sourceAbility.getManaCostsToPay().getX(); + } + + @Override + public ConflagrateVariableValue copy() { + return new ConflagrateVariableValue(); + } + + @Override + public String toString() { + return "X"; + } + + @Override + public String getMessage() { + return ""; + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/CorpulentCorpse.java b/Mage.Sets/src/mage/sets/timespiral/CorpulentCorpse.java new file mode 100644 index 00000000000..52190d73722 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/CorpulentCorpse.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.FearAbility; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CorpulentCorpse extends CardImpl { + + public CorpulentCorpse(UUID ownerId) { + super(ownerId, 98, "Corpulent Corpse", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Zombie"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Fear + this.addAbility(FearAbility.getInstance()); + // Suspend 5-{B} + this.addAbility(new SuspendAbility(5, new ManaCostsImpl("{B}"), this)); + } + + public CorpulentCorpse(final CorpulentCorpse card) { + super(card); + } + + @Override + public CorpulentCorpse copy() { + return new CorpulentCorpse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/DAvenantHealer.java b/Mage.Sets/src/mage/sets/timespiral/DAvenantHealer.java new file mode 100644 index 00000000000..8f1a6ca0e00 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/DAvenantHealer.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetAttackingOrBlockingCreature; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class DAvenantHealer extends CardImpl { + + public DAvenantHealer(UUID ownerId) { + super(ownerId, 11, "D'Avenant Healer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.subtype.add("Archer"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {T}: D'Avenant Healer deals 1 damage to target attacking or blocking creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + ability.addTarget(new TargetAttackingOrBlockingCreature()); + this.addAbility(ability); + // {T}: Prevent the next 1 damage that would be dealt to target creature or player this turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public DAvenantHealer(final DAvenantHealer card) { + super(card); + } + + @Override + public DAvenantHealer copy() { + return new DAvenantHealer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/DementiaSliver.java b/Mage.Sets/src/mage/sets/timespiral/DementiaSliver.java new file mode 100644 index 00000000000..444e703bb59 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/DementiaSliver.java @@ -0,0 +1,132 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.MyTurnCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class DementiaSliver extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("All Slivers"); + + static { + filter.add(new SubtypePredicate("Sliver")); + } + + public DementiaSliver(UUID ownerId) { + super(ownerId, 236, "Dementia Sliver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Sliver"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // All Slivers have "{T}: Name a card. Target opponent reveals a card at random from his or her hand. If it's the named card, that player discards it. Activate this ability only during your turn." + Ability gainedAbility = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new NameACardEffect(NameACardEffect.TypeOfName.ALL), new TapSourceCost(), MyTurnCondition.getInstance()); + gainedAbility.addEffect(new DementiaSliverEffect()); + gainedAbility.addTarget(new TargetOpponent()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new GainAbilityAllEffect(gainedAbility, Duration.WhileOnBattlefield, filter, + "All Slivers have \"{T}: Name a card. Target opponent reveals a card at random from his or her hand. If it's the named card, that player discards it\""))); + } + + public DementiaSliver(final DementiaSliver card) { + super(card); + } + + @Override + public DementiaSliver copy() { + return new DementiaSliver(this); + } +} + +class DementiaSliverEffect extends OneShotEffect { + + public DementiaSliverEffect() { + super(Outcome.Damage); + staticText = "Target opponent reveals a card at random from his or her hand. If it's the named card, that player discards it"; + } + + public DementiaSliverEffect(final DementiaSliverEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); + MageObject sourceObject = game.getObject(source.getSourceId()); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + if (opponent != null && sourceObject != null && !cardName.isEmpty()) { + if (opponent.getHand().size() > 0) { + Cards revealed = new CardsImpl(); + Card card = opponent.getHand().getRandom(game); + if (card != null) { + revealed.add(card); + opponent.revealCards(sourceObject.getName(), revealed, game); + if (card.getName().equals(cardName)) { + opponent.discard(card, source, game); + } + } + } + return true; + } + return false; + } + + @Override + public DementiaSliverEffect copy() { + return new DementiaSliverEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/timespiral/DrifterIlDal.java b/Mage.Sets/src/mage/sets/timespiral/DrifterIlDal.java new file mode 100644 index 00000000000..464fbe54ccb --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/DrifterIlDal.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class DrifterIlDal extends CardImpl { + + public DrifterIlDal(UUID ownerId) { + super(ownerId, 59, "Drifter il-Dal", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // At the beginning of your upkeep, sacrifice Drifter il-Dal unless you pay {U}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{U}")), TargetController.YOU, false)); + } + + public DrifterIlDal(final DrifterIlDal card) { + super(card); + } + + @Override + public DrifterIlDal copy() { + return new DrifterIlDal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/DrudgeReavers.java b/Mage.Sets/src/mage/sets/timespiral/DrudgeReavers.java new file mode 100644 index 00000000000..a46a1d52fcb --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/DrudgeReavers.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class DrudgeReavers extends CardImpl { + + public DrudgeReavers(UUID ownerId) { + super(ownerId, 105, "Drudge Reavers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Skeleton"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // {B}: Regenerate Drudge Reavers. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); + } + + public DrudgeReavers(final DrudgeReavers card) { + super(card); + } + + @Override + public DrudgeReavers copy() { + return new DrudgeReavers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ErrantDoomsayers.java b/Mage.Sets/src/mage/sets/timespiral/ErrantDoomsayers.java new file mode 100644 index 00000000000..9167c2d475d --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ErrantDoomsayers.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ToughnessPredicate; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class ErrantDoomsayers extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with toughness 2 or less"); + static { + filter.add(new ToughnessPredicate(Filter.ComparisonType.LessThan, 3)); + } + + public ErrantDoomsayers(UUID ownerId) { + super(ownerId, 15, "Errant Doomsayers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Human"); + this.subtype.add("Rebel"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Tap target creature with toughness 2 or less. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); + Target target = new TargetCreaturePermanent(filter); + ability.addTarget(target); + this.addAbility(ability); + } + + public ErrantDoomsayers(final ErrantDoomsayers card) { + super(card); + } + + @Override + public ErrantDoomsayers copy() { + return new ErrantDoomsayers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/FacelessDevourer.java b/Mage.Sets/src/mage/sets/timespiral/FacelessDevourer.java new file mode 100644 index 00000000000..10a7130adcd --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/FacelessDevourer.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ExileTargetForSourceEffect; +import mage.abilities.effects.common.ReturnFromExileForSourceEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.Target; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class FacelessDevourer extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.add(new AnotherPredicate()); + filter.add(new AbilityPredicate(ShadowAbility.class)); + } + + public FacelessDevourer(UUID ownerId) { + super(ownerId, 108, "Faceless Devourer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Nightmare"); + this.subtype.add("Horror"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // When Faceless Devourer enters the battlefield, exile another target creature with shadow. + Effect effect = new ExileTargetForSourceEffect(); + effect.setText("exile another target creature with shadow"); + Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); + Target target = new TargetPermanent(filter); + ability.addTarget(target); + this.addAbility(ability); + // When Faceless Devourer leaves the battlefield, return the exiled card to the battlefield under its owner's control. + ability = new LeavesBattlefieldTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD), false); + this.addAbility(ability); + } + + public FacelessDevourer(final FacelessDevourer card) { + super(card); + } + + @Override + public FacelessDevourer copy() { + return new FacelessDevourer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Feebleness.java b/Mage.Sets/src/mage/sets/timespiral/Feebleness.java new file mode 100644 index 00000000000..3f02843db9f --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Feebleness.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author nigelzor + */ +public class Feebleness extends CardImpl { + + public Feebleness(UUID ownerId) { + super(ownerId, 110, "Feebleness", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Aura"); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets -2/-1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(-2, -1, Duration.WhileOnBattlefield))); + } + + public Feebleness(final Feebleness card) { + super(card); + } + + @Override + public Feebleness copy() { + return new Feebleness(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/FlamecoreElemental.java b/Mage.Sets/src/mage/sets/timespiral/FlamecoreElemental.java new file mode 100644 index 00000000000..1b2e8615ab3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/FlamecoreElemental.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.EchoAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FlamecoreElemental extends CardImpl { + + public FlamecoreElemental(UUID ownerId) { + super(ownerId, 154, "Flamecore Elemental", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Elemental"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Echo {2}{R}{R} + this.addAbility(new EchoAbility("{2}{R}{R}")); + } + + public FlamecoreElemental(final FlamecoreElemental card) { + super(card); + } + + @Override + public FlamecoreElemental copy() { + return new FlamecoreElemental(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ForiysianInterceptor.java b/Mage.Sets/src/mage/sets/timespiral/ForiysianInterceptor.java new file mode 100644 index 00000000000..ec3759abe24 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ForiysianInterceptor.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class ForiysianInterceptor extends CardImpl { + + public ForiysianInterceptor(UUID ownerId) { + super(ownerId, 18, "Foriysian Interceptor", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(0); + this.toughness = new MageInt(5); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Foriysian Interceptor can block an additional creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAdditionalCreatureEffect())); + } + + public ForiysianInterceptor(final ForiysianInterceptor card) { + super(card); + } + + @Override + public ForiysianInterceptor copy() { + return new ForiysianInterceptor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/GhituFirebreathing.java b/Mage.Sets/src/mage/sets/timespiral/GhituFirebreathing.java new file mode 100644 index 00000000000..e8203ac9728 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/GhituFirebreathing.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class GhituFirebreathing extends CardImpl { + + public GhituFirebreathing(UUID ownerId) { + super(ownerId, 158, "Ghitu Firebreathing", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Aura"); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // {R}: Enchanted creature gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.R))); + + // {R}: Return Ghitu Firebreathing to its owner's hand. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(), new ManaCostsImpl("{R}"))); + } + + public GhituFirebreathing(final GhituFirebreathing card) { + super(card); + } + + @Override + public GhituFirebreathing copy() { + return new GhituFirebreathing(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/GorgonRecluse.java b/Mage.Sets/src/mage/sets/timespiral/GorgonRecluse.java new file mode 100644 index 00000000000..fec34f76e4a --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/GorgonRecluse.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility; +import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.MadnessAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author nigelzor + */ +public class GorgonRecluse extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public GorgonRecluse(UUID ownerId) { + super(ownerId, 111, "Gorgon Recluse", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Gorgon"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Whenever Gorgon Recluse blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat. + Effect effect = new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true); + effect.setText("destroy that creature at end of combat"); + this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false)); + // Madness {B}{B} + this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{B}{B}"))); + } + + public GorgonRecluse(final GorgonRecluse card) { + super(card); + } + + @Override + public GorgonRecluse copy() { + return new GorgonRecluse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/GriffinGuide.java b/Mage.Sets/src/mage/sets/timespiral/GriffinGuide.java index c086c8bf41e..b94762aca65 100644 --- a/Mage.Sets/src/mage/sets/timespiral/GriffinGuide.java +++ b/Mage.Sets/src/mage/sets/timespiral/GriffinGuide.java @@ -93,7 +93,7 @@ class GriffinToken extends Token { cardType.add(CardType.CREATURE); color.setWhite(true); - subtype.add("Soldier"); + subtype.add("Griffin"); power = new MageInt(2); toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/timespiral/HauntingHymn.java b/Mage.Sets/src/mage/sets/timespiral/HauntingHymn.java new file mode 100644 index 00000000000..0e0a924ce11 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/HauntingHymn.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; + +import mage.abilities.condition.common.MyMainPhaseCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author nigelzor + */ +public class HauntingHymn extends CardImpl { + + public HauntingHymn(UUID ownerId) { + super(ownerId, 112, "Haunting Hymn", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{B}{B}"); + this.expansionSetCode = "TSP"; + + // Target player discards two cards. If you cast this spell during your main phase, that player discards four cards instead. + this.getSpellAbility().addEffect(new ConditionalOneShotEffect( + new DiscardTargetEffect(4), + new DiscardTargetEffect(2), + MyMainPhaseCondition.getInstance(), + "Target player discards two cards. If you cast this spell during your main phase, that player discards four cards instead")); + this.getSpellAbility().addTarget(new TargetPlayer()); + + } + + public HauntingHymn(final HauntingHymn card) { + super(card); + } + + @Override + public HauntingHymn copy() { + return new HauntingHymn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Hypergenesis.java b/Mage.Sets/src/mage/sets/timespiral/Hypergenesis.java index de7538b305a..d2b840b0cb1 100644 --- a/Mage.Sets/src/mage/sets/timespiral/Hypergenesis.java +++ b/Mage.Sets/src/mage/sets/timespiral/Hypergenesis.java @@ -60,7 +60,7 @@ public class Hypergenesis extends CardImpl { // Suspend 3-{1}{G}{G} this.addAbility(new SuspendAbility(3, new ManaCostsImpl("{1}{G}{G}"), this)); - + // Starting with you, each player may put an artifact, creature, enchantment, or land card from his or her hand onto the battlefield. Repeat this process until no one puts a card onto the battlefield. this.getSpellAbility().addEffect(new HypergenesisEffect()); } @@ -77,8 +77,9 @@ public class Hypergenesis extends CardImpl { @SuppressWarnings("unchecked") class HypergenesisEffect extends OneShotEffect { - + private static final FilterCard filter = new FilterCard("an artifact, creature, enchantment, or land card"); + static { filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.ENCHANTMENT), new CardTypePredicate(CardType.LAND))); } @@ -109,7 +110,7 @@ class HypergenesisEffect extends OneShotEffect { UUID firstInactivePlayer = null; Target target = new TargetCardInHand(filter); - while (controller.canRespond()) { + while (controller.canRespond()) { if (currentPlayer != null && currentPlayer.canRespond() && controller.getInRange().contains(currentPlayer.getId())) { if (firstInactivePlayer == null) { firstInactivePlayer = currentPlayer.getId(); @@ -120,7 +121,7 @@ class HypergenesisEffect extends OneShotEffect { if (target.chooseTarget(outcome, currentPlayer.getId(), source, game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - currentPlayer.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); + currentPlayer.moveCards(card, Zone.BATTLEFIELD, source, game); firstInactivePlayer = null; } } diff --git a/Mage.Sets/src/mage/sets/timespiral/IthHighArcanist.java b/Mage.Sets/src/mage/sets/timespiral/IthHighArcanist.java new file mode 100644 index 00000000000..eed301275f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/IthHighArcanist.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetAttackingCreature; + +/** + * + * @author LoneFox + */ +public class IthHighArcanist extends CardImpl { + + public IthHighArcanist(UUID ownerId) { + super(ownerId, 241, "Ith, High Arcanist", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{W}{U}"); + this.expansionSetCode = "TSP"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // {T}: Untap target attacking creature. Prevent all combat damage that would be dealt to and dealt by that creature this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost()); Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true); + effect.setText("Prevent all combat damage that would be dealt to"); + ability.addEffect(effect); + effect = new PreventDamageToTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE, true); + effect.setText("and dealt by that creature this turn"); + ability.addEffect(effect); + ability.addTarget(new TargetAttackingCreature()); + this.addAbility(ability); + // Suspend 4-{W}{U} + this.addAbility(new SuspendAbility(4, new ManaCostsImpl("{W}{U}"), this)); + } + + public IthHighArcanist(final IthHighArcanist card) { + super(card); + } + + @Override + public IthHighArcanist copy() { + return new IthHighArcanist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/KeldonHalberdier.java b/Mage.Sets/src/mage/sets/timespiral/KeldonHalberdier.java new file mode 100644 index 00000000000..c24c20da263 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/KeldonHalberdier.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class KeldonHalberdier extends CardImpl { + + public KeldonHalberdier(UUID ownerId) { + super(ownerId, 167, "Keldon Halberdier", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.power = new MageInt(4); + this.toughness = new MageInt(1); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // Suspend 4-{R} + this.addAbility(new SuspendAbility(4, new ManaCostsImpl("{R}"), this)); + } + + public KeldonHalberdier(final KeldonHalberdier card) { + super(card); + } + + @Override + public KeldonHalberdier copy() { + return new KeldonHalberdier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/LimDulTheNecromancer.java b/Mage.Sets/src/mage/sets/timespiral/LimDulTheNecromancer.java new file mode 100644 index 00000000000..7839ac9c469 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/LimDulTheNecromancer.java @@ -0,0 +1,136 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author jeffwadsworth + */ +public class LimDulTheNecromancer extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + private static final FilterPermanent filter2 = new FilterPermanent("Zombie"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + filter2.add(new SubtypePredicate("Zombie")); + } + + public LimDulTheNecromancer(UUID ownerId) { + super(ownerId, 114, "Lim-Dul the Necromancer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); + this.expansionSetCode = "TSP"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever a creature an opponent controls dies, you may pay {1}{B}. If you do, return that card to the battlefield under your control. If it's a creature, it's a Zombie in addition to its other creature types. + this.addAbility(new DiesCreatureTriggeredAbility(new DoIfCostPaid(new LimDulTheNecromancerEffect(), new ManaCostsImpl("{1}{B}")), true, filter, true)); + + // {1}{B}: Regenerate target Zombie. + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{1}{B}")); + ability2.addTarget(new TargetPermanent(filter2)); + this.addAbility(ability2); + + } + + public LimDulTheNecromancer(final LimDulTheNecromancer card) { + super(card); + } + + @Override + public LimDulTheNecromancer copy() { + return new LimDulTheNecromancer(this); + } +} + +class LimDulTheNecromancerEffect extends OneShotEffect { + + public LimDulTheNecromancerEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "return that card to the battlefield under your control. If it's a creature, it's a Zombie in addition to its other creature types"; + } + + public LimDulTheNecromancerEffect(final LimDulTheNecromancerEffect effect) { + super(effect); + } + + @Override + public LimDulTheNecromancerEffect copy() { + return new LimDulTheNecromancerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Card card = game.getCard(targetPointer.getFirst(game, source)); + if (card != null) { + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game) + && card.getCardType().contains(CardType.CREATURE)) { + Permanent creature = game.getPermanent(card.getId()); + ContinuousEffect effect = new AddCardSubTypeTargetEffect("Zombie", Duration.WhileOnBattlefield); + effect.setTargetPointer(new FixedTarget(creature.getId())); + game.addEffect(effect, source); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/LivingEnd.java b/Mage.Sets/src/mage/sets/timespiral/LivingEnd.java index 398a3e28fc2..cf26eed618f 100644 --- a/Mage.Sets/src/mage/sets/timespiral/LivingEnd.java +++ b/Mage.Sets/src/mage/sets/timespiral/LivingEnd.java @@ -27,6 +27,9 @@ */ package mage.sets.timespiral; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; @@ -41,7 +44,6 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; -import mage.game.ExileZone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -63,7 +65,7 @@ public class LivingEnd extends CardImpl { // Each player exiles all creature cards from his or her graveyard, then sacrifices all creatures // he or she controls, then puts all cards he or she exiled this way onto the battlefield. this.getSpellAbility().addEffect(new LivingEndEffect()); - + } public LivingEnd(final LivingEnd card) { @@ -97,26 +99,29 @@ class LivingEndEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { + Map> exiledCards = new HashMap<>(); // move creature cards from graveyard to exile - for (UUID playerId: controller.getInRange()){ + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card :player.getGraveyard().getCards(new FilterCreatureCard(), game)) { - controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.GRAVEYARD, true); + Set cardsPlayer = player.getGraveyard().getCards(new FilterCreatureCard(), game); + if (!cardsPlayer.isEmpty()) { + exiledCards.put(player.getId(), cardsPlayer); + player.moveCards(cardsPlayer, Zone.EXILED, source, game); } } } // sacrifice all creatures - for (Permanent permanent :game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { permanent.sacrifice(source.getSourceId(), game); } // put exiled cards to battlefield - ExileZone exileZone = game.getState().getExile().getExileZone(source.getSourceId()); - if (exileZone != null) { - for (Card card : exileZone.getCards(game)) { - Player player = game.getPlayer(card.getOwnerId()); - if (player != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + Set cardsPlayer = exiledCards.get(playerId); + if (cardsPlayer != null && !cardsPlayer.isEmpty()) { + player.moveCards(cardsPlayer, Zone.BATTLEFIELD, source, game, false, false, false, null); } } } diff --git a/Mage.Sets/src/mage/sets/timespiral/ManaSkimmer.java b/Mage.Sets/src/mage/sets/timespiral/ManaSkimmer.java new file mode 100644 index 00000000000..a149585d332 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ManaSkimmer.java @@ -0,0 +1,116 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; + +/** + * + * @author nigelzor + */ +public class ManaSkimmer extends CardImpl { + + public ManaSkimmer(UUID ownerId) { + super(ownerId, 117, "Mana Skimmer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Leech"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Whenever Mana Skimmer deals damage to a player, tap target land that player controls. That land doesn't untap during its controller's next untap step. + this.addAbility(new ManaSkimmerTriggeredAbility()); + } + + public ManaSkimmer(final ManaSkimmer card) { + super(card); + } + + @Override + public ManaSkimmer copy() { + return new ManaSkimmer(this); + } +} + +class ManaSkimmerTriggeredAbility extends TriggeredAbilityImpl { + + ManaSkimmerTriggeredAbility() { + super(Zone.BATTLEFIELD, new TapTargetEffect(), false); + addEffect(new DontUntapInControllersNextUntapStepTargetEffect()); + } + + ManaSkimmerTriggeredAbility(ManaSkimmerTriggeredAbility ability) { + super(ability); + } + + @Override + public ManaSkimmerTriggeredAbility copy() { + return new ManaSkimmerTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent source = game.getPermanent(event.getSourceId()); + if (source != null && source.getId().equals(this.getSourceId())) { + FilterLandPermanent filter = new FilterLandPermanent("land that player controls"); + filter.add(new ControllerIdPredicate(event.getPlayerId())); + filter.setMessage("land controlled by " + game.getPlayer(event.getTargetId()).getLogName()); + this.getTargets().clear(); + this.addTarget(new TargetPermanent(filter)); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} deals damage to a player, tap target land that player controls. That land doesn't untap during its controller's next untap step."; + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/MishraArtificerProdigy.java b/Mage.Sets/src/mage/sets/timespiral/MishraArtificerProdigy.java index 28488d56754..0ef45b5d50b 100644 --- a/Mage.Sets/src/mage/sets/timespiral/MishraArtificerProdigy.java +++ b/Mage.Sets/src/mage/sets/timespiral/MishraArtificerProdigy.java @@ -142,15 +142,12 @@ class MishraArtificerProdigyEffect extends OneShotEffect { FilterCard filter = new FilterCard("card named " + this.cardName); filter.add(new NamePredicate(cardName)); Card card = null; - Zone zone = null; // Graveyard if (controller.chooseUse(Outcome.Neutral, "Search your graveyard?", source, game)) { - TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(0, 1, filter); + // You can't fail to find the card in your graveyard because it's not hidden + TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(1, 1, filter); if (controller.choose(Outcome.PutCardInPlay, controller.getGraveyard(), target, game)) { card = game.getCard(target.getFirstTarget()); - if (card != null) { - zone = Zone.GRAVEYARD; - } } } // Hand @@ -158,9 +155,6 @@ class MishraArtificerProdigyEffect extends OneShotEffect { TargetCardInHand target = new TargetCardInHand(0, 1, filter); if (controller.choose(Outcome.PutCardInPlay, controller.getHand(), target, game)) { card = game.getCard(target.getFirstTarget()); - if (card != null) { - zone = Zone.HAND; - } } } // Library @@ -168,15 +162,12 @@ class MishraArtificerProdigyEffect extends OneShotEffect { TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter); if (controller.searchLibrary(target, game)) { card = game.getCard(target.getFirstTarget()); - if (card != null) { - zone = Zone.LIBRARY; - } } controller.shuffleLibrary(game); } // Put on battlefield if (card != null) { - controller.moveCards(card, zone, Zone.BATTLEFIELD, source, game); + controller.moveCards(card, null, Zone.BATTLEFIELD, source, game); } return true; } diff --git a/Mage.Sets/src/mage/sets/timespiral/Molder.java b/Mage.Sets/src/mage/sets/timespiral/Molder.java new file mode 100644 index 00000000000..8e65c7b5e12 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Molder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterArtifactOrEnchantmentPermanent; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class Molder extends CardImpl { + + public Molder(UUID ownerId) { + super(ownerId, 206, "Molder", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{X}{G}"); + this.expansionSetCode = "TSP"; + + // Destroy target artifact or enchantment with converted mana cost X. It can't be regenerated. You gain X life. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent("artifact or enchantment with converted mana cost X"))); + this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue())); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if(ability instanceof SpellAbility) { + ability.getTargets().clear(); + int xValue = ability.getManaCostsToPay().getX(); + FilterArtifactOrEnchantmentPermanent filter = new FilterArtifactOrEnchantmentPermanent("artifact or enchantment with converted mana cost X"); + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, xValue)); + ability.addTarget(new TargetPermanent(filter)); + } + } + + public Molder(final Molder card) { + super(card); + } + + @Override + public Molder copy() { + return new Molder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Moonlace.java b/Mage.Sets/src/mage/sets/timespiral/Moonlace.java new file mode 100644 index 00000000000..8babbebfc6b --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Moonlace.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetSpellOrPermanent; + +/** + * + * @author AlumiuN + */ +public class Moonlace extends CardImpl { + + public Moonlace(UUID ownerId) { + super(ownerId, 68, "Moonlace", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "TSP"; + + // Target spell or permanent becomes colorless. + this.getSpellAbility().addTarget(new TargetSpellOrPermanent()); + this.getSpellAbility().addEffect(new BecomesColorTargetEffect(new ObjectColor(), Duration.Custom)); + } + + public Moonlace(final Moonlace card) { + super(card); + } + + @Override + public Moonlace copy() { + return new Moonlace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java b/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java index 7bb54c0dd5b..ede5bc10ed5 100644 --- a/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java +++ b/Mage.Sets/src/mage/sets/timespiral/MwonvuliAcidMoss.java @@ -1,71 +1,70 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.timespiral; - -import java.util.UUID; -import mage.abilities.effects.common.DestroyTargetEffect; -import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.filter.common.FilterBasicLandCard; -import mage.filter.common.FilterLandCard; -import mage.filter.common.FilterLandPermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.target.TargetPermanent; -import mage.target.common.TargetCardInLibrary; - -/** - * - * @author markedagain - */ -public class MwonvuliAcidMoss extends CardImpl { - - public MwonvuliAcidMoss(UUID ownerId) { - super(ownerId, 207, "Mwonvuli Acid-Moss", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); - this.expansionSetCode = "TSP"; - - FilterLandCard filterForest = new FilterLandCard(); - filterForest.add(new SubtypePredicate("Forest")); - - // Destroy target land. Search your library for a Forest card and put that card onto the battlefield tapped. Then shuffle your library. - this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); - this.getSpellAbility().addTarget(new TargetPermanent(new FilterLandPermanent())); - this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filterForest), false, true)); - } - - public MwonvuliAcidMoss(final MwonvuliAcidMoss card) { - super(card); - } - - @Override - public MwonvuliAcidMoss copy() { - return new MwonvuliAcidMoss(this); - } -} - +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandCard; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author markedagain + */ +public class MwonvuliAcidMoss extends CardImpl { + + public MwonvuliAcidMoss(UUID ownerId) { + super(ownerId, 207, "Mwonvuli Acid-Moss", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); + this.expansionSetCode = "TSP"; + + FilterLandCard filterForest = new FilterLandCard(); + filterForest.add(new SubtypePredicate("Forest")); + + // Destroy target land. Search your library for a Forest card and put that card onto the battlefield tapped. Then shuffle your library. + this.getSpellAbility().addEffect(new DestroyTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetPermanent(new FilterLandPermanent())); + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filterForest), true, true)); + } + + public MwonvuliAcidMoss(final MwonvuliAcidMoss card) { + super(card); + } + + @Override + public MwonvuliAcidMoss copy() { + return new MwonvuliAcidMoss(this); + } +} + diff --git a/Mage.Sets/src/mage/sets/timespiral/OpalGuardian.java b/Mage.Sets/src/mage/sets/timespiral/OpalGuardian.java index 04e6861f177..56c436d813c 100644 --- a/Mage.Sets/src/mage/sets/timespiral/OpalGuardian.java +++ b/Mage.Sets/src/mage/sets/timespiral/OpalGuardian.java @@ -86,7 +86,7 @@ class OpalGuardianGargoyle extends Token { public OpalGuardianGargoyle() { super("Gargoyle", "a 3/4 Gargoyle creature with flying and protection from red"); cardType.add(CardType.CREATURE); - subtype.add("Knight"); + subtype.add("Gargoyle"); power = new MageInt(3); toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/sets/timespiral/OpalineSliver.java b/Mage.Sets/src/mage/sets/timespiral/OpalineSliver.java index b891c5f5c31..f653af6f14a 100644 --- a/Mage.Sets/src/mage/sets/timespiral/OpalineSliver.java +++ b/Mage.Sets/src/mage/sets/timespiral/OpalineSliver.java @@ -112,7 +112,7 @@ class OpalineSliverTriggeredAbility extends TriggeredAbilityImpl { } else { return event.getTargetId().equals(this.getSourceId()) && game.getOpponents(this.controllerId).contains(event.getPlayerId()) - && spellCard.match(spell, event.getPlayerId(), game); + && spellCard.match(spell, getSourceId(), getControllerId(), game); } } diff --git a/Mage.Sets/src/mage/sets/timespiral/OutriderEnKor.java b/Mage.Sets/src/mage/sets/timespiral/OutriderEnKor.java new file mode 100644 index 00000000000..00845989196 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/OutriderEnKor.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.RedirectDamageFromSourceToTargetEffect; +import mage.abilities.keyword.FlankingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class OutriderEnKor extends CardImpl { + + public OutriderEnKor(UUID ownerId) { + super(ownerId, 31, "Outrider en-Kor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Kor"); + this.subtype.add("Rebel"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flanking + this.addAbility(new FlankingAbility()); + + // {0}: The next 1 damage that would be dealt to Outrider en-Kor this turn is dealt to target creature you control instead. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RedirectDamageFromSourceToTargetEffect(Duration.EndOfTurn, 1, true), new GenericManaCost(0)); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + public OutriderEnKor(final OutriderEnKor card) { + super(card); + } + + @Override + public OutriderEnKor copy() { + return new OutriderEnKor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ParadoxHaze.java b/Mage.Sets/src/mage/sets/timespiral/ParadoxHaze.java index 40c612225b4..76b84e06c36 100644 --- a/Mage.Sets/src/mage/sets/timespiral/ParadoxHaze.java +++ b/Mage.Sets/src/mage/sets/timespiral/ParadoxHaze.java @@ -47,6 +47,7 @@ import mage.game.turn.UpkeepStep; import mage.players.Player; import mage.target.TargetPlayer; import mage.target.targetpointer.FixedTarget; +import mage.watchers.common.FirstTimeStepWatcher; /** * @@ -59,15 +60,14 @@ public class ParadoxHaze extends CardImpl { this.expansionSetCode = "TSP"; this.subtype.add("Aura"); - // Enchant player TargetPlayer auraTarget = new TargetPlayer(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Neutral)); this.addAbility(new EnchantAbility(auraTarget.getTargetName())); - + // At the beginning of enchanted player's first upkeep each turn, that player gets an additional upkeep step after this step. - this.addAbility(new ParadoxHazeTriggeredAbility()); + this.addAbility(new ParadoxHazeTriggeredAbility(), new FirstTimeStepWatcher(EventType.UPKEEP_STEP_POST)); } public ParadoxHaze(final ParadoxHaze card) { @@ -81,18 +81,15 @@ public class ParadoxHaze extends CardImpl { } class ParadoxHazeTriggeredAbility extends TriggeredAbilityImpl { - - protected int lastTriggerTurnNumber; - + ParadoxHazeTriggeredAbility() { super(Zone.BATTLEFIELD, new ParadoxHazeEffect(), false); } - + ParadoxHazeTriggeredAbility(final ParadoxHazeTriggeredAbility ability) { super(ability); - lastTriggerTurnNumber = ability.lastTriggerTurnNumber; } - + @Override public ParadoxHazeTriggeredAbility copy() { return new ParadoxHazeTriggeredAbility(this); @@ -102,21 +99,23 @@ class ParadoxHazeTriggeredAbility extends TriggeredAbilityImpl { public boolean checkEventType(GameEvent event, Game game) { return event.getType() == EventType.UPKEEP_STEP_PRE; } - + @Override public boolean checkTrigger(GameEvent event, Game game) { - Permanent permanent = game.getPermanent(this.sourceId); + Permanent permanent = game.getPermanent(getSourceId()); if (permanent != null) { Player player = game.getPlayer(permanent.getAttachedTo()); - if (player != null && game.getActivePlayerId().equals(player.getId()) && lastTriggerTurnNumber != game.getTurnNum()) { - lastTriggerTurnNumber = game.getTurnNum(); - this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); - return true; + if (player != null && game.getActivePlayerId().equals(player.getId())) { + FirstTimeStepWatcher watcher = (FirstTimeStepWatcher) game.getState().getWatchers().get(EventType.UPKEEP_STEP_POST.toString() + FirstTimeStepWatcher.class.getName()); + if (watcher != null && !watcher.conditionMet()) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); + return true; + } } } return false; } - + @Override public String getRule() { return "At the beginning of enchanted player's first upkeep each turn, that player gets an additional upkeep step after this step."; @@ -124,21 +123,21 @@ class ParadoxHazeTriggeredAbility extends TriggeredAbilityImpl { } class ParadoxHazeEffect extends OneShotEffect { - + ParadoxHazeEffect() { super(Outcome.Benefit); this.staticText = "that player gets an additional upkeep step after this step"; } - + ParadoxHazeEffect(final ParadoxHazeEffect effect) { super(effect); } - + @Override public ParadoxHazeEffect copy() { return new ParadoxHazeEffect(this); } - + @Override public boolean apply(Game game, Ability source) { game.getState().getTurnMods().add(new TurnMod(this.getTargetPointer().getFirst(game, source), new UpkeepStep(), null)); diff --git a/Mage.Sets/src/mage/sets/timespiral/PendelhavenElder.java b/Mage.Sets/src/mage/sets/timespiral/PendelhavenElder.java new file mode 100644 index 00000000000..ba17f4d8573 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/PendelhavenElder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.filter.predicate.mageobject.ToughnessPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class PendelhavenElder extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("each 1/1 creature you control"); + static { + filter.add(new PowerPredicate(Filter.ComparisonType.Equal, 1)); + filter.add(new ToughnessPredicate(Filter.ComparisonType.Equal, 1)); + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public PendelhavenElder(UUID ownerId) { + super(ownerId, 209, "Pendelhaven Elder", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Elf"); + this.subtype.add("Shaman"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Each 1/1 creature you control gets +1/+2 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 2, Duration.EndOfTurn, filter, false), new TapSourceCost())); + } + + public PendelhavenElder(final PendelhavenElder card) { + super(card); + } + + @Override + public PendelhavenElder copy() { + return new PendelhavenElder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Plunder.java b/Mage.Sets/src/mage/sets/timespiral/Plunder.java new file mode 100644 index 00000000000..f92736792d8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Plunder.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class Plunder extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact or land"); + + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.LAND))); + } + + public Plunder(UUID ownerId) { + super(ownerId, 174, "Plunder", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{4}{R}"); + this.expansionSetCode = "TSP"; + + // Destroy target artifact or land. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + // Suspend 4-{1}{R} + this.addAbility(new SuspendAbility(4, new ManaCostsImpl("{1}{R}"), this)); + } + + public Plunder(final Plunder card) { + super(card); + } + + @Override + public Plunder copy() { + return new Plunder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/PsionicSliver.java b/Mage.Sets/src/mage/sets/timespiral/PsionicSliver.java index 19442525b82..305762c162c 100644 --- a/Mage.Sets/src/mage/sets/timespiral/PsionicSliver.java +++ b/Mage.Sets/src/mage/sets/timespiral/PsionicSliver.java @@ -60,13 +60,13 @@ public class PsionicSliver extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - // All Sliver creatures have "{tap}: This creature deals 2 damage to target creature or player and 3 damage to itself." + // All Sliver creatures have "{T}: This creature deals 2 damage to target creature or player and 3 damage to itself." Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); ability.addEffect(new DamageSelfEffect(3)); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, - filter, "All Sliver creatures have \"{tap}: This creature deals 2 damage to target creature or player and 3 damage to itself.\""))); + filter, "All Sliver creatures have \"{T}: This creature deals 2 damage to target creature or player and 3 damage to itself.\""))); } public PsionicSliver(final PsionicSliver card) { diff --git a/Mage.Sets/src/mage/sets/timespiral/RiftwingCloudskate.java b/Mage.Sets/src/mage/sets/timespiral/RiftwingCloudskate.java index 221faa6eb4d..c0fd5c60bc7 100644 --- a/Mage.Sets/src/mage/sets/timespiral/RiftwingCloudskate.java +++ b/Mage.Sets/src/mage/sets/timespiral/RiftwingCloudskate.java @@ -28,8 +28,6 @@ package mage.sets.timespiral; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -38,6 +36,8 @@ import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.SuspendAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.target.TargetPermanent; /** @@ -62,7 +62,7 @@ public class RiftwingCloudskate extends CardImpl { this.addAbility(ability); // Suspend 3-{1}{U} - this.addAbility(new SuspendAbility(3, new ManaCostsImpl("{1}{U}"),this)); + this.addAbility(new SuspendAbility(3, new ManaCostsImpl("{1}{U}"), this)); } public RiftwingCloudskate(final RiftwingCloudskate card) { diff --git a/Mage.Sets/src/mage/sets/timespiral/SarpadianEmpiresVolVii.java b/Mage.Sets/src/mage/sets/timespiral/SarpadianEmpiresVolVii.java new file mode 100644 index 00000000000..b0ab59b347a --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/SarpadianEmpiresVolVii.java @@ -0,0 +1,168 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.token.CitizenToken; +import mage.game.permanent.token.GoblinToken; +import mage.game.permanent.token.SaprolingToken; +import mage.game.permanent.token.ThrullToken; +import mage.game.permanent.token.Token; +import mage.players.Player; + +/** + * + * @author LoneFox + */ +public class SarpadianEmpiresVolVii extends CardImpl { + + public SarpadianEmpiresVolVii(UUID ownerId) { + super(ownerId, 263, "Sarpadian Empires, Vol. VII", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "TSP"; + + // As Sarpadian Empires, Vol. VII enters the battlefield, choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling. + this.addAbility(new AsEntersBattlefieldAbility(new ChooseTokenEffect())); + // {3}, {T}: Put a 1/1 creature token of the chosen color and type onto the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateSelectedTokenEffect(), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public SarpadianEmpiresVolVii(final SarpadianEmpiresVolVii card) { + super(card); + } + + @Override + public SarpadianEmpiresVolVii copy() { + return new SarpadianEmpiresVolVii(this); + } +} + +class ChooseTokenEffect extends OneShotEffect { + + public ChooseTokenEffect() { + super(Outcome.Neutral); + this.staticText = "choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling"; + } + + public ChooseTokenEffect(final ChooseTokenEffect effect) { + super(effect); + } + + @Override + public ChooseTokenEffect copy() { + return new ChooseTokenEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if(sourceObject != null && controller != null) { + ChoiceImpl choices = new ChoiceImpl(true); + choices.setMessage("Choose token type"); + choices.getChoices().add("White Citizen"); + choices.getChoices().add("Blue Camarid"); + choices.getChoices().add("Black Thrull"); + choices.getChoices().add("Red Goblin"); + choices.getChoices().add("Green Saproling"); + if(controller.choose(Outcome.Neutral, choices, game)) { + game.informPlayers(sourceObject.getLogName() + ": chosen token type is " + choices.getChoice()); + game.getState().setValue(source.getSourceId().toString() + "_SarpadianEmpiresVolVii", choices.getChoice()); + return true; + } + } + return false; + } +} + +class CreateSelectedTokenEffect extends OneShotEffect { + + public CreateSelectedTokenEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "put a 1/1 creature token of the chosen color and type onto the battlefield"; + } + + public CreateSelectedTokenEffect(final CreateSelectedTokenEffect effect) { + super(effect); + } + + @Override + public CreateSelectedTokenEffect copy() { + return new CreateSelectedTokenEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + String tokenType = game.getState().getValue(source.getSourceId().toString() + "_SarpadianEmpiresVolVii").toString(); + Token token; + if(tokenType.equals("White Citizen")) { + token = new CitizenToken(); + } + else if(tokenType.equals("Blue Camarid")) { + token = new CamaridToken(); + } + else if(tokenType.equals("Black Thrull")) { + token = new ThrullToken(); + } + else if(tokenType.equals("Red Goblin")) { + token = new GoblinToken(); + } + else { + token = new SaprolingToken(); + } + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + return true; + } +} + +class CamaridToken extends Token { + public CamaridToken() { + super("Camarid", "1/1 blue Camarid creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Camarid"); + color.setBlue(true); + power = new MageInt(1); + toughness = new MageInt(1); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ScarwoodTreefolk.java b/Mage.Sets/src/mage/sets/timespiral/ScarwoodTreefolk.java new file mode 100644 index 00000000000..e6d8718bdb2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ScarwoodTreefolk.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.common.TapSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ScarwoodTreefolk extends CardImpl { + + private static final String staticText = "{this} enters the battlefield tapped"; + + public ScarwoodTreefolk(UUID ownerId) { + super(ownerId, 214, "Scarwood Treefolk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Treefolk"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Scarwood Treefolk enters the battlefield tapped. + this.addAbility(new EntersBattlefieldAbility(new TapSourceEffect(), staticText)); + } + + public ScarwoodTreefolk(final ScarwoodTreefolk card) { + super(card); + } + + @Override + public ScarwoodTreefolk copy() { + return new ScarwoodTreefolk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ScionOfTheUrDragon.java b/Mage.Sets/src/mage/sets/timespiral/ScionOfTheUrDragon.java index 3112e6b86b7..1a3700f00b2 100644 --- a/Mage.Sets/src/mage/sets/timespiral/ScionOfTheUrDragon.java +++ b/Mage.Sets/src/mage/sets/timespiral/ScionOfTheUrDragon.java @@ -53,7 +53,6 @@ import mage.target.common.TargetCardInLibrary; /** * @author duncant */ - public class ScionOfTheUrDragon extends CardImpl { public ScionOfTheUrDragon(UUID ownerId) { @@ -69,8 +68,8 @@ public class ScionOfTheUrDragon extends CardImpl { // {2}: Search your library for a Dragon permanent card and put it into your graveyard. If you do, Scion of the Ur-Dragon becomes a copy of that card until end of turn. Then shuffle your library. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new ScionOfTheUrDragonEffect(), - new ManaCostsImpl("{2}"))); + new ScionOfTheUrDragonEffect(), + new ManaCostsImpl("{2}"))); } public ScionOfTheUrDragon(final ScionOfTheUrDragon card) { @@ -84,15 +83,16 @@ public class ScionOfTheUrDragon extends CardImpl { } class ScionOfTheUrDragonEffect extends SearchEffect { + private static final FilterCard filter = new FilterPermanentCard("Dragon permanent card"); - + static { filter.add(new SubtypePredicate("Dragon")); } - + public ScionOfTheUrDragonEffect() { super(new TargetCardInLibrary(filter), Outcome.Copy); - staticText = "Search your library for a Dragon permanent card and put it into your graveyard. If you do, Scion of the Ur-Dragon becomes a copy of that card until end of turn. Then shuffle your library."; + staticText = "Search your library for a Dragon permanent card and put it into your graveyard. If you do, {this} becomes a copy of that card until end of turn. Then shuffle your library."; } ScionOfTheUrDragonEffect(final ScionOfTheUrDragonEffect effect) { diff --git a/Mage.Sets/src/mage/sets/timespiral/ScreechingSliver.java b/Mage.Sets/src/mage/sets/timespiral/ScreechingSliver.java index e38da3c8a11..8f04fbeb05f 100644 --- a/Mage.Sets/src/mage/sets/timespiral/ScreechingSliver.java +++ b/Mage.Sets/src/mage/sets/timespiral/ScreechingSliver.java @@ -57,13 +57,13 @@ public class ScreechingSliver extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - // All Slivers have "{tap}: Target player puts the top card of his or her library into his or her graveyard." + // All Slivers have "{T}: Target player puts the top card of his or her library into his or her graveyard." SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(1), new TapSourceCost()); ability.addTarget(new TargetPlayer()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, - filter, "All Sliver creatures have \"{tap}: Target player puts the top card of his or her library into his or her graveyard.\""))); + filter, "All Sliver creatures have \"{T}: Target player puts the top card of his or her library into his or her graveyard.\""))); } public ScreechingSliver(final ScreechingSliver card) { diff --git a/Mage.Sets/src/mage/sets/timespiral/ScrybRanger.java b/Mage.Sets/src/mage/sets/timespiral/ScrybRanger.java index f4218fe4bd2..e3fe4173f65 100644 --- a/Mage.Sets/src/mage/sets/timespiral/ScrybRanger.java +++ b/Mage.Sets/src/mage/sets/timespiral/ScrybRanger.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.FlyingAbility; @@ -76,7 +76,7 @@ public class ScrybRanger extends CardImpl { // protection from blue this.addAbility(new ProtectionAbility(filter)); // Return a Forest you control to its owner's hand: Untap target creature. Activate this ability only once each turn. - Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filterForest))); + Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filterForest))); ability.addTarget(new TargetCreaturePermanent(1)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/timespiral/SkitteringMonstrosity.java b/Mage.Sets/src/mage/sets/timespiral/SkitteringMonstrosity.java new file mode 100644 index 00000000000..69ab924f768 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/SkitteringMonstrosity.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author nigelzor + */ +public class SkitteringMonstrosity extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a creature spell"); + + static { + filter.add(new CardTypePredicate(CardType.CREATURE)); + } + + public SkitteringMonstrosity(UUID ownerId) { + super(ownerId, 129, "Skittering Monstrosity", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Horror"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // When you cast a creature spell, sacrifice Skittering Monstrosity. + this.addAbility(new SpellCastControllerTriggeredAbility(new SacrificeSourceEffect(), filter, false)); + } + + public SkitteringMonstrosity(final SkitteringMonstrosity card) { + super(card); + } + + @Override + public SkitteringMonstrosity copy() { + return new SkitteringMonstrosity(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Sprout.java b/Mage.Sets/src/mage/sets/timespiral/Sprout.java new file mode 100644 index 00000000000..ae16ecf750d --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Sprout.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.SaprolingToken; + +/** + * + * @author LoneFox + */ +public class Sprout extends CardImpl { + + public Sprout(UUID ownerId) { + super(ownerId, 221, "Sprout", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "TSP"; + + // Put a 1/1 green Saproling creature token onto the battlefield. + this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken())); + } + + public Sprout(final Sprout card) { + super(card); + } + + @Override + public Sprout copy() { + return new Sprout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/SquallLine.java b/Mage.Sets/src/mage/sets/timespiral/SquallLine.java new file mode 100644 index 00000000000..4a310fd1127 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/SquallLine.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class SquallLine extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public SquallLine(UUID ownerId) { + super(ownerId, 222, "Squall Line", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{G}{G}"); + this.expansionSetCode = "TSP"; + + // Squall Line deals X damage to each creature with flying and each player. + this.getSpellAbility().addEffect(new DamageEverythingEffect(new ManacostVariableValue(), filter)); } + + public SquallLine(final SquallLine card) { + super(card); + } + + @Override + public SquallLine copy() { + return new SquallLine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/StormcloudDjinn.java b/Mage.Sets/src/mage/sets/timespiral/StormcloudDjinn.java new file mode 100644 index 00000000000..31c7a73b90e --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/StormcloudDjinn.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class StormcloudDjinn extends CardImpl { + + public StormcloudDjinn(UUID ownerId) { + super(ownerId, 82, "Stormcloud Djinn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Djinn"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Stormcloud Djinn can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + // {R}{R}: Stormcloud Djinn gets +2/+0 until end of turn and deals 1 damage to you. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Duration.EndOfTurn), + new ManaCostsImpl("{R}{R}")); + Effect effect = new DamageControllerEffect(1); + effect.setText("and deals 1 damage to you"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public StormcloudDjinn(final StormcloudDjinn card) { + super(card); + } + + @Override + public StormcloudDjinn copy() { + return new StormcloudDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/StrongholdOverseer.java b/Mage.Sets/src/mage/sets/timespiral/StrongholdOverseer.java new file mode 100644 index 00000000000..6127f98184d --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/StrongholdOverseer.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class StrongholdOverseer extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with shadow"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creatures without shadow"); + + static { + filter.add(new AbilityPredicate(ShadowAbility.class)); + filter2.add(Predicates.not(new AbilityPredicate(ShadowAbility.class))); + } + + public StrongholdOverseer(UUID ownerId) { + super(ownerId, 133, "Stronghold Overseer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Demon"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // {B}{B}: Creatures with shadow get +1/+0 until end of turn and creatures without shadow get -1/-0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 0, Duration.EndOfTurn, filter, false), new ManaCostsImpl("{B}{B}")); + Effect effect = new BoostAllEffect(-1, 0, Duration.EndOfTurn, filter2, false); + effect.setText("and creatures without shadow get -1/-0 until end of turn"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public StrongholdOverseer(final StrongholdOverseer card) { + super(card); + } + + @Override + public StrongholdOverseer copy() { + return new StrongholdOverseer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/StuffyDoll.java b/Mage.Sets/src/mage/sets/timespiral/StuffyDoll.java index 7927019a7b4..2a30d327984 100644 --- a/Mage.Sets/src/mage/sets/timespiral/StuffyDoll.java +++ b/Mage.Sets/src/mage/sets/timespiral/StuffyDoll.java @@ -35,6 +35,7 @@ import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChoosePlayerEffect; import mage.abilities.effects.common.DamageSelfEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; @@ -45,10 +46,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.players.Player; -import mage.target.TargetPlayer; - /** * @@ -64,7 +62,7 @@ public class StuffyDoll extends CardImpl { this.toughness = new MageInt(1); // As Stuffy Doll enters the battlefield, choose a player. - this.addAbility(new AsEntersBattlefieldAbility(new StuffyDollChoosePlayerEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChoosePlayerEffect(Outcome.Damage))); // Stuffy Doll is indestructible. this.addAbility(IndestructibleAbility.getInstance()); // Whenever Stuffy Doll is dealt damage, it deals that much damage to the chosen player. @@ -83,41 +81,6 @@ public class StuffyDoll extends CardImpl { } } -class StuffyDollChoosePlayerEffect extends OneShotEffect { - - public StuffyDollChoosePlayerEffect() { - super(Outcome.Detriment); - this.staticText = "choose a player"; - } - - public StuffyDollChoosePlayerEffect(final StuffyDollChoosePlayerEffect effect) { - super(effect); - } - - @Override - public StuffyDollChoosePlayerEffect copy() { - return new StuffyDollChoosePlayerEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - TargetPlayer target = new TargetPlayer(); - if (player.choose(this.outcome, target, source.getSourceId(), game)) { - Player chosenPlayer = game.getPlayer(target.getFirstTarget()); - if (chosenPlayer != null) { - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + chosenPlayer.getLogName()); - game.getState().setValue(permanent.getId() + "_player", target.getFirstTarget()); - return true; - } - } - } - return false; - } -} - class StuffyDollTriggeredAbility extends TriggeredAbilityImpl { public StuffyDollTriggeredAbility() { @@ -179,4 +142,3 @@ class StuffyDollGainLifeEffect extends OneShotEffect { return true; } } - diff --git a/Mage.Sets/src/mage/sets/timespiral/TectonicFiend.java b/Mage.Sets/src/mage/sets/timespiral/TectonicFiend.java new file mode 100644 index 00000000000..ddb1bf268c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/TectonicFiend.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksEachTurnStaticAbility; +import mage.abilities.keyword.EchoAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TectonicFiend extends CardImpl { + + public TectonicFiend(UUID ownerId) { + super(ownerId, 181, "Tectonic Fiend", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Elemental"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Echo {4}{R}{R} + this.addAbility(new EchoAbility("{4}{R}{R}")); + // Tectonic Fiend attacks each turn if able. + this.addAbility(new AttacksEachTurnStaticAbility()); + } + + public TectonicFiend(final TectonicFiend card) { + super(card); + } + + @Override + public TectonicFiend copy() { + return new TectonicFiend(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/TeferiMageOfZhalfir.java b/Mage.Sets/src/mage/sets/timespiral/TeferiMageOfZhalfir.java index 26395fa7c3a..8e58dc1c9bd 100644 --- a/Mage.Sets/src/mage/sets/timespiral/TeferiMageOfZhalfir.java +++ b/Mage.Sets/src/mage/sets/timespiral/TeferiMageOfZhalfir.java @@ -73,7 +73,6 @@ public class TeferiMageOfZhalfir extends CardImpl { // Each opponent can cast spells only any time he or she could cast a sorcery. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TeferiMageOfZhalfirReplacementEffect())); - } public TeferiMageOfZhalfir(final TeferiMageOfZhalfir card) { @@ -107,31 +106,31 @@ class TeferiMageOfZhalfirAddFlashEffect extends ContinuousEffectImpl { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { // in graveyard - for (UUID cardId: controller.getGraveyard()) { + for (UUID cardId : controller.getGraveyard()) { Card card = game.getCard(cardId); if (card.getCardType().contains(CardType.CREATURE)) { game.getState().addOtherAbility(card, FlashAbility.getInstance()); } } // on Hand - for (UUID cardId: controller.getHand()) { + for (UUID cardId : controller.getHand()) { Card card = game.getCard(cardId); if (card.getCardType().contains(CardType.CREATURE)) { game.getState().addOtherAbility(card, FlashAbility.getInstance()); } } // in Exile - for (Card card: game.getState().getExile().getAllCards(game)) { + for (Card card : game.getState().getExile().getAllCards(game)) { if (card.getOwnerId().equals(controller.getId()) && card.getCardType().contains(CardType.CREATURE)) { game.getState().addOtherAbility(card, FlashAbility.getInstance()); } } // in Library (e.g. for Mystical Teachings) - for (Card card: controller.getLibrary().getCards(game)) { + for (Card card : controller.getLibrary().getCards(game)) { if (card.getOwnerId().equals(controller.getId()) && card.getCardType().contains(CardType.CREATURE)) { game.getState().addOtherAbility(card, FlashAbility.getInstance()); } - } + } // commander in command zone if (controller.getCommanderId() != null && game.getState().getZone(controller.getCommanderId()).equals(Zone.COMMAND)) { Card card = game.getCard(controller.getCommanderId()); @@ -160,7 +159,7 @@ class TeferiMageOfZhalfirReplacementEffect extends ContinuousRuleModifyingEffect public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can cast spells only any time you could cast a sorcery (" + mageObject.getLogName() + ")."; + return "You can cast spells only any time you could cast a sorcery (" + mageObject.getIdName() + ")."; } return null; } @@ -170,7 +169,6 @@ class TeferiMageOfZhalfirReplacementEffect extends ContinuousRuleModifyingEffect return event.getType() == GameEvent.EventType.CAST_SPELL; } - @Override public boolean applies(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/timespiral/TelekineticSliver.java b/Mage.Sets/src/mage/sets/timespiral/TelekineticSliver.java index d92e3eb48dd..c05e9cad7f2 100644 --- a/Mage.Sets/src/mage/sets/timespiral/TelekineticSliver.java +++ b/Mage.Sets/src/mage/sets/timespiral/TelekineticSliver.java @@ -58,11 +58,11 @@ public class TelekineticSliver extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - // All Slivers have "{tap}: Tap target permanent." + // All Slivers have "{T}: Tap target permanent." Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); ability.addTarget(new TargetPermanent()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, filter, "All Slivers have \"{tap}: Tap target permanent.\""))); + new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, filter, "All Slivers have \"{T}: Tap target permanent.\""))); } public TelekineticSliver(final TelekineticSliver card) { diff --git a/Mage/src/mage/abilities/costs/common/MetalcraftCost.java b/Mage.Sets/src/mage/sets/timespiral/TemporalEddy.java similarity index 65% rename from Mage/src/mage/abilities/costs/common/MetalcraftCost.java rename to Mage.Sets/src/mage/sets/timespiral/TemporalEddy.java index d73fd484bac..7c316993ed1 100644 --- a/Mage/src/mage/abilities/costs/common/MetalcraftCost.java +++ b/Mage.Sets/src/mage/sets/timespiral/TemporalEddy.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,56 +20,53 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - -package mage.abilities.costs.common; +package mage.sets.timespiral; import java.util.UUID; + +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; import mage.constants.CardType; -import mage.abilities.Ability; -import mage.abilities.costs.CostImpl; +import mage.constants.Rarity; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; +import mage.target.TargetPermanent; /** * - * @author BetaSteward_at_googlemail.com + * @author nigelzor */ -public class MetalcraftCost extends CostImpl { +public class TemporalEddy extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("artifact"); + private static final FilterPermanent filter = new FilterPermanent("creature or land"); static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); + filter.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); } - public MetalcraftCost() { - this.text = "Activate this ability only if you control three or more artifacts"; + public TemporalEddy(UUID ownerId) { + super(ownerId, 85, "Temporal Eddy", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}{U}"); + this.expansionSetCode = "TSP"; + + // Put target creature or land on top of its owner's library. + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); } - public MetalcraftCost(final MetalcraftCost cost) { - super(cost); + public TemporalEddy(final TemporalEddy card) { + super(card); } @Override - public MetalcraftCost copy() { - return new MetalcraftCost(this); + public TemporalEddy copy() { + return new TemporalEddy(this); } - - @Override - public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - return game.getBattlefield().contains(filter, controllerId, 3, game); - } - - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } - -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ThrillOfTheHunt.java b/Mage.Sets/src/mage/sets/timespiral/ThrillOfTheHunt.java new file mode 100644 index 00000000000..22fe2e6b1c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ThrillOfTheHunt.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.FlashbackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TimingRule; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ThrillOfTheHunt extends CardImpl { + + public ThrillOfTheHunt(UUID ownerId) { + super(ownerId, 229, "Thrill of the Hunt", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "TSP"; + + // Target creature gets +1/+2 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(1, 2, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // Flashback {W} + this.addAbility(new FlashbackAbility(new ManaCostsImpl("{W}"), TimingRule.INSTANT)); + } + + public ThrillOfTheHunt(final ThrillOfTheHunt card) { + super(card); + } + + @Override + public ThrillOfTheHunt copy() { + return new ThrillOfTheHunt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Triskelavus.java b/Mage.Sets/src/mage/sets/timespiral/Triskelavus.java new file mode 100644 index 00000000000..6a95558fbb8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Triskelavus.java @@ -0,0 +1,102 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.permanent.token.Token; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class Triskelavus extends CardImpl { + + public Triskelavus(UUID ownerId) { + super(ownerId, 266, "Triskelavus", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{7}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Construct"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Triskelavus enters the battlefield with three +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it")); + + // {1}, Remove a +1/+1 counter from Triskelavus: Put a 1/1 colorless Triskelavite artifact creature token with flying onto the battlefield. It has "Sacrifice this creature: This creature deals 1 damage to target creature or player." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new TriskelaviteToken()), new GenericManaCost(1)); + ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance())); + this.addAbility(ability); + } + + public Triskelavus(final Triskelavus card) { + super(card); + } + + @Override + public Triskelavus copy() { + return new Triskelavus(this); + } +} + +class TriskelaviteToken extends Token { + + public TriskelaviteToken() { + super("Triskelavite", "1/1 colorless Triskelavite artifact creature token with flying onto the battlefield. It has \"Sacrifice this creature: This creature deals 1 damage to target creature or player.\""); + this.setOriginalExpansionSetCode("TSP"); + cardType.add(CardType.ARTIFACT); + cardType.add(CardType.CREATURE); + subtype.add("Triskelavite"); + power = new MageInt(1); + toughness = new MageInt(1); + + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new SacrificeSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + + addAbility(FlyingAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/TrompTheDomains.java b/Mage.Sets/src/mage/sets/timespiral/TrompTheDomains.java index 6fbd03506b2..3533d54b41a 100644 --- a/Mage.Sets/src/mage/sets/timespiral/TrompTheDomains.java +++ b/Mage.Sets/src/mage/sets/timespiral/TrompTheDomains.java @@ -38,7 +38,6 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; /** @@ -51,14 +50,13 @@ public class TrompTheDomains extends CardImpl { super(ownerId, 230, "Tromp the Domains", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{5}{G}"); this.expansionSetCode = "TSP"; - // Domain - Until end of turn, creatures you control gain trample and get +1/+1 for each basic land type among lands you control. Effect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); effect.setText("Domain - Until end of turn, creatures you control gain Trample"); this.getSpellAbility().addEffect(effect); DynamicValue domain = new DomainValue(); effect = new BoostControlledEffect(domain, domain, Duration.EndOfTurn, new FilterCreaturePermanent(), false); - effect.setText(" and get +1/+1 for each basic land type among lands you control"); + effect.setText("and get +1/+1 for each basic land type among lands you control"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/sets/timespiral/UnyaroBees.java b/Mage.Sets/src/mage/sets/timespiral/UnyaroBees.java new file mode 100644 index 00000000000..0d08284a89a --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/UnyaroBees.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class UnyaroBees extends CardImpl { + + public UnyaroBees(UUID ownerId) { + super(ownerId, 231, "Unyaro Bees", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}{G}{G}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Insect"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {G}: Unyaro Bees gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{G}"))); + // {3}{G}, Sacrifice Unyaro Bees: Unyaro Bees deals 2 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{3}{G}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public UnyaroBees(final UnyaroBees card) { + super(card); + } + + @Override + public UnyaroBees copy() { + return new UnyaroBees(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/VerdantEmbrace.java b/Mage.Sets/src/mage/sets/timespiral/VerdantEmbrace.java new file mode 100644 index 00000000000..57a2adc8b3d --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/VerdantEmbrace.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.permanent.token.SaprolingToken; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class VerdantEmbrace extends CardImpl { + + public VerdantEmbrace(UUID ownerId) { + super(ownerId, 232, "Verdant Embrace", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{G}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +3/+3 and has "At the beginning of each upkeep, put a 1/1 green Saproling creature token onto the battlefield." + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield)); + Ability grantedAbility = new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new SaprolingToken()), TargetController.ANY, false); + Effect effect = new GainAbilityAttachedEffect(grantedAbility, AttachmentType.AURA); + effect.setText("and has \"At the beginning of each upkeep, put a 1/1 green Saproling creature token onto the battlefield.\""); + ability.addEffect(effect); + this.addAbility(ability); + } + + public VerdantEmbrace(final VerdantEmbrace card) { + super(card); + } + + @Override + public VerdantEmbrace copy() { + return new VerdantEmbrace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Vesuva.java b/Mage.Sets/src/mage/sets/timespiral/Vesuva.java index 197107be0c8..99f6571e913 100644 --- a/Mage.Sets/src/mage/sets/timespiral/Vesuva.java +++ b/Mage.Sets/src/mage/sets/timespiral/Vesuva.java @@ -28,14 +28,14 @@ package mage.sets.timespiral; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.CopyPermanentEffect; import mage.abilities.effects.common.TapSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -56,12 +56,13 @@ public class Vesuva extends CardImpl { this.expansionSetCode = "TSP"; // You may have Vesuva enter the battlefield tapped as a copy of any land on the battlefield. - EntersBattlefieldEffect effect = new EntersBattlefieldEffect( - new TapSourceEffect(true), - "You may have {this} enter the battlefield tapped as a copy of any land on the battlefield", - true); - effect.addEffect(new CopyPermanentEffect(filter)); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + Effect effect = new TapSourceEffect(true); + effect.setText("tapped"); + Ability ability = new EntersBattlefieldAbility(effect, true); + effect = new CopyPermanentEffect(filter); + effect.setText("as a copy of any land on the battlefield"); + ability.addEffect(effect); + this.addAbility(ability); } public Vesuva(final Vesuva card) { diff --git a/Mage.Sets/src/mage/sets/timespiral/ViashinoBladescout.java b/Mage.Sets/src/mage/sets/timespiral/ViashinoBladescout.java new file mode 100644 index 00000000000..0bc7db02d78 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ViashinoBladescout.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ViashinoBladescout extends CardImpl { + + public ViashinoBladescout(UUID ownerId) { + super(ownerId, 185, "Viashino Bladescout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Viashino"); + this.subtype.add("Scout"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // When Viashino Bladescout enters the battlefield, target creature gains first strike until end of turn. + Ability ability = new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ViashinoBladescout(final ViashinoBladescout card) { + super(card); + } + + @Override + public ViashinoBladescout copy() { + return new ViashinoBladescout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/VisceridDeepwalker.java b/Mage.Sets/src/mage/sets/timespiral/VisceridDeepwalker.java new file mode 100644 index 00000000000..810f9e4952a --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/VisceridDeepwalker.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class VisceridDeepwalker extends CardImpl { + + public VisceridDeepwalker(UUID ownerId) { + super(ownerId, 91, "Viscerid Deepwalker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Homarid"); + this.subtype.add("Warrior"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {U}: Viscerid Deepwalker gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{U}"))); + // Suspend 4-{U} + this.addAbility(new SuspendAbility(4, new ManaCostsImpl("{U}"), this)); + } + + public VisceridDeepwalker(final VisceridDeepwalker card) { + super(card); + } + + @Override + public VisceridDeepwalker copy() { + return new VisceridDeepwalker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ViscidLemures.java b/Mage.Sets/src/mage/sets/timespiral/ViscidLemures.java new file mode 100644 index 00000000000..47ed07fc566 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ViscidLemures.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class ViscidLemures extends CardImpl { + + public ViscidLemures(UUID ownerId) { + super(ownerId, 141, "Viscid Lemures", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Spirit"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // {0}: Viscid Lemures gets -1/-0 and gains swampwalk until end of turn. + Effect effect = new BoostSourceEffect(-1, 0, Duration.EndOfTurn); + effect.setText("{this} gets -1/-0"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(0)); + effect = new GainAbilitySourceEffect(new SwampwalkAbility(), Duration.EndOfTurn); + effect.setText("and gains swampwalk until end of turn. (It can't be blocked as long as defending player controls a Swamp.)"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public ViscidLemures(final ViscidLemures card) { + super(card); + } + + @Override + public ViscidLemures copy() { + return new ViscidLemures(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/VoidmageHusher.java b/Mage.Sets/src/mage/sets/timespiral/VoidmageHusher.java new file mode 100644 index 00000000000..f74b44b3dcb --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/VoidmageHusher.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author andyfries + */ +public class VoidmageHusher extends mage.sets.mediainserts.VoidmageHusher { + + public VoidmageHusher(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "TSP"; + this.rarity = Rarity.UNCOMMON; + } + + public VoidmageHusher(final VoidmageHusher card) { + super(card); + } + + @Override + public VoidmageHusher copy() { + return new VoidmageHusher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/WormwoodDryad.java b/Mage.Sets/src/mage/sets/timespiral/WormwoodDryad.java new file mode 100644 index 00000000000..5bafb1249e2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/WormwoodDryad.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ForestwalkAbility; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class WormwoodDryad extends CardImpl { + + public WormwoodDryad(UUID ownerId) { + super(ownerId, 233, "Wormwood Dryad", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Dryad"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // {G}: Wormwood Dryad gains forestwalk until end of turn and deals 1 damage to you. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new ForestwalkAbility(false), Duration.EndOfTurn), new ManaCostsImpl("{G}")); + ability.addEffect(new DamageControllerEffect(1)); + this.addAbility(ability); + + // {B}: Wormwood Dryad gains swampwalk until end of turn and deals 1 damage to you. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect(new SwampwalkAbility(false), Duration.EndOfTurn), new ManaCostsImpl("{B}")); + ability.addEffect(new DamageControllerEffect(1)); + this.addAbility(ability); + } + + public WormwoodDryad(final WormwoodDryad card) { + super(card); + } + + @Override + public WormwoodDryad copy() { + return new WormwoodDryad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/Wurmcalling.java b/Mage.Sets/src/mage/sets/timespiral/Wurmcalling.java new file mode 100644 index 00000000000..fac4952c75b --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/Wurmcalling.java @@ -0,0 +1,104 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.BuybackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + */ +public class Wurmcalling extends CardImpl { + + public Wurmcalling(UUID ownerId) { + super(ownerId, 234, "Wurmcalling", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{G}"); + this.expansionSetCode = "TSP"; + + // Buyback {2}{G} + this.addAbility(new BuybackAbility("{2}{G}")); + // Put an X/X green Wurm creature token onto the battlefield. + this.getSpellAbility().addEffect(new WurmcallingEffect()); + } + + public Wurmcalling(final Wurmcalling card) { + super(card); + } + + @Override + public Wurmcalling copy() { + return new Wurmcalling(this); + } +} + +class WurmcallingEffect extends OneShotEffect { + + public WurmcallingEffect() { + super(Outcome.PutCreatureInPlay); + staticText = "Put an X/X green Wurm creature token onto the battlefield"; + } + + public WurmcallingEffect(WurmcallingEffect ability) { + super(ability); + } + + @Override + public boolean apply(Game game, Ability source) { + int count = source.getManaCostsToPay().getX(); + WurmToken token = new WurmToken(); + token.getPower().initValue(count); + token.getToughness().initValue(count); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + return true; + } + + @Override + public WurmcallingEffect copy() { + return new WurmcallingEffect(this); + } +} + +class WurmToken extends Token { + public WurmToken() { + super("Wurm", "X/X green Wurm creature token"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Wurm"); + power = new MageInt(0); + toughness = new MageInt(0); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/YavimayaDryad.java b/Mage.Sets/src/mage/sets/timespiral/YavimayaDryad.java new file mode 100644 index 00000000000..e066abdbceb --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/YavimayaDryad.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class YavimayaDryad extends mage.sets.archenemy.YavimayaDryad { + + public YavimayaDryad(UUID ownerId) { + super(ownerId); + this.cardNumber = 235; + this.expansionSetCode = "TSP"; + } + + public YavimayaDryad(final YavimayaDryad card) { + super(card); + } + + @Override + public YavimayaDryad copy() { + return new YavimayaDryad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/ZealotIlVec.java b/Mage.Sets/src/mage/sets/timespiral/ZealotIlVec.java new file mode 100644 index 00000000000..47fa6319572 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/ZealotIlVec.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.PreventCombatDamageBySourceEffect; +import mage.abilities.keyword.ShadowAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ZealotIlVec extends CardImpl { + + public ZealotIlVec(UUID ownerId) { + super(ownerId, 47, "Zealot il-Vec", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Human"); + this.subtype.add("Rebel"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Shadow + this.addAbility(ShadowAbility.getInstance()); + // Whenever Zealot il-Vec attacks and isn't blocked, you may have it deal 1 damage to target creature. If you do, prevent all combat damage Zealot il-Vec would deal this turn. + Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(new DamageTargetEffect(1), true); + Effect effect = new PreventCombatDamageBySourceEffect(Duration.EndOfTurn); + effect.setText("if you do, prevent all combat damage {this} would deal this turn"); + ability.addEffect(effect); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + } + + public ZealotIlVec(final ZealotIlVec card) { + super(card); + } + + @Override + public ZealotIlVec copy() { + return new ZealotIlVec(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/BalshanCollaborator.java b/Mage.Sets/src/mage/sets/torment/BalshanCollaborator.java new file mode 100644 index 00000000000..02000670863 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/BalshanCollaborator.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class BalshanCollaborator extends CardImpl { + + public BalshanCollaborator(UUID ownerId) { + super(ownerId, 25, "Balshan Collaborator", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {B}: Balshan Collaborator gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + } + + public BalshanCollaborator(final BalshanCollaborator card) { + super(card); + } + + @Override + public BalshanCollaborator copy() { + return new BalshanCollaborator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/BarbarianOutcast.java b/Mage.Sets/src/mage/sets/torment/BarbarianOutcast.java new file mode 100644 index 00000000000..0becdaa5ed7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/BarbarianOutcast.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author fireshoes + */ +public class BarbarianOutcast extends CardImpl { + + private static final FilterControlledLandPermanent filterControlledLand = new FilterControlledLandPermanent("a Swamp"); + + static { + filterControlledLand.add(new SubtypePredicate("Swamp")); + } + + public BarbarianOutcast(UUID ownerId) { + super(ownerId, 92, "Barbarian Outcast", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Human"); + this.subtype.add("Barbarian"); + this.subtype.add("Beast"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When you control no Swamps, sacrifice Barbarian Outcast. + this.addAbility(new ControlsPermanentsControllerTriggeredAbility( + new FilterLandPermanent("Swamp", "no Swamps"), Filter.ComparisonType.Equal, 0, + new SacrificeSourceEffect())); + } + + public BarbarianOutcast(final BarbarianOutcast card) { + super(card); + } + + @Override + public BarbarianOutcast copy() { + return new BarbarianOutcast(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/CabalRitual.java b/Mage.Sets/src/mage/sets/torment/CabalRitual.java index d22e660ba42..203914aba3f 100644 --- a/Mage.Sets/src/mage/sets/torment/CabalRitual.java +++ b/Mage.Sets/src/mage/sets/torment/CabalRitual.java @@ -53,7 +53,7 @@ public class CabalRitual extends CardImpl { new BasicManaEffect(new Mana(0, 0, 0, 0, 5, 0, 0)), new BasicManaEffect(new Mana(0, 0, 0, 0, 3, 0, 0)), new CardsInControllerGraveCondition(7), - "Add {B}{B}{B} to your mana pool.

Threshold - Add {B}{B}{B}{B}{B} to your mana pool instead if seven or more cards are in your graveyard")); + "Add {B}{B}{B} to your mana pool.

Threshold - Add {B}{B}{B}{B}{B} to your mana pool instead if seven or more cards are in your graveyard")); } public CabalRitual(final CabalRitual card) { diff --git a/Mage.Sets/src/mage/sets/torment/CabalTorturer.java b/Mage.Sets/src/mage/sets/torment/CabalTorturer.java new file mode 100644 index 00000000000..9c68435e04f --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/CabalTorturer.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class CabalTorturer extends CardImpl { + + public CabalTorturer(UUID ownerId) { + super(ownerId, 53, "Cabal Torturer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Human"); + this.subtype.add("Minion"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {B}, {tap}: Target creature gets -1/-1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-1, -1, Duration.EndOfTurn), new ManaCostsImpl("{B}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + // Threshold - {3}{B}{B}, {tap}: Target creature gets -2/-2 until end of turn. Activate this ability only if seven or more cards are in your graveyard. + ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), + new ManaCostsImpl("{3}{B}{B}"), new CardsInControllerGraveCondition(7)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public CabalTorturer(final CabalTorturer card) { + super(card); + } + + @Override + public CabalTorturer copy() { + return new CabalTorturer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/CentaurChieftain.java b/Mage.Sets/src/mage/sets/torment/CentaurChieftain.java new file mode 100644 index 00000000000..a548a2bb0c9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/CentaurChieftain.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class CentaurChieftain extends CardImpl { + + public CentaurChieftain(UUID ownerId) { + super(ownerId, 122, "Centaur Chieftain", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Centaur"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // Threshold - As long as seven or more cards are in your graveyard, Centaur Chieftain has "When Centaur Chieftain enters the battlefield, creatures you control get +1/+1 and gain trample until end of turn." + Effect effect = new BoostControlledEffect(1, 1, Duration.EndOfTurn); + effect.setText("creatures you control get +1/+1"); + Ability gainedAbility = new EntersBattlefieldTriggeredAbility(effect); + effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, + new FilterControlledCreaturePermanent()); + effect.setText("and gain trample until end of turn"); + gainedAbility.addEffect(effect); + + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new GainAbilitySourceEffect(gainedAbility), new CardsInControllerGraveCondition(7), + "As long as seven or more cards are in your graveyard, {this} has \"When {this} enters the battlefield, creatures you control get +1/+1 and gain trample until end of turn.\"")); + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public CentaurChieftain(final CentaurChieftain card) { + super(card); + } + + @Override + public CentaurChieftain copy() { + return new CentaurChieftain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/CephalidAristocrat.java b/Mage.Sets/src/mage/sets/torment/CephalidAristocrat.java new file mode 100644 index 00000000000..f0c831e3a10 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/CephalidAristocrat.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesTargetTriggeredAbility; +import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class CephalidAristocrat extends CardImpl { + + public CephalidAristocrat(UUID ownerId) { + super(ownerId, 27, "Cephalid Aristocrat", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Cephalid"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Cephalid Aristocrat becomes the target of a spell or ability, put the top two cards of your library into your graveyard. + this.addAbility(new BecomesTargetTriggeredAbility(new PutTopCardOfLibraryIntoGraveControllerEffect(2))); + } + + public CephalidAristocrat(final CephalidAristocrat card) { + super(card); + } + + @Override + public CephalidAristocrat copy() { + return new CephalidAristocrat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/CephalidVandal.java b/Mage.Sets/src/mage/sets/torment/CephalidVandal.java new file mode 100644 index 00000000000..6aa724c6288 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/CephalidVandal.java @@ -0,0 +1,105 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class CephalidVandal extends CardImpl { + + public CephalidVandal(UUID ownerId) { + super(ownerId, 31, "Cephalid Vandal", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Cephalid"); + this.subtype.add("Rogue"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // At the beginning of your upkeep, put a shred counter on Cephalid Vandal. Then put the top card of your library into your graveyard for each shred counter on Cephalid Vandal. + Effect effect = new CephalidVandalEffect(); + Ability ability = new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.SHRED.createInstance(), false), TargetController.YOU, false); + ability.addEffect(effect); + this.addAbility(ability); + } + + public CephalidVandal(final CephalidVandal card) { + super(card); + } + + @Override + public CephalidVandal copy() { + return new CephalidVandal(this); + } +} + +class CephalidVandalEffect extends OneShotEffect { + + public CephalidVandalEffect() { + super(Outcome.Neutral); + staticText = "Then put the top card of your library into your graveyard for each shred counter on {this}"; + } + + public CephalidVandalEffect(final CephalidVandalEffect effect) { + super(effect); + } + + @Override + public CephalidVandalEffect copy() { + return new CephalidVandalEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null && controller != null) { + int amount = permanent.getCounters().getCount(CounterType.SHRED); + controller.moveCards(controller.getLibrary().getTopCards(game, amount), Zone.LIBRARY, Zone.GRAVEYARD, source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/torment/ChainerDementiaMaster.java b/Mage.Sets/src/mage/sets/torment/ChainerDementiaMaster.java new file mode 100644 index 00000000000..253f7ade515 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/ChainerDementiaMaster.java @@ -0,0 +1,144 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileAllEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureTypeTargetEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInGraveyard; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author emerald000 + */ +public class ChainerDementiaMaster extends CardImpl { + + private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("Nightmare creatures"); + private static final FilterPermanent filterPermanent = new FilterPermanent("Nightmares"); + static { + filterCreature.add(new SubtypePredicate("Nightmare")); + filterPermanent.add(new SubtypePredicate("Nightmare")); + } + + public ChainerDementiaMaster(UUID ownerId) { + super(ownerId, 56, "Chainer, Dementia Master", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "TOR"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Minion"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Nightmare creatures get +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filterCreature, false))); + + // {B}{B}{B}, Pay 3 life: Put target creature card from a graveyard onto the battlefield under your control. That creature is black and is a Nightmare in addition to its other creature types. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChainerDementiaMasterEffect(), new ManaCostsImpl<>("{B}{B}{B}")); + ability.addCost(new PayLifeCost(3)); + ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard"))); + this.addAbility(ability); + + // When Chainer, Dementia Master leaves the battlefield, exile all Nightmares. + this.addAbility(new LeavesBattlefieldTriggeredAbility(new ExileAllEffect(filterPermanent), false)); + } + + public ChainerDementiaMaster(final ChainerDementiaMaster card) { + super(card); + } + + @Override + public ChainerDementiaMaster copy() { + return new ChainerDementiaMaster(this); + } +} + +class ChainerDementiaMasterEffect extends OneShotEffect { + + ChainerDementiaMasterEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "Put target creature card from a graveyard onto the battlefield under your control. That creature is black and is a Nightmare in addition to its other creature types"; + } + + ChainerDementiaMasterEffect(final ChainerDementiaMasterEffect effect) { + super(effect); + } + + @Override + public ChainerDementiaMasterEffect copy() { + return new ChainerDementiaMasterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + UUID cardId = this.getTargetPointer().getFirst(game, source); + new ReturnFromGraveyardToBattlefieldTargetEffect().apply(game, source); + Permanent permanent = game.getPermanent(cardId); + if (permanent != null) { + ContinuousEffectImpl effect = new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield); + effect.setTargetPointer(new FixedTarget(permanent, game)); + game.addEffect(effect, source); + effect = new BecomesCreatureTypeTargetEffect(Duration.WhileOnBattlefield, new ArrayList<>(Arrays.asList("Nightmare")), false); + effect.setTargetPointer(new FixedTarget(permanent, game)); + game.addEffect(effect, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/torment/DwellOnThePast.java b/Mage.Sets/src/mage/sets/torment/DwellOnThePast.java new file mode 100644 index 00000000000..e1c8774608a --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/DwellOnThePast.java @@ -0,0 +1,140 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class DwellOnThePast extends CardImpl { + + public DwellOnThePast(UUID ownerId) { + super(ownerId, 124, "Dwell on the Past", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{G}"); + this.expansionSetCode = "TOR"; + + // Target player shuffles up to four target cards from his or her graveyard into his or her library. + this.getSpellAbility().addEffect(new DwellOnThePastEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addTarget(new DwellOnThePastTarget()); + + } + + public DwellOnThePast(final DwellOnThePast card) { + super(card); + } + + @Override + public DwellOnThePast copy() { + return new DwellOnThePast(this); + } +} + +class DwellOnThePastEffect extends OneShotEffect { + + public DwellOnThePastEffect() { + super(Outcome.Neutral); + this.staticText = "Target player shuffles up to four target cards from his or her graveyard into his or her library"; + } + + public DwellOnThePastEffect(final DwellOnThePastEffect effect) { + super(effect); + } + + @Override + public DwellOnThePastEffect copy() { + return new DwellOnThePastEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + List targets = source.getTargets().get(1).getTargets(); + boolean shuffle = false; + for (UUID targetId : targets) { + Card card = game.getCard(targetId); + if (card != null) { + if (player.getGraveyard().contains(card.getId())) { + player.getGraveyard().remove(card); + card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + shuffle = true; + } + } + } + if (shuffle) { + player.shuffleLibrary(game); + } + return true; + } + return false; + } +} + +class DwellOnThePastTarget extends TargetCard { + + public DwellOnThePastTarget() { + super(0, 4, Zone.GRAVEYARD, new FilterCard("cards from target player's graveyard")); + } + + public DwellOnThePastTarget(final DwellOnThePastTarget target) { + super(target); + } + + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + Card card = game.getCard(id); + if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) { + UUID firstTarget = source.getFirstTarget(); + if (firstTarget != null && game.getPlayer(firstTarget).getGraveyard().contains(id)) { + return filter.match(card, game); + } + } + return false; + } + + @Override + public DwellOnThePastTarget copy() { + return new DwellOnThePastTarget(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/EnslavedDwarf.java b/Mage.Sets/src/mage/sets/torment/EnslavedDwarf.java new file mode 100644 index 00000000000..5ca796ddc0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/EnslavedDwarf.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author tomd1990 + */ +public class EnslavedDwarf extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("black creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public EnslavedDwarf(UUID ownerId) { + super(ownerId, 96, "Enslaved Dwarf", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Dwarf"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {R}, Sacrifice Enslaved Dwarf: Target black creature gets +1/+0 and gains first strike until end of turn. + Effect effect = new BoostTargetEffect(1,0,Duration.EndOfTurn); + effect.setText("Target black creature gets +1/+0"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{R}")); + ability.addCost(new SacrificeSourceCost()); + effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains first strike until end of turn"); + ability.addEffect(effect); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public EnslavedDwarf(final EnslavedDwarf card) { + super(card); + } + + @Override + public EnslavedDwarf copy() { + return new EnslavedDwarf(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/FlashOfDefiance.java b/Mage.Sets/src/mage/sets/torment/FlashOfDefiance.java new file mode 100644 index 00000000000..b537c088f8c --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/FlashOfDefiance.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CantBlockAllEffect; +import mage.abilities.keyword.FlashbackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TimingRule; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author fireshoes + */ +public class FlashOfDefiance extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green creatures and white creatures"); + + static { + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.WHITE), + new ColorPredicate(ObjectColor.GREEN))); + } + + public FlashOfDefiance(UUID ownerId) { + super(ownerId, 99, "Flash of Defiance", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); + this.expansionSetCode = "TOR"; + + // Green creatures and white creatures can't block this turn. + this.getSpellAbility().addEffect(new CantBlockAllEffect(filter, Duration.EndOfTurn)); + + // Flashback-{1}{R}, Pay 3 life. + Ability ability = new FlashbackAbility(new ManaCostsImpl("{1}{R}"), TimingRule.SORCERY); + ability.addCost(new PayLifeCost(3)); + this.addAbility(ability); + } + + public FlashOfDefiance(final FlashOfDefiance card) { + super(card); + } + + @Override + public FlashOfDefiance copy() { + return new FlashOfDefiance(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/HellBentRaider.java b/Mage.Sets/src/mage/sets/torment/HellBentRaider.java new file mode 100644 index 00000000000..b504970e282 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/HellBentRaider.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.ObjectColor; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.abilities.common.SimpleActivatedAbility; +import mage.constants.Duration; +import mage.abilities.keyword.ProtectionAbility; +/** + * + * @author tomd1990 + */ +public class HellBentRaider extends CardImpl { + private static final FilterCard protectionFilter = new FilterCard("White"); + + static { + protectionFilter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public HellBentRaider(UUID ownerId) { + super(ownerId, 101, "Hell-Bent Raider", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Human"); + this.subtype.add("Barbarian"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // Haste + this.addAbility(HasteAbility.getInstance()); + // Discard a card at random: Hell-Bent Raider gains protection from white until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilitySourceEffect( new ProtectionAbility(protectionFilter), Duration.EndOfTurn), + new DiscardCardCost(true)); + this.addAbility(ability); + } + + public HellBentRaider(final HellBentRaider card) { + super(card); + } + + @Override + public HellBentRaider copy() { + return new HellBentRaider(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/torment/HydromorphGuardian.java b/Mage.Sets/src/mage/sets/torment/HydromorphGuardian.java new file mode 100644 index 00000000000..0eaaf30cd1f --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/HydromorphGuardian.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.other.TargetsPermanentPredicate; +import mage.target.TargetSpell; + +/** + * + * @author TaVSt + */ +public class HydromorphGuardian extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("spell that targets one or more creatures you control"); + + static { + filter.add(new TargetsPermanentPredicate(new FilterControlledCreaturePermanent())); + } + + public HydromorphGuardian(UUID ownerId) { + super(ownerId, 39, "Hydromorph Guardian", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Elemental"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {U}, Sacrifice Hydromorph Guardian: Counter target spell that targets one or more creatures you control. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ColoredManaCost(ColoredManaSymbol.U)); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetSpell(filter)); + this.addAbility(ability); + } + + public HydromorphGuardian(final HydromorphGuardian card) { + super(card); + } + + @Override + public HydromorphGuardian copy() { + return new HydromorphGuardian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/HydromorphGull.java b/Mage.Sets/src/mage/sets/torment/HydromorphGull.java new file mode 100644 index 00000000000..c427837724d --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/HydromorphGull.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.other.TargetsPermanentPredicate; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + */ +public class HydromorphGull extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("spell that targets one or more creatures you control"); + + static { + filter.add(new TargetsPermanentPredicate(new FilterControlledCreaturePermanent())); + } + + public HydromorphGull(UUID ownerId) { + super(ownerId, 40, "Hydromorph Gull", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Elemental"); + this.subtype.add("Bird"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {U}, Sacrifice Hydromorph Gull: Counter target spell that targets one or more creatures you control. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ColoredManaCost(ColoredManaSymbol.U)); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetSpell(filter)); + this.addAbility(ability); + } + + public HydromorphGull(final HydromorphGull card) { + super(card); + } + + @Override + public HydromorphGull copy() { + return new HydromorphGull(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/KrosanConstrictor.java b/Mage.Sets/src/mage/sets/torment/KrosanConstrictor.java new file mode 100644 index 00000000000..05c8229f67b --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/KrosanConstrictor.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class KrosanConstrictor extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("black creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public KrosanConstrictor(UUID ownerId) { + super(ownerId, 129, "Krosan Constrictor", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Snake"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Swampwalk + this.addAbility(new SwampwalkAbility()); + // {tap}: Target black creature gets -2/-0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -0, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public KrosanConstrictor(final KrosanConstrictor card) { + super(card); + } + + @Override + public KrosanConstrictor copy() { + return new KrosanConstrictor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/Liquify.java b/Mage.Sets/src/mage/sets/torment/Liquify.java new file mode 100644 index 00000000000..2ff79251434 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/Liquify.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.abilities.effects.common.CounterTargetWithReplacementEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + */ +public class Liquify extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("spell with converted mana cost 3 or less"); + + static { + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 4)); + } + + public Liquify(UUID ownerId) { + super(ownerId, 41, "Liquify", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); + this.expansionSetCode = "TOR"; + + // Counter target spell with converted mana cost 3 or less. If that spell is countered this way, exile it instead of putting it into its owner's graveyard. + this.getSpellAbility().addEffect(new CounterTargetWithReplacementEffect(Zone.EXILED)); + this.getSpellAbility().addTarget(new TargetSpell(filter)); + } + + public Liquify(final Liquify card) { + super(card); + } + + @Override + public Liquify copy() { + return new Liquify(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/Narcissism.java b/Mage.Sets/src/mage/sets/torment/Narcissism.java new file mode 100644 index 00000000000..e42647943b7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/Narcissism.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Narcissism extends CardImpl { + + public Narcissism(UUID ownerId) { + super(ownerId, 134, "Narcissism", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "TOR"; + + // {G}, Discard a card: Target creature gets +2/+2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new ManaCostsImpl("{G}")); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + // {G}, Sacrifice Narcissism: Target creature gets +2/+2 until end of turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2, 2, Duration.EndOfTurn), new ManaCostsImpl("{G}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public Narcissism(final Narcissism card) { + super(card); + } + + @Override + public Narcissism copy() { + return new Narcissism(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/PardicArsonist.java b/Mage.Sets/src/mage/sets/torment/PardicArsonist.java new file mode 100644 index 00000000000..0a7b965bfab --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/PardicArsonist.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class PardicArsonist extends CardImpl { + + public PardicArsonist(UUID ownerId) { + super(ownerId, 105, "Pardic Arsonist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Human"); + this.subtype.add("Barbarian"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Threshold - As long as seven or more cards are in your graveyard, Pardic Arsonist has "When Pardic Arsonist enters the battlefield, it deals 3 damage to target creature or player." + Ability gainedAbility = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(3)); + gainedAbility.addTarget(new TargetCreatureOrPlayer()); + + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new GainAbilitySourceEffect(gainedAbility), new CardsInControllerGraveCondition(7), + "As long as seven or more cards are in your graveyard, {this} has \"When {this} enters the battlefield, it deals 3 damage to target creature or player.\"")); + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public PardicArsonist(final PardicArsonist card) { + super(card); + } + + @Override + public PardicArsonist copy() { + return new PardicArsonist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/PardicCollaborator.java b/Mage.Sets/src/mage/sets/torment/PardicCollaborator.java new file mode 100644 index 00000000000..8465052736a --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/PardicCollaborator.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class PardicCollaborator extends CardImpl { + + public PardicCollaborator(UUID ownerId) { + super(ownerId, 106, "Pardic Collaborator", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Human"); + this.subtype.add("Barbarian"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // {B}: Pardic Collaborator gets +1/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + } + + public PardicCollaborator(final PardicCollaborator card) { + super(card); + } + + @Override + public PardicCollaborator copy() { + return new PardicCollaborator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/PardicLancer.java b/Mage.Sets/src/mage/sets/torment/PardicLancer.java new file mode 100644 index 00000000000..878cad07acc --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/PardicLancer.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.abilities.effects.Effect; + +/** + * + * @author tomd1990 + */ +public class PardicLancer extends CardImpl { + + public PardicLancer(UUID ownerId) { + super(ownerId, 107, "Pardic Lancer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Human"); + this.subtype.add("Barbarian"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Discard a card at random: Pardic Lancer gets +1/+0 and gains first strike until end of turn. + Effect effect = new BoostSourceEffect(1,0,Duration.EndOfTurn); + effect.setText("{this} gets +1/+0"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new DiscardCardCost(true)); + effect = new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains first strike until end of turn"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public PardicLancer(final PardicLancer card) { + super(card); + } + + @Override + public PardicLancer copy() { + return new PardicLancer(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/torment/PossessedAven.java b/Mage.Sets/src/mage/sets/torment/PossessedAven.java new file mode 100644 index 00000000000..e51fc4f6625 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/PossessedAven.java @@ -0,0 +1,107 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.BecomesColorSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class PossessedAven extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blue creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public PossessedAven(UUID ownerId) { + super(ownerId, 45, "Possessed Aven", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Bird"); + this.subtype.add("Soldier"); + this.subtype.add("Horror"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Threshold - As long as seven or more cards are in your graveyard, Possessed Aven gets +1/+1, is black, and has "{2}{B}, {tap}: Destroy target blue creature." + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), + "As long as seven or more cards are in your graveyard, {this} gets +1/+1")); + + Effect effect = new ConditionalContinuousEffect(new BecomesColorSourceEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield), + new CardsInControllerGraveCondition(7), ", is black"); + ability.addEffect(effect); + + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{2}{B}")); + gainedAbility.addCost(new TapSourceCost()); + gainedAbility.addTarget(new TargetCreaturePermanent(filter)); + effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(gainedAbility), + new CardsInControllerGraveCondition(7), ", and has \"{2}{B}, {T}: Destroy target blue creature.\""); + ability.addEffect(effect); + + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public PossessedAven(final PossessedAven card) { + super(card); + } + + @Override + public PossessedAven copy() { + return new PossessedAven(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/PossessedBarbarian.java b/Mage.Sets/src/mage/sets/torment/PossessedBarbarian.java new file mode 100644 index 00000000000..311f0475080 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/PossessedBarbarian.java @@ -0,0 +1,107 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.BecomesColorSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class PossessedBarbarian extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("red creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public PossessedBarbarian(UUID ownerId) { + super(ownerId, 111, "Possessed Barbarian", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Human"); + this.subtype.add("Barbarian"); + this.subtype.add("Horror"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // Threshold - As long as seven or more cards are in your graveyard, Possessed Barbarian gets +1/+1, is black, and has "{2}{B}, {tap}: Destroy target red creature." + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), + "As long as seven or more cards are in your graveyard, {this} gets +1/+1")); + + Effect effect = new ConditionalContinuousEffect(new BecomesColorSourceEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield), + new CardsInControllerGraveCondition(7), ", is black"); + ability.addEffect(effect); + + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{2}{B}")); + gainedAbility.addCost(new TapSourceCost()); + gainedAbility.addTarget(new TargetCreaturePermanent(filter)); + effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(gainedAbility), + new CardsInControllerGraveCondition(7), ", and has \"{2}{B}, {T}: Destroy target red creature.\""); + ability.addEffect(effect); + + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public PossessedBarbarian(final PossessedBarbarian card) { + super(card); + } + + @Override + public PossessedBarbarian copy() { + return new PossessedBarbarian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/PossessedCentaur.java b/Mage.Sets/src/mage/sets/torment/PossessedCentaur.java new file mode 100644 index 00000000000..8117de8c695 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/PossessedCentaur.java @@ -0,0 +1,106 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.BecomesColorSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class PossessedCentaur extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public PossessedCentaur(UUID ownerId) { + super(ownerId, 137, "Possessed Centaur", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Centaur"); + this.subtype.add("Horror"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Threshold - As long as seven or more cards are in your graveyard, Possessed Centaur gets +1/+1, is black, and has "{2}{B}, {tap}: Destroy target green creature." + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), + "As long as seven or more cards are in your graveyard, {this} gets +1/+1")); + + Effect effect = new ConditionalContinuousEffect(new BecomesColorSourceEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield), + new CardsInControllerGraveCondition(7), ", is black"); + ability.addEffect(effect); + + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{2}{B}")); + gainedAbility.addCost(new TapSourceCost()); + gainedAbility.addTarget(new TargetCreaturePermanent(filter)); + effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(gainedAbility), + new CardsInControllerGraveCondition(7), ", and has \"{2}{B}, {T}: Destroy target green creature.\""); + ability.addEffect(effect); + + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public PossessedCentaur(final PossessedCentaur card) { + super(card); + } + + @Override + public PossessedCentaur copy() { + return new PossessedCentaur(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/PossessedNomad.java b/Mage.Sets/src/mage/sets/torment/PossessedNomad.java new file mode 100644 index 00000000000..2f8f67b3e07 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/PossessedNomad.java @@ -0,0 +1,107 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continuous.BecomesColorSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class PossessedNomad extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("white creature"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public PossessedNomad(UUID ownerId) { + super(ownerId, 13, "Possessed Nomad", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Human"); + this.subtype.add("Nomad"); + this.subtype.add("Horror"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // Threshold - As long as seven or more cards are in your graveyard, Possessed Nomad gets +1/+1, is black, and has "{2}{B}, {tap}: Destroy target white creature." + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), + "As long as seven or more cards are in your graveyard, {this} gets +1/+1")); + + Effect effect = new ConditionalContinuousEffect(new BecomesColorSourceEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield), + new CardsInControllerGraveCondition(7), ", is black"); + ability.addEffect(effect); + + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{2}{B}")); + gainedAbility.addCost(new TapSourceCost()); + gainedAbility.addTarget(new TargetCreaturePermanent(filter)); + effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(gainedAbility), + new CardsInControllerGraveCondition(7), ", and has \"{2}{B}, {T}: Destroy target white creature.\""); + ability.addEffect(effect); + + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public PossessedNomad(final PossessedNomad card) { + super(card); + } + + @Override + public PossessedNomad copy() { + return new PossessedNomad(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/RancidEarth.java b/Mage.Sets/src/mage/sets/torment/RancidEarth.java index 39308e07c52..64ff991989b 100644 --- a/Mage.Sets/src/mage/sets/torment/RancidEarth.java +++ b/Mage.Sets/src/mage/sets/torment/RancidEarth.java @@ -58,7 +58,7 @@ public class RancidEarth extends CardImpl { new RancidEarthEffect(), new DestroyTargetEffect(), new CardsInControllerGraveCondition(7), - "Destroy target land.

Threshold - If seven or more cards are in your graveyard, instead destroy that land and Rancid Earth deals 1 damage to each creature and each player.")); + "Destroy target land.

Threshold - If seven or more cards are in your graveyard, instead destroy that land and Rancid Earth deals 1 damage to each creature and each player.")); this.getSpellAbility().addTarget(new TargetLandPermanent()); } diff --git a/Mage.Sets/src/mage/sets/torment/SetonsScout.java b/Mage.Sets/src/mage/sets/torment/SetonsScout.java new file mode 100644 index 00000000000..cced148dca5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/SetonsScout.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class SetonsScout extends CardImpl { + + public SetonsScout(UUID ownerId) { + super(ownerId, 138, "Seton's Scout", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Centaur"); + this.subtype.add("Druid"); + this.subtype.add("Scout"); + this.subtype.add("Archer"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Reach + this.addAbility(ReachAbility.getInstance()); + // Threshold - Seton's Scout gets +2/+2 as long as seven or more cards are in your graveyard. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), + "As long as seven or more cards are in your graveyard, {this} gets +2/+2")); + ability.setAbilityWord(AbilityWord.THRESHOLD); + this.addAbility(ability); + } + + public SetonsScout(final SetonsScout card) { + super(card); + } + + @Override + public SetonsScout copy() { + return new SetonsScout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/SickeningDreams.java b/Mage.Sets/src/mage/sets/torment/SickeningDreams.java new file mode 100644 index 00000000000..84c68615434 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/SickeningDreams.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SickeningDreams extends mage.sets.pdsgraveborn.SickeningDreams { + + public SickeningDreams(UUID ownerId) { + super(ownerId); + this.cardNumber = 83; + this.expansionSetCode = "TOR"; + } + + public SickeningDreams(final SickeningDreams card) { + super(card); + } + + @Override + public SickeningDreams copy() { + return new SickeningDreams(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/SlitheryStalker.java b/Mage.Sets/src/mage/sets/torment/SlitheryStalker.java new file mode 100644 index 00000000000..f3f36f20074 --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/SlitheryStalker.java @@ -0,0 +1,96 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ExileTargetForSourceEffect; +import mage.abilities.effects.common.ReturnFromExileForSourceEffect; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.Target; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class SlitheryStalker extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a green or white creature an opponent controls"); + + static { + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.GREEN), + new ColorPredicate(ObjectColor.WHITE))); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public SlitheryStalker(UUID ownerId) { + super(ownerId, 84, "Slithery Stalker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Nightmare"); + this.subtype.add("Horror"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Swampwalk + this.addAbility(new SwampwalkAbility()); + + // When Slithery Stalker enters the battlefield, exile target green or white creature an opponent controls. + Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect(), true); + Target target = new TargetPermanent(filter); + ability1.addTarget(target); + this.addAbility(ability1); + + // When Slithery Stalker leaves the battlefield, return the exiled card to the battlefield under its owner's control. + Ability ability2 = new LeavesBattlefieldTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD), false); + this.addAbility(ability2); + } + + public SlitheryStalker(final SlitheryStalker card) { + super(card); + } + + @Override + public SlitheryStalker copy() { + return new SlitheryStalker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/StupefyingTouch.java b/Mage.Sets/src/mage/sets/torment/StupefyingTouch.java new file mode 100644 index 00000000000..e52c34e006b --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/StupefyingTouch.java @@ -0,0 +1,116 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class StupefyingTouch extends CardImpl { + + public StupefyingTouch(UUID ownerId) { + super(ownerId, 48, "Stupefying Touch", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // When Stupefying Touch enters the battlefield, draw a card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); + + // Enchanted creature's activated abilities can't be activated. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantActivateAbilitiesAttachedEffect())); + } + + public StupefyingTouch(final StupefyingTouch card) { + super(card); + } + + @Override + public StupefyingTouch copy() { + return new StupefyingTouch(this); + } +} + +class CantActivateAbilitiesAttachedEffect extends RestrictionEffect { + + public CantActivateAbilitiesAttachedEffect() { + super(Duration.WhileOnBattlefield); + staticText = "Enchanted creature's activated abilities can't be activated"; + } + + public CantActivateAbilitiesAttachedEffect(final CantActivateAbilitiesAttachedEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + if (permanent.getId().equals(enchantment.getAttachedTo())) { + return true; + } + } + return false; + } + + @Override + public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) { + return false; + } + + @Override + public CantActivateAbilitiesAttachedEffect copy() { + return new CantActivateAbilitiesAttachedEffect(this); + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/torment/VengefulDreams.java b/Mage.Sets/src/mage/sets/torment/VengefulDreams.java new file mode 100644 index 00000000000..42b78e2114c --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/VengefulDreams.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.common.DiscardXTargetCost; +import mage.abilities.dynamicvalue.common.GetXValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterAttackingCreature; +import mage.game.Game; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class VengefulDreams extends CardImpl { + + public VengefulDreams(UUID ownerId) { + super(ownerId, 21, "Vengeful Dreams", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{W}{W}"); + this.expansionSetCode = "TOR"; + + // As an additional cost to cast Vengeful Dreams, discard X cards. + this.getSpellAbility().addCost(new DiscardXTargetCost(new FilterCard("cards"), true)); + + // Exile X target attacking creatures. + Effect effect = new ExileTargetEffect(); + effect.setText("Exile X target attacking creatures"); + this.getSpellAbility().addEffect(effect); + } + + public VengefulDreams(final VengefulDreams card) { + super(card); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + int xValue = new GetXValue().calculate(game, ability, null); + Target target = new TargetCreaturePermanent(0, xValue, new FilterAttackingCreature(), false); + ability.addTarget(target); + } + + @Override + public VengefulDreams copy() { + return new VengefulDreams(this); + } +} diff --git a/Mage.Sets/src/mage/sets/torment/ZombieTrailblazer.java b/Mage.Sets/src/mage/sets/torment/ZombieTrailblazer.java new file mode 100644 index 00000000000..67ae57e6c9b --- /dev/null +++ b/Mage.Sets/src/mage/sets/torment/ZombieTrailblazer.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.torment; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author fireshoes + */ +public class ZombieTrailblazer extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an untapped Zombie you control"); + + static { + filter.add(new SubtypePredicate("Zombie")); + filter.add(Predicates.not(new TappedPredicate())); + } + + public ZombieTrailblazer(UUID ownerId) { + super(ownerId, 89, "Zombie Trailblazer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{B}{B}"); + this.expansionSetCode = "TOR"; + this.subtype.add("Zombie"); + this.subtype.add("Scout"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Tap an untapped Zombie you control: Target land becomes a Swamp until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BecomesBasicLandTargetEffect(Duration.EndOfTurn, "Swamp"), new TapTargetCost(new TargetControlledPermanent(filter))); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + + // Tap an untapped Zombie you control: Target creature gains swampwalk until end of turn. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(new SwampwalkAbility(false), Duration.EndOfTurn), new TapTargetCost(new TargetControlledPermanent(filter))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ZombieTrailblazer(final ZombieTrailblazer card) { + super(card); + } + + @Override + public ZombieTrailblazer copy() { + return new ZombieTrailblazer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Chaoslace.java b/Mage.Sets/src/mage/sets/unlimitededition/Chaoslace.java new file mode 100644 index 00000000000..b42abd03c4b --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Chaoslace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Chaoslace extends mage.sets.fourthedition.Chaoslace { + + public Chaoslace(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + this.expansionSetCode = "2ED"; + } + + public Chaoslace(final Chaoslace card) { + super(card); + } + + @Override + public Chaoslace copy() { + return new Chaoslace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Conversion.java b/Mage.Sets/src/mage/sets/unlimitededition/Conversion.java new file mode 100644 index 00000000000..5f61f2899cd --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Conversion.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 200; + this.expansionSetCode = "2ED"; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/CursedLand.java b/Mage.Sets/src/mage/sets/unlimitededition/CursedLand.java new file mode 100644 index 00000000000..7ee2487d278 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "2ED"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Deathgrip.java b/Mage.Sets/src/mage/sets/unlimitededition/Deathgrip.java new file mode 100644 index 00000000000..5467ba0936c --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Deathgrip.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class Deathgrip extends mage.sets.limitedbeta.Deathgrip { + + public Deathgrip(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "2ED"; + } + + public Deathgrip(final Deathgrip card) { + super(card); + } + + @Override + public Deathgrip copy() { + return new Deathgrip(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Deathlace.java b/Mage.Sets/src/mage/sets/unlimitededition/Deathlace.java new file mode 100644 index 00000000000..6dd2d54e012 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Deathlace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Deathlace extends mage.sets.limitedbeta.Deathlace { + + public Deathlace(UUID ownerId) { + super(ownerId); + this.cardNumber = 10; + this.expansionSetCode = "2ED"; + } + + public Deathlace(final Deathlace card) { + super(card); + } + + @Override + public Deathlace copy() { + return new Deathlace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Feedback.java b/Mage.Sets/src/mage/sets/unlimitededition/Feedback.java new file mode 100644 index 00000000000..0d7fd8ae9f9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "2ED"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/GraniteGargoyle.java b/Mage.Sets/src/mage/sets/unlimitededition/GraniteGargoyle.java new file mode 100644 index 00000000000..dafb05335a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/GraniteGargoyle.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class GraniteGargoyle extends mage.sets.revisededition.GraniteGargoyle { + + public GraniteGargoyle(UUID ownerId) { + super(ownerId); + this.cardNumber = 156; + this.expansionSetCode = "2ED"; + } + + public GraniteGargoyle(final GraniteGargoyle card) { + super(card); + } + + @Override + public GraniteGargoyle copy() { + return new GraniteGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Lifeforce.java b/Mage.Sets/src/mage/sets/unlimitededition/Lifeforce.java new file mode 100644 index 00000000000..688270c6f3a --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Lifeforce.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Lifeforce extends mage.sets.masterseditioniv.Lifeforce { + + public Lifeforce(UUID ownerId) { + super(ownerId); + this.cardNumber = 115; + this.expansionSetCode = "2ED"; + this.rarity = Rarity.UNCOMMON; + } + + public Lifeforce(final Lifeforce card) { + super(card); + } + + @Override + public Lifeforce copy() { + return new Lifeforce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Lifelace.java b/Mage.Sets/src/mage/sets/unlimitededition/Lifelace.java new file mode 100644 index 00000000000..d96ebdbe10d --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Lifelace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Lifelace extends mage.sets.limitedalpha.Lifelace { + + public Lifelace(UUID ownerId) { + super(ownerId); + this.cardNumber = 116; + this.expansionSetCode = "2ED"; + } + + public Lifelace(final Lifelace card) { + super(card); + } + + @Override + public Lifelace copy() { + return new Lifelace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Lifetap.java b/Mage.Sets/src/mage/sets/unlimitededition/Lifetap.java new file mode 100644 index 00000000000..2e900c7bb5c --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Lifetap.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Lifetap extends mage.sets.fifthedition.Lifetap { + + public Lifetap(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "2ED"; + } + + public Lifetap(final Lifetap card) { + super(card); + } + + @Override + public Lifetap copy() { + return new Lifetap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/LivingArtifact.java b/Mage.Sets/src/mage/sets/unlimitededition/LivingArtifact.java new file mode 100644 index 00000000000..f1f32f10467 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/LivingArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class LivingArtifact extends mage.sets.fifthedition.LivingArtifact { + + public LivingArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 117; + this.expansionSetCode = "2ED"; + } + + public LivingArtifact(final LivingArtifact card) { + super(card); + } + + @Override + public LivingArtifact copy() { + return new LivingArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Purelace.java b/Mage.Sets/src/mage/sets/unlimitededition/Purelace.java new file mode 100644 index 00000000000..d7fb351bf06 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Purelace.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetSpellOrPermanent; + +/** + * + * @author AlumiuN + */ +public class Purelace extends CardImpl { + + public Purelace(UUID ownerId) { + super(ownerId, 217, "Purelace", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "2ED"; + + // Target spell or permanent becomes white. + this.getSpellAbility().addTarget(new TargetSpellOrPermanent()); + this.getSpellAbility().addEffect(new BecomesColorTargetEffect(ObjectColor.WHITE, Duration.Custom)); + } + + public Purelace(final Purelace card) { + super(card); + } + + @Override + public Purelace copy() { + return new Purelace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Sacrifice.java b/Mage.Sets/src/mage/sets/unlimitededition/Sacrifice.java new file mode 100644 index 00000000000..b62d1a7e564 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Sacrifice.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.effects.common.DynamicManaEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Sacrifice extends CardImpl { + + public Sacrifice(UUID ownerId) { + super(ownerId, 33, "Sacrifice", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "2ED"; + + // As an additional cost to cast Sacrifice, sacrifice a creature. + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + // Add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost. + this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.BlackMana, new SacrificeCostConvertedMana("creature"), + "add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost")); + } + + public Sacrifice(final Sacrifice card) { + super(card); + } + + @Override + public Sacrifice copy() { + return new Sacrifice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/ScavengingGhoul.java b/Mage.Sets/src/mage/sets/unlimitededition/ScavengingGhoul.java new file mode 100644 index 00000000000..b98e8feaee5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/ScavengingGhoul.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ScavengingGhoul extends mage.sets.limitedalpha.ScavengingGhoul { + + public ScavengingGhoul(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "2ED"; + } + + public ScavengingGhoul(final ScavengingGhoul card) { + super(card); + } + + @Override + public ScavengingGhoul copy() { + return new ScavengingGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/SunglassesOfUrza.java b/Mage.Sets/src/mage/sets/unlimitededition/SunglassesOfUrza.java new file mode 100644 index 00000000000..b0f22438e9a --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/SunglassesOfUrza.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class SunglassesOfUrza extends mage.sets.limitedalpha.SunglassesOfUrza { + + public SunglassesOfUrza(UUID ownerId) { + super(ownerId); + this.cardNumber = 272; + this.expansionSetCode = "2ED"; + } + + public SunglassesOfUrza(final SunglassesOfUrza card) { + super(card); + } + + @Override + public SunglassesOfUrza copy() { + return new SunglassesOfUrza(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Thoughtlace.java b/Mage.Sets/src/mage/sets/unlimitededition/Thoughtlace.java new file mode 100644 index 00000000000..e7fb6d39082 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Thoughtlace.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author AlumiuN + */ +public class Thoughtlace extends mage.sets.limitedbeta.Thoughtlace { + + public Thoughtlace(UUID ownerId) { + super(ownerId); + this.cardNumber = 83; + this.expansionSetCode = "2ED"; + } + + public Thoughtlace(final Thoughtlace card) { + super(card); + } + + @Override + public Thoughtlace copy() { + return new Thoughtlace(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/TwoHeadedGiantOfForiys.java b/Mage.Sets/src/mage/sets/unlimitededition/TwoHeadedGiantOfForiys.java new file mode 100644 index 00000000000..5ae29d3df23 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/TwoHeadedGiantOfForiys.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TwoHeadedGiantOfForiys extends mage.sets.masterseditioniv.TwoHeadedGiantOfForiys { + + public TwoHeadedGiantOfForiys(UUID ownerId) { + super(ownerId); + this.cardNumber = 180; + this.expansionSetCode = "2ED"; + this.rarity = Rarity.RARE; + } + + public TwoHeadedGiantOfForiys(final TwoHeadedGiantOfForiys card) { + super(card); + } + + @Override + public TwoHeadedGiantOfForiys copy() { + return new TwoHeadedGiantOfForiys(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java new file mode 100644 index 00000000000..8dd32a04b9e --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java @@ -0,0 +1,140 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetPermanent; +import mage.util.functions.ApplyToPermanent; + +/** + * + * @author jeffwadsworth + */ +public class VesuvanDoppelganger extends CardImpl { + + private static final String rule = "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains \"At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability.\""; + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId, 88, "Vesuvan Doppelganger", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "2ED"; + this.subtype.add("Shapeshifter"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // You may have Vesuvan Doppelganger enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability." + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new VesuvanDoppelgangerCopyEffect(), rule, true)); + this.addAbility(ability); + + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} + +class VesuvanDoppelgangerCopyEffect extends OneShotEffect { + + private static final String rule2 = "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability."; + + public VesuvanDoppelgangerCopyEffect() { + super(Outcome.Copy); + } + + public VesuvanDoppelgangerCopyEffect(final VesuvanDoppelgangerCopyEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + final Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (controller != null && sourcePermanent != null) { + Target target = new TargetPermanent(new FilterCreaturePermanent("target creature (you copy from)")); + target.setRequired(true); + if (source instanceof SimpleStaticAbility) { + target = new TargetPermanent(new FilterCreaturePermanent("creature (you copy from)")); + target.setRequired(false); + target.setNotTarget(true); + } + if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { + controller.choose(Outcome.Copy, target, source.getSourceId(), game); + Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget()); + if (copyFromPermanent != null) { + game.copyPermanent(copyFromPermanent, sourcePermanent.getId(), source, new ApplyToPermanent() { + @Override + public Boolean apply(Game game, Permanent permanent) { + permanent.getColor(game).setColor(sourcePermanent.getColor(game)); + permanent.getAbilities().add(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, + new VesuvanDoppelgangerCopyEffect(), TargetController.YOU, true, false, rule2)); + return true; + } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + mageObject.getColor(game).setColor(sourcePermanent.getColor(game)); + mageObject.getAbilities().add(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, + new VesuvanDoppelgangerCopyEffect(), TargetController.YOU, true, false, rule2)); + return true; + } + + }); + return true; + } + } + } + return false; + } + + @Override + public VesuvanDoppelgangerCopyEffect copy() { + return new VesuvanDoppelgangerCopyEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Wanderlust.java b/Mage.Sets/src/mage/sets/unlimitededition/Wanderlust.java new file mode 100644 index 00000000000..be640016ad2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Wanderlust.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends CardImpl { + + public Wanderlust(UUID ownerId) { + super(ownerId, 135, "Wanderlust", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "2ED"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted creature's controller, Wanderlust deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/WarpArtifact.java b/Mage.Sets/src/mage/sets/unlimitededition/WarpArtifact.java new file mode 100644 index 00000000000..0afbd74f63b --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "2ED"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/AcademyRector.java b/Mage.Sets/src/mage/sets/urzasdestiny/AcademyRector.java index 393033b9be8..502842da895 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/AcademyRector.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/AcademyRector.java @@ -106,7 +106,7 @@ class AcademyRectorEffect extends OneShotEffect { controller.searchLibrary(target, game); Card targetCard = game.getCard(target.getFirstTarget()); if (targetCard != null) { - controller.putOntoBattlefieldWithInfo(targetCard, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(targetCard, Zone.BATTLEFIELD, source, game); } controller.shuffleLibrary(game); return true; diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/BloodshotCyclops.java b/Mage.Sets/src/mage/sets/urzasdestiny/BloodshotCyclops.java index 1fa8d58f38f..b760233b1b6 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/BloodshotCyclops.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/BloodshotCyclops.java @@ -1,121 +1,77 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.urzasdestiny; - -import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.Cost; -import mage.abilities.costs.common.SacrificeTargetCost; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.common.TargetControlledCreaturePermanent; -import mage.target.common.TargetCreatureOrPlayer; - -/** - * - * @author Backfir3 - */ -public class BloodshotCyclops extends CardImpl { - - public BloodshotCyclops(UUID ownerId) { - super(ownerId, 77, "Bloodshot Cyclops", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}"); - this.expansionSetCode = "UDS"; - this.subtype.add("Cyclops"); - this.subtype.add("Giant"); - - this.power = new MageInt(4); - this.toughness = new MageInt(4); - - // {T}, Sacrifice a creature: Bloodshot Cyclops deals damage equal to the sacrificed - // creature's power to target creature or player. - SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BloodshotCyclopsEffect(), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - ability.addTarget(new TargetCreatureOrPlayer()); - this.addAbility(ability); - } - - public BloodshotCyclops(final BloodshotCyclops card) { - super(card); - } - - @Override - public BloodshotCyclops copy() { - return new BloodshotCyclops(this); - } -} - -class BloodshotCyclopsEffect extends OneShotEffect { - - public BloodshotCyclopsEffect() { - super(Outcome.Damage); - staticText = "{this} deals damage equal to the sacrificed creature's power to target creature or player"; - } - - public BloodshotCyclopsEffect(final BloodshotCyclopsEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - int amount = 0; - for (Cost cost : source.getCosts()) { - if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost) cost).getPermanents().size() > 0) { - amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue(); - break; - } - } - if (amount > 0) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.damage(amount, source.getSourceId(), game, false, true); - return true; - } - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.damage(amount, source.getSourceId(), game, false, true); - return true; - } - } - return false; - } - - @Override - public BloodshotCyclopsEffect copy() { - return new BloodshotCyclopsEffect(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author Backfir3 + */ +public class BloodshotCyclops extends CardImpl { + + public BloodshotCyclops(UUID ownerId) { + super(ownerId, 77, "Bloodshot Cyclops", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Cyclops"); + this.subtype.add("Giant"); + + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {T}, Sacrifice a creature: Bloodshot Cyclops deals damage equal to the sacrificed + // creature's power to target creature or player. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new DamageTargetEffect(new SacrificeCostCreaturesPower()), + new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public BloodshotCyclops(final BloodshotCyclops card) { + super(card); + } + + @Override + public BloodshotCyclops copy() { + return new BloodshotCyclops(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/CapashenStandard.java b/Mage.Sets/src/mage/sets/urzasdestiny/CapashenStandard.java new file mode 100644 index 00000000000..5e23a8041ca --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/CapashenStandard.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class CapashenStandard extends CardImpl { + + public CapashenStandard(UUID ownerId) { + super(ownerId, 4, "Capashen Standard", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); + // {2}, Sacrifice Capashen Standard: Draw a card. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{2}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public CapashenStandard(final CapashenStandard card) { + super(card); + } + + @Override + public CapashenStandard copy() { + return new CapashenStandard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/ColosYearling.java b/Mage.Sets/src/mage/sets/urzasdestiny/ColosYearling.java new file mode 100644 index 00000000000..790d390a4e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/ColosYearling.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.MountainwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class ColosYearling extends CardImpl { + + public ColosYearling(UUID ownerId) { + super(ownerId, 79, "Colos Yearling", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Goat"); + this.subtype.add("Beast"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Mountainwalk + this.addAbility(new MountainwalkAbility()); + + // {R}: Colos Yearling gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public ColosYearling(final ColosYearling card) { + super(card); + } + + @Override + public ColosYearling copy() { + return new ColosYearling(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/CovetousDragon.java b/Mage.Sets/src/mage/sets/urzasdestiny/CovetousDragon.java new file mode 100644 index 00000000000..03d130e3e28 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/CovetousDragon.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterArtifactPermanent; + +/** + * + * @author fireshoes + */ +public class CovetousDragon extends CardImpl { + + public CovetousDragon(UUID ownerId) { + super(ownerId, 80, "Covetous Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Dragon"); + this.power = new MageInt(6); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When you control no artifacts, sacrifice Covetous Dragon. + this.addAbility(new ControlsPermanentsControllerTriggeredAbility( + new FilterArtifactPermanent(), Filter.ComparisonType.Equal, 0, + new SacrificeSourceEffect())); + } + + public CovetousDragon(final CovetousDragon card) { + super(card); + } + + @Override + public CovetousDragon copy() { + return new CovetousDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/DiseaseCarriers.java b/Mage.Sets/src/mage/sets/urzasdestiny/DiseaseCarriers.java new file mode 100644 index 00000000000..e72bac6b43f --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/DiseaseCarriers.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DiseaseCarriers extends CardImpl { + + public DiseaseCarriers(UUID ownerId) { + super(ownerId, 57, "Disease Carriers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Rat"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Disease Carriers dies, target creature gets -2/-2 until end of turn. + Ability ability = new DiesTriggeredAbility(new BoostTargetEffect(-2, -2, Duration.EndOfTurn), false); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public DiseaseCarriers(final DiseaseCarriers card) { + super(card); + } + + @Override + public DiseaseCarriers copy() { + return new DiseaseCarriers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/DyingWail.java b/Mage.Sets/src/mage/sets/urzasdestiny/DyingWail.java new file mode 100644 index 00000000000..b3a9815c520 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/DyingWail.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.DiesAttachedTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.target.TargetPermanent; +import mage.target.TargetPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DyingWail extends CardImpl { + + public DyingWail(UUID ownerId) { + super(ownerId, 58, "Dying Wail", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // When enchanted creature dies, target player discards two cards. + ability = new DiesAttachedTriggeredAbility(new DiscardTargetEffect(2), "enchanted creature"); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public DyingWail(final DyingWail card) { + super(card); + } + + @Override + public DyingWail copy() { + return new DyingWail(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Encroach.java b/Mage.Sets/src/mage/sets/urzasdestiny/Encroach.java new file mode 100644 index 00000000000..08ea3ed41b1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Encroach.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.common.TargetOpponent; + +/** + * + * @author LoneFox + */ +public class Encroach extends CardImpl { + + private static final FilterCard filter = new FilterCard("a nonbasic land card"); + + static { + filter.add(Predicates.not(new SupertypePredicate("Basic"))); + filter.add(new CardTypePredicate(CardType.LAND)); + } + + public Encroach(UUID ownerId) { + super(ownerId, 59, "Encroach", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{B}"); + this.expansionSetCode = "UDS"; + + // Target player reveals his or her hand. You choose a nonbasic land card from it. That player discards that card. + this.getSpellAbility().addEffect(new DiscardCardYouChooseTargetEffect(filter)); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public Encroach(final Encroach card) { + super(card); + } + + @Override + public Encroach copy() { + return new Encroach(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/FieldSurgeon.java b/Mage.Sets/src/mage/sets/urzasdestiny/FieldSurgeon.java new file mode 100644 index 00000000000..bfc228d3424 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/FieldSurgeon.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FieldSurgeon extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("an untapped creature you control"); + + static { + filter.add(Predicates.not(new TappedPredicate())); + } + + public FieldSurgeon(UUID ownerId) { + super(ownerId, 8, "Field Surgeon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Tap an untapped creature you control: Prevent the next 1 damage that would be dealt to target creature this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), + new TapTargetCost(new TapTargetCost(new TargetControlledCreaturePermanent(filter)))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FieldSurgeon(final FieldSurgeon card) { + super(card); + } + + @Override + public FieldSurgeon copy() { + return new FieldSurgeon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/FlameJet.java b/Mage.Sets/src/mage/sets/urzasdestiny/FlameJet.java new file mode 100644 index 00000000000..617fb0ad9d7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/FlameJet.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author LoneFox + */ +public class FlameJet extends CardImpl { + + public FlameJet(UUID ownerId) { + super(ownerId, 81, "Flame Jet", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); + this.expansionSetCode = "UDS"; + + // Flame Jet deals 3 damage to target player. + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addTarget(new TargetPlayer()); + // Cycling {2} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); + } + + public FlameJet(final FlameJet card) { + super(card); + } + + @Override + public FlameJet copy() { + return new FlameJet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Gamekeeper.java b/Mage.Sets/src/mage/sets/urzasdestiny/Gamekeeper.java index 71b6e21e76b..060dd763312 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/Gamekeeper.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Gamekeeper.java @@ -77,8 +77,6 @@ public class Gamekeeper extends CardImpl { class GamekeeperEffect extends OneShotEffect { - - public GamekeeperEffect() { super(Outcome.Benefit); staticText = "reveal cards from the top of your library until you reveal a creature card. Put that card onto the battlefield and put all other cards revealed this way into your graveyard"; @@ -98,15 +96,13 @@ class GamekeeperEffect extends OneShotEffect { while (controller.getLibrary().size() > 0) { Card card = controller.getLibrary().removeFromTop(game); if (card.getCardType().contains(CardType.CREATURE)) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); break; } revealedCards.add(card); } - controller.revealCards("Gamekeeper", revealedCards, game); - for (Card card: revealedCards.getCards(game)) { - card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, true); - } + controller.revealCards(sourceObject.getIdName(), revealedCards, game); + controller.moveCards(revealedCards, Zone.GRAVEYARD, source, game); return true; } return false; @@ -116,4 +112,4 @@ class GamekeeperEffect extends OneShotEffect { public GamekeeperEffect copy() { return new GamekeeperEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/GoblinMasons.java b/Mage.Sets/src/mage/sets/urzasdestiny/GoblinMasons.java new file mode 100644 index 00000000000..eb2854b0393 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/GoblinMasons.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; + +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author BursegSardaukar + */ +public class GoblinMasons extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Wall"); + + static { + filter.add(new SubtypePredicate("Wall")); + } + + + public GoblinMasons(UUID ownerId) { + super(ownerId, 86, "Goblin Masons", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Goblin"); + + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + //When Goblin Masons dies, destroy target Wall + DiesTriggeredAbility ability = new DiesTriggeredAbility(new DestroyTargetEffect(), false); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + + } + + public GoblinMasons(final GoblinMasons card) { + super(card); + } + + @Override + public GoblinMasons copy() { + return new GoblinMasons(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/HulkingOgre.java b/Mage.Sets/src/mage/sets/urzasdestiny/HulkingOgre.java new file mode 100644 index 00000000000..ca75ebcb2c5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/HulkingOgre.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class HulkingOgre extends mage.sets.starter1999.HulkingOgre { + + public HulkingOgre(UUID ownerId) { + super(ownerId); + this.cardNumber = 87; + this.expansionSetCode = "UDS"; + this.rarity = Rarity.COMMON; + } + + public HulkingOgre(final HulkingOgre card) { + super(card); + } + + @Override + public HulkingOgre copy() { + return new HulkingOgre(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/IlluminatedWings.java b/Mage.Sets/src/mage/sets/urzasdestiny/IlluminatedWings.java new file mode 100644 index 00000000000..248051c64e8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/IlluminatedWings.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class IlluminatedWings extends CardImpl { + + public IlluminatedWings(UUID ownerId) { + super(ownerId, 34, "Illuminated Wings", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature has flying. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA))); + // {2}, Sacrifice Illuminated Wings: Draw a card. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{2}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public IlluminatedWings(final IlluminatedWings card) { + super(card); + } + + @Override + public IlluminatedWings copy() { + return new IlluminatedWings(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Kingfisher.java b/Mage.Sets/src/mage/sets/urzasdestiny/Kingfisher.java new file mode 100644 index 00000000000..8b8ca589828 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Kingfisher.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Kingfisher extends CardImpl { + + public Kingfisher(UUID ownerId) { + super(ownerId, 36, "Kingfisher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Kingfisher dies, draw a card. + this.addAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); + } + + public Kingfisher(final Kingfisher card) { + super(card); + } + + @Override + public Kingfisher copy() { + return new Kingfisher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Magnify.java b/Mage.Sets/src/mage/sets/urzasdestiny/Magnify.java new file mode 100644 index 00000000000..2a1171cca54 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Magnify.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Magnify extends CardImpl { + + public Magnify(UUID ownerId) { + super(ownerId, 111, "Magnify", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "UDS"; + + // All creatures get +1/+1 until end of turn. + this.getSpellAbility().addEffect(new BoostAllEffect(1, 1, Duration.EndOfTurn)); + } + + public Magnify(final Magnify card) { + super(card); + } + + @Override + public Magnify copy() { + return new Magnify(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/MarkOfFury.java b/Mage.Sets/src/mage/sets/urzasdestiny/MarkOfFury.java new file mode 100644 index 00000000000..1323172005d --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/MarkOfFury.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MarkOfFury extends CardImpl { + + public MarkOfFury(UUID ownerId) { + super(ownerId, 93, "Mark of Fury", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{R}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature has haste. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.AURA))); + // At the beginning of the end step, return Mark of Fury to its owner's hand. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new ReturnToHandSourceEffect(true), TargetController.YOU, false)); + } + + public MarkOfFury(final MarkOfFury card) { + super(card); + } + + @Override + public MarkOfFury copy() { + return new MarkOfFury(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/MarkerBeetles.java b/Mage.Sets/src/mage/sets/urzasdestiny/MarkerBeetles.java new file mode 100644 index 00000000000..bae7f803909 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/MarkerBeetles.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MarkerBeetles extends CardImpl { + + public MarkerBeetles(UUID ownerId) { + super(ownerId, 112, "Marker Beetles", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Insect"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // When Marker Beetles dies, target creature gets +1/+1 until end of turn. + Ability ability = new DiesTriggeredAbility(new BoostTargetEffect(1, 1, Duration.EndOfTurn), false); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + // {2}, Sacrifice Marker Beetles: Draw a card. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{2}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public MarkerBeetles(final MarkerBeetles card) { + super(card); + } + + @Override + public MarkerBeetles copy() { + return new MarkerBeetles(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/MentalDiscipline.java b/Mage.Sets/src/mage/sets/urzasdestiny/MentalDiscipline.java new file mode 100644 index 00000000000..d6cd85c3cb3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/MentalDiscipline.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class MentalDiscipline extends CardImpl { + + public MentalDiscipline(UUID ownerId) { + super(ownerId, 37, "Mental Discipline", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}"); + this.expansionSetCode = "UDS"; + + // {1}{U}, Discard a card: Draw a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{1}{U}")); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public MentalDiscipline(final MentalDiscipline card) { + super(card); + } + + @Override + public MentalDiscipline copy() { + return new MentalDiscipline(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Metalworker.java b/Mage.Sets/src/mage/sets/urzasdestiny/Metalworker.java index 14bb54ff872..a06535181fc 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/Metalworker.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Metalworker.java @@ -28,11 +28,8 @@ package mage.sets.urzasdestiny; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.MageInt; +import mage.MageObject; import mage.Mana; import mage.abilities.Ability; import mage.abilities.costs.common.TapSourceCost; @@ -41,6 +38,9 @@ import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.common.FilterArtifactCard; @@ -76,19 +76,15 @@ public class Metalworker extends CardImpl { } } - class MetalworkerManaEffect extends ManaEffect { - private static final FilterCard filter = new FilterArtifactCard(); - + public MetalworkerManaEffect() { super(); staticText = "Reveal any number of artifact cards in your hand. Add {2} to your mana pool for each card revealed this way"; } - - public MetalworkerManaEffect(final MetalworkerManaEffect effect) { super(effect); } @@ -100,35 +96,35 @@ class MetalworkerManaEffect extends ManaEffect { @Override public boolean apply(Game game, Ability source) { - - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller == null || sourceObject == null) { return false; } - Cards cards = new CardsImpl(); - if (player.getHand().count(filter, game) > 0) { + if (controller.getHand().count(filter, game) > 0) { TargetCardInHand target = new TargetCardInHand(0, Integer.MAX_VALUE, filter); - if (player.choose(Outcome.Benefit, target, source.getSourceId(), game)) { - for(UUID uuid : target.getTargets()){ - cards.add(player.getHand().get(uuid, game)); - } - player.revealCards("Revealed card", cards, game); - Mana mana = Mana.ColorlessMana(target.getTargets().size()*2); + if (controller.choose(Outcome.Benefit, target, source.getSourceId(), game)) { + Cards cards = new CardsImpl(target.getTargets()); + controller.revealCards(sourceObject.getIdName(), cards, game); + Mana mana = Mana.ColorlessMana(target.getTargets().size() * 2); checkToFirePossibleEvents(mana, game, source); - player.getManaPool().addMana(mana, game, source); - + controller.getManaPool().addMana(mana, game, source); } - } - - + } return true; } @Override public Mana getMana(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int artifactsHand = controller.getHand().count(filter, game); + if (artifactsHand > 0) { + return Mana.ColorlessMana(artifactsHand * 2); + } + } return null; } - } diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/MetathranSoldier.java b/Mage.Sets/src/mage/sets/urzasdestiny/MetathranSoldier.java new file mode 100644 index 00000000000..db7a06eac8b --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/MetathranSoldier.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.CantBeBlockedSourceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class MetathranSoldier extends CardImpl { + + public MetathranSoldier(UUID ownerId) { + super(ownerId, 39, "Metathran Soldier", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Metathran"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Metathran Soldier is unblockable. + this.addAbility(new CantBeBlockedSourceAbility()); + } + + public MetathranSoldier(final MetathranSoldier card) { + super(card); + } + + @Override + public MetathranSoldier copy() { + return new MetathranSoldier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java b/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java index 977547a474a..32b44a5f8ea 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java @@ -27,12 +27,18 @@ */ package mage.sets.urzasdestiny; +import java.util.EnumSet; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.Layer; import static mage.constants.Layer.PTChangingEffects_7; @@ -58,7 +64,6 @@ public class Opalescence extends CardImpl { super(ownerId, 13, "Opalescence", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); this.expansionSetCode = "UDS"; - // Each other non-Aura enchantment is a creature with power and toughness each equal to its converted mana cost. It's still an enchantment. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OpalescenceEffect())); @@ -72,19 +77,23 @@ public class Opalescence extends CardImpl { public Opalescence copy() { return new Opalescence(this); } + } class OpalescenceEffect extends ContinuousEffectImpl { private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("Each other non-Aura enchantment"); + private static final EnumSet checkDependencyTypes; + static { filter.add(Predicates.not(new SubtypePredicate("Aura"))); filter.add(new AnotherPredicate()); + checkDependencyTypes = EnumSet.of(DependencyType.AuraAddingRemoving, DependencyType.EnchantmentAddingRemoving); } - + public OpalescenceEffect() { super(Duration.WhileOnBattlefield, Outcome.BecomeCreature); - staticText = "Each other non-Aura enchantment is a creature with power and toughness each equal to its converted mana cost"; + staticText = "Each other non-Aura enchantment is a creature in addition to its other types and has base power and base toughness each equal to its converted mana cost"; } public OpalescenceEffect(final OpalescenceEffect effect) { @@ -125,10 +134,24 @@ class OpalescenceEffect extends ContinuousEffectImpl { return false; } - @Override public boolean hasLayer(Layer layer) { return layer == Layer.PTChangingEffects_7 || layer == Layer.TypeChangingEffects_4; } + @Override + public Set isDependentTo(List allEffectsInLayer) { + Set dependentTo = null; + for (ContinuousEffect effect : allEffectsInLayer) { + for (DependencyType dependencyType : effect.getDependencyTypes()) { + if (checkDependencyTypes.contains(dependencyType)) { + if (dependentTo == null) { + dependentTo = new HashSet<>(); + } + dependentTo.add(effect.getId()); + } + } + } + return dependentTo; + } } diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/PatternOfRebirth.java b/Mage.Sets/src/mage/sets/urzasdestiny/PatternOfRebirth.java index 017063b773e..038d5fda7dc 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/PatternOfRebirth.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/PatternOfRebirth.java @@ -32,12 +32,13 @@ import mage.abilities.Ability; import mage.abilities.common.DiesAttachedTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayTargetPlayerEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.SetTargetPointer; import mage.filter.common.FilterCreatureCard; import mage.target.TargetPermanent; import mage.target.common.TargetCardInLibrary; @@ -54,7 +55,6 @@ public class PatternOfRebirth extends CardImpl { this.expansionSetCode = "UDS"; this.subtype.add("Aura"); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -63,9 +63,9 @@ public class PatternOfRebirth extends CardImpl { this.addAbility(ability); // When enchanted creature dies, that creature's controller may search his or her library for a creature card and put that card onto the battlefield. If that player does, he or she shuffles his or her library. - Effect effect = new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterCreatureCard()), false, true, Outcome.PutCreatureInPlay); + Effect effect = new SearchLibraryPutInPlayTargetPlayerEffect(new TargetCardInLibrary(new FilterCreatureCard()), false, true, Outcome.PutCreatureInPlay); effect.setText("that creature's controller may search his or her library for a creature card and put that card onto the battlefield. If that player does, he or she shuffles his or her library"); - this.addAbility(new DiesAttachedTriggeredAbility(effect, "enchanted creature", true, true)); + this.addAbility(new DiesAttachedTriggeredAbility(effect, "enchanted creature", true, true, SetTargetPointer.ATTACHED_TO_CONTROLLER)); } diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianMonitor.java b/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianMonitor.java new file mode 100644 index 00000000000..c025a391e60 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianMonitor.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class PhyrexianMonitor extends CardImpl { + + public PhyrexianMonitor(UUID ownerId) { + super(ownerId, 64, "Phyrexian Monitor", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Skeleton"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {B}: Regenerate Phyrexian Monitor. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); + } + + public PhyrexianMonitor(final PhyrexianMonitor card) { + super(card); + } + + @Override + public PhyrexianMonitor copy() { + return new PhyrexianMonitor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/PlagueDogs.java b/Mage.Sets/src/mage/sets/urzasdestiny/PlagueDogs.java new file mode 100644 index 00000000000..533484e968e --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/PlagueDogs.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class PlagueDogs extends CardImpl { + + public PlagueDogs(UUID ownerId) { + super(ownerId, 66, "Plague Dogs", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Zombie"); + this.subtype.add("Hound"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Plague Dogs dies, all creatures get -1/-1 until end of turn. + this.addAbility(new DiesTriggeredAbility(new BoostAllEffect(-1, -1, Duration.EndOfTurn), false)); + // {2}, Sacrifice Plague Dogs: Draw a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{2}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public PlagueDogs(final PlagueDogs card) { + super(card); + } + + @Override + public PlagueDogs copy() { + return new PlagueDogs(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/RapidDecay.java b/Mage.Sets/src/mage/sets/urzasdestiny/RapidDecay.java new file mode 100644 index 00000000000..09775f15d30 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/RapidDecay.java @@ -0,0 +1,98 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.target.common.TargetCardInASingleGraveyard; + +/** + * + * @author fireshoes + */ +public class RapidDecay extends CardImpl { + + public RapidDecay(UUID ownerId) { + super(ownerId, 67, "Rapid Decay", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{B}"); + this.expansionSetCode = "UDS"; + + // Exile up to three target cards from a single graveyard. + this.getSpellAbility().addEffect(new RapidDecayExileEffect()); + this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("up to three target cards from a single graveyard"))); + + // Cycling {2} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); + } + + public RapidDecay(final RapidDecay card) { + super(card); + } + + @Override + public RapidDecay copy() { + return new RapidDecay(this); + } +} + +class RapidDecayExileEffect extends OneShotEffect { + + public RapidDecayExileEffect() { + super(Outcome.Exile); + this.staticText = "Exile up to three target cards from a single graveyard"; + } + + public RapidDecayExileEffect(final RapidDecayExileEffect effect) { + super(effect); + } + + @Override + public RapidDecayExileEffect copy() { + return new RapidDecayExileEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (UUID targetID : source.getTargets().get(0).getTargets()) { + Card card = game.getCard(targetID); + if (card != null) { + card.moveToExile(null, "", source.getSourceId(), game); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/ReliquaryMonk.java b/Mage.Sets/src/mage/sets/urzasdestiny/ReliquaryMonk.java new file mode 100644 index 00000000000..dd5ebf7730d --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/ReliquaryMonk.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterArtifactOrEnchantmentPermanent; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class ReliquaryMonk extends CardImpl { + + public ReliquaryMonk(UUID ownerId) { + super(ownerId, 14, "Reliquary Monk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Human"); + this.subtype.add("Monk"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Reliquary Monk dies, destroy target artifact or enchantment. + Ability ability = new DiesTriggeredAbility(new DestroyTargetEffect(), false); + ability.addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent())); + this.addAbility(ability); + } + + public ReliquaryMonk(final ReliquaryMonk card) { + super(card); + } + + @Override + public ReliquaryMonk copy() { + return new ReliquaryMonk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Replenish.java b/Mage.Sets/src/mage/sets/urzasdestiny/Replenish.java index ec46d722ec8..217f77fb07c 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/Replenish.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Replenish.java @@ -27,17 +27,15 @@ */ package mage.sets.urzasdestiny; -import java.util.ArrayList; -import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; +import mage.filter.common.FilterEnchantmentCard; import mage.game.Game; import mage.players.Player; @@ -51,7 +49,6 @@ public class Replenish extends CardImpl { super(ownerId, 15, "Replenish", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{W}"); this.expansionSetCode = "UDS"; - // Return all enchantment cards from your graveyard to the battlefield. this.getSpellAbility().addEffect(new ReplenishEffect()); } @@ -67,36 +64,27 @@ public class Replenish extends CardImpl { } class ReplenishEffect extends OneShotEffect { - + ReplenishEffect() { super(Outcome.PutCardInPlay); this.staticText = "Return all enchantment cards from your graveyard to the battlefield"; } - + ReplenishEffect(final ReplenishEffect effect) { super(effect); } - + @Override public ReplenishEffect copy() { return new ReplenishEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - List cards = new ArrayList<>(0); - for (UUID cardId : player.getGraveyard()) { - Card card = game.getCard(cardId); - if (card != null && card.getCardType().contains(CardType.ENCHANTMENT)) { - cards.add(card); - } - } - for (Card card : cards) { - player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); - } - return true; + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + return controller.moveCards(controller.getGraveyard().getCards(new FilterEnchantmentCard(), source.getSourceId(), + source.getControllerId(), game), Zone.BATTLEFIELD, source, game); } return false; } diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Rescue.java b/Mage.Sets/src/mage/sets/urzasdestiny/Rescue.java new file mode 100644 index 00000000000..dfa985e378d --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Rescue.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class Rescue extends CardImpl { + + public Rescue(UUID ownerId) { + super(ownerId, 44, "Rescue", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "UDS"; + + // Return target permanent you control to its owner's hand. + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetControlledPermanent()); + } + + public Rescue(final Rescue card) { + super(card); + } + + @Override + public Rescue copy() { + return new Rescue(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/SigilOfSleep.java b/Mage.Sets/src/mage/sets/urzasdestiny/SigilOfSleep.java index 8594f497f6e..7db5c8d1b99 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/SigilOfSleep.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/SigilOfSleep.java @@ -52,6 +52,8 @@ import mage.target.targetpointer.FirstTargetPointer; */ public class SigilOfSleep extends CardImpl { + private final UUID originalId; + public SigilOfSleep(UUID ownerId) { super(ownerId, 46, "Sigil of Sleep", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}"); this.expansionSetCode = "UDS"; @@ -67,13 +69,14 @@ public class SigilOfSleep extends CardImpl { Effect effect = new ReturnToHandTargetEffect(); effect.setText("return target creature that player controls to its owner's hand"); ability = new DealsDamageToAPlayerAttachedTriggeredAbility(effect, "enchanted", false, true, false); + originalId = ability.getOriginalId(); this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof DealsDamageToAPlayerAttachedTriggeredAbility) { + if (ability.getOriginalId().equals(originalId)) { UUID playerId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability); if (playerId != null) { FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that player controls"); @@ -89,6 +92,7 @@ public class SigilOfSleep extends CardImpl { public SigilOfSleep(final SigilOfSleep card) { super(card); + this.originalId = card.originalId; } @Override diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/SkitteringHorror.java b/Mage.Sets/src/mage/sets/urzasdestiny/SkitteringHorror.java new file mode 100644 index 00000000000..690ba9a05e4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/SkitteringHorror.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author nigelzor + */ +public class SkitteringHorror extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a creature spell"); + + static { + filter.add(new CardTypePredicate(CardType.CREATURE)); + } + + public SkitteringHorror(UUID ownerId) { + super(ownerId, 70, "Skittering Horror", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Horror"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // When you cast a creature spell, sacrifice Skittering Horror. + this.addAbility(new SpellCastControllerTriggeredAbility(new SacrificeSourceEffect(), filter, false)); + } + + public SkitteringHorror(final SkitteringHorror card) { + super(card); + } + + @Override + public SkitteringHorror copy() { + return new SkitteringHorror(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/SlinkingSkirge.java b/Mage.Sets/src/mage/sets/urzasdestiny/SlinkingSkirge.java new file mode 100644 index 00000000000..2c47c409286 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/SlinkingSkirge.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class SlinkingSkirge extends CardImpl { + + public SlinkingSkirge(UUID ownerId) { + super(ownerId, 71, "Slinking Skirge", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Imp"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {2}, Sacrifice Slinking Skirge: Draw a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{2}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public SlinkingSkirge(final SlinkingSkirge card) { + super(card); + } + + @Override + public SlinkingSkirge copy() { + return new SlinkingSkirge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/TetheredGriffin.java b/Mage.Sets/src/mage/sets/urzasdestiny/TetheredGriffin.java new file mode 100644 index 00000000000..85da8fd853b --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/TetheredGriffin.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterEnchantmentPermanent; + +/** + * + * @author fireshoes + */ +public class TetheredGriffin extends CardImpl { + + public TetheredGriffin(UUID ownerId) { + super(ownerId, 21, "Tethered Griffin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Griffin"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When you control no enchantments, sacrifice Tethered Griffin. + this.addAbility(new ControlsPermanentsControllerTriggeredAbility( + new FilterEnchantmentPermanent(), Filter.ComparisonType.Equal, 0, + new SacrificeSourceEffect())); + } + + public TetheredGriffin(final TetheredGriffin card) { + super(card); + } + + @Override + public TetheredGriffin copy() { + return new TetheredGriffin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/UrzasIncubator.java b/Mage.Sets/src/mage/sets/urzasdestiny/UrzasIncubator.java new file mode 100644 index 00000000000..e91445dce38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/UrzasIncubator.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.ChooseCreatureTypeEffect; +import mage.abilities.effects.common.cost.SpellsCostReductionAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.ChosenSubtypePredicate; + +/** + * + * @author LoneFox + */ +public class UrzasIncubator extends CardImpl { + + public UrzasIncubator(UUID ownerId) { + super(ownerId, 142, "Urza's Incubator", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "UDS"; + + // As Urza's Incubator enters the battlefield, choose a creature type. + this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.BoostCreature))); + // Creature spells of the chosen type cost {2} less to cast. + FilterCreatureCard filter = new FilterCreatureCard("creature spells of the chosen type"); + filter.add(new ChosenSubtypePredicate(this.getId())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionAllEffect(filter, 2))); + } + + public UrzasIncubator(final UrzasIncubator card) { + super(card); + } + + @Override + public UrzasIncubator copy() { + return new UrzasIncubator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/VoiceOfDuty.java b/Mage.Sets/src/mage/sets/urzasdestiny/VoiceOfDuty.java new file mode 100644 index 00000000000..125c9a9d5c2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/VoiceOfDuty.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; +/** + * + * @author LoneFox + */ +public class VoiceOfDuty extends CardImpl { + + private static final FilterCard filter = new FilterCard("green"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public VoiceOfDuty(UUID ownerId) { + super(ownerId, 23, "Voice of Duty", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Angel"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // protection from green + this.addAbility(new ProtectionAbility(filter)); + } + + public VoiceOfDuty(final VoiceOfDuty card) { + super(card); + } + + @Override + public VoiceOfDuty copy() { + return new VoiceOfDuty(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/VoiceOfReason.java b/Mage.Sets/src/mage/sets/urzasdestiny/VoiceOfReason.java new file mode 100644 index 00000000000..30a7390a5bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/VoiceOfReason.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class VoiceOfReason extends CardImpl { + + private static final FilterCard filter = new FilterCard("blue"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public VoiceOfReason(UUID ownerId) { + super(ownerId, 24, "Voice of Reason", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Angel"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // protection from blue + this.addAbility(new ProtectionAbility(filter)); + } + + public VoiceOfReason(final VoiceOfReason card) { + super(card); + } + + @Override + public VoiceOfReason copy() { + return new VoiceOfReason(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/AngelsTrumpet.java b/Mage.Sets/src/mage/sets/urzaslegacy/AngelsTrumpet.java new file mode 100644 index 00000000000..0ae0bd87bcd --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/AngelsTrumpet.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzaslegacy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.watchers.common.AttackedThisTurnWatcher; + +/** + * + * @author fireshoes + */ +public class AngelsTrumpet extends CardImpl { + + public AngelsTrumpet(UUID ownerId) { + super(ownerId, 121, "Angel's Trumpet", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "ULG"; + + // All creatures have vigilance. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); + + // At the beginning of each player's end step, tap all untapped creatures that player controls that didn't attack this turn. Angel's Trumpet deals damage to the player equal to the number of creatures tapped this way. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new AngelsTrumpetTapEffect(), TargetController.ANY, false), new AttackedThisTurnWatcher()); + } + + public AngelsTrumpet(final AngelsTrumpet card) { + super(card); + } + + @Override + public AngelsTrumpet copy() { + return new AngelsTrumpet(this); + } +} + +class AngelsTrumpetTapEffect extends OneShotEffect { + + AngelsTrumpetTapEffect() { + super(Outcome.Tap); + this.staticText = "tap all untapped creatures that player controls that didn't attack this turn. Angel's Trumpet deals damage to the player equal to the number of creatures tapped this way"; + } + + AngelsTrumpetTapEffect(final AngelsTrumpetTapEffect effect) { + super(effect); + } + + @Override + public AngelsTrumpetTapEffect copy() { + return new AngelsTrumpetTapEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(game.getActivePlayerId()); + int count = 0; + if (player != null) { + for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { + // Untapped creatures are safe. + if (creature.isTapped()) { + continue; + } + // Creatures that attacked are safe. + AttackedThisTurnWatcher watcher = (AttackedThisTurnWatcher) game.getState().getWatchers().get("AttackedThisTurn"); + if (watcher != null && watcher.getAttackedThisTurnCreatures().contains(creature.getId())) { + continue; + } + // Tap the rest. + creature.tap(game); + count++; + } + if (count > 0) { + player.damage(count, source.getSourceId(), game, false, true); + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/GoblinMedics.java b/Mage.Sets/src/mage/sets/urzaslegacy/GoblinMedics.java index 94df69ca9ab..0f51156ce52 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/GoblinMedics.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/GoblinMedics.java @@ -32,7 +32,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.BecomesTappedTriggeredAbility; +import mage.abilities.common.BecomesTappedSourceTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.target.common.TargetCreatureOrPlayer; @@ -53,7 +53,7 @@ public class GoblinMedics extends CardImpl { this.toughness = new MageInt(1); // Whenever Goblin Medics becomes tapped, it deals 1 damage to target creature or player. - Ability ability = new BecomesTappedTriggeredAbility(new DamageTargetEffect(1)); + Ability ability = new BecomesTappedSourceTriggeredAbility(new DamageTargetEffect(1)); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/GoblinWelder.java b/Mage.Sets/src/mage/sets/urzaslegacy/GoblinWelder.java index d9ccd3e001c..a34a97f95e3 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/GoblinWelder.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/GoblinWelder.java @@ -30,7 +30,6 @@ package mage.sets.urzaslegacy; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.Mode; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; @@ -78,7 +77,6 @@ public class GoblinWelder extends CardImpl { public GoblinWelder copy() { return new GoblinWelder(this); } - public class GoblinWelderEffect extends OneShotEffect { @@ -87,7 +85,6 @@ public class GoblinWelder extends CardImpl { staticText = "Choose target artifact a player controls and target artifact card in that player's graveyard. If both targets are still legal as this ability resolves, that player simultaneously sacrifices the artifact and returns the artifact card to the battlefield"; } - public GoblinWelderEffect(final GoblinWelderEffect effect) { super(effect); } @@ -106,7 +103,7 @@ public class GoblinWelder extends CardImpl { && currentZone == Zone.GRAVEYARD && card.getOwnerId().equals(artifact.getControllerId())) { boolean sacrifice = artifact.sacrifice(source.getSourceId(), game); - boolean putOnBF = owner.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + boolean putOnBF = owner.moveCards(card, Zone.BATTLEFIELD, source, game); if (sacrifice || putOnBF) { return true; } @@ -121,7 +118,7 @@ public class GoblinWelder extends CardImpl { } } - + class GoblinWelderTarget extends TargetCardInGraveyard { public GoblinWelderTarget() { @@ -146,7 +143,6 @@ public class GoblinWelder extends CardImpl { } return false; } - @Override public GoblinWelderTarget copy() { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/Intervene.java b/Mage.Sets/src/mage/sets/urzaslegacy/Intervene.java index 2713856744f..aa35fd116bd 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/Intervene.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/Intervene.java @@ -27,24 +27,15 @@ */ package mage.sets.urzaslegacy; -import java.util.HashSet; -import java.util.Set; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.abilities.Ability; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; -import mage.constants.Zone; -import mage.filter.Filter; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.FilterSpell; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.stack.Spell; -import mage.game.stack.StackObject; -import mage.target.Target; -import mage.target.TargetObject; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.other.TargetsPermanentPredicate; +import mage.target.TargetSpell; /** * @@ -52,13 +43,19 @@ import mage.target.TargetObject; */ public class Intervene extends CardImpl { + private final static FilterSpell filter = new FilterSpell("spell that targets a creature"); + + static { + filter.add(new TargetsPermanentPredicate(new FilterCreaturePermanent())); + } + public Intervene(UUID ownerId) { super(ownerId, 33, "Intervene", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); this.expansionSetCode = "ULG"; // Counter target spell that targets a creature. - this.getSpellAbility().addTarget(new InterveneTargetSpell()); + this.getSpellAbility().addTarget(new TargetSpell(filter)); this.getSpellAbility().addEffect(new CounterTargetEffect()); } @@ -70,93 +67,4 @@ public class Intervene extends CardImpl { public Intervene copy() { return new Intervene(this); } - - private class InterveneTargetSpell extends TargetObject { - - - public InterveneTargetSpell() { - super(1, Zone.STACK); - this.targetName = "spell that targets a creature"; - } - - public InterveneTargetSpell(final InterveneTargetSpell target) { - super(target); - } - - @Override - public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - return canChoose(sourceControllerId, game); - } - - @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - return possibleTargets(sourceControllerId, game); - } - - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - if (super.canTarget(id, source, game)) { - if (targetsCreature(id, game)) { - return true; - } - } - return false; - } - - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { - for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell) { - if (targetsCreature(stackObject.getId(), game)) { - return true; - } - } - } - return false; - } - - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { - Set possibleTargets = new HashSet(); - for (StackObject stackObject : game.getStack()) { - if (stackObject instanceof Spell) { - if (targetsCreature(stackObject.getId(), game)) { - possibleTargets.add(stackObject.getId()); - } - } - } - return possibleTargets; - } - - - private boolean targetsCreature(UUID id, Game game) { - StackObject spell = game.getStack().getStackObject(id); - if (spell != null) { - Ability ability = spell.getStackAbility(); - if (ability != null && !ability.getTargets().isEmpty()) { - for (Target target : ability.getTargets()) { - for (UUID targetId : target.getTargets()) { - Permanent permanent = game.getPermanent(targetId); - if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { - return true; - } - } - } - } - } - return false; - } - - @Override - public InterveneTargetSpell copy() { - return new InterveneTargetSpell(this); - } - - @Override - public Filter getFilter() { - return new FilterSpell(); - } - } } - - diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/JhoirasToolbox.java b/Mage.Sets/src/mage/sets/urzaslegacy/JhoirasToolbox.java index 667af6cd463..d3db8d8c98b 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/JhoirasToolbox.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/JhoirasToolbox.java @@ -28,15 +28,14 @@ package mage.sets.urzaslegacy; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.RegenerateTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -48,10 +47,10 @@ import mage.target.common.TargetCreaturePermanent; */ public class JhoirasToolbox extends CardImpl { - private static final FilterCreaturePermanent filer = new FilterCreaturePermanent("artifact creature"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature"); static { - filer.add(new CardTypePredicate(CardType.ARTIFACT)); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public JhoirasToolbox(UUID ownerId) { @@ -64,7 +63,8 @@ public class JhoirasToolbox extends CardImpl { // {2}: Regenerate target artifact creature. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{2}")); - ability.addTarget(new TargetCreaturePermanent(filer)); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); } public JhoirasToolbox(final JhoirasToolbox card) { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/LastDitchEffort.java b/Mage.Sets/src/mage/sets/urzaslegacy/LastDitchEffort.java new file mode 100644 index 00000000000..cba7cd00b53 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/LastDitchEffort.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzaslegacy; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author BursegSardaukar + */ +public class LastDitchEffort extends CardImpl { + + public LastDitchEffort(UUID ownerId) { + super(ownerId, 83, "Last-Ditch Effort", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "ULG"; + + // Sacrifice any number of creatures. Last-Ditch Effort deals that much damage to target creature or player. + this.getSpellAbility().addEffect(new LastDitchEffortEffect()); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public LastDitchEffort(final LastDitchEffort card) { + super(card); + } + + @Override + public LastDitchEffort copy() { + return new LastDitchEffort(this); + } +} + +class LastDitchEffortEffect extends OneShotEffect { + + LastDitchEffortEffect() { + super(Outcome.Damage); + this.staticText = "Sacrifice any number of creatures. {this} deals that much damage to target creature or player"; + } + + LastDitchEffortEffect(final LastDitchEffortEffect effect) { + super(effect); + } + + @Override + public LastDitchEffortEffect copy() { + return new LastDitchEffortEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + Target target = new TargetControlledCreaturePermanent(0, Integer.MAX_VALUE, new FilterControlledCreaturePermanent(), true); + player.chooseTarget(Outcome.Sacrifice, target, source, game); + int numSacrificed = 0; + for (UUID permanentId : target.getTargets()) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null) { + if (permanent.sacrifice(source.getSourceId(), game)) { + numSacrificed++; + } + } + } + if (numSacrificed > 0) { + int damage = numSacrificed; + UUID uuid = this.getTargetPointer().getFirst(game, source); + Permanent permanent = game.getPermanent(uuid); + Player opponent = game.getPlayer(uuid); + if (permanent != null) { + permanent.damage(damage, source.getSourceId(), game, false, true); + } + if (opponent != null) { + opponent.damage(damage, source.getSourceId(), game, false, true); + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/TickingGnomes.java b/Mage.Sets/src/mage/sets/urzaslegacy/TickingGnomes.java index e9956161084..c4458d3f390 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/TickingGnomes.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/TickingGnomes.java @@ -28,9 +28,6 @@ package mage.sets.urzaslegacy; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -38,6 +35,8 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.EchoAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.target.common.TargetCreatureOrPlayer; @@ -60,6 +59,7 @@ public class TickingGnomes extends CardImpl { // Sacrifice Ticking Gnomes: Ticking Gnomes deals 1 damage to target creature or player. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new SacrificeSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); } public TickingGnomes(final TickingGnomes card) { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/ViashinoSandscout.java b/Mage.Sets/src/mage/sets/urzaslegacy/ViashinoSandscout.java index 3bd1fc5154f..113d371f981 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/ViashinoSandscout.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/ViashinoSandscout.java @@ -28,13 +28,14 @@ package mage.sets.urzaslegacy; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; -import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; /** * @@ -54,7 +55,7 @@ public class ViashinoSandscout extends CardImpl { // Haste this.addAbility(HasteAbility.getInstance()); // At the beginning of the end step, return Viashino Sandscout to its owner's hand. - this.addAbility(new BeginningOfYourEndStepTriggeredAbility(new ReturnToHandSourceEffect(true), false)); + this.addAbility(new BeginningOfEndStepTriggeredAbility(new ReturnToHandSourceEffect(true), TargetController.ANY, false)); } public ViashinoSandscout(final ViashinoSandscout card) { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/WeatherseedElf.java b/Mage.Sets/src/mage/sets/urzaslegacy/WeatherseedElf.java index 25985872da0..99727c6a186 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/WeatherseedElf.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/WeatherseedElf.java @@ -28,10 +28,6 @@ package mage.sets.urzaslegacy; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,6 +35,10 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.ForestwalkAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.common.TargetCreaturePermanent; /** @@ -57,7 +57,7 @@ public class WeatherseedElf extends CardImpl { // {tap}: Target creature gains forestwalk until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new GainAbilityTargetEffect(new ForestwalkAbility(), Duration.EndOfTurn), + new GainAbilityTargetEffect(new ForestwalkAbility(false), Duration.EndOfTurn), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/urzassaga/CacklingFiend.java b/Mage.Sets/src/mage/sets/urzassaga/CacklingFiend.java index 66f4639b0bc..ec7a3b1cdeb 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/CacklingFiend.java +++ b/Mage.Sets/src/mage/sets/urzassaga/CacklingFiend.java @@ -29,19 +29,13 @@ package mage.sets.urzassaga; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.TargetController; -import mage.game.Game; -import mage.players.Player; /** * @@ -57,7 +51,7 @@ public class CacklingFiend extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); + // When Cackling Fiend enters the battlefield, each opponent discards a card. this.addAbility(new EntersBattlefieldTriggeredAbility(new DiscardEachPlayerEffect(TargetController.OPPONENT), false)); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/CarrionBeetles.java b/Mage.Sets/src/mage/sets/urzassaga/CarrionBeetles.java new file mode 100644 index 00000000000..20ed6bab867 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/CarrionBeetles.java @@ -0,0 +1,103 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.target.common.TargetCardInASingleGraveyard; + +/** + * + * @author fireshoes + */ +public class CarrionBeetles extends CardImpl { + + public CarrionBeetles(UUID ownerId) { + super(ownerId, 122, "Carrion Beetles", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "USG"; + this.subtype.add("Insect"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {2}{B}, {tap}: Exile up to three target cards from a single graveyard. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CarrionBeetlesExileEffect(), new ManaCostsImpl("{2}{B}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("up to three target cards from a single graveyard"))); + this.addAbility(ability); + } + + public CarrionBeetles(final CarrionBeetles card) { + super(card); + } + + @Override + public CarrionBeetles copy() { + return new CarrionBeetles(this); + } +} + +class CarrionBeetlesExileEffect extends OneShotEffect { + + public CarrionBeetlesExileEffect() { + super(Outcome.Exile); + this.staticText = "Exile up to three target cards from a single graveyard"; + } + + public CarrionBeetlesExileEffect(final CarrionBeetlesExileEffect effect) { + super(effect); + } + + @Override + public CarrionBeetlesExileEffect copy() { + return new CarrionBeetlesExileEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (UUID targetID : source.getTargets().get(0).getTargets()) { + Card card = game.getCard(targetID); + if (card != null) { + card.moveToExile(null, "", source.getSourceId(), game); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/CopperGnomes.java b/Mage.Sets/src/mage/sets/urzassaga/CopperGnomes.java index 2971de2eda7..145b521c5cb 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/CopperGnomes.java +++ b/Mage.Sets/src/mage/sets/urzassaga/CopperGnomes.java @@ -94,19 +94,18 @@ class PutArtifactOnBattlefieldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null || !player.chooseUse(Outcome.PutCardInPlay, choiceText, source, game)) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null || !controller.chooseUse(Outcome.PutCardInPlay, choiceText, source, game)) { return false; } TargetCardInHand target = new TargetCardInHand(new FilterArtifactCard()); - if (player.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) { + if (controller.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); - return true; + return controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Crosswinds.java b/Mage.Sets/src/mage/sets/urzassaga/Crosswinds.java new file mode 100644 index 00000000000..73aaa540fba --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Crosswinds.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author hanasu + */ +public class Crosswinds extends CardImpl { + + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Creatures with flying"); + + static { + filter1.add(new AbilityPredicate(FlyingAbility.class)); + } + + public Crosswinds(UUID ownerId) { + super(ownerId, 246, "Crosswinds", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + this.expansionSetCode = "USG"; + + // Creatures with flying get -2/-0. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(-2, 0, Duration.WhileOnBattlefield, filter1, false))); + } + + public Crosswinds(final Crosswinds card) { + super(card); + } + + @Override + public Crosswinds copy() { + return new Crosswinds(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/CrystalChimes.java b/Mage.Sets/src/mage/sets/urzassaga/CrystalChimes.java new file mode 100644 index 00000000000..7f465439940 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/CrystalChimes.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CrystalChimes extends mage.sets.commander2015.CrystalChimes { + + public CrystalChimes(UUID ownerId) { + super(ownerId); + this.cardNumber = 292; + this.expansionSetCode = "USG"; + } + + public CrystalChimes(final CrystalChimes card) { + super(card); + } + + @Override + public CrystalChimes copy() { + return new CrystalChimes(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Despondency.java b/Mage.Sets/src/mage/sets/urzassaga/Despondency.java new file mode 100644 index 00000000000..603c895cee1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Despondency.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author hanasu + */ +public class Despondency extends CardImpl { + + public Despondency(UUID ownerId) { + super(ownerId, 129, "Despondency", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "USG"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets -2/-0. + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(-2, 0)); + this.addAbility(ability); + + // When Despondency is put into a graveyard from the battlefield, return Despondency to its owner's hand. + this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new ReturnToHandSourceEffect())); + } + + public Despondency(final Despondency card) { + super(card); + } + + @Override + public Despondency copy() { + return new Despondency(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfGrace.java b/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfGrace.java index b271ba24413..e34548dbd8b 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfGrace.java +++ b/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfGrace.java @@ -53,7 +53,7 @@ public class DiscipleOfGrace extends CardImpl { } public DiscipleOfGrace(UUID ownerId) { - super(ownerId, 10, "Disciple Of Grace", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + super(ownerId, 10, "Disciple of Grace", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.expansionSetCode = "USG"; this.subtype.add("Human"); this.subtype.add("Cleric"); diff --git a/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfLaw.java b/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfLaw.java index 8edffd89acc..b639fb3aaf9 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfLaw.java +++ b/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfLaw.java @@ -53,7 +53,7 @@ public class DiscipleOfLaw extends CardImpl { } public DiscipleOfLaw(UUID ownerId) { - super(ownerId, 11, "Disciple Of Law", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + super(ownerId, 11, "Disciple of Law", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.expansionSetCode = "USG"; this.subtype.add("Human"); this.subtype.add("Cleric"); diff --git a/Mage.Sets/src/mage/sets/urzassaga/Douse.java b/Mage.Sets/src/mage/sets/urzassaga/Douse.java new file mode 100644 index 00000000000..95aad42e904 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Douse.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.ObjectColor; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.TargetSpell; + +/** + * + * @author anonymous + */ +public class Douse extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("red spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public Douse(UUID ownerId) { + super(ownerId, 70, "Douse", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "USG"; + + // {1}{U}: Counter target red spell. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{1}{U}")); + ability.addTarget(new TargetSpell(filter)); + this.addAbility(ability); + } + + public Douse(final Douse card) { + super(card); + } + + @Override + public Douse copy() { + return new Douse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/ElvishHerder.java b/Mage.Sets/src/mage/sets/urzassaga/ElvishHerder.java new file mode 100644 index 00000000000..5733f999c64 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/ElvishHerder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ElvishHerder extends CardImpl { + + public ElvishHerder(UUID ownerId) { + super(ownerId, 247, "Elvish Herder", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "USG"; + this.subtype.add("Elf"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {G}: Target creature gains trample until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect( + TrampleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{G}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public ElvishHerder(final ElvishHerder card) { + super(card); + } + + @Override + public ElvishHerder copy() { + return new ElvishHerder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Endoskeleton.java b/Mage.Sets/src/mage/sets/urzassaga/Endoskeleton.java new file mode 100644 index 00000000000..59e3240ae18 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Endoskeleton.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Endoskeleton extends CardImpl { + + public Endoskeleton(UUID ownerId) { + super(ownerId, 294, "Endoskeleton", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "USG"; + + // You may choose not to untap Endoskeleton during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {2}, {tap}: Target creature gets +0/+3 for as long as Endoskeleton remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostTargetEffect(0, 3, Duration.Custom), SourceTappedCondition.getInstance(), + "target creature gets +0/+3 for as long as {this} remains tapped"), new ManaCostsImpl("{2}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public Endoskeleton(final Endoskeleton card) { + super(card); + } + + @Override + public Endoskeleton copy() { + return new Endoskeleton(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Exhume.java b/Mage.Sets/src/mage/sets/urzassaga/Exhume.java index 4b853980dd8..6350318c19f 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Exhume.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Exhume.java @@ -52,7 +52,6 @@ public class Exhume extends CardImpl { super(ownerId, 134, "Exhume", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{B}"); this.expansionSetCode = "USG"; - // Each player puts a creature card from his or her graveyard onto the battlefield. this.getSpellAbility().addEffect(new ExhumeEffect()); } @@ -90,17 +89,17 @@ class ExhumeEffect extends OneShotEffect { return false; } - for (UUID playerId : controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { FilterCreatureCard filterCreatureCard = new FilterCreatureCard("creature card from your graveyard"); filterCreatureCard.add(new OwnerIdPredicate(playerId)); TargetCardInGraveyard target = new TargetCardInGraveyard(filterCreatureCard); - if (target.canChoose(playerId, game) && - player.chooseTarget(outcome, target, source, game)) { + if (target.canChoose(playerId, game) + && player.chooseTarget(outcome, target, source, game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId()); + player.moveCards(card, Zone.BATTLEFIELD, source, game); } } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/FaithHealer.java b/Mage.Sets/src/mage/sets/urzassaga/FaithHealer.java new file mode 100644 index 00000000000..37a52580727 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/FaithHealer.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledEnchantmentPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class FaithHealer extends CardImpl { + + public FaithHealer(UUID ownerId) { + super(ownerId, 14, "Faith Healer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "USG"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Sacrifice an enchantment: You gain life equal to the sacrificed enchantment's converted mana cost. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(new SacrificeCostConvertedMana("enchantment")), + new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledEnchantmentPermanent())))); + } + + public FaithHealer(final FaithHealer card) { + super(card); + } + + @Override + public FaithHealer copy() { + return new FaithHealer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/FaultLine.java b/Mage.Sets/src/mage/sets/urzassaga/FaultLine.java new file mode 100644 index 00000000000..be9be709887 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/FaultLine.java @@ -0,0 +1,105 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class FaultLine extends CardImpl { + + public FaultLine(UUID ownerId) { + super(ownerId, 185, "Fault Line", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{R}{R}"); + this.expansionSetCode = "USG"; + + // Fault Line deals X damage to each creature without flying and each player. + this.getSpellAbility().addEffect(new FaultLineEffect()); + } + + public FaultLine(final FaultLine card) { + super(card); + } + + @Override + public FaultLine copy() { + return new FaultLine(this); + } +} + +class FaultLineEffect extends OneShotEffect { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + + public FaultLineEffect() { + super(Outcome.Damage); + staticText = "{this} deals X damage to each creature without flying and each player"; + } + + public FaultLineEffect(final FaultLineEffect effect) { + super(effect); + } + + @Override + public FaultLineEffect copy() { + return new FaultLineEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int amount = source.getManaCostsToPay().getX(); + for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + permanent.damage(amount, source.getSourceId(), game, false, true); + } + for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) + player.damage(amount, source.getSourceId(), game, false, true); + } + return true; + } + +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/urzassaga/FieryMantle.java b/Mage.Sets/src/mage/sets/urzassaga/FieryMantle.java new file mode 100644 index 00000000000..483bbd2fa38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/FieryMantle.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class FieryMantle extends CardImpl { + + public FieryMantle(UUID ownerId) { + super(ownerId, 186, "Fiery Mantle", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "USG"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // {R}: Enchanted creature gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.R))); + + // When Fiery Mantle is put into a graveyard from the battlefield, return Fiery Mantle to its owner's hand. + this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new ReturnToHandSourceEffect())); + } + + public FieryMantle(final FieryMantle card) { + super(card); + } + + @Override + public FieryMantle copy() { + return new FieryMantle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Fluctuator.java b/Mage.Sets/src/mage/sets/urzassaga/Fluctuator.java index 931c2d8a008..11c4d3241d6 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Fluctuator.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Fluctuator.java @@ -32,6 +32,7 @@ import java.util.Set; import java.util.UUID; import mage.Mana; import mage.abilities.Ability; +import mage.abilities.ActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.cost.CostModificationEffectImpl; import mage.abilities.keyword.CyclingAbility; @@ -73,7 +74,7 @@ public class Fluctuator extends CardImpl { } class FluctuatorEffect extends CostModificationEffectImpl { - + private static final String effectText = "Cycling abilities you activate cost you up to {2} less to activate"; public FluctuatorEffect() { @@ -87,37 +88,44 @@ class FluctuatorEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - return abilityToModify.getControllerId().equals(source.getControllerId()) && - abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED) && - (abilityToModify instanceof CyclingAbility); + return abilityToModify.getControllerId().equals(source.getControllerId()) + && (abilityToModify instanceof CyclingAbility); } - + @Override public boolean apply(Game game, Ability source, Ability abilityToModify) { Player controller = game.getPlayer(abilityToModify.getControllerId()); - if (controller != null){ + if (controller != null) { Mana mana = abilityToModify.getManaCostsToPay().getMana(); int reduceMax = mana.getColorless(); - if (reduceMax > 2){ + if (reduceMax > 2) { reduceMax = 2; } if (reduceMax > 0) { - ChoiceImpl choice = new ChoiceImpl(true); - Set set = new LinkedHashSet<>(); + int reduce = 0; + if (abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED) + && ((ActivatedAbility) abilityToModify).isCheckPlayableMode()) { + reduce = reduceMax; + } else { + ChoiceImpl choice = new ChoiceImpl(true); + Set set = new LinkedHashSet<>(); - for(int i = 0; i <= reduceMax; i++){ - set.add(String.valueOf(i)); - } - choice.setChoices(set); - choice.setMessage("Reduce cycling cost"); - if(controller.choose(Outcome.Benefit, choice, game)){ - int reduce = Integer.parseInt(choice.getChoice()); - CardUtil.reduceCost(abilityToModify, reduce); + for (int i = 0; i <= reduceMax; i++) { + set.add(String.valueOf(i)); + } + choice.setChoices(set); + choice.setMessage("Reduce cycling cost"); + + if (controller.choose(Outcome.Benefit, choice, game)) { + reduce = Integer.parseInt(choice.getChoice()); + + } } + CardUtil.reduceCost(abilityToModify, reduce); } return true; } - return false; + return false; } @Override diff --git a/Mage.Sets/src/mage/sets/urzassaga/Fortitude.java b/Mage.Sets/src/mage/sets/urzassaga/Fortitude.java new file mode 100644 index 00000000000..34e1c426be3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Fortitude.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.RegenerateAttachedEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author hanasu + */ +public class Fortitude extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Forest"); + + static { + filter.add(new SubtypePredicate("Forest")); + } + + public Fortitude(UUID ownerId) { + super(ownerId, 253, "Fortitude", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + this.expansionSetCode = "USG"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Sacrifice a Forest: Regenerate enchanted creature. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateAttachedEffect(AttachmentType.AURA), new SacrificeTargetCost(new TargetControlledPermanent(filter)))); + + // When Fortitude is put into a graveyard from the battlefield, return Fortitude to its owner's hand. + this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new ReturnToHandSourceEffect())); + } + + public Fortitude(final Fortitude card) { + super(card); + } + + @Override + public Fortitude copy() { + return new Fortitude(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/GaeasBounty.java b/Mage.Sets/src/mage/sets/urzassaga/GaeasBounty.java new file mode 100644 index 00000000000..a97e7cc9aa8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/GaeasBounty.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author hanasu + */ +public class GaeasBounty extends CardImpl { + + private static final FilterLandCard filter = new FilterLandCard("Forest"); + + static { + filter.add(new SubtypePredicate("Forest")); + } + + public GaeasBounty(UUID ownerId) { + super(ownerId, 254, "Gaea's Bounty", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}"); + this.expansionSetCode = "USG"; + + // Search your library for up to two Forest cards, reveal those cards, and put them into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 2, filter), false)); + } + + public GaeasBounty(final GaeasBounty card) { + super(card); + } + + @Override + public GaeasBounty copy() { + return new GaeasBounty(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/GaeasEmbrace.java b/Mage.Sets/src/mage/sets/urzassaga/GaeasEmbrace.java index 62339dbe560..2931fd30691 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/GaeasEmbrace.java +++ b/Mage.Sets/src/mage/sets/urzassaga/GaeasEmbrace.java @@ -28,16 +28,11 @@ package mage.sets.urzassaga; import java.util.UUID; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.ColoredManaSymbol; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.RegenerateAttachedEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; @@ -45,6 +40,12 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -58,18 +59,18 @@ public class GaeasEmbrace extends CardImpl { this.expansionSetCode = "USG"; this.subtype.add("Aura"); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - // Enchanted creature gets +3/+3 and has trample. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA))); - + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3)); + Effect effect = new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has trample"); + ability.addEffect(effect); + this.addAbility(ability); // {G}: Regenerate enchanted creature. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateAttachedEffect(AttachmentType.AURA), new ColoredManaCost(ColoredManaSymbol.G))); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/GoblinOffensive.java b/Mage.Sets/src/mage/sets/urzassaga/GoblinOffensive.java index 4d11aa29eec..a9937de242e 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/GoblinOffensive.java +++ b/Mage.Sets/src/mage/sets/urzassaga/GoblinOffensive.java @@ -28,13 +28,12 @@ package mage.sets.urzassaga; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.GoblinToken; /** * @@ -46,7 +45,6 @@ public class GoblinOffensive extends CardImpl { super(ownerId, 192, "Goblin Offensive", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{1}{R}{R}"); this.expansionSetCode = "USG"; - // Put X 1/1 red Goblin creature tokens onto the battlefield. this.getSpellAbility().addEffect(new CreateTokenEffect(new GoblinToken(), new ManacostVariableValue())); } @@ -60,14 +58,3 @@ public class GoblinOffensive extends CardImpl { return new GoblinOffensive(this); } } - -class GoblinToken extends Token { - public GoblinToken() { - super("Goblin", "1/1 red Goblin creature token"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add("Goblin"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/urzassaga/GorillaWarrior.java b/Mage.Sets/src/mage/sets/urzassaga/GorillaWarrior.java index 5c20c56b30c..3149b5f07a4 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/GorillaWarrior.java +++ b/Mage.Sets/src/mage/sets/urzassaga/GorillaWarrior.java @@ -44,6 +44,7 @@ public class GorillaWarrior extends CardImpl { super(ownerId, 256, "Gorilla Warrior", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.expansionSetCode = "USG"; this.subtype.add("Ape"); + this.subtype.add("Warrior"); this.power = new MageInt(3); this.toughness = new MageInt(2); diff --git a/Mage.Sets/src/mage/sets/urzassaga/GreatWhale.java b/Mage.Sets/src/mage/sets/urzassaga/GreatWhale.java new file mode 100644 index 00000000000..e8b5b9f6c5f --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/GreatWhale.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.UntapLandsEffect; +import mage.cards.CardImpl; + +/** + * + * @author LoneFox + */ +public class GreatWhale extends CardImpl { + + public GreatWhale(UUID ownerId) { + super(ownerId, 77, "Great Whale", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{U}{U}"); + this.expansionSetCode = "USG"; + this.subtype.add("Whale"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // When Great Whale enters the battlefield, untap up to seven lands. + this.addAbility(new EntersBattlefieldTriggeredAbility(new UntapLandsEffect(7))); + } + + public GreatWhale(final GreatWhale card) { + super(card); + } + + @Override + public GreatWhale copy() { + return new GreatWhale(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/HermeticStudy.java b/Mage.Sets/src/mage/sets/urzassaga/HermeticStudy.java new file mode 100644 index 00000000000..d04371b3e0c --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/HermeticStudy.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreatureOrPlayer; +import mage.target.common.TargetCreaturePermanent; +/** + * + * @author LoneFox + */ +public class HermeticStudy extends CardImpl { + + public HermeticStudy(UUID ownerId) { + super(ownerId, 78, "Hermetic Study", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "USG"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature has "{tap}: This creature deals 1 damage to target creature or player." + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability, AttachmentType.AURA, Duration.WhileOnBattlefield, + "Enchanted creature has \"{T}: This creature deals 1 damage to target creature or player.\""))); + } + + public HermeticStudy(final HermeticStudy card) { + super(card); + } + + @Override + public HermeticStudy copy() { + return new HermeticStudy(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/IllGottenGains.java b/Mage.Sets/src/mage/sets/urzassaga/IllGottenGains.java index f731566dde4..6e2a10f1d85 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/IllGottenGains.java +++ b/Mage.Sets/src/mage/sets/urzassaga/IllGottenGains.java @@ -94,12 +94,12 @@ class IllGottenGainsEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (UUID playerId : controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { Target target = new TargetCardInYourGraveyard(0, 3, new FilterCard()); if (target.choose(Outcome.ReturnToHand, player.getId(), source.getSourceId(), game)) { - controller.moveCards(new CardsImpl(target.getTargets()), null, Zone.HAND, source, game); + player.moveCards(new CardsImpl(target.getTargets()), Zone.HAND, source, game); } } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/ImaginaryPet.java b/Mage.Sets/src/mage/sets/urzassaga/ImaginaryPet.java new file mode 100644 index 00000000000..69a4a490c45 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/ImaginaryPet.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.common.CardsInHandCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class ImaginaryPet extends CardImpl { + + public ImaginaryPet(UUID ownerId) { + super(ownerId, 81, "Imaginary Pet", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "USG"; + this.subtype.add("Illusion"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // At the beginning of your upkeep, if you have a card in hand, return Imaginary Pet to its owner's hand. + TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new ReturnToHandSourceEffect(true), TargetController.YOU, false); + this.addAbility(new ConditionalTriggeredAbility(ability, new CardsInHandCondition(CardsInHandCondition.CountType.MORE_THAN, 0), + "At the beginning of your upkeep, if you have a card in hand, return {this} to its owner's hand.")); + } + + public ImaginaryPet(final ImaginaryPet card) { + super(card); + } + + @Override + public ImaginaryPet copy() { + return new ImaginaryPet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/JaggedLightning.java b/Mage.Sets/src/mage/sets/urzassaga/JaggedLightning.java new file mode 100644 index 00000000000..c164794333d --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/JaggedLightning.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class JaggedLightning extends CardImpl { + + public JaggedLightning(UUID ownerId) { + super(ownerId, 200, "Jagged Lightning", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "USG"; + + // Jagged Lightning deals 3 damage to each of two target creatures. + this.getSpellAbility().addEffect(new DamageTargetEffect(3, true, "each of two target creatures")); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, new FilterCreaturePermanent(), false)); + } + + public JaggedLightning(final JaggedLightning card) { + super(card); + } + + @Override + public JaggedLightning copy() { + return new JaggedLightning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/LurkingEvil.java b/Mage.Sets/src/mage/sets/urzassaga/LurkingEvil.java new file mode 100644 index 00000000000..d3958d12dc1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/LurkingEvil.java @@ -0,0 +1,122 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.CostImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.players.Player; + +/** + * + * @author emerald000 + */ +public class LurkingEvil extends CardImpl { + + public LurkingEvil(UUID ownerId) { + super(ownerId, 140, "Lurking Evil", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}{B}"); + this.expansionSetCode = "USG"; + + // Pay half your life, rounded up: Lurking Evil becomes a 4/4 Horror creature with flying. + Effect effect = new BecomesCreatureSourceEffect(new LurkingEvilToken(), null, Duration.EndOfGame, true); + effect.setText("{this} becomes a 4/4 Horror creature with flying"); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new LurkingEvilCost())); + } + + public LurkingEvil(final LurkingEvil card) { + super(card); + } + + @Override + public LurkingEvil copy() { + return new LurkingEvil(this); + } +} + +class LurkingEvilCost extends CostImpl { + + LurkingEvilCost() { + this.text = "Pay half your life, rounded up"; + } + + LurkingEvilCost(LurkingEvilCost cost) { + super(cost); + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + Player controller = game.getPlayer(controllerId); + return controller != null && !(controller.getLife() > 0 && !controller.canPayLifeCost()); + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Player controller = game.getPlayer(controllerId); + if (controller != null) { + int currentLife = controller.getLife(); + int lifeToPay = (currentLife + currentLife%2) / 2; // Divide by two and round up. + if (lifeToPay < 0) { + this.paid = true; + } + else { + this.paid = (controller.loseLife(lifeToPay, game) == lifeToPay); + } + return this.paid; + } + return false; + } + + @Override + public LurkingEvilCost copy() { + return new LurkingEvilCost(this); + } +} + +class LurkingEvilToken extends Token { + + LurkingEvilToken() { + super("Horror", "4/4 Horror creature with flying"); + power = new MageInt(4); + toughness = new MageInt(4); + subtype.add("Horror"); + cardType.add(CardType.CREATURE); + this.addAbility(FlyingAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/ManaLeech.java b/Mage.Sets/src/mage/sets/urzassaga/ManaLeech.java new file mode 100644 index 00000000000..9879b1c9829 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/ManaLeech.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SkipUntapOptionalAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DontUntapAsLongAsSourceTappedEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class ManaLeech extends CardImpl { + + public ManaLeech(UUID ownerId) { + super(ownerId, 141, "Mana Leech", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "USG"; + this.subtype.add("Leech"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // You may choose not to untap Mana Leech during your untap step. + this.addAbility(new SkipUntapOptionalAbility()); + // {tap}: Tap target land. It doesn't untap during its controller's untap step for as long as Mana Leech remains tapped. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetLandPermanent()); + ability.addEffect(new DontUntapAsLongAsSourceTappedEffect()); + this.addAbility(ability); + } + + public ManaLeech(final ManaLeech card) { + super(card); + } + + @Override + public ManaLeech copy() { + return new ManaLeech(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Metrognome.java b/Mage.Sets/src/mage/sets/urzassaga/Metrognome.java new file mode 100644 index 00000000000..4bae5c0bea0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Metrognome.java @@ -0,0 +1,123 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.game.permanent.token.Token; +import mage.game.stack.StackObject; + +/** + * + * @author LoneFox + */ +public class Metrognome extends CardImpl { + + public Metrognome(UUID ownerId) { + super(ownerId, 301, "Metrognome", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "USG"; + + // When a spell or ability an opponent controls causes you to discard Metrognome, put four 1/1 colorless Gnome artifact creature tokens onto the battlefield. + this.addAbility(new MetrognomeTriggeredAbility()); + // {4}, {tap}: Put a 1/1 colorless Gnome artifact creature token onto the battlefield. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new GnomeToken()), new ManaCostsImpl("{4}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public Metrognome(final Metrognome card) { + super(card); + } + + @Override + public Metrognome copy() { + return new Metrognome(this); + } +} + +class MetrognomeTriggeredAbility extends TriggeredAbilityImpl { + + MetrognomeTriggeredAbility() { + super(Zone.ALL, new CreateTokenEffect(new GnomeToken(), 4)); + } + + MetrognomeTriggeredAbility(final MetrognomeTriggeredAbility ability) { + super(ability); + } + + @Override + public MetrognomeTriggeredAbility copy() { + return new MetrognomeTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (getSourceId().equals(event.getTargetId())) { + StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); + if (stackObject != null) { + return game.getOpponents(this.getControllerId()).contains(stackObject.getControllerId()); + } + } + return false; + } + + @Override + public String getRule() { + return "When a spell or ability an opponent controls causes you to discard {this}, " + super.getRule(); + } +} + +class GnomeToken extends Token { + + public GnomeToken() { + super("Gnome", "1/1 colorless Gnome artifact creature token"); + cardType.add(CardType.ARTIFACT); + cardType.add(CardType.CREATURE); + subtype.add("Gnome"); + power = new MageInt(1); + toughness = new MageInt(1); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/MidsummerRevel.java b/Mage.Sets/src/mage/sets/urzassaga/MidsummerRevel.java new file mode 100644 index 00000000000..4197bea2266 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/MidsummerRevel.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.permanent.token.BeastToken; + +/** + * + * @author LoneFox + */ +public class MidsummerRevel extends CardImpl { + + public MidsummerRevel(UUID ownerId) { + super(ownerId, 268, "Midsummer Revel", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{G}"); + this.expansionSetCode = "USG"; + + // At the beginning of your upkeep, you may put a verse counter on Midsummer Revel. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, + new AddCountersSourceEffect(CounterType.VERSE.createInstance(), true), TargetController.YOU, true)); + // {G}, Sacrifice Midsummer Revel: Put X 3/3 green Beast creature tokens onto the battlefield, where X is the number of verse counters on Midsummer Revel. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new BeastToken(), + new CountersCount(CounterType.VERSE)), new ManaCostsImpl("{G}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public MidsummerRevel(final MidsummerRevel card) { + super(card); + } + + @Override + public MidsummerRevel copy() { + return new MidsummerRevel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/MobileFort.java b/Mage.Sets/src/mage/sets/urzassaga/MobileFort.java new file mode 100644 index 00000000000..c33774b3560 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/MobileFort.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class MobileFort extends CardImpl { + + public MobileFort(UUID ownerId) { + super(ownerId, 303, "Mobile Fort", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "USG"; + this.subtype.add("Wall"); + this.power = new MageInt(0); + this.toughness = new MageInt(6); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + + // {3}: Mobile Fort gets +3/-1 until end of turn and can attack this turn as though it didn't have defender. Activate this ability only once each turn. + Effect effect = new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.EndOfTurn); + effect.setText("and can attack as though it didn't have defender"); + Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, -1, Duration.EndOfTurn), new ManaCostsImpl("{3}")); + ability.addEffect(effect); + this.addAbility(ability); + } + + public MobileFort(final MobileFort card) { + super(card); + } + + @Override + public MobileFort copy() { + return new MobileFort(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/MonkIdealist.java b/Mage.Sets/src/mage/sets/urzassaga/MonkIdealist.java new file mode 100644 index 00000000000..8e24a1ac389 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/MonkIdealist.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author hanasu + */ +public class MonkIdealist extends CardImpl { + + private static final FilterCard filter = new FilterCard("enchantment card from your graveyard"); + + static { + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); + } + + public MonkIdealist(UUID ownerId) { + super(ownerId, 20, "Monk Idealist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "USG"; + this.subtype.add("Human"); + this.subtype.add("Monk"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Monk Idealist enters the battlefield, return target enchantment card from your graveyard to your hand. + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true); + ability.addTarget(new TargetCardInYourGraveyard(filter)); + this.addAbility(ability); + } + + public MonkIdealist(final MonkIdealist card) { + super(card); + } + + @Override + public MonkIdealist copy() { + return new MonkIdealist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Oppression.java b/Mage.Sets/src/mage/sets/urzassaga/Oppression.java index 5c626c2089e..dee4dea7f2b 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Oppression.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Oppression.java @@ -28,16 +28,11 @@ package mage.sets.urzassaga; import java.util.UUID; - -import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SpellCastAllTriggeredAbility; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.filter.FilterSpell; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; @@ -53,7 +48,6 @@ public class Oppression extends CardImpl { super(ownerId, 143, "Oppression", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{B}"); this.expansionSetCode = "USG"; - // Whenever a player casts a spell, that player discards a card. this.addAbility(new OppressionTriggeredAbility()); } @@ -82,7 +76,7 @@ class OppressionTriggeredAbility extends SpellCastAllTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && filter.match(spell, getControllerId(), game)) { + if (spell != null && filter.match(spell, getSourceId(), getControllerId(), game)) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; } @@ -94,4 +88,4 @@ class OppressionTriggeredAbility extends SpellCastAllTriggeredAbility { public OppressionTriggeredAbility copy() { return new OppressionTriggeredAbility(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/ParasiticBond.java b/Mage.Sets/src/mage/sets/urzassaga/ParasiticBond.java new file mode 100644 index 00000000000..f92ea066e29 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/ParasiticBond.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ParasiticBond extends CardImpl { + + public ParasiticBond(UUID ownerId) { + super(ownerId, 145, "Parasitic Bond", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}"); + this.expansionSetCode = "USG"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted creature's controller, Parasitic Bond deals 2 damage to that player. + Effect effect = new DamageTargetEffect(2); + effect.setText("{this} deals 2 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public ParasiticBond(final ParasiticBond card) { + super(card); + } + + @Override + public ParasiticBond copy() { + return new ParasiticBond(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/PlanarBirth.java b/Mage.Sets/src/mage/sets/urzassaga/PlanarBirth.java index fdd6644437e..7b298acc3d7 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/PlanarBirth.java +++ b/Mage.Sets/src/mage/sets/urzassaga/PlanarBirth.java @@ -30,8 +30,9 @@ package mage.sets.urzassaga; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -65,33 +66,33 @@ public class PlanarBirth extends CardImpl { } class PlanarBirthEffect extends OneShotEffect { - + PlanarBirthEffect() { super(Outcome.PutLandInPlay); this.staticText = "Return all basic land cards from all graveyards to the battlefield tapped under their owners' control"; } - + PlanarBirthEffect(final PlanarBirthEffect effect) { super(effect); } - + @Override public PlanarBirthEffect copy() { return new PlanarBirthEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (UUID playerId : controller.getInRange()) { + Cards toBattlefield = new CardsImpl(); + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card : player.getGraveyard().getCards(new FilterBasicLandCard(), source.getSourceId(), controller.getId(), game)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), true); - } + toBattlefield.addAll(player.getGraveyard().getCards(new FilterBasicLandCard(), source.getSourceId(), controller.getId(), game)); } } + controller.moveCards(toBattlefield.getCards(game), Zone.BATTLEFIELD, source, game, true, false, true, null); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/urzassaga/PresenceOfTheMaster.java b/Mage.Sets/src/mage/sets/urzassaga/PresenceOfTheMaster.java new file mode 100644 index 00000000000..dd2cfa33e06 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/PresenceOfTheMaster.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PresenceOfTheMaster extends mage.sets.legends.PresenceOfTheMaster { + + public PresenceOfTheMaster(UUID ownerId) { + super(ownerId); + this.cardNumber = 32; + this.expansionSetCode = "USG"; + } + + public PresenceOfTheMaster(final PresenceOfTheMaster card) { + super(card); + } + + @Override + public PresenceOfTheMaster copy() { + return new PresenceOfTheMaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/SanctumCustodian.java b/Mage.Sets/src/mage/sets/urzassaga/SanctumCustodian.java new file mode 100644 index 00000000000..bdad5a972f7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/SanctumCustodian.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class SanctumCustodian extends CardImpl { + + public SanctumCustodian(UUID ownerId) { + super(ownerId, 42, "Sanctum Custodian", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "USG"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {tap}: Prevent the next 2 damage that would be dealt to target creature or player this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 2), new TapSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public SanctumCustodian(final SanctumCustodian card) { + super(card); + } + + @Override + public SanctumCustodian copy() { + return new SanctumCustodian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/SanctumGuardian.java b/Mage.Sets/src/mage/sets/urzassaga/SanctumGuardian.java new file mode 100644 index 00000000000..2b40cfa1a64 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/SanctumGuardian.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class SanctumGuardian extends mage.sets.ninthedition.SanctumGuardian { + + public SanctumGuardian(UUID ownerId) { + super(ownerId); + this.cardNumber = 43; + this.expansionSetCode = "USG"; + } + + public SanctumGuardian(final SanctumGuardian card) { + super(card); + } + + @Override + public SanctumGuardian copy() { + return new SanctumGuardian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/ShowAndTell.java b/Mage.Sets/src/mage/sets/urzassaga/ShowAndTell.java index 21b6a651688..0161b4f0df9 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/ShowAndTell.java +++ b/Mage.Sets/src/mage/sets/urzassaga/ShowAndTell.java @@ -28,7 +28,9 @@ package mage.sets.urzassaga; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; @@ -55,7 +57,6 @@ public class ShowAndTell extends CardImpl { super(ownerId, 96, "Show and Tell", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{U}"); this.expansionSetCode = "USG"; - // Each player may put an artifact, creature, enchantment, or land card from his or her hand onto the battlefield. this.getSpellAbility().addEffect(new ShowAndTellEffect()); } @@ -103,10 +104,10 @@ class ShowAndTellEffect extends OneShotEffect { if (controller == null) { return false; } - List cardsToPutIntoPlay = new ArrayList<>(); + Set cardsToPutIntoPlay = new LinkedHashSet<>(); TargetCardInHand target = new TargetCardInHand(filter); - - for(UUID playerId: game.getState().getPlayersInRange(controller.getId(), game)) { + + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { if (player.chooseUse(outcome, "Put an artifact, creature, enchantment, or land card from hand onto the battlefield?", source, game)) { @@ -117,15 +118,9 @@ class ShowAndTellEffect extends OneShotEffect { cardsToPutIntoPlay.add(card); } } - } + } } } - for (Card card: cardsToPutIntoPlay) { - Player player = game.getPlayer(card.getOwnerId()); - if (player != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); - } - } - return true; + return controller.moveCards(cardsToPutIntoPlay, Zone.BATTLEFIELD, source, game, false, false, true, null); } } diff --git a/Mage.Sets/src/mage/sets/urzassaga/SkitteringSkirge.java b/Mage.Sets/src/mage/sets/urzassaga/SkitteringSkirge.java new file mode 100644 index 00000000000..1b1815af39d --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/SkitteringSkirge.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author hanasu + */ +public class SkitteringSkirge extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a creature spell"); + + static { + filter.add(new CardTypePredicate(CardType.CREATURE)); + } + + public SkitteringSkirge(UUID ownerId) { + super(ownerId, 158, "Skittering Skirge", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); + this.expansionSetCode = "USG"; + this.subtype.add("Imp"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When you cast a creature spell, sacrifice Skittering Skirge. + this.addAbility(new SpellCastControllerTriggeredAbility(new SacrificeSourceEffect(), filter, false)); + } + + public SkitteringSkirge(final SkitteringSkirge card) { + super(card); + } + + @Override + public SkitteringSkirge copy() { + return new SkitteringSkirge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/SneakAttack.java b/Mage.Sets/src/mage/sets/urzassaga/SneakAttack.java index 1b447cb9f41..4cb45d7a1fc 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/SneakAttack.java +++ b/Mage.Sets/src/mage/sets/urzassaga/SneakAttack.java @@ -62,7 +62,6 @@ public class SneakAttack extends CardImpl { super(ownerId, 218, "Sneak Attack", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); this.expansionSetCode = "USG"; - // {R}: You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice the creature at the beginning of the next end step. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SneakAttackEffect(), new ManaCostsImpl("{R}"))); } @@ -78,48 +77,49 @@ public class SneakAttack extends CardImpl { } class SneakAttackEffect extends OneShotEffect { - + private static final String choiceText = "Put a creature card from your hand onto the battlefield?"; - + public SneakAttackEffect() { super(Outcome.Benefit); this.staticText = "You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice the creature at the beginning of the next end step"; } - + public SneakAttackEffect(final SneakAttackEffect effect) { super(effect); } - + @Override public SneakAttackEffect copy() { return new SneakAttackEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - if (player.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + if (controller.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) { TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard()); - if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { + if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - if (player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId())) { + if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent permanent = game.getPermanent(card.getId()); - ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); - effect.setTargetPointer(new FixedTarget(permanent.getId())); - game.addEffect(effect, source); - - SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName()); - sacrificeEffect.setTargetPointer(new FixedTarget(card.getId())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - + if (permanent != null) { + ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); + effect.setTargetPointer(new FixedTarget(permanent, game)); + game.addEffect(effect, source); + + SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice " + card.getName(), source.getControllerId()); + sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } return true; - } + } } return false; } diff --git a/Mage.Sets/src/mage/sets/urzassaga/SpireOwl.java b/Mage.Sets/src/mage/sets/urzassaga/SpireOwl.java new file mode 100644 index 00000000000..1e30546bfad --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/SpireOwl.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.LookLibraryControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SpireOwl extends CardImpl { + + public SpireOwl(UUID ownerId) { + super(ownerId, 98, "Spire Owl", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "USG"; + this.subtype.add("Bird"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Spire Owl enters the battlefield, look at the top four cards of your library, then put them back in any order. + this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryControllerEffect(4))); + } + + public SpireOwl(final SpireOwl card) { + super(card); + } + + @Override + public SpireOwl copy() { + return new SpireOwl(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/SpreadingAlgae.java b/Mage.Sets/src/mage/sets/urzassaga/SpreadingAlgae.java index 3f944b98a29..117c5bca447 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/SpreadingAlgae.java +++ b/Mage.Sets/src/mage/sets/urzassaga/SpreadingAlgae.java @@ -29,11 +29,10 @@ package mage.sets.urzassaga; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BecomesTappedAttachedTriggeredAbility; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; @@ -41,15 +40,9 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterLandPermanent; +import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; -import mage.target.common.TargetLandPermanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -57,29 +50,29 @@ import mage.target.targetpointer.FixedTarget; */ public class SpreadingAlgae extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp"); + private static final FilterPermanent filter = new FilterPermanent("Swamp"); + static{ filter.add(new SubtypePredicate("Swamp")); } + public SpreadingAlgae(UUID ownerId) { super(ownerId, 274, "Spreading Algae", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); this.expansionSetCode = "USG"; this.subtype.add("Aura"); - // Enchant Swamp - - TargetPermanent auraTarget = new TargetLandPermanent(); + TargetPermanent auraTarget = new TargetPermanent(filter); this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // When enchanted land becomes tapped, destroy it. - this.addAbility(new SpreadingAlgaeTriggeredAbility(new DestroyTargetEffect())); - + this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DestroyAttachedEffect("it"), "enchanted land")); + // When Spreading Algae is put into a graveyard from the battlefield, return Spreading Algae to its owner's hand. this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new ReturnToHandSourceEffect())); - + } public SpreadingAlgae(final SpreadingAlgae card) { @@ -91,43 +84,3 @@ public class SpreadingAlgae extends CardImpl { return new SpreadingAlgae(this); } } - - -class SpreadingAlgaeTriggeredAbility extends TriggeredAbilityImpl { - - public SpreadingAlgaeTriggeredAbility(Effect effect) { - super(Zone.BATTLEFIELD, effect); - } - - public SpreadingAlgaeTriggeredAbility(final SpreadingAlgaeTriggeredAbility ability) { - super(ability); - } - - @Override - public SpreadingAlgaeTriggeredAbility copy() { - return new SpreadingAlgaeTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent enchant = game.getPermanent(sourceId); - if (enchant != null && enchant.getAttachedTo() != null) { - if (event.getTargetId().equals(enchant.getAttachedTo())) { - getEffects().get(0).setTargetPointer(new FixedTarget(enchant.getAttachedTo())); - return true; - } - } - return false; - } - - @Override - public String getRule() { - return "When enchanted permanent becomes tapped, destroy it."; - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/urzassaga/Sunder.java b/Mage.Sets/src/mage/sets/urzassaga/Sunder.java new file mode 100644 index 00000000000..fee91fcee5e --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Sunder.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author fireshoes + */ +public class Sunder extends CardImpl { + + public Sunder(UUID ownerId) { + super(ownerId, 101, "Sunder", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{U}{U}"); + this.expansionSetCode = "USG"; + + // Return all lands to their owners' hands. + this.getSpellAbility().addEffect(new SunderEffect()); + } + + public Sunder(final Sunder card) { + super(card); + } + + @Override + public Sunder copy() { + return new Sunder(this); + } +} + +class SunderEffect extends OneShotEffect { + + public SunderEffect() { + super(Outcome.ReturnToHand); + staticText = "Return all lands to their owners' hands"; + } + + public SunderEffect(final SunderEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent land : game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), source.getSourceId(), game)) { + land.moveToZone(Zone.HAND, source.getSourceId(), game, true); + } + return true; + } + + @Override + public SunderEffect copy() { + return new SunderEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/TimeSpiral.java b/Mage.Sets/src/mage/sets/urzassaga/TimeSpiral.java index 1b19a828190..fff482faff9 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/TimeSpiral.java +++ b/Mage.Sets/src/mage/sets/urzassaga/TimeSpiral.java @@ -28,15 +28,17 @@ package mage.sets.urzassaga; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.abilities.Ability; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardAllEffect; import mage.abilities.effects.common.ExileSpellEffect; import mage.abilities.effects.common.UntapLandsEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -51,12 +53,15 @@ public class TimeSpiral extends CardImpl { super(ownerId, 103, "Time Spiral", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{U}{U}"); this.expansionSetCode = "USG"; - // Exile Time Spiral. Each player shuffles his or her graveyard and hand into his or her library, then draws seven cards. You untap up to six lands. this.getSpellAbility().addEffect(ExileSpellEffect.getInstance()); this.getSpellAbility().addEffect(new TimeSpiralEffect()); + Effect effect = new DrawCardAllEffect(7); + effect.setText(", then draws seven cards"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(new UntapLandsEffect(6)); } + public TimeSpiral(final TimeSpiral card) { super(card); } @@ -71,7 +76,7 @@ class TimeSpiralEffect extends OneShotEffect { public TimeSpiralEffect() { super(Outcome.Neutral); - staticText = "Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards"; + staticText = "Each player shuffles his or her hand and graveyard into his or her library"; } public TimeSpiralEffect(final TimeSpiralEffect effect) { @@ -81,17 +86,16 @@ class TimeSpiralEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player sourcePlayer = game.getPlayer(source.getControllerId()); - for (UUID playerId: sourcePlayer.getInRange()) { + for (UUID playerId : sourcePlayer.getInRange()) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card: player.getHand().getCards(game)) { + for (Card card : player.getHand().getCards(game)) { card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - for (Card card: player.getGraveyard().getCards(game)) { + } + for (Card card : player.getGraveyard().getCards(game)) { card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } + } player.shuffleLibrary(game); - player.drawCards(7, game); } } return true; @@ -102,4 +106,4 @@ class TimeSpiralEffect extends OneShotEffect { return new TimeSpiralEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/TorchSong.java b/Mage.Sets/src/mage/sets/urzassaga/TorchSong.java new file mode 100644 index 00000000000..edd10ecd569 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/TorchSong.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class TorchSong extends CardImpl { + + public TorchSong(UUID ownerId) { + super(ownerId, 222, "Torch Song", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "USG"; + + // At the beginning of your upkeep, you may put a verse counter on Torch Song. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, + new AddCountersSourceEffect(CounterType.VERSE.createInstance(), true), TargetController.YOU, true)); + // {2}{R}, Sacrifice Torch Song: Torch Song deals X damage to target creature or player, where X is the number of verse counters on Torch Song. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new CountersCount(CounterType.VERSE)), new ManaCostsImpl("{2}{R}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public TorchSong(final TorchSong card) { + super(card); + } + + @Override + public TorchSong copy() { + return new TorchSong(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/VampiricEmbrace.java b/Mage.Sets/src/mage/sets/urzassaga/VampiricEmbrace.java index e8157d73dcb..325bceb58f1 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/VampiricEmbrace.java +++ b/Mage.Sets/src/mage/sets/urzassaga/VampiricEmbrace.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; @@ -65,11 +66,12 @@ public class VampiricEmbrace extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - // Enchanted creature gets +2/+2 and has flying. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA))); - + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2)); + Effect effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has flying"); + ability.addEffect(effect); + this.addAbility(ability); // Whenever a creature dealt damage by enchanted creature this turn dies, put a +1/+1 counter on that creature. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false), AttachmentType.AURA))); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/ViashinoWeaponsmith.java b/Mage.Sets/src/mage/sets/urzassaga/ViashinoWeaponsmith.java new file mode 100644 index 00000000000..fef2a24dfe9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/ViashinoWeaponsmith.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedByCreatureTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author hanasu + */ +public class ViashinoWeaponsmith extends CardImpl { + + public ViashinoWeaponsmith(UUID ownerId) { + super(ownerId, 226, "Viashino Weaponsmith", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "USG"; + this.subtype.add("Viashino"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Viashino Weaponsmith becomes blocked by a creature, Viashino Weaponsmith gets +2/+2 until end of turn. + this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false)); + } + + public ViashinoWeaponsmith(final ViashinoWeaponsmith card) { + super(card); + } + + @Override + public ViashinoWeaponsmith copy() { + return new ViashinoWeaponsmith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/VileRequiem.java b/Mage.Sets/src/mage/sets/urzassaga/VileRequiem.java index 0bb7130dc62..e41d1ff8d95 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/VileRequiem.java +++ b/Mage.Sets/src/mage/sets/urzassaga/VileRequiem.java @@ -71,11 +71,11 @@ public class VileRequiem extends CardImpl { // At the beginning of your upkeep, you may put a verse counter on Vile Requiem. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, - new AddCountersSourceEffect(CounterType.VILE.createInstance(), true ), TargetController.YOU, true)); + new AddCountersSourceEffect(CounterType.VERSE.createInstance(), true ), TargetController.YOU, true)); // {1}{B}, Sacrifice Vile Requiem: Destroy up to X target nonblack creatures, where X is the number of verse counters on Vile Requiem. They can't be regenerated. Effect effect = new DestroyTargetEffect(true); effect.setText("Destroy up to X target nonblack creatures, where X is the number of verse counters on {this}. They can't be regenerated"); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}")); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetCreaturePermanent(0,0,filter, false)); this.addAbility(ability); @@ -88,7 +88,7 @@ public class VileRequiem extends CardImpl { if (ability.getOriginalId().equals(originalId)) { Permanent sourcePermanent = game.getPermanent(ability.getSourceId()); if (sourcePermanent != null) { - int numberCounters = sourcePermanent.getCounters().getCount(CounterType.VILE); + int numberCounters = sourcePermanent.getCounters().getCount(CounterType.VERSE); ability.getTargets().clear(); FilterCreaturePermanent newFilter = filter.copy(); newFilter.setMessage(new StringBuilder("up to ").append(CardUtil.numberToText(numberCounters)).append(" target nonblack creatures").toString()); diff --git a/Mage.Sets/src/mage/sets/urzassaga/VoiceOfGrace.java b/Mage.Sets/src/mage/sets/urzassaga/VoiceOfGrace.java index fa51e7b9e59..2fa195c2d3b 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/VoiceOfGrace.java +++ b/Mage.Sets/src/mage/sets/urzassaga/VoiceOfGrace.java @@ -53,7 +53,7 @@ public class VoiceOfGrace extends CardImpl { } public VoiceOfGrace(UUID ownerId) { - super(ownerId, 54, "Voice Of Grace", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + super(ownerId, 54, "Voice of Grace", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); this.expansionSetCode = "USG"; this.subtype.add("Angel"); diff --git a/Mage.Sets/src/mage/sets/urzassaga/VoiceOfLaw.java b/Mage.Sets/src/mage/sets/urzassaga/VoiceOfLaw.java index 898152c6247..51fcaf8fcba 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/VoiceOfLaw.java +++ b/Mage.Sets/src/mage/sets/urzassaga/VoiceOfLaw.java @@ -52,7 +52,7 @@ public class VoiceOfLaw extends CardImpl { } public VoiceOfLaw(UUID ownerId) { - super(ownerId, 55, "Voice Of Law", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + super(ownerId, 55, "Voice of Law", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); this.expansionSetCode = "USG"; this.subtype.add("Angel"); diff --git a/Mage.Sets/src/mage/sets/urzassaga/Windfall.java b/Mage.Sets/src/mage/sets/urzassaga/Windfall.java index 4b398342cfd..c6f2b14192f 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Windfall.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Windfall.java @@ -48,7 +48,6 @@ public class Windfall extends CardImpl { super(ownerId, 111, "Windfall", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); this.expansionSetCode = "USG"; - // Each player discards his or her hand, then draws cards equal to the greatest number of cards a player discarded this way. this.getSpellAbility().addEffect(new WindfallEffect()); } @@ -64,6 +63,7 @@ public class Windfall extends CardImpl { } class WindfallEffect extends OneShotEffect { + WindfallEffect() { super(Outcome.Discard); staticText = "Each player discards his or her hand, then draws cards equal to the greatest number of cards a player discarded this way."; @@ -76,11 +76,11 @@ class WindfallEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int maxDiscarded = 0; - Player sourcePlayer = game.getPlayer(source.getControllerId()); - if (sourcePlayer == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } - for (UUID playerId : sourcePlayer.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { int discarded = 0; @@ -94,7 +94,7 @@ class WindfallEffect extends OneShotEffect { } } } - for (UUID playerId : sourcePlayer.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { player.drawCards(maxDiscarded, game); @@ -107,4 +107,4 @@ class WindfallEffect extends OneShotEffect { public WindfallEffect copy() { return new WindfallEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/WitchEngine.java b/Mage.Sets/src/mage/sets/urzassaga/WitchEngine.java new file mode 100644 index 00000000000..71092fd879f --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/WitchEngine.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.keyword.SwampwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class WitchEngine extends CardImpl { + + public WitchEngine(UUID ownerId) { + super(ownerId, 169, "Witch Engine", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}"); + this.expansionSetCode = "USG"; + this.subtype.add("Horror"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Swampwalk + this.addAbility(new SwampwalkAbility()); + + // {tap}: Add {B}{B}{B}{B} to your mana pool. Target opponent gains control of Witch Engine. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(0, 0, 0, 0, 4, 0, 0)), new TapSourceCost()); + ability.addEffect(new WitchEngineEffect()); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public WitchEngine(final WitchEngine card) { + super(card); + } + + @Override + public WitchEngine copy() { + return new WitchEngine(this); + } +} + +class WitchEngineEffect extends ContinuousEffectImpl { + + public WitchEngineEffect() { + super(Duration.Custom, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); + staticText = "target opponent gains control of {this}"; + } + + public WitchEngineEffect(final WitchEngineEffect effect) { + super(effect); + } + + @Override + public WitchEngineEffect copy() { + return new WitchEngineEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game); + if (permanent != null) { + return permanent.changeControllerId(source.getFirstTarget(), game); + } else { + discard(); + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/ZephidsEmbrace.java b/Mage.Sets/src/mage/sets/urzassaga/ZephidsEmbrace.java index 0c90e838c91..b3608bf3dc5 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/ZephidsEmbrace.java +++ b/Mage.Sets/src/mage/sets/urzassaga/ZephidsEmbrace.java @@ -29,23 +29,21 @@ package mage.sets.urzassaga; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -58,15 +56,23 @@ public class ZephidsEmbrace extends CardImpl { public ZephidsEmbrace(UUID ownerId) { super(ownerId, 114, "Zephid's Embrace", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}"); this.expansionSetCode = "USG"; - this.subtype.add("Aura"); + // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ZephidsEmbraceEffect())); + // Enchanted creature gets +2/+2 and has flying and shroud. + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2)); + Effect effect = new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has flying"); + ability.addEffect(effect); + effect = new GainAbilityAttachedEffect(ShroudAbility.getInstance(), AttachmentType.AURA); + effect.setText("and shroud"); + ability.addEffect(effect); + this.addAbility(ability); } public ZephidsEmbrace(final ZephidsEmbrace card) { @@ -78,57 +84,3 @@ public class ZephidsEmbrace extends CardImpl { return new ZephidsEmbrace(this); } } - -class ZephidsEmbraceEffect extends ContinuousEffectImpl { - - public ZephidsEmbraceEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Enchanted creature gets +2/+2 and has flying and shroud"; - } - - public ZephidsEmbraceEffect(final ZephidsEmbraceEffect effect) { - super(effect); - } - - @Override - public ZephidsEmbraceEffect copy() { - return new ZephidsEmbraceEffect(this); - } - - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - switch (layer) { - case PTChangingEffects_7: - if (sublayer == SubLayer.ModifyPT_7c) { - creature.addPower(2); - creature.addToughness(2); - } - break; - case AbilityAddingRemovingEffects_6: - if (sublayer == SubLayer.NA) { - creature.addAbility(FlyingAbility.getInstance(), game); - creature.addAbility(ShroudAbility.getInstance(), game); - } - break; - } - return true; - } - } - return false; - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.PTChangingEffects_7; - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/venservskoth/CoralFighters.java b/Mage.Sets/src/mage/sets/venservskoth/CoralFighters.java new file mode 100644 index 00000000000..451fe869337 --- /dev/null +++ b/Mage.Sets/src/mage/sets/venservskoth/CoralFighters.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.venservskoth; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LoneFox + */ +public class CoralFighters extends CardImpl { + + public CoralFighters(UUID ownerId) { + super(ownerId, 4, "Coral Fighters", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "DDI"; + this.subtype.add("Merfolk"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Coral Fighters attacks and isn't blocked, look at the top card of defending player's library. You may put that card on the bottom of that player's library. + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(new CoralFightersEffect(), false, true)); + } + + public CoralFighters(final CoralFighters card) { + super(card); + } + + @Override + public CoralFighters copy() { + return new CoralFighters(this); + } +} + +class CoralFightersEffect extends OneShotEffect { + + public CoralFightersEffect() { + super(Outcome.Detriment); + staticText = "look at the top card of defending player's library. You may put that card on the bottom of that player's library"; + } + + public CoralFightersEffect(final CoralFightersEffect effect) { + super(effect); + } + + @Override + public CoralFightersEffect copy() { + return new CoralFightersEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player defendingPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + if(controller != null && defendingPlayer != null) { + Card card = defendingPlayer.getLibrary().getFromTop(game); + if(card != null) { + Cards cards = new CardsImpl(); + cards.add(card); + controller.lookAtCards("Coral Fighters", cards, game); + if (controller.chooseUse(outcome, "Do you wish to put card on the bottom of player's library?", source, game)) { + controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, false, false); + } + else { + game.informPlayers(controller.getLogName() + " puts the card back on top of the library."); + } + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/venservskoth/CrypticAnnelid.java b/Mage.Sets/src/mage/sets/venservskoth/CrypticAnnelid.java new file mode 100644 index 00000000000..66d55fade06 --- /dev/null +++ b/Mage.Sets/src/mage/sets/venservskoth/CrypticAnnelid.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.venservskoth; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CrypticAnnelid extends mage.sets.futuresight.CrypticAnnelid { + + public CrypticAnnelid(UUID ownerId) { + super(ownerId); + this.cardNumber = 15; + this.expansionSetCode = "DDI"; + } + + public CrypticAnnelid(final CrypticAnnelid card) { + super(card); + } + + @Override + public CrypticAnnelid copy() { + return new CrypticAnnelid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/venservskoth/DownhillCharge.java b/Mage.Sets/src/mage/sets/venservskoth/DownhillCharge.java new file mode 100644 index 00000000000..328f17486b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/venservskoth/DownhillCharge.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.venservskoth; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class DownhillCharge extends mage.sets.nemesis.DownhillCharge { + + public DownhillCharge(UUID ownerId) { + super(ownerId); + this.cardNumber = 69; + this.expansionSetCode = "DDI"; + } + + public DownhillCharge(final DownhillCharge card) { + super(card); + } + + @Override + public DownhillCharge copy() { + return new DownhillCharge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/venservskoth/GreaterStoneSpirit.java b/Mage.Sets/src/mage/sets/venservskoth/GreaterStoneSpirit.java new file mode 100644 index 00000000000..8ad60995aac --- /dev/null +++ b/Mage.Sets/src/mage/sets/venservskoth/GreaterStoneSpirit.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.venservskoth; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class GreaterStoneSpirit extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with flying"); + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public GreaterStoneSpirit(UUID ownerId) { + super(ownerId, 61, "Greater Stone Spirit", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); + this.expansionSetCode = "DDI"; + this.subtype.add("Elemental"); + this.subtype.add("Spirit"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Greater Stone Spirit can't be blocked by creatures with flying. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + + // {2}{R}: Until end of turn, target creature gets +0/+2 and gains "{R}: This creature gets +1/+0 until end of turn." + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")); + Effect effect = new GainAbilityTargetEffect(gainedAbility, Duration.EndOfTurn); + effect.setText("and gains \"{R}: This creature gets +1/+0 until end of turn.\""); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(0, 2, Duration.EndOfTurn), new ManaCostsImpl("{2}{R}")); + ability.addEffect(effect); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public GreaterStoneSpirit(final GreaterStoneSpirit card) { + super(card); + } + + @Override + public GreaterStoneSpirit copy() { + return new GreaterStoneSpirit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/venservskoth/Lithophage.java b/Mage.Sets/src/mage/sets/venservskoth/Lithophage.java new file mode 100644 index 00000000000..d7c256cbec6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/venservskoth/Lithophage.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.venservskoth; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Lithophage extends mage.sets.mercadianmasques.Lithophage { + + public Lithophage(UUID ownerId) { + super(ownerId); + this.cardNumber = 57; + this.expansionSetCode = "DDI"; + } + + public Lithophage(final Lithophage card) { + super(card); + } + + @Override + public Lithophage copy() { + return new Lithophage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/venservskoth/SawtoothLoon.java b/Mage.Sets/src/mage/sets/venservskoth/SawtoothLoon.java index ccef7acff4d..a4c3ff1e73c 100644 --- a/Mage.Sets/src/mage/sets/venservskoth/SawtoothLoon.java +++ b/Mage.Sets/src/mage/sets/venservskoth/SawtoothLoon.java @@ -35,12 +35,13 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect; import mage.abilities.keyword.FlyingAbility; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; +import mage.filter.FilterCard; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; @@ -58,8 +59,8 @@ public class SawtoothLoon extends CardImpl { static { Predicates.or( - new ColorPredicate(ObjectColor.WHITE), - new ColorPredicate(ObjectColor.BLUE)); + new ColorPredicate(ObjectColor.WHITE), + new ColorPredicate(ObjectColor.BLUE)); } public SawtoothLoon(UUID ownerId) { @@ -110,21 +111,15 @@ class SawtoothLoonEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { controller.drawCards(2, game); - putOnLibrary(controller, source, game); - putOnLibrary(controller, source, game); + TargetCardInHand target = new TargetCardInHand(2, 2, new FilterCard()); + controller.chooseTarget(Outcome.Detriment, target, source, game); + Cards cardsToLibrary = new CardsImpl(target.getTargets()); + if (!cardsToLibrary.isEmpty()) { + controller.putCardsOnBottomOfLibrary(cardsToLibrary, game, source, false); + } return true; } return false; } - private boolean putOnLibrary(Player player, Ability source, Game game) { - TargetCardInHand target = new TargetCardInHand(); - player.chooseTarget(Outcome.ReturnToHand, target, source, game); - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - player.getHand().remove(card); - player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, false, false); - } - return true; - } } diff --git a/Mage.Sets/src/mage/sets/vintagemasters/ArmorOfThorns.java b/Mage.Sets/src/mage/sets/vintagemasters/ArmorOfThorns.java new file mode 100644 index 00000000000..5935dd45b28 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/ArmorOfThorns.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ArmorOfThorns extends mage.sets.mirage.ArmorOfThorns { + + public ArmorOfThorns(UUID ownerId) { + super(ownerId); + this.cardNumber = 194; + this.expansionSetCode = "VMA"; + } + + public ArmorOfThorns(final ArmorOfThorns card) { + super(card); + } + + @Override + public ArmorOfThorns copy() { + return new ArmorOfThorns(this); + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/ChaosWarp.java b/Mage.Sets/src/mage/sets/vintagemasters/ChaosWarp.java index 96230a129e5..d4e09af0c93 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/ChaosWarp.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/ChaosWarp.java @@ -35,20 +35,20 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; -import mage.players.Player; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; +import mage.filter.common.FilterPermanentCard; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.players.Player; import mage.target.TargetPermanent; -import mage.filter.common.FilterPermanentCard; /** * * @author Mitchel Stein - * + * */ public class ChaosWarp extends CardImpl { @@ -56,14 +56,13 @@ public class ChaosWarp extends CardImpl { super(ownerId, 154, "Chaos Warp", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{R}"); this.expansionSetCode = "VMA"; - // The owner of target permanent shuffles it into his or her library, this.getSpellAbility().addEffect(new ChaosWarpShuffleIntoLibraryEffect()); this.getSpellAbility().addTarget(new TargetPermanent()); - //then reveals the top card of his or her library. + //then reveals the top card of his or her library. //If it's a permanent card, he or she puts it onto the battlefield. this.getSpellAbility().addEffect(new ChaosWarpRevealEffect()); - + } public ChaosWarp(final ChaosWarp card) { @@ -94,9 +93,9 @@ class ChaosWarpShuffleIntoLibraryEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null) { - Player owner = game.getPlayer(permanent.getOwnerId()); + Player owner = game.getPlayer(permanent.getOwnerId()); if (owner != null) { owner.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true); owner.shuffleLibrary(game); @@ -108,10 +107,10 @@ class ChaosWarpShuffleIntoLibraryEffect extends OneShotEffect { } class ChaosWarpRevealEffect extends OneShotEffect { - -public ChaosWarpRevealEffect() { + + public ChaosWarpRevealEffect() { super(Outcome.PutCardInPlay); - this.staticText = "then reveals the top card of his or her library. If it's a permanent card, he or she puts it onto the battlefield."; + this.staticText = "then reveals the top card of his or her library. If it's a permanent card, he or she puts it onto the battlefield"; } public ChaosWarpRevealEffect(final ChaosWarpRevealEffect effect) { @@ -138,11 +137,10 @@ public ChaosWarpRevealEffect() { if (owner.getLibrary().size() > 0) { Card card = owner.getLibrary().getFromTop(game); if (card != null) { - Cards cards = new CardsImpl(); - cards.add(card); - owner.revealCards(sourceObject.getName(), cards, game); - if (new FilterPermanentCard().match(card, game)) { - owner.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + Cards cards = new CardsImpl(card); + owner.revealCards(sourceObject.getIdName(), cards, game); + if (new FilterPermanentCard().match(card, game)) { + owner.moveCards(card, Zone.BATTLEFIELD, source, game); } } } diff --git a/Mage.Sets/src/mage/sets/vintagemasters/CrescendoOfWar.java b/Mage.Sets/src/mage/sets/vintagemasters/CrescendoOfWar.java new file mode 100644 index 00000000000..45773d8f0af --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/CrescendoOfWar.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.common.FilterBlockingCreature; + +/** + * + * @author fireshoes + */ +public class CrescendoOfWar extends CardImpl { + + public CrescendoOfWar(UUID ownerId) { + super(ownerId, 21, "Crescendo of War", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "VMA"; + + // At the beginning of each upkeep, put a strife counter on Crescendo of War. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.STRIFE.createInstance(1), true), TargetController.ANY, false)); + + // Attacking creatures get +1/+0 for each strife counter on Crescendo of War. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersCount(CounterType.STRIFE), new StaticValue(0), + Duration.WhileOnBattlefield, new FilterAttackingCreature(), false))); + + // Blocking creatures you control get +1/+0 for each strife counter on Crescendo of War. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersCount(CounterType.STRIFE), new StaticValue(0), + Duration.WhileOnBattlefield, new FilterBlockingCreature(), false))); + } + + public CrescendoOfWar(final CrescendoOfWar card) { + super(card); + } + + @Override + public CrescendoOfWar copy() { + return new CrescendoOfWar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/DacksDuplicate.java b/Mage.Sets/src/mage/sets/vintagemasters/DacksDuplicate.java index 7c2e0602262..476ad0d3747 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/DacksDuplicate.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/DacksDuplicate.java @@ -29,15 +29,16 @@ package mage.sets.vintagemasters; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.EntersBattlefieldEffect; +import mage.MageObject; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.CopyPermanentEffect; import mage.abilities.keyword.DethroneAbility; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.util.functions.ApplyToPermanent; @@ -57,11 +58,9 @@ public class DacksDuplicate extends CardImpl { this.toughness = new MageInt(0); // You may have Dack's Duplicate enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone. - this.addAbility(new SimpleStaticAbility( - Zone.BATTLEFIELD, - new EntersBattlefieldEffect(new CopyPermanentEffect(new DacksDuplicateApplyToPermanent()), - "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone", - true))); + Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new DacksDuplicateApplyToPermanent()); + effect.setText("as a copy of any creature on the battlefield except it gains haste and dethrone"); + this.addAbility(new EntersBattlefieldAbility(effect, true)); } public DacksDuplicate(final DacksDuplicate card) { @@ -86,4 +85,12 @@ class DacksDuplicateApplyToPermanent extends ApplyToPermanent { permanent.addAbility(HasteAbility.getInstance(), game); return true; } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + mageObject.getAbilities().add(new DethroneAbility()); + mageObject.getAbilities().add(HasteAbility.getInstance()); + return true; + } + } diff --git a/Mage.Sets/src/mage/sets/vintagemasters/DecreeOfJustice.java b/Mage.Sets/src/mage/sets/vintagemasters/DecreeOfJustice.java index 247b5ecf8b7..241c2d5b492 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/DecreeOfJustice.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/DecreeOfJustice.java @@ -60,7 +60,7 @@ public class DecreeOfJustice extends CardImpl { // Put X 4/4 white Angel creature tokens with flying onto the battlefield. - this.getSpellAbility().addEffect(new CreateTokenEffect(new AngelToken("C14"), new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new AngelToken(), new ManacostVariableValue())); // Cycling {2}{W} this.addAbility(new CyclingAbility(new ManaCostsImpl<>("{2}{W}"))); diff --git a/Mage.Sets/src/mage/sets/vintagemasters/Eureka.java b/Mage.Sets/src/mage/sets/vintagemasters/Eureka.java index c47f7887e12..d5dbfa28e5e 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/Eureka.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/Eureka.java @@ -53,7 +53,6 @@ public class Eureka extends CardImpl { super(ownerId, 208, "Eureka", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); this.expansionSetCode = "VMA"; - // Starting with you, each player may put a permanent card from his or her hand onto the battlefield. Repeat this process until no one puts a card onto the battlefield. this.getSpellAbility().addEffect(new EurekaEffect()); } @@ -108,7 +107,7 @@ class EurekaEffect extends OneShotEffect { if (target.chooseTarget(outcome, currentPlayer.getId(), source, game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - currentPlayer.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); + currentPlayer.moveCards(card, Zone.BATTLEFIELD, source, game); firstInactivePlayer = null; } } diff --git a/Mage.Sets/src/mage/sets/vintagemasters/FlowstoneSculpture.java b/Mage.Sets/src/mage/sets/vintagemasters/FlowstoneSculpture.java new file mode 100644 index 00000000000..6d67f89d7a5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/FlowstoneSculpture.java @@ -0,0 +1,144 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.HashSet; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LoneFox + */ +public class FlowstoneSculpture extends CardImpl { + + public FlowstoneSculpture(UUID ownerId) { + super(ownerId, 268, "Flowstone Sculpture", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); + this.expansionSetCode = "VMA"; + this.subtype.add("Shapeshifter"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {2}, Discard a card: Put a +1/+1 counter on Flowstone Sculpture or Flowstone Sculpture gains flying, first strike, or trample. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new FlowstoneSculptureEffect(), new ManaCostsImpl("{2}")); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public FlowstoneSculpture(final FlowstoneSculpture card) { + super(card); + } + + @Override + public FlowstoneSculpture copy() { + return new FlowstoneSculpture(this); + } +} + +class FlowstoneSculptureEffect extends OneShotEffect { + + private static final HashSet choices = new HashSet<>(); + + static { + choices.add("+1/+1 counter"); + choices.add("Flying"); + choices.add("First Strike"); + choices.add("Trample"); + } + + public FlowstoneSculptureEffect() { + super(Outcome.Benefit); + staticText = "Put a +1/+1 counter on {this} or {this} gains flying, first strike, or trample."; + } + + public FlowstoneSculptureEffect(final FlowstoneSculptureEffect effect) { + super(effect); + } + + @Override + public FlowstoneSculptureEffect copy() { + return new FlowstoneSculptureEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if(controller != null) { + Choice choice = new ChoiceImpl(true); + choice.setMessage("Choose ability to add"); + choice.setChoices(choices); + while(!controller.choose(outcome, choice, game)) { + if(controller.canRespond()) { + return false; + } + } + + String chosen = choice.getChoice(); + if(chosen.equals("+1/+1 counter")) { + return new AddCountersSourceEffect(CounterType.P1P1.createInstance()).apply(game, source); + } + else { + Ability gainedAbility; + if(chosen.equals("Flying")) { + gainedAbility = FlyingAbility.getInstance(); + } + else if(chosen.equals("First strike")) { + gainedAbility = FirstStrikeAbility.getInstance(); + } + else { + gainedAbility = TrampleAbility.getInstance(); + } + game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.WhileOnBattlefield), source); + return true; + } + + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/GoblinGoon.java b/Mage.Sets/src/mage/sets/vintagemasters/GoblinGoon.java new file mode 100644 index 00000000000..e36435f4894 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/GoblinGoon.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author emerald000 + */ +public class GoblinGoon extends mage.sets.legions.GoblinGoon { + + public GoblinGoon(UUID ownerId) { + super(ownerId); + this.cardNumber = 166; + this.expansionSetCode = "VMA"; + this.rarity = Rarity.UNCOMMON; + } + + public GoblinGoon(final GoblinGoon card) { + super(card); + } + + @Override + public GoblinGoon copy() { + return new GoblinGoon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/JungleWurm.java b/Mage.Sets/src/mage/sets/vintagemasters/JungleWurm.java new file mode 100644 index 00000000000..85d9d57a05e --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/JungleWurm.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class JungleWurm extends mage.sets.mirage.JungleWurm { + + public JungleWurm(UUID ownerId) { + super(ownerId); + this.cardNumber = 217; + this.expansionSetCode = "VMA"; + } + + public JungleWurm(final JungleWurm card) { + super(card); + } + + @Override + public JungleWurm copy() { + return new JungleWurm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java b/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java index d94e06339c3..2af317e2e49 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java @@ -29,6 +29,7 @@ package mage.sets.vintagemasters; import java.util.UUID; import mage.abilities.Ability; +import mage.abilities.Mode; import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.ManacostVariableValue; @@ -44,14 +45,13 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.target.Target; -import mage.target.Targets; import mage.target.common.TargetCreatureOrPlayer; import mage.util.CardUtil; /** * * @author LoneFox - + * */ public class KaerveksTorch extends CardImpl { @@ -95,13 +95,11 @@ class KaerveksTorchCostIncreaseEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if(abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) - { - for(UUID modeId: abilityToModify.getModes().getSelectedModes()) { - abilityToModify.getModes().setActiveMode(modeId); - for(Target target: abilityToModify.getTargets()) { - for(UUID id: target.getTargets()) { - if(id.equals(source.getSourceObject(game).getId())) { + if (abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) { + for (Mode mode : abilityToModify.getModes().getSelectedModes()) { + for (Target target : mode.getTargets()) { + for (UUID targetId : target.getTargets()) { + if (targetId.equals(source.getSourceObject(game).getId())) { return true; } } diff --git a/Mage.Sets/src/mage/sets/vintagemasters/KrovikanSorcerer.java b/Mage.Sets/src/mage/sets/vintagemasters/KrovikanSorcerer.java new file mode 100644 index 00000000000..dbc7f439960 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/KrovikanSorcerer.java @@ -0,0 +1,139 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.common.TargetCardInHand; + +/** + * + * @author emerald000 + */ +public class KrovikanSorcerer extends CardImpl { + + private static final FilterCard filterNonBlack = new FilterCard("a nonblack card"); + private static final FilterCard filterBlack = new FilterCard("a black card"); + static { + filterNonBlack.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + filterBlack.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public KrovikanSorcerer(UUID ownerId) { + super(ownerId, 77, "Krovikan Sorcerer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "VMA"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}, Discard a nonblack card: Draw a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new TapSourceCost()); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(filterNonBlack))); + this.addAbility(ability); + + // {tap}, Discard a black card: Draw two cards, then discard one of them. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new KrovikanSorcererEffect(), new TapSourceCost()); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(filterBlack))); + this.addAbility(ability); + } + + public KrovikanSorcerer(final KrovikanSorcerer card) { + super(card); + } + + @Override + public KrovikanSorcerer copy() { + return new KrovikanSorcerer(this); + } +} + +class KrovikanSorcererEffect extends OneShotEffect { + + KrovikanSorcererEffect() { + super(Outcome.DrawCard); + this.staticText = "Draw two cards, then discard one of them"; + } + + KrovikanSorcererEffect(final KrovikanSorcererEffect effect) { + super(effect); + } + + @Override + public KrovikanSorcererEffect copy() { + return new KrovikanSorcererEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + Cards initialHand = player.getHand().copy(); + player.drawCards(2, game); + Cards drawnCards = new CardsImpl(Zone.PICK); + for (UUID cardId : player.getHand()) { + if (!initialHand.contains(cardId)) { + drawnCards.add(cardId); + } + } + if (drawnCards.size() > 0) { + TargetCard cardToDiscard = new TargetCard(Zone.PICK, new FilterCard("card to discard")); + cardToDiscard.setNotTarget(true); + if (player.choose(Outcome.Discard, drawnCards, cardToDiscard, game)) { + Card card = player.getHand().get(cardToDiscard.getFirstTarget(), game); + if (card != null) { + return player.discard(card, source, game); + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/LurkingEvil.java b/Mage.Sets/src/mage/sets/vintagemasters/LurkingEvil.java new file mode 100644 index 00000000000..14cbf8bb012 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/LurkingEvil.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author emerald000 + */ +public class LurkingEvil extends mage.sets.urzassaga.LurkingEvil { + + public LurkingEvil(UUID ownerId) { + super(ownerId); + this.cardNumber = 127; + this.expansionSetCode = "VMA"; + this.rarity = Rarity.UNCOMMON; + } + + public LurkingEvil(final LurkingEvil card) { + super(card); + } + + @Override + public LurkingEvil copy() { + return new LurkingEvil(this); + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/MagisterOfWorth.java b/Mage.Sets/src/mage/sets/vintagemasters/MagisterOfWorth.java new file mode 100644 index 00000000000..5242c1ab252 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/MagisterOfWorth.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class MagisterOfWorth extends mage.sets.mediainserts.MagisterOfWorth { + + public MagisterOfWorth(UUID ownerId) { + super(ownerId); + this.cardNumber = 255; + this.expansionSetCode = "VMA"; + this.rarity = Rarity.RARE; + } + + public MagisterOfWorth(final MagisterOfWorth card) { + super(card); + } + + @Override + public MagisterOfWorth copy() { + return new MagisterOfWorth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/ManaDrain.java b/Mage.Sets/src/mage/sets/vintagemasters/ManaDrain.java index 16cc9baccb3..ac4ba8c8c7f 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/ManaDrain.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/ManaDrain.java @@ -1,109 +1,109 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.vintagemasters; - -import java.util.UUID; -import mage.Mana; -import mage.abilities.Ability; -import mage.abilities.common.delayed.AtTheBeginOMainPhaseDelayedTriggeredAbility; -import mage.abilities.common.delayed.AtTheBeginOMainPhaseDelayedTriggeredAbility.PhaseSelection; -import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.game.Game; -import mage.game.stack.Spell; -import mage.target.TargetSpell; -import mage.target.targetpointer.FixedTarget; - -/** - * - * @author LevelX2 - */ -public class ManaDrain extends CardImpl { - - public ManaDrain(UUID ownerId) { - super(ownerId, 78, "Mana Drain", Rarity.MYTHIC, new CardType[]{CardType.INSTANT}, "{U}{U}"); - this.expansionSetCode = "VMA"; - - - // Counter target spell. At the beginning of your next main phase, add {X} to your mana pool, where X is that spell's converted mana cost. - this.getSpellAbility().addTarget(new TargetSpell()); - this.getSpellAbility().addEffect(new ManaDrainCounterEffect()); - } - - public ManaDrain(final ManaDrain card) { - super(card); - } - - @Override - public ManaDrain copy() { - return new ManaDrain(this); - } -} - -class ManaDrainCounterEffect extends OneShotEffect { - - public ManaDrainCounterEffect() { - super(Outcome.Benefit); - this.staticText = "Counter target spell. At the beginning of your next main phase, add {X} to your mana pool, where X is that spell's converted mana cost"; - } - - public ManaDrainCounterEffect(final ManaDrainCounterEffect effect) { - super(effect); - } - - @Override - public ManaDrainCounterEffect copy() { - return new ManaDrainCounterEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); - if (spell != null) { - game.getStack().counter(getTargetPointer().getFirst(game, source), source.getSourceId(), game); - // mana gets added also if counter is not successful - int cmc = spell.getConvertedManaCost(); - Effect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(0,0,0,0,0,cmc,0), "your"); - effect.setTargetPointer(new FixedTarget(source.getControllerId())); - AtTheBeginOMainPhaseDelayedTriggeredAbility delayedAbility = - new AtTheBeginOMainPhaseDelayedTriggeredAbility(effect, false, TargetController.YOU, PhaseSelection.NEXT_MAIN); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - return true; - } - return false; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfMainPhaseDelayedTriggeredAbility; +import mage.abilities.common.delayed.AtTheBeginOfMainPhaseDelayedTriggeredAbility.PhaseSelection; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.target.TargetSpell; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class ManaDrain extends CardImpl { + + public ManaDrain(UUID ownerId) { + super(ownerId, 78, "Mana Drain", Rarity.MYTHIC, new CardType[]{CardType.INSTANT}, "{U}{U}"); + this.expansionSetCode = "VMA"; + + + // Counter target spell. At the beginning of your next main phase, add {X} to your mana pool, where X is that spell's converted mana cost. + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new ManaDrainCounterEffect()); + } + + public ManaDrain(final ManaDrain card) { + super(card); + } + + @Override + public ManaDrain copy() { + return new ManaDrain(this); + } +} + +class ManaDrainCounterEffect extends OneShotEffect { + + public ManaDrainCounterEffect() { + super(Outcome.Benefit); + this.staticText = "Counter target spell. At the beginning of your next main phase, add {X} to your mana pool, where X is that spell's converted mana cost"; + } + + public ManaDrainCounterEffect(final ManaDrainCounterEffect effect) { + super(effect); + } + + @Override + public ManaDrainCounterEffect copy() { + return new ManaDrainCounterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); + if (spell != null) { + game.getStack().counter(getTargetPointer().getFirst(game, source), source.getSourceId(), game); + // mana gets added also if counter is not successful + int cmc = spell.getConvertedManaCost(); + Effect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(0,0,0,0,0,cmc,0), "your"); + effect.setTargetPointer(new FixedTarget(source.getControllerId())); + AtTheBeginOfMainPhaseDelayedTriggeredAbility delayedAbility = + new AtTheBeginOfMainPhaseDelayedTriggeredAbility(effect, false, TargetController.YOU, PhaseSelection.NEXT_MAIN); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/MindsDesire.java b/Mage.Sets/src/mage/sets/vintagemasters/MindsDesire.java index 0533cb5b646..184e2b898b9 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/MindsDesire.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/MindsDesire.java @@ -140,7 +140,7 @@ class MindsDesireCastFromExileEffect extends AsThoughEffectImpl { Card card = game.getCard(sourceId); if (card != null && game.getState().getZone(sourceId) == Zone.EXILED) { Player player = game.getPlayer(affectedControllerId); - player.setCastSourceIdWithAlternateMana(sourceId, null); + player.setCastSourceIdWithAlternateMana(sourceId, null, null); return true; } } diff --git a/Mage.Sets/src/mage/sets/vintagemasters/MishrasWorkshop.java b/Mage.Sets/src/mage/sets/vintagemasters/MishrasWorkshop.java index afac89175d6..f81f43f940b 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/MishrasWorkshop.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/MishrasWorkshop.java @@ -28,14 +28,13 @@ package mage.sets.vintagemasters; import java.util.UUID; -import mage.ConditionalMana; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.mana.ConditionalColorlessManaAbility; -import mage.abilities.mana.builder.ConditionalManaBuilder; -import mage.abilities.mana.conditional.ArtifactCastConditionalMana; +import mage.abilities.mana.conditional.ConditionalSpellManaBuilder; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; +import mage.filter.common.FilterArtifactSpell; /** * @@ -48,7 +47,8 @@ public class MishrasWorkshop extends CardImpl { this.expansionSetCode = "VMA"; // {tap}: Add {3} to your mana pool. Spend this mana only to cast artifact spells. - this.addAbility(new ConditionalColorlessManaAbility(new TapSourceCost(), 3, new MishrasWorkshopManaBuilder())); + this.addAbility(new ConditionalColorlessManaAbility(new TapSourceCost(), 3, + new ConditionalSpellManaBuilder(new FilterArtifactSpell("artifact spells")))); } @@ -61,15 +61,3 @@ public class MishrasWorkshop extends CardImpl { return new MishrasWorkshop(this); } } - -class MishrasWorkshopManaBuilder extends ConditionalManaBuilder { - @Override - public ConditionalMana build(Object... options) { - return new ArtifactCastConditionalMana(this.mana); - } - - @Override - public String getRule() { - return "Spend this mana only to cast artifact spells"; - } -} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/MistmoonGriffin.java b/Mage.Sets/src/mage/sets/vintagemasters/MistmoonGriffin.java index d6f979dca39..290f1681191 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/MistmoonGriffin.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/MistmoonGriffin.java @@ -97,13 +97,13 @@ class MistmoonGriffinEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card lastCreatureCard = null; - for (Card card :controller.getGraveyard().getCards(game)) { + for (Card card : controller.getGraveyard().getCards(game)) { if (card.getCardType().contains(CardType.CREATURE)) { lastCreatureCard = card; } } if (lastCreatureCard != null) { - return controller.putOntoBattlefieldWithInfo(lastCreatureCard, game, Zone.GRAVEYARD, source.getSourceId()); + return controller.moveCards(lastCreatureCard, Zone.BATTLEFIELD, source, game); } return true; } diff --git a/Mage.Sets/src/mage/sets/vintagemasters/NorwoodPriestess.java b/Mage.Sets/src/mage/sets/vintagemasters/NorwoodPriestess.java index 423afe9b1c1..b1ca906bdae 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/NorwoodPriestess.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/NorwoodPriestess.java @@ -62,7 +62,7 @@ public class NorwoodPriestess extends CardImpl { this.toughness = new MageInt(1); // {tap}: You may put a green creature card from your hand onto the battlefield. Activate this ability only during your turn, before attackers are declared. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new NorwoodPriestessEffect(), new TapSourceCost(), MyTurnBeforeAttackersDeclaredCondition.getInstance()); this.addAbility(ability); } @@ -80,9 +80,9 @@ public class NorwoodPriestess extends CardImpl { class NorwoodPriestessEffect extends OneShotEffect { private static final String choiceText = "Put a green creature card from your hand onto the battlefield?"; - + private static final FilterCreatureCard filter = new FilterCreatureCard("a green creature card"); - + static { filter.add(new ColorPredicate(ObjectColor.GREEN)); } @@ -103,19 +103,18 @@ class NorwoodPriestessEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null || !controller.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) { return false; } TargetCardInHand target = new TargetCardInHand(filter); - if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { + if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId()); - return true; + return controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/Ophidian.java b/Mage.Sets/src/mage/sets/vintagemasters/Ophidian.java new file mode 100644 index 00000000000..4061bbe1385 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/Ophidian.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.AssignNoCombatDamageSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Ophidian extends CardImpl { + + public Ophidian(UUID ownerId) { + super(ownerId, 84, "Ophidian", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "VMA"; + this.subtype.add("Snake"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Whenever Ophidian attacks and isn't blocked, you may draw a card. If you do, Ophidian assigns no combat damage this turn. + Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(new DrawCardSourceControllerEffect(1), true); + ability.addEffect(new AssignNoCombatDamageSourceEffect(Duration.EndOfTurn, true)); + this.addAbility(ability); + } + + public Ophidian(final Ophidian card) { + super(card); + } + + @Override + public Ophidian copy() { + return new Ophidian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/ReignOfThePit.java b/Mage.Sets/src/mage/sets/vintagemasters/ReignOfThePit.java new file mode 100644 index 00000000000..46e2cf0c3ae --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/ReignOfThePit.java @@ -0,0 +1,134 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.Token; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author emerald000 + */ +public class ReignOfThePit extends CardImpl { + + public ReignOfThePit(UUID ownerId) { + super(ownerId, 138, "Reign of the Pit", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}{B}"); + this.expansionSetCode = "VMA"; + + // Each player sacrifices a creature. Put an X/X black Demon creature token with flying onto the battlefield, where X is the total power of the creatures sacrificed this way. + this.getSpellAbility().addEffect(new ReignOfThePitEffect()); + } + + public ReignOfThePit(final ReignOfThePit card) { + super(card); + } + + @Override + public ReignOfThePit copy() { + return new ReignOfThePit(this); + } +} + +class ReignOfThePitEffect extends OneShotEffect { + + ReignOfThePitEffect() { + super(Outcome.Sacrifice); + this.staticText = "Each player sacrifices a creature. Put an X/X black Demon creature token with flying onto the battlefield, where X is the total power of the creatures sacrificed this way"; + } + + ReignOfThePitEffect(final ReignOfThePitEffect effect) { + super(effect); + } + + @Override + public ReignOfThePitEffect copy() { + return new ReignOfThePitEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + int totalPowerSacrificed = 0; + List perms = new ArrayList<>(); + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent(), true); + if (target.canChoose(player.getId(), game)) { + while (!target.isChosen() && player.canRespond()) { + player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); + } + perms.addAll(target.getTargets()); + } + } + } + for (UUID permID : perms) { + Permanent permanent = game.getPermanent(permID); + if (permanent != null) { + int power = permanent.getPower().getValue(); + if (permanent.sacrifice(source.getSourceId(), game)) { + totalPowerSacrificed += power; + } + } + } + new CreateTokenEffect(new ReignOfThePitToken(totalPowerSacrificed)).apply(game, source); + return true; + } +} + +class ReignOfThePitToken extends Token { + + ReignOfThePitToken(int xValue) { + super("Demon", "X/X black Demon creature token with flying"); + power = new MageInt(xValue); + toughness = new MageInt(xValue); + color.setBlack(true); + subtype.add("Demon"); + cardType.add(CardType.CREATURE); + this.addAbility(FlyingAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/RitesOfInitiation.java b/Mage.Sets/src/mage/sets/vintagemasters/RitesOfInitiation.java new file mode 100644 index 00000000000..7ce9f398b1d --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/RitesOfInitiation.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author emerald000 + */ +public class RitesOfInitiation extends mage.sets.odyssey.RitesOfInitiation { + + public RitesOfInitiation(UUID ownerId) { + super(ownerId); + this.cardNumber = 182; + this.expansionSetCode = "VMA"; + this.rarity = Rarity.UNCOMMON; + } + + public RitesOfInitiation(final RitesOfInitiation card) { + super(card); + } + + @Override + public RitesOfInitiation copy() { + return new RitesOfInitiation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/SaprolingBurst.java b/Mage.Sets/src/mage/sets/vintagemasters/SaprolingBurst.java new file mode 100644 index 00000000000..3e8b281f8f9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/SaprolingBurst.java @@ -0,0 +1,242 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.ZoneChangeTriggeredAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.keyword.FadingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.Token; +import mage.util.CardUtil; + +/** + * + * @author emerald000 + */ +public class SaprolingBurst extends CardImpl { + + public SaprolingBurst(UUID ownerId) { + super(ownerId, 230, "Saproling Burst", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{G}"); + this.expansionSetCode = "VMA"; + + // Fading 7 + this.addAbility(new FadingAbility(7, this)); + + // Remove a fade counter from Saproling Burst: Put a green Saproling creature token onto the battlefield. It has "This creature's power and toughness are each equal to the number of fade counters on Saproling Burst." + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SaprolingBurstCreateTokenEffect(), new RemoveCountersSourceCost(CounterType.FADE.createInstance()))); + + // When Saproling Burst leaves the battlefield, destroy all tokens put onto the battlefield with Saproling Burst. They can't be regenerated. + this.addAbility(new SaprolingBurstLeavesBattlefieldTriggeredAbility()); + } + + public SaprolingBurst(final SaprolingBurst card) { + super(card); + } + + @Override + public SaprolingBurst copy() { + return new SaprolingBurst(this); + } +} + +class SaprolingBurstCreateTokenEffect extends OneShotEffect { + + SaprolingBurstCreateTokenEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "Put a green Saproling creature token onto the battlefield. It has \"This creature's power and toughness are each equal to the number of fade counters on {this}.\""; + } + + SaprolingBurstCreateTokenEffect(final SaprolingBurstCreateTokenEffect effect) { + super(effect); + } + + @Override + public SaprolingBurstCreateTokenEffect copy() { + return new SaprolingBurstCreateTokenEffect(this); + } + + @Override + @SuppressWarnings("unchecked") + public boolean apply(Game game, Ability source) { + Token token = new SaprolingBurstToken(new MageObjectReference(source.getSourceObject(game), game)); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + Object object = game.getState().getValue(CardUtil.getCardZoneString("_tokensCreated", source.getSourceId(), game)); + Set tokensCreated; + if (object != null) { + tokensCreated = (Set) object; + } + else { + tokensCreated = new HashSet<>(); + } + for (UUID tokenId : token.getLastAddedTokenIds()) { + tokensCreated.add(tokenId); + } + game.getState().setValue(CardUtil.getCardZoneString("_tokensCreated", source.getSourceId(), game), tokensCreated); + } + return true; + } +} + +class SaprolingBurstToken extends Token { + + SaprolingBurstToken(MageObjectReference saprolingBurstMOR) { + super("Saproling", "green Saproling creature token with \"This creature's power and toughness are each equal to the number of fade counters on Saproling Burst.\""); + this.color.setGreen(true); + this.subtype.add("Saproling"); + this.cardType.add(CardType.CREATURE); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new SaprolingBurstTokenDynamicValue(saprolingBurstMOR), Duration.WhileOnBattlefield))); + } +} + +class SaprolingBurstTokenDynamicValue implements DynamicValue { + + private final MageObjectReference saprolingBurstMOR; + + SaprolingBurstTokenDynamicValue(MageObjectReference saprolingBurstMOR) { + this.saprolingBurstMOR = saprolingBurstMOR; + } + + SaprolingBurstTokenDynamicValue(final SaprolingBurstTokenDynamicValue dynamicValue) { + this.saprolingBurstMOR = dynamicValue.saprolingBurstMOR; + } + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Permanent permanent = this.saprolingBurstMOR.getPermanent(game); + if (permanent != null) { + return permanent.getCounters().getCount(CounterType.FADE); + } + return 0; + } + + @Override + public SaprolingBurstTokenDynamicValue copy() { + return new SaprolingBurstTokenDynamicValue(this); + } + + @Override + public String toString() { + return "X"; + } + + @Override + public String getMessage() { + return "the number of fade counters on Saproling Burst"; + } +} + +class SaprolingBurstLeavesBattlefieldTriggeredAbility extends ZoneChangeTriggeredAbility { + + SaprolingBurstLeavesBattlefieldTriggeredAbility() { + super(Zone.BATTLEFIELD, null, new SaprolingBurstDestroyEffect(), "When {this} leaves the battlefield, ", false); + } + + SaprolingBurstLeavesBattlefieldTriggeredAbility(SaprolingBurstLeavesBattlefieldTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (super.checkTrigger(event, game)) { + for (Effect effect : this.getEffects()) { + if (effect instanceof SaprolingBurstDestroyEffect) { + ((SaprolingBurstDestroyEffect) effect).setCardZoneString(CardUtil.getCardZoneString("_tokensCreated", this.getSourceId(), game, true)); + } + } + return true; + } + return false; + } + + @Override + public SaprolingBurstLeavesBattlefieldTriggeredAbility copy() { + return new SaprolingBurstLeavesBattlefieldTriggeredAbility(this); + } +} + +class SaprolingBurstDestroyEffect extends OneShotEffect { + + private String cardZoneString; + + SaprolingBurstDestroyEffect() { + super(Outcome.Benefit); + this.staticText = "destroy all tokens put onto the battlefield with {this}. They can't be regenerated"; + } + + SaprolingBurstDestroyEffect(final SaprolingBurstDestroyEffect effect) { + super(effect); + this.cardZoneString = effect.cardZoneString; + } + + @Override + public SaprolingBurstDestroyEffect copy() { + return new SaprolingBurstDestroyEffect(this); + } + + @Override + @SuppressWarnings("unchecked") + public boolean apply(Game game, Ability source) { + Object object = game.getState().getValue(cardZoneString); + if (object != null) { + Set tokensCreated = (Set) object; + for (UUID tokenId : tokensCreated) { + Permanent token = game.getPermanent(tokenId); + if (token != null) { + token.destroy(source.getSourceId(), game, true); + } + } + } + return true; + } + + public void setCardZoneString(String cardZoneString) { + this.cardZoneString = cardZoneString; + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/ThopterSquadron.java b/Mage.Sets/src/mage/sets/vintagemasters/ThopterSquadron.java index c5748f4dcc3..24ec01d3920 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/ThopterSquadron.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/ThopterSquadron.java @@ -48,7 +48,7 @@ import mage.counters.CounterType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.AnotherPredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.ThopterColorlessToken; import mage.target.common.TargetControlledPermanent; /** @@ -56,14 +56,14 @@ import mage.target.common.TargetControlledPermanent; * @author LevelX2 */ public class ThopterSquadron extends CardImpl { - + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another Thopter"); - + static { filter.add(new AnotherPredicate()); filter.add(new SubtypePredicate("Thopter")); } - + public ThopterSquadron(UUID ownerId) { super(ownerId, 286, "Thopter Squadron", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); this.expansionSetCode = "VMA"; @@ -75,16 +75,16 @@ public class ThopterSquadron extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Thopter Squadron enters the battlefield with three +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), "with three +1/+1 counters on it")); - + // {1}, Remove a +1/+1 counter from Thopter Squadron: Put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield. Activate this ability only any time you could cast a sorcery. - Ability firstAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new ThopterSquadronThopterToken(), 1), new GenericManaCost(1)); + Ability firstAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new ThopterColorlessToken(), 1), new GenericManaCost(1)); firstAbility.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1))); this.addAbility(firstAbility); - + // {1}, Sacrifice another Thopter: Put a +1/+1 counter on Thopter Squadron. Activate this ability only any time you could cast a sorcery. Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(), true), new ManaCostsImpl("{1}")); ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); - + } public ThopterSquadron(final ThopterSquadron card) { @@ -96,16 +96,3 @@ public class ThopterSquadron extends CardImpl { return new ThopterSquadron(this); } } - -class ThopterSquadronThopterToken extends Token { - public ThopterSquadronThopterToken() { - super("Thopter", "1/1 colorless Thopter artifact creature token with flying"); - cardType.add(CardType.ARTIFACT); - cardType.add(CardType.CREATURE); - subtype.add("Thopter"); - power = new MageInt(1); - toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/vintagemasters/ZhalfirinCrusader.java b/Mage.Sets/src/mage/sets/vintagemasters/ZhalfirinCrusader.java new file mode 100644 index 00000000000..1720e354f31 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/ZhalfirinCrusader.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.vintagemasters; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ZhalfirinCrusader extends mage.sets.visions.ZhalfirinCrusader { + + public ZhalfirinCrusader(UUID ownerId) { + super(ownerId); + this.cardNumber = 54; + this.expansionSetCode = "VMA"; + } + + public ZhalfirinCrusader(final ZhalfirinCrusader card) { + super(card); + } + + @Override + public ZhalfirinCrusader copy() { + return new ZhalfirinCrusader(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/Betrayal.java b/Mage.Sets/src/mage/sets/visions/Betrayal.java index db86ed389fc..94658d95827 100644 --- a/Mage.Sets/src/mage/sets/visions/Betrayal.java +++ b/Mage.Sets/src/mage/sets/visions/Betrayal.java @@ -67,7 +67,7 @@ public class Betrayal extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever enchanted creature becomes tapped, you draw a card. - this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); + this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1), "enchanted creature")); } public Betrayal(final Betrayal card) { diff --git a/Mage.Sets/src/mage/sets/visions/Chronatog.java b/Mage.Sets/src/mage/sets/visions/Chronatog.java new file mode 100644 index 00000000000..96dc557dda3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/Chronatog.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.turn.SkipNextTurnSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class Chronatog extends CardImpl { + + public Chronatog(UUID ownerId) { + super(ownerId, 28, "Chronatog", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Atog"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {0}: Chronatog gets +3/+3 until end of turn. You skip your next turn. Activate this ability only once each turn. + Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, 3, Duration.EndOfTurn), new GenericManaCost(0)); + ability.addEffect(new SkipNextTurnSourceEffect()); + this.addAbility(ability); + } + + public Chronatog(final Chronatog card) { + super(card); + } + + @Override + public Chronatog copy() { + return new Chronatog(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/Desertion.java b/Mage.Sets/src/mage/sets/visions/Desertion.java index 728c4856058..d963b62b70c 100644 --- a/Mage.Sets/src/mage/sets/visions/Desertion.java +++ b/Mage.Sets/src/mage/sets/visions/Desertion.java @@ -28,10 +28,8 @@ package mage.sets.visions; import java.util.UUID; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -41,9 +39,7 @@ import mage.filter.FilterSpell; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.stack.Spell; -import mage.game.stack.StackObject; +import mage.players.Player; import mage.target.TargetSpell; /** @@ -56,7 +52,6 @@ public class Desertion extends CardImpl { super(ownerId, 30, "Desertion", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{U}{U}"); this.expansionSetCode = "VIS"; - // Counter target spell. If an artifact or creature spell is countered this way, put that card onto the battlefield under your control instead of into its owner's graveyard. this.getSpellAbility().addEffect(new DesertionEffect()); this.getSpellAbility().addTarget(new TargetSpell()); @@ -81,7 +76,7 @@ class DesertionEffect extends OneShotEffect { new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE))); } - + public DesertionEffect() { super(Outcome.Detriment); this.staticText = "Counter target spell. If an artifact or creature spell is countered this way, put that card onto the battlefield under your control instead of into its owner's graveyard."; @@ -98,27 +93,11 @@ class DesertionEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - UUID objectId = source.getFirstTarget(); - UUID sourceId = source.getSourceId(); - - StackObject stackObject = game.getStack().getStackObject(objectId); - if (stackObject != null && !game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) { - if (stackObject instanceof Spell) { - game.rememberLKI(objectId, Zone.STACK, (Spell) stackObject); - game.getStack().remove(stackObject); - if (!((Spell) stackObject).isCopiedSpell() && filter.match(stackObject, source.getControllerId(), game)) { - MageObject card = game.getObject(stackObject.getSourceId()); - if (card instanceof Card) { - ((Card) card).putOntoBattlefield(game, Zone.STACK, source.getSourceId(), source.getControllerId()); - } - } else { - stackObject.counter(sourceId, game); - } - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId())); - return true; - } + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + return game.getStack().counter(targetPointer.getFirst(game, source), source.getSourceId(), game, Zone.BATTLEFIELD, false, false); } return false; } - + } diff --git a/Mage.Sets/src/mage/sets/visions/DwarvenVigilantes.java b/Mage.Sets/src/mage/sets/visions/DwarvenVigilantes.java new file mode 100644 index 00000000000..a82414a6a7e --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/DwarvenVigilantes.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.AssignNoCombatDamageSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DwarvenVigilantes extends CardImpl { + + public DwarvenVigilantes(UUID ownerId) { + super(ownerId, 77, "Dwarven Vigilantes", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Dwarf"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Dwarven Vigilantes attacks and isn't blocked, you may have it deal damage equal to its power to target creature. If you do, Dwarven Vigilantes assigns no combat damage this turn. + Effect effect = new DamageTargetEffect(new SourcePermanentPowerCount()); + effect.setText("it deal damage equal to its power to target creature"); + Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(effect, true); + ability.addEffect(new AssignNoCombatDamageSourceEffect(Duration.EndOfTurn, true)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public DwarvenVigilantes(final DwarvenVigilantes card) { + super(card); + } + + @Override + public DwarvenVigilantes copy() { + return new DwarvenVigilantes(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/EmeraldCharm.java b/Mage.Sets/src/mage/sets/visions/EmeraldCharm.java new file mode 100644 index 00000000000..9897e61e069 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/EmeraldCharm.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.effects.common.continuous.LoseAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author fireshoes + */ +public class EmeraldCharm extends CardImpl { + + private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("non-Aura enchantment"); + + static { + filter.add(Predicates.not(new SubtypePredicate("Aura"))); + } + + public EmeraldCharm(UUID ownerId) { + super(ownerId, 56, "Emerald Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "VIS"; + + // Choose one - Untap target permanent; + this.getSpellAbility().addEffect(new UntapTargetEffect()); + this.getSpellAbility().addTarget(new TargetPermanent()); + + // or destroy target non-Aura enchantment; + Mode mode = new Mode(); + mode.getEffects().add(new DestroyTargetEffect()); + mode.getTargets().add(new TargetEnchantmentPermanent(filter)); + this.getSpellAbility().addMode(mode); + + // or target creature loses flying until end of turn. + mode = new Mode(); + mode.getEffects().add(new LoseAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); + mode.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode); + } + + public EmeraldCharm(final EmeraldCharm card) { + super(card); + } + + @Override + public EmeraldCharm copy() { + return new EmeraldCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/FeralInstinct.java b/Mage.Sets/src/mage/sets/visions/FeralInstinct.java new file mode 100644 index 00000000000..ce469c363f8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/FeralInstinct.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class FeralInstinct extends CardImpl { + + public FeralInstinct(UUID ownerId) { + super(ownerId, 57, "Feral Instinct", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "VIS"; + + // Target creature gets +1/+1 until end of turn. + this.getSpellAbility().addEffect(new BoostTargetEffect(1, 1, Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public FeralInstinct(final FeralInstinct card) { + super(card); + } + + @Override + public FeralInstinct copy() { + return new FeralInstinct(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/FirestormHellkite.java b/Mage.Sets/src/mage/sets/visions/FirestormHellkite.java new file mode 100644 index 00000000000..b8c1bb96e04 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/FirestormHellkite.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FirestormHellkite extends CardImpl { + + public FirestormHellkite(UUID ownerId) { + super(ownerId, 130, "Firestorm Hellkite", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}{R}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Dragon"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Cumulative upkeep {U}{R} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{U}{R}"))); + } + + public FirestormHellkite(final FirestormHellkite card) { + super(card); + } + + @Override + public FirestormHellkite copy() { + return new FirestormHellkite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/FloodedShoreline.java b/Mage.Sets/src/mage/sets/visions/FloodedShoreline.java new file mode 100644 index 00000000000..49d125f91b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/FloodedShoreline.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class FloodedShoreline extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("Islands"); + + static { + filter.add(new SubtypePredicate("Island")); + } + + public FloodedShoreline(UUID ownerId) { + super(ownerId, 32, "Flooded Shoreline", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}"); + this.expansionSetCode = "VIS"; + + // {U}{U}, Return two Islands you control to their owner's hand: Return target creature to its owner's hand. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{U}{U}")); + ability.addCost(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2,2, filter, true))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FloodedShoreline(final FloodedShoreline card) { + super(card); + } + + @Override + public FloodedShoreline copy() { + return new FloodedShoreline(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/GiantCaterpillar.java b/Mage.Sets/src/mage/sets/visions/GiantCaterpillar.java new file mode 100644 index 00000000000..09ee570ba3d --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/GiantCaterpillar.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class GiantCaterpillar extends mage.sets.mercadianmasques.GiantCaterpillar { + + public GiantCaterpillar(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "VIS"; + } + + public GiantCaterpillar(final GiantCaterpillar card) { + super(card); + } + + @Override + public GiantCaterpillar copy() { + return new GiantCaterpillar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/GoblinRecruiter.java b/Mage.Sets/src/mage/sets/visions/GoblinRecruiter.java index b2951b39274..9d574f3020b 100644 --- a/Mage.Sets/src/mage/sets/visions/GoblinRecruiter.java +++ b/Mage.Sets/src/mage/sets/visions/GoblinRecruiter.java @@ -32,19 +32,16 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; -import mage.target.TargetCard; import mage.target.common.TargetCardInLibrary; /** @@ -78,18 +75,16 @@ public class GoblinRecruiter extends CardImpl { class GoblinRecruiterEffect extends OneShotEffect { private static final FilterCard goblinFilter = new FilterCard("Goblin cards"); - - private static final FilterCard putOnTopOfLibraryFilter = new FilterCard("card to put on the top of your library (last chosen will be on top)"); - + static { goblinFilter.add(new SubtypePredicate("Goblin")); } - + public GoblinRecruiterEffect() { super(Outcome.Benefit); this.staticText = "search your library for any number of Goblin cards and reveal those cards. Shuffle your library, then put them on top of it in any order."; } - + public GoblinRecruiterEffect(final GoblinRecruiterEffect effect) { super(effect); } @@ -98,54 +93,26 @@ class GoblinRecruiterEffect extends OneShotEffect { public GoblinRecruiterEffect copy() { return new GoblinRecruiterEffect(this); } - + @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { TargetCardInLibrary targetGoblins = new TargetCardInLibrary(0, Integer.MAX_VALUE, goblinFilter); Cards cards = new CardsImpl(); - if (player.searchLibrary(targetGoblins, game)) { - for (UUID targetId : targetGoblins.getTargets()) { - Card card = player.getLibrary().remove(targetId, game); - if (card != null) { - cards.add(card); - } - } + if (controller.searchLibrary(targetGoblins, game)) { + cards.addAll(targetGoblins.getTargets()); } - - player.shuffleLibrary(game); - + controller.revealCards(staticText, cards, game); + controller.shuffleLibrary(game); + int numberOfGoblins = cards.size(); if (numberOfGoblins > 0) { - if (cards.size() > 1) { - TargetCard targetCard = new TargetCard(Zone.LIBRARY, putOnTopOfLibraryFilter); - while (player.canRespond() && cards.size() > 1) { - player.choose(Outcome.Benefit, cards, targetCard, game); - Card card = cards.get(targetCard.getFirstTarget(), game); - if (card != null) { - cards.remove(card); - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - targetCard.clearChosen(); - } - } - if (cards.size() == 1) { - Card card = cards.get(cards.iterator().next(), game); - if (card != null) { - cards.remove(card); - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - } + controller.putCardsOnTopOfLibrary(cards, game, source, true); } - - game.informPlayers(new StringBuilder(player.getLogName()).append(" puts ") - .append(numberOfGoblins).append(" Goblin").append(numberOfGoblins == 1 ? " card" : " cards") - .append(" on top of his library").toString()); - return true; } return false; } - + } diff --git a/Mage.Sets/src/mage/sets/visions/GoblinSwineRider.java b/Mage.Sets/src/mage/sets/visions/GoblinSwineRider.java new file mode 100644 index 00000000000..34a515481e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/GoblinSwineRider.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.DamageAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingOrBlockingCreature; + +/** + * + * @author LoneFox + */ +public class GoblinSwineRider extends CardImpl { + + public GoblinSwineRider(UUID ownerId) { + super(ownerId, 81, "Goblin Swine-Rider", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Goblin"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Goblin Swine-Rider becomes blocked, it deals 2 damage to each attacking creature and each blocking creature. + this.addAbility(new BecomesBlockedTriggeredAbility(new DamageAllEffect(2, new FilterAttackingOrBlockingCreature("attacking creature and each blocking creature")), false)); + } + + public GoblinSwineRider(final GoblinSwineRider card) { + super(card); + } + + @Override + public GoblinSwineRider copy() { + return new GoblinSwineRider(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/GossamerChains.java b/Mage.Sets/src/mage/sets/visions/GossamerChains.java new file mode 100644 index 00000000000..aa991ac8fd6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/GossamerChains.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ReturnToHandSourceCost; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.UnblockedPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class GossamerChains extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("unblocked creature"); + + static { + filter.add(new UnblockedPredicate()); + } + + public GossamerChains(UUID ownerId) { + super(ownerId, 106, "Gossamer Chains", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}"); + this.expansionSetCode = "VIS"; + + // Return Gossamer Chains to its owner's hand: Prevent all combat damage that would be dealt by target unblocked creature this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageByTargetEffect(Duration.EndOfTurn, true), new ReturnToHandSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public GossamerChains(final GossamerChains card) { + super(card); + } + + @Override + public GossamerChains copy() { + return new GossamerChains(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/HearthCharm.java b/Mage.Sets/src/mage/sets/visions/HearthCharm.java new file mode 100644 index 00000000000..43443a8296d --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/HearthCharm.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.filter.predicate.permanent.AttackingPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class HearthCharm extends CardImpl { + + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("artifact creature"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("attacking creatures"); + private static final FilterCreaturePermanent filter3 = new FilterCreaturePermanent("creature with power 2 or less"); + static { + filter1.add(new CardTypePredicate(CardType.ARTIFACT)); + filter2.add(new AttackingPredicate()); + filter3.add(new PowerPredicate(Filter.ComparisonType.LessThan, 3)); + } + + public HearthCharm(UUID ownerId) { + super(ownerId, 82, "Hearth Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "VIS"; + + // Choose one - Destroy target artifact creature + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter1)); + // or attacking creatures get +1/+0 until end of turn + Mode mode = new Mode(); + mode.getEffects().add(new BoostAllEffect(1, 0, Duration.EndOfTurn, filter2, false)); + this.getSpellAbility().addMode(mode); + // or target creature with power 2 or less is unblockable this turn. + mode = new Mode(); + mode.getEffects().add(new CantBeBlockedTargetEffect()); + mode.getTargets().add(new TargetCreaturePermanent(filter3)); + this.getSpellAbility().addMode(mode); + } + + public HearthCharm(final HearthCharm card) { + super(card); + } + + @Override + public HearthCharm copy() { + return new HearthCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/HopeCharm.java b/Mage.Sets/src/mage/sets/visions/HopeCharm.java new file mode 100644 index 00000000000..bddab599788 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/HopeCharm.java @@ -0,0 +1,85 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.GainLifeTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.TargetPermanent; +import mage.target.TargetPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class HopeCharm extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Aura"); + + static { + filter.add(new SubtypePredicate("Aura")); + } + + public HopeCharm(UUID ownerId) { + super(ownerId, 108, "Hope Charm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "VIS"; + + // Choose one - Target creature gains first strike until end of turn + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // or target player gains 2 life + Mode mode = new Mode(); + mode.getEffects().add(new GainLifeTargetEffect(2)); + mode.getTargets().add(new TargetPlayer()); + this.getSpellAbility().addMode(mode); + // or destroy target Aura. + mode = new Mode(); + mode.getEffects().add(new DestroyTargetEffect()); + mode.getTargets().add(new TargetPermanent(filter)); + this.getSpellAbility().addMode(mode); + } + + public HopeCharm(final HopeCharm card) { + super(card); + } + + @Override + public HopeCharm copy() { + return new HopeCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/Impulse.java b/Mage.Sets/src/mage/sets/visions/Impulse.java index a259fd3b8e1..2a3a2bd0dba 100644 --- a/Mage.Sets/src/mage/sets/visions/Impulse.java +++ b/Mage.Sets/src/mage/sets/visions/Impulse.java @@ -46,7 +46,6 @@ public class Impulse extends CardImpl { super(ownerId, 34, "Impulse", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); this.expansionSetCode = "VIS"; - // Look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order. this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(4), false, new StaticValue(1), new FilterCard(), Zone.LIBRARY, false, false)); diff --git a/Mage.Sets/src/mage/sets/visions/JamuraanLion.java b/Mage.Sets/src/mage/sets/visions/JamuraanLion.java new file mode 100644 index 00000000000..4570f07eee4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/JamuraanLion.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.combat.CantBlockTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class JamuraanLion extends CardImpl { + + public JamuraanLion(UUID ownerId) { + super(ownerId, 110, "Jamuraan Lion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Cat"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // {W}, {tap}: Target creature can't block this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBlockTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{W}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public JamuraanLion(final JamuraanLion card) { + super(card); + } + + @Override + public JamuraanLion copy() { + return new JamuraanLion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/KeeperOfKookus.java b/Mage.Sets/src/mage/sets/visions/KeeperOfKookus.java new file mode 100644 index 00000000000..6c8d798a12c --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/KeeperOfKookus.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author BursegSardaukar + */ +public class KeeperOfKookus extends CardImpl { + + private static final FilterCard filter = new FilterCard("from red"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + + public KeeperOfKookus(UUID ownerId) { + super(ownerId, 85, "Keeper of Kookus", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Goblin"); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Keeper of Kookus gains protection from red until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(new ProtectionAbility(filter), Duration.EndOfTurn),new ManaCostsImpl("{R")); + this.addAbility(ability); + } + + public KeeperOfKookus(final KeeperOfKookus card) { + super(card); + } + + @Override + public KeeperOfKookus copy() { + return new KeeperOfKookus(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/visions/KnightOfValor.java b/Mage.Sets/src/mage/sets/visions/KnightOfValor.java new file mode 100644 index 00000000000..1c12875167f --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/KnightOfValor.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.keyword.FlankingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.BlockingAttackerIdPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class KnightOfValor extends CardImpl { + + public KnightOfValor(UUID ownerId) { + super(ownerId, 111, "Knight of Valor", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flanking + this.addAbility(new FlankingAbility()); + // {1}{W}: Each creature without flanking blocking Knight of Valor gets -1/-1 until end of turn. Activate this ability only once each turn. + FilterCreaturePermanent filter = new FilterCreaturePermanent("each creature without flanking blocking {this}"); + filter.add(Predicates.not(new AbilityPredicate(FlankingAbility.class))); + filter.add(new BlockingAttackerIdPredicate(this.getId())); + this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Duration.EndOfTurn, filter, false), new ManaCostsImpl("{1}{W}"))); + } + + public KnightOfValor(final KnightOfValor card) { + super(card); + } + + @Override + public KnightOfValor copy() { + return new KnightOfValor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/LightningCloud.java b/Mage.Sets/src/mage/sets/visions/LightningCloud.java new file mode 100644 index 00000000000..1f4309a4d81 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/LightningCloud.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastAllTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class LightningCloud extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("a red spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public LightningCloud(UUID ownerId) { + super(ownerId, 87, "Lightning Cloud", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); + this.expansionSetCode = "VIS"; + + // Whenever a player casts a red spell, you may pay {R}. If you do, Lightning Cloud deals 1 damage to target creature or player. + Ability ability = new SpellCastAllTriggeredAbility(new DoIfCostPaid(new DamageTargetEffect(1), new ManaCostsImpl("{R}")), filter, false); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public LightningCloud(final LightningCloud card) { + super(card); + } + + @Override + public LightningCloud copy() { + return new LightningCloud(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/MagmaMine.java b/Mage.Sets/src/mage/sets/visions/MagmaMine.java new file mode 100644 index 00000000000..aac5b04b731 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/MagmaMine.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class MagmaMine extends CardImpl { + + public MagmaMine(UUID ownerId) { + super(ownerId, 149, "Magma Mine", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "VIS"; + + // {4}: Put a pressure counter on Magma Mine. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new AddCountersSourceEffect(CounterType.PRESSURE.createInstance(), true), + new GenericManaCost(4))); + + // {tap}, Sacrifice Magma Mine: Magma Mine deals damage equal to the number of pressure counters on it to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new CountersCount(CounterType.PRESSURE)), new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public MagmaMine(final MagmaMine card) { + super(card); + } + + @Override + public MagmaMine copy() { + return new MagmaMine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/MortalWound.java b/Mage.Sets/src/mage/sets/visions/MortalWound.java new file mode 100644 index 00000000000..93b030b87c5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/MortalWound.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.DamageDealtToAttachedTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MortalWound extends CardImpl { + + public MortalWound(UUID ownerId) { + super(ownerId, 63, "Mortal Wound", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // When enchanted creature is dealt damage, destroy it. + this.addAbility(new DamageDealtToAttachedTriggeredAbility(new DestroyAttachedEffect("it"), false)); + } + + public MortalWound(final MortalWound card) { + super(card); + } + + @Override + public MortalWound copy() { + return new MortalWound(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/Mundungu.java b/Mage.Sets/src/mage/sets/visions/Mundungu.java new file mode 100644 index 00000000000..ca0f29d4f2b --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/Mundungu.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.CostsImpl; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetSpell; + +/** + * + * @author nigelzor + */ +public class Mundungu extends CardImpl { + + public Mundungu(UUID ownerId) { + super(ownerId, 132, "Mundungu", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{B}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Counter target spell unless its controller pays {1} and 1 life. + CostsImpl costs = new CostsImpl<>(); + costs.add(new GenericManaCost(1)); + costs.add(new PayLifeCost(1)); + costs.setText("{1} and 1 life"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(costs), new TapSourceCost()); + ability.addTarget(new TargetSpell()); + this.addAbility(ability); + } + + public Mundungu(final Mundungu card) { + super(card); + } + + @Override + public Mundungu copy() { + return new Mundungu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/MysticVeil.java b/Mage.Sets/src/mage/sets/visions/MysticVeil.java new file mode 100644 index 00000000000..bfcb4210d71 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/MysticVeil.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SacrificeIfCastAtInstantTimeTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + + * + * @author LoneFox + */ +public class MysticVeil extends CardImpl { + + public MysticVeil(UUID ownerId) { + super(ownerId, 38, "Mystic Veil", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Aura"); + + // You may cast Mystic Veil as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame))); + this.addAbility(new SacrificeIfCastAtInstantTimeTriggeredAbility()); + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature has shroud. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), AttachmentType.AURA))); + } + + public MysticVeil(final MysticVeil card) { + super(card); + } + + @Override + public MysticVeil copy() { + return new MysticVeil(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/Necromancy.java b/Mage.Sets/src/mage/sets/visions/Necromancy.java index 0525df83ffc..13d1bb76169 100644 --- a/Mage.Sets/src/mage/sets/visions/Necromancy.java +++ b/Mage.Sets/src/mage/sets/visions/Necromancy.java @@ -30,24 +30,21 @@ package mage.sets.visions; import java.util.UUID; import mage.MageObjectReference; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.common.SacrificeIfCastAtInstantTimeTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.common.delayed.AtTheBeginOfNextCleanupDelayedTriggeredAbility; import mage.abilities.condition.common.SourceOnBattlefieldCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; -import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashSourceEffect; import mage.abilities.effects.common.continuous.SourceEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.constants.AsThoughEffectType; import mage.constants.CardType; +import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; @@ -58,10 +55,7 @@ import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.PermanentIdPredicate; import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; -import mage.game.stack.Spell; import mage.players.Player; import mage.target.Target; import mage.target.common.TargetCardInGraveyard; @@ -77,13 +71,12 @@ public class Necromancy extends CardImpl { super(ownerId, 14, "Necromancy", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); this.expansionSetCode = "VIS"; - // You may cast Necromancy as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastSourceAsThoughItHadFlashEffect(this, Duration.EndOfGame, true))); - this.addAbility(new CastAtInstantTimeTriggeredAbility()); - - // When Necromancy enters the battlefield, if it's on the battlefield, it becomes an Aura with "enchant creature put onto the battlefield with Necromancy." - // Put target creature card from a graveyard onto the battlefield under your control and attach Necromancy to it. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame))); + this.addAbility(new SacrificeIfCastAtInstantTimeTriggeredAbility()); + + // When Necromancy enters the battlefield, if it's on the battlefield, it becomes an Aura with "enchant creature put onto the battlefield with Necromancy." + // Put target creature card from a graveyard onto the battlefield under your control and attach Necromancy to it. // When Necromancy leaves the battlefield, that creature's controller sacrifices it. Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new NecromancyReAttachEffect(), false), @@ -91,7 +84,7 @@ public class Necromancy extends CardImpl { "When {this} enters the battlefield, if it's on the battlefield, it becomes an Aura with \"enchant creature put onto the battlefield with {this}.\" Put target creature card from a graveyard onto the battlefield under your control and attach {this} to it."); ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard"))); this.addAbility(ability); - this.addAbility(new LeavesBattlefieldTriggeredAbility(new NecromancyLeavesBattlefieldTriggeredEffect(), false)); + this.addAbility(new LeavesBattlefieldTriggeredAbility(new NecromancyLeavesBattlefieldTriggeredEffect(), false)); } public Necromancy(final Necromancy card) { @@ -105,105 +98,33 @@ public class Necromancy extends CardImpl { } -class CastSourceAsThoughItHadFlashEffect extends AsThoughEffectImpl { - - private final boolean sacrificeIfCastAsInstant; - - public CastSourceAsThoughItHadFlashEffect(Card card, Duration duration, boolean sacrificeIfCastAsInstant) { - super(AsThoughEffectType.CAST_AS_INSTANT, duration, Outcome.Benefit); - this.sacrificeIfCastAsInstant = sacrificeIfCastAsInstant; - staticText = "You may cast {this} as though it had flash"; - } - - - public CastSourceAsThoughItHadFlashEffect(final CastSourceAsThoughItHadFlashEffect effect) { - super(effect); - this.sacrificeIfCastAsInstant = effect.sacrificeIfCastAsInstant; - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public CastSourceAsThoughItHadFlashEffect copy() { - return new CastSourceAsThoughItHadFlashEffect(this); - } - - @Override - public boolean applies(UUID affectedSpellId, Ability source, UUID affectedControllerId, Game game) { - return source.getSourceId().equals(affectedSpellId); - } - -} - -class CastAtInstantTimeTriggeredAbility extends TriggeredAbilityImpl { - public CastAtInstantTimeTriggeredAbility() { - super(Zone.STACK, new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextCleanupDelayedTriggeredAbility(new SacrificeSourceEffect()))); - } - - public CastAtInstantTimeTriggeredAbility(final CastAtInstantTimeTriggeredAbility ability) { - super(ability); - } - - @Override - public CastAtInstantTimeTriggeredAbility copy() { - return new CastAtInstantTimeTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - // The sacrifice occurs only if you cast it using its own ability. If you cast it using some other - // effect (for instance, if it gained flash from Vedalken Orrery), then it won't be sacrificed. - // CHECK - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getSourceId().equals(getSourceId())) { - return !(game.isMainPhase() && game.getActivePlayerId().equals(event.getPlayerId()) && game.getStack().size() == 1); - } - return false; - } - - @Override - public String getRule() { - return "If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step."; - } -} - class NecromancyReAttachEffect extends OneShotEffect { - + public NecromancyReAttachEffect() { super(Outcome.Benefit); this.staticText = "it becomes an Aura with \"enchant creature put onto the battlefield with {this}\""; } - + public NecromancyReAttachEffect(final NecromancyReAttachEffect effect) { super(effect); } - + @Override public NecromancyReAttachEffect copy() { return new NecromancyReAttachEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent enchantment = game.getPermanent(source.getSourceId()); Card cardInGraveyard = game.getCard(getTargetPointer().getFirst(game, source)); if (controller != null && enchantment != null && cardInGraveyard != null) { - // put card into play - controller.putOntoBattlefieldWithInfo(cardInGraveyard, game, Zone.GRAVEYARD, source.getSourceId()); + controller.moveCards(cardInGraveyard, Zone.BATTLEFIELD, source, game); Permanent enchantedCreature = game.getPermanent(cardInGraveyard.getId()); - if (enchantedCreature != null) { enchantedCreature.addAttachment(enchantment.getId(), game); - FilterCreaturePermanent filter = new FilterCreaturePermanent("enchant creature put onto the battlefield with Necromancy"); + FilterCreaturePermanent filter = new FilterCreaturePermanent("enchant creature put onto the battlefield with " + enchantment.getIdName()); filter.add(new PermanentIdPredicate(cardInGraveyard.getId())); Target target = new TargetCreaturePermanent(filter); target.addTarget(enchantedCreature.getId(), source, game); @@ -211,27 +132,27 @@ class NecromancyReAttachEffect extends OneShotEffect { } return true; } - + return false; } } - + class NecromancyLeavesBattlefieldTriggeredEffect extends OneShotEffect { - + public NecromancyLeavesBattlefieldTriggeredEffect() { super(Outcome.Benefit); this.staticText = "enchanted creature's controller sacrifices it"; } - + public NecromancyLeavesBattlefieldTriggeredEffect(final NecromancyLeavesBattlefieldTriggeredEffect effect) { super(effect); } - + @Override public NecromancyLeavesBattlefieldTriggeredEffect copy() { return new NecromancyLeavesBattlefieldTriggeredEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); @@ -249,10 +170,11 @@ class NecromancyLeavesBattlefieldTriggeredEffect extends OneShotEffect { } } + class NecromancyChangeAbilityEffect extends ContinuousEffectImpl implements SourceEffect { private final static Ability newAbility = new EnchantAbility("creature put onto the battlefield with Necromancy"); - + static { newAbility.setRuleAtTheTop(true); } @@ -263,9 +185,9 @@ class NecromancyChangeAbilityEffect extends ContinuousEffectImpl implements Sour super(Duration.Custom, Outcome.AddAbility); staticText = "it becomes an Aura with \"enchant creature put onto the battlefield with {this}\""; this.target = target; + dependencyTypes.add(DependencyType.AuraAddingRemoving); } - public NecromancyChangeAbilityEffect(final NecromancyChangeAbilityEffect effect) { super(effect); this.target = effect.target; @@ -275,7 +197,7 @@ class NecromancyChangeAbilityEffect extends ContinuousEffectImpl implements Sour public NecromancyChangeAbilityEffect copy() { return new NecromancyChangeAbilityEffect(this); } - + @Override public void init(Ability source, Game game) { super.init(source, game); @@ -301,8 +223,8 @@ class NecromancyChangeAbilityEffect extends ContinuousEffectImpl implements Sour permanent.getSpellAbility().getTargets().add(target); } } - return true; - } + return true; + } this.discard(); return false; } @@ -316,5 +238,5 @@ class NecromancyChangeAbilityEffect extends ContinuousEffectImpl implements Sour public boolean hasLayer(Layer layer) { return Layer.AbilityAddingRemovingEffects_6.equals(layer) || Layer.TypeChangingEffects_4.equals(layer); } - + } diff --git a/Mage.Sets/src/mage/sets/visions/Parapet.java b/Mage.Sets/src/mage/sets/visions/Parapet.java new file mode 100644 index 00000000000..d05703ebca6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/Parapet.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.common.SacrificeIfCastAtInstantTimeTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class Parapet extends CardImpl { + + public Parapet(UUID ownerId) { + super(ownerId, 114, "Parapet", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "VIS"; + + // You may cast Parapet as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame))); + this.addAbility(new SacrificeIfCastAtInstantTimeTriggeredAbility()); + // Creatures you control get +0/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 1, Duration.WhileOnBattlefield))); + } + + public Parapet(final Parapet card) { + super(card); + } + + @Override + public Parapet copy() { + return new Parapet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java b/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java index 3079b7ca4d0..8e513985729 100644 --- a/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java +++ b/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java @@ -30,18 +30,15 @@ package mage.sets.visions; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.common.CantBlockAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; import mage.abilities.effects.common.combat.CantAttackBlockUnlessPaysSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; @@ -63,7 +60,7 @@ public class PhyrexianMarauder extends CardImpl { this.toughness = new MageInt(0); // Phyrexian Marauder enters the battlefield with X +1/+1 counters on it. - this.addAbility(new EntersBattlefieldAbility(new PhyrexianMarauderEntersEffect(), "with X +1/+1 counters on it")); + this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()))); // Phyrexian Marauder can't block. this.addAbility(new CantBlockAbility()); @@ -82,37 +79,6 @@ public class PhyrexianMarauder extends CardImpl { } } -class PhyrexianMarauderEntersEffect extends OneShotEffect { - - PhyrexianMarauderEntersEffect() { - super(Outcome.BoostCreature); - } - - PhyrexianMarauderEntersEffect(final PhyrexianMarauderEntersEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null && !permanent.isFaceDown(game)) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility) { - int amount = ((Ability) obj).getManaCostsToPay().getX(); - if (amount > 0) { - permanent.addCounters(CounterType.P1P1.createInstance(amount), game); - } - } - } - return true; - } - - @Override - public PhyrexianMarauderEntersEffect copy() { - return new PhyrexianMarauderEntersEffect(this); - } -} - class PhyrexianMarauderCantAttackUnlessYouPayEffect extends CantAttackBlockUnlessPaysSourceEffect { PhyrexianMarauderCantAttackUnlessYouPayEffect() { diff --git a/Mage.Sets/src/mage/sets/visions/QuirionRanger.java b/Mage.Sets/src/mage/sets/visions/QuirionRanger.java index bfba3fdce8c..1df79ddb4ce 100644 --- a/Mage.Sets/src/mage/sets/visions/QuirionRanger.java +++ b/Mage.Sets/src/mage/sets/visions/QuirionRanger.java @@ -34,7 +34,7 @@ import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.UntapTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; @@ -63,7 +63,7 @@ public class QuirionRanger extends CardImpl { this.toughness = new MageInt(1); // Return a Forest you control to its owner's hand: Untap target creature. Activate this ability only once each turn. - Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(filter))); + Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(filter))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/visions/RagingGorilla.java b/Mage.Sets/src/mage/sets/visions/RagingGorilla.java new file mode 100644 index 00000000000..2f86b3c49bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/RagingGorilla.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class RagingGorilla extends CardImpl { + + public RagingGorilla(UUID ownerId) { + super(ownerId, 90, "Raging Gorilla", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Ape"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Whenever Raging Gorilla blocks or becomes blocked, it gets +2/-2 until end of turn. + this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(2, -2, Duration.EndOfTurn), false)); + } + + public RagingGorilla(final RagingGorilla card) { + super(card); + } + + @Override + public RagingGorilla copy() { + return new RagingGorilla(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/RainbowEfreet.java b/Mage.Sets/src/mage/sets/visions/RainbowEfreet.java new file mode 100644 index 00000000000..654cb7b4e1a --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/RainbowEfreet.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PhaseOutSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class RainbowEfreet extends CardImpl { + + public RainbowEfreet(UUID ownerId) { + super(ownerId, 41, "Rainbow Efreet", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Efreet"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // {U}{U}: Rainbow Efreet phases out. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PhaseOutSourceEffect(), new ManaCostsImpl("{U}{U}"))); + } + + public RainbowEfreet(final RainbowEfreet card) { + super(card); + } + + @Override + public RainbowEfreet copy() { + return new RainbowEfreet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/RelicWard.java b/Mage.Sets/src/mage/sets/visions/RelicWard.java new file mode 100644 index 00000000000..122cf167927 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/RelicWard.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SacrificeIfCastAtInstantTimeTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.ShroudAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetArtifactPermanent; +/** + * + * @author LoneFox + */ +public class RelicWard extends CardImpl { + + public RelicWard(UUID ownerId) { + super(ownerId, 116, "Relic Ward", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Aura"); + + // You may cast Relic Ward as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame))); + this.addAbility(new SacrificeIfCastAtInstantTimeTriggeredAbility()); + // Enchant artifact + TargetPermanent auraTarget = new TargetArtifactPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted artifact has shroud. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), AttachmentType.AURA))); + } + + public RelicWard(final RelicWard card) { + super(card); + } + + @Override + public RelicWard copy() { + return new RelicWard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/RetributionOfTheMeek.java b/Mage.Sets/src/mage/sets/visions/RetributionOfTheMeek.java new file mode 100644 index 00000000000..e4c7e81c2b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/RetributionOfTheMeek.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; + +/** + * + * @author Jesse Whyte + */ +public class RetributionOfTheMeek extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with power 4 or greater"); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 3)); + } + + public RetributionOfTheMeek (UUID ownerId) { + super(ownerId, 119, "Retribution of the Meek", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "VIS"; + + // Destroy all creatures with power 4 or greater. They can't be regenerated. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter, true)); + } + + public RetributionOfTheMeek(final RetributionOfTheMeek card) { + super(card); + } + + @Override + public Card copy() { + return new RetributionOfTheMeek(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/visions/Solfatara.java b/Mage.Sets/src/mage/sets/visions/Solfatara.java new file mode 100644 index 00000000000..53ec304a503 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/Solfatara.java @@ -0,0 +1,113 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class Solfatara extends CardImpl { + + public Solfatara(UUID ownerId) { + super(ownerId, 93, "Solfatara", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); + this.expansionSetCode = "VIS"; + + // Target player can't play land cards this turn. + this.getSpellAbility().addEffect(new SolfataraEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Draw a card at the beginning of the next turn's upkeep. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect( + new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(1), Duration.OneUse), false)); + } + + public Solfatara(final Solfatara card) { + super(card); + } + + @Override + public Solfatara copy() { + return new Solfatara(this); + } +} + +class SolfataraEffect extends ContinuousRuleModifyingEffectImpl { + + public SolfataraEffect() { + super(Duration.EndOfTurn, Outcome.Detriment); + staticText = "Target player can't play land cards this turn."; + } + + public SolfataraEffect(final SolfataraEffect effect) { + super(effect); + } + + @Override + public SolfataraEffect copy() { + return new SolfataraEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public String getInfoMessage(Ability source, GameEvent event, Game game) { + MageObject mageObject = game.getObject(source.getSourceId()); + if (mageObject != null) { + return "You can't play lands this turn (" + mageObject.getIdName() + ")."; + } + return null; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.PLAY_LAND && event.getPlayerId().equals(source.getFirstTarget())) { + return true; + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/visions/SpiderClimb.java b/Mage.Sets/src/mage/sets/visions/SpiderClimb.java new file mode 100644 index 00000000000..bdccf5912c6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/SpiderClimb.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SacrificeIfCastAtInstantTimeTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SpiderClimb extends CardImpl { + + public SpiderClimb(UUID ownerId) { + super(ownerId, 70, "Spider Climb", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Aura"); + + // You may cast Spider Climb as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame))); + this.addAbility(new SacrificeIfCastAtInstantTimeTriggeredAbility()); + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +0/+3 and has reach. + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(0, 3, Duration.WhileOnBattlefield)); + Effect effect = new GainAbilityAttachedEffect(ReachAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has reach"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public SpiderClimb(final SpiderClimb card) { + super(card); + } + + @Override + public SpiderClimb copy() { + return new SpiderClimb(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/SuqAtaAssassin.java b/Mage.Sets/src/mage/sets/visions/SuqAtaAssassin.java new file mode 100644 index 00000000000..b011b65da73 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/SuqAtaAssassin.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.counter.AddPoisonCounterTargetEffect; +import mage.abilities.keyword.FearAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SuqAtaAssassin extends CardImpl { + + public SuqAtaAssassin(UUID ownerId) { + super(ownerId, 19, "Suq'Ata Assassin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Human"); + this.subtype.add("Assassin"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Fear + this.addAbility(FearAbility.getInstance()); + // Whenever Suq'Ata Assassin attacks and isn't blocked, defending player gets a poison counter. + Effect effect = new AddPoisonCounterTargetEffect(1); + effect.setText("defending player gets a poison counter"); + this.addAbility(new AttacksAndIsNotBlockedTriggeredAbility(effect, false, true)); + } + + public SuqAtaAssassin(final SuqAtaAssassin card) { + super(card); + } + + @Override + public SuqAtaAssassin copy() { + return new SuqAtaAssassin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/TalruumPiper.java b/Mage.Sets/src/mage/sets/visions/TalruumPiper.java new file mode 100644 index 00000000000..e37d25ad9dd --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/TalruumPiper.java @@ -0,0 +1,112 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RequirementEffect; +import mage.abilities.effects.common.combat.MustBeBlockedByAllSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author nigelzor + */ +public class TalruumPiper extends CardImpl { + + public TalruumPiper(UUID ownerId) { + super(ownerId, 98, "Talruum Piper", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Minotaur"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // All creatures with flying able to block Talruum Piper do so. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TalruumPiperEffect())); + } + + public TalruumPiper(final TalruumPiper card) { + super(card); + } + + @Override + public TalruumPiper copy() { + return new TalruumPiper(this); + } +} + +class TalruumPiperEffect extends RequirementEffect { + + public TalruumPiperEffect() { + super(Duration.WhileOnBattlefield); + staticText = "All creatures with flying able to block {this} do so"; + } + + public TalruumPiperEffect(TalruumPiperEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + Permanent sourceCreature = game.getPermanent(source.getSourceId()); + if (sourceCreature != null && sourceCreature.isAttacking()) { + return permanent.getAbilities().contains(FlyingAbility.getInstance()) + && permanent.canBlock(source.getSourceId(), game); + } + return false; + } + + @Override + public boolean mustAttack(Game game) { + return false; + } + + @Override + public boolean mustBlock(Game game) { + return true; + } + + @Override + public UUID mustBlockAttacker(Ability source, Game game) { + return source.getSourceId(); + } + + @Override + public TalruumPiperEffect copy() { + return new TalruumPiperEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/TarPitWarrior.java b/Mage.Sets/src/mage/sets/visions/TarPitWarrior.java new file mode 100644 index 00000000000..f6212d37c3c --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/TarPitWarrior.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesTargetTriggeredAbility; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TarPitWarrior extends CardImpl { + + public TarPitWarrior(UUID ownerId) { + super(ownerId, 20, "Tar Pit Warrior", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Cyclops"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // When Tar Pit Warrior becomes the target of a spell or ability, sacrifice it. + this.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect())); + } + + public TarPitWarrior(final TarPitWarrior card) { + super(card); + } + + @Override + public TarPitWarrior copy() { + return new TarPitWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/TeferisHonorGuard.java b/Mage.Sets/src/mage/sets/visions/TeferisHonorGuard.java new file mode 100644 index 00000000000..8b8d79bf05d --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/TeferisHonorGuard.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PhaseOutSourceEffect; +import mage.abilities.keyword.FlankingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class TeferisHonorGuard extends CardImpl { + + public TeferisHonorGuard(UUID ownerId) { + super(ownerId, 122, "Teferi's Honor Guard", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flanking + this.addAbility(new FlankingAbility()); + + // {U}{U}: Teferi's Honor Guard phases out. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PhaseOutSourceEffect(), new ManaCostsImpl("{U}{U}"))); + } + + public TeferisHonorGuard(final TeferisHonorGuard card) { + super(card); + } + + @Override + public TeferisHonorGuard copy() { + return new TeferisHonorGuard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/Tithe.java b/Mage.Sets/src/mage/sets/visions/Tithe.java new file mode 100644 index 00000000000..d36db987a05 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/Tithe.java @@ -0,0 +1,98 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetOpponent; + +/** + * + * @author emerald000 + */ +public class Tithe extends CardImpl { + + public Tithe(UUID ownerId) { + super(ownerId, 123, "Tithe", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{W}"); + this.expansionSetCode = "VIS"; + + // Search your library for a Plains card. If target opponent controls more lands than you, you may search your library for an additional Plains card. Reveal those cards and put them into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new TitheEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public Tithe(final Tithe card) { + super(card); + } + + @Override + public Tithe copy() { + return new Tithe(this); + } +} + +class TitheEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("Plains"); + static { + filter.add(new SubtypePredicate("Plains")); + } + + TitheEffect() { + super(Outcome.Benefit); + this.staticText = "Search your library for a Plains card. If target opponent controls more lands than you, you may search your library for an additional Plains card. Reveal those cards and put them into your hand. Then shuffle your library"; + } + + TitheEffect(final TitheEffect effect) { + super(effect); + } + + @Override + public TitheEffect copy() { + return new TitheEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int numYourLands = game.getBattlefield().countAll(new FilterLandPermanent(), source.getControllerId(), game); + int numOpponentLands = game.getBattlefield().countAll(new FilterLandPermanent(), this.getTargetPointer().getFirst(game, source), game); + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, (numOpponentLands > numYourLands ? 2 : 1), filter), true).apply(game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/visions/UrborgMindsucker.java b/Mage.Sets/src/mage/sets/visions/UrborgMindsucker.java new file mode 100644 index 00000000000..dda4f2b245f --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/UrborgMindsucker.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class UrborgMindsucker extends CardImpl { + + public UrborgMindsucker(UUID ownerId) { + super(ownerId, 21, "Urborg Mindsucker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Horror"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {B}, Sacrifice Urborg Mindsucker: Target opponent discards a card at random. Activate this ability only any time you could cast a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(1, true), new ManaCostsImpl("{B}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public UrborgMindsucker(final UrborgMindsucker card) { + super(card); + } + + @Override + public UrborgMindsucker copy() { + return new UrborgMindsucker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/WakeOfVultures.java b/Mage.Sets/src/mage/sets/visions/WakeOfVultures.java new file mode 100644 index 00000000000..37f78dd9313 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/WakeOfVultures.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author nigelzor + */ +public class WakeOfVultures extends CardImpl { + + public WakeOfVultures(UUID ownerId) { + super(ownerId, 24, "Wake of Vultures", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Bird"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {1}{B}, Sacrifice a creature: Regenerate Wake of Vultures. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{B}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.addAbility(ability); + } + + public WakeOfVultures(final WakeOfVultures card) { + super(card); + } + + @Override + public WakeOfVultures copy() { + return new WakeOfVultures(this); + } +} diff --git a/Mage.Sets/src/mage/sets/visions/ZhalfirinCrusader.java b/Mage.Sets/src/mage/sets/visions/ZhalfirinCrusader.java new file mode 100644 index 00000000000..e717afcf8f3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/visions/ZhalfirinCrusader.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.visions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RedirectDamageFromSourceToTargetEffect; +import mage.abilities.keyword.FlankingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class ZhalfirinCrusader extends CardImpl { + + public ZhalfirinCrusader(UUID ownerId) { + super(ownerId, 125, "Zhalfirin Crusader", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "VIS"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flanking + this.addAbility(new FlankingAbility()); + + // {1}{W}: The next 1 damage that would be dealt to Zhalfirin Crusader this turn is dealt to target creature or player instead. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RedirectDamageFromSourceToTargetEffect(Duration.EndOfTurn, 1, true), new ManaCostsImpl("{1}{W}")); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public ZhalfirinCrusader(final ZhalfirinCrusader card) { + super(card); + } + + @Override + public ZhalfirinCrusader copy() { + return new ZhalfirinCrusader(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/Abeyance.java b/Mage.Sets/src/mage/sets/weatherlight/Abeyance.java new file mode 100644 index 00000000000..4a48d8daa7a --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/Abeyance.java @@ -0,0 +1,121 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.mana.ManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.TargetPlayer; + +/** + * + * @author fireshoes + */ +public class Abeyance extends CardImpl { + + public Abeyance(UUID ownerId) { + super(ownerId, 117, "Abeyance", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "WTH"; + + // Until end of turn, target player can't cast instant or sorcery spells, and that player can't activate abilities that aren't mana abilities. + this.getSpellAbility().addEffect(new AbeyanceEffect()); + this.getSpellAbility().addTarget(new TargetPlayer()); + + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public Abeyance(final Abeyance card) { + super(card); + } + + @Override + public Abeyance copy() { + return new Abeyance(this); + } +} + +class AbeyanceEffect extends ContinuousRuleModifyingEffectImpl { + + public AbeyanceEffect() { + super(Duration.EndOfTurn, Outcome.Detriment); + staticText = "Until end of turn, target player can't cast instant or sorcery spells, and that player can't activate abilities that aren't mana abilities"; + } + + public AbeyanceEffect(final AbeyanceEffect effect) { + super(effect); + } + + @Override + public AbeyanceEffect copy() { + return new AbeyanceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public String getInfoMessage(Ability source, GameEvent event, Game game) { + MageObject mageObject = game.getObject(source.getSourceId()); + if (mageObject != null) { + return "You can't cast instant or sorcery spells or activate abilities that aren't mana abilities this turn (" + mageObject.getIdName() + ")."; + } + return null; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getPlayerId().equals(source.getFirstTarget())) { + MageObject object = game.getObject(event.getSourceId()); + if (event.getType() == GameEvent.EventType.CAST_SPELL) { + if (object.getCardType().contains(CardType.INSTANT) || object.getCardType().contains(CardType.SORCERY)) { + return true; + } + } + if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) { + Ability ability = game.getAbility(event.getTargetId(), event.getSourceId()); + if (ability != null && !(ability instanceof ManaAbility)) { + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/AlabasterDragon.java b/Mage.Sets/src/mage/sets/weatherlight/AlabasterDragon.java new file mode 100644 index 00000000000..ce9dcfe7c49 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/AlabasterDragon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class AlabasterDragon extends mage.sets.portal.AlabasterDragon { + + public AlabasterDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 118; + this.expansionSetCode = "WTH"; + } + + public AlabasterDragon(final AlabasterDragon card) { + super(card); + } + + @Override + public AlabasterDragon copy() { + return new AlabasterDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/Alms.java b/Mage.Sets/src/mage/sets/weatherlight/Alms.java new file mode 100644 index 00000000000..d9f4aaf5416 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/Alms.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileTopCardOfGraveyardCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Alms extends CardImpl { + + public Alms(UUID ownerId) { + super(ownerId, 119, "Alms", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "WTH"; + + // {1}, Exile the top card of your graveyard: Prevent the next 1 damage that would be dealt to target creature this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), new GenericManaCost(1)); + ability.addCost(new ExileTopCardOfGraveyardCost(1)); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public Alms(final Alms card) { + super(card); + } + + @Override + public Alms copy() { + return new Alms(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/AngelicRenewal.java b/Mage.Sets/src/mage/sets/weatherlight/AngelicRenewal.java new file mode 100644 index 00000000000..6b7ef11f4c1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/AngelicRenewal.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class AngelicRenewal extends CardImpl { + + public AngelicRenewal(UUID ownerId) { + super(ownerId, 120, "Angelic Renewal", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "WTH"; + + // Whenever a creature is put into your graveyard from the battlefield, you may sacrifice Angelic Renewal. If you do, return that card to the battlefield. + this.addAbility(new PutIntoGraveFromBattlefieldAllTriggeredAbility(new DoIfCostPaid( + new ReturnToBattlefieldUnderOwnerControlTargetEffect(), new SacrificeSourceCost()), false, + new FilterCreaturePermanent("a creature"), true, true)); + } + + public AngelicRenewal(final AngelicRenewal card) { + super(card); + } + + @Override + public AngelicRenewal copy() { + return new AngelicRenewal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/ArcticWolves.java b/Mage.Sets/src/mage/sets/weatherlight/ArcticWolves.java new file mode 100644 index 00000000000..7cf903a34f7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/ArcticWolves.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ArcticWolves extends CardImpl { + + public ArcticWolves(UUID ownerId) { + super(ownerId, 60, "Arctic Wolves", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Wolf"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Cumulative upkeep {2} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{2}"))); + // When Arctic Wolves enters the battlefield, draw a card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); + } + + public ArcticWolves(final ArcticWolves card) { + super(card); + } + + @Override + public ArcticWolves copy() { + return new ArcticWolves(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/BarrowGhoul.java b/Mage.Sets/src/mage/sets/weatherlight/BarrowGhoul.java new file mode 100644 index 00000000000..24451a04e2a --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/BarrowGhoul.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.common.ExileTopCreatureCardOfGraveyardCost; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author fireshoes + */ +public class BarrowGhoul extends CardImpl { + + public BarrowGhoul(UUID ownerId) { + super(ownerId, 3, "Barrow Ghoul", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Zombie"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // At the beginning of your upkeep, sacrifice Barrow Ghoul unless you exile the top creature card of your graveyard. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ExileTopCreatureCardOfGraveyardCost(1)), TargetController.YOU, false)); + } + + public BarrowGhoul(final BarrowGhoul card) { + super(card); + } + + @Override + public BarrowGhoul copy() { + return new BarrowGhoul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/BenalishMissionary.java b/Mage.Sets/src/mage/sets/weatherlight/BenalishMissionary.java new file mode 100644 index 00000000000..2c5d65f0133 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/BenalishMissionary.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.BlockedPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class BenalishMissionary extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blocked creature"); + + static { + filter.add(new BlockedPredicate()); + } + + public BenalishMissionary(UUID ownerId) { + super(ownerId, 126, "Benalish Missionary", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}{W}, {tap}: Prevent all combat damage that would be dealt by target blocked creature this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageByTargetEffect(Duration.EndOfTurn, true), new ManaCostsImpl("{1}{W}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public BenalishMissionary(final BenalishMissionary card) { + super(card); + } + + @Override + public BenalishMissionary copy() { + return new BenalishMissionary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/BoilingBlood.java b/Mage.Sets/src/mage/sets/weatherlight/BoilingBlood.java new file mode 100644 index 00000000000..1a7482d074a --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/BoilingBlood.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.combat.AttacksIfAbleTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class BoilingBlood extends CardImpl { + + public BoilingBlood(UUID ownerId) { + super(ownerId, 92, "Boiling Blood", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{R}"); + this.expansionSetCode = "WTH"; + + // Target creature attacks this turn if able. + this.getSpellAbility().addEffect(new AttacksIfAbleTargetEffect(Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public BoilingBlood(final BoilingBlood card) { + super(card); + } + + @Override + public BoilingBlood copy() { + return new BoilingBlood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/BoneDancer.java b/Mage.Sets/src/mage/sets/weatherlight/BoneDancer.java new file mode 100644 index 00000000000..45c623b43b8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/BoneDancer.java @@ -0,0 +1,109 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.AssignNoCombatDamageSourceEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LoneFox + */ +public class BoneDancer extends CardImpl { + + public BoneDancer(UUID ownerId) { + super(ownerId, 4, "Bone Dancer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Bone Dancer attacks and isn't blocked, you may put the top creature card of defending player's graveyard onto the battlefield under your control. If you do, Bone Dancer assigns no combat damage this turn. + Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(new BoneDancerEffect(), true, true); + ability.addEffect(new AssignNoCombatDamageSourceEffect(Duration.EndOfTurn, true)); + this.addAbility(ability); + } + + public BoneDancer(final BoneDancer card) { + super(card); + } + + @Override + public BoneDancer copy() { + return new BoneDancer(this); + } +} + +class BoneDancerEffect extends OneShotEffect { + + public BoneDancerEffect() { + super(Outcome.Benefit); + this.staticText = "put the top creature card of defending player's graveyard onto the battlefield under your control"; + } + + public BoneDancerEffect(final BoneDancerEffect effect) { + super(effect); + } + + @Override + public BoneDancerEffect copy() { + return new BoneDancerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player defendingPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + if (controller != null && defendingPlayer != null) { + Card lastCreatureCard = null; + for (Card card : defendingPlayer.getGraveyard().getCards(game)) { + if (card.getCardType().contains(CardType.CREATURE)) { + lastCreatureCard = card; + } + } + if (lastCreatureCard != null) { + controller.moveCards(lastCreatureCard, Zone.BATTLEFIELD, source, game); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/BriarShield.java b/Mage.Sets/src/mage/sets/weatherlight/BriarShield.java new file mode 100644 index 00000000000..4d85b60f09e --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/BriarShield.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class BriarShield extends CardImpl { + + public BriarShield(UUID ownerId) { + super(ownerId, 63, "Briar Shield", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); + // Sacrifice Briar Shield: Enchanted creature gets +3/+3 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.EndOfTurn), new SacrificeSourceCost())); + } + + public BriarShield(final BriarShield card) { + super(card); + } + + @Override + public BriarShield copy() { + return new BriarShield(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/BubbleMatrix.java b/Mage.Sets/src/mage/sets/weatherlight/BubbleMatrix.java new file mode 100644 index 00000000000..e9f0a587ff2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/BubbleMatrix.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.PreventAllDamageToAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class BubbleMatrix extends CardImpl { + + public BubbleMatrix(UUID ownerId) { + super(ownerId, 147, "Bubble Matrix", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "WTH"; + + // Prevent all damage that would be dealt to creatures. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventAllDamageToAllEffect(Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures")))); + } + + public BubbleMatrix(final BubbleMatrix card) { + super(card); + } + + @Override + public BubbleMatrix copy() { + return new BubbleMatrix(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/CallOfTheWild.java b/Mage.Sets/src/mage/sets/weatherlight/CallOfTheWild.java index bc0509a505a..5dbc70aa620 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/CallOfTheWild.java +++ b/Mage.Sets/src/mage/sets/weatherlight/CallOfTheWild.java @@ -28,11 +28,7 @@ package mage.sets.weatherlight; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -41,6 +37,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -68,7 +68,6 @@ public class CallOfTheWild extends CardImpl { } } - class CallOfTheWildEffect extends OneShotEffect { public CallOfTheWildEffect() { @@ -87,22 +86,21 @@ class CallOfTheWildEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller == null || sourceObject == null) { return false; } - if (player.getLibrary().size() > 0) { - Card card = player.getLibrary().getFromTop(game); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards("Call of the Wild", cards, game); - + if (controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().getFromTop(game); if (card != null) { + Cards cards = new CardsImpl(card); + controller.revealCards(sourceObject.getIdName(), cards, game); if (card.getCardType().contains(CardType.CREATURE)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } else { - player.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); + controller.moveCards(card, Zone.GRAVEYARD, source, game); } } } diff --git a/Mage.Sets/src/mage/sets/weatherlight/ChimericSphere.java b/Mage.Sets/src/mage/sets/weatherlight/ChimericSphere.java new file mode 100644 index 00000000000..5fa0b62b516 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/ChimericSphere.java @@ -0,0 +1,94 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + */ +public class ChimericSphere extends CardImpl { + + public ChimericSphere(UUID ownerId) { + super(ownerId, 148, "Chimeric Sphere", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "WTH"; + + // {2}: Until end of turn, Chimeric Sphere becomes a 2/1 Construct artifact creature with flying. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new ChimericSphereCreature1(), + "", Duration.EndOfTurn), new ManaCostsImpl("{2}"))); + // {2}: Until end of turn, Chimeric Sphere becomes a 3/2 Construct artifact creature without flying. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new ChimericSphereCreature2(), + "", Duration.EndOfTurn), new ManaCostsImpl("{2}"))); + } + + public ChimericSphere(final ChimericSphere card) { + super(card); + } + + @Override + public ChimericSphere copy() { + return new ChimericSphere(this); + } +} + +class ChimericSphereCreature1 extends Token { + + public ChimericSphereCreature1() { + super("Chimeric Sphere", "2/1 Construct artifact creature with flying"); + cardType.add(CardType.ARTIFACT); + cardType.add(CardType.CREATURE); + power = new MageInt(2); + toughness = new MageInt(1); + + this.addAbility(FlyingAbility.getInstance()); + } +} + +class ChimericSphereCreature2 extends Token { + + public ChimericSphereCreature2() { + super("Chimeric Sphere", "3/2 Construct artifact creature without flying"); + cardType.add(CardType.ARTIFACT); + cardType.add(CardType.CREATURE); + power = new MageInt(3); + toughness = new MageInt(2); + } +} + diff --git a/Mage.Sets/src/mage/sets/weatherlight/CinderGiant.java b/Mage.Sets/src/mage/sets/weatherlight/CinderGiant.java new file mode 100644 index 00000000000..574899c6fcd --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/CinderGiant.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.DamageAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author fireshoes + */ +public class CinderGiant extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("each other creature you control"); + static { + filter.add(new AnotherPredicate()); + } + + public CinderGiant(UUID ownerId) { + super(ownerId, 93, "Cinder Giant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Giant"); + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + // At the beginning of your upkeep, Cinder Giant deals 2 damage to each other creature you control. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DamageAllEffect(2, filter), TargetController.YOU, false)); + } + + public CinderGiant(final CinderGiant card) { + super(card); + } + + @Override + public CinderGiant copy() { + return new CinderGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/Downdraft.java b/Mage.Sets/src/mage/sets/weatherlight/Downdraft.java new file mode 100644 index 00000000000..0ec3c65aaf9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/Downdraft.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.effects.common.continuous.LoseAbilityTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class Downdraft extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public Downdraft(UUID ownerId) { + super(ownerId, 67, "Downdraft", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "WTH"; + + // {G}: Target creature loses flying until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new LoseAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), + new ManaCostsImpl("{G}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + // Sacrifice Downdraft: Downdraft deals 2 damage to each creature with flying. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageAllEffect(2, filter), new SacrificeSourceCost())); + } + + public Downdraft(final Downdraft card) { + super(card); + } + + @Override + public Downdraft copy() { + return new Downdraft(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/DuskriderFalcon.java b/Mage.Sets/src/mage/sets/weatherlight/DuskriderFalcon.java new file mode 100644 index 00000000000..b28e6fd8de0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/DuskriderFalcon.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + */ +public class DuskriderFalcon extends CardImpl { + + private static final FilterCard filter = new FilterCard("black"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public DuskriderFalcon(UUID ownerId) { + super(ownerId, 128, "Duskrider Falcon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Bird"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // protection from black + this.addAbility(new ProtectionAbility(filter)); + } + + public DuskriderFalcon(final DuskriderFalcon card) { + super(card); + } + + @Override + public DuskriderFalcon copy() { + return new DuskriderFalcon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/DwarvenBerserker.java b/Mage.Sets/src/mage/sets/weatherlight/DwarvenBerserker.java new file mode 100644 index 00000000000..c022ab31a01 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/DwarvenBerserker.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class DwarvenBerserker extends CardImpl { + + public DwarvenBerserker(UUID ownerId) { + super(ownerId, 97, "Dwarven Berserker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Dwarf"); + this.subtype.add("Berserker"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Dwarven Berserker becomes blocked, it gets +3/+0 and gains trample until end of turn. + Effect effect = new BoostSourceEffect(3, 0, Duration.EndOfTurn); + effect.setText("it gets +3/+0"); + Ability ability = new BecomesBlockedTriggeredAbility(effect, false); + effect = new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains trample until end of turn"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public DwarvenBerserker(final DwarvenBerserker card) { + super(card); + } + + @Override + public DwarvenBerserker copy() { + return new DwarvenBerserker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/DwarvenThaumaturgist.java b/Mage.Sets/src/mage/sets/weatherlight/DwarvenThaumaturgist.java new file mode 100644 index 00000000000..7eb2a3b3855 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/DwarvenThaumaturgist.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.SwitchPowerToughnessTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class DwarvenThaumaturgist extends CardImpl { + + public DwarvenThaumaturgist(UUID ownerId) { + super(ownerId, 98, "Dwarven Thaumaturgist", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Dwarf"); + this.subtype.add("Shaman"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {tap}: Switch target creature's power and toughness until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SwitchPowerToughnessTargetEffect(Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public DwarvenThaumaturgist(final DwarvenThaumaturgist card) { + super(card); + } + + @Override + public DwarvenThaumaturgist copy() { + return new DwarvenThaumaturgist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/FallowWurm.java b/Mage.Sets/src/mage/sets/weatherlight/FallowWurm.java new file mode 100644 index 00000000000..b930d82bdea --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/FallowWurm.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandCard; + +/** + * + * @author LoneFox + */ +public class FallowWurm extends CardImpl { + + public FallowWurm(UUID ownerId) { + super(ownerId, 68, "Fallow Wurm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Wurm"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // When Fallow Wurm enters the battlefield, sacrifice it unless you discard a land card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardCardCost(new FilterLandCard("a land card"))))); + } + + public FallowWurm(final FallowWurm card) { + super(card); + } + + @Override + public FallowWurm copy() { + return new FallowWurm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/FesteringEvil.java b/Mage.Sets/src/mage/sets/weatherlight/FesteringEvil.java new file mode 100644 index 00000000000..66e94d41ac3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/FesteringEvil.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class FesteringEvil extends CardImpl { + + public FesteringEvil(UUID ownerId) { + super(ownerId, 10, "Festering Evil", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}"); + this.expansionSetCode = "WTH"; + + // At the beginning of your upkeep, Festering Evil deals 1 damage to each creature and each player. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DamageEverythingEffect(1), TargetController.YOU, false)); + + // {B}{B}, Sacrifice Festering Evil: Festering Evil deals 3 damage to each creature and each player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEverythingEffect(3), new ManaCostsImpl("{B}{B}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public FesteringEvil(final FesteringEvil card) { + super(card); + } + + @Override + public FesteringEvil copy() { + return new FesteringEvil(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/ForiysianBrigade.java b/Mage.Sets/src/mage/sets/weatherlight/ForiysianBrigade.java new file mode 100644 index 00000000000..e8d7ddce8d9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/ForiysianBrigade.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class ForiysianBrigade extends CardImpl { + + public ForiysianBrigade(UUID ownerId) { + super(ownerId, 130, "Foriysian Brigade", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Foriysian Brigade can block an additional creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAdditionalCreatureEffect())); + } + + public ForiysianBrigade(final ForiysianBrigade card) { + super(card); + } + + @Override + public ForiysianBrigade copy() { + return new ForiysianBrigade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/Gallowbraid.java b/Mage.Sets/src/mage/sets/weatherlight/Gallowbraid.java new file mode 100644 index 00000000000..c80abcfb030 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/Gallowbraid.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Gallowbraid extends CardImpl { + + public Gallowbraid(UUID ownerId) { + super(ownerId, 12, "Gallowbraid", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "WTH"; + this.supertype.add("Legendary"); + this.subtype.add("Horror"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Cumulative upkeep-Pay 1 life. + this.addAbility(new CumulativeUpkeepAbility(new PayLifeCost(1))); + } + + public Gallowbraid(final Gallowbraid card) { + super(card); + } + + @Override + public Gallowbraid copy() { + return new Gallowbraid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/GoblinGrenadiers.java b/Mage.Sets/src/mage/sets/weatherlight/GoblinGrenadiers.java new file mode 100644 index 00000000000..ed5891a9222 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/GoblinGrenadiers.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAndIsNotBlockedTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class GoblinGrenadiers extends CardImpl { + + public GoblinGrenadiers(UUID ownerId) { + super(ownerId, 104, "Goblin Grenadiers", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Goblin"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Goblin Grenadiers attacks and isn't blocked, you may sacrifice it. If you do, destroy target creature and target land. + Effect effect = new DoIfCostPaid(new DestroyTargetEffect(false, true), new SacrificeSourceCost(), "Sacrifice {this} to destroy target creature and target land?"); + effect.setText("you may sacrifice it. If you do, destroy target creature and target land"); + Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(effect); + ability.addTarget(new TargetCreaturePermanent()); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + } + + public GoblinGrenadiers(final GoblinGrenadiers card) { + super(card); + } + + @Override + public GoblinGrenadiers copy() { + return new GoblinGrenadiers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/ManaChains.java b/Mage.Sets/src/mage/sets/weatherlight/ManaChains.java new file mode 100644 index 00000000000..19a1c5559cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/ManaChains.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ManaChains extends CardImpl { + + public ManaChains(UUID ownerId) { + super(ownerId, 41, "Mana Chains", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature has "Cumulative upkeep {1}." + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect( + new CumulativeUpkeepAbility(new ManaCostsImpl("{1}")), AttachmentType.AURA))); + } + + public ManaChains(final ManaChains card) { + super(card); + } + + @Override + public ManaChains copy() { + return new ManaChains(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/MasterOfArms.java b/Mage.Sets/src/mage/sets/weatherlight/MasterOfArms.java new file mode 100644 index 00000000000..d032b2616e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/MasterOfArms.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.BlockingAttackerIdPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MasterOfArms extends CardImpl { + + public MasterOfArms(UUID ownerId) { + super(ownerId, 136, "Master of Arms", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // {1}{W}: Tap target creature blocking Master of Arms. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{1}{W}")); + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking {this}"); + filter.add(new BlockingAttackerIdPredicate(this.getId())); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public MasterOfArms(final MasterOfArms card) { + super(card); + } + + @Override + public MasterOfArms copy() { + return new MasterOfArms(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/MerfolkTraders.java b/Mage.Sets/src/mage/sets/weatherlight/MerfolkTraders.java new file mode 100644 index 00000000000..5633b978d79 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/MerfolkTraders.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DrawDiscardControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class MerfolkTraders extends CardImpl { + + public MerfolkTraders(UUID ownerId) { + super(ownerId, 43, "Merfolk Traders", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Merfolk"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // When Merfolk Traders enters the battlefield, draw a card, then discard a card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawDiscardControllerEffect())); + } + + public MerfolkTraders(final MerfolkTraders card) { + super(card); + } + + @Override + public MerfolkTraders copy() { + return new MerfolkTraders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/Morinfen.java b/Mage.Sets/src/mage/sets/weatherlight/Morinfen.java new file mode 100644 index 00000000000..c6634294106 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/Morinfen.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Morinfen extends CardImpl { + + public Morinfen(UUID ownerId) { + super(ownerId, 17, "Morinfen", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "WTH"; + this.supertype.add("Legendary"); + this.subtype.add("Horror"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Cumulative upkeep-Pay 1 life. + this.addAbility(new CumulativeUpkeepAbility(new PayLifeCost(1))); + } + + public Morinfen(final Morinfen card) { + super(card); + } + + @Override + public Morinfen copy() { + return new Morinfen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/MwonvuliOoze.java b/Mage.Sets/src/mage/sets/weatherlight/MwonvuliOoze.java new file mode 100644 index 00000000000..e9ff59f123b --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/MwonvuliOoze.java @@ -0,0 +1,101 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; + +/** + * + * @author LoneFox + */ +public class MwonvuliOoze extends CardImpl { + + public MwonvuliOoze(UUID ownerId) { + super(ownerId, 77, "Mwonvuli Ooze", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Ooze"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Cumulative upkeep {2} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{2}"))); + // Mwonvuli Ooze's power and toughness are each equal to 1 plus twice the number of age counters on it. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new MwonvuliOozePTValue(), Duration.EndOfGame))); + } + + public MwonvuliOoze(final MwonvuliOoze card) { + super(card); + } + + @Override + public MwonvuliOoze copy() { + return new MwonvuliOoze(this); + } +} + + +class MwonvuliOozePTValue extends CountersCount { + + public MwonvuliOozePTValue() { + super(CounterType.AGE); + } + + public MwonvuliOozePTValue(final MwonvuliOozePTValue value) { + super(value); + } + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + return 2 * super.calculate(game, sourceAbility, effect) + 1; + } + + @Override + public MwonvuliOozePTValue copy() { + return new MwonvuliOozePTValue(this); + } + + @Override + public String getMessage() { + return "1 plus twice the number of age counters on it"; + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/NaturesKiss.java b/Mage.Sets/src/mage/sets/weatherlight/NaturesKiss.java index c0f1bbeec55..abf514ddc89 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/NaturesKiss.java +++ b/Mage.Sets/src/mage/sets/weatherlight/NaturesKiss.java @@ -30,20 +30,17 @@ package mage.sets.weatherlight; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.CostImpl; +import mage.abilities.costs.common.ExileTopCardOfGraveyardCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.keyword.EnchantAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.players.Player; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -66,7 +63,7 @@ public class NaturesKiss extends CardImpl { // {1}, Exile the top card of your graveyard: Enchanted creature gets +1/+1 until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{1}")); - ability.addCost(new ExileFromTopOfGraveyardCost(1)); + ability.addCost(new ExileTopCardOfGraveyardCost(1)); this.addAbility(ability); } @@ -79,48 +76,3 @@ public class NaturesKiss extends CardImpl { return new NaturesKiss(this); } } - -class ExileFromTopOfGraveyardCost extends CostImpl { - - private final int amount; - - public ExileFromTopOfGraveyardCost(int amount) { - this.amount = amount; - this.text = "Exile the top card of your graveyard"; - } - - public ExileFromTopOfGraveyardCost(ExileFromTopOfGraveyardCost cost) { - super(cost); - this.amount = cost.amount; - } - - @Override - public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - Player controller = game.getPlayer(controllerId); - if(controller == null) { - return false; - } - return controller.getGraveyard().size() >= amount; - } - - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - Player controller = game.getPlayer(controllerId); - if(controller != null) { - Card topCard = null; - for (Card card :controller.getGraveyard().getCards(game)) { - topCard = card; - } - if (topCard != null) { - controller.moveCardToExileWithInfo(topCard, null, "", ability.getSourceId(), game, Zone.GRAVEYARD, true); - paid = true; - } - } - return paid; - } - - @Override - public ExileFromTopOfGraveyardCost copy() { - return new ExileFromTopOfGraveyardCost(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/weatherlight/Necratog.java b/Mage.Sets/src/mage/sets/weatherlight/Necratog.java new file mode 100644 index 00000000000..24dbc5189d4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/Necratog.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileTopCreatureCardOfGraveyardCost; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class Necratog extends CardImpl { + + public Necratog(UUID ownerId) { + super(ownerId, 18, "Necratog", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Atog"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Exile the top creature card of your graveyard: Necratog gets +2/+2 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), new ExileTopCreatureCardOfGraveyardCost(1))); + } + + public Necratog(final Necratog card) { + super(card); + } + + @Override + public Necratog copy() { + return new Necratog(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/weatherlight/Ophidian.java b/Mage.Sets/src/mage/sets/weatherlight/Ophidian.java new file mode 100644 index 00000000000..02ac97ce9ce --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/Ophidian.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Ophidian extends mage.sets.vintagemasters.Ophidian { + + public Ophidian(UUID ownerId) { + super(ownerId); + this.cardNumber = 45; + this.expansionSetCode = "WTH"; + } + + public Ophidian(final Ophidian card) { + super(card); + } + + @Override + public Ophidian copy() { + return new Ophidian(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/ReveredUnicorn.java b/Mage.Sets/src/mage/sets/weatherlight/ReveredUnicorn.java new file mode 100644 index 00000000000..2897ba0ec64 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/ReveredUnicorn.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + */ +public class ReveredUnicorn extends CardImpl { + + public ReveredUnicorn(UUID ownerId) { + super(ownerId, 139, "Revered Unicorn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Unicorn"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Cumulative upkeep {1} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}"))); + // When Revered Unicorn leaves the battlefield, you gain life equal to the number of age counters on it. + this.addAbility(new LeavesBattlefieldTriggeredAbility(new GainLifeEffect(new CountersCount(CounterType.AGE)), false)); + } + + public ReveredUnicorn(final ReveredUnicorn card) { + super(card); + } + + @Override + public ReveredUnicorn copy() { + return new ReveredUnicorn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/RocHatchling.java b/Mage.Sets/src/mage/sets/weatherlight/RocHatchling.java new file mode 100644 index 00000000000..28983d991fd --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/RocHatchling.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.SourceHasCounterCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.counter.RemoveCounterSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + */ +public class RocHatchling extends CardImpl { + + public RocHatchling(UUID ownerId) { + super(ownerId, 113, "Roc Hatchling", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Bird"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // Roc Hatchling enters the battlefield with four shell counters on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.SHELL.createInstance(4)), "with four shell counters on it")); + // At the beginning of your upkeep, remove a shell counter from Roc Hatchling. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new RemoveCounterSourceEffect(CounterType.SHELL.createInstance()), TargetController.YOU, false)); + // As long as Roc Hatchling has no shell counters on it, it gets +3/+2 and has flying. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new BoostSourceEffect(3, 2, Duration.WhileOnBattlefield), + new SourceHasCounterCondition(CounterType.SHELL, 0, 0), + "As long as {this} has no shell counters on it, it gets +3/+2")); + ability.addEffect(new ConditionalContinuousEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance()), + new SourceHasCounterCondition(CounterType.SHELL, 0, 0), "and has flying")); + this.addAbility(ability); + } + + public RocHatchling(final RocHatchling card) { + super(card); + } + + @Override + public RocHatchling copy() { + return new RocHatchling(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/SoulShepherd.java b/Mage.Sets/src/mage/sets/weatherlight/SoulShepherd.java new file mode 100644 index 00000000000..3590e304225 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/SoulShepherd.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileFromGraveCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LoneFox + */ +public class SoulShepherd extends CardImpl { + + public SoulShepherd(UUID ownerId) { + super(ownerId, 142, "Soul Shepherd", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // {W}, Exile a creature card from your graveyard: You gain 1 life. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new ManaCostsImpl("{W}")); + ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterCreatureCard("a creature card from your graveyard")))); + this.addAbility(ability); + } + + public SoulShepherd(final SoulShepherd card) { + super(card); + } + + @Override + public SoulShepherd copy() { + return new SoulShepherd(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/StripedBears.java b/Mage.Sets/src/mage/sets/weatherlight/StripedBears.java new file mode 100644 index 00000000000..063c15a260d --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/StripedBears.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class StripedBears extends CardImpl { + + public StripedBears(UUID ownerId) { + super(ownerId, 82, "Striped Bears", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Bear"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Striped Bears enters the battlefield, draw a card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); + } + + public StripedBears(final StripedBears card) { + super(card); + } + + @Override + public StripedBears copy() { + return new StripedBears(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/Thundermare.java b/Mage.Sets/src/mage/sets/weatherlight/Thundermare.java new file mode 100644 index 00000000000..6a8f1b8be50 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/Thundermare.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Thundermare extends mage.sets.portal.Thundermare { + + public Thundermare(UUID ownerId) { + super(ownerId); + this.cardNumber = 116; + this.expansionSetCode = "WTH"; + } + + public Thundermare(final Thundermare card) { + super(card); + } + + @Override + public Thundermare copy() { + return new Thundermare(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/TolarianDrake.java b/Mage.Sets/src/mage/sets/weatherlight/TolarianDrake.java index d235b884073..36fd5e37428 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/TolarianDrake.java +++ b/Mage.Sets/src/mage/sets/weatherlight/TolarianDrake.java @@ -28,12 +28,12 @@ package mage.sets.weatherlight; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.PhasingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; /** * @@ -49,7 +49,10 @@ public class TolarianDrake extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(4); + // Flying this.addAbility(FlyingAbility.getInstance()); + + // Phasing this.addAbility(PhasingAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/weatherlight/TolarianSerpent.java b/Mage.Sets/src/mage/sets/weatherlight/TolarianSerpent.java new file mode 100644 index 00000000000..5446010fb4b --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/TolarianSerpent.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.OnEventTriggeredAbility; +import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.events.GameEvent.EventType; + +/** + * + * @author fireshoes + */ +public class TolarianSerpent extends CardImpl { + + public TolarianSerpent(UUID ownerId) { + super(ownerId, 57, "Tolarian Serpent", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{U}{U}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Serpent"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // At the beginning of your upkeep, put the top seven cards of your library into your graveyard. + this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, + "beginning of your upkeep", + new PutTopCardOfLibraryIntoGraveControllerEffect(7), false)); + } + + public TolarianSerpent(final TolarianSerpent card) { + super(card); + } + + @Override + public TolarianSerpent copy() { + return new TolarianSerpent(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/Touchstone.java b/Mage.Sets/src/mage/sets/weatherlight/Touchstone.java new file mode 100644 index 00000000000..23339f313a6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/Touchstone.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author LoneFox + */ +public class Touchstone extends CardImpl { + + private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact you don't control"); + + static { + filter.add(new ControllerPredicate(TargetController.NOT_YOU)); + } + + public Touchstone(UUID ownerId) { + super(ownerId, 161, "Touchstone", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "WTH"; + + // {tap}: Tap target artifact you don't control. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetArtifactPermanent(filter)); + this.addAbility(ability); + } + + public Touchstone(final Touchstone card) { + super(card); + } + + @Override + public Touchstone copy() { + return new Touchstone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/VodalianIllusionist.java b/Mage.Sets/src/mage/sets/weatherlight/VodalianIllusionist.java new file mode 100644 index 00000000000..8684a6b2bdf --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/VodalianIllusionist.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PhaseOutTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class VodalianIllusionist extends CardImpl { + + public VodalianIllusionist(UUID ownerId) { + super(ownerId, 58, "Vodalian Illusionist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Merfolk"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {U}{U}, {tap}: Target creature phases out. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PhaseOutTargetEffect(), new ManaCostsImpl("{U}{U}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public VodalianIllusionist(final VodalianIllusionist card) { + super(card); + } + + @Override + public VodalianIllusionist copy() { + return new VodalianIllusionist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/XanthicStatue.java b/Mage.Sets/src/mage/sets/weatherlight/XanthicStatue.java new file mode 100644 index 00000000000..4df293f62ff --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/XanthicStatue.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + */ +public class XanthicStatue extends CardImpl { + + public XanthicStatue(UUID ownerId) { + super(ownerId, 163, "Xanthic Statue", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{8}"); + this.expansionSetCode = "WTH"; + + // {5}: Until end of turn, Xanthic Statue becomes an 8/8 Golem artifact creature with trample. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new XanthicStatueCreature(), + "", Duration.EndOfTurn), new ManaCostsImpl("{5}"))); + } + + public XanthicStatue(final XanthicStatue card) { + super(card); + } + + @Override + public XanthicStatue copy() { + return new XanthicStatue(this); + } +} + +class XanthicStatueCreature extends Token { + + public XanthicStatueCreature() { + super("Xanthic Statue", "8/8 Golem artifact creature with trample"); + cardType.add(CardType.ARTIFACT); + cardType.add(CardType.CREATURE); + power = new MageInt(8); + toughness = new MageInt(8); + + this.addAbility(TrampleAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/ZombieScavengers.java b/Mage.Sets/src/mage/sets/weatherlight/ZombieScavengers.java new file mode 100644 index 00000000000..126280485b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/ZombieScavengers.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileTopCreatureCardOfGraveyardCost; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class ZombieScavengers extends CardImpl { + + public ZombieScavengers(UUID ownerId) { + super(ownerId, 29, "Zombie Scavengers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Zombie"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Exile the top creature card of your graveyard: Regenerate Zombie Scavengers. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ExileTopCreatureCardOfGraveyardCost(1))); + } + + public ZombieScavengers(final ZombieScavengers card) { + super(card); + } + + @Override + public ZombieScavengers copy() { + return new ZombieScavengers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/worldwake/AgadeemOccultist.java b/Mage.Sets/src/mage/sets/worldwake/AgadeemOccultist.java index 7deedb8ceb2..69342ccaf85 100644 --- a/Mage.Sets/src/mage/sets/worldwake/AgadeemOccultist.java +++ b/Mage.Sets/src/mage/sets/worldwake/AgadeemOccultist.java @@ -28,9 +28,6 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -38,7 +35,9 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -96,32 +95,30 @@ class AgadeemOccultistEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - - Player you = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); int allycount = 0; for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) { if (permanent.hasSubtype("Ally")) { allycount++; } } - FilterCard filter = new FilterCard("creature card in an opponent's graveyard"); filter.add(new CardTypePredicate(CardType.CREATURE)); TargetCardInOpponentsGraveyard target = new TargetCardInOpponentsGraveyard(1, 1, filter); - if (you != null) { + if (controller != null) { if (target.canChoose(source.getControllerId(), game) - && you.choose(Outcome.GainControl, target, source.getSourceId(), game)) { + && controller.choose(Outcome.GainControl, target, source.getSourceId(), game)) { if (!target.getTargets().isEmpty()) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { if (card.getManaCost().convertedManaCost() <= allycount) { - card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId()); - return true; + return controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } } } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java b/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java index bb646a302af..c0222a26374 100644 --- a/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java +++ b/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java @@ -28,24 +28,19 @@ package mage.sets.worldwake; import java.util.UUID; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.Effect; +import mage.abilities.Ability; +import mage.abilities.common.BecomesTappedAttachedTriggeredAbility; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; +import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -53,7 +48,7 @@ import mage.target.targetpointer.FixedTarget; */ public class BrinkOfDisaster extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent(); + private static final FilterPermanent filter = new FilterPermanent("creature or land"); static { filter.add(Predicates.or( @@ -68,12 +63,14 @@ public class BrinkOfDisaster extends CardImpl { // Enchant creature or land - TargetPermanent auraTarget = new TargetPermanent(); + TargetPermanent auraTarget = new TargetPermanent(filter); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); // When enchanted permanent becomes tapped, destroy it. - this.addAbility(new EnchantedBecomesTappedTriggeredAbility(new DestroyTargetEffect())); + this.addAbility(new BecomesTappedAttachedTriggeredAbility(new DestroyAttachedEffect("it"), "enchanted permanent")); } public BrinkOfDisaster(final BrinkOfDisaster card) { @@ -85,41 +82,3 @@ public class BrinkOfDisaster extends CardImpl { return new BrinkOfDisaster(this); } } - -class EnchantedBecomesTappedTriggeredAbility extends TriggeredAbilityImpl { - - public EnchantedBecomesTappedTriggeredAbility(Effect effect) { - super(Zone.BATTLEFIELD, effect); - } - - public EnchantedBecomesTappedTriggeredAbility(final EnchantedBecomesTappedTriggeredAbility ability) { - super(ability); - } - - @Override - public EnchantedBecomesTappedTriggeredAbility copy() { - return new EnchantedBecomesTappedTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent enchant = game.getPermanent(sourceId); - if (enchant != null && enchant.getAttachedTo() != null) { - if (event.getTargetId().equals(enchant.getAttachedTo())) { - getEffects().get(0).setTargetPointer(new FixedTarget(enchant.getAttachedTo())); - return true; - } - } - return false; - } - - @Override - public String getRule() { - return "When enchanted permanent becomes tapped, destroy it."; - } -} diff --git a/Mage.Sets/src/mage/sets/worldwake/CanopyCover.java b/Mage.Sets/src/mage/sets/worldwake/CanopyCover.java index ca6ca52f355..71c8ff7ec97 100644 --- a/Mage.Sets/src/mage/sets/worldwake/CanopyCover.java +++ b/Mage.Sets/src/mage/sets/worldwake/CanopyCover.java @@ -28,12 +28,6 @@ package mage.sets.worldwake; import java.util.UUID; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.RestrictionEffect; @@ -43,33 +37,32 @@ import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ReachAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterObject; import mage.filter.FilterStackObject; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; - - /** * @author noxx */ public class CanopyCover extends CardImpl { - private static final FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control"); + private static final FilterObject filter = new FilterStackObject("spells or abilities your opponents control"); - static { - filter.add(new ControllerPredicate(TargetController.OPPONENT)); - } - public CanopyCover(UUID ownerId) { super(ownerId, 98, "Canopy Cover", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); this.expansionSetCode = "WWK"; this.subtype.add("Aura"); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -81,7 +74,7 @@ public class CanopyCover extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OrchardSpiritEffect())); // Enchanted creature can't be the target of spells or abilities your opponents control. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeTargetedAttachedEffect(filter, Duration.WhileOnBattlefield, AttachmentType.AURA))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeTargetedAttachedEffect(filter, Duration.WhileOnBattlefield, AttachmentType.AURA, TargetController.OPPONENT))); } public CanopyCover(final CanopyCover card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/DeathsShadow.java b/Mage.Sets/src/mage/sets/worldwake/DeathsShadow.java index 06208b8a2b3..57ea6364b1c 100644 --- a/Mage.Sets/src/mage/sets/worldwake/DeathsShadow.java +++ b/Mage.Sets/src/mage/sets/worldwake/DeathsShadow.java @@ -55,7 +55,8 @@ public class DeathsShadow extends CardImpl { this.toughness = new MageInt(13); // Death's Shadow gets -X/-X, where X is your life total. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new SignInversionDynamicValue(new ControllerLifeCount()), new SignInversionDynamicValue(new ControllerLifeCount()), Duration.WhileOnBattlefield))); + SignInversionDynamicValue x = new SignInversionDynamicValue(new ControllerLifeCount()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(x, x, Duration.WhileOnBattlefield))); } public DeathsShadow(final DeathsShadow card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/DragonmasterOutcast.java b/Mage.Sets/src/mage/sets/worldwake/DragonmasterOutcast.java index e0c43a32e08..b92c0b32276 100644 --- a/Mage.Sets/src/mage/sets/worldwake/DragonmasterOutcast.java +++ b/Mage.Sets/src/mage/sets/worldwake/DragonmasterOutcast.java @@ -38,12 +38,11 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.TargetController; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.DragonToken2; /** * @@ -67,7 +66,7 @@ public class DragonmasterOutcast extends CardImpl { this.toughness = new MageInt(1); // At the beginning of your upkeep, if you control six or more lands, put a 5/5 red Dragon creature token with flying onto the battlefield. - TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new DragonToken(), 1), TargetController.YOU, false); + TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new DragonToken2(), 1), TargetController.YOU, false); this.addAbility(new ConditionalTriggeredAbility(ability, new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 5), "At the beginning of your upkeep, if you control six or more lands, put a 5/5 red Dragon creature token with flying onto the battlefield.")); } @@ -80,16 +79,3 @@ public class DragonmasterOutcast extends CardImpl { return new DragonmasterOutcast(this); } } - -class DragonToken extends Token { - - public DragonToken() { - super("Dragon", "5/5 red Dragon creature token with flying"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add("Dragon"); - power = new MageInt(5); - toughness = new MageInt(5); - addAbility(FlyingAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/worldwake/FeralContest.java b/Mage.Sets/src/mage/sets/worldwake/FeralContest.java index f0af7b313e4..b519cab6c9c 100644 --- a/Mage.Sets/src/mage/sets/worldwake/FeralContest.java +++ b/Mage.Sets/src/mage/sets/worldwake/FeralContest.java @@ -32,7 +32,6 @@ import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; import mage.abilities.Ability; -import mage.abilities.effects.Effect; import mage.abilities.effects.RequirementEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.cards.CardImpl; @@ -53,8 +52,7 @@ public class FeralContest extends CardImpl { super(ownerId, 100, "Feral Contest", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{G}"); this.expansionSetCode = "WWK"; - - // Put a +1/+1 counter on target creature you control. + // Put a +1/+1 counter on target creature you control. this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance())); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); // Another target creature blocks it this turn if able. @@ -88,7 +86,7 @@ class FeralContestEffect extends RequirementEffect { } @Override - public boolean applies(Permanent permanent, Ability source, Game game) { + public boolean applies(Permanent permanent, Ability source, Game game) { if (permanent.getId().equals(source.getTargets().get(1).getFirstTarget())) { return permanent.canBlock(source.getFirstTarget(), game); } @@ -116,4 +114,3 @@ class FeralContestEffect extends RequirementEffect { } } - diff --git a/Mage.Sets/src/mage/sets/worldwake/JaceTheMindSculptor.java b/Mage.Sets/src/mage/sets/worldwake/JaceTheMindSculptor.java index 77ae649901b..26c00ef4c85 100644 --- a/Mage.Sets/src/mage/sets/worldwake/JaceTheMindSculptor.java +++ b/Mage.Sets/src/mage/sets/worldwake/JaceTheMindSculptor.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,21 +20,19 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.worldwake; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; @@ -43,8 +41,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; -import mage.game.ExileZone; +import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; @@ -56,13 +53,12 @@ import mage.target.common.TargetCreaturePermanent; */ public class JaceTheMindSculptor extends CardImpl { - public JaceTheMindSculptor(UUID ownerId) { super(ownerId, 31, "Jace, the Mind Sculptor", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{U}"); this.expansionSetCode = "WWK"; this.subtype.add("Jace"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3)); // +2: Look at the top card of target player's library. You may put that card on the bottom of that player's library. LoyaltyAbility ability1 = new LoyaltyAbility(new JaceTheMindSculptorEffect1(), 2); @@ -77,7 +73,7 @@ public class JaceTheMindSculptor extends CardImpl { LoyaltyAbility ability3 = new LoyaltyAbility(new ReturnToHandTargetEffect(), -1); ability3.addTarget(new TargetCreaturePermanent()); this.addAbility(ability3); - + // −12: Exile all cards from target player's library, then that player shuffles his or her hand into his or her library. LoyaltyAbility ability4 = new LoyaltyAbility(new JaceTheMindSculptorEffect3(), -12); ability4.addTarget(new TargetPlayer()); @@ -123,7 +119,7 @@ class JaceTheMindSculptorEffect1 extends OneShotEffect { cards.add(card); controller.lookAtCards("Jace, the Mind Sculptor", cards, game); if (controller.chooseUse(outcome, "Do you wish to put card on the bottom of player's library?", source, game)) { - controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, false, false); + controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, false, false); } else { game.informPlayers(controller.getLogName() + " puts the card back on top of the library."); } @@ -153,27 +149,19 @@ class JaceTheMindSculptorEffect2 extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - player.drawCards(3, game); - putOnLibrary(player, source, game); - putOnLibrary(player, source, game); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.drawCards(3, game); + TargetCardInHand target = new TargetCardInHand(2, 2, new FilterCard()); + controller.chooseTarget(Outcome.Detriment, target, source, game); + Cards cardsToLibrary = new CardsImpl(target.getTargets()); + if (!cardsToLibrary.isEmpty()) { + controller.putCardsOnTopOfLibrary(cardsToLibrary, game, source, true); + } return true; } return false; } - - private boolean putOnLibrary(Player player, Ability source, Game game) { - TargetCardInHand target = new TargetCardInHand(); - player.chooseTarget(Outcome.ReturnToHand, target, source, game); - Card card = player.getHand().get(target.getFirstTarget(), game); - if (card != null) { - player.getHand().remove(card); - player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false); - } - return true; - } - } class JaceTheMindSculptorEffect3 extends OneShotEffect { diff --git a/Mage.Sets/src/mage/sets/worldwake/JwariShapeshifter.java b/Mage.Sets/src/mage/sets/worldwake/JwariShapeshifter.java index c436a967e92..75eaeeef964 100644 --- a/Mage.Sets/src/mage/sets/worldwake/JwariShapeshifter.java +++ b/Mage.Sets/src/mage/sets/worldwake/JwariShapeshifter.java @@ -28,15 +28,12 @@ package mage.sets.worldwake; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -47,9 +44,9 @@ import mage.filter.predicate.permanent.AnotherPredicate; * @author jeffwadsworth */ public class JwariShapeshifter extends CardImpl { - + private static final FilterPermanent filter = new FilterPermanent("Ally creature"); - + static { filter.add(new SubtypePredicate("Ally")); filter.add(new CardTypePredicate(CardType.CREATURE)); @@ -66,11 +63,7 @@ public class JwariShapeshifter extends CardImpl { this.toughness = new MageInt(0); // You may have Jwari Shapeshifter enter the battlefield as a copy of any Ally creature on the battlefield. - Ability ability = new SimpleStaticAbility( - Zone.BATTLEFIELD, - new EntersBattlefieldEffect(new CopyPermanentEffect(filter), null, - "You may have {this} enter the battlefield as a copy of any Ally creature on the battlefield", true, true)); - this.addAbility(ability); + this.addAbility(new EntersBattlefieldAbility(new CopyPermanentEffect(filter), true)); } public JwariShapeshifter(final JwariShapeshifter card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java b/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java index 03616f85f12..c31ead38fb5 100644 --- a/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java +++ b/Mage.Sets/src/mage/sets/worldwake/LavaclawReaches.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,19 +20,14 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.worldwake; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -44,6 +39,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.permanent.token.Token; /** @@ -55,9 +54,13 @@ public class LavaclawReaches extends CardImpl { public LavaclawReaches(UUID ownerId) { super(ownerId, 139, "Lavaclaw Reaches", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "WWK"; + + // Lavaclaw Reaches enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); + // {T}: Add {B} or {R} to your mana pool. this.addAbility(new BlackManaAbility()); this.addAbility(new RedManaAbility()); + // {1}{B}{R}: Until end of turn, Lavaclaw Reaches becomes a 2/2 black and red Elemental creature with ": This creature gets +X/+0 until end of turn." It's still a land. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new LavaclawReachesToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{1}{B}{R}"))); } diff --git a/Mage.Sets/src/mage/sets/worldwake/MarshalsAnthem.java b/Mage.Sets/src/mage/sets/worldwake/MarshalsAnthem.java index a86eb44cc24..1c659222013 100644 --- a/Mage.Sets/src/mage/sets/worldwake/MarshalsAnthem.java +++ b/Mage.Sets/src/mage/sets/worldwake/MarshalsAnthem.java @@ -27,6 +27,7 @@ */ package mage.sets.worldwake; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -37,7 +38,11 @@ import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffec import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.keyword.MultikickerAbility; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -45,8 +50,6 @@ import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.target.common.TargetCardInYourGraveyard; -import java.util.UUID; - /** * * @author jeffwadsworth @@ -62,11 +65,12 @@ public class MarshalsAnthem extends CardImpl { filterCard.add(new CardTypePredicate(CardType.CREATURE)); } + private final UUID originalId; + public MarshalsAnthem(UUID ownerId) { super(ownerId, 15, "Marshal's Anthem", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); this.expansionSetCode = "WWK"; - // Multikicker {1}{W} this.addAbility(new MultikickerAbility("{1}{W}")); @@ -74,18 +78,18 @@ public class MarshalsAnthem extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false))); // When Marshal's Anthem enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times Marshal's Anthem was kicked. - Ability ability = new ConditionalTriggeredAbility( new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), false), KickedCondition.getInstance(), "When {this} enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times {this} was kicked."); + originalId = ability.getOriginalId(); this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof ConditionalTriggeredAbility) { + if (ability.getOriginalId().equals(originalId)) { ability.getTargets().clear(); int numbTargets = new MultikickerCount().calculate(game, ability, null); if (numbTargets > 0) { @@ -96,6 +100,7 @@ public class MarshalsAnthem extends CardImpl { public MarshalsAnthem(final MarshalsAnthem card) { super(card); + this.originalId = card.originalId; } @Override diff --git a/Mage.Sets/src/mage/sets/worldwake/NemesisTrap.java b/Mage.Sets/src/mage/sets/worldwake/NemesisTrap.java index 5665494edbe..95b7dead30f 100644 --- a/Mage.Sets/src/mage/sets/worldwake/NemesisTrap.java +++ b/Mage.Sets/src/mage/sets/worldwake/NemesisTrap.java @@ -29,28 +29,29 @@ package mage.sets.worldwake; import java.util.UUID; import mage.ObjectColor; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileSourceEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.permanent.AttackingPredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; import mage.players.Player; import mage.target.common.TargetAttackingCreature; -import mage.util.CardUtil; +import mage.target.targetpointer.FixedTarget; /** * @@ -59,19 +60,17 @@ import mage.util.CardUtil; public class NemesisTrap extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("If a white creature is attacking"); - + static { filter.add(new ColorPredicate(ObjectColor.WHITE)); filter.add(new AttackingPredicate()); } - - + public NemesisTrap(UUID ownerId) { super(ownerId, 61, "Nemesis Trap", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{4}{B}{B}"); this.expansionSetCode = "WWK"; this.subtype.add("Trap"); - // If a white creature is attacking, you may pay {B}{B} rather than pay Nemesis Trap's mana cost. this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{B}{B}"), new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 0, false))); @@ -111,11 +110,21 @@ class NemesisTrapEffect extends OneShotEffect { Permanent targetedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); Player controller = game.getPlayer(source.getControllerId()); if (controller != null && targetedCreature != null) { - controller.moveCardToExileWithInfo(targetedCreature, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true); - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(targetedCreature); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - token.addAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ExileSourceEffect())); + // exile target + controller.moveCards(targetedCreature, null, Zone.EXILED, source, game); + // create token + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); + effect.setTargetPointer(new FixedTarget(targetedCreature, game)); + effect.apply(game, source); + for (Permanent addedToken : effect.getAddedPermanent()) { + Effect exileEffect = new ExileTargetEffect("Exile " + addedToken.getName() + " at the beginning of the next end step"); + exileEffect.setTargetPointer(new FixedTarget(addedToken, game)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } return true; } return false; diff --git a/Mage.Sets/src/mage/sets/worldwake/QuestForRenewal.java b/Mage.Sets/src/mage/sets/worldwake/QuestForRenewal.java index 0e54dc6ac14..bea09ad6d9f 100644 --- a/Mage.Sets/src/mage/sets/worldwake/QuestForRenewal.java +++ b/Mage.Sets/src/mage/sets/worldwake/QuestForRenewal.java @@ -28,7 +28,7 @@ package mage.sets.worldwake; import java.util.UUID; -import mage.abilities.common.BecomesTappedCreatureControlledTriggeredAbility; +import mage.abilities.common.BecomesTappedTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.SourceHasCounterCondition; import mage.abilities.decorator.ConditionalContinuousEffect; @@ -46,22 +46,20 @@ import mage.filter.common.FilterControlledCreaturePermanent; * @author jeffwadsworth */ public class QuestForRenewal extends CardImpl { - - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control"); public QuestForRenewal(UUID ownerId) { super(ownerId, 110, "Quest for Renewal", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); this.expansionSetCode = "WWK"; - // Whenever a creature you control becomes tapped, you may put a quest counter on Quest for Renewal. - this.addAbility(new BecomesTappedCreatureControlledTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true)); - + this.addAbility(new BecomesTappedTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), + true, new FilterControlledCreaturePermanent("a creature you control"))); + // As long as there are four or more quest counters on Quest for Renewal, untap all creatures you control during each other player's untap step. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new UntapAllDuringEachOtherPlayersUntapStepEffect(filter), - new SourceHasCounterCondition(CounterType.QUEST, 4), - "As long as there are four or more quest counters on {this}, untap all creatures you control during each other player's untap step."))); + new UntapAllDuringEachOtherPlayersUntapStepEffect(new FilterControlledCreaturePermanent()), + new SourceHasCounterCondition(CounterType.QUEST, 4), + "As long as there are four or more quest counters on {this}, untap all creatures you control during each other player's untap step."))); } public QuestForRenewal(final QuestForRenewal card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/QuestForUlasTemple.java b/Mage.Sets/src/mage/sets/worldwake/QuestForUlasTemple.java index d4ae627af11..95eaa8a0b70 100644 --- a/Mage.Sets/src/mage/sets/worldwake/QuestForUlasTemple.java +++ b/Mage.Sets/src/mage/sets/worldwake/QuestForUlasTemple.java @@ -62,7 +62,6 @@ public class QuestForUlasTemple extends CardImpl { super(ownerId, 35, "Quest for Ula's Temple", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{U}"); this.expansionSetCode = "WWK"; - // At the beginning of your upkeep, you may look at the top card of your library. If it's a creature card, you may reveal it and put a quest counter on Quest for Ula's Temple. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new QuestForUlasTempleEffect(), TargetController.YOU, true)); @@ -140,7 +139,7 @@ class QuestForUlasTempleTriggeredAbility extends TriggeredAbilityImpl { } @Override -public boolean checkTrigger(GameEvent event, Game game) { + public boolean checkTrigger(GameEvent event, Game game) { Permanent quest = game.getPermanent(super.getSourceId()); return quest != null && quest.getCounters().getCount(CounterType.QUEST) >= 3; } @@ -178,12 +177,10 @@ class QuestForUlasTempleEffect2 extends OneShotEffect { if (controller != null) { TargetCardInHand target = new TargetCardInHand(filter); if (target.canChoose(source.getSourceId(), controller.getId(), game) - &&controller.chooseUse(Outcome.PutCreatureInPlay, query, source, game)) { + && controller.chooseUse(Outcome.PutCreatureInPlay, query, source, game)) { if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); - if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); - } + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } return true; diff --git a/Mage.Sets/src/mage/sets/worldwake/RoilingTerrain.java b/Mage.Sets/src/mage/sets/worldwake/RoilingTerrain.java index 6a709b65662..d60e58b151a 100644 --- a/Mage.Sets/src/mage/sets/worldwake/RoilingTerrain.java +++ b/Mage.Sets/src/mage/sets/worldwake/RoilingTerrain.java @@ -28,15 +28,13 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; -import mage.filter.FilterCard; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.constants.Rarity; +import mage.filter.common.FilterLandCard; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -52,7 +50,6 @@ public class RoilingTerrain extends CardImpl { super(ownerId, 88, "Roiling Terrain", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{R}{R}"); this.expansionSetCode = "WWK"; - // Destroy target land, then Roiling Terrain deals damage to that land's controller equal to the number of land cards in that player's graveyard. this.getSpellAbility().addEffect(new RoilingTerrainEffect()); this.getSpellAbility().addTarget(new TargetLandPermanent()); @@ -69,12 +66,6 @@ public class RoilingTerrain extends CardImpl { } class RoilingTerrainEffect extends OneShotEffect { - - private static final FilterCard filter = new FilterCard("lands in graveyard"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } public RoilingTerrainEffect() { super(Outcome.Sacrifice); @@ -92,14 +83,16 @@ class RoilingTerrainEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent targetedLand = game.getPermanent(source.getFirstTarget()); + Permanent targetedLand = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetedLand != null) { - Player controller = game.getPlayer(targetedLand.getControllerId()); - targetedLand.destroy(id, game, true); - int landsInGraveyard = controller.getGraveyard().count(filter, game); - controller.damage(landsInGraveyard, id, game, false, true); + targetedLand.destroy(source.getSourceId(), game, true); + Player targetController = game.getPlayer(targetedLand.getControllerId()); + if (targetController != null) { + int landsInGraveyard = targetController.getGraveyard().count(new FilterLandCard(), game); + targetController.damage(landsInGraveyard, source.getSourceId(), game, false, true); + } return true; } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java index 2cccea80098..dd13eb7b80d 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java +++ b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.worldwake; import java.util.HashSet; @@ -45,7 +44,6 @@ import mage.game.stack.StackObject; import mage.players.Player; import mage.target.TargetPermanent; import mage.target.TargetPlayer; -import mage.watchers.Watcher; import mage.watchers.common.LandfallWatcher; /** @@ -140,10 +138,10 @@ class SearingBlazeTarget extends TargetPermanent { Set possibleTargets = new HashSet<>(); MageObject object = game.getObject(sourceId); if (object instanceof StackObject) { - UUID playerId = ((StackObject)object).getStackAbility().getFirstTarget(); + UUID playerId = ((StackObject) object).getStackAbility().getFirstTarget(); for (UUID targetId : availablePossibleTargets) { Permanent permanent = game.getPermanent(targetId); - if(permanent != null && permanent.getControllerId().equals(playerId)){ + if (permanent != null && permanent.getControllerId().equals(playerId)) { possibleTargets.add(targetId); } } @@ -155,4 +153,4 @@ class SearingBlazeTarget extends TargetPermanent { public SearingBlazeTarget copy() { return new SearingBlazeTarget(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/worldwake/StoneIdolTrap.java b/Mage.Sets/src/mage/sets/worldwake/StoneIdolTrap.java index 2bab309e9cc..d6f1d3c7394 100644 --- a/Mage.Sets/src/mage/sets/worldwake/StoneIdolTrap.java +++ b/Mage.Sets/src/mage/sets/worldwake/StoneIdolTrap.java @@ -30,7 +30,6 @@ package mage.sets.worldwake; import mage.constants.*; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; @@ -47,6 +46,7 @@ import mage.target.targetpointer.FixedTarget; import mage.util.CardUtil; import java.util.UUID; +import mage.game.permanent.Permanent; /** * @@ -54,7 +54,6 @@ import java.util.UUID; */ public class StoneIdolTrap extends CardImpl { - public StoneIdolTrap(UUID ownerId) { super(ownerId, 93, "Stone Idol Trap", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{5}{R}"); this.expansionSetCode = "WWK"; @@ -86,6 +85,7 @@ class StoneIdolTrapCostReductionEffect extends CostModificationEffectImpl { static { filter.add(new AttackingPredicate()); } + public StoneIdolTrapCostReductionEffect() { super(Duration.WhileOnStack, Outcome.Benefit, CostModificationType.REDUCE_COST); staticText = "{this} costs {1} less to cast for each attacking creature"; @@ -97,7 +97,7 @@ class StoneIdolTrapCostReductionEffect extends CostModificationEffectImpl { @Override public boolean apply(Game game, Ability source, Ability abilityToModify) { - int reductionAmount = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(),game); + int reductionAmount = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game); CardUtil.reduceCost(abilityToModify, reductionAmount); return true; } @@ -136,14 +136,14 @@ class StoneIdolTrapEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { StoneTrapIdolToken token = new StoneTrapIdolToken(); token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - ExileTargetEffect exileEffect = new ExileTargetEffect("exile the token"); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect, TargetController.YOU); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source); + } + } return true; } } diff --git a/Mage.Sets/src/mage/sets/worldwake/Terastodon.java b/Mage.Sets/src/mage/sets/worldwake/Terastodon.java index 3192537315c..9999b33da28 100644 --- a/Mage.Sets/src/mage/sets/worldwake/Terastodon.java +++ b/Mage.Sets/src/mage/sets/worldwake/Terastodon.java @@ -28,15 +28,15 @@ package mage.sets.worldwake; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -68,7 +68,7 @@ public class Terastodon extends CardImpl { // When Terastodon enters the battlefield, you may destroy up to three target noncreature permanents. For each permanent put into a graveyard this way, its controller puts a 3/3 green Elephant creature token onto the battlefield. Ability ability = new EntersBattlefieldTriggeredAbility(new TerastodonEffect(), true); - ability.addTarget(new TargetPermanent(0, 3, filter, true)); + ability.addTarget(new TargetPermanent(0, 3, filter, false)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/worldwake/ThadaAdelAcquisitor.java b/Mage.Sets/src/mage/sets/worldwake/ThadaAdelAcquisitor.java index 409950b8a77..55124b98a13 100644 --- a/Mage.Sets/src/mage/sets/worldwake/ThadaAdelAcquisitor.java +++ b/Mage.Sets/src/mage/sets/worldwake/ThadaAdelAcquisitor.java @@ -147,6 +147,7 @@ class ThadaAdelPlayFromExileEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - return sourceId.equals(getTargetPointer().getFirst(game, source)) && game.getState().getZone(sourceId) == Zone.EXILED; + return source.getControllerId().equals(affectedControllerId) + && sourceId.equals(getTargetPointer().getFirst(game, source)); } } diff --git a/Mage.Sets/src/mage/sets/worldwake/TuktukScrapper.java b/Mage.Sets/src/mage/sets/worldwake/TuktukScrapper.java index f1476ca3aee..2a22757c2ef 100644 --- a/Mage.Sets/src/mage/sets/worldwake/TuktukScrapper.java +++ b/Mage.Sets/src/mage/sets/worldwake/TuktukScrapper.java @@ -100,7 +100,7 @@ class TuktukScrapperTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null) { - if (permanent.getId() == this.getSourceId()) { + if (permanent.getId().equals(this.getSourceId())) { return true; } if (permanent.hasSubtype("Ally") diff --git a/Mage.Sets/src/mage/sets/worldwake/UrgeToFeed.java b/Mage.Sets/src/mage/sets/worldwake/UrgeToFeed.java index 63b2dd60258..ad2d8e2ba1b 100644 --- a/Mage.Sets/src/mage/sets/worldwake/UrgeToFeed.java +++ b/Mage.Sets/src/mage/sets/worldwake/UrgeToFeed.java @@ -28,15 +28,14 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.TargetController; import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; @@ -45,6 +44,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; /** @@ -59,7 +59,6 @@ public class UrgeToFeed extends CardImpl { super(ownerId, 70, "Urge to Feed", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{B}{B}"); this.expansionSetCode = "WWK"; - // Target creature gets -3/-3 until end of turn. You may tap any number of untapped Vampire creatures you control. If you do, put a +1/+1 counter on each of those Vampires. this.getSpellAbility().addEffect(new BoostTargetEffect(-3, -3, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); @@ -97,20 +96,17 @@ class UrgeToFeedEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - TargetCreaturePermanent target = new TargetCreaturePermanent(filter); - while (true) { - target.clearChosen(); - if (target.canChoose(source.getControllerId(), game) && target.choose(Outcome.Tap, source.getControllerId(), source.getSourceId(), game)) { - UUID vampire = target.getFirstTarget(); + TargetCreaturePermanent target = new TargetCreaturePermanent(0, Integer.MAX_VALUE, filter, true); + if (target.canChoose(source.getControllerId(), game) && target.choose(Outcome.Tap, source.getControllerId(), source.getSourceId(), game)) { + for (UUID vampireId : target.getTargets()) { + Permanent vampire = game.getPermanent(vampireId); if (vampire != null) { - game.getPermanent(vampire).tap(game); - game.getPermanent(vampire).addCounters(CounterType.P1P1.createInstance(), game); + vampire.tap(game); + vampire.addCounters(CounterType.P1P1.createInstance(), game); } - } else { - break; } } - return false; + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/worldwake/VoyagerDrake.java b/Mage.Sets/src/mage/sets/worldwake/VoyagerDrake.java index 63fc3e04582..393be9eb6df 100644 --- a/Mage.Sets/src/mage/sets/worldwake/VoyagerDrake.java +++ b/Mage.Sets/src/mage/sets/worldwake/VoyagerDrake.java @@ -27,6 +27,7 @@ */ package mage.sets.worldwake; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -43,14 +44,14 @@ import mage.constants.Rarity; import mage.game.Game; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * * @author jeffwadsworth */ public class VoyagerDrake extends CardImpl { + private final UUID originalId; + public VoyagerDrake(UUID ownerId) { super(ownerId, 45, "Voyager Drake", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.expansionSetCode = "WWK"; @@ -70,21 +71,24 @@ public class VoyagerDrake extends CardImpl { new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), false), KickedCondition.getInstance(), "When {this} enters the battlefield, up to X target creatures gain flying until end of turn, where X is the number of times {this} was kicked."); + originalId = ability.getOriginalId(); this.addAbility(ability); } @Override public void adjustTargets(Ability ability, Game game) { - if (ability instanceof ConditionalTriggeredAbility) { + if (ability.getOriginalId().equals(originalId)) { ability.getTargets().clear(); int numbTargets = new MultikickerCount().calculate(game, ability, null); if (numbTargets > 0) { - ability.addTarget(new TargetCreaturePermanent(0,numbTargets)); + ability.addTarget(new TargetCreaturePermanent(0, numbTargets)); } } } + public VoyagerDrake(final VoyagerDrake card) { super(card); + this.originalId = card.originalId; } @Override diff --git a/Mage.Sets/src/mage/sets/worldwake/WrexialTheRisenDeep.java b/Mage.Sets/src/mage/sets/worldwake/WrexialTheRisenDeep.java index c0c76991785..678fbf386b4 100644 --- a/Mage.Sets/src/mage/sets/worldwake/WrexialTheRisenDeep.java +++ b/Mage.Sets/src/mage/sets/worldwake/WrexialTheRisenDeep.java @@ -28,11 +28,6 @@ package mage.sets.worldwake; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; @@ -42,6 +37,11 @@ import mage.abilities.keyword.IslandwalkAbility; import mage.abilities.keyword.SwampwalkAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -50,7 +50,6 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; -import mage.game.stack.Spell; import mage.game.stack.StackObject; import mage.players.Player; import mage.target.Target; @@ -156,29 +155,22 @@ class WrexialReplacementEffect extends ReplacementEffectImpl { public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.ZONE_CHANGE; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getToZone() == Zone.GRAVEYARD - && ((ZoneChangeEvent) event).getTargetId() == cardid) { - return true; - } - return false; + return zEvent.getToZone() == Zone.GRAVEYARD + && ((ZoneChangeEvent) event).getTargetId().equals(cardid); } - + @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { UUID eventObject = ((ZoneChangeEvent) event).getTargetId(); StackObject card = game.getStack().getStackObject(eventObject); Player controller = game.getPlayer(source.getControllerId()); if (card != null && controller != null) { - if (card instanceof Spell) { - game.rememberLKI(card.getId(), Zone.STACK, (Spell) card); - } if (card instanceof Card) { - controller.moveCardToExileWithInfo((Card)card, null, "", source.getSourceId(), game, game.getState().getZone(event.getTargetId()), true); - return true; + return controller.moveCards((Card) card, null, Zone.EXILED, source, game); } } return false; diff --git a/Mage.Sets/src/mage/sets/zendikar/AetherFigment.java b/Mage.Sets/src/mage/sets/zendikar/AetherFigment.java index da7a28bd75e..d5b4caaa4a7 100644 --- a/Mage.Sets/src/mage/sets/zendikar/AetherFigment.java +++ b/Mage.Sets/src/mage/sets/zendikar/AetherFigment.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,36 +20,31 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.common.KickedCondition; -import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.abilities.keyword.KickerAbility; import mage.abilities.keyword.CantBeBlockedSourceAbility; +import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.counters.CounterType; - /** * @author nantuko, BetaSteward_at_googlemail.com */ public class AetherFigment extends CardImpl { - private static final String staticText = "with two +1/+1 counters on it, if it was kicked"; - public AetherFigment(UUID ownerId) { super(ownerId, 40, "AEther Figment", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.expansionSetCode = "ZEN"; @@ -65,7 +60,11 @@ public class AetherFigment extends CardImpl { this.addAbility(new KickerAbility("{3}")); // If AEther Figment was kicked, it enters the battlefield with two +1/+1 counters on it - Ability ability = new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), KickedCondition.getInstance(), ""), staticText); + Ability ability = new EntersBattlefieldAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), + KickedCondition.getInstance(), + "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it", + ""); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/zendikar/ArrowVolleyTrap.java b/Mage.Sets/src/mage/sets/zendikar/ArrowVolleyTrap.java index 704c1011a60..a83b34aa210 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ArrowVolleyTrap.java +++ b/Mage.Sets/src/mage/sets/zendikar/ArrowVolleyTrap.java @@ -35,8 +35,7 @@ import mage.abilities.effects.common.DamageMultiEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.permanent.AttackingPredicate; +import mage.filter.common.FilterAttackingCreature; import mage.game.Game; import mage.target.common.TargetCreaturePermanentAmount; @@ -45,23 +44,17 @@ import mage.target.common.TargetCreaturePermanentAmount; */ public class ArrowVolleyTrap extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("attacking creatures"); - - static { - filter.add(new AttackingPredicate()); - } - public ArrowVolleyTrap(UUID ownerId) { super(ownerId, 2, "Arrow Volley Trap", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{W}{W}"); this.expansionSetCode = "ZEN"; - + this.subtype.add("Trap"); // If four or more creatures are attacking, you may pay {1}{W} rather than pay Arrow Volley Trap's mana cost. this.getSpellAbility().addAlternativeCost(new ArrowVolleyTrapAlternativeCost()); // Arrow Volley Trap deals 5 damage divided as you choose among any number of target attacking creatures. this.getSpellAbility().addEffect(new DamageMultiEffect(5)); - this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(5, filter)); + this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(5, new FilterAttackingCreature("attacking creatures"))); } @@ -100,4 +93,4 @@ class ArrowVolleyTrapAlternativeCost extends AlternativeCostImpl { public String getText() { return "If four or more creatures are attacking, you may pay {1}{W} rather than pay {this}'s mana cost"; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/zendikar/BalaGedThief.java b/Mage.Sets/src/mage/sets/zendikar/BalaGedThief.java index 36129e4800a..eb1ad19cc5c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BalaGedThief.java +++ b/Mage.Sets/src/mage/sets/zendikar/BalaGedThief.java @@ -1,156 +1,146 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.zendikar; - -import java.util.List; -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; -import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.constants.Outcome; -import mage.constants.Zone; -import mage.filter.FilterCard; -import mage.filter.FilterPermanent; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardIdPredicate; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.players.Player; -import mage.target.TargetCard; -import mage.target.TargetPlayer; - -/** - * - * @author jeffwadsworth - */ -public class BalaGedThief extends CardImpl { - - public BalaGedThief(UUID ownerId) { - super(ownerId, 79, "Bala Ged Thief", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Human"); - this.subtype.add("Rogue"); - this.subtype.add("Ally"); - - this.power = new MageInt(2); - this.toughness = new MageInt(2); - - FilterPermanent filter = new FilterPermanent("Bala Ged Thief or another Ally"); - filter.add(Predicates.or( - new CardIdPredicate(this.getId()), - new SubtypePredicate("Ally"))); - - // Whenever Bala Ged Thief or another Ally enters the battlefield under your control, target player reveals a number of cards from his or her hand equal to the number of Allies you control. You choose one of them. That player discards that card. - Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new BalaGedThiefEffect(), filter, false); - TargetPlayer target = new TargetPlayer(); - ability.addTarget(target); - this.addAbility(ability); - } - - public BalaGedThief(final BalaGedThief card) { - super(card); - } - - @Override - public BalaGedThief copy() { - return new BalaGedThief(this); - } -} - -class BalaGedThiefEffect extends OneShotEffect { - - public BalaGedThiefEffect() { - super(Outcome.Discard); - this.staticText = "target player reveals a number of cards from his or her hand equal to the number of Allies you control. You choose one of them. That player discards that card"; - } - - public BalaGedThiefEffect(final BalaGedThiefEffect effect) { - super(effect); - } - - @Override - public BalaGedThiefEffect copy() { - return new BalaGedThiefEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player targetPlayer = game.getPlayer(source.getFirstTarget()); - - if (targetPlayer == null) { - return false; - } - - Player you = game.getPlayer(source.getControllerId()); - - FilterControlledPermanent filter = new FilterControlledPermanent(); - filter.add(new SubtypePredicate("Ally")); - - int numberOfAllies = game.getBattlefield().countAll(filter, you.getId(), game); - - Cards cardsInHand = new CardsImpl(Zone.PICK); - cardsInHand.addAll(targetPlayer.getHand()); - - int count = Math.min(cardsInHand.size(), numberOfAllies); - - TargetCard target = new TargetCard(count, Zone.PICK, new FilterCard()); - Cards revealedCards = new CardsImpl(); - - if (targetPlayer.choose(Outcome.DrawCard, cardsInHand, target, game)) { - List targets = target.getTargets(); - for (UUID targetId : targets) { - Card card = game.getCard(targetId); - if (card != null) { - revealedCards.add(card); - } - } - } - - TargetCard targetInHand = new TargetCard(Zone.PICK, new FilterCard("card to discard")); - - if (!revealedCards.isEmpty()) { - targetPlayer.revealCards("Bala Ged Thief", revealedCards, game); - you.choose(Outcome.Neutral, revealedCards, targetInHand, game); - Card card = revealedCards.get(targetInHand.getFirstTarget(), game); - if (card != null) { - targetPlayer.discard(card, source, game); - game.informPlayers(new StringBuilder("Bala Ged Thief: ").append(targetPlayer.getLogName()).append(" discarded ").append(card.getName()).toString()); - } - } - return true; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikar; + +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; +import mage.target.TargetPlayer; + +/** + * + * @author jeffwadsworth + */ +public class BalaGedThief extends CardImpl { + + public BalaGedThief(UUID ownerId) { + super(ownerId, 79, "Bala Ged Thief", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Human"); + this.subtype.add("Rogue"); + this.subtype.add("Ally"); + + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Bala Ged Thief or another Ally enters the battlefield under your control, target player reveals a number of cards from his or her hand equal to the number of Allies you control. You choose one of them. That player discards that card. + Ability ability = new AllyEntersBattlefieldTriggeredAbility(new BalaGedThiefEffect(), false); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public BalaGedThief(final BalaGedThief card) { + super(card); + } + + @Override + public BalaGedThief copy() { + return new BalaGedThief(this); + } +} + +class BalaGedThiefEffect extends OneShotEffect { + + public BalaGedThiefEffect() { + super(Outcome.Discard); + this.staticText = "target player reveals a number of cards from his or her hand equal to the number of Allies you control. You choose one of them. That player discards that card"; + } + + public BalaGedThiefEffect(final BalaGedThiefEffect effect) { + super(effect); + } + + @Override + public BalaGedThiefEffect copy() { + return new BalaGedThiefEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(source.getFirstTarget()); + + if (targetPlayer == null) { + return false; + } + + Player you = game.getPlayer(source.getControllerId()); + + FilterControlledPermanent filter = new FilterControlledPermanent(); + filter.add(new SubtypePredicate("Ally")); + + int numberOfAllies = game.getBattlefield().countAll(filter, you.getId(), game); + + Cards cardsInHand = new CardsImpl(Zone.PICK); + cardsInHand.addAll(targetPlayer.getHand()); + + int count = Math.min(cardsInHand.size(), numberOfAllies); + + TargetCard target = new TargetCard(count, Zone.PICK, new FilterCard()); + Cards revealedCards = new CardsImpl(); + + if (targetPlayer.choose(Outcome.DrawCard, cardsInHand, target, game)) { + List targets = target.getTargets(); + for (UUID targetId : targets) { + Card card = game.getCard(targetId); + if (card != null) { + revealedCards.add(card); + } + } + } + + TargetCard targetInHand = new TargetCard(Zone.PICK, new FilterCard("card to discard")); + + if (!revealedCards.isEmpty()) { + targetPlayer.revealCards("Bala Ged Thief", revealedCards, game); + you.choose(Outcome.Neutral, revealedCards, targetInHand, game); + Card card = revealedCards.get(targetInHand.getFirstTarget(), game); + if (card != null) { + targetPlayer.discard(card, source, game); + game.informPlayers(new StringBuilder("Bala Ged Thief: ").append(targetPlayer.getLogName()).append(" discarded ").append(card.getName()).toString()); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/BalothCageTrap.java b/Mage.Sets/src/mage/sets/zendikar/BalothCageTrap.java index 62210c83963..492af7f4d46 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BalothCageTrap.java +++ b/Mage.Sets/src/mage/sets/zendikar/BalothCageTrap.java @@ -28,21 +28,18 @@ package mage.sets.zendikar; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; -import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.costs.AlternativeCostImpl; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.WatcherScope; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.BeastToken2; import mage.watchers.Watcher; /** @@ -56,13 +53,12 @@ public class BalothCageTrap extends CardImpl { this.expansionSetCode = "ZEN"; this.subtype.add("Trap"); - // If an opponent had an artifact enter the battlefield under his or her control this turn, you may pay {1}{G} rather than pay Baloth Cage Trap's mana cost. this.getSpellAbility().addAlternativeCost(new BalothCageTrapAlternativeCost()); this.getSpellAbility().addWatcher(new BalothCageTrapWatcher()); // Put a 4/4 green Beast creature token onto the battlefield. - this.getSpellAbility().addEffect(new CreateTokenEffect(new BeastGreenToken())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new BeastToken2())); } public BalothCageTrap(final BalothCageTrap card) { @@ -140,15 +136,3 @@ class BalothCageTrapAlternativeCost extends AlternativeCostImpl { return "If an opponent had an artifact enter the battlefield under his or her control this turn, you may pay {1}{G} rather than pay Baloth Cage Trap's mana cost"; } } - -class BeastGreenToken extends Token { - - public BeastGreenToken() { - super("Beast", "4/4 green Beast creature token"); - cardType.add(CardType.CREATURE); - color.setGreen(true); - subtype.add("Beast"); - power = new MageInt(4); - toughness = new MageInt(4); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/BloodTribute.java b/Mage.Sets/src/mage/sets/zendikar/BloodTribute.java index 43437afc3f2..1335d9f4be9 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BloodTribute.java +++ b/Mage.Sets/src/mage/sets/zendikar/BloodTribute.java @@ -33,8 +33,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.condition.common.KickedCondition; -import mage.abilities.costs.OptionalAdditionalCost; -import mage.abilities.costs.OptionalAdditionalCostImpl; import mage.abilities.costs.common.TapTargetCost; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.Effect; @@ -56,7 +54,7 @@ import mage.target.common.TargetOpponent; */ public class BloodTribute extends CardImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Vampire you control"); + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("an untapped Vampire you control"); static { filter.add(Predicates.not(new TappedPredicate())); @@ -67,20 +65,18 @@ public class BloodTribute extends CardImpl { super(ownerId, 81, "Blood Tribute", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}{B}"); this.expansionSetCode = "ZEN"; - // Kicker - Tap an untapped Vampire you control. - OptionalAdditionalCost cost = new OptionalAdditionalCostImpl("Kicker-","",new TapTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true))); - this.addAbility(new KickerAbility(cost)); + this.addAbility(new KickerAbility(new TapTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true)))); // Target opponent loses half his or her life, rounded up. this.getSpellAbility().addTarget(new TargetOpponent()); this.getSpellAbility().addEffect(new BloodTributeLoseLifeEffect()); - + // If Blood Tribute was kicked, you gain life equal to the life lost this way. Effect effect = new ConditionalOneShotEffect( new BloodTributeGainLifeEffect(), KickedCondition.getInstance(), - "If Blood Tribute was kicked, you gain life equal to the life lost this way"); + "If {this} was kicked, you gain life equal to the life lost this way"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/sets/zendikar/ChandraAblaze.java b/Mage.Sets/src/mage/sets/zendikar/ChandraAblaze.java index 9ccf7a83cff..7caa34f04f9 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ChandraAblaze.java +++ b/Mage.Sets/src/mage/sets/zendikar/ChandraAblaze.java @@ -32,17 +32,16 @@ import java.util.UUID; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardAllEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.discard.DiscardHandAllEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -65,8 +64,7 @@ public class ChandraAblaze extends CardImpl { this.expansionSetCode = "ZEN"; this.subtype.add("Chandra"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5)); // +1: Discard a card. If a red card is discarded this way, Chandra Ablaze deals 4 damage to target creature or player. LoyaltyAbility ability = new LoyaltyAbility(new ChandraAblazeEffect1(), 1); @@ -75,7 +73,9 @@ public class ChandraAblaze extends CardImpl { this.addAbility(ability); // -2: Each player discards his or her hand, then draws three cards. ability = new LoyaltyAbility(new DiscardHandAllEffect(), -2); - ability.addEffect(new ChandraAblazeEffect4()); + Effect effect = new DrawCardAllEffect(3); + effect.setText(", then draws three cards"); + ability.addEffect(effect); this.addAbility(ability); // -7: Cast any number of red instant and/or sorcery cards from your graveyard without paying their mana costs. ability = new LoyaltyAbility(new ChandraAblazeEffect5(), -7); @@ -162,23 +162,6 @@ class ChandraAblazeEffect2 extends OneShotEffect { } } -class ChandraAblazeEffect4 extends DrawCardAllEffect { - - public ChandraAblazeEffect4() { - super(3); - this.staticText = "Then draws three cards"; - } - - public ChandraAblazeEffect4(final ChandraAblazeEffect4 effect) { - super(effect); - } - - @Override - public ChandraAblazeEffect4 copy() { - return new ChandraAblazeEffect4(this); - } -} - class ChandraAblazeEffect5 extends OneShotEffect { public ChandraAblazeEffect5() { diff --git a/Mage.Sets/src/mage/sets/zendikar/ConquerorsPledge.java b/Mage.Sets/src/mage/sets/zendikar/ConquerorsPledge.java index de37a7675b9..02fbd720725 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ConquerorsPledge.java +++ b/Mage.Sets/src/mage/sets/zendikar/ConquerorsPledge.java @@ -37,7 +37,7 @@ import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.KorSoldierToken; /** * @@ -67,17 +67,3 @@ public class ConquerorsPledge extends CardImpl { } } - -class KorSoldierToken extends Token { - - public KorSoldierToken() { - super("Kor Soldier", "1/1 white Kor Soldier creature token"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Kor"); - subtype.add("Soldier"); - power = new MageInt(1); - toughness = new MageInt(1); - } - -} diff --git a/Mage.Sets/src/mage/sets/zendikar/ElementalAppeal.java b/Mage.Sets/src/mage/sets/zendikar/ElementalAppeal.java index dbe2952eb59..78c175f96c8 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ElementalAppeal.java +++ b/Mage.Sets/src/mage/sets/zendikar/ElementalAppeal.java @@ -33,7 +33,6 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.condition.LockedInCondition; import mage.abilities.condition.common.KickedCondition; @@ -44,6 +43,7 @@ import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; /** @@ -56,7 +56,6 @@ public class ElementalAppeal extends CardImpl { super(ownerId, 123, "Elemental Appeal", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{R}{R}{R}{R}"); this.expansionSetCode = "ZEN"; - // Kicker {5} this.addAbility(new KickerAbility("{5}")); @@ -100,17 +99,14 @@ class ElementalAppealEffect extends OneShotEffect { ElementalToken token = new ElementalToken(); token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - FixedTarget fixedTarget = new FixedTarget(token.getLastAddedToken()); - source.getEffects().get(1).setTargetPointer(fixedTarget); - - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(fixedTarget); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source); + } + } return true; } } diff --git a/Mage.Sets/src/mage/sets/zendikar/EmeriaAngel.java b/Mage.Sets/src/mage/sets/zendikar/EmeriaAngel.java index 31e88702455..bd80adab15f 100644 --- a/Mage.Sets/src/mage/sets/zendikar/EmeriaAngel.java +++ b/Mage.Sets/src/mage/sets/zendikar/EmeriaAngel.java @@ -36,7 +36,7 @@ import mage.abilities.common.LandfallAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.BirdToken; /** * @@ -66,16 +66,3 @@ public class EmeriaAngel extends CardImpl { } } - -class BirdToken extends Token { - - public BirdToken() { - super("Bird", "1/1 white Bird creature token with flying"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Bird"); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(FlyingAbility.getInstance()); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/ExplorersScope.java b/Mage.Sets/src/mage/sets/zendikar/ExplorersScope.java index 7ced325384c..a81413a9cbf 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ExplorersScope.java +++ b/Mage.Sets/src/mage/sets/zendikar/ExplorersScope.java @@ -29,10 +29,6 @@ package mage.sets.zendikar; import java.util.UUID; import mage.MageObject; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.AttacksAttachedTriggeredAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -42,6 +38,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -56,9 +56,9 @@ public class ExplorersScope extends CardImpl { this.expansionSetCode = "ZEN"; this.subtype.add("Equipment"); - // Whenever equipped creature attacks, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped. + // Whenever equipped creature attacks, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped. this.addAbility(new AttacksAttachedTriggeredAbility(new ExplorersScopeEffect())); - + // Equip ({1}: Attach to target creature you control. Equip only as a sorcery.) this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1))); } @@ -105,7 +105,7 @@ class ExplorersScopeEffect extends OneShotEffect { if (card.getCardType().contains(CardType.LAND)) { String message = "Put " + card.getLogName() + " onto the battlefield tapped?"; if (controller.chooseUse(Outcome.PutLandInPlay, message, source, game)) { - card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId(), true); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); } } } diff --git a/Mage.Sets/src/mage/sets/zendikar/Gigantiform.java b/Mage.Sets/src/mage/sets/zendikar/Gigantiform.java index 15d9f689266..52cf4888409 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Gigantiform.java +++ b/Mage.Sets/src/mage/sets/zendikar/Gigantiform.java @@ -48,6 +48,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.NamePredicate; @@ -68,7 +69,6 @@ public class Gigantiform extends CardImpl { this.expansionSetCode = "ZEN"; this.subtype.add("Aura"); - // Kicker {4} this.addAbility(new KickerAbility("{4}")); @@ -101,7 +101,7 @@ class GigantiformAbility extends StaticAbility { public GigantiformAbility() { super(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA)); - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(8, 8, Duration.WhileOnBattlefield)); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(8, 8, Duration.WhileOnBattlefield, SubLayer.SetPT_7b)); this.addEffect(new GainAbilityAttachedEffect(ability, AttachmentType.AURA)); } @@ -143,14 +143,14 @@ class GigantiformEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); TargetCardInLibrary target = new TargetCardInLibrary(filter); - if (player != null && player.searchLibrary(target, game)) { - Card card = player.getLibrary().getCard(target.getFirstTarget(), game); + if (controller != null && controller.searchLibrary(target, game)) { + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); if (card != null) { - card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java b/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java index 3ed316b0b69..8e911bc145d 100644 --- a/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java +++ b/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java @@ -1,79 +1,82 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.zendikar; - -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.MageInt; -import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; -import mage.abilities.effects.common.continuous.GainAbilityAllEffect; -import mage.abilities.keyword.FirstStrikeAbility; -import mage.cards.CardImpl; -import mage.constants.TargetController; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; - -/** - * - * @author North - */ -public class HighlandBerserker extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Ally creatures you control"); - - static { - filter.add(new SubtypePredicate("Ally")); - filter.add(new ControllerPredicate(TargetController.YOU)); - } - - public HighlandBerserker(UUID ownerId) { - super(ownerId, 132, "Highland Berserker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); - this.expansionSetCode = "ZEN"; - this.subtype.add("Human"); - this.subtype.add("Berserker"); - this.subtype.add("Ally"); - - this.power = new MageInt(2); - this.toughness = new MageInt(1); - - this.addAbility(new AllyEntersBattlefieldTriggeredAbility(new GainAbilityAllEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, filter), true)); - } - - public HighlandBerserker(final HighlandBerserker card) { - super(card); - } - - @Override - public HighlandBerserker copy() { - return new HighlandBerserker(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author North + */ +public class HighlandBerserker extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Ally creatures you control"); + + static { + filter.add(new SubtypePredicate("Ally")); + filter.add(new ControllerPredicate(TargetController.YOU)); + } + + public HighlandBerserker(UUID ownerId) { + super(ownerId, 132, "Highland Berserker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "ZEN"; + this.subtype.add("Human"); + this.subtype.add("Berserker"); + this.subtype.add("Ally"); + + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Whenever Highland Berserker or another Ally enters the battlefield under your control, you may have Ally creatures you control gain first strike until end of turn. + Effect effect = new GainAbilityAllEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, filter); + effect.setText("you may have Ally creatures you control gain first strike until end of turn"); + this.addAbility(new AllyEntersBattlefieldTriggeredAbility(effect, true)); + } + + public HighlandBerserker(final HighlandBerserker card) { + super(card); + } + + @Override + public HighlandBerserker copy() { + return new HighlandBerserker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/IonaShieldOfEmeria.java b/Mage.Sets/src/mage/sets/zendikar/IonaShieldOfEmeria.java index 91fc8f24195..ae55b9d3e56 100644 --- a/Mage.Sets/src/mage/sets/zendikar/IonaShieldOfEmeria.java +++ b/Mage.Sets/src/mage/sets/zendikar/IonaShieldOfEmeria.java @@ -99,7 +99,7 @@ class IonaShieldOfEmeriaReplacementEffect extends ContinuousRuleModifyingEffectI ObjectColor chosenColor = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null && chosenColor != null) { - return "You can't cast " + chosenColor.toString() +" spells (" + mageObject.getLogName() + ")."; + return "You can't cast " + chosenColor.toString() + " spells (" + mageObject.getIdName() + ")."; } return null; } @@ -107,11 +107,11 @@ class IonaShieldOfEmeriaReplacementEffect extends ContinuousRuleModifyingEffectI @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.CAST_SPELL; - } - + } + @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId()) ) { + if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { ObjectColor chosenColor = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); // spell is not on the stack yet, so we have to check the card Card card = game.getCard(event.getSourceId()); diff --git a/Mage.Sets/src/mage/sets/zendikar/IorRuinExpedition.java b/Mage.Sets/src/mage/sets/zendikar/IorRuinExpedition.java index 57d4201cfc0..c8df9cd1513 100644 --- a/Mage.Sets/src/mage/sets/zendikar/IorRuinExpedition.java +++ b/Mage.Sets/src/mage/sets/zendikar/IorRuinExpedition.java @@ -27,8 +27,7 @@ */ package mage.sets.zendikar; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.LandfallAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -37,11 +36,11 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; -import java.util.UUID; - /** * * @author Loki @@ -52,9 +51,11 @@ public class IorRuinExpedition extends CardImpl { super(ownerId, 49, "Ior Ruin Expedition", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); this.expansionSetCode = "ZEN"; - + // Landfall - Whenever a land enters the battlefield under your control, you may put a quest counter on Ior Ruin Expedition. this.addAbility(new LandfallAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true)); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(3), new RemoveCountersSourceCost(CounterType.QUEST.createInstance(3))); + + // Remove three quest counters from Ior Ruin Expedition and sacrifice it: Draw two cards. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(2), new RemoveCountersSourceCost(CounterType.QUEST.createInstance(3))); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/zendikar/JourneyToNowhere.java b/Mage.Sets/src/mage/sets/zendikar/JourneyToNowhere.java index e4b5afec2e3..5fce040e7de 100644 --- a/Mage.Sets/src/mage/sets/zendikar/JourneyToNowhere.java +++ b/Mage.Sets/src/mage/sets/zendikar/JourneyToNowhere.java @@ -1,43 +1,42 @@ /* -* Copyright 2010 maurer.it_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of maurer.it_at_googlemail.com. -*/ - + * Copyright 2010 maurer.it_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of maurer.it_at_googlemail.com. + */ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.effects.common.ExileTargetForSourceEffect; import mage.abilities.effects.common.ReturnFromExileForSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.target.Target; @@ -53,7 +52,6 @@ public class JourneyToNowhere extends CardImpl { super(ownerId, 14, "Journey to Nowhere", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); this.expansionSetCode = "ZEN"; - // When Journey to Nowhere enters the battlefield, exile target creature. FilterCreaturePermanent filter = new FilterCreaturePermanent(); filter.add(new AnotherPredicate()); @@ -61,7 +59,7 @@ public class JourneyToNowhere extends CardImpl { Target target = new TargetPermanent(filter); ability1.addTarget(target); this.addAbility(ability1); - + // When Journey to Nowhere leaves the battlefield, return the exiled card to the battlefield under its owner's control. Ability ability2 = new LeavesBattlefieldTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD), false); this.addAbility(ability2); diff --git a/Mage.Sets/src/mage/sets/zendikar/LivingTsunami.java b/Mage.Sets/src/mage/sets/zendikar/LivingTsunami.java index 8c761ff0bfe..436b2886265 100644 --- a/Mage.Sets/src/mage/sets/zendikar/LivingTsunami.java +++ b/Mage.Sets/src/mage/sets/zendikar/LivingTsunami.java @@ -34,7 +34,7 @@ import mage.constants.Rarity; import mage.constants.TargetController; import mage.MageInt; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.costs.common.ReturnToHandTargetPermanentCost; +import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; @@ -67,7 +67,7 @@ public class LivingTsunami extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // At the beginning of your upkeep, sacrifice Living Tsunami unless you return a land you control to its owner's hand. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceUnlessPaysEffect(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(1, 1, filter, true))), TargetController.YOU, false)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceUnlessPaysEffect(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(1, 1, filter, true))), TargetController.YOU, false)); } public LivingTsunami(final LivingTsunami card) { diff --git a/Mage.Sets/src/mage/sets/zendikar/MireBlight.java b/Mage.Sets/src/mage/sets/zendikar/MireBlight.java index 9a6b87ebc59..f40db77d1ec 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MireBlight.java +++ b/Mage.Sets/src/mage/sets/zendikar/MireBlight.java @@ -29,22 +29,17 @@ package mage.sets.zendikar; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.DamageDealtToAttachedTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.DestroyAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; -import mage.target.targetpointer.FixedTarget; /** * @@ -65,7 +60,7 @@ public class MireBlight extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // When enchanted creature is dealt damage, destroy it. - this.addAbility(new MireBlightTriggeredAbility()); + this.addAbility(new DamageDealtToAttachedTriggeredAbility(new DestroyAttachedEffect("it"), false)); } public MireBlight(final MireBlight card) { @@ -77,40 +72,3 @@ public class MireBlight extends CardImpl { return new MireBlight(this); } } - -class MireBlightTriggeredAbility extends TriggeredAbilityImpl { - - public MireBlightTriggeredAbility() { - super(Zone.BATTLEFIELD, new DestroyTargetEffect()); - } - - public MireBlightTriggeredAbility(final MireBlightTriggeredAbility ability) { - super(ability); - } - - @Override - public MireBlightTriggeredAbility copy() { - return new MireBlightTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.DAMAGED_CREATURE; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent enchantment = game.getPermanent(sourceId); - UUID targetId = event.getTargetId(); - if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId)); - return true; - } - return false; - } - - @Override - public String getRule() { - return "When enchanted creature is dealt damage, destroy it."; - } -} diff --git a/Mage.Sets/src/mage/sets/zendikar/NissaRevane.java b/Mage.Sets/src/mage/sets/zendikar/NissaRevane.java index 1a24adaacdf..2306fb65d75 100644 --- a/Mage.Sets/src/mage/sets/zendikar/NissaRevane.java +++ b/Mage.Sets/src/mage/sets/zendikar/NissaRevane.java @@ -28,17 +28,15 @@ package mage.sets.zendikar; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; -import mage.cards.CardImpl; -import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.NamePredicate; @@ -62,11 +60,10 @@ public class NissaRevane extends CardImpl { } public NissaRevane(UUID ownerId) { - super(ownerId, 170, "Nissa Revane", Rarity.MYTHIC, new CardType[]{ CardType.PLANESWALKER }, "{2}{G}{G}"); + super(ownerId, 170, "Nissa Revane", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{G}{G}"); this.expansionSetCode = "ZEN"; this.subtype.add("Nissa"); - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(2)), false)); - + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(2)); LoyaltyAbility ability1 = new LoyaltyAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(1, nissasChosenFilter)), 1); this.addAbility(ability1); diff --git a/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java b/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java index 5c17c3c360b..dd7ee2ac455 100644 --- a/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java +++ b/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java @@ -28,11 +28,6 @@ package mage.sets.zendikar; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; @@ -42,6 +37,10 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.FilterSpell; @@ -61,6 +60,7 @@ import mage.target.common.TargetControlledCreaturePermanent; public class QuestForTheHolyRelic extends CardImpl { private static final FilterSpell filter = new FilterSpell("a creature spell"); + static { filter.add(new CardTypePredicate(CardType.CREATURE)); } @@ -69,7 +69,6 @@ public class QuestForTheHolyRelic extends CardImpl { super(ownerId, 33, "Quest for the Holy Relic", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); this.expansionSetCode = "ZEN"; - // Whenever you cast a creature spell, you may put a quest counter on Quest for the Holy Relic. this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), filter, true)); // Remove five quest counters from Quest for the Holy Relic and sacrifice it: Search your library for an Equipment card, put it onto the battlefield, and attach it to a creature you control. Then shuffle your library. @@ -106,28 +105,26 @@ class QuestForTheHolyRelicEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } FilterCard filter = new FilterCard("Equipment"); filter.add(new SubtypePredicate("Equipment")); TargetCardInLibrary target = new TargetCardInLibrary(filter); - if (player.searchLibrary(target, game)) { - Card card = player.getLibrary().getCard(target.getFirstTarget(), game); - if (card != null) { - card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId()); + if (controller.searchLibrary(target, game)) { + Card card = controller.getLibrary().getCard(target.getFirstTarget(), game); + if (card != null && controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent equipment = game.getPermanent(card.getId()); - Target targetCreature = new TargetControlledCreaturePermanent(); - if (equipment != null && player.choose(Outcome.BoostCreature, targetCreature, source.getSourceId(), game)) { + if (equipment != null && controller.choose(Outcome.BoostCreature, targetCreature, source.getSourceId(), game)) { Permanent permanent = game.getPermanent(targetCreature.getFirstTarget()); permanent.addAttachment(equipment.getId(), game); } } } - player.shuffleLibrary(game); + controller.shuffleLibrary(game); return true; } } diff --git a/Mage.Sets/src/mage/sets/zendikar/RampagingBaloths.java b/Mage.Sets/src/mage/sets/zendikar/RampagingBaloths.java index 7a721a310f0..488ab7bde1f 100644 --- a/Mage.Sets/src/mage/sets/zendikar/RampagingBaloths.java +++ b/Mage.Sets/src/mage/sets/zendikar/RampagingBaloths.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -29,14 +29,14 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.LandfallAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.BeastToken2; /** * @@ -52,7 +52,7 @@ public class RampagingBaloths extends CardImpl { this.power = new MageInt(6); this.toughness = new MageInt(6); this.addAbility(TrampleAbility.getInstance()); - this.addAbility(new LandfallAbility(new CreateTokenEffect(new RampagingBalothsToken()), true)); + this.addAbility(new LandfallAbility(new CreateTokenEffect(new BeastToken2()), true)); } public RampagingBaloths(final RampagingBaloths card) { @@ -65,15 +65,3 @@ public class RampagingBaloths extends CardImpl { } } - -class RampagingBalothsToken extends Token { - - public RampagingBalothsToken() { - super("Beast", "4/4 green Beast creature token"); - cardType.add(CardType.CREATURE); - subtype.add("Beast"); - this.color.setGreen(true); - power = new MageInt(4); - toughness = new MageInt(4); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/RelicCrush.java b/Mage.Sets/src/mage/sets/zendikar/RelicCrush.java index 150a3c4c73d..4f306bf163a 100644 --- a/Mage.Sets/src/mage/sets/zendikar/RelicCrush.java +++ b/Mage.Sets/src/mage/sets/zendikar/RelicCrush.java @@ -29,15 +29,12 @@ package mage.sets.zendikar; import java.util.UUID; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.common.FilterArtifactOrEnchantmentPermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; /** @@ -45,14 +42,16 @@ import mage.target.TargetPermanent; * @author jeffwadsworth */ public class RelicCrush extends CardImpl { - + public RelicCrush(UUID ownerId) { super(ownerId, 179, "Relic Crush", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{4}{G}"); this.expansionSetCode = "ZEN"; // Destroy target artifact or enchantment and up to one other target artifact or enchantment. FilterPermanent filter = new FilterArtifactOrEnchantmentPermanent(); - this.getSpellAbility().addEffect(new RelicCrushEffect()); + Effect effect = new DestroyTargetEffect(false, true); + effect.setText("Destroy target artifact or enchantment and up to one other target artifact or enchantment"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellAbility().addTarget(new TargetPermanent(0, 1, filter, false)); } @@ -66,33 +65,3 @@ public class RelicCrush extends CardImpl { return new RelicCrush(this); } } - -class RelicCrushEffect extends OneShotEffect { - - public RelicCrushEffect() { - super(Outcome.DestroyPermanent); - this.staticText = "Destroy target artifact or enchantment and up to one other target artifact or enchantment"; - } - - public RelicCrushEffect(final RelicCrushEffect effect) { - super(effect); - } - - @Override - public RelicCrushEffect copy() { - return new RelicCrushEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent firstTarget = game.getPermanent(source.getFirstTarget()); - Permanent secondTarget = game.getPermanent(source.getTargets().get(1).getFirstTarget()); - if (firstTarget != null) { - firstTarget.destroy(id, game, false); - } - if (secondTarget != null) { - return secondTarget.destroy(id, game, false); - } - return true; - } -} diff --git a/Mage.Sets/src/mage/sets/zendikar/RiteOfReplication.java b/Mage.Sets/src/mage/sets/zendikar/RiteOfReplication.java index 328c65228a8..85152ecc7c4 100644 --- a/Mage.Sets/src/mage/sets/zendikar/RiteOfReplication.java +++ b/Mage.Sets/src/mage/sets/zendikar/RiteOfReplication.java @@ -28,21 +28,14 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.abilities.Ability; import mage.abilities.condition.common.KickedCondition; import mage.abilities.decorator.ConditionalOneShotEffect; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.target.common.TargetCreaturePermanent; -import mage.util.CardUtil; /** * @@ -54,14 +47,13 @@ public class RiteOfReplication extends CardImpl { super(ownerId, 61, "Rite of Replication", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{U}{U}"); this.expansionSetCode = "ZEN"; - // Kicker {5} this.addAbility(new KickerAbility("{5}")); // Put a token that's a copy of target creature onto the battlefield. If Rite of Replication was kicked, put five of those tokens onto the battlefield instead. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new RiteOfReplicationEffect(5), - new RiteOfReplicationEffect(1), KickedCondition.getInstance(), + this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new PutTokenOntoBattlefieldCopyTargetEffect(null, null, false, 5), + new PutTokenOntoBattlefieldCopyTargetEffect(), KickedCondition.getInstance(), "Put a token that's a copy of target creature onto the battlefield. If {this} was kicked, put five of those tokens onto the battlefield instead")); } @@ -74,38 +66,3 @@ public class RiteOfReplication extends CardImpl { return new RiteOfReplication(this); } } - -class RiteOfReplicationEffect extends OneShotEffect { - - private final int amount; - - public RiteOfReplicationEffect(int amount) { - super(Outcome.PutCreatureInPlay); - this.amount = amount; - } - - public RiteOfReplicationEffect(final RiteOfReplicationEffect effect) { - super(effect); - this.amount = effect.amount; - } - - @Override - public RiteOfReplicationEffect copy() { - return new RiteOfReplicationEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); - } - if (permanent != null) { - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(permanent); - token.putOntoBattlefield(amount, game, source.getSourceId(), source.getControllerId()); - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/zendikar/RuinousMinotaur.java b/Mage.Sets/src/mage/sets/zendikar/RuinousMinotaur.java index 84d78b7cc11..9942935f688 100644 --- a/Mage.Sets/src/mage/sets/zendikar/RuinousMinotaur.java +++ b/Mage.Sets/src/mage/sets/zendikar/RuinousMinotaur.java @@ -30,16 +30,11 @@ package mage.sets.zendikar; import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.common.DealsDamageToOpponentTriggeredAbility; +import mage.abilities.effects.common.SacrificeControllerEffect; import mage.cards.CardImpl; -import mage.filter.common.FilterControlledLandPermanent; -import mage.filter.common.FilterControlledPermanent; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.target.common.TargetControlledPermanent; +import mage.filter.common.FilterLandPermanent; /** * @@ -57,7 +52,8 @@ public class RuinousMinotaur extends CardImpl { this.toughness = new MageInt(2); // Whenever Ruinous Minotaur deals damage to an opponent, sacrifice a land. - this.addAbility(new RuinousMinotaurTriggeredAbility()); + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new SacrificeControllerEffect(new FilterLandPermanent(), 1, ""), false, false)); + } public RuinousMinotaur(final RuinousMinotaur card) { @@ -69,38 +65,3 @@ public class RuinousMinotaur extends CardImpl { return new RuinousMinotaur(this); } } - -class RuinousMinotaurTriggeredAbility extends TriggeredAbilityImpl { - - private static final FilterControlledPermanent filter = new FilterControlledLandPermanent(); - - public RuinousMinotaurTriggeredAbility() { - super(Zone.BATTLEFIELD, new SacrificeTargetEffect(), false); - this.addTarget(new TargetControlledPermanent(filter)); - } - - public RuinousMinotaurTriggeredAbility(final RuinousMinotaurTriggeredAbility ability) { - super(ability); - } - - @Override - public RuinousMinotaurTriggeredAbility copy() { - return new RuinousMinotaurTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return event.getSourceId().equals(this.sourceId) - && game.getOpponents(this.getControllerId()).contains(event.getTargetId()); - } - - @Override - public String getRule() { - return "Whenever {this} deals damage to an opponent, sacrifice a land."; - } -} diff --git a/Mage.Sets/src/mage/sets/zendikar/SorinMarkov.java b/Mage.Sets/src/mage/sets/zendikar/SorinMarkov.java index 5ecb9fe0b4c..309684109aa 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SorinMarkov.java +++ b/Mage.Sets/src/mage/sets/zendikar/SorinMarkov.java @@ -27,27 +27,24 @@ */ package mage.sets.zendikar; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.GainLifeEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.turn.ControlTargetPlayerNextTurnEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; -import mage.counters.CounterType; +import mage.constants.Rarity; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetOpponent; -import java.util.UUID; - /** * * @author nantuko @@ -59,8 +56,7 @@ public class SorinMarkov extends CardImpl { this.expansionSetCode = "ZEN"; this.subtype.add("Sorin"); - - this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4)); // +2: Sorin Markov deals 2 damage to target creature or player and you gain 2 life. LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(2), 2); diff --git a/Mage.Sets/src/mage/sets/zendikar/SpreadingSeas.java b/Mage.Sets/src/mage/sets/zendikar/SpreadingSeas.java index 7b75921e09f..24b3df5f4a3 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SpreadingSeas.java +++ b/Mage.Sets/src/mage/sets/zendikar/SpreadingSeas.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,19 +20,14 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -41,6 +36,10 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.BecomesBasicLandEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -56,12 +55,16 @@ public class SpreadingSeas extends CardImpl { this.subtype.add("Aura"); + // Enchant land TargetPermanent auraTarget = new TargetLandPermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); + + // When Spreading Seas enters the battlefield, draw a card. this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); + // Enchanted land is an Island. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandEnchantedEffect("Island"))); diff --git a/Mage.Sets/src/mage/sets/zendikar/SummoningTrap.java b/Mage.Sets/src/mage/sets/zendikar/SummoningTrap.java index e2fd1b88a42..61aa2805786 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SummoningTrap.java +++ b/Mage.Sets/src/mage/sets/zendikar/SummoningTrap.java @@ -28,12 +28,6 @@ package mage.sets.zendikar; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.WatcherScope; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.costs.AlternativeCostImpl; import mage.abilities.costs.Cost; @@ -43,6 +37,11 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.WatcherScope; +import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.events.GameEvent; @@ -179,7 +178,7 @@ class SummoningTrapEffect extends OneShotEffect { Card card = cards.get(target.getFirstTarget(), game); if (card != null) { cards.remove(card); - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } if (cards.size() > 0) { diff --git a/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java b/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java index a689e538717..14f9ac96dcb 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java +++ b/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -106,7 +106,7 @@ class ValakutTheMoltenPinnacleTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.getControllerId())) { + if (permanent != null && permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.getControllerId())) { if (permanent.hasSubtype("Mountain")) { return true; } diff --git a/Mage.Sets/src/mage/sets/zendikar/VinesOfVastwood.java b/Mage.Sets/src/mage/sets/zendikar/VinesOfVastwood.java index d67de8aa3f2..cb72eb9e989 100644 --- a/Mage.Sets/src/mage/sets/zendikar/VinesOfVastwood.java +++ b/Mage.Sets/src/mage/sets/zendikar/VinesOfVastwood.java @@ -25,23 +25,22 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.zendikar; import java.util.UUID; import mage.abilities.condition.LockedInCondition; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; import mage.abilities.condition.common.KickedCondition; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.common.CantBeTargetedTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.TargetController; +import mage.filter.FilterObject; import mage.filter.FilterStackObject; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -49,12 +48,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class VinesOfVastwood extends CardImpl { - private static final FilterStackObject filter = new FilterStackObject("spells or abilities your opponents control"); + private static final FilterObject filter = new FilterStackObject("spells or abilities your opponents control"); - static { - filter.add(new ControllerPredicate(TargetController.OPPONENT)); - } - private static final String staticText = "If {this} was kicked, that creature gets +4/+4 until end of turn"; public VinesOfVastwood(UUID ownerId) { @@ -66,7 +61,7 @@ public class VinesOfVastwood extends CardImpl { // Target creature can't be the target of spells or abilities your opponents control this turn. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new CantBeTargetedTargetEffect(filter, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new CantBeTargetedTargetEffect(filter, Duration.EndOfTurn, TargetController.OPPONENT)); // If Vines of Vastwood was kicked, that creature gets +4/+4 until end of turn. this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostTargetEffect(4, 4, Duration.EndOfTurn), @@ -82,4 +77,3 @@ public class VinesOfVastwood extends CardImpl { return new VinesOfVastwood(this); } } - diff --git a/Mage.Sets/src/mage/sets/zendikar/ZektarShrineExpedition.java b/Mage.Sets/src/mage/sets/zendikar/ZektarShrineExpedition.java index a6d09201a64..8bc084c9f76 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ZektarShrineExpedition.java +++ b/Mage.Sets/src/mage/sets/zendikar/ZektarShrineExpedition.java @@ -28,14 +28,8 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; -import mage.ObjectColor; import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.LandfallAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; @@ -47,8 +41,13 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.target.targetpointer.FixedTarget; @@ -62,7 +61,6 @@ public class ZektarShrineExpedition extends CardImpl { super(ownerId, 155, "Zektar Shrine Expedition", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); this.expansionSetCode = "ZEN"; - // Landfall - Whenever a land enters the battlefield under your control, you may put a quest counter on Zektar Shrine Expedition. this.addAbility(new LandfallAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true)); // Remove three quest counters from Zektar Shrine Expedition and sacrifice it: Put a 7/1 red Elemental creature token with trample and haste onto the battlefield. Exile it at the beginning of the next end step. @@ -101,15 +99,14 @@ class ZektarShrineExpeditionEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { ElementalToken token = new ElementalToken(); token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - - ExileTargetEffect exileEffect = new ExileTargetEffect(); - exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken())); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); - + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source); + } + } return true; } } diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/AridMesa.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/AridMesa.java new file mode 100644 index 00000000000..c74cea7246e --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/AridMesa.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class AridMesa extends mage.sets.zendikar.AridMesa { + + public AridMesa(UUID ownerId) { + super(ownerId); + this.cardNumber = 24; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public AridMesa(final AridMesa card) { + super(card); + } + + @Override + public AridMesa copy() { + return new AridMesa(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/BloodCrypt.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/BloodCrypt.java new file mode 100644 index 00000000000..75f2c346c37 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/BloodCrypt.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class BloodCrypt extends mage.sets.dissension.BloodCrypt { + + public BloodCrypt(UUID ownerId) { + super(ownerId); + this.cardNumber = 8; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public BloodCrypt(final BloodCrypt card) { + super(card); + } + + @Override + public BloodCrypt copy() { + return new BloodCrypt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/BloodstainedMire.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/BloodstainedMire.java new file mode 100644 index 00000000000..30f5956274b --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/BloodstainedMire.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class BloodstainedMire extends mage.sets.onslaught.BloodstainedMire { + + public BloodstainedMire(UUID ownerId) { + super(ownerId); + this.cardNumber = 18; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public BloodstainedMire(final BloodstainedMire card) { + super(card); + } + + @Override + public BloodstainedMire copy() { + return new BloodstainedMire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/BreedingPool.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/BreedingPool.java new file mode 100644 index 00000000000..a7a407d5b3f --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/BreedingPool.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class BreedingPool extends mage.sets.dissension.BreedingPool { + + public BreedingPool(UUID ownerId) { + super(ownerId); + this.cardNumber = 15; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public BreedingPool(final BreedingPool card) { + super(card); + } + + @Override + public BreedingPool copy() { + return new BreedingPool(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/CanopyVista.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/CanopyVista.java new file mode 100644 index 00000000000..15a45bb0ae5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/CanopyVista.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class CanopyVista extends mage.sets.battleforzendikar.CanopyVista { + + public CanopyVista(UUID ownerId) { + super(ownerId); + this.cardNumber = 5; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public CanopyVista(final CanopyVista card) { + super(card); + } + + @Override + public CanopyVista copy() { + return new CanopyVista(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/CinderGlade.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/CinderGlade.java new file mode 100644 index 00000000000..c81265ccb5a --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/CinderGlade.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class CinderGlade extends mage.sets.battleforzendikar.CinderGlade { + + public CinderGlade(UUID ownerId) { + super(ownerId); + this.cardNumber = 4; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public CinderGlade(final CinderGlade card) { + super(card); + } + + @Override + public CinderGlade copy() { + return new CinderGlade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/FloodedStrand.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/FloodedStrand.java new file mode 100644 index 00000000000..f1da51bfc14 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/FloodedStrand.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class FloodedStrand extends mage.sets.onslaught.FloodedStrand { + + public FloodedStrand(UUID ownerId) { + super(ownerId); + this.cardNumber = 16; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public FloodedStrand(final FloodedStrand card) { + super(card); + } + + @Override + public FloodedStrand copy() { + return new FloodedStrand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/GodlessShrine.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/GodlessShrine.java new file mode 100644 index 00000000000..92fb6f57178 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/GodlessShrine.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class GodlessShrine extends mage.sets.guildpact.GodlessShrine { + + public GodlessShrine(UUID ownerId) { + super(ownerId); + this.cardNumber = 11; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public GodlessShrine(final GodlessShrine card) { + super(card); + } + + @Override + public GodlessShrine copy() { + return new GodlessShrine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/HallowedFountain.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/HallowedFountain.java new file mode 100644 index 00000000000..a2221249147 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/HallowedFountain.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class HallowedFountain extends mage.sets.dissension.HallowedFountain { + + public HallowedFountain(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public HallowedFountain(final HallowedFountain card) { + super(card); + } + + @Override + public HallowedFountain copy() { + return new HallowedFountain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/MarshFlats.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/MarshFlats.java new file mode 100644 index 00000000000..030eb459e3a --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/MarshFlats.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class MarshFlats extends mage.sets.zendikar.MarshFlats { + + public MarshFlats(UUID ownerId) { + super(ownerId); + this.cardNumber = 21; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public MarshFlats(final MarshFlats card) { + super(card); + } + + @Override + public MarshFlats copy() { + return new MarshFlats(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/MistyRainforest.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/MistyRainforest.java new file mode 100644 index 00000000000..4c22fa52e19 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/MistyRainforest.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class MistyRainforest extends mage.sets.zendikar.MistyRainforest { + + public MistyRainforest(UUID ownerId) { + super(ownerId); + this.cardNumber = 25; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public MistyRainforest(final MistyRainforest card) { + super(card); + } + + @Override + public MistyRainforest copy() { + return new MistyRainforest(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/OvergrownTomb.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/OvergrownTomb.java new file mode 100644 index 00000000000..ae424e0f58f --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/OvergrownTomb.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class OvergrownTomb extends mage.sets.ravnica.OvergrownTomb { + + public OvergrownTomb(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public OvergrownTomb(final OvergrownTomb card) { + super(card); + } + + @Override + public OvergrownTomb copy() { + return new OvergrownTomb(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/PollutedDelta.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/PollutedDelta.java new file mode 100644 index 00000000000..35fb00d05d3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/PollutedDelta.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class PollutedDelta extends mage.sets.onslaught.PollutedDelta { + + public PollutedDelta(UUID ownerId) { + super(ownerId); + this.cardNumber = 17; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public PollutedDelta(final PollutedDelta card) { + super(card); + } + + @Override + public PollutedDelta copy() { + return new PollutedDelta(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/PrairieStream.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/PrairieStream.java new file mode 100644 index 00000000000..54965a94fdf --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/PrairieStream.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class PrairieStream extends mage.sets.battleforzendikar.PrairieStream { + + public PrairieStream(UUID ownerId) { + super(ownerId); + this.cardNumber = 1; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public PrairieStream(final PrairieStream card) { + super(card); + } + + @Override + public PrairieStream copy() { + return new PrairieStream(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/SacredFoundry.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/SacredFoundry.java new file mode 100644 index 00000000000..25d51b68ba3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/SacredFoundry.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class SacredFoundry extends mage.sets.ravnica.SacredFoundry { + + public SacredFoundry(UUID ownerId) { + super(ownerId); + this.cardNumber = 14; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public SacredFoundry(final SacredFoundry card) { + super(card); + } + + @Override + public SacredFoundry copy() { + return new SacredFoundry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/ScaldingTarn.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/ScaldingTarn.java new file mode 100644 index 00000000000..1d4a9534d33 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/ScaldingTarn.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ScaldingTarn extends mage.sets.zendikar.ScaldingTarn { + + public ScaldingTarn(UUID ownerId) { + super(ownerId); + this.cardNumber = 22; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public ScaldingTarn(final ScaldingTarn card) { + super(card); + } + + @Override + public ScaldingTarn copy() { + return new ScaldingTarn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/SmolderingMarsh.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/SmolderingMarsh.java new file mode 100644 index 00000000000..3a9b4adabca --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/SmolderingMarsh.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class SmolderingMarsh extends mage.sets.battleforzendikar.SmolderingMarsh { + + public SmolderingMarsh(UUID ownerId) { + super(ownerId); + this.cardNumber = 3; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public SmolderingMarsh(final SmolderingMarsh card) { + super(card); + } + + @Override + public SmolderingMarsh copy() { + return new SmolderingMarsh(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/SteamVents.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/SteamVents.java new file mode 100644 index 00000000000..5f9f5adfc8f --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/SteamVents.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class SteamVents extends mage.sets.guildpact.SteamVents { + + public SteamVents(UUID ownerId) { + super(ownerId); + this.cardNumber = 12; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public SteamVents(final SteamVents card) { + super(card); + } + + @Override + public SteamVents copy() { + return new SteamVents(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/StompingGround.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/StompingGround.java new file mode 100644 index 00000000000..06acf8a4b58 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/StompingGround.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class StompingGround extends mage.sets.guildpact.StompingGround { + + public StompingGround(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public StompingGround(final StompingGround card) { + super(card); + } + + @Override + public StompingGround copy() { + return new StompingGround(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/SunkenHollow.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/SunkenHollow.java new file mode 100644 index 00000000000..8ea9fe8546b --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/SunkenHollow.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class SunkenHollow extends mage.sets.battleforzendikar.SunkenHollow { + + public SunkenHollow(UUID ownerId) { + super(ownerId); + this.cardNumber = 2; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public SunkenHollow(final SunkenHollow card) { + super(card); + } + + @Override + public SunkenHollow copy() { + return new SunkenHollow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/TempleGarden.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/TempleGarden.java new file mode 100644 index 00000000000..60feb64b6e2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/TempleGarden.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class TempleGarden extends mage.sets.ravnica.TempleGarden { + + public TempleGarden(UUID ownerId) { + super(ownerId); + this.cardNumber = 10; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public TempleGarden(final TempleGarden card) { + super(card); + } + + @Override + public TempleGarden copy() { + return new TempleGarden(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/VerdantCatacombs.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/VerdantCatacombs.java new file mode 100644 index 00000000000..339425a636c --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/VerdantCatacombs.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class VerdantCatacombs extends mage.sets.zendikar.VerdantCatacombs { + + public VerdantCatacombs(UUID ownerId) { + super(ownerId); + this.cardNumber = 23; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public VerdantCatacombs(final VerdantCatacombs card) { + super(card); + } + + @Override + public VerdantCatacombs copy() { + return new VerdantCatacombs(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/WateryGrave.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/WateryGrave.java new file mode 100644 index 00000000000..3cfc5781323 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/WateryGrave.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class WateryGrave extends mage.sets.ravnica.WateryGrave { + + public WateryGrave(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public WateryGrave(final WateryGrave card) { + super(card); + } + + @Override + public WateryGrave copy() { + return new WateryGrave(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/WindsweptHeath.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/WindsweptHeath.java new file mode 100644 index 00000000000..7513ad9be8b --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/WindsweptHeath.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class WindsweptHeath extends mage.sets.onslaught.WindsweptHeath { + + public WindsweptHeath(UUID ownerId) { + super(ownerId); + this.cardNumber = 20; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public WindsweptHeath(final WindsweptHeath card) { + super(card); + } + + @Override + public WindsweptHeath copy() { + return new WindsweptHeath(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarexpeditions/WoodedFoothills.java b/Mage.Sets/src/mage/sets/zendikarexpeditions/WoodedFoothills.java new file mode 100644 index 00000000000..30909248a96 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarexpeditions/WoodedFoothills.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarexpeditions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class WoodedFoothills extends mage.sets.onslaught.WoodedFoothills { + + public WoodedFoothills(UUID ownerId) { + super(ownerId); + this.cardNumber = 19; + this.expansionSetCode = "EXP"; + this.rarity = Rarity.MYTHIC; + } + + public WoodedFoothills(final WoodedFoothills card) { + super(card); + } + + @Override + public WoodedFoothills copy() { + return new WoodedFoothills(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/AffaGuardHound.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/AffaGuardHound.java new file mode 100644 index 00000000000..5124a2cef46 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/AffaGuardHound.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AffaGuardHound extends mage.sets.riseoftheeldrazi.AffaGuardHound { + + public AffaGuardHound(UUID ownerId) { + super(ownerId); + this.cardNumber = 2; + this.expansionSetCode = "DDP"; + } + + public AffaGuardHound(final AffaGuardHound card) { + super(card); + } + + @Override + public AffaGuardHound copy() { + return new AffaGuardHound(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/AkoumRefuge.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/AkoumRefuge.java new file mode 100644 index 00000000000..b1224e4e788 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/AkoumRefuge.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AkoumRefuge extends mage.sets.zendikar.AkoumRefuge { + + public AkoumRefuge(UUID ownerId) { + super(ownerId); + this.cardNumber = 67; + this.expansionSetCode = "DDP"; + } + + public AkoumRefuge(final AkoumRefuge card) { + super(card); + } + + @Override + public AkoumRefuge copy() { + return new AkoumRefuge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/ArtisanOfKozilek.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ArtisanOfKozilek.java new file mode 100644 index 00000000000..50e551ec19b --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ArtisanOfKozilek.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ArtisanOfKozilek extends mage.sets.riseoftheeldrazi.ArtisanOfKozilek { + + public ArtisanOfKozilek(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "DDP"; + } + + public ArtisanOfKozilek(final ArtisanOfKozilek card) { + super(card); + } + + @Override + public ArtisanOfKozilek copy() { + return new ArtisanOfKozilek(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/AvengerOfZendikar.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/AvengerOfZendikar.java new file mode 100644 index 00000000000..8a943c47192 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/AvengerOfZendikar.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class AvengerOfZendikar extends mage.sets.worldwake.AvengerOfZendikar { + + public AvengerOfZendikar(UUID ownerId) { + super(ownerId); + this.cardNumber = 1; + this.expansionSetCode = "DDP"; + } + + public AvengerOfZendikar(final AvengerOfZendikar card) { + super(card); + } + + @Override + public AvengerOfZendikar copy() { + return new AvengerOfZendikar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/BeastbreakerOfBalaGed.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/BeastbreakerOfBalaGed.java new file mode 100644 index 00000000000..c6186f3bac0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/BeastbreakerOfBalaGed.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BeastbreakerOfBalaGed extends mage.sets.riseoftheeldrazi.BeastbreakerOfBalaGed { + + public BeastbreakerOfBalaGed(UUID ownerId) { + super(ownerId); + this.cardNumber = 10; + this.expansionSetCode = "DDP"; + } + + public BeastbreakerOfBalaGed(final BeastbreakerOfBalaGed card) { + super(card); + } + + @Override + public BeastbreakerOfBalaGed copy() { + return new BeastbreakerOfBalaGed(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/BloodriteInvoker.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/BloodriteInvoker.java new file mode 100644 index 00000000000..6882416b536 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/BloodriteInvoker.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BloodriteInvoker extends mage.sets.riseoftheeldrazi.BloodriteInvoker { + + public BloodriteInvoker(UUID ownerId) { + super(ownerId); + this.cardNumber = 45; + this.expansionSetCode = "DDP"; + } + + public BloodriteInvoker(final BloodriteInvoker card) { + super(card); + } + + @Override + public BloodriteInvoker copy() { + return new BloodriteInvoker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/BloodthroneVampire.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/BloodthroneVampire.java new file mode 100644 index 00000000000..df217b22dc8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/BloodthroneVampire.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class BloodthroneVampire extends mage.sets.riseoftheeldrazi.BloodthroneVampire { + + public BloodthroneVampire(UUID ownerId) { + super(ownerId); + this.cardNumber = 46; + this.expansionSetCode = "DDP"; + } + + public BloodthroneVampire(final BloodthroneVampire card) { + super(card); + } + + @Override + public BloodthroneVampire copy() { + return new BloodthroneVampire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/ButcherOfMalakir.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ButcherOfMalakir.java new file mode 100644 index 00000000000..b6cc30b4eb3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ButcherOfMalakir.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ButcherOfMalakir extends mage.sets.worldwake.ButcherOfMalakir { + + public ButcherOfMalakir(UUID ownerId) { + super(ownerId); + this.cardNumber = 47; + this.expansionSetCode = "DDP"; + } + + public ButcherOfMalakir(final ButcherOfMalakir card) { + super(card); + } + + @Override + public ButcherOfMalakir copy() { + return new ButcherOfMalakir(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/CadaverImp.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/CadaverImp.java new file mode 100644 index 00000000000..b29ded2282e --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/CadaverImp.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CadaverImp extends mage.sets.riseoftheeldrazi.CadaverImp { + + public CadaverImp(UUID ownerId) { + super(ownerId); + this.cardNumber = 48; + this.expansionSetCode = "DDP"; + } + + public CadaverImp(final CadaverImp card) { + super(card); + } + + @Override + public CadaverImp copy() { + return new CadaverImp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/CaravanEscort.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/CaravanEscort.java new file mode 100644 index 00000000000..ca835f7380e --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/CaravanEscort.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class CaravanEscort extends mage.sets.riseoftheeldrazi.CaravanEscort { + + public CaravanEscort(UUID ownerId) { + super(ownerId); + this.cardNumber = 3; + this.expansionSetCode = "DDP"; + } + + public CaravanEscort(final CaravanEscort card) { + super(card); + } + + @Override + public CaravanEscort copy() { + return new CaravanEscort(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/ConsumeTheMeek.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ConsumeTheMeek.java new file mode 100644 index 00000000000..f0ab133945c --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ConsumeTheMeek.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ConsumeTheMeek extends mage.sets.riseoftheeldrazi.ConsumeTheMeek { + + public ConsumeTheMeek(UUID ownerId) { + super(ownerId); + this.cardNumber = 49; + this.expansionSetCode = "DDP"; + } + + public ConsumeTheMeek(final ConsumeTheMeek card) { + super(card); + } + + @Override + public ConsumeTheMeek copy() { + return new ConsumeTheMeek(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Corpsehatch.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Corpsehatch.java new file mode 100644 index 00000000000..d773fac09f8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Corpsehatch.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Corpsehatch extends mage.sets.riseoftheeldrazi.Corpsehatch { + + public Corpsehatch(UUID ownerId) { + super(ownerId); + this.cardNumber = 50; + this.expansionSetCode = "DDP"; + } + + public Corpsehatch(final Corpsehatch card) { + super(card); + } + + @Override + public Corpsehatch copy() { + return new Corpsehatch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/DaggerbackBasilisk.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/DaggerbackBasilisk.java new file mode 100644 index 00000000000..12a2bf2ecfe --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/DaggerbackBasilisk.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class DaggerbackBasilisk extends mage.sets.riseoftheeldrazi.DaggerbackBasilisk { + + public DaggerbackBasilisk(UUID ownerId) { + super(ownerId); + this.cardNumber = 11; + this.expansionSetCode = "DDP"; + } + + public DaggerbackBasilisk(final DaggerbackBasilisk card) { + super(card); + } + + @Override + public DaggerbackBasilisk copy() { + return new DaggerbackBasilisk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/DominatorDrone.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/DominatorDrone.java new file mode 100644 index 00000000000..99555127b42 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/DominatorDrone.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class DominatorDrone extends mage.sets.battleforzendikar.DominatorDrone { + + public DominatorDrone(UUID ownerId) { + super(ownerId); + this.cardNumber = 51; + this.expansionSetCode = "DDP"; + } + + public DominatorDrone(final DominatorDrone card) { + super(card); + } + + @Override + public DominatorDrone copy() { + return new DominatorDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/EldraziTemple.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/EldraziTemple.java new file mode 100644 index 00000000000..c8e18c76644 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/EldraziTemple.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class EldraziTemple extends mage.sets.riseoftheeldrazi.EldraziTemple { + + public EldraziTemple(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "DDP"; + this.rarity = Rarity.UNCOMMON; + } + + public EldraziTemple(final EldraziTemple card) { + super(card); + } + + @Override + public EldraziTemple copy() { + return new EldraziTemple(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/EmrakulsHatcher.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/EmrakulsHatcher.java new file mode 100644 index 00000000000..2f19778d32f --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/EmrakulsHatcher.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EmrakulsHatcher extends mage.sets.riseoftheeldrazi.EmrakulsHatcher { + + public EmrakulsHatcher(UUID ownerId) { + super(ownerId); + this.cardNumber = 59; + this.expansionSetCode = "DDP"; + } + + public EmrakulsHatcher(final EmrakulsHatcher card) { + super(card); + } + + @Override + public EmrakulsHatcher copy() { + return new EmrakulsHatcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/EvolvingWilds.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/EvolvingWilds.java new file mode 100644 index 00000000000..e958eaa4294 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/EvolvingWilds.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class EvolvingWilds extends mage.sets.riseoftheeldrazi.EvolvingWilds { + + public EvolvingWilds(UUID ownerId) { + super(ownerId); + this.cardNumber = 31; + this.expansionSetCode = "DDP"; + } + + public EvolvingWilds(final EvolvingWilds card) { + super(card); + } + + @Override + public EvolvingWilds copy() { + return new EvolvingWilds(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/ExplorersScope.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ExplorersScope.java new file mode 100644 index 00000000000..2a2ea956976 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ExplorersScope.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class ExplorersScope extends mage.sets.zendikar.ExplorersScope { + + public ExplorersScope(UUID ownerId) { + super(ownerId); + this.cardNumber = 28; + this.expansionSetCode = "DDP"; + this.rarity = Rarity.UNCOMMON; + } + + public ExplorersScope(final ExplorersScope card) { + super(card); + } + + @Override + public ExplorersScope copy() { + return new ExplorersScope(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/ForerunnerOfSlaughter.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ForerunnerOfSlaughter.java new file mode 100644 index 00000000000..4a411beb283 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ForerunnerOfSlaughter.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ForerunnerOfSlaughter extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("colorless creature"); + + static { + filter.add(new ColorlessPredicate()); + } + + public ForerunnerOfSlaughter(UUID ownerId) { + super(ownerId, 64, "Forerunner of Slaughter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{R}"); + this.expansionSetCode = "DDP"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Devoid (This card has no color.) + this.addAbility(new DevoidAbility(this.color)); + + // {1}: Target colorless creature gains haste until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(1)); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public ForerunnerOfSlaughter(final ForerunnerOfSlaughter card) { + super(card); + } + + @Override + public ForerunnerOfSlaughter copy() { + return new ForerunnerOfSlaughter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Forest1.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Forest1.java new file mode 100644 index 00000000000..9d8e5d4a4de --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Forest1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest1 extends mage.cards.basiclands.Forest { + + public Forest1(UUID ownerId) { + super(ownerId, 38); + this.expansionSetCode = "DDP"; + } + + public Forest1(final Forest1 card) { + super(card); + } + + @Override + public Forest1 copy() { + return new Forest1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Forest2.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Forest2.java new file mode 100644 index 00000000000..f85611bd15e --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Forest2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest2 extends mage.cards.basiclands.Forest { + + public Forest2(UUID ownerId) { + super(ownerId, 39); + this.expansionSetCode = "DDP"; + } + + public Forest2(final Forest2 card) { + super(card); + } + + @Override + public Forest2 copy() { + return new Forest2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Forest3.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Forest3.java new file mode 100644 index 00000000000..b65992fa0c8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Forest3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest3 extends mage.cards.basiclands.Forest { + + public Forest3(UUID ownerId) { + super(ownerId, 40); + this.expansionSetCode = "DDP"; + } + + public Forest3(final Forest3 card) { + super(card); + } + + @Override + public Forest3 copy() { + return new Forest3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/ForkedBolt.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ForkedBolt.java new file mode 100644 index 00000000000..3722dea752d --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ForkedBolt.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ForkedBolt extends mage.sets.riseoftheeldrazi.ForkedBolt { + + public ForkedBolt(UUID ownerId) { + super(ownerId); + this.cardNumber = 60; + this.expansionSetCode = "DDP"; + } + + public ForkedBolt(final ForkedBolt card) { + super(card); + } + + @Override + public ForkedBolt copy() { + return new ForkedBolt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/FrontierGuide.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/FrontierGuide.java new file mode 100644 index 00000000000..b4843dd070d --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/FrontierGuide.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class FrontierGuide extends mage.sets.zendikar.FrontierGuide { + + public FrontierGuide(UUID ownerId) { + super(ownerId); + this.cardNumber = 12; + this.expansionSetCode = "DDP"; + } + + public FrontierGuide(final FrontierGuide card) { + super(card); + } + + @Override + public FrontierGuide copy() { + return new FrontierGuide(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/GraypeltHunter.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/GraypeltHunter.java new file mode 100644 index 00000000000..c173909d574 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/GraypeltHunter.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GraypeltHunter extends mage.sets.worldwake.GraypeltHunter { + + public GraypeltHunter(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "DDP"; + } + + public GraypeltHunter(final GraypeltHunter card) { + super(card); + } + + @Override + public GraypeltHunter copy() { + return new GraypeltHunter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/GraypeltRefuge.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/GraypeltRefuge.java new file mode 100644 index 00000000000..62ed8e05e38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/GraypeltRefuge.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GraypeltRefuge extends mage.sets.zendikar.GraypeltRefuge { + + public GraypeltRefuge(UUID ownerId) { + super(ownerId); + this.cardNumber = 32; + this.expansionSetCode = "DDP"; + } + + public GraypeltRefuge(final GraypeltRefuge card) { + super(card); + } + + @Override + public GraypeltRefuge copy() { + return new GraypeltRefuge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/GrazingGladehart.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/GrazingGladehart.java new file mode 100644 index 00000000000..67aad1851b8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/GrazingGladehart.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class GrazingGladehart extends mage.sets.zendikar.GrazingGladehart { + + public GrazingGladehart(UUID ownerId) { + super(ownerId); + this.cardNumber = 14; + this.expansionSetCode = "DDP"; + } + + public GrazingGladehart(final GrazingGladehart card) { + super(card); + } + + @Override + public GrazingGladehart copy() { + return new GrazingGladehart(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Groundswell.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Groundswell.java new file mode 100644 index 00000000000..0744ac71923 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Groundswell.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Groundswell extends mage.sets.worldwake.Groundswell { + + public Groundswell(UUID ownerId) { + super(ownerId); + this.cardNumber = 15; + this.expansionSetCode = "DDP"; + } + + public Groundswell(final Groundswell card) { + super(card); + } + + @Override + public Groundswell copy() { + return new Groundswell(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Harrow.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Harrow.java new file mode 100644 index 00000000000..d8fa9e400f4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Harrow.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Harrow extends mage.sets.zendikar.Harrow { + + public Harrow(UUID ownerId) { + super(ownerId); + this.cardNumber = 16; + this.expansionSetCode = "DDP"; + } + + public Harrow(final Harrow card) { + super(card); + } + + @Override + public Harrow copy() { + return new Harrow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/HeartstabberMosquito.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/HeartstabberMosquito.java new file mode 100644 index 00000000000..7951e57aede --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/HeartstabberMosquito.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class HeartstabberMosquito extends mage.sets.zendikar.HeartstabberMosquito { + + public HeartstabberMosquito(UUID ownerId) { + super(ownerId); + this.cardNumber = 52; + this.expansionSetCode = "DDP"; + } + + public HeartstabberMosquito(final HeartstabberMosquito card) { + super(card); + } + + @Override + public HeartstabberMosquito copy() { + return new HeartstabberMosquito(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/HellionEruption.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/HellionEruption.java new file mode 100644 index 00000000000..0144b2c5359 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/HellionEruption.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class HellionEruption extends mage.sets.riseoftheeldrazi.HellionEruption { + + public HellionEruption(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "DDP"; + } + + public HellionEruption(final HellionEruption card) { + super(card); + } + + @Override + public HellionEruption copy() { + return new HellionEruption(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/InduceDespair.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/InduceDespair.java new file mode 100644 index 00000000000..976002758bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/InduceDespair.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class InduceDespair extends mage.sets.riseoftheeldrazi.InduceDespair { + + public InduceDespair(UUID ownerId) { + super(ownerId); + this.cardNumber = 53; + this.expansionSetCode = "DDP"; + } + + public InduceDespair(final InduceDespair card) { + super(card); + } + + @Override + public InduceDespair copy() { + return new InduceDespair(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/ItThatBetrays.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ItThatBetrays.java new file mode 100644 index 00000000000..bb8f9ec7154 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ItThatBetrays.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ItThatBetrays extends mage.sets.riseoftheeldrazi.ItThatBetrays { + + public ItThatBetrays(UUID ownerId) { + super(ownerId); + this.cardNumber = 43; + this.expansionSetCode = "DDP"; + } + + public ItThatBetrays(final ItThatBetrays card) { + super(card); + } + + @Override + public ItThatBetrays copy() { + return new ItThatBetrays(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/JoragaBard.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/JoragaBard.java new file mode 100644 index 00000000000..77ef10b33e8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/JoragaBard.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class JoragaBard extends mage.sets.zendikar.JoragaBard { + + public JoragaBard(UUID ownerId) { + super(ownerId); + this.cardNumber = 17; + this.expansionSetCode = "DDP"; + } + + public JoragaBard(final JoragaBard card) { + super(card); + } + + @Override + public JoragaBard copy() { + return new JoragaBard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/KabiraVindicator.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/KabiraVindicator.java new file mode 100644 index 00000000000..82aecd4d550 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/KabiraVindicator.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class KabiraVindicator extends mage.sets.riseoftheeldrazi.KabiraVindicator { + + public KabiraVindicator(UUID ownerId) { + super(ownerId); + this.cardNumber = 4; + this.expansionSetCode = "DDP"; + } + + public KabiraVindicator(final KabiraVindicator card) { + super(card); + } + + @Override + public KabiraVindicator copy() { + return new KabiraVindicator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/KhalniHeartExpedition.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/KhalniHeartExpedition.java new file mode 100644 index 00000000000..7364cfa8cff --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/KhalniHeartExpedition.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class KhalniHeartExpedition extends mage.sets.zendikar.KhalniHeartExpedition { + + public KhalniHeartExpedition(UUID ownerId) { + super(ownerId); + this.cardNumber = 18; + this.expansionSetCode = "DDP"; + } + + public KhalniHeartExpedition(final KhalniHeartExpedition card) { + super(card); + } + + @Override + public KhalniHeartExpedition copy() { + return new KhalniHeartExpedition(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/KnightOfCliffhaven.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/KnightOfCliffhaven.java new file mode 100644 index 00000000000..3ba6d8f6b53 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/KnightOfCliffhaven.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class KnightOfCliffhaven extends mage.sets.riseoftheeldrazi.KnightOfCliffhaven { + + public KnightOfCliffhaven(UUID ownerId) { + super(ownerId); + this.cardNumber = 5; + this.expansionSetCode = "DDP"; + } + + public KnightOfCliffhaven(final KnightOfCliffhaven card) { + super(card); + } + + @Override + public KnightOfCliffhaven copy() { + return new KnightOfCliffhaven(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Magmaw.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Magmaw.java new file mode 100644 index 00000000000..54a13892c1c --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Magmaw.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Magmaw extends mage.sets.riseoftheeldrazi.Magmaw { + + public Magmaw(UUID ownerId) { + super(ownerId); + this.cardNumber = 62; + this.expansionSetCode = "DDP"; + } + + public Magmaw(final Magmaw card) { + super(card); + } + + @Override + public Magmaw copy() { + return new Magmaw(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/MakindiGriffin.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/MakindiGriffin.java new file mode 100644 index 00000000000..9b932dc3265 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/MakindiGriffin.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MakindiGriffin extends mage.sets.riseoftheeldrazi.MakindiGriffin { + + public MakindiGriffin(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "DDP"; + } + + public MakindiGriffin(final MakindiGriffin card) { + super(card); + } + + @Override + public MakindiGriffin copy() { + return new MakindiGriffin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/MarshCasualties.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/MarshCasualties.java new file mode 100644 index 00000000000..d0e6f06ba63 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/MarshCasualties.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MarshCasualties extends mage.sets.zendikar.MarshCasualties { + + public MarshCasualties(UUID ownerId) { + super(ownerId); + this.cardNumber = 54; + this.expansionSetCode = "DDP"; + } + + public MarshCasualties(final MarshCasualties card) { + super(card); + } + + @Override + public MarshCasualties copy() { + return new MarshCasualties(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/MindStone.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/MindStone.java new file mode 100644 index 00000000000..c6188c788b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/MindStone.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class MindStone extends mage.sets.tenthedition.MindStone { + + public MindStone(UUID ownerId) { + super(ownerId); + this.cardNumber = 65; + this.expansionSetCode = "DDP"; + } + + public MindStone(final MindStone card) { + super(card); + } + + @Override + public MindStone copy() { + return new MindStone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Mountain1.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Mountain1.java new file mode 100644 index 00000000000..ca96eaf6635 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Mountain1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain1 extends mage.cards.basiclands.Mountain { + + public Mountain1(UUID ownerId) { + super(ownerId, 73); + this.expansionSetCode = "DDP"; + } + + public Mountain1(final Mountain1 card) { + super(card); + } + + @Override + public Mountain1 copy() { + return new Mountain1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Mountain2.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Mountain2.java new file mode 100644 index 00000000000..d111d89f00e --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Mountain2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain2 extends mage.cards.basiclands.Mountain { + + public Mountain2(UUID ownerId) { + super(ownerId, 74); + this.expansionSetCode = "DDP"; + } + + public Mountain2(final Mountain2 card) { + super(card); + } + + @Override + public Mountain2 copy() { + return new Mountain2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Mountain3.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Mountain3.java new file mode 100644 index 00000000000..0989f3b1959 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Mountain3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain3 extends mage.cards.basiclands.Mountain { + + public Mountain3(UUID ownerId) { + super(ownerId, 75); + this.expansionSetCode = "DDP"; + } + + public Mountain3(final Mountain3 card) { + super(card); + } + + @Override + public Mountain3 copy() { + return new Mountain3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/OblivionSower.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/OblivionSower.java new file mode 100644 index 00000000000..875ff61ef2e --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/OblivionSower.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class OblivionSower extends mage.sets.battleforzendikar.OblivionSower { + + public OblivionSower(UUID ownerId) { + super(ownerId); + this.cardNumber = 41; + this.expansionSetCode = "DDP"; + } + + public OblivionSower(final OblivionSower card) { + super(card); + } + + @Override + public OblivionSower copy() { + return new OblivionSower(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/OnduGiant.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/OnduGiant.java new file mode 100644 index 00000000000..fcd3f7da7db --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/OnduGiant.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class OnduGiant extends mage.sets.riseoftheeldrazi.OnduGiant { + + public OnduGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 19; + this.expansionSetCode = "DDP"; + } + + public OnduGiant(final OnduGiant card) { + super(card); + } + + @Override + public OnduGiant copy() { + return new OnduGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Oust.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Oust.java new file mode 100644 index 00000000000..4c697dae8be --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Oust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Oust extends mage.sets.riseoftheeldrazi.Oust { + + public Oust(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "DDP"; + } + + public Oust(final Oust card) { + super(card); + } + + @Override + public Oust copy() { + return new Oust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/PawnOfUlamog.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/PawnOfUlamog.java new file mode 100644 index 00000000000..a21afa97ad7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/PawnOfUlamog.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PawnOfUlamog extends mage.sets.riseoftheeldrazi.PawnOfUlamog { + + public PawnOfUlamog(UUID ownerId) { + super(ownerId); + this.cardNumber = 55; + this.expansionSetCode = "DDP"; + } + + public PawnOfUlamog(final PawnOfUlamog card) { + super(card); + } + + @Override + public PawnOfUlamog copy() { + return new PawnOfUlamog(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Plains1.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Plains1.java new file mode 100644 index 00000000000..1ae9c56ab78 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Plains1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains1 extends mage.cards.basiclands.Plains { + + public Plains1(UUID ownerId) { + super(ownerId, 35); + this.expansionSetCode = "DDP"; + } + + public Plains1(final Plains1 card) { + super(card); + } + + @Override + public Plains1 copy() { + return new Plains1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Plains2.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Plains2.java new file mode 100644 index 00000000000..2637e408be2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Plains2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains2 extends mage.cards.basiclands.Plains { + + public Plains2(UUID ownerId) { + super(ownerId, 36); + this.expansionSetCode = "DDP"; + } + + public Plains2(final Plains2 card) { + super(card); + } + + @Override + public Plains2 copy() { + return new Plains2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Plains3.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Plains3.java new file mode 100644 index 00000000000..93ab89238ab --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Plains3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains3 extends mage.cards.basiclands.Plains { + + public Plains3(UUID ownerId) { + super(ownerId, 37); + this.expansionSetCode = "DDP"; + } + + public Plains3(final Plains3 card) { + super(card); + } + + @Override + public Plains3 copy() { + return new Plains3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/PrimalCommand.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/PrimalCommand.java new file mode 100644 index 00000000000..c4972bf4eed --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/PrimalCommand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class PrimalCommand extends mage.sets.lorwyn.PrimalCommand { + + public PrimalCommand(UUID ownerId) { + super(ownerId); + this.cardNumber = 20; + this.expansionSetCode = "DDP"; + } + + public PrimalCommand(final PrimalCommand card) { + super(card); + } + + @Override + public PrimalCommand copy() { + return new PrimalCommand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/ReadTheBones.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ReadTheBones.java new file mode 100644 index 00000000000..501b0e742e4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ReadTheBones.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ReadTheBones extends mage.sets.theros.ReadTheBones { + + public ReadTheBones(UUID ownerId) { + super(ownerId); + this.cardNumber = 56; + this.expansionSetCode = "DDP"; + } + + public ReadTheBones(final ReadTheBones card) { + super(card); + } + + @Override + public ReadTheBones copy() { + return new ReadTheBones(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/RepelTheDarkness.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/RepelTheDarkness.java new file mode 100644 index 00000000000..f81bb35304b --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/RepelTheDarkness.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RepelTheDarkness extends mage.sets.riseoftheeldrazi.RepelTheDarkness { + + public RepelTheDarkness(UUID ownerId) { + super(ownerId); + this.cardNumber = 8; + this.expansionSetCode = "DDP"; + } + + public RepelTheDarkness(final RepelTheDarkness card) { + super(card); + } + + @Override + public RepelTheDarkness copy() { + return new RepelTheDarkness(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/RetreatToKazandu.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/RetreatToKazandu.java new file mode 100644 index 00000000000..07b44962924 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/RetreatToKazandu.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class RetreatToKazandu extends CardImpl { + + public RetreatToKazandu(UUID ownerId) { + super(ownerId, 21, "Retreat to Kazandu", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "DDP"; + + // Landfall-Whenever a land enters the battlefield under your control, choose one - Put a +1/+1 counter on target creature; or You gain 2 life. + LandfallAbility ability = new LandfallAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), false); + ability.addTarget(new TargetCreaturePermanent()); + Mode mode = new Mode(); + mode.getEffects().add(new GainLifeEffect(2)); + ability.addMode(mode); + this.addAbility(ability); + } + + public RetreatToKazandu(final RetreatToKazandu card) { + super(card); + } + + @Override + public RetreatToKazandu copy() { + return new RetreatToKazandu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/RockyTarPit.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/RockyTarPit.java new file mode 100644 index 00000000000..993dcce4f9d --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/RockyTarPit.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RockyTarPit extends mage.sets.mirage.RockyTarPit { + + public RockyTarPit(UUID ownerId) { + super(ownerId); + this.cardNumber = 69; + this.expansionSetCode = "DDP"; + } + + public RockyTarPit(final RockyTarPit card) { + super(card); + } + + @Override + public RockyTarPit copy() { + return new RockyTarPit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/RunedServitor.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/RunedServitor.java new file mode 100644 index 00000000000..9def3c5dff8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/RunedServitor.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RunedServitor extends mage.sets.riseoftheeldrazi.RunedServitor { + + public RunedServitor(UUID ownerId) { + super(ownerId); + this.cardNumber = 66; + this.expansionSetCode = "DDP"; + } + + public RunedServitor(final RunedServitor card) { + super(card); + } + + @Override + public RunedServitor copy() { + return new RunedServitor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/ScuteMob.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ScuteMob.java new file mode 100644 index 00000000000..5e469dcb1d8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ScuteMob.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class ScuteMob extends mage.sets.zendikar.ScuteMob { + + public ScuteMob(UUID ownerId) { + super(ownerId); + this.cardNumber = 22; + this.expansionSetCode = "DDP"; + } + + public ScuteMob(final ScuteMob card) { + super(card); + } + + @Override + public ScuteMob copy() { + return new ScuteMob(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/SeersSundial.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/SeersSundial.java new file mode 100644 index 00000000000..f62a7e72f93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/SeersSundial.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class SeersSundial extends mage.sets.worldwake.SeersSundial { + + public SeersSundial(UUID ownerId) { + super(ownerId); + this.cardNumber = 29; + this.expansionSetCode = "DDP"; + } + + public SeersSundial(final SeersSundial card) { + super(card); + } + + @Override + public SeersSundial copy() { + return new SeersSundial(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/SheerDrop.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/SheerDrop.java new file mode 100644 index 00000000000..69decb3a8de --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/SheerDrop.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.AwakenAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class SheerDrop extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature"); + + static { + filter.add(new TappedPredicate()); + } + + public SheerDrop(UUID ownerId) { + super(ownerId, 9, "Sheer Drop", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "DDP"; + + // Destroy target tapped creature. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + + // Awaken 3-{5}{W} (If you cast this spell for {5}{W}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.) + this.addAbility(new AwakenAbility(this, 3, "{5}{W}")); + } + + public SheerDrop(final SheerDrop card) { + super(card); + } + + @Override + public SheerDrop copy() { + return new SheerDrop(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Smother.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Smother.java new file mode 100644 index 00000000000..be12e7e00e7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Smother.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Smother extends mage.sets.worldwake.Smother { + + public Smother(UUID ownerId) { + super(ownerId); + this.cardNumber = 57; + this.expansionSetCode = "DDP"; + } + + public Smother(final Smother card) { + super(card); + } + + @Override + public Smother copy() { + return new Smother(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/StirringWildwood.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/StirringWildwood.java new file mode 100644 index 00000000000..10277a1dc71 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/StirringWildwood.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class StirringWildwood extends mage.sets.worldwake.StirringWildwood { + + public StirringWildwood(UUID ownerId) { + super(ownerId); + this.cardNumber = 33; + this.expansionSetCode = "DDP"; + } + + public StirringWildwood(final StirringWildwood card) { + super(card); + } + + @Override + public StirringWildwood copy() { + return new StirringWildwood(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/StoneworkPuma.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/StoneworkPuma.java new file mode 100644 index 00000000000..131308063a3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/StoneworkPuma.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class StoneworkPuma extends mage.sets.zendikar.StoneworkPuma { + + public StoneworkPuma(UUID ownerId) { + super(ownerId); + this.cardNumber = 30; + this.expansionSetCode = "DDP"; + } + + public StoneworkPuma(final StoneworkPuma card) { + super(card); + } + + @Override + public StoneworkPuma copy() { + return new StoneworkPuma(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Swamp1.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Swamp1.java new file mode 100644 index 00000000000..7affb99410c --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Swamp1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp1 extends mage.cards.basiclands.Swamp { + + public Swamp1(UUID ownerId) { + super(ownerId, 70); + this.expansionSetCode = "DDP"; + } + + public Swamp1(final Swamp1 card) { + super(card); + } + + @Override + public Swamp1 copy() { + return new Swamp1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Swamp2.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Swamp2.java new file mode 100644 index 00000000000..bbd67095465 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Swamp2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp2 extends mage.cards.basiclands.Swamp { + + public Swamp2(UUID ownerId) { + super(ownerId, 71); + this.expansionSetCode = "DDP"; + } + + public Swamp2(final Swamp2 card) { + super(card); + } + + @Override + public Swamp2 copy() { + return new Swamp2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/Swamp3.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Swamp3.java new file mode 100644 index 00000000000..f33970248bb --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/Swamp3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp3 extends mage.cards.basiclands.Swamp { + + public Swamp3(UUID ownerId) { + super(ownerId, 72); + this.expansionSetCode = "DDP"; + } + + public Swamp3(final Swamp3 card) { + super(card); + } + + @Override + public Swamp3 copy() { + return new Swamp3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/TajuruArcher.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/TajuruArcher.java new file mode 100644 index 00000000000..ee274b7ed7e --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/TajuruArcher.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TajuruArcher extends mage.sets.zendikar.TajuruArcher { + + public TajuruArcher(UUID ownerId) { + super(ownerId); + this.cardNumber = 23; + this.expansionSetCode = "DDP"; + } + + public TajuruArcher(final TajuruArcher card) { + super(card); + } + + @Override + public TajuruArcher copy() { + return new TajuruArcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/TerritorialBaloth.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/TerritorialBaloth.java new file mode 100644 index 00000000000..3cf3a4057c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/TerritorialBaloth.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TerritorialBaloth extends mage.sets.zendikar.TerritorialBaloth { + + public TerritorialBaloth(UUID ownerId) { + super(ownerId); + this.cardNumber = 24; + this.expansionSetCode = "DDP"; + } + + public TerritorialBaloth(final TerritorialBaloth card) { + super(card); + } + + @Override + public TerritorialBaloth copy() { + return new TerritorialBaloth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/TorchSlinger.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/TorchSlinger.java new file mode 100644 index 00000000000..e3b09616772 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/TorchSlinger.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TorchSlinger extends mage.sets.zendikar.TorchSlinger { + + public TorchSlinger(UUID ownerId) { + super(ownerId); + this.cardNumber = 63; + this.expansionSetCode = "DDP"; + } + + public TorchSlinger(final TorchSlinger card) { + super(card); + } + + @Override + public TorchSlinger copy() { + return new TorchSlinger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/TurntimberBasilisk.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/TurntimberBasilisk.java new file mode 100644 index 00000000000..9cd597887d6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/TurntimberBasilisk.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TurntimberBasilisk extends mage.sets.zendikar.TurntimberBasilisk { + + public TurntimberBasilisk(UUID ownerId) { + super(ownerId); + this.cardNumber = 25; + this.expansionSetCode = "DDP"; + } + + public TurntimberBasilisk(final TurntimberBasilisk card) { + super(card); + } + + @Override + public TurntimberBasilisk copy() { + return new TurntimberBasilisk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/TurntimberGrove.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/TurntimberGrove.java new file mode 100644 index 00000000000..ee78b72004b --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/TurntimberGrove.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class TurntimberGrove extends mage.sets.zendikar.TurntimberGrove { + + public TurntimberGrove(UUID ownerId) { + super(ownerId); + this.cardNumber = 34; + this.expansionSetCode = "DDP"; + } + + public TurntimberGrove(final TurntimberGrove card) { + super(card); + } + + @Override + public TurntimberGrove copy() { + return new TurntimberGrove(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/UlamogsCrusher.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/UlamogsCrusher.java new file mode 100644 index 00000000000..d9955f51810 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/UlamogsCrusher.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class UlamogsCrusher extends mage.sets.riseoftheeldrazi.UlamogsCrusher { + + public UlamogsCrusher(UUID ownerId) { + super(ownerId); + this.cardNumber = 44; + this.expansionSetCode = "DDP"; + } + + public UlamogsCrusher(final UlamogsCrusher card) { + super(card); + } + + @Override + public UlamogsCrusher copy() { + return new UlamogsCrusher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/VampireNighthawk.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/VampireNighthawk.java new file mode 100644 index 00000000000..62f3c0a0fa2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/VampireNighthawk.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class VampireNighthawk extends mage.sets.zendikar.VampireNighthawk { + + public VampireNighthawk(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "DDP"; + } + + public VampireNighthawk(final VampireNighthawk card) { + super(card); + } + + @Override + public VampireNighthawk copy() { + return new VampireNighthawk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/VeteranWarleader.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/VeteranWarleader.java new file mode 100644 index 00000000000..7da3274afa2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/VeteranWarleader.java @@ -0,0 +1,159 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author fireshoes + */ +public class VeteranWarleader extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another untapped Ally you control"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new SubtypePredicate("Ally")); + } + + public VeteranWarleader(UUID ownerId) { + super(ownerId, 27, "Veteran Warleader", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{W}"); + this.expansionSetCode = "DDP"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Ally"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Veteran Warleader's power and toughness are each equal to the number of creatures you control. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect( + new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), Duration.EndOfGame))); + + // Tap another untapped Ally you control: Veteran Warleader gains your choice of first strike, vigilance, or trample until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new VeteranWarleaderEffect(), new TapTargetCost(new TargetControlledPermanent(1, 1, filter, true)))); + } + + public VeteranWarleader(final VeteranWarleader card) { + super(card); + } + + @Override + public VeteranWarleader copy() { + return new VeteranWarleader(this); + } +} + +class VeteranWarleaderEffect extends OneShotEffect { + + VeteranWarleaderEffect() { + super(Outcome.AddAbility); + staticText = "{this} gains your choice of first strike, vigilance, or trample until end of turn"; + } + + VeteranWarleaderEffect(final VeteranWarleaderEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (sourceObject != null && controller != null) { + Choice abilityChoice = new ChoiceImpl(); + abilityChoice.setMessage("Choose an ability to add"); + + Set abilities = new HashSet<>(); + abilities.add(FirstStrikeAbility.getInstance().getRule()); + abilities.add(VigilanceAbility.getInstance().getRule()); + abilities.add(TrampleAbility.getInstance().getRule()); + abilityChoice.setChoices(abilities); + while (!abilityChoice.isChosen()) { + controller.choose(Outcome.AddAbility, abilityChoice, game); + if (!controller.canRespond()) { + return false; + } + } + + String chosen = abilityChoice.getChoice(); + Ability ability = null; + if (FirstStrikeAbility.getInstance().getRule().equals(chosen)) { + ability = FirstStrikeAbility.getInstance(); + } else if (VigilanceAbility.getInstance().getRule().equals(chosen)) { + ability = VigilanceAbility.getInstance(); + } else if (TrampleAbility.getInstance().getRule().equals(chosen)) { + ability = TrampleAbility.getInstance(); + } + + if (ability != null) { + game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " has chosen: " + chosen); + ContinuousEffect effect = new GainAbilitySourceEffect(ability, Duration.EndOfTurn); + game.addEffect(effect, source); + return true; + } + } + return false; + } + + @Override + public VeteranWarleaderEffect copy() { + return new VeteranWarleaderEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/WildheartInvoker.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/WildheartInvoker.java new file mode 100644 index 00000000000..a2d95524a8c --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/WildheartInvoker.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class WildheartInvoker extends mage.sets.riseoftheeldrazi.WildheartInvoker { + + public WildheartInvoker(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + this.expansionSetCode = "DDP"; + } + + public WildheartInvoker(final WildheartInvoker card) { + super(card); + } + + @Override + public WildheartInvoker copy() { + return new WildheartInvoker(this); + } +} diff --git a/Mage.Stats/pom.xml b/Mage.Stats/pom.xml index 91da9f71b06..102c0d3d4c4 100644 --- a/Mage.Stats/pom.xml +++ b/Mage.Stats/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.3 + 1.4.5 org.mage diff --git a/Mage.Tests/CommanderAnafenza_WBG.dck b/Mage.Tests/CommanderAnafenza_WBG.dck new file mode 100644 index 00000000000..0c8db1eb734 --- /dev/null +++ b/Mage.Tests/CommanderAnafenza_WBG.dck @@ -0,0 +1,88 @@ +1 [RTR:71] Necropolis Regent +1 [FUT:171] Llanowar Reborn +1 [RAV:158] Doubling Season +1 [RAV:33] Twilight Drover +1 [RAV:278] Golgari Rot Farm +1 [8ED:247] Fecundity +1 [M11:221] Whispersilk Cloak +1 [6ED:274] Ashnod's Altar +1 [ZEN:182] Scute Mob +1 [RTR:152] Corpsejack Menace +1 [ALA:140] Mycoloth +1 [RTR:150] Collective Blessing +1 [RTR:194] Selesnya Charm +1 [M13:170] Farseek +1 [BNG:148] Karametra, God of Harvests +7 [BFZ:270] Forest +1 [FUT:138] Sprout Swarm +1 [DKA:76] Tragic Slip +1 [DGM:149] Golgari Guildgate +1 [GTC:123] Gyre Sage +1 [DGM:93] Putrefy +1 [GTC:242] Godless Shrine +1 [AVR:10] Cathars' Crusade +1 [AVR:171] Champion of Lambholt +1 [M14:1] Ajani, Caller of the Pride +1 [THS:153] Bow of Nylea +1 [INV:233] Aura Shards +1 [RTR:63] Desecration Demon +1 [MOR:72] Oona's Blackguard +1 [KTK:215] Abzan Banner +1 [KTK:79] Mer-Ek Nightblade +1 [KTK:179] Ivorytusk Fortress +1 [M15:177] Hornet Nest +1 [DGM:153] Orzhov Guildgate +1 [KTK:133] Hardened Scales +1 [KTK:210] Utter End +1 [DGM:155] Selesnya Guildgate +1 [RTR:176] Korozda Guildmage +1 [VMA:255] Magister of Worth +1 [ISD:199] Parallel Lives +4 [BFZ:260] Swamp +1 [M12:190] Rampant Growth +1 [KTK:85] Retribution of the Ancients +1 [DGM:63] Deadbridge Chant +1 [CHK:239] Sakura-Tribe Elder +1 [ISD:239] Gavony Township +1 [DGM:114] Voice of Resurgence +1 [VMA:250] Deathreap Ritual +1 [CHK:225] Kodama's Reach +1 [M13:229] Sunpetal Grove +1 [M13:227] Reliquary Tower +1 [SCG:25] Wing Shards +1 [KTK:1] Abzan Battle Priest +1 [M11:120] Viscera Seer +1 [THS:227] Temple of Silence +1 [RTR:174] Jarad, Golgari Lich Lord +1 [RAV:251] Privileged Position +1 [KTK:3] Ainok Bond-Kin +1 [NPH:73] Sheoldred, Whispering One +1 [KTK:2] Abzan Falconer +1 [GTC:182] Obzedat, Ghost Council +1 [KTK:241] Sandsteppe Citadel +1 [RTR:121] Death's Presence +4 [BFZ:250] Plains +1 [KTK:161] Abzan Charm +1 [ISD:242] Isolated Chapel +1 [RTR:248] Temple Garden +1 [KTK:160] Abzan Ascendancy +1 [JOU:65] Dictate of Erebos +1 [TMP:36] Living Death +1 [M11:11] Condemn +1 [ORI:246] Evolving Wilds +1 [RAV:218] Phytohydra +1 [ISD:249] Woodland Cemetery +1 [M15:93] Cruel Sadist +1 [CSP:130] Juniper Order Ranger +1 [WWK:132] Bojuka Bog +1 [FUT:169] Dakmor Salvage +1 [CMD:200] Ghave, Guru of Spores +1 [DIS:95] Sprouting Phytohydra +1 [RAV:281] Selesnya Sanctuary +1 [KTK:156] Tuskguard Captain +1 [DKA:156] Grim Backwoods +1 [GPT:122] Mortify +1 [GPT:161] Orzhov Basilica +1 [C13:281] Command Tower +1 [RAV:207] Glare of Subdual +SB: 1 [KTK:163] Anafenza, the Foremost diff --git a/Mage.Tests/pom.xml b/Mage.Tests/pom.xml index d5da2643a78..68ccbf7bc82 100644 --- a/Mage.Tests/pom.xml +++ b/Mage.Tests/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.3 + 1.4.5 mage-tests @@ -85,6 +85,20 @@ + + + org.apache.maven.plugins + maven-clean-plugin + 2.5 + + + + db + + + + + mage-tests diff --git a/Mage.Tests/src/test/java/mage/ManaSymbolTest.java b/Mage.Tests/src/test/java/mage/ManaSymbolTest.java new file mode 100644 index 00000000000..3fb8a731149 --- /dev/null +++ b/Mage.Tests/src/test/java/mage/ManaSymbolTest.java @@ -0,0 +1,819 @@ +package mage; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Custom unit tests for {@link ManaSymbol} + */ +public class ManaSymbolTest { + + @Test + public void shouldCreateWhiteManaSymbol() { + // given + + // when + ManaSymbol w = ManaSymbol.W; + + // then + assertEquals("{W}", w.toString()); + assertFalse(w.isBlack()); + assertFalse(w.isBlue()); + assertFalse(w.isRed()); + assertFalse(w.isGreen()); + assertFalse(w.isColorless()); + assertFalse(w.isSnow()); + assertFalse(w.isPhyrexian()); + assertFalse(w.isGeneric()); + assertFalse(w.isHybrid()); + + assertTrue(w.isColored()); + assertTrue(w.isWhite()); + assertTrue(w.isPrimary()); + assertTrue(w.isMonocolored()); + + assertEquals(null, w.getManaSymbol1()); + assertEquals(null, w.getManaSymbol2()); + } + + @Test + public void shouldCreateBlueManaSymbol() { + // given + + // when + ManaSymbol u = ManaSymbol.U; + + // then + assertEquals("{U}", u.toString()); + assertFalse(u.isBlack()); + assertFalse(u.isWhite()); + assertFalse(u.isRed()); + assertFalse(u.isGreen()); + assertFalse(u.isColorless()); + assertFalse(u.isSnow()); + assertFalse(u.isPhyrexian()); + assertFalse(u.isGeneric()); + assertFalse(u.isHybrid()); + + assertTrue(u.isColored()); + assertTrue(u.isBlue()); + assertTrue(u.isPrimary()); + assertTrue(u.isMonocolored()); + + assertEquals(null, u.getManaSymbol1()); + assertEquals(null, u.getManaSymbol2()); + } + + + @Test + public void shouldCreateBlackManaSymbol() { + // given + + // when + ManaSymbol b = ManaSymbol.B; + + // then + assertEquals("{B}", b.toString()); + assertFalse(b.isBlue()); + assertFalse(b.isWhite()); + assertFalse(b.isRed()); + assertFalse(b.isGreen()); + assertFalse(b.isColorless()); + assertFalse(b.isSnow()); + assertFalse(b.isPhyrexian()); + assertFalse(b.isGeneric()); + assertFalse(b.isHybrid()); + + assertTrue(b.isColored()); + assertTrue(b.isBlack()); + assertTrue(b.isPrimary()); + assertTrue(b.isMonocolored()); + + assertEquals(null, b.getManaSymbol1()); + assertEquals(null, b.getManaSymbol2()); + } + + @Test + public void shouldCreateRedManaSymbol() { + // given + + // when + ManaSymbol r = ManaSymbol.R; + + // then + assertEquals("{R}", r.toString()); + assertFalse(r.isBlue()); + assertFalse(r.isWhite()); + assertFalse(r.isBlack()); + assertFalse(r.isGreen()); + assertFalse(r.isColorless()); + assertFalse(r.isSnow()); + assertFalse(r.isPhyrexian()); + assertFalse(r.isGeneric()); + assertFalse(r.isHybrid()); + + assertTrue(r.isColored()); + assertTrue(r.isRed()); + assertTrue(r.isPrimary()); + assertTrue(r.isMonocolored()); + + assertEquals(null, r.getManaSymbol1()); + assertEquals(null, r.getManaSymbol2()); + } + + + @Test + public void shouldCreateGreenManaSymbol() { + // given + + // when + ManaSymbol g = ManaSymbol.G; + + // then + assertEquals("{G}", g.toString()); + assertFalse(g.isBlue()); + assertFalse(g.isWhite()); + assertFalse(g.isBlack()); + assertFalse(g.isRed()); + assertFalse(g.isColorless()); + assertFalse(g.isSnow()); + assertFalse(g.isPhyrexian()); + assertFalse(g.isGeneric()); + assertFalse(g.isHybrid()); + + assertTrue(g.isColored()); + assertTrue(g.isGreen()); + assertTrue(g.isPrimary()); + assertTrue(g.isMonocolored()); + + assertEquals(null, g.getManaSymbol1()); + assertEquals(null, g.getManaSymbol2()); + } + + @Test + public void shouldCreateGenericManaSymbol() { + // given + + // when + ManaSymbol x = ManaSymbol.X; + + // then + assertEquals("{X}", x.toString()); + assertFalse(x.isBlue()); + assertFalse(x.isWhite()); + assertFalse(x.isBlack()); + assertFalse(x.isRed()); + assertFalse(x.isGreen()); + assertFalse(x.isColored()); + assertFalse(x.isSnow()); + assertFalse(x.isPhyrexian()); + assertFalse(x.isHybrid()); + assertFalse(x.isPrimary()); + assertFalse(x.isMonocolored()); + + assertTrue(x.isGeneric()); + assertTrue(x.isColorless()); + + assertEquals(null, x.getManaSymbol1()); + assertEquals(null, x.getManaSymbol2()); + } + + + @Test + public void shouldCreateNumericManaSymbol() { + // given + + // when + ManaSymbol numeric = ManaSymbol.NUMERIC; + + // then + assertEquals("{N/A}", numeric.toString()); + assertFalse(numeric.isBlue()); + assertFalse(numeric.isWhite()); + assertFalse(numeric.isBlack()); + assertFalse(numeric.isRed()); + assertFalse(numeric.isGreen()); + assertFalse(numeric.isColored()); + assertFalse(numeric.isSnow()); + assertFalse(numeric.isPhyrexian()); + assertFalse(numeric.isHybrid()); + assertFalse(numeric.isPrimary()); + assertFalse(numeric.isMonocolored()); + + assertTrue(numeric.isGeneric()); + assertTrue(numeric.isColorless()); + + assertEquals(null, numeric.getManaSymbol1()); + assertEquals(null, numeric.getManaSymbol2()); + } + + + @Test + public void shouldCreateMonoColoredHybridWManaSymbol() { + // given + + // when + ManaSymbol monoHybridW = ManaSymbol.MONOCOLORED_HYBRID_W; + + // then + assertEquals("{2/W}", monoHybridW.toString()); + assertFalse(monoHybridW.isBlue()); + assertFalse(monoHybridW.isBlack()); + assertFalse(monoHybridW.isRed()); + assertFalse(monoHybridW.isGreen()); + assertFalse(monoHybridW.isSnow()); + assertFalse(monoHybridW.isPhyrexian()); + assertFalse(monoHybridW.isPrimary()); + assertFalse(monoHybridW.isGeneric()); + assertFalse(monoHybridW.isColorless()); + + assertTrue(monoHybridW.isMonocolored()); + assertTrue(monoHybridW.isHybrid()); + assertTrue(monoHybridW.isWhite()); + assertTrue(monoHybridW.isColored()); + + assertEquals(ManaSymbol.W, monoHybridW.getManaSymbol1()); + assertEquals(null, monoHybridW.getManaSymbol2()); + } + + + @Test + public void shouldCreateMonoColoredHybridUManaSymbol() { + // given + + // when + ManaSymbol monoHybridU = ManaSymbol.MONOCOLORED_HYBRID_U; + + // then + assertEquals("{2/U}", monoHybridU.toString()); + assertFalse(monoHybridU.isWhite()); + assertFalse(monoHybridU.isBlack()); + assertFalse(monoHybridU.isRed()); + assertFalse(monoHybridU.isGreen()); + assertFalse(monoHybridU.isSnow()); + assertFalse(monoHybridU.isPhyrexian()); + assertFalse(monoHybridU.isPrimary()); + assertFalse(monoHybridU.isGeneric()); + assertFalse(monoHybridU.isColorless()); + + assertTrue(monoHybridU.isMonocolored()); + assertTrue(monoHybridU.isHybrid()); + assertTrue(monoHybridU.isBlue()); + assertTrue(monoHybridU.isColored()); + + assertEquals(ManaSymbol.U, monoHybridU.getManaSymbol1()); + assertEquals(null, monoHybridU.getManaSymbol2()); + } + + + @Test + public void shouldCreateMonoColoredHybridBManaSymbol() { + // given + + // when + ManaSymbol monoHybridB = ManaSymbol.MONOCOLORED_HYBRID_B; + + // then + assertEquals("{2/B}", monoHybridB.toString()); + assertFalse(monoHybridB.isBlue()); + assertFalse(monoHybridB.isWhite()); + assertFalse(monoHybridB.isRed()); + assertFalse(monoHybridB.isGreen()); + assertFalse(monoHybridB.isSnow()); + assertFalse(monoHybridB.isPhyrexian()); + assertFalse(monoHybridB.isPrimary()); + assertFalse(monoHybridB.isGeneric()); + assertFalse(monoHybridB.isColorless()); + + assertTrue(monoHybridB.isMonocolored()); + assertTrue(monoHybridB.isHybrid()); + assertTrue(monoHybridB.isBlack()); + assertTrue(monoHybridB.isColored()); + + assertEquals(ManaSymbol.B, monoHybridB.getManaSymbol1()); + assertEquals(null, monoHybridB.getManaSymbol2()); + } + + + @Test + public void shouldCreateMonoColoredHybridRManaSymbol() { + // given + + // when + ManaSymbol monoHybridR = ManaSymbol.MONOCOLORED_HYBRID_R; + + // then + assertEquals("{2/R}", monoHybridR.toString()); + assertFalse(monoHybridR.isBlack()); + assertFalse(monoHybridR.isBlue()); + assertFalse(monoHybridR.isWhite()); + assertFalse(monoHybridR.isGreen()); + assertFalse(monoHybridR.isSnow()); + assertFalse(monoHybridR.isPhyrexian()); + assertFalse(monoHybridR.isPrimary()); + assertFalse(monoHybridR.isGeneric()); + assertFalse(monoHybridR.isColorless()); + + assertTrue(monoHybridR.isMonocolored()); + assertTrue(monoHybridR.isHybrid()); + assertTrue(monoHybridR.isRed()); + assertTrue(monoHybridR.isColored()); + + assertEquals(ManaSymbol.R, monoHybridR.getManaSymbol1()); + assertEquals(null, monoHybridR.getManaSymbol2()); + } + + + @Test + public void shouldCreateMonoColoredHybridGManaSymbol() { + // given + + // when + ManaSymbol monoHybridG = ManaSymbol.MONOCOLORED_HYBRID_G; + + // then + assertEquals("{2/G}", monoHybridG.toString()); + assertFalse(monoHybridG.isBlack()); + assertFalse(monoHybridG.isBlue()); + assertFalse(monoHybridG.isWhite()); + assertFalse(monoHybridG.isRed()); + assertFalse(monoHybridG.isSnow()); + assertFalse(monoHybridG.isPhyrexian()); + assertFalse(monoHybridG.isPrimary()); + assertFalse(monoHybridG.isGeneric()); + assertFalse(monoHybridG.isColorless()); + + assertTrue(monoHybridG.isMonocolored()); + assertTrue(monoHybridG.isHybrid()); + assertTrue(monoHybridG.isGreen()); + assertTrue(monoHybridG.isColored()); + + assertEquals(ManaSymbol.G, monoHybridG.getManaSymbol1()); + assertEquals(null, monoHybridG.getManaSymbol2()); + } + + + @Test + public void shouldCreateHybridWUManaSymbol() { + // given + + // when + ManaSymbol hybridWU = ManaSymbol.HYBRID_WU; + + // then + assertEquals("{W/U}", hybridWU.toString()); + assertFalse(hybridWU.isGreen()); + assertFalse(hybridWU.isBlack()); + assertFalse(hybridWU.isRed()); + assertFalse(hybridWU.isSnow()); + assertFalse(hybridWU.isPhyrexian()); + assertFalse(hybridWU.isPrimary()); + assertFalse(hybridWU.isGeneric()); + assertFalse(hybridWU.isColorless()); + assertFalse(hybridWU.isMonocolored()); + + assertTrue(hybridWU.isWhite()); + assertTrue(hybridWU.isBlue()); + assertTrue(hybridWU.isHybrid()); + assertTrue(hybridWU.isColored()); + + assertEquals(ManaSymbol.W, hybridWU.getManaSymbol1()); + assertEquals(ManaSymbol.U, hybridWU.getManaSymbol2()); + } + + + @Test + public void shouldCreateHybridWBManaSymbol() { + // given + + // when + ManaSymbol hybridWB = ManaSymbol.HYBRID_WB; + + // then + assertEquals("{W/B}", hybridWB.toString()); + assertFalse(hybridWB.isBlue()); + assertFalse(hybridWB.isGreen()); + assertFalse(hybridWB.isRed()); + assertFalse(hybridWB.isSnow()); + assertFalse(hybridWB.isPhyrexian()); + assertFalse(hybridWB.isPrimary()); + assertFalse(hybridWB.isGeneric()); + assertFalse(hybridWB.isColorless()); + assertFalse(hybridWB.isMonocolored()); + + assertTrue(hybridWB.isWhite()); + assertTrue(hybridWB.isBlack()); + assertTrue(hybridWB.isHybrid()); + assertTrue(hybridWB.isColored()); + + assertEquals(ManaSymbol.W, hybridWB.getManaSymbol1()); + assertEquals(ManaSymbol.B, hybridWB.getManaSymbol2()); + } + + + @Test + public void shouldCreateHybridUBManaSymbol() { + // given + + // when + ManaSymbol hybridUB = ManaSymbol.HYBRID_UB; + + // then + assertEquals("{U/B}", hybridUB.toString()); + assertFalse(hybridUB.isWhite()); + assertFalse(hybridUB.isGreen()); + assertFalse(hybridUB.isRed()); + assertFalse(hybridUB.isSnow()); + assertFalse(hybridUB.isPhyrexian()); + assertFalse(hybridUB.isPrimary()); + assertFalse(hybridUB.isGeneric()); + assertFalse(hybridUB.isColorless()); + assertFalse(hybridUB.isMonocolored()); + + assertTrue(hybridUB.isBlue()); + assertTrue(hybridUB.isBlack()); + assertTrue(hybridUB.isHybrid()); + assertTrue(hybridUB.isColored()); + + assertEquals(ManaSymbol.U, hybridUB.getManaSymbol1()); + assertEquals(ManaSymbol.B, hybridUB.getManaSymbol2()); + } + + + @Test + public void shouldCreateHybridURManaSymbol() { + // given + + // when + ManaSymbol hybridUR = ManaSymbol.HYBRID_UR; + + // then + assertEquals("{U/R}", hybridUR.toString()); + assertFalse(hybridUR.isBlack()); + assertFalse(hybridUR.isWhite()); + assertFalse(hybridUR.isGreen()); + assertFalse(hybridUR.isSnow()); + assertFalse(hybridUR.isPhyrexian()); + assertFalse(hybridUR.isPrimary()); + assertFalse(hybridUR.isGeneric()); + assertFalse(hybridUR.isColorless()); + assertFalse(hybridUR.isMonocolored()); + + assertTrue(hybridUR.isBlue()); + assertTrue(hybridUR.isRed()); + assertTrue(hybridUR.isHybrid()); + assertTrue(hybridUR.isColored()); + + assertEquals(ManaSymbol.U, hybridUR.getManaSymbol1()); + assertEquals(ManaSymbol.R, hybridUR.getManaSymbol2()); + } + + + @Test + public void shouldCreateHybridBRManaSymbol() { + // given + + // when + ManaSymbol hybridBR = ManaSymbol.HYBRID_BR; + + // then + assertEquals("{B/R}", hybridBR.toString()); + assertFalse(hybridBR.isBlue()); + assertFalse(hybridBR.isWhite()); + assertFalse(hybridBR.isGreen()); + assertFalse(hybridBR.isSnow()); + assertFalse(hybridBR.isPhyrexian()); + assertFalse(hybridBR.isPrimary()); + assertFalse(hybridBR.isGeneric()); + assertFalse(hybridBR.isColorless()); + assertFalse(hybridBR.isMonocolored()); + + assertTrue(hybridBR.isBlack()); + assertTrue(hybridBR.isRed()); + assertTrue(hybridBR.isHybrid()); + assertTrue(hybridBR.isColored()); + + assertEquals(ManaSymbol.B, hybridBR.getManaSymbol1()); + assertEquals(ManaSymbol.R, hybridBR.getManaSymbol2()); + } + + + @Test + public void shouldCreateHybridBGManaSymbol() { + // given + + // when + ManaSymbol hybridBG = ManaSymbol.HYBRID_BG; + + // then + assertEquals("{B/G}", hybridBG.toString()); + assertFalse(hybridBG.isRed()); + assertFalse(hybridBG.isBlue()); + assertFalse(hybridBG.isWhite()); + assertFalse(hybridBG.isSnow()); + assertFalse(hybridBG.isPhyrexian()); + assertFalse(hybridBG.isPrimary()); + assertFalse(hybridBG.isGeneric()); + assertFalse(hybridBG.isColorless()); + assertFalse(hybridBG.isMonocolored()); + + assertTrue(hybridBG.isBlack()); + assertTrue(hybridBG.isGreen()); + assertTrue(hybridBG.isHybrid()); + assertTrue(hybridBG.isColored()); + + assertEquals(ManaSymbol.B, hybridBG.getManaSymbol1()); + assertEquals(ManaSymbol.G, hybridBG.getManaSymbol2()); + } + + + @Test + public void shouldCreateHybridRGManaSymbol() { + // given + + // when + ManaSymbol hybridRG = ManaSymbol.HYBRID_RG; + + // then + assertEquals("{R/G}", hybridRG.toString()); + assertFalse(hybridRG.isBlack()); + assertFalse(hybridRG.isBlue()); + assertFalse(hybridRG.isWhite()); + assertFalse(hybridRG.isSnow()); + assertFalse(hybridRG.isPhyrexian()); + assertFalse(hybridRG.isPrimary()); + assertFalse(hybridRG.isGeneric()); + assertFalse(hybridRG.isColorless()); + assertFalse(hybridRG.isMonocolored()); + + assertTrue(hybridRG.isRed()); + assertTrue(hybridRG.isGreen()); + assertTrue(hybridRG.isHybrid()); + assertTrue(hybridRG.isColored()); + + assertEquals(ManaSymbol.R, hybridRG.getManaSymbol1()); + assertEquals(ManaSymbol.G, hybridRG.getManaSymbol2()); + } + + + @Test + public void shouldCreateHybridRWManaSymbol() { + // given + + // when + ManaSymbol hybridRW = ManaSymbol.HYBRID_RW; + + // then + assertEquals("{R/W}", hybridRW.toString()); + assertFalse(hybridRW.isGreen()); + assertFalse(hybridRW.isBlack()); + assertFalse(hybridRW.isBlue()); + assertFalse(hybridRW.isSnow()); + assertFalse(hybridRW.isPhyrexian()); + assertFalse(hybridRW.isPrimary()); + assertFalse(hybridRW.isGeneric()); + assertFalse(hybridRW.isColorless()); + assertFalse(hybridRW.isMonocolored()); + + assertTrue(hybridRW.isRed()); + assertTrue(hybridRW.isWhite()); + assertTrue(hybridRW.isHybrid()); + assertTrue(hybridRW.isColored()); + + assertEquals(ManaSymbol.R, hybridRW.getManaSymbol1()); + assertEquals(ManaSymbol.W, hybridRW.getManaSymbol2()); + } + + + @Test + public void shouldCreateHybridGWManaSymbol() { + // given + + // when + ManaSymbol hybridGW = ManaSymbol.HYBRID_GW; + + // then + assertEquals("{G/W}", hybridGW.toString()); + assertFalse(hybridGW.isRed()); + assertFalse(hybridGW.isBlack()); + assertFalse(hybridGW.isBlue()); + assertFalse(hybridGW.isSnow()); + assertFalse(hybridGW.isPhyrexian()); + assertFalse(hybridGW.isPrimary()); + assertFalse(hybridGW.isGeneric()); + assertFalse(hybridGW.isColorless()); + assertFalse(hybridGW.isMonocolored()); + + assertTrue(hybridGW.isGreen()); + assertTrue(hybridGW.isWhite()); + assertTrue(hybridGW.isHybrid()); + assertTrue(hybridGW.isColored()); + + assertEquals(ManaSymbol.G, hybridGW.getManaSymbol1()); + assertEquals(ManaSymbol.W, hybridGW.getManaSymbol2()); + } + + + @Test + public void shouldCreateHybridGUManaSymbol() { + // given + + // when + ManaSymbol hybridGU = ManaSymbol.HYBRID_GU; + + // then + assertEquals("{G/U}", hybridGU.toString()); + assertFalse(hybridGU.isWhite()); + assertFalse(hybridGU.isRed()); + assertFalse(hybridGU.isBlack()); + assertFalse(hybridGU.isSnow()); + assertFalse(hybridGU.isPhyrexian()); + assertFalse(hybridGU.isPrimary()); + assertFalse(hybridGU.isGeneric()); + assertFalse(hybridGU.isColorless()); + assertFalse(hybridGU.isMonocolored()); + + assertTrue(hybridGU.isGreen()); + assertTrue(hybridGU.isBlue()); + assertTrue(hybridGU.isHybrid()); + assertTrue(hybridGU.isColored()); + + assertEquals(ManaSymbol.G, hybridGU.getManaSymbol1()); + assertEquals(ManaSymbol.U, hybridGU.getManaSymbol2()); + } + + + @Test + public void shouldCreateWPhyrexianMana() { + // given + + // when + ManaSymbol phyW = ManaSymbol.PHYREXIAN_W; + + // then + assertEquals("{W/P}", phyW.toString()); + assertFalse(phyW.isGreen()); + assertFalse(phyW.isBlue()); + assertFalse(phyW.isRed()); + assertFalse(phyW.isBlack()); + assertFalse(phyW.isPrimary()); + assertFalse(phyW.isGeneric()); + assertFalse(phyW.isColorless()); + assertFalse(phyW.isHybrid()); + assertFalse(phyW.isSnow()); + + assertTrue(phyW.isWhite()); + assertTrue(phyW.isPhyrexian()); + assertTrue(phyW.isColored()); + assertTrue(phyW.isMonocolored()); + + assertEquals(ManaSymbol.W, phyW.getManaSymbol1()); + assertEquals(null, phyW.getManaSymbol2()); + } + + + @Test + public void shouldCreateGPhyrexianMana() { + // given + + // when + ManaSymbol phyG = ManaSymbol.PHYREXIAN_G; + + // then + assertEquals("{G/P}", phyG.toString()); + assertFalse(phyG.isWhite()); + assertFalse(phyG.isBlue()); + assertFalse(phyG.isRed()); + assertFalse(phyG.isBlack()); + assertFalse(phyG.isPrimary()); + assertFalse(phyG.isGeneric()); + assertFalse(phyG.isColorless()); + assertFalse(phyG.isHybrid()); + assertFalse(phyG.isSnow()); + + assertTrue(phyG.isGreen()); + assertTrue(phyG.isPhyrexian()); + assertTrue(phyG.isColored()); + assertTrue(phyG.isMonocolored()); + + assertEquals(ManaSymbol.G, phyG.getManaSymbol1()); + assertEquals(null, phyG.getManaSymbol2()); + } + + + @Test + public void shouldCreateRPhyrexianMana() { + // given + + // when + ManaSymbol phyR = ManaSymbol.PHYREXIAN_R; + + // then + assertEquals("{R/P}", phyR.toString()); + assertFalse(phyR.isGreen()); + assertFalse(phyR.isWhite()); + assertFalse(phyR.isBlue()); + assertFalse(phyR.isBlack()); + assertFalse(phyR.isPrimary()); + assertFalse(phyR.isGeneric()); + assertFalse(phyR.isColorless()); + assertFalse(phyR.isHybrid()); + assertFalse(phyR.isSnow()); + + assertTrue(phyR.isRed()); + assertTrue(phyR.isPhyrexian()); + assertTrue(phyR.isColored()); + assertTrue(phyR.isMonocolored()); + + assertEquals(ManaSymbol.R, phyR.getManaSymbol1()); + assertEquals(null, phyR.getManaSymbol2()); + } + + + @Test + public void shouldCreateBPhyrexianMana() { + // given + + // when + ManaSymbol phyB = ManaSymbol.PHYREXIAN_B; + + // then + assertEquals("{B/P}", phyB.toString()); + assertFalse(phyB.isRed()); + assertFalse(phyB.isGreen()); + assertFalse(phyB.isWhite()); + assertFalse(phyB.isBlue()); + assertFalse(phyB.isPrimary()); + assertFalse(phyB.isGeneric()); + assertFalse(phyB.isColorless()); + assertFalse(phyB.isHybrid()); + assertFalse(phyB.isSnow()); + + assertTrue(phyB.isBlack()); + assertTrue(phyB.isPhyrexian()); + assertTrue(phyB.isColored()); + assertTrue(phyB.isMonocolored()); + + assertEquals(ManaSymbol.B, phyB.getManaSymbol1()); + assertEquals(null, phyB.getManaSymbol2()); + } + + + @Test + public void shouldCreateUPhyrexianMana() { + // given + + // when + ManaSymbol phyU = ManaSymbol.PHYREXIAN_U; + + // then + assertEquals("{U/P}", phyU.toString()); + assertFalse(phyU.isBlack()); + assertFalse(phyU.isRed()); + assertFalse(phyU.isGreen()); + assertFalse(phyU.isWhite()); + assertFalse(phyU.isPrimary()); + assertFalse(phyU.isGeneric()); + assertFalse(phyU.isColorless()); + assertFalse(phyU.isHybrid()); + assertFalse(phyU.isSnow()); + + assertTrue(phyU.isBlue()); + assertTrue(phyU.isPhyrexian()); + assertTrue(phyU.isColored()); + assertTrue(phyU.isMonocolored()); + + assertEquals(ManaSymbol.U, phyU.getManaSymbol1()); + assertEquals(null, phyU.getManaSymbol2()); + } + + + @Test + public void shouldCreateSnowMana() { + // given + + // when + ManaSymbol snow = ManaSymbol.SNOW; + + // then + assertEquals("{S}", snow.toString()); + assertFalse(snow.isGreen()); + assertFalse(snow.isBlue()); + assertFalse(snow.isWhite()); + assertFalse(snow.isRed()); + assertFalse(snow.isBlack()); + assertFalse(snow.isPhyrexian()); + assertFalse(snow.isPrimary()); + assertFalse(snow.isGeneric()); + assertFalse(snow.isColorless()); + assertFalse(snow.isMonocolored()); + assertFalse(snow.isHybrid()); + assertFalse(snow.isColored()); + + assertTrue(snow.isSnow()); + + assertEquals(null, snow.getManaSymbol1()); + assertEquals(null, snow.getManaSymbol2()); + } +} \ No newline at end of file diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java index d14393676f2..7ec428ccede 100644 --- a/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java @@ -52,6 +52,10 @@ public class CastCreaturesTest extends CardTestPlayerBaseAI { assertPermanentCount(playerA, "Silvercoat Lion", 1); } + /** + * This test fails sometimes, probably because two plains are tapped for the + * first creature + */ @Test public void testSimpleCast2() { addCard(Zone.HAND, playerA, "Silvercoat Lion"); @@ -100,6 +104,35 @@ public class CastCreaturesTest extends CardTestPlayerBaseAI { assertPermanentCount(playerA, "Blazing Specter", 1); } + @Test + public void testSimpleCast5() { + addCard(Zone.HAND, playerA, "Plains", 2); + addCard(Zone.HAND, playerA, "Mountain", 1); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 3); + addCard(Zone.HAND, playerA, "Soul Warden"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Plains", 1); + assertPermanentCount(playerA, "Soul Warden", 1); + } + + @Test + public void testSimpleCast6() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.HAND, playerA, "Plains", 2); + addCard(Zone.HAND, playerA, "Mountain", 2); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); + addCard(Zone.HAND, playerA, "Pillarfield Ox", 1); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Plains", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + } + @Test public void testCast4Creature() { addCard(Zone.LIBRARY, playerA, "Swamp", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastDestroySpellsTest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastDestroySpellsTest.java index 458bd5012f9..1e595c19e6e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastDestroySpellsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastDestroySpellsTest.java @@ -45,11 +45,13 @@ public class CastDestroySpellsTest extends CardTestPlayerBaseAI { @Test public void testOrzhovCharm() { // Choose one - - // Return target creature you control and all Auras you control attached to it to their owner's hand; - // or destroy target creature and you lose life equal to its toughness; - // or return target creature card with converted mana cost 1 or less from your graveyard to the battlefield. + // - Return target creature you control and all Auras you control attached to it to their owner's hand; + // - Destroy target creature and you lose life equal to its toughness; + // - Return target creature card with converted mana cost 1 or less from your graveyard to the battlefield. addCard(Zone.HAND, playerA, "Orzhov Charm"); // {W}{B} + // {T}: Add {1} to your mana pool. + // {T} {W/B}, {T}: Add {W}{W}, {W}{B}, or {B}{B} to your mana pool. addCard(Zone.BATTLEFIELD, playerA, "Fetid Heath", 1); addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/PreventRepeatedActionsTest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/PreventRepeatedActionsTest.java index 1a6259d8e10..45e99f0806b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/AI/basic/PreventRepeatedActionsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/PreventRepeatedActionsTest.java @@ -73,15 +73,20 @@ public class PreventRepeatedActionsTest extends CardTestPlayerBaseAI { */ @Test public void testBasaltMonolith() { + addCard(Zone.HAND, playerA, "Phyrexian Vault", 1); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 3); // Basalt Monolith doesn't untap during your untap step. // {T}: Add {3} to your mana pool. // {3}: Untap Basalt Monolith. - addCard(Zone.BATTLEFIELD, playerA, "Basalt Monolith", 1); + addCard(Zone.BATTLEFIELD, playerA, "Basalt Monolith", 1, true); - setStopAt(1, PhaseStep.END_TURN); + setStopAt(5, PhaseStep.END_TURN); execute(); - assertTapped("Basalt Monolith", false); + // {2}, {T}, Sacrifice a creature: Draw a card. + assertPermanentCount(playerA, "Phyrexian Vault", 1); + assertTapped("Basalt Monolith", true); + assertTappedCount("Plains", false, 3); } /** diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetsAreChosenTest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetsAreChosenTest.java index 31a037b721b..4859e3af03f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetsAreChosenTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetsAreChosenTest.java @@ -63,7 +63,7 @@ public class TargetsAreChosenTest extends CardTestPlayerBaseAI { /** * Check that the AI does not cast Rack and Ruin if it would destroy the - * owly creature on the battlefield owned by the AI + * only creature on the battlefield owned by the AI */ @Test public void testRackAndRuin2() { @@ -196,7 +196,7 @@ public class TargetsAreChosenTest extends CardTestPlayerBaseAI { } /** - * Test that AI counters creatire spell + * Test that AI counters creature spell */ @Test @Ignore // counter spells don't seem to be cast by AI @@ -222,4 +222,13 @@ public class TargetsAreChosenTest extends CardTestPlayerBaseAI { } + /** + * Target selection from EntersTheBattlefield is not varied in the AI + * calculation, so value is only calculated for the one selected target set. + * + * E.g. If AI casts an Eyeblight Assassin and opponent has a 3/1 and a 2/2, + * the AI should target the 3/1. + * + * Add test to check such situations + */ } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/abilitywords/ConvergeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/abilitywords/ConvergeTest.java new file mode 100644 index 00000000000..d374c691c5e --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/abilitywords/ConvergeTest.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.abilitywords; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class ConvergeTest extends CardTestPlayerBase { + + /** + * Test with only red mana + */ + @Test + public void testOnlyOneColor() { + // Converge — Radiant Flames deals X damage to each creature, where X is the number of colors of mana spent to cast Radiant Flames. + addCard(Zone.HAND, playerA, "Radiant Flames", 1); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerA, "Akroan Jailer", 1); // 1/1 + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerB, "Akroan Jailer", 1); // 1/1 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Radiant Flames"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Akroan Jailer", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + assertGraveyardCount(playerB, "Akroan Jailer", 1); + assertPermanentCount(playerB, "Silvercoat Lion", 1); + } + + @Test + public void testWithTwoColors() { + // Converge — Radiant Flames deals X damage to each creature, where X is the number of colors of mana spent to cast Radiant Flames. + addCard(Zone.HAND, playerA, "Radiant Flames", 1); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerA, "Akroan Jailer", 1); // 1/1 + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerB, "Akroan Jailer", 1); // 1/1 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Radiant Flames"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Akroan Jailer", 1); + assertGraveyardCount(playerA, "Silvercoat Lion", 1); + assertGraveyardCount(playerB, "Akroan Jailer", 1); + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/abilitywords/DomainTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/abilitywords/DomainTest.java new file mode 100644 index 00000000000..a74ad001f91 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/abilitywords/DomainTest.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.abilitywords; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class DomainTest extends CardTestPlayerBase { + + /** + * Collapsing Borders correctly does the 3 damage to each player at the + * beginning of their upkeeps. However, it does NOT add any life for each + * type of basic land the player has on the field. + */ + @Test + public void testCollapsingBorders() { + // Domain - At the beginning of each player's upkeep, that player gains 1 life for each basic land type among lands he or she controls. + // Then Collapsing Borders deals 3 damage to him or her. + addCard(Zone.HAND, playerA, "Collapsing Borders", 1); // {3}{R} + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 3); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Collapsing Borders"); + + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Collapsing Borders", 1); + + assertLife(playerA, 21); + assertLife(playerB, 18); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/LicidAbilityTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/LicidAbilityTest.java new file mode 100644 index 00000000000..27907d2fed5 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/LicidAbilityTest.java @@ -0,0 +1,118 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.activated; + +import mage.abilities.common.LicidAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.keyword.HasteAbility; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Ignore; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author emerald0000 + */ + +public class LicidAbilityTest extends CardTestPlayerBase { + + /** + * Activate on another creature + */ + @Test + public void BasicUsageTest() { + addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox"); + // {R}, {T}: Enraging Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {R} to end this effect. + // Enchanted creature has haste. + addCard(Zone.BATTLEFIELD, playerA, "Enraging Licid"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain"); + + activateAbility(1, PhaseStep.UPKEEP, playerA, "{R},", "Pillarfield Ox"); + setStopAt(1, PhaseStep.PRECOMBAT_MAIN); + + execute(); + + assertAbility(playerA, "Pillarfield Ox", HasteAbility.getInstance(), true); + assertAbility(playerA, "Enraging Licid", new LicidAbility(new ColoredManaCost(ColoredManaSymbol.R), new ColoredManaCost(ColoredManaSymbol.R)), false); + assertType("Enraging Licid", CardType.ENCHANTMENT, true); + assertType("Enraging Licid", CardType.CREATURE, false); + } + + /** + * Use special action to remove the continuous effect + */ + @Test + @Ignore("Test player can't activate special actions yet") + public void SpecialActionTest() { + addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox"); + // {R}, {T}: Enraging Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {R} to end this effect. + // Enchanted creature has haste. + addCard(Zone.BATTLEFIELD, playerA, "Enraging Licid"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + + activateAbility(1, PhaseStep.UPKEEP, playerA, "{R},", "Pillarfield Ox"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: End"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + + execute(); + + assertActionCount(playerA, 0); + assertAbility(playerA, "Pillarfield Ox", HasteAbility.getInstance(), false); + assertAbility(playerA, "Enraging Licid", new LicidAbility(new ColoredManaCost(ColoredManaSymbol.R), new ColoredManaCost(ColoredManaSymbol.R)), true); + assertType("Enraging Licid", CardType.ENCHANTMENT, false); + assertType("Enraging Licid", CardType.CREATURE, true); + } + + /** + * Licid should die if enchanted creature dies + */ + @Test + @Ignore("Enraging Licid doesn't die when its enchanted creature dies due to similarity to Bestow") + public void EnchantedCreatureDiesTest() { + addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox"); + // {R}, {T}: Enraging Licid loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay {R} to end this effect. + // Enchanted creature has haste. + addCard(Zone.BATTLEFIELD, playerA, "Enraging Licid"); + // Destroy target nonblack creature. + addCard(Zone.HAND, playerB, "Doom Blade"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2); + + activateAbility(1, PhaseStep.UPKEEP, playerA, "{R},", "Pillarfield Ox"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Doom Blade", "Pillarfield Ox"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + + execute(); + + assertGraveyardCount(playerA, 2); // Pillarfield Ox + Enraging Licid + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/PutToGraveyardTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/PutToGraveyardTest.java new file mode 100644 index 00000000000..1b72964a695 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/PutToGraveyardTest.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.activated; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class PutToGraveyardTest extends CardTestPlayerBase { + + /** + * Void Attendant The usable "Prozessor-Effect" doesnt put the card back + * into the graveyard from the exile. + */ + @Test + public void testExileToGraveyard() { + // Devoid + // {1}{G}, Put a card an opponent owns from exile into that player's graveyard: Put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + addCard(Zone.BATTLEFIELD, playerA, "Void Attendant"); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); + // Flash (You may cast this spell any time you could cast an instant.) + // When Stasis Snare enters the battlefield, exile target creature an opponent controls until Stasis Snare leaves the battlefield. (That creature returns under its owner's control.) + addCard(Zone.HAND, playerA, "Stasis Snare", 1); // {1}{W}{W} + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Stasis Snare"); + addTarget(playerA, "Silvercoat Lion"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{G},", NO_TARGET, ""); + addTarget(playerA, "Silvercoat Lion"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Stasis Snare", 1); + assertPermanentCount(playerB, "Silvercoat Lion", 0); + assertExileCount(playerB, 0); + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + assertPermanentCount(playerA, "Eldrazi Scion", 1); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java index 9864c33cfdb..22c8614b8a0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java @@ -36,7 +36,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class ReturnToHandTest extends CardTestPlayerBase { /** @@ -47,23 +46,24 @@ public class ReturnToHandTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox"); // Bloodthirst 3 // Flying - // {R}{R}{R}: Return Skarrgan Firebird from your graveyard to your hand. Activate this ability only if an opponent was dealt damage this turn. + // {R}{R}{R}: Return Skarrgan Firebird from your graveyard to your hand. Activate this ability only if an opponent was dealt damage this turn. addCard(Zone.BATTLEFIELD, playerB, "Skarrgan Firebird"); addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); addCard(Zone.BATTLEFIELD, playerB, "Mountain", 3); - addCard(Zone.HAND, playerB, "Bone Splinters"); - + // As an additional cost to cast Bone Splinters, sacrifice a creature. // Destroy target creature. + addCard(Zone.HAND, playerB, "Bone Splinters"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Bone Splinters", "Pillarfield Ox"); setChoice(playerB, "Skarrgan Firebird"); - + attack(2, playerB, "Silvercoat Lion"); - + activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{R}{R}{R}: Return"); setStopAt(2, PhaseStep.END_TURN); - + execute(); assertPermanentCount(playerA, "Skarrgan Firebird", 0); @@ -79,40 +79,73 @@ public class ReturnToHandTest extends CardTestPlayerBase { @Test public void VeilbornGhoulTest1() { // Veilborn Ghoul can't block. - // Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand. + // Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand. addCard(Zone.GRAVEYARD, playerA, "Veilborn Ghoul"); addCard(Zone.HAND, playerA, "Swamp"); - + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Swamp"); setStopAt(1, PhaseStep.BEGIN_COMBAT); - + execute(); - assertPermanentCount(playerA, "Swamp", 1); + assertPermanentCount(playerA, "Swamp", 1); assertHandCount(playerA, "Veilborn Ghoul", 1); } + /** - * Return from graveyard to hand if you play a non swamp land but Urborg, Tomb of Yawgmoth is in play + * Return from graveyard to hand if you play a non swamp land but Urborg, + * Tomb of Yawgmoth is in play */ @Test public void VeilbornGhoulTest2() { // Veilborn Ghoul can't block. - // Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand. + // Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand. addCard(Zone.GRAVEYARD, playerA, "Veilborn Ghoul"); addCard(Zone.HAND, playerA, "Flood Plain"); - + // Each land is a Swamp in addition to its other land types. addCard(Zone.BATTLEFIELD, playerA, "Urborg, Tomb of Yawgmoth", 1); - + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flood Plain"); setStopAt(1, PhaseStep.BEGIN_COMBAT); - + execute(); - assertPermanentCount(playerA, "Flood Plain", 1); + assertPermanentCount(playerA, "Flood Plain", 1); assertHandCount(playerA, "Veilborn Ghoul", 1); - } - + } + + /** + * Return a spell from stack to Hand + */ + @Test + public void BrutalExpulsionTest() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 2); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + // Devoid + // Choose one or both + // - Return target spell or creature to its owner's hand; + // - Brutal Expulsion deals 2 damage to target creature or planeswalker. If that permanent would be put into a graveyard this turn, exile it instead. + addCard(Zone.HAND, playerA, "Brutal Expulsion"); // {2}{U}{R} + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 4); + addCard(Zone.HAND, playerB, "Pillarfield Ox", 1); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Pillarfield Ox"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerA, "Brutal Expulsion", "mode=1Pillarfield Ox^mode=2Silvercoat Lion", "Pillarfield Ox"); + setModeChoice(playerA, "1"); + setModeChoice(playerA, "2"); + setStopAt(2, PhaseStep.BEGIN_COMBAT); + + execute(); + + assertGraveyardCount(playerA, "Brutal Expulsion", 1); + assertExileCount("Silvercoat Lion", 1); + assertPermanentCount(playerB, "Pillarfield Ox", 0); + assertHandCount(playerB, "Pillarfield Ox", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/MasterBiomancerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/MasterBiomancerTest.java index ebea5c555aa..41fdc97851c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/MasterBiomancerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/MasterBiomancerTest.java @@ -9,23 +9,19 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - - public class MasterBiomancerTest extends CardTestPlayerBase { /* Master Biomancer {2}{G}{U} * Creature - Elf Wizard * 2/4 - * Each other creature you control enters the battlefield with a number of additional +1/+1 counters + * Each other creature you control enters the battlefield with a number of additional +1/+1 counters * on it equal to Master Biomancer's power and as a Mutant in addition to its other types. * */ - @Test public void testCreatureGetsCounters() { // a creature enters the battlefield and gets a counter for each point of power of Master Biomancer - addCard(Zone.BATTLEFIELD, playerA, "Island", 5); addCard(Zone.BATTLEFIELD, playerA, "Master Biomancer", 1); addCard(Zone.HAND, playerA, "Mindeye Drake"); @@ -52,12 +48,12 @@ public class MasterBiomancerTest extends CardTestPlayerBase { // a creature enters the battlefield and gets a counter for each point of power of Master Biomancer // doubled by Corpsejack Menace (when he ist cast, his own ability will not apply) // http://blogs.magicjudges.org/rulestips/2013/03/corpsejack-menace-and-master-biomancer/ - addCard(Zone.BATTLEFIELD, playerA, "Island", 2); addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); addCard(Zone.BATTLEFIELD, playerA, "Master Biomancer", 1); + // If one or more +1/+1 counters would be placed on a creature you control, twice that many +1/+1 counters are placed on it instead. addCard(Zone.HAND, playerA, "Corpsejack Menace"); addCard(Zone.HAND, playerA, "Mindeye Drake"); @@ -83,30 +79,28 @@ public class MasterBiomancerTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Mindeye Drake", 6, 9); } - /** - * Progenitor Mimic - * Creature - Shapeshifter - * 0/0 - * You may have Progenitor Mimic enter the battlefield as a copy of any creature on - * the battlefield except it gains "At the beginning of your upkeep, if this creature - * isn't a token, put a token onto the battlefield that's a copy of this creature." + * Progenitor Mimic Creature - Shapeshifter 0/0 You may have Progenitor + * Mimic enter the battlefield as a copy of any creature on the battlefield + * except it gains "At the beginning of your upkeep, if this creature isn't + * a token, put a token onto the battlefield that's a copy of this + * creature." * - * If Progenitor Mimic comes into play, it gets two +1/+1 counters from - * the Master Biomancer already in play. It copies the Master Biomancer and - * is therfore a 4/6 creature. - * The Token generated next round from Progenitor Mimic has to get 2 + 4 counters - * and is therefore a 8/10 creature. + * If Progenitor Mimic comes into play, it gets two +1/+1 counters from the + * Master Biomancer already in play. It copies the Master Biomancer and is + * therfore a 4/6 creature. The Token generated next round from Progenitor + * Mimic has to get 2 + 4 counters and is therefore a 8/10 creature. */ - @Test public void testWithProgenitorMimic() { // a creature enters the battlefield and gets a counter for each point of power of Master Biomancer - addCard(Zone.BATTLEFIELD, playerA, "Island", 3); addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); addCard(Zone.BATTLEFIELD, playerA, "Master Biomancer", 1); + // You may have Progenitor Mimic enter the battlefield as a copy of any creature on the battlefield + // except it gains "At the beginning of your upkeep, if this creature isn't a token, + // put a token onto the battlefield that's a copy of this creature." addCard(Zone.HAND, playerA, "Progenitor Mimic"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Progenitor Mimic"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ProteanHydraTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ProteanHydraTest.java index 6b3a7325312..4fd8c979fab 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ProteanHydraTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ProteanHydraTest.java @@ -16,7 +16,10 @@ public class ProteanHydraTest extends CardTestPlayerBase { @Test public void testEnteringWithCounters() { addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); - addCard(Zone.HAND, playerA, "Protean Hydra"); + // Protean Hydra enters the battlefield with X +1/+1 counters on it. + // If damage would be dealt to Protean Hydra, prevent that damage and remove that many +1/+1 counters from it. + // Whenever a +1/+1 counter is removed from Protean Hydra, put two +1/+1 counters on it at the beginning of the next end step. + addCard(Zone.HAND, playerA, "Protean Hydra"); // CREATURE - {X}{G} castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Protean Hydra"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/SearchEntersBattlefieldTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/SearchEntersBattlefieldTest.java new file mode 100644 index 00000000000..b097f3a7eef --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/SearchEntersBattlefieldTest.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.enters; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class SearchEntersBattlefieldTest extends CardTestPlayerBase { + + @Test + public void testLandAfterFetchUntapped() { + addCard(Zone.HAND, playerA, "Verdant Catacombs"); + addCard(Zone.LIBRARY, playerA, "Forest"); + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Verdant Catacombs"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}, Pay"); + setChoice(playerA, "Forest"); + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerA, "Verdant Catacombs", 1); + assertPermanentCount(playerA, "Forest", 1); + assertTapped("Forest", false); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ValakutTheMoltenPinnacleTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ValakutTheMoltenPinnacleTest.java index c29cd7a736b..141e9951328 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ValakutTheMoltenPinnacleTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/enters/ValakutTheMoltenPinnacleTest.java @@ -26,13 +26,10 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package org.mage.test.cards.abilities.enters; import mage.constants.PhaseStep; import mage.constants.Zone; -import mage.game.permanent.Permanent; -import org.junit.Assert; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -40,17 +37,15 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class ValakutTheMoltenPinnacleTest extends CardTestPlayerBase { /** - * Valakut, the Molten Pinnacle - * Land - * Valakut, the Molten Pinnacle enters the battlefield tapped. - * Whenever a Mountain enters the battlefield under your control, if you control at least five other Mountains, you may have Valakut, the Molten Pinnacle deal 3 damage to target creature or player. - * {T}: Add {R} to your mana pool. + * Valakut, the Molten Pinnacle Land Valakut, the Molten Pinnacle enters the + * battlefield tapped. Whenever a Mountain enters the battlefield under your + * control, if you control at least five other Mountains, you may have + * Valakut, the Molten Pinnacle deal 3 damage to target creature or player. + * {T}: Add {R} to your mana pool. */ - @Test public void onlyFourMountainsNoDamage() { @@ -85,13 +80,11 @@ public class ValakutTheMoltenPinnacleTest extends CardTestPlayerBase { assertLife(playerA, 20); assertLife(playerB, 17); - } - // Scapeshift {2}{G}{G} - // Sorcery - // Sacrifice any number of lands. Search your library for that many land cards, put them onto the battlefield tapped, then shuffle your library. - + // Scapeshift {2}{G}{G} + // Sorcery + // Sacrifice any number of lands. Search your library for that many land cards, put them onto the battlefield tapped, then shuffle your library. @Test public void sixEnterWithScapeshiftDamageToPlayerB() { @@ -113,7 +106,6 @@ public class ValakutTheMoltenPinnacleTest extends CardTestPlayerBase { assertLife(playerA, 20); assertLife(playerB, 2); // 6 * 3 damage = 18 - } @Test @@ -166,4 +158,36 @@ public class ValakutTheMoltenPinnacleTest extends CardTestPlayerBase { assertLife(playerB, 2); // 6 * 3 damage = 18 } + + /** + * Some lands aren't triggering Valakut, the Molten Pinnacle with Prismatic + * Omen and 6+ lands in play. So far I've noticed that Misty Rainforest and + * basic Island did not trigger Valakut, but an additional copy of Valakut + * did. + */ + @Test + public void withPrismaticOmen() { + // Valakut, the Molten Pinnacle enters the battlefield tapped. + // Whenever a Mountain enters the battlefield under your control, if you control at least five other Mountains, + // you may have Valakut, the Molten Pinnacle deal 3 damage to target creature or player. + // {T}: Add {R} to your mana pool. + addCard(Zone.BATTLEFIELD, playerA, "Valakut, the Molten Pinnacle"); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 4); + + addCard(Zone.HAND, playerA, "Forest", 1); + + // Lands you control are every basic land type in addition to their other types. + addCard(Zone.BATTLEFIELD, playerA, "Prismatic Omen"); + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest"); + addTarget(playerA, playerB); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 17); + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AwakenTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AwakenTest.java new file mode 100644 index 00000000000..e1692db1808 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/AwakenTest.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.keywords; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class AwakenTest extends CardTestPlayerBase { + + @Test + public void testCastWithAwaken() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 6); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + // Destroy target creature or planeswalker. + // Awaken 4-{5}{B}{B} + addCard(Zone.HAND, playerA, "Ruinous Path", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ruinous Path with awaken", "Silvercoat Lion"); + addTarget(playerA, "Plains"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPowerToughness(playerA, "Plains", 4, 4); + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BuybackTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BuybackTest.java new file mode 100644 index 00000000000..a3b73c7f6f7 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/BuybackTest.java @@ -0,0 +1,116 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.keywords; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class BuybackTest extends CardTestPlayerBase { + + /** + * Tests boosting on being blocked + */ + @Test + public void testNormal() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + // Buyback {4} (You may pay an additional as you cast this spell. If you do, put this card into your hand as it resolves.) + // Target creature gets +2/+2 until end of turn. + addCard(Zone.HAND, playerA, "Elvish Fury", 1); // Instant {G} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Elvish Fury", "Silvercoat Lion"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPowerToughness(playerA, "Silvercoat Lion", 4, 4); + assertHandCount(playerA, "Elvish Fury", 1); + } + + /** + * It seems that a spell with it's buyback cost paid returned to hand after + * it fizzled (by failing to target) when it should go to graveyard. + * + * "Q: If I pay a spell's buyback cost, but it fizzles, do I get the card + * back anyway? A: If you pay a buyback cost, you would get the card back + * during the spell's resolution. So if it never resolves (i.e., something + * counters it or it fizzles against all of its targets), you don't get the + * card back." + */ + @Test + public void testBuybackSpellFizzles() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + // Buyback {4} (You may pay an additional as you cast this spell. If you do, put this card into your hand as it resolves.) + // Target creature gets +2/+2 until end of turn. + addCard(Zone.HAND, playerA, "Elvish Fury", 1); // Instant {G} + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Zone.HAND, playerB, "Boomerang", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Elvish Fury", "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Boomerang", "Silvercoat Lion", "Elvish Fury"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Boomerang", 1); + assertHandCount(playerA, "Silvercoat Lion", 1); + assertHandCount(playerA, "Elvish Fury", 0); + assertGraveyardCount(playerA, "Elvish Fury", 1); + } + + @Test + public void testBuybackSpellWasCountered() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + // Buyback {4} (You may pay an additional as you cast this spell. If you do, put this card into your hand as it resolves.) + // Target creature gets +2/+2 until end of turn. + addCard(Zone.HAND, playerA, "Elvish Fury", 1); // Instant {G} + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Zone.HAND, playerB, "Counterspell", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Elvish Fury", "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Counterspell", "Elvish Fury", "Elvish Fury"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Counterspell", 1); + assertPowerToughness(playerA, "Silvercoat Lion", 2, 2); + assertHandCount(playerA, "Elvish Fury", 0); + assertGraveyardCount(playerA, "Elvish Fury", 1); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ConspireTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ConspireTest.java index eda72663473..a9ef3d1e769 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ConspireTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ConspireTest.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package org.mage.test.cards.abilities.keywords; import mage.constants.PhaseStep; @@ -40,31 +39,31 @@ import org.mage.test.serverside.base.CardTestPlayerBase; public class ConspireTest extends CardTestPlayerBase { /** - * 702.77. Conspire - * 702.77a Conspire is a keyword that represents two abilities. The first is a static ability that functions - * while the spell with conspire is on the stack. The second is a triggered ability that functions - * while the spell with conspire is on the stack. “Conspire” means “As an additional cost to cast - * this spell, you may tap two untapped creatures you control that each share a color with it” and - * “When you cast this spell, if its conspire cost was paid, copy it. If the spell has any targets, you - * may choose new targets for the copy.” Paying a spell’s conspire cost follows the rules for - * paying additional costs in rules 601.2b and 601.2e–g. - * - * 702.77b If a spell has multiple instances of conspire, each is paid separately and triggers based on - * its own payment, not any other instance of conspire - * - */ - - /** - * Burn Trail - * Sorcery, 3R (4) - * Burn Trail deals 3 damage to target creature or player. - * - * Conspire (As you cast this spell, you may tap two untapped creatures you - * control that share a color with it. When you do, copy it and you may - * choose a new target for the copy.) + * 702.77. Conspire 702.77a Conspire is a keyword that represents two + * abilities. The first is a static ability that functions while the spell + * with conspire is on the stack. The second is a triggered ability that + * functions while the spell with conspire is on the stack. “Conspire” means + * “As an additional cost to cast this spell, you may tap two untapped + * creatures you control that each share a color with it” and “When you cast + * this spell, if its conspire cost was paid, copy it. If the spell has any + * targets, you may choose new targets for the copy.” Paying a spell’s + * conspire cost follows the rules for paying additional costs in rules + * 601.2b and 601.2e–g. + * + * 702.77b If a spell has multiple instances of conspire, each is paid + * separately and triggers based on its own payment, not any other instance + * of conspire + * + */ + /** + * Burn Trail Sorcery, 3R (4) Burn Trail deals 3 damage to target creature + * or player. + * + * Conspire (As you cast this spell, you may tap two untapped creatures you + * control that share a color with it. When you do, copy it and you may + * choose a new target for the copy.) * */ - @Test public void testConspire() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); @@ -72,7 +71,6 @@ public class ConspireTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Raging Goblin"); addCard(Zone.HAND, playerA, "Burn Trail"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Burn Trail", playerB); setChoice(playerA, "Yes"); @@ -93,7 +91,6 @@ public class ConspireTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Raging Goblin"); addCard(Zone.HAND, playerA, "Burn Trail"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Burn Trail", playerB); setChoice(playerA, "No"); @@ -107,4 +104,50 @@ public class ConspireTest extends CardTestPlayerBase { } + @Test + public void testWortTheRaidmother() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 7); + // When Wort, the Raidmother enters the battlefield, put two 1/1 red and green Goblin Warrior creature tokens onto the battlefield. + // Each red or green instant or sorcery spell you cast has conspire. + // (As you cast the spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose new targets for the copy.) + addCard(Zone.HAND, playerA, "Wort, the Raidmother"); + addCard(Zone.HAND, playerA, "Lightning Bolt"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wort, the Raidmother");// {4}{R/G}{R/G} + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + setChoice(playerA, "Yes"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + assertPermanentCount(playerA, "Wort, the Raidmother", 1); + assertGraveyardCount(playerA, "Lightning Bolt", 1); + assertLife(playerB, 14); + + } + + @Test + public void testWortTheRaidmotherWithConspireSpell() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 10); + addCard(Zone.BATTLEFIELD, playerA, "Raging Goblin", 2); + // When Wort, the Raidmother enters the battlefield, put two 1/1 red and green Goblin Warrior creature tokens onto the battlefield. + // Each red or green instant or sorcery spell you cast has conspire. + // (As you cast the spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose new targets for the copy.) + addCard(Zone.HAND, playerA, "Wort, the Raidmother"); + addCard(Zone.HAND, playerA, "Burn Trail"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wort, the Raidmother"); // {4}{R/G}{R/G} + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Burn Trail", playerB); + setChoice(playerA, "Yes"); // use Conspire from Burn Trail itself + setChoice(playerA, "Yes"); // use Conspire gained from Wort, the Raidmother + + setStopAt(1, PhaseStep.END_TURN); + execute(); + assertPermanentCount(playerA, "Wort, the Raidmother", 1); + assertLife(playerB, 11); + assertLife(playerA, 20); + assertGraveyardCount(playerA, "Burn Trail", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/CyclingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/CyclingTest.java index e50598c40b4..472fada8fb9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/CyclingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/CyclingTest.java @@ -96,7 +96,7 @@ public class CyclingTest extends CardTestPlayerBase { addCard(Zone.GRAVEYARD, playerA, "Decree of Pain"); // Protection from black // Cycling {2} ({2}, Discard this card: Draw a card.) - addCard(Zone.BATTLEFIELD, playerB, "Disciple Of Grace"); + addCard(Zone.BATTLEFIELD, playerB, "Disciple of Grace"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cycling {3}{B}{B}"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Cycling {2}"); @@ -108,7 +108,7 @@ public class CyclingTest extends CardTestPlayerBase { assertHandCount(playerB, 0); assertGraveyardCount(playerA, "Decree of Pain", 1); - assertPermanentCount(playerB, "Disciple Of Grace", 1); + assertPermanentCount(playerB, "Disciple of Grace", 1); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeathtouchTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeathtouchTest.java index 1f9a2f19cfb..780399d3e8e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeathtouchTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DeathtouchTest.java @@ -86,7 +86,7 @@ public class DeathtouchTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Marath, Will of the Wild"); - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {2}", "Marath, Will of the Wild"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {2}", "Marath, Will of the Wild", "Marath, Will of the Wild", StackClause.WHILE_NOT_ON_STACK); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{X},Remove X +1/+1 counters from Marath", "Archangel of Thune"); setChoice(playerA, "X=3"); @@ -123,6 +123,9 @@ public class DeathtouchTest extends CardTestPlayerBase { */ addCard(Zone.HAND, playerA, "Marath, Will of the Wild", 1); + // Vigilance + // Other creatures you control get +2/+2. + // Creatures your opponents control get -2/-2. addCard(Zone.BATTLEFIELD, playerB, "Elesh Norn, Grand Cenobite"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Marath, Will of the Wild"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DethroneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DethroneTest.java new file mode 100644 index 00000000000..b43b59f298c --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DethroneTest.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.keywords; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.counters.CounterType; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class DethroneTest extends CardTestPlayerBase { + + @Test + public void testAddingOnceACounterForEqualLife() { + // Dethrone (Whenever this creature attacks the player with the most life or tied for most life, put a +1/+1 counter on it.)"; + // Other creatures you control have dethrone. + // Whenever a creature you control with a +1/+1 counter on it dies, return that card to the battlefield under your control at the beginning of the next end step. + addCard(Zone.BATTLEFIELD, playerA, "Marchesa, the Black Rose"); // 3/3 + + attack(1, playerA, "Marchesa, the Black Rose"); + + attack(3, playerA, "Marchesa, the Black Rose"); + + setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 12); // 4 + 4 + + assertCounterCount(playerA, "Marchesa, the Black Rose", CounterType.P1P1, 1); + assertPowerToughness(playerA, "Marchesa, the Black Rose", 4, 4); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/EvolveTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/EvolveTest.java index 3472d6e139f..f993b7a1339 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/EvolveTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/EvolveTest.java @@ -25,11 +25,11 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package org.mage.test.cards.abilities.keywords; import mage.constants.PhaseStep; import mage.constants.Zone; +import mage.filter.Filter; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -37,15 +37,12 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - - public class EvolveTest extends CardTestPlayerBase { @Test public void testCreatureComesIntoPlay() { // Cloudfin Raptor gets one +1/+1 because Mindeye Drake comes into play - addCard(Zone.BATTLEFIELD, playerA, "Island", 5); addCard(Zone.BATTLEFIELD, playerA, "Cloudfin Raptor", 1); @@ -70,7 +67,6 @@ public class EvolveTest extends CardTestPlayerBase { public void testCreatureComesIntoPlayNoCounter() { // Experiment One gets no counter because Kird Ape is 1/1 with no Forest in play - addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); addCard(Zone.BATTLEFIELD, playerA, "Experiment One", 1); @@ -95,7 +91,6 @@ public class EvolveTest extends CardTestPlayerBase { public void testCreatureComesStrongerIntoPlayCounter() { // Experiment One gets a counter because Kird Ape is 2/2 with a Forest in play - addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Experiment One", 1); @@ -121,7 +116,6 @@ public class EvolveTest extends CardTestPlayerBase { public void testEvolveWithMasterBiomance() { // Experiment One gets a counter because Kird Ape is 2/2 with a Forest in play - addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Experiment One", 1); addCard(Zone.BATTLEFIELD, playerA, "Master Biomancer", 1); @@ -145,20 +139,18 @@ public class EvolveTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Experiment One", 3, 3); } - + @Test public void testMultipleCreaturesComeIntoPlay() { // Cloudfin Raptor gets one +1/+1 because itself and other creatur return from exile - addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6); addCard(Zone.BATTLEFIELD, playerA, "Judge's Familiar", 1); addCard(Zone.BATTLEFIELD, playerA, "Cloudfin Raptor", 1); addCard(Zone.HAND, playerA, "Mizzium Mortars", 1); - + addCard(Zone.BATTLEFIELD, playerB, "Plains", 6); addCard(Zone.HAND, playerB, "Banisher Priest", 2); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Banisher Priest"); addTarget(playerB, "Cloudfin Raptor"); @@ -174,7 +166,7 @@ public class EvolveTest extends CardTestPlayerBase { assertLife(playerB, 20); assertPermanentCount(playerB, "Banisher Priest", 0); - + assertGraveyardCount(playerB, 2); assertGraveyardCount(playerA, 1); @@ -182,26 +174,22 @@ public class EvolveTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Judge's Familiar", 1); assertPowerToughness(playerA, "Cloudfin Raptor", 1, 2); - - - } - + + } + @Test public void testMultipleCreaturesComeIntoPlaySuddenDisappearance() { // Sudden Disappearance // Sorcery {5}{W} - // Exile all nonland permanents target player controls. Return the exiled cards + // Exile all nonland permanents target player controls. Return the exiled cards // to the battlefield under their owner's control at the beginning of the next end step. - // Battering Krasis (2/1) and Crocanura (1/3) get both a +1/+1 counter each other because they come into play at the same time - addCard(Zone.BATTLEFIELD, playerA, "Battering Krasis", 1); addCard(Zone.BATTLEFIELD, playerA, "Crocanura", 1); - + addCard(Zone.BATTLEFIELD, playerB, "Plains", 6); addCard(Zone.HAND, playerB, "Sudden Disappearance", 2); - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Sudden Disappearance", playerA); @@ -210,7 +198,7 @@ public class EvolveTest extends CardTestPlayerBase { assertLife(playerA, 20); assertLife(playerB, 20); - + assertGraveyardCount(playerB, 1); assertGraveyardCount(playerA, 0); @@ -219,9 +207,64 @@ public class EvolveTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Battering Krasis", 3, 2); assertPowerToughness(playerA, "Crocanura", 2, 4); - - - } - - + + } + + /* + * Renegade Krasis's ability when trigger it evolves is not triggered under + * case. + * + * I control Renegade Krasis and two Ivy Lane Denizen. (Renegade Krasis and + * one of Ivy Lane Denizen have a +1/+1 counter on it) + * I cast Adaptive Snapjaw. + * When it resolves, there are three abilities on going to stack, + * Renegade Krasis's Evolve Ability, two Ivy Lane Denizen ability. + * I take two Ivy Lane Denizen on to the stack and then Renegade Krasis's Evolve + * Ability, so resolving Renegade Krasis's Evolve Ability is first . (Maybe + * Ivy Lane Denizen's target is any.) When Renegade Krasis's Evolve Ability + * resolves, +1/+1 counter is placed on it, but doesn't triggers Renegade + * Krasis's second ability. + */ + @Test + public void testRenegadeKrasis() { + + // Evolve (Whenever a creature enters the battlefield under your control, if that creature has greater power or toughness + // than this creature, put a +1/+1 counter on this creature.) + // Whenever Renegade Krasis evolves, put a +1/+1 counter on each other creature you control with a +1/+1 counter on it. + addCard(Zone.HAND, playerA, "Renegade Krasis", 1); // {1}{G}{G} - 3/2 + // Whenever another green creature enters the battlefield under your control, put a +1/+1 counter on target creature. + addCard(Zone.BATTLEFIELD, playerA, "Forest", 16); + + // Whenever another green creature enters the battlefield under your control, put a +1/+1 counter on target creature. + addCard(Zone.HAND, playerA, "Ivy Lane Denizen", 2); // {3}{G} - Creature 2/3 + // Evolve + addCard(Zone.HAND, playerA, "Adaptive Snapjaw", 1); // {4}{G} - Creature 6/2 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ivy Lane Denizen"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Renegade Krasis"); + addTarget(playerA, "Ivy Lane Denizen"); // Ivy target + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ivy Lane Denizen"); // Renegade Krasis evolves + addTarget(playerA, "Renegade Krasis"); // Ivy target + setChoice(playerA, "Whenever another green creature"); // So +1/+1 counter from Renegade is first put onto Ivy + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Adaptive Snapjaw"); + addTarget(playerA, "Adaptive Snapjaw"); // From Ivy 1 + addTarget(playerA, "Adaptive Snapjaw"); // From Ivy 2 + setChoice(playerA, "Evolve"); // Evolve of Renegade Krasis first on the stack, so Adaptive Snapjaw gets +1/+1 from Renegade Krasis ability + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Renegade Krasis", 1); + assertPermanentCount(playerA, "Ivy Lane Denizen", 2); + assertPermanentCount(playerA, "Adaptive Snapjaw", 1); + + assertPowerToughness(playerA, "Adaptive Snapjaw", 9, 5); // +2 from Ivys + 1 From Renegade Krasis's Evolve + assertPowerToughness(playerA, "Renegade Krasis", 6, 5); // +1 Evolve by Ivy and +1 from Ivy as 2nd Ivy enters +1 Evolve by Snapjaw + assertPowerToughness(playerA, "Ivy Lane Denizen", 2, 3, Filter.ComparisonScope.Any); + assertPowerToughness(playerA, "Ivy Lane Denizen", 5, 6, Filter.ComparisonScope.Any); // +1 from Other Ivy + 2 from Krasis + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java index 52dff9e173a..7f0273567c6 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java @@ -49,76 +49,133 @@ public class FlashbackTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Island", 2); addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); addCard(Zone.HAND, playerA, "Snapcaster Mage", 1); - + // Destroy all artifacts and enchantments. You gain 2 life for each permanent destroyed this way. addCard(Zone.GRAVEYARD, playerA, "Fracturing Gust"); addCard(Zone.BATTLEFIELD, playerA, "Berserkers' Onslaught", 1); addCard(Zone.BATTLEFIELD, playerB, "Darksteel Citadel", 1); - // When Snapcaster Mage enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Snapcaster Mage"); setChoice(playerA, "Fracturing Gust"); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flashback {2}{G/W}{G/W}{G/W}"); // now snapcaster mage is died so -13/-13 - setStopAt(1, PhaseStep.END_TURN); execute(); assertPermanentCount(playerA, "Snapcaster Mage", 1); assertGraveyardCount(playerA, "Berserkers' Onslaught", 1); - + assertPermanentCount(playerB, "Darksteel Citadel", 1); - + assertExileCount("Fracturing Gust", 1); } /** * My opponent put Iona on the battlefield using Unburial Rites, but my game * log didn't show me the color he has chosen. - * + * */ @Test public void testUnburialRites() { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); addCard(Zone.BATTLEFIELD, playerA, "Plains", 8); // Return target creature card from your graveyard to the battlefield. - // Flashback {3}{W} + // Flashback {3}{W} addCard(Zone.HAND, playerA, "Unburial Rites", 1); // Sorcery - {4}{B} - + // Flying // As Iona, Shield of Emeria enters the battlefield, choose a color. // Your opponents can't cast spells of the chosen color. addCard(Zone.GRAVEYARD, playerA, "Iona, Shield of Emeria"); - + // As Lurebound Scarecrow enters the battlefield, choose a color. - // When you control no permanents of the chosen color, sacrifice Lurebound Scarecrow. + // When you control no permanents of the chosen color, sacrifice Lurebound Scarecrow. addCard(Zone.GRAVEYARD, playerA, "Lurebound Scarecrow"); // Enchantment - {2}{U} addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); - addCard(Zone.HAND, playerB, "Lightning Bolt", 1); + addCard(Zone.HAND, playerB, "Lightning Bolt", 1); - - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Unburial Rites", "Iona, Shield of Emeria"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Unburial Rites", "Iona, Shield of Emeria"); setChoice(playerA, "Red"); - activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flashback {3}{W}"); + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flashback {3}{W}"); addTarget(playerA, "Lurebound Scarecrow"); setChoice(playerA, "White"); - - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); setStopAt(1, PhaseStep.END_TURN); execute(); assertPermanentCount(playerA, "Iona, Shield of Emeria", 1); assertPermanentCount(playerA, "Lurebound Scarecrow", 1); - + assertHandCount(playerB, "Lightning Bolt", 1); - + assertExileCount("Unburial Rites", 1); } - + + /** + * + */ + @Test + public void testFlashbackWithConverge() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + addCard(Zone.HAND, playerA, "Snapcaster Mage", 1); + + // Converge - Put a 1/1 white Kor Ally creature token onto the battlefield for each color of mana spent to cast Unified Front. + addCard(Zone.GRAVEYARD, playerA, "Unified Front"); // {3}{W} + + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {W}"); + // When Snapcaster Mage enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost. + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Snapcaster Mage"); + setChoice(playerA, "Unified Front"); + + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flashback {3}{W}"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, "Snapcaster Mage", 1); + assertPermanentCount(playerA, "Kor Ally", 4); + assertExileCount("Unified Front", 1); + + } + + /** + * Conflagrate flashback no longer works. Requires mana payment but never + * allows target selection before resolving. + */ + @Test + public void testConflagrate() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 7); + + // Conflagrate deals X damage divided as you choose among any number of target creatures and/or players. + // Flashback-{R}{R}, Discard X cards. + addCard(Zone.HAND, playerA, "Conflagrate", 1); + + addCard(Zone.HAND, playerA, "Forest", 4); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Conflagrate"); + setChoice(playerA, "X=2"); + + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flashback"); + setChoice(playerA, "X=4"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 14); + + assertExileCount("Conflagrate", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/HeroicTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/HeroicTest.java index 9ba14bc6326..e1b4b6739d7 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/HeroicTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/HeroicTest.java @@ -36,30 +36,29 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class HeroicTest extends CardTestPlayerBase { /** - * When casting Dromoka's Command targeting two of my own Heroic creatures, only one of them triggers. - * It appears to be the one targeted with mode 4 (fight) rather than the one targeted with mode 3 (+1/+1 counter). + * When casting Dromoka's Command targeting two of my own Heroic creatures, + * only one of them triggers. It appears to be the one targeted with mode 4 + * (fight) rather than the one targeted with mode 3 (+1/+1 counter). * Screenshot attached. Reproducible. */ - @Test public void testHeroicWithModal() { // Heroic - Whenever you cast a spell that targets Favored Hoplite, put a +1/+1 counter on Favored Hoplite and prevent all damage that would be dealt to it this turn. addCard(Zone.BATTLEFIELD, playerA, "Favored Hoplite", 1); // 1/2 // Heroic — Whenever you cast a spell that targets Lagonna-Band Trailblazer, put a +1/+1 counter on Lagonna-Band Trailblazer. addCard(Zone.BATTLEFIELD, playerA, "Lagonna-Band Trailblazer"); // 0/4 - + // Mode 3 = Put a +1/+1 counter on target creature // Mode 4 = Target creature you control fights target creature you don't control addCard(Zone.HAND, playerA, "Dromoka's Command", 1); // {G}{W} addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); - addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); - + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dromoka's Command", "mode=3Lagonna-Band Trailblazer^mode=4Favored Hoplite^Silvercoat Lion"); // Silvercoat lion will be set by AI as only possible target setModeChoice(playerA, "3"); @@ -69,11 +68,11 @@ public class HeroicTest extends CardTestPlayerBase { execute(); assertGraveyardCount(playerA, "Dromoka's Command", 1); - + assertPowerToughness(playerA, "Favored Hoplite", 2, 3); assertGraveyardCount(playerB, "Silvercoat Lion", 1); assertPowerToughness(playerA, "Lagonna-Band Trailblazer", 2, 6); - + } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java index 4b8729e65f1..c404d825452 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java @@ -27,6 +27,7 @@ */ package org.mage.test.cards.abilities.keywords; +import mage.abilities.keyword.InfectAbility; import mage.constants.PhaseStep; import mage.constants.Zone; import mage.counters.CounterType; @@ -37,21 +38,23 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class InfectTest extends CardTestPlayerBase { /** - - 702.89. Infect - 702.89a Infect is a static ability. - 702.89b Damage dealt to a player by a source with infect doesn’t cause that player to lose life. Rather, it causes the player to get that many poison counters. See rule 119.3. - 702.89c Damage dealt to a creature by a source with infect isn’t marked on that creature. Rather, it causes that many -1/-1 counters to be put on that creature. See rule 119.3. - 702.89d If a permanent leaves the battlefield before an effect causes it to deal damage, its last known information is used to determine whether it had infect. - 702.89e The infect rules function no matter what zone an object with infect deals damage from. - 702.89f Multiple instances of infect on the same object are redundant. - + * + * 702.89. Infect 702.89a Infect is a static ability. 702.89b Damage dealt + * to a player by a source with infect doesn’t cause that player to lose + * life. Rather, it causes the player to get that many poison counters. See + * rule 119.3. 702.89c Damage dealt to a creature by a source with infect + * isn’t marked on that creature. Rather, it causes that many -1/-1 counters + * to be put on that creature. See rule 119.3. 702.89d If a permanent leaves + * the battlefield before an effect causes it to deal damage, its last known + * information is used to determine whether it had infect. 702.89e The + * infect rules function no matter what zone an object with infect deals + * damage from. 702.89f Multiple instances of infect on the same object are + * redundant. + * */ - @Test public void testNormalUse() { addCard(Zone.BATTLEFIELD, playerB, "Tine Shrike"); // 2/1 Infect @@ -64,16 +67,15 @@ public class InfectTest extends CardTestPlayerBase { assertCounterCount(playerA, CounterType.POISON, 2); assertLife(playerA, 20); - assertLife(playerB, 20); - + assertLife(playerB, 20); + } - @Test public void testLoseInfectUse() { - // Creatures your opponents control lose infect. - addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast"); - + // Creatures your opponents control lose infect. + addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast"); + addCard(Zone.BATTLEFIELD, playerB, "Tine Shrike"); // 2/1 Infect attack(2, playerB, "Tine Shrike"); @@ -84,23 +86,29 @@ public class InfectTest extends CardTestPlayerBase { assertCounterCount(playerA, CounterType.POISON, 0); assertLife(playerA, 18); - assertLife(playerB, 20); - - } - + assertLife(playerB, 20); + + } + /** - * Inkmoth Nexus has no effect it he attacks becaus it has infect but there are no counters added + * Inkmoth Nexus has no effect it he attacks becaus it has infect but there + * are no counters added * http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/296553-melira-sylvok-outcast-vs-inkmoth-nexus */ @Test public void testInkmothNexusLoseInfect() { - // Creatures your opponents control lose infect. - addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast"); - - addCard(Zone.BATTLEFIELD, playerB, "Plains", 1); - addCard(Zone.BATTLEFIELD, playerB, "Inkmoth Nexus"); + // Creatures your opponents control lose infect. + // Creatures you control can't have -1/-1 counters placed on them. + addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast"); + // Put a -1/-1 counter on target creature. When that creature dies this turn, its controller gets a poison counter. + addCard(Zone.HAND, playerA, "Virulent Wound"); // Instant {B} + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); - // {1}: Inkmoth Nexus becomes a 1/1 Blinkmoth artifact creature with flying and infect until end of turn. It's still a land. + addCard(Zone.BATTLEFIELD, playerB, "Plains", 1); + addCard(Zone.BATTLEFIELD, playerB, "Inkmoth Nexus"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Virulent Wound", "Melira, Sylvok Outcast"); + // {1}: Inkmoth Nexus becomes a 1/1 Blinkmoth artifact creature with flying and infect until end of turn. It's still a land. // (It deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.) activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}: {this} becomes"); attack(2, playerB, "Inkmoth Nexus"); @@ -108,13 +116,57 @@ public class InfectTest extends CardTestPlayerBase { setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); execute(); + assertGraveyardCount(playerA, "Virulent Wound", 1); + assertPowerToughness(playerA, "Melira, Sylvok Outcast", 2, 2); assertTapped("Plains", true); assertTapped("Inkmoth Nexus", true); assertCounterCount(playerA, CounterType.POISON, 0); assertLife(playerA, 20); - assertLife(playerB, 20); - - } - + assertLife(playerB, 20); + + } + + /** + * Phyrexian Obliterator is enchanted with Corrupted Conscience and Enslave + * + * on upkeep Phyrexian Obliterator does 1 damage to its owner but this + * damage was NOT infect damage and it should have been + */ + @Test + public void GainedInfectByEnchantment() { + // Trample + // Whenever a source deals damage to Phyrexian Obliterator, that source's controller sacrifices that many permanents. + addCard(Zone.BATTLEFIELD, playerB, "Phyrexian Obliterator"); + + // Enchant creature + // You control enchanted creature. + // Enchanted creature has infect. (It deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.) + addCard(Zone.HAND, playerA, "Corrupted Conscience"); // Enchantment {3}{U}{U} + // Enchant creature + // You control enchanted creature. + // At the beginning of your upkeep, enchanted creature deals 1 damage to its owner. + addCard(Zone.HAND, playerA, "Enslave"); // Enchantment {4}{B}{B} + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 9); + addCard(Zone.BATTLEFIELD, playerA, "Island", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Corrupted Conscience", "Phyrexian Obliterator"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Enslave", "Phyrexian Obliterator"); + + setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Phyrexian Obliterator", 1); + assertPermanentCount(playerA, "Corrupted Conscience", 1); + assertPermanentCount(playerA, "Enslave", 1); + + assertAbility(playerA, "Phyrexian Obliterator", InfectAbility.getInstance(), true); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertCounterCount(playerB, CounterType.POISON, 1); + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ManifestTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ManifestTest.java index f980b8be196..e3cfc186491 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ManifestTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/ManifestTest.java @@ -27,7 +27,6 @@ */ package org.mage.test.cards.abilities.keywords; - import mage.cards.Card; import mage.constants.PhaseStep; import mage.constants.Zone; @@ -39,7 +38,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class ManifestTest extends CardTestPlayerBase { /** @@ -73,7 +71,8 @@ public class ManifestTest extends CardTestPlayerBase { } /** - * If Doomwake Giant gets manifested, it's Constellation trigger may not trigger + * If Doomwake Giant gets manifested, it's Constellation trigger may not + * trigger */ @Test public void testETBTriggeredAbilities2() { @@ -103,8 +102,10 @@ public class ManifestTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Silvercoat Lion", 1); assertPowerToughness(playerB, "Silvercoat Lion", 2, 2); } + /** - * If Doomwake Giant gets manifested, it's Constellation trigger may not trigger + * If Doomwake Giant gets manifested, it's Constellation trigger may not + * trigger */ @Test public void testETBTriggeredAbilities3() { @@ -115,10 +116,10 @@ public class ManifestTest extends CardTestPlayerBase { // Constellation - When Doomwake Giant or another enchantment enters the battlefield // under your control, creatures your opponents control get -1/-1 until end of turn. addCard(Zone.LIBRARY, playerA, "Doomwake Giant"); - - addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox"); + + addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox"); addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); - + skipInitShuffling(); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Reality Shift", "Silvercoat Lion"); @@ -130,7 +131,7 @@ public class ManifestTest extends CardTestPlayerBase { assertLife(playerA, 20); assertLife(playerB, 20); assertGraveyardCount(playerB, "Reality Shift", 1); - assertExileCount("Silvercoat Lion" , 1); + assertExileCount("Silvercoat Lion", 1); // a facedown creature is on the battlefield assertPermanentCount(playerA, "", 1); assertPowerToughness(playerA, "", 2, 2); @@ -138,8 +139,10 @@ public class ManifestTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Pillarfield Ox", 1); assertPowerToughness(playerB, "Pillarfield Ox", 2, 4); } + /** - * If Doomwake Giant gets manifested, it's Constellation trigger may not trigger + * If Doomwake Giant gets manifested, it's Constellation trigger may not + * trigger */ @Test public void testNylea() { @@ -150,7 +153,7 @@ public class ManifestTest extends CardTestPlayerBase { // As long as your devotion to white is less than five, Nylea isn't a creature. // (Each {G} in the mana costs of permanents you control counts towards your devotion to green.) addCard(Zone.LIBRARY, playerA, "Nylea, God of the Hunt"); - + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); skipInitShuffling(); @@ -164,17 +167,17 @@ public class ManifestTest extends CardTestPlayerBase { assertLife(playerA, 20); assertLife(playerB, 20); assertGraveyardCount(playerB, "Reality Shift", 1); - assertExileCount("Silvercoat Lion" , 1); + assertExileCount("Silvercoat Lion", 1); // a facedown creature is on the battlefield assertPermanentCount(playerA, "", 1); assertPowerToughness(playerA, "", 2, 2); } - + /* - Had a Foundry Street Denizen and another creature out. - Opponent Reality Shift'ed the other creature, manifested card was a red creature. This pumped the foundry street denizen even though it shouldn't. - */ + Had a Foundry Street Denizen and another creature out. + Opponent Reality Shift'ed the other creature, manifested card was a red creature. This pumped the foundry street denizen even though it shouldn't. + */ @Test public void testColorOfManifestedCardDoesNotCount() { addCard(Zone.BATTLEFIELD, playerB, "Island", 2); @@ -184,7 +187,7 @@ public class ManifestTest extends CardTestPlayerBase { // Gore Swine {2}{R} // 4/1 addCard(Zone.LIBRARY, playerA, "Gore Swine"); - + // Whenever another red creature enters the battlefield under your control, Foundry Street Denizen gets +1/+0 until end of turn. addCard(Zone.BATTLEFIELD, playerA, "Foundry Street Denizen"); addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); @@ -200,16 +203,17 @@ public class ManifestTest extends CardTestPlayerBase { assertLife(playerA, 20); assertLife(playerB, 20); assertGraveyardCount(playerB, "Reality Shift", 1); - assertExileCount("Silvercoat Lion" , 1); + assertExileCount("Silvercoat Lion", 1); // a facedown creature is on the battlefield assertPermanentCount(playerA, "", 1); assertPowerToughness(playerA, "", 2, 2); assertPowerToughness(playerA, "Foundry Street Denizen", 1, 1); - } + } /* - I casted a Silence the Believers on a manifested card. It moved to the exile zone face-down. - */ + I casted a Silence the Believers on a manifested card. It moved to the exile zone face-down. + */ + @Test public void testCardGetsExiledFaceUp() { addCard(Zone.BATTLEFIELD, playerB, "Island", 2); @@ -224,7 +228,7 @@ public class ManifestTest extends CardTestPlayerBase { // Gore Swine {2}{R} // 4/1 addCard(Zone.LIBRARY, playerA, "Gore Swine"); - + // Whenever another red creature enters the battlefield under your control, Foundry Street Denizen gets +1/+0 until end of turn. addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); @@ -240,12 +244,12 @@ public class ManifestTest extends CardTestPlayerBase { assertLife(playerA, 20); assertLife(playerB, 20); assertGraveyardCount(playerB, "Reality Shift", 1); - assertExileCount("Silvercoat Lion" , 1); - assertExileCount("Gore Swine" , 1); + assertExileCount("Silvercoat Lion", 1); + assertExileCount("Gore Swine", 1); // no facedown creature is on the battlefield assertPermanentCount(playerA, "", 0); - - for (Card card :currentGame.getExile().getAllCards(currentGame)){ + + for (Card card : currentGame.getExile().getAllCards(currentGame)) { if (card.getName().equals("Gore Swine")) { Assert.assertTrue("Gore Swine may not be face down in exile", !card.isFaceDown(currentGame)); } @@ -255,7 +259,6 @@ public class ManifestTest extends CardTestPlayerBase { // Qarsi High Priest went to manifest Illusory Gains, // but it made me choose a target for gains, then enchanted the card to that creature. - @Test public void testManifestAura() { @@ -282,15 +285,13 @@ public class ManifestTest extends CardTestPlayerBase { assertGraveyardCount(playerB, "Illusory Gains", 0); assertGraveyardCount(playerB, "Silvercoat Lion", 1); - // a facedown creature is on the battlefield assertPermanentCount(playerB, "", 1); } - // Check if a Megamorph card is manifested and truned by their megamorph ability + // Check if a Megamorph card is manifested and turned face up by their megamorph ability // it gets the +1/+1 counter. - @Test public void testManifestMegamorph() { @@ -300,6 +301,8 @@ public class ManifestTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Qarsi High Priest", 1); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + // Reach (This creature can block creatures with flying.) + // Megamorph {5}{G} addCard(Zone.LIBRARY, playerB, "Aerie Bowmasters", 1); addCard(Zone.LIBRARY, playerB, "Mountain", 1); @@ -324,10 +327,11 @@ public class ManifestTest extends CardTestPlayerBase { assertPowerToughness(playerB, "Aerie Bowmasters", 4, 5); // 3/4 and the +1/+1 counter from Megamorph } - + /** - * When a Forest came manifested into play my Courser of Kruphix gained me a life. - * + * When a Forest came manifested into play my Courser of Kruphix gained me a + * life. + * */ @Test public void testManifestForest() { @@ -349,7 +353,6 @@ public class ManifestTest extends CardTestPlayerBase { activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}{B},{T}, Sacrifice another creature"); addTarget(playerB, "Silvercoat Lion"); - setStopAt(2, PhaseStep.END_TURN); execute(); @@ -361,41 +364,92 @@ public class ManifestTest extends CardTestPlayerBase { assertPermanentCount(playerB, "", 1); - } - - /** + } + + /** * Whisperwood Elemental - Its sacrifice ability doesn't work.. - * + * */ @Test public void testWhisperwoodElemental() { - addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); // Seismic Rupture deals 2 damage to each creature without flying. addCard(Zone.HAND, playerA, "Seismic Rupture", 1); - + // At the beginning of your end step, manifest the top card of your library. // Sacrifice Whisperwood Elemental: Until end of turn, face-up, nontoken creatures you control gain "When this creature dies, manifest the top card of your library." addCard(Zone.BATTLEFIELD, playerB, "Whisperwood Elemental", 1); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Sacrifice"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Seismic Rupture"); - + setStopAt(1, PhaseStep.END_TURN); execute(); // no life gain assertLife(playerA, 20); assertLife(playerB, 20); - + assertGraveyardCount(playerA, "Seismic Rupture", 1); assertGraveyardCount(playerB, "Whisperwood Elemental", 1); assertGraveyardCount(playerB, "Silvercoat Lion", 2); assertPermanentCount(playerB, "", 2); - } + } + + /** + * I sacrificed a manifested face-down Smothering Abomination to Nantuko + * Husk and it made me draw a card. + * + */ + @Test + public void testDiesTriggeredAbilitiesOfManifestedCreatures() { + + addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2); + + // Sacrifice a creature: Nantuko Husk gets +2/+2 until end of turn. + addCard(Zone.BATTLEFIELD, playerB, "Nantuko Husk", 1); + + // {1}{B}, {T}, Sacrifice another creature: Manifest the top card of your library. + addCard(Zone.BATTLEFIELD, playerB, "Qarsi High Priest", 1); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + + // Devoid + // Flying + // At the beginning of your upkeep, sacrifice a creature + // Whenever you sacrifice a creature, draw a card. + addCard(Zone.LIBRARY, playerB, "Mountain", 1); + addCard(Zone.LIBRARY, playerB, "Smothering Abomination", 1); + addCard(Zone.LIBRARY, playerB, "Mountain", 1); + + skipInitShuffling(); + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}{B},{T}, Sacrifice another creature"); + setChoice(playerB, "Silvercoat Lion"); + + activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Sacrifice a creature"); + setChoice(playerB, ""); + + setStopAt(2, PhaseStep.END_TURN); + execute(); + + // no life gain + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertPermanentCount(playerB, "Qarsi High Priest", 1); + assertPermanentCount(playerB, "Nantuko Husk", 1); + + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + assertGraveyardCount(playerB, "Smothering Abomination", 1); + + assertPowerToughness(playerB, "Nantuko Husk", 4, 4); + + assertHandCount(playerB, "Mountain", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java index 60991689d79..7b35f5ef6a2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java @@ -47,7 +47,7 @@ public class MorphTest extends CardTestPlayerBase { * */ @Test - public void testCastMoprhCreatureWithoutMorph() { + public void testCastMorphCreatureWithoutMorph() { /* Pine Walker Creature - Elemental @@ -612,4 +612,34 @@ public class MorphTest extends CardTestPlayerBase { assertPermanentCount(playerA, "", 1); } + + /** + * Linvala, Keep of Silence is preventing morph creatures from turning face + * up Turning face up is a special ability not an active ability. This + * should not be prevented by the loss of active abilities. + */ + @Test + public void testTurnFaceUpWithLinvala() { + addCard(Zone.HAND, playerA, "Pine Walker"); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); + + addCard(Zone.BATTLEFIELD, playerB, "Linvala, Keeper of Silence", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pine Walker"); + setChoice(playerA, "Yes"); // cast it face down as 2/2 creature + + attack(3, playerA, ""); + + activateAbility(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "{4}{G}: Turn this face-down permanent face up."); + setStopAt(3, PhaseStep.END_TURN); + execute(); + + assertLife(playerB, 18); + + assertPermanentCount(playerA, "", 0); + assertPermanentCount(playerA, "Pine Walker", 1); + assertPowerToughness(playerA, "Pine Walker", 5, 5); + assertTapped("Pine Walker", false); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PersistTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PersistTest.java index 5f2859f6c1a..85a451e4298 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PersistTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PersistTest.java @@ -3,7 +3,6 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ - package org.mage.test.cards.abilities.keywords; import mage.constants.PhaseStep; @@ -15,33 +14,32 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** - * 702.78. Persist - * 702.78a Persist is a triggered ability. "Persist" means "When this permanent is put into a graveyard - * from the battlefield, if it had no -1/-1 counters on it, return it to the battlefield under its - * owner's control with a -1/-1 counter on it." + * 702.78. Persist 702.78a Persist is a triggered ability. "Persist" means "When + * this permanent is put into a graveyard from the battlefield, if it had no + * -1/-1 counters on it, return it to the battlefield under its owner's control + * with a -1/-1 counter on it." * * @author LevelX2 */ - public class PersistTest extends CardTestPlayerBase { /** - * Tests Safehold Elite don't returns from Persist if already a -1/-1 counter - * was put on it from another source + * Tests Safehold Elite don't returns from Persist if already a -1/-1 + * counter was put on it from another source * */ @Test public void testUndyingdoesntTriggerWithMinusCounter() { - + // Safehold Elite 2/2 {1}{G/W} // Creature - Elf Scout - // + // // Persist addCard(Zone.BATTLEFIELD, playerA, "Safehold Elite"); // Put a -1/-1 counter on target creature. When that creature dies this turn, its controller gets a poison counter. - addCard(Zone.HAND, playerB, "Virulent Wound",1); - addCard(Zone.HAND, playerB, "Lightning Bolt",1); + addCard(Zone.HAND, playerB, "Virulent Wound", 1); + addCard(Zone.HAND, playerB, "Lightning Bolt", 1); addCard(Zone.BATTLEFIELD, playerB, "Swamp", 1); addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); @@ -58,9 +56,9 @@ public class PersistTest extends CardTestPlayerBase { Assert.assertEquals(1, playerA.getCounters().getCount(CounterType.POISON)); } - /** - * If a card with persist is removed from a graveyard before the persist ability resolves, persist will do nothing. + * If a card with persist is removed from a graveyard before the persist + * ability resolves, persist will do nothing. */ @Test public void testWontTriggerIfPersistCardIsRemovedFromGraveyard() { @@ -71,15 +69,15 @@ public class PersistTest extends CardTestPlayerBase { // Persist addCard(Zone.BATTLEFIELD, playerA, "Safehold Elite"); + addCard(Zone.HAND, playerB, "Lightning Bolt", 1); // Exile target card from a graveyard. You gain 3 life. - addCard(Zone.HAND, playerB, "Lightning Bolt",1); - addCard(Zone.HAND, playerB, "Shadowfeed",1); + addCard(Zone.HAND, playerB, "Shadowfeed", 1); addCard(Zone.BATTLEFIELD, playerB, "Swamp", 1); addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Safehold Elite"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Shadowfeed", "Safehold Elite","Persist (When this creature dies, if it had no -1/-1 counters on it, return it to the battlefield under its owner's control with a -1/-1 counter on it.)"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Shadowfeed", "Safehold Elite", "Persist (When this creature dies, if it had no -1/-1 counters on it, return it to the battlefield under its owner's control with a -1/-1 counter on it.)"); setStopAt(1, PhaseStep.END_TURN); execute(); @@ -103,11 +101,11 @@ public class PersistTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Kitchen Finks", 1); /** - * Deathtouch, lifelink - * When Wurmcoil Engine dies, put a 3/3 colorless Wurm artifact creature token with - * deathtouch and a 3/3 colorless Wurm artifact creature token with lifelink onto the battlefield. + * Deathtouch, lifelink When Wurmcoil Engine dies, put a 3/3 colorless + * Wurm artifact creature token with deathtouch and a 3/3 colorless Wurm + * artifact creature token with lifelink onto the battlefield. */ - addCard(Zone.BATTLEFIELD, playerB, "Wurmcoil Engine",1); + addCard(Zone.BATTLEFIELD, playerB, "Wurmcoil Engine", 1); attack(2, playerB, "Wurmcoil Engine"); block(2, playerA, "Kitchen Finks", "Wurmcoil Engine"); @@ -117,14 +115,13 @@ public class PersistTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Wurmcoil Engine", 1); assertPermanentCount(playerA, "Kitchen Finks", 1); - assertPowerToughness(playerA, "Kitchen Finks", 2,1); + assertPowerToughness(playerA, "Kitchen Finks", 2, 1); assertLife(playerA, 22); // Kitchen Finks +2 life assertLife(playerB, 26); // Wurmcoil Engine +6 ife } - @Test public void testInteractionWithToporOrb() { @@ -137,12 +134,12 @@ public class PersistTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Kitchen Finks", 2); /** - * Deathtouch, lifelink - * When Wurmcoil Engine dies, put a 3/3 colorless Wurm artifact creature token with - * deathtouch and a 3/3 colorless Wurm artifact creature token with lifelink onto the battlefield. + * Deathtouch, lifelink When Wurmcoil Engine dies, put a 3/3 colorless + * Wurm artifact creature token with deathtouch and a 3/3 colorless Wurm + * artifact creature token with lifelink onto the battlefield. */ - addCard(Zone.BATTLEFIELD, playerB, "Wurmcoil Engine",1); - addCard(Zone.BATTLEFIELD, playerB, "Torpor Orb",1); + addCard(Zone.BATTLEFIELD, playerB, "Wurmcoil Engine", 1); + addCard(Zone.BATTLEFIELD, playerB, "Torpor Orb", 1); attack(2, playerB, "Wurmcoil Engine"); block(2, playerA, "Kitchen Finks", "Wurmcoil Engine"); @@ -161,9 +158,73 @@ public class PersistTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Wurm", 2); assertPermanentCount(playerA, "Kitchen Finks", 2); assertPowerToughness(playerA, "Kitchen Finks", 2, 1, Filter.ComparisonScope.All); - + } + /** + * Situation: Clever Impersonator is copying ". Opponent casts Supreme + * Verdict. Persist on the clone of Glen Elendra Archmage triggers and goes + * on the stack, and I am asked to put triggers on the stack. Problem: No + * options pop up. I tried pressing many buttons, but the game was + * deadlocked. + */ + @Test + public void testCopiedCreatureWithPersists() { - // some tests were moved to LastKnownInformationTest + // Flying + // {U}, Sacrifice Glen Elendra Archmage: Counter target noncreature spell. + // Persist + addCard(Zone.BATTLEFIELD, playerB, "Glen Elendra Archmage", 1); // 2/2 + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + // Supreme Verdict can't be countered. + // Destroy all creatures. + addCard(Zone.HAND, playerB, "Supreme Verdict", 1); // {1}{W}{W}{U} + + // You may have Clever Impersonator enter the battlefield as a copy of any nonland permanent on the battlefield. + addCard(Zone.HAND, playerA, "Clever Impersonator", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clever Impersonator"); + setChoice(playerA, "Glen Elendra Archmage"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Supreme Verdict"); + + setStopAt(2, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerB, "Glen Elendra Archmage", 1); + assertPowerToughness(playerB, "Glen Elendra Archmage", 1, 1); + assertGraveyardCount(playerA, "Clever Impersonator", 1); + } + + @Test + public void testMeliraSylvokOutcast() { + + // You can't get poison counters. + // Creatures you control can't have -1/-1 counters placed on them. + // Creatures your opponents control lose infect. + addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast", 1); // 2/2 + // When Murderous Redcap enters the battlefield, it deals damage equal to its power to target creature or player. + // Persist + addCard(Zone.HAND, playerA, "Murderous Redcap", 1); // 2/2 + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); + addCard(Zone.HAND, playerB, "Lightning Bolt", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Murderous Redcap"); + addTarget(playerA, "Silvercoat Lion"); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Murderous Redcap"); + addTarget(playerA, "Silvercoat Lion"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerB, "Lightning Bolt", 1); + assertGraveyardCount(playerB, "Silvercoat Lion", 2); + assertPowerToughness(playerA, "Murderous Redcap", 2, 2); // Got no -1/-1 after returning because of Melira in play + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PhasingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PhasingTest.java index 53027c46f22..77bd021e04b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PhasingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PhasingTest.java @@ -36,27 +36,25 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class PhasingTest extends CardTestPlayerBase { - - /** - * Test that abilities of phased out cards do not trigger or apply their effects + * Test that abilities of phased out cards do not trigger or apply their + * effects */ @Test public void TestAbilitiesOfPhasedOutAreNotApplied() { addCard(Zone.BATTLEFIELD, playerA, "Island", 3); - // At the beginning of each player's upkeep, that player chooses artifact, creature, land, or non-Aura enchantment. - // All nontoken permanents of that type phase out. + // At the beginning of each player's upkeep, that player chooses artifact, creature, land, or non-Aura enchantment. + // All nontoken permanents of that type phase out. addCard(Zone.HAND, playerA, "Teferi's Realm", 1); - + addCard(Zone.BATTLEFIELD, playerB, "Crusade", 1); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Teferi's Realm"); - - setChoice(playerB, "Non-Aura enchantment"); + + setChoice(playerB, "Non-Aura enchantment"); setStopAt(2, PhaseStep.PRECOMBAT_MAIN); execute(); @@ -64,4 +62,60 @@ public class PhasingTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Silvercoat Lion", 1); assertPowerToughness(playerB, "Silvercoat Lion", 2, 2); } -} \ No newline at end of file + + /** + * I had Fireshrieker equipped to Taniwha. When Taniwha phased out, the + * Fireshrieker remained visible on the battlefield, appearing to be + * attached to a Coldsteel Heart. The Fireshrieker should have been phased + * out indirectly. + * + * 502.15i When a permanent phases out, any local enchantments or Equipment + * attached to that permanent phase out at the same time. This alternate way + * of phasing out is known as phasing out "indirectly." An enchantment or + * Equipment that phased out indirectly won't phase in by itself, but + * instead phases in along with the card it's attached to. + */ + @Test + public void TestIndirectPhasing() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + // Flying + // Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.) + // All nontoken permanents of that type phase out. + addCard(Zone.HAND, playerA, "Tolarian Drake", 1); + // Enchant creature + // {R}: Enchanted creature gets +1/+0 until end of turn. + addCard(Zone.HAND, playerA, "Firebreathing", 1); // {R} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tolarian Drake"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Tolarian Drake"); + + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Tolarian Drake", 0); + assertPermanentCount(playerA, "Firebreathing", 0); + } + + @Test + public void TestIndirectPhasingAgainPhasedIn() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + // Flying + // Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.) + // All nontoken permanents of that type phase out. + addCard(Zone.HAND, playerA, "Tolarian Drake", 1); + // Enchant creature + // {R}: Enchanted creature gets +1/+0 until end of turn. + addCard(Zone.HAND, playerA, "Firebreathing", 1); // {R} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tolarian Drake"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Tolarian Drake"); + + setStopAt(5, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Tolarian Drake", 1); + assertPermanentCount(playerA, "Firebreathing", 1); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SoulbondKeywordTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SoulbondKeywordTest.java index 4a7dc293243..1770b99e8cd 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SoulbondKeywordTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SoulbondKeywordTest.java @@ -88,14 +88,18 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { } /** - * Tests Soulbond effect disabling whenever Soulbond creature changes its controller + * Tests Soulbond effect disabling whenever Soulbond creature changes its + * controller */ @Test public void testChangeControllerForSoulbondCreature() { addCard(Zone.BATTLEFIELD, playerA, "Elite Vanguard"); + // Soulbond (You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.) + // As long as Trusted Forcemage is paired with another creature, each of those creatures gets +1/+1. addCard(Zone.HAND, playerA, "Trusted Forcemage"); addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); + // Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn. (It can attack and Tap this turn.) addCard(Zone.HAND, playerB, "Act of Treason"); addCard(Zone.BATTLEFIELD, playerB, "Mountain", 3); @@ -115,12 +119,15 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { } /** - * Tests Soulbond effect disabling when paired creture changes its controller + * Tests Soulbond effect disabling when paired creture changes its + * controller */ @Test public void testChangeControllerForAnotherCreature() { - addCard(Zone.BATTLEFIELD, playerA, "Elite Vanguard"); - addCard(Zone.HAND, playerA, "Trusted Forcemage"); + addCard(Zone.BATTLEFIELD, playerA, "Elite Vanguard"); // 2,1 + // Soulbond (You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.) + // As long as Trusted Forcemage is paired with another creature, each of those creatures gets +1/+1. + addCard(Zone.HAND, playerA, "Trusted Forcemage"); // 2/2 addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); addCard(Zone.HAND, playerB, "Act of Treason"); @@ -141,8 +148,8 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { } /** - * Tests Soulbond effect disabling when Soulbond creature changes its controller and then returns back. - * Effect should not be restored. + * Tests Soulbond effect disabling when Soulbond creature changes its + * controller and then returns back. Effect should not be restored. */ @Test public void testChangeControllerAndGettingBack() { @@ -166,7 +173,8 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { } /** - * Tests that stealing creature will allow to use Soulbond ability on controller's creature + * Tests that stealing creature will allow to use Soulbond ability on + * controller's creature */ @Test public void testSoulbondWorksOnControllerSide() { @@ -243,7 +251,8 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { } /** - * Tests that it is possible to animate land and pair it on next coming Soulbond creature + * Tests that it is possible to animate land and pair it on next coming + * Soulbond creature */ @Test public void testPairOnAnimatedLand() { @@ -263,7 +272,8 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { } /** - * Tests no effect whether land was animated after Soulbond creature has entered the battlefield + * Tests no effect whether land was animated after Soulbond creature has + * entered the battlefield */ @Test public void testPairOnPostAnimatedLand() { @@ -302,7 +312,8 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { } /** - * Tests that after loosing first pair it is possible to pair creature with another one + * Tests that after loosing first pair it is possible to pair creature with + * another one */ @Test public void testRebondOnNextCreature() { @@ -357,6 +368,8 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { public void testExileAndReturnBack() { addCard(Zone.HAND, playerA, "Elite Vanguard"); addCard(Zone.HAND, playerA, "Cloudshift"); + // Soulbond (You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.) + // As long as Trusted Forcemage is paired with another creature, each of those creatures gets +1/+1. addCard(Zone.BATTLEFIELD, playerA, "Trusted Forcemage"); addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); @@ -375,6 +388,6 @@ public class SoulbondKeywordTest extends CardTestPlayerBase { Permanent trustedForcemange = getPermanent("Trusted Forcemage", playerA.getId()); Permanent eliteVanguard = getPermanent("Elite Vanguard", playerA.getId()); Assert.assertEquals(trustedForcemange.getPairedCard(), null); - Assert.assertEquals(eliteVanguard.getPairedCard(),null); + Assert.assertEquals(eliteVanguard.getPairedCard(), null); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SpliceOnArcaneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SpliceOnArcaneTest.java index 6eff8eaae26..f67350c1d85 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SpliceOnArcaneTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SpliceOnArcaneTest.java @@ -38,70 +38,70 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class SpliceOnArcaneTest extends CardTestPlayerBase { /** - * Test that it works to cast Through the Breach - * by slicing it on an arcane spell + * Test that it works to cast Through the Breach by slicing it on an arcane + * spell * */ @Test public void testSpliceThroughTheBreach() { - + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5); // Sorcery - Arcane {R} // Lava Spike deals 3 damage to target player. - addCard(Zone.HAND, playerA, "Lava Spike",1); + addCard(Zone.HAND, playerA, "Lava Spike", 1); // You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step. // Splice onto Arcane {2}{R}{R} (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.) - addCard(Zone.HAND, playerA, "Through the Breach",1); - addCard(Zone.HAND, playerA, "Silvercoat Lion",1); + addCard(Zone.HAND, playerA, "Through the Breach", 1); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lava Spike", playerB); setChoice(playerA, "Silvercoat Lion"); - + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); assertLife(playerA, 20); assertLife(playerB, 17); - + assertGraveyardCount(playerA, "Lava Spike", 1); assertHandCount(playerA, "Through the Breach", 1); - assertPermanentCount(playerA, "Silvercoat Lion", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), true); Assert.assertEquals("All available mana has to be used", 0, playerA.getManaAvailable(currentGame).size()); } - + @Test - public void testSpliceTorrentOfStone() { - + public void testSpliceTorrentOfStone() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); // Sorcery - Arcane {R} // Lava Spike deals 3 damage to target player. - addCard(Zone.HAND, playerA, "Lava Spike",1); + addCard(Zone.HAND, playerA, "Lava Spike", 1); // Torrent of Stone deals 4 damage to target creature. - // Splice onto Arcane-Sacrifice two Mountains. (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.) - addCard(Zone.HAND, playerA, "Torrent of Stone",1); + // Splice onto Arcane-Sacrifice two Mountains. (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.) + addCard(Zone.HAND, playerA, "Torrent of Stone", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); - addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lava Spike", playerB); addTarget(playerA, "Silvercoat Lion"); - + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); assertLife(playerA, 20); assertLife(playerB, 17); - + assertGraveyardCount(playerA, "Lava Spike", 1); assertHandCount(playerA, "Torrent of Stone", 1); assertGraveyardCount(playerB, "Silvercoat Lion", 1); - assertPermanentCount(playerA, "Mountain", 0); + assertPermanentCount(playerA, "Mountain", 0); Assert.assertEquals("No more mana available", "[]", playerA.getManaAvailable(currentGame).toString()); - } + } + /** * Nourishing Shoal's interaction with Splicing Through the Breach is * bugged. You should still need to pay 2RR as an additional cost, which is @@ -111,34 +111,94 @@ public class SpliceOnArcaneTest extends CardTestPlayerBase { * powerful. */ @Test - public void testSpliceThroughTheBreach2() { + public void testSpliceThroughTheBreach2() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); // You may exile a green card with converted mana cost X from your hand rather than pay Nourishing Shoal's mana cost. // You gain X life. - addCard(Zone.HAND, playerA, "Nourishing Shoal",1); - addCard(Zone.HAND, playerA, "Giant Growth",1); + addCard(Zone.HAND, playerA, "Nourishing Shoal", 1); // {X}{G}{G} + addCard(Zone.HAND, playerA, "Giant Growth", 1); // You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step. // Splice onto Arcane {2}{R}{R} (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.) - addCard(Zone.HAND, playerA, "Through the Breach",1); - addCard(Zone.HAND, playerA, "Silvercoat Lion",1); + addCard(Zone.HAND, playerA, "Through the Breach", 1); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nourishing Shoal"); setChoice(playerA, "Yes"); setChoice(playerA, "Silvercoat Lion"); - + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); assertLife(playerA, 21); assertLife(playerB, 20); - + assertGraveyardCount(playerA, "Nourishing Shoal", 1); assertHandCount(playerA, "Through the Breach", 1); - assertPermanentCount(playerA, "Silvercoat Lion", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), true); - - Assert.assertEquals("All available mana has to be used","[]", playerA.getManaAvailable(currentGame).toString()); - } - - + + Assert.assertEquals("All available mana has to be used", "[]", playerA.getManaAvailable(currentGame).toString()); + } + + /** + * Cards involved: Nourishing Shoal, Goryo's Vengeance, Griselbrand, + * Terminate + * + * I actually noticed this bug on the 1.4.3 client, but I didn't see it in + * the change log for 1.4.4, so I assume it is still unknown. Also, it is a + * bit of a rules corner case and I haven't seen anyone else report it, so + * the players of this deck may actually not realize it's incorrect. + * + * The scenario was that I cast a Nourishing Shoal with a Goryo's Vengeance + * spliced to it targeting Griselbrand in my graveyard and exiling + * Worldspine Wurm. My opponent responded with a Snapcaster Mage, so to + * deprive him of his ability to reuse his counterspell, I cast the Goryo's + * Vengeance on the Griselbrand. This one resolved. He then used Terminate + * on the Griselbrand after I had activated it once. When the Shoal tried to + * resolve, it should have been countered due to no legal target. However, + * it caused me to gain 11 life. It did not resurrect Griselbrand + * (correctly), but it should have done nothing at all. + * + * I include the info about the Terminate because thinking through, it could + * be pertinent. I would guess what is going on here is one of two things. + * Either the client doesn't recognize the Shoal with a spliced Vengeance as + * a spell with a single target (because Shoal normally doesn't have a + * target) or because the Griselbrand ended up back in the graveyard before + * the Shoal tried to resolve, the client thought its target was still + * valid. I lean toward the former since the Shoal/Vengeance properly failed + * to resurrect the now dead again Griselbrand, so I don't think it was + * reading that as the target, but I'm not certain. I will try to reproduce + * the error against a bot and update this report. + */ + @Test + public void testCounteredBecauseOfNoLegalTarget() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 8); + // You may exile a green card with converted mana cost X from your hand rather than pay Nourishing Shoal's mana cost. + // You gain X life. + addCard(Zone.HAND, playerA, "Nourishing Shoal", 1); // "{X}{G}{G}" + // Return target legendary creature card from your graveyard to the battlefield. That creature gains haste. Exile it at the beginning of the next end step. + // Splice onto Arcane {2}{B} + addCard(Zone.HAND, playerA, "Goryo's Vengeance", 1); // {1}{B} + addCard(Zone.GRAVEYARD, playerA, "Griselbrand", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nourishing Shoal"); + setChoice(playerA, "X=3"); + setChoice(playerA, "Yes"); // splice + addTarget(playerA, "Griselbrand"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Goryo's Vengeance", "Griselbrand", "Nourishing Shoal"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Nourishing Shoal", 1); + assertGraveyardCount(playerA, "Goryo's Vengeance", 1); + assertPermanentCount(playerA, "Griselbrand", 1); + + assertLife(playerA, 20); // no life gain because Nourishing Shoal has to be countered having no legal targets (from Goryo's V.) + assertLife(playerB, 20); + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SuspendTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SuspendTest.java index 16de1ce5615..74779a13b96 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SuspendTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SuspendTest.java @@ -27,6 +27,7 @@ */ package org.mage.test.cards.abilities.keywords; +import mage.abilities.keyword.HasteAbility; import mage.constants.PhaseStep; import mage.constants.Zone; import mage.counters.CounterType; @@ -40,16 +41,18 @@ import org.mage.test.serverside.base.CardTestPlayerBase; public class SuspendTest extends CardTestPlayerBase { /** - * Tests Epochrasite works (give suspend to a exiled card) - * When Epochrasite dies, exile it with three time counters on it and it gains suspend. + * Tests Epochrasite works (give suspend to a exiled card) When Epochrasite + * dies, exile it with three time counters on it and it gains suspend. * */ @Test public void testEpochrasite() { - + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); - addCard(Zone.HAND, playerA, "Epochrasite",1); - addCard(Zone.HAND, playerB, "Lightning Bolt",1); + // Epochrasite enters the battlefield with three +1/+1 counters on it if you didn't cast it from your hand. + // When Epochrasite dies, exile it with three time counters on it and it gains suspend. + addCard(Zone.HAND, playerA, "Epochrasite", 1); + addCard(Zone.HAND, playerB, "Lightning Bolt", 1); addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Epochrasite"); @@ -61,11 +64,14 @@ public class SuspendTest extends CardTestPlayerBase { assertGraveyardCount(playerB, "Lightning Bolt", 1); assertPermanentCount(playerA, "Epochrasite", 1); // returned on turn 7 with 3 +1/+1 Counter assertPowerToughness(playerA, "Epochrasite", 4, 4); + assertAbility(playerA, "Epochrasite", HasteAbility.getInstance(), true); } + /** - * Tests Jhoira of the Ghitu works (give suspend to a exiled card) - * {2}, Exile a nonland card from your hand: Put four time counters on the exiled card. If it doesn't have suspend, it gains suspend. + * Tests Jhoira of the Ghitu works (give suspend to a exiled card) {2}, + * Exile a nonland card from your hand: Put four time counters on the exiled + * card. If it doesn't have suspend, it gains suspend. * */ @Test @@ -73,10 +79,10 @@ public class SuspendTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); - addCard(Zone.HAND, playerA, "Silvercoat Lion",1); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); addCard(Zone.BATTLEFIELD, playerA, "Jhoira of the Ghitu", 1); - activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},Exile a nonland card from your hand: Put four time counters on the exiled card. If it doesn't have suspend, it gains suspend (At the beginning of your upkeep, remove a time counter from that card. When the last is removed, cast it without paying its mana cost. If it's a creature, it has haste.)."); + activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},Exile a nonland card from your hand: Put four time counters on the exiled card. If it doesn't have suspend, it gains suspend"); setChoice(playerA, "Silvercoat Lion"); setStopAt(11, PhaseStep.PRECOMBAT_MAIN); @@ -85,11 +91,12 @@ public class SuspendTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Jhoira of the Ghitu", 1); assertHandCount(playerA, "Silvercoat Lion", 0); assertPermanentCount(playerA, "Silvercoat Lion", 1); - + } + /** - * Tests that a spell countered with delay goes to exile with 3 time counters - * and can be cast after the 3 counters are removed + * Tests that a spell countered with delay goes to exile with 3 time + * counters and can be cast after the 3 counters are removed * */ @Test @@ -97,13 +104,13 @@ public class SuspendTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); - addCard(Zone.HAND, playerA, "Silvercoat Lion",1); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); // Instant {1}{U} // Counter target spell. If the spell is countered this way, exile it with three time counters on it instead of putting it into its owner's graveyard. If it doesn't have suspend, it gains suspend. (At the beginning of its owner's upkeep, remove a counter from that card. When the last is removed, the player plays it without paying its mana cost. If it's a creature, it has haste.) - addCard(Zone.HAND, playerB, "Delay",1); + addCard(Zone.HAND, playerB, "Delay", 1); addCard(Zone.BATTLEFIELD, playerB, "Island", 2); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Delay", "Silvercoat Lion"); setChoice(playerA, "Silvercoat Lion"); @@ -113,20 +120,21 @@ public class SuspendTest extends CardTestPlayerBase { assertGraveyardCount(playerB, "Delay", 1); assertPermanentCount(playerA, "Silvercoat Lion", 1); - - } + + } + @Test public void testDeepSeaKraken() { addCard(Zone.BATTLEFIELD, playerA, "Island", 3); // Suspend 9-{2}{U} // Whenever an opponent casts a spell, if Deep-Sea Kraken is suspended, remove a time counter from it. - addCard(Zone.HAND, playerA, "Deep-Sea Kraken",1); + addCard(Zone.HAND, playerA, "Deep-Sea Kraken", 1); // Instant {1}{U} // Counter target spell. If the spell is countered this way, exile it with three time counters on it instead of putting it into its owner's graveyard. If it doesn't have suspend, it gains suspend. (At the beginning of its owner's upkeep, remove a counter from that card. When the last is removed, the player plays it without paying its mana cost. If it's a creature, it has haste.) - addCard(Zone.HAND, playerB, "Lightning Bolt",1); + addCard(Zone.HAND, playerB, "Lightning Bolt", 1); addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); - + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Suspend"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); @@ -135,8 +143,24 @@ public class SuspendTest extends CardTestPlayerBase { assertGraveyardCount(playerB, "Lightning Bolt", 1); assertExileCount("Deep-Sea Kraken", 1); - + assertCounterOnExiledCardCount("Deep-Sea Kraken", CounterType.TIME, 8); // -1 from spell of player B - - } + + } + + @Test + public void testAncestralVisionCantBeCastDirectly() { + // Suspend 4-{U} + // Target player draws three cards. + addCard(Zone.HAND, playerA, "Ancestral Vision", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ancestral Vision", playerA); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, 1); + assertHandCount(playerA, "Ancestral Vision", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java index 14e6c0db6a3..d37249116ca 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java @@ -44,23 +44,35 @@ public class TransformTest extends CardTestPlayerBase { addCard(Zone.LIBRARY, playerA, "Forest"); - addCard(Zone.BATTLEFIELD, playerA, "Forest", 6); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); // When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library. // Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control. addCard(Zone.HAND, playerA, "Nissa, Vastwood Seer"); + addCard(Zone.BATTLEFIELD, playerB, "Forest", 2); + // {G}{G}, Sacrifice Rootrunner: Put target land on top of its owner's library. + addCard(Zone.BATTLEFIELD, playerB, "Rootrunner"); // {2}{G}{G} + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nissa, Vastwood Seer"); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest"); - setStopAt(1, PhaseStep.BEGIN_COMBAT); + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "{G}{G}", "Swamp"); + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "+1: Reveal"); + + setStopAt(1, PhaseStep.END_TURN); execute(); - assertPermanentCount(playerA, "Forest", 7); + assertGraveyardCount(playerB, "Rootrunner", 1); assertPermanentCount(playerA, "Nissa, Vastwood Seer", 0); assertPermanentCount(playerA, "Nissa, Sage Animist", 1); - assertCounterCount("Nissa, Sage Animist", CounterType.LOYALTY, 3); + + assertCounterCount("Nissa, Sage Animist", CounterType.LOYALTY, 4); + assertPermanentCount(playerA, "Forest", 6); + assertPermanentCount(playerA, "Swamp", 1); + } @Test diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransmuteTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransmuteTest.java index 0720c51cbe1..7010f8e2603 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransmuteTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransmuteTest.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package org.mage.test.cards.abilities.keywords; import mage.constants.PhaseStep; @@ -35,30 +34,34 @@ import org.mage.test.serverside.base.CardTestPlayerBase; /** * - * 702.52. Transmute + * 702.52. Transmute * - * 702.52a Transmute is an activated ability that functions only while the card with transmute is - * in a player’s hand. “Transmute [cost]” means “[Cost], Discard this card: Search your library for - * a card with the same converted mana cost as the discarded card, reveal that card, and put it into - * your hand. Then shuffle your library. Play this ability only any time you could play a sorcery.” + * 702.52a Transmute is an activated ability that functions only while the card + * with transmute is in a player’s hand. “Transmute [cost]” means “[Cost], + * Discard this card: Search your library for a card with the same converted + * mana cost as the discarded card, reveal that card, and put it into your hand. + * Then shuffle your library. Play this ability only any time you could play a + * sorcery.” * - * 702.52b Although the transmute ability is playable only if the card is in a player’s hand, it - * continues to exist while the object is in play and in all other zones. Therefore objects with - * transmute will be affected by effects that depend on objects having one or more activated abilities. + * 702.52b Although the transmute ability is playable only if the card is in a + * player’s hand, it continues to exist while the object is in play and in all + * other zones. Therefore objects with transmute will be affected by effects + * that depend on objects having one or more activated abilities. * * @author LevelX2 */ - -public class TransmuteTest extends CardTestPlayerBase{ +public class TransmuteTest extends CardTestPlayerBase { @Test public void searchSimpleOneManaCmcSpell() { addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + // Target creature gets -3/-0 until end of turn. + // Transmute {1}{U}{U} addCard(Zone.HAND, playerA, "Dizzy Spell"); addCard(Zone.LIBRARY, playerA, "Lightning Bolt"); - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Transmute {1}{U}{U} ({1}{U}{U}, Discard this card: Search your library for a card with the same converted mana cost as this card, reveal it, and put it into your hand. Then shuffle your library. Transmute only as a sorcery.)"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Transmute {1}{U}{U}"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); @@ -74,7 +77,7 @@ public class TransmuteTest extends CardTestPlayerBase{ addCard(Zone.LIBRARY, playerA, "Wear // Tear"); - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Transmute {1}{U}{U} ({1}{U}{U}, Discard this card: Search your library for a card with the same converted mana cost as this card, reveal it, and put it into your hand. Then shuffle your library. Transmute only as a sorcery.)"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Transmute {1}{U}{U}"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); @@ -84,4 +87,4 @@ public class TransmuteTest extends CardTestPlayerBase{ assertHandCount(playerA, "Tear", 1); // Filter search can only search for one side of a split card } -} \ No newline at end of file +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java index eca34b84cd3..058b5e5bed1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java @@ -2,6 +2,7 @@ package org.mage.test.cards.abilities.keywords; import mage.constants.PhaseStep; import mage.constants.Zone; +import mage.counters.CounterType; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -11,7 +12,8 @@ import org.mage.test.serverside.base.CardTestPlayerBase; public class UndyingTest extends CardTestPlayerBase { /** - * Tests boost weren't be applied second time when creature back to battlefield + * Tests boost weren't be applied second time when creature back to + * battlefield */ @Test public void testWithBoost() { @@ -29,7 +31,8 @@ public class UndyingTest extends CardTestPlayerBase { } /** - * Tests boost weren't be applied second time when creature back to battlefield + * Tests boost weren't be applied second time when creature back to + * battlefield */ @Test public void testWithMassBoost() { @@ -62,7 +65,7 @@ public class UndyingTest extends CardTestPlayerBase { // Target creature gets -3/-3 until end of turn. addCard(Zone.HAND, playerA, "Last Gasp"); // Undying Evil - // Target creature gains undying until end of turn. + // Target creature gains undying until end of turn. // When it dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.) addCard(Zone.HAND, playerA, "Undying Evil"); @@ -76,9 +79,9 @@ public class UndyingTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Elite Vanguard", 3, 2); } - /** - * Tests "Threads of Disloyalty enchanting Strangleroot Geist: after geist died it returns to the bf under opponent's control." + * Tests "Threads of Disloyalty enchanting Strangleroot Geist: after geist + * died it returns to the bf under opponent's control." */ @Test public void testUndyingControlledReturnsToOwner() { @@ -105,18 +108,20 @@ public class UndyingTest extends CardTestPlayerBase { setStopAt(2, PhaseStep.END_TURN); execute(); - assertGraveyardCount(playerB, "Threads of Disloyalty", 1); - assertGraveyardCount(playerA, "Lightning Bolt",1); + assertGraveyardCount(playerB, "Threads of Disloyalty", 1); + assertGraveyardCount(playerA, "Lightning Bolt", 1); assertPermanentCount(playerB, "Strangleroot Geist", 0); assertPermanentCount(playerA, "Strangleroot Geist", 1); assertPowerToughness(playerA, "Strangleroot Geist", 3, 2); } /** - * Tests "Target creature with Undying will be exiled by Anafenza before it returns to battlefield - * - * Anafenza the foremost doesn't exile an undying creature when dying at the same time as - * that undying one. The undying comes back to the field when he shouldn't. + * Tests "Target creature with Undying will be exiled by Anafenza before it + * returns to battlefield + * + * Anafenza the foremost doesn't exile an undying creature when dying at the + * same time as that undying one. The undying comes back to the field when + * he shouldn't. */ @Test public void testReplacementEffectPreventsReturnOfUndying() { @@ -125,7 +130,7 @@ public class UndyingTest extends CardTestPlayerBase { // Creature - Zombie, 1/1 {1}{B} // Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.) addCard(Zone.HAND, playerA, "Butcher Ghoul"); - + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); addCard(Zone.HAND, playerB, "Lightning Bolt"); // Anafenza, the Foremost @@ -141,17 +146,18 @@ public class UndyingTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Anafenza, the Foremost", 1); assertGraveyardCount(playerB, "Lightning Bolt", 1); - + assertPermanentCount(playerA, "Butcher Ghoul", 0); assertExileCount("Butcher Ghoul", 1); } /** - * Tests "Target creature with Undying will be exiled by Anafenza before it returns to battlefield - * if both leave the battlefield at the same time + * Tests "Target creature with Undying will be exiled by Anafenza before it + * returns to battlefield if both leave the battlefield at the same time * - * Anafenza the foremost doesn't exile an undying creature when dying at the same time as - * that undying one. The undying comes back to the field when he shouldn't. + * Anafenza the foremost doesn't exile an undying creature when dying at the + * same time as that undying one. The undying comes back to the field when + * he shouldn't. */ @Test public void testReplacementEffectPreventsReturnOfUndyingWrath() { @@ -208,4 +214,34 @@ public class UndyingTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Silvercoat Lion", 4, 4); } + + /** + * Tatterkite is getting counters on it, i have him in a edh deck with + * Mikaeus, the Lunarch and when Tatterkite dies it triggers the undying and + * he gets the +1/+1 counters + */ + @Test + public void testUndyingMikaeusAndTatterkite() { + addCard(Zone.HAND, playerA, "Lightning Bolt", 1); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + // Whenever a Human deals damage to you, destroy it. + // Other non-Human creatures you control get +1/+1 and have undying. + addCard(Zone.BATTLEFIELD, playerA, "Mikaeus, the Unhallowed", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Tatterkite", 1); // Artifact Creature - Scarecrow 2/1 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Tatterkite"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Lightning Bolt", 1); + + assertPermanentCount(playerA, "Tatterkite", 1); + assertPermanentCount(playerA, "Mikaeus, the Unhallowed", 1); + assertCounterCount("Tatterkite", CounterType.P1P1, 1); + assertPowerToughness(playerA, "Tatterkite", 4, 3); + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java index ecd169b3272..599b9f7f0aa 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java @@ -36,7 +36,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class AddingCountersToPermanentsTest extends CardTestPlayerBase { @Test @@ -47,7 +46,7 @@ public class AddingCountersToPermanentsTest extends CardTestPlayerBase { // Put X -1/-1 counters on each creature. Shuffle Black Sun's Zenith into its owner's library. addCard(Zone.HAND, playerA, "Black Sun's Zenith", 1); - + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); addCard(Zone.BATTLEFIELD, playerB, "Witch's Familiar", 1); @@ -59,14 +58,13 @@ public class AddingCountersToPermanentsTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Silvercoat Lion", 1); assertGraveyardCount(playerB, "Silvercoat Lion", 1); - - assertPermanentCount(playerA, "Witch's Familiar", 1); + + assertPermanentCount(playerA, "Witch's Familiar", 1); assertPowerToughness(playerA, "Witch's Familiar", 0, 1); - assertPermanentCount(playerB, "Witch's Familiar", 1); + assertPermanentCount(playerB, "Witch's Familiar", 1); assertPowerToughness(playerB, "Witch's Familiar", 0, 1); - } -} \ No newline at end of file +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/MovingCounterTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/MovingCounterTest.java index 8e687a50e95..a1ef2b75ec5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/MovingCounterTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/MovingCounterTest.java @@ -36,7 +36,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class MovingCounterTest extends CardTestPlayerBase { /** @@ -51,12 +50,11 @@ public class MovingCounterTest extends CardTestPlayerBase { // Move any number of +1/+1 counters from target creature onto another target creature with the same controller. addCard(Zone.HAND, playerA, "Bioshift", 1); - - // Protean Hydra enters the battlefield with X +1/+1 counters on it. - // If damage would be dealt to Protean Hydra, prevent that damage and remove that many +1/+1 counters from it. - // Whenever a +1/+1 counter is removed from Protean Hydra, put two +1/+1 counters on it at the beginning of the next end step. - addCard(Zone.HAND, playerA, "Protean Hydra", 1); + // Protean Hydra enters the battlefield with X +1/+1 counters on it. + // If damage would be dealt to Protean Hydra, prevent that damage and remove that many +1/+1 counters from it. + // Whenever a +1/+1 counter is removed from Protean Hydra, put two +1/+1 counters on it at the beginning of the next end step. + addCard(Zone.HAND, playerA, "Protean Hydra", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Protean Hydra"); setChoice(playerA, "X=4"); @@ -67,14 +65,45 @@ public class MovingCounterTest extends CardTestPlayerBase { execute(); assertGraveyardCount(playerA, "Bioshift", 1); - - assertPermanentCount(playerA, "Silvercoat Lion", 1); + + assertPermanentCount(playerA, "Silvercoat Lion", 1); assertPowerToughness(playerA, "Silvercoat Lion", 4, 4); // added 2 counters - assertPermanentCount(playerA, "Protean Hydra", 1); + assertPermanentCount(playerA, "Protean Hydra", 1); assertPowerToughness(playerA, "Protean Hydra", 6, 6); // started with 4, removed 2, added 4 at end = 6 - } -} \ No newline at end of file + /** + * I'm having an issue when using Bioshift to move only a portion of + * counters to another creature. When I attempt to do this, it moves all of + * the counters (and in some cases with my Simic deck) kills the creature. + */ + @Test + public void testFateTransfer() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 4); + // Noxious Hatchling enters the battlefield with four -1/-1 counters on it. + // Wither (This deals damage to creatures in the form of -1/-1 counters.) + // Whenever you cast a black spell, remove a -1/-1 counter from Noxious Hatchling. + // Whenever you cast a green spell, remove a -1/-1 counter from Noxious Hatchling. + addCard(Zone.HAND, playerA, "Noxious Hatchling", 1);// 6/6 + addCard(Zone.BATTLEFIELD, playerA, "Ruin Processor", 1); // Creature 7/8 + + addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2); + // Move all counters from target creature onto another target creature. + addCard(Zone.HAND, playerB, "Fate Transfer", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Noxious Hatchling"); + castSpell(1, PhaseStep.BEGIN_COMBAT, playerB, "Fate Transfer", "Noxious Hatchling^Ruin Processor"); + + setStopAt(1, PhaseStep.END_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Fate Transfer", 1); + + assertPowerToughness(playerA, "Noxious Hatchling", 6, 6); + + assertPowerToughness(playerA, "Ruin Processor", 3, 4); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CrypticCommandTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CrypticCommandTest.java index 804af9f69de..5a8c29325c3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CrypticCommandTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CrypticCommandTest.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package org.mage.test.cards.abilities.oneshot.counterspell; import mage.constants.PhaseStep; @@ -34,17 +33,17 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** - * Cryptic Command - * Instant, 1UUU - * Choose two — Counter target spell; or return target permanent to its owner's hand; or tap all creatures your opponents control; or draw a card. + * Cryptic Command Instant, 1UUU Choose two — Counter target spell; or return + * target permanent to its owner's hand; or tap all creatures your opponents + * control; or draw a card. * * @author LevelX2 */ public class CrypticCommandTest extends CardTestPlayerBase { /** - * Test that if command has only one target and that targets is not valid on resolution, Cryptic Command fizzeles - * The player does not draw a card + * Test that if command has only one target and that targets is not valid on + * resolution, Cryptic Command fizzeles The player does not draw a card */ @Test public void testCommand() { @@ -54,16 +53,16 @@ public class CrypticCommandTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Remand"); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); addCard(Zone.BATTLEFIELD, playerA, "Island", 2); - + addCard(Zone.HAND, playerB, "Cryptic Command"); addCard(Zone.BATTLEFIELD, playerB, "Island", 4); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thoughtseize", playerB); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Cryptic Command", "Thoughtseize"); setModeChoice(playerB, "1"); // Counter target spell setModeChoice(playerB, "4"); // Draw a card - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Remand", "Thoughtseize", "Cast Cryptic Command"); setStopAt(1, PhaseStep.CLEANUP); @@ -78,14 +77,16 @@ public class CrypticCommandTest extends CardTestPlayerBase { assertGraveyardCount(playerB, 1); assertHandCount(playerA, 2); // Thoughtsize + card drawn from Remand assertHandCount(playerB, 0); // Because Cryptic Command has no legal target playerB does not draw a card and has 0 cards in hand - + } - /** - * Game is not letting me play Ricochet Trap targetting oponent's Cryptic Command, - * modes 1 and 4. It only has one target and should be allowed + + /** + * Game is not letting me play Ricochet Trap targetting oponent's Cryptic + * Command, modes 1 and 4. It only has one target and should be allowed */ @Test public void testCommandChangeTarget() { + // Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. You lose 2 life. addCard(Zone.HAND, playerA, "Thoughtseize"); // Counter target spell. If that spell is countered this way, put it into its owner's hand instead of into that player's graveyard. // Draw a card. @@ -93,19 +94,19 @@ public class CrypticCommandTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Lightning Bolt"); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5); - + addCard(Zone.HAND, playerB, "Cryptic Command"); addCard(Zone.BATTLEFIELD, playerB, "Island", 4); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thoughtseize", playerB); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Cryptic Command", "Thoughtseize"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Cryptic Command", "mode=1Thoughtseize", "Thoughtseize", StackClause.WHILE_ON_STACK); setModeChoice(playerB, "1"); // Counter target spell setModeChoice(playerB, "4"); // Draw a card - - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ricochet Trap", "Cryptic Command"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ricochet Trap", "Cryptic Command", "Cryptic Command", StackClause.WHILE_ON_STACK); addTarget(playerA, "Lightning Bolt"); - + setStopAt(1, PhaseStep.CLEANUP); execute(); @@ -118,6 +119,6 @@ public class CrypticCommandTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Lightning Bolt", 1); assertHandCount(playerB, 1); // card drawn from Cryptic Command - + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/DesertionTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/DesertionTest.java new file mode 100644 index 00000000000..ce8872c313d --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/DesertionTest.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.oneshot.counterspell; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class DesertionTest extends CardTestPlayerBase { + + /** + * I cast Kozilek, Butcher of Truth from my hand and my opponent cast + * Desertion targeting Kozilek, Butcher of Truth. Desertion resolved but + * Kozilek, Butcher of Truth has disappeared (not in play for my opponent as + * expected and not in my command zone or hand or graveyard or library) + * + */ + @Test + public void testCounterKozilek() { + // When you cast Kozilek, Butcher of Truth, draw four cards. + // Annihilator 4 (Whenever this creature attacks, defending player sacrifices four permanents.) + // When Kozilek is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library. + addCard(Zone.HAND, playerA, "Kozilek, Butcher of Truth"); // {10} + addCard(Zone.BATTLEFIELD, playerA, "Island", 10); + addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion"); // {10} + + // Counter target spell. If an artifact or creature spell is countered this way, put that card onto the battlefield under your control instead of into its owner's graveyard. + addCard(Zone.HAND, playerB, "Desertion"); // {3}{U}{U} + addCard(Zone.BATTLEFIELD, playerB, "Island", 5); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Kozilek, Butcher of Truth"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Desertion", "Kozilek, Butcher of Truth"); + + setStopAt(1, PhaseStep.CLEANUP); + execute(); + + assertGraveyardCount(playerB, "Desertion", 1); + + assertGraveyardCount(playerA, "Silvercoat Lion", 1); + assertGraveyardCount(playerA, "Kozilek, Butcher of Truth", 0); + assertHandCount(playerA, "Kozilek, Butcher of Truth", 0); + assertPermanentCount(playerB, "Kozilek, Butcher of Truth", 1); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/NotOfThisWorldTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/NotOfThisWorldTest.java index 41d3992a219..dbd08d14129 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/NotOfThisWorldTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/NotOfThisWorldTest.java @@ -63,6 +63,7 @@ public class NotOfThisWorldTest extends CardTestPlayerBase { setStopAt(2, PhaseStep.PRECOMBAT_MAIN); execute(); + assertHandCount(playerB, "Not of This World", 0); assertGraveyardCount(playerB, "Not of This World", 1); assertPermanentCount(playerB, "Ruhan of the Fomori", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/damage/JayaBallardTaskMageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/damage/JayaBallardTaskMageTest.java new file mode 100644 index 00000000000..809e42c861b --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/damage/JayaBallardTaskMageTest.java @@ -0,0 +1,122 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.oneshot.damage; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class JayaBallardTaskMageTest extends CardTestPlayerBase { + + @Test + public void testDamageNormal() { + // {R}, {tap}, Discard a card: Destroy target blue permanent. + // {1}{R}, {tap}, Discard a card: Jaya Ballard, Task Mage deals 3 damage to target creature or player. A creature dealt damage this way can't be regenerated this turn. + // {5}{R}{R}, {tap}, Discard a card: Jaya Ballard deals 6 damage to each creature and each player. + addCard(Zone.BATTLEFIELD, playerA, "Jaya Ballard, Task Mage"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 7); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{5}{R}{R}"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Jaya Ballard, Task Mage", 1); + assertGraveyardCount(playerA, "Silvercoat Lion", 1); + + assertGraveyardCount(playerB, "Pillarfield Ox", 1); + + assertLife(playerA, 14); + assertLife(playerB, 14); + } + + @Test + public void testDamageWithDeathPitsOfRath() { + // {R}, {tap}, Discard a card: Destroy target blue permanent. + // {1}{R}, {tap}, Discard a card: Jaya Ballard, Task Mage deals 3 damage to target creature or player. A creature dealt damage this way can't be regenerated this turn. + // {5}{R}{R}, {tap}, Discard a card: Jaya Ballard deals 6 damage to each creature and each player. + addCard(Zone.BATTLEFIELD, playerA, "Jaya Ballard, Task Mage"); + // Whenever a creature is dealt damage, destroy it. It can't be regenerated. + addCard(Zone.BATTLEFIELD, playerA, "Death Pits of Rath"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 7); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{5}{R}{R}"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Jaya Ballard, Task Mage", 1); + assertPermanentCount(playerA, "Death Pits of Rath", 1); + assertGraveyardCount(playerA, "Silvercoat Lion", 1); + + assertGraveyardCount(playerB, "Pillarfield Ox", 1); + + assertLife(playerA, 14); + assertLife(playerB, 14); + } + + @Test + public void testDamageWithRepercussion() { + // {R}, {tap}, Discard a card: Destroy target blue permanent. + // {1}{R}, {tap}, Discard a card: Jaya Ballard, Task Mage deals 3 damage to target creature or player. A creature dealt damage this way can't be regenerated this turn. + // {5}{R}{R}, {tap}, Discard a card: Jaya Ballard deals 6 damage to each creature and each player. + addCard(Zone.BATTLEFIELD, playerA, "Jaya Ballard, Task Mage"); + // Whenever a creature is dealt damage, Repercussion deals that much damage to that creature's controller. + addCard(Zone.BATTLEFIELD, playerA, "Repercussion"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 7); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 2); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{5}{R}{R}"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Jaya Ballard, Task Mage", 1); + assertPermanentCount(playerA, "Repercussion", 1); + assertGraveyardCount(playerA, "Silvercoat Lion", 1); + + assertGraveyardCount(playerB, "Pillarfield Ox", 2); + + assertLife(playerA, 8); + assertLife(playerB, 2); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/destroy/BoilTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/destroy/BoilTest.java new file mode 100644 index 00000000000..c7eabd0ac60 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/destroy/BoilTest.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.oneshot.destroy; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class BoilTest extends CardTestPlayerBase { + + @Test + public void testDestroy() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + addCard(Zone.BATTLEFIELD, playerA, "Breeding Pool"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + // Destroy all Islands. + addCard(Zone.HAND, playerA, "Boil"); // {3}{R} + + addCard(Zone.BATTLEFIELD, playerB, "Island", 1); + addCard(Zone.BATTLEFIELD, playerB, "Breeding Pool"); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boil"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Island", 0); + assertPermanentCount(playerA, "Breeding Pool", 0); + assertPermanentCount(playerA, "Mountain", 2); + + assertPermanentCount(playerB, "Island", 0); + assertPermanentCount(playerB, "Breeding Pool", 0); + assertPermanentCount(playerB, "Mountain", 2); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/CelestialPurgeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/CelestialPurgeTest.java new file mode 100644 index 00000000000..ba5ae1387d1 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/CelestialPurgeTest.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.oneshot.exile; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class CelestialPurgeTest extends CardTestPlayerBase { + + /** + * I activated Celestial Purge trying to targeting a Bitterblossom but i + * couldn't so please fix that bug + */ + @Test + public void testExileWorks() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + // Exile target black or red permanent. + addCard(Zone.HAND, playerA, "Celestial Purge"); + + // At the beginning of your upkeep, you lose 1 life and put a 1/1 black Faerie Rogue creature token with flying onto the battlefield. + addCard(Zone.BATTLEFIELD, playerB, "Bitterblossom"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerA, "Celestial Purge", "Bitterblossom"); + + setStopAt(2, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 19); + + assertGraveyardCount(playerA, "Celestial Purge", 1); + + assertExileCount("Bitterblossom", 1); + assertPermanentCount(playerB, "Faerie Rogue", 1); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/FiendHunterTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/FiendHunterTest.java new file mode 100644 index 00000000000..81a98e7ce54 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/FiendHunterTest.java @@ -0,0 +1,106 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.oneshot.exile; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class FiendHunterTest extends CardTestPlayerBase { + + /** + * + * + * Hi i rencently play against an opponent that when i did the bounce + * ability with Restoration Angel to Fiend hunter to Exile Primeval Titan + * the first primeval titan that i exiled didnt came back into play. + * + * Just to be sure i exile primeval titan the first time that fiend hunter + * came into play and i resto angel fiend hunter to exile another primeval + * titan Fiend hunter was on the battlefield for 4-6 rounds. When Fiend + * hunter is remove from the battlefield the exile ability is suppose lose + * his effect and the first Titan is suppose to come back. + */ + @Test + public void testExileWorks() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 3); + // When Fiend Hunter enters the battlefield, you may exile another target creature. + // When Fiend Hunter leaves the battlefield, return the exiled card to the battlefield under its owner's control. + addCard(Zone.HAND, playerA, "Fiend Hunter"); // Creature - Human Cleric 1/3 {1}{W}{W} + + // At the beginning of your upkeep, you lose 1 life and put a 1/1 black Faerie Rogue creature token with flying onto the battlefield. + addCard(Zone.BATTLEFIELD, playerB, "Primeval Titan"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Fiend Hunter"); + addTarget(playerA, "Primeval Titan"); + + setStopAt(2, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertExileCount("Primeval Titan", 1); + assertPermanentCount(playerA, "Fiend Hunter", 1); + + } + + @Test + public void testExileAndReturnWorks() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); + // When Fiend Hunter enters the battlefield, you may exile another target creature. + // When Fiend Hunter leaves the battlefield, return the exiled card to the battlefield under its owner's control. + addCard(Zone.HAND, playerA, "Fiend Hunter"); // Creature - Human Cleric 1/3 {1}{W}{W} + // When Restoration Angel enters the battlefield, you may exile target non-Angel creature you control, then return that card to the battlefield under your control + addCard(Zone.HAND, playerA, "Restoration Angel"); // Creature - Angel 3/4 {3}{W} + + // At the beginning of your upkeep, you lose 1 life and put a 1/1 black Faerie Rogue creature token with flying onto the battlefield. + addCard(Zone.BATTLEFIELD, playerB, "Primeval Titan"); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Fiend Hunter"); + addTarget(playerA, "Primeval Titan"); + + // When Restoration Angel enters the battlefield, you may exile target non-Angel creature you control, then return that card to the battlefield under your control + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Restoration Angel"); + addTarget(playerA, "Fiend Hunter"); + + setStopAt(4, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertExileCount("Silvercoat Lion", 1); + assertPermanentCount(playerB, "Primeval Titan", 1); + + assertPermanentCount(playerA, "Fiend Hunter", 1); + assertPermanentCount(playerA, "Restoration Angel", 1); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/OblivionSowerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/OblivionSowerTest.java new file mode 100644 index 00000000000..ae9c4982beb --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/exile/OblivionSowerTest.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.oneshot.exile; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class OblivionSowerTest extends CardTestPlayerBase { + + /** + * When putting lands into play from an opponent's exile zone using Oblivion + * Sower, the BFZ dual lands behave exactly the opposite way of how they + * should: if you control less than two basics, they enter the battlefield + * untapped, and if you control more, they enter tapped. + */ + @Test + public void testPlayLandsFromExile() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 6); + // When you cast Oblivion Sower, target opponent exiles the top four cards of his or her library, then you may put any number of land cards that player owns from exile onto the battlefield under your control. + addCard(Zone.HAND, playerA, "Oblivion Sower"); // Creature - 5/8 + + // Canopy Vista enters the battlefield tapped unless you control two or more basic lands. + addCard(Zone.LIBRARY, playerB, "Canopy Vista", 3); + addCard(Zone.LIBRARY, playerB, "Silvercoat Lion", 1); + skipInitShuffling(); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oblivion Sower"); + + addTarget(playerA, "Canopy Vista^Canopy Vista^Canopy Vista"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, "Oblivion Sower", 0); + assertPermanentCount(playerA, "Oblivion Sower", 1); + + assertExileCount("Silvercoat Lion", 1); + assertPermanentCount(playerA, "Canopy Vista", 3); + + assertTappedCount("Canopy Vista", false, 3); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/sacrifice/TradingPostTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/sacrifice/TradingPostTest.java new file mode 100644 index 00000000000..242c0358eb7 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/sacrifice/TradingPostTest.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.oneshot.sacrifice; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class TradingPostTest extends CardTestPlayerBase { + + /** + * Trading Post doesn't let me sacrifice a creature owned by my opponent, + * but controlled by me. I get an error message saying You cannot sacrifice + * this creature. + */ + @Test + public void testSacrifice() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + // {1}, {T}, Discard a card: You gain 4 life. + // {1}, {T}, Pay 1 life: Put a 0/1 white Goat creature token onto the battlefield. + // {1}, {T}, Sacrifice a creature: Return target artifact card from your graveyard to your hand. + // {1}, {T}, Sacrifice an artifact: Draw a card. + addCard(Zone.BATTLEFIELD, playerA, "Trading Post", 1); + // Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn. (It can attack and this turn.) + addCard(Zone.HAND, playerA, "Act of Treason"); // Sorcery {2}{R} + addCard(Zone.GRAVEYARD, playerA, "Helm of Possession"); + + addCard(Zone.BATTLEFIELD, playerB, "Savannah Lions"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Act of Treason", "Savannah Lions"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1},{T}, Sacrifice a creature", "Helm of Possession", "Act of Treason", StackClause.WHILE_NOT_ON_STACK); + setChoice(playerA, "Savannah Lions"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Act of Treason", 1); + + assertPermanentCount(playerB, "Savannah Lions", 0); + assertGraveyardCount(playerB, "Savannah Lions", 1); + + assertTapped("Trading Post", true); + assertHandCount(playerA, 1); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/DevastationTideTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/DevastationTideTest.java new file mode 100644 index 00000000000..e9ddc239d89 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/DevastationTideTest.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.other; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class DevastationTideTest extends CardTestPlayerBase { + + @Test + public void testReturnNonLandPermanents() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + addCard(Zone.HAND, playerA, "Devastation Tide"); // {3}{U}{U} + + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); // Creature + addCard(Zone.BATTLEFIELD, playerA, "Vampiric Rites"); // Enchantment + addCard(Zone.BATTLEFIELD, playerA, "Hedron Archive"); // Artifact + addCard(Zone.BATTLEFIELD, playerA, "Karn Liberated"); // Planeswalker + addCard(Zone.BATTLEFIELD, playerA, "Nimbus Maze", 1); // Land + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); // Creature + addCard(Zone.BATTLEFIELD, playerB, "Vampiric Rites"); // Enchantment + addCard(Zone.BATTLEFIELD, playerB, "Hedron Archive"); // Artifact + addCard(Zone.BATTLEFIELD, playerB, "Karn Liberated"); // Planeswalker + addCard(Zone.BATTLEFIELD, playerB, "Nimbus Maze", 1); // Land + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Devastation Tide"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, "Silvercoat Lion", 1); + assertHandCount(playerA, "Vampiric Rites", 1); + assertHandCount(playerA, "Hedron Archive", 1); + assertHandCount(playerA, "Karn Liberated", 1); + assertHandCount(playerA, "Nimbus Maze", 0); + + assertHandCount(playerB, "Silvercoat Lion", 1); + assertHandCount(playerB, "Vampiric Rites", 1); + assertHandCount(playerB, "Hedron Archive", 1); + assertHandCount(playerB, "Karn Liberated", 1); + assertHandCount(playerB, "Nimbus Maze", 0); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/ImpelledGiantTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/ImpelledGiantTest.java new file mode 100644 index 00000000000..907175c0693 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/ImpelledGiantTest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.other; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +public class ImpelledGiantTest extends CardTestPlayerBase { + + @Test + public void testGainsPower() { + addCard(Zone.BATTLEFIELD, playerA, "Impelled Giant"); + addCard(Zone.BATTLEFIELD, playerA, "Hurloon Minotaur"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tap an untapped red creature you control other than Impelled Giant"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertTapped("Hurloon Minotaur", true); + assertPowerToughness(playerA, "Impelled Giant", 5, 3); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/MycosynthGolemTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/MycosynthGolemTest.java index f7172974d0a..f77f9d097af 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/MycosynthGolemTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/MycosynthGolemTest.java @@ -51,8 +51,10 @@ public class MycosynthGolemTest extends CardTestPlayerBase { public void testSpellsAffinity() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + // Affinity for artifacts + // Artifact creature spells you cast have affinity for artifacts. addCard(Zone.BATTLEFIELD, playerA, "Mycosynth Golem"); - addCard(Zone.HAND, playerA, "Alpha Myr"); + addCard(Zone.HAND, playerA, "Alpha Myr"); // Creature - Myr 2/1 castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Alpha Myr"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SoulfireGrandMasterTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SoulfireGrandMasterTest.java index bce66195698..32387a9896d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SoulfireGrandMasterTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SoulfireGrandMasterTest.java @@ -66,6 +66,9 @@ public class SoulfireGrandMasterTest extends CardTestPlayerBase { @Test public void testSpellsReturnToHand() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5); + // Lifelink + // Instant and sorcery spells you control have lifelink. + // {2}{U/R}{U/R}: The next time you cast an instant or sorcery spell from your hand this turn, put that card into your hand instead of your graveyard as it resolves. addCard(Zone.BATTLEFIELD, playerA, "Soulfire Grand Master"); addCard(Zone.HAND, playerA, "Lightning Bolt"); @@ -199,7 +202,6 @@ public class SoulfireGrandMasterTest extends CardTestPlayerBase { * Test that if Soulfire Grand Master has left the battlefield spell has no * longer lifelink */ - @Test public void testSoulfireLeft() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); @@ -231,7 +233,6 @@ public class SoulfireGrandMasterTest extends CardTestPlayerBase { * the elemental, so stoke didnt resolve, but i still got the life from * lifelink. */ - @Test public void testSoulfireStokeTheFlames() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 8); @@ -296,7 +297,6 @@ public class SoulfireGrandMasterTest extends CardTestPlayerBase { * Constructed. * */ - @Test public void testWithDeflectingPalm() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SpellFizzlesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SpellFizzlesTest.java new file mode 100644 index 00000000000..4deddfc8c06 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/other/SpellFizzlesTest.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.other; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class SpellFizzlesTest extends CardTestPlayerBase { + + @Test + public void testSpellFizzlesWithNoLegalTargets() throws Exception { + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + // Devoid + // Tap up to two target creatures. Those creatures don't untap during their controller's next untap step. + // Put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + addCard(Zone.HAND, playerA, "Adverse Conditions"); // {3}{U} + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); + addCard(Zone.HAND, playerB, "Lightning Bolt", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Adverse Conditions", "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion", "Adverse Conditions"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Adverse Conditions", 1); + assertGraveyardCount(playerB, "Lightning Bolt", 1); + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + assertPermanentCount(playerA, "Eldrazi Scion", 0); // All targets were illegal - spell fizzles + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java index 0c2a6912486..395b217c589 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java @@ -36,14 +36,31 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class PlayFromNonHandZoneTest extends CardTestPlayerBase { + @Test + public void testWorldheartPhoenixNormal() { + // Creature - Phoenix {3}{R} + // Flying + // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. + // If you do, it enters the battlefield with two +1/+1 counters on it. + addCard(Zone.HAND, playerA, "Worldheart Phoenix"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Worldheart Phoenix"); // can only be cast by {W}{U}{B}{R}{G} + + setStopAt(1, PhaseStep.END_COMBAT); + execute(); + + assertPowerToughness(playerA, "Worldheart Phoenix", 2, 2); + + } + @Test public void testWorldheartPhoenixNoMana() { // Creature - Phoenix {3}{R} - // Flying - // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. + // Flying + // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. // If you do, it enters the battlefield with two +1/+1 counters on it. addCard(Zone.GRAVEYARD, playerA, "Worldheart Phoenix"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); @@ -53,16 +70,15 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.END_COMBAT); execute(); - assertPermanentCount(playerA, "Worldheart Phoenix", 0); - - } + assertPermanentCount(playerA, "Worldheart Phoenix", 0); + } @Test public void testWorldheartPhoenix() { // Creature - Phoenix {3}{R} - // Flying - // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. + // Flying + // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. // If you do, it enters the battlefield with two +1/+1 counters on it. addCard(Zone.GRAVEYARD, playerA, "Worldheart Phoenix"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); @@ -76,11 +92,10 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.END_COMBAT); execute(); - assertPermanentCount(playerA, "Worldheart Phoenix", 1); - - } - - + assertPermanentCount(playerA, "Worldheart Phoenix", 1); + + } + @Test public void testNarsetEnlightenedMaster() { // First strike @@ -90,38 +105,36 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBase { skipInitShuffling(); addCard(Zone.LIBRARY, playerB, "Silvercoat Lion"); - addCard(Zone.LIBRARY, playerB, "Abzan Banner"); + addCard(Zone.LIBRARY, playerB, "Abzan Banner"); // Ferocious - If you control a creature with power 4 or greater, you may cast Dragon Grip as though it had flash. (You may cast it any time you could cast an instant.) // Enchant creature // Enchanted creature gets +2/+0 and has first strike. - addCard(Zone.LIBRARY, playerB, "Dragon Grip"); + addCard(Zone.LIBRARY, playerB, "Dragon Grip"); // You gain 2 life for each creature you control. - addCard(Zone.LIBRARY, playerB, "Peach Garden Oath"); - addCard(Zone.LIBRARY, playerB, "Plains"); - + addCard(Zone.LIBRARY, playerB, "Peach Garden Oath"); + addCard(Zone.LIBRARY, playerB, "Plains"); + attack(2, playerB, "Narset, Enlightened Master"); castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Silvercoat Lion"); // can't be cast from exile castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Abzan Banner"); // can be cast from exile castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Dragon Grip", "Narset, Enlightened Master"); // can be cast from exile castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Peach Garden Oath"); // can be cast from exile - + setStopAt(2, PhaseStep.END_TURN); execute(); assertExileCount("Silvercoat Lion", 1); - assertPermanentCount(playerB, "Abzan Banner", 1); - assertPermanentCount(playerB, "Dragon Grip", 1); + assertPermanentCount(playerB, "Abzan Banner", 1); + assertPermanentCount(playerB, "Dragon Grip", 1); assertGraveyardCount(playerB, "Peach Garden Oath", 1); - + assertPowerToughness(playerB, "Narset, Enlightened Master", 5, 2); - + assertHandCount(playerB, "Plains", 1); assertLife(playerA, 17); assertLife(playerB, 22); - - - } - - + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/RazorvergeThicketTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/RazorvergeThicketTest.java new file mode 100644 index 00000000000..01705b7a0e1 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/RazorvergeThicketTest.java @@ -0,0 +1,39 @@ +package org.mage.test.cards.conditional; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * @author tobz + */ +public class RazorvergeThicketTest extends CardTestPlayerBase { + + @Test + public void testEntersTappedForThreeLands() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + addCard(Zone.HAND, playerA, "Razorverge Thicket"); + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Razorverge Thicket"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertTapped("Razorverge Thicket", true); + } + + @Test + public void testEntersUntappedForTwoLands() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 2); + addCard(Zone.HAND, playerA, "Razorverge Thicket"); + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Razorverge Thicket"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertTapped("Razorverge Thicket", false); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/RootwaterMatriarchTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/RootwaterMatriarchTest.java index 7f74e563818..79a8b996666 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/RootwaterMatriarchTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/RootwaterMatriarchTest.java @@ -1,7 +1,3 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ package org.mage.test.cards.conditional; import mage.constants.PhaseStep; @@ -14,10 +10,10 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * @author jeff */ public class RootwaterMatriarchTest extends CardTestPlayerBase { - + @Test public void testTargetFail() { - + addCard(Zone.BATTLEFIELD, playerA, "Rootwater Matriarch"); addCard(Zone.BATTLEFIELD, playerB, "Memnite"); @@ -25,73 +21,73 @@ public class RootwaterMatriarchTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); - + assertPermanentCount(playerA, "Rootwater Matriarch", 1); assertPermanentCount(playerB, "Memnite", 1); } - + @Test public void testTargetSuccess() { - + // {T}: Gain control of target creature for as long as that creature is enchanted addCard(Zone.BATTLEFIELD, playerA, "Rootwater Matriarch"); addCard(Zone.BATTLEFIELD, playerA, "Island"); addCard(Zone.BATTLEFIELD, playerB, "Memnite"); - + addCard(Zone.HAND, playerA, "Flight"); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flight", "Memnite"); activateAbility(1, PhaseStep.BEGIN_COMBAT, playerA, "{T}: Gain control of target creature for as long as that creature is enchanted.", "Memnite"); setStopAt(1, PhaseStep.END_COMBAT); execute(); - + assertPermanentCount(playerA, "Rootwater Matriarch", 1); assertPermanentCount(playerA, "Memnite", 1); - + } - + @Test public void testGainControlEnchantedTargetAndRWLeavesPlay() { - + addCard(Zone.BATTLEFIELD, playerA, "Rootwater Matriarch"); addCard(Zone.BATTLEFIELD, playerA, "Island", 2); addCard(Zone.BATTLEFIELD, playerB, "Memnite"); addCard(Zone.HAND, playerA, "Unsummon"); addCard(Zone.HAND, playerA, "Flight"); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flight", "Memnite"); activateAbility(1, PhaseStep.BEGIN_COMBAT, playerA, "{T}: Gain control of target creature for as long as that creature is enchanted.", "Memnite"); - + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Unsummon", "Rootwater Matriarch"); - + setStopAt(1, PhaseStep.END_TURN); execute(); - + assertPermanentCount(playerA, "Rootwater Matriarch", 0); assertPermanentCount(playerA, "Memnite", 1); } - + @Test public void testGainControlEnchantedTargetAndAuraIsDisenchanted() { - + addCard(Zone.BATTLEFIELD, playerA, "Rootwater Matriarch"); addCard(Zone.BATTLEFIELD, playerA, "Island"); addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); addCard(Zone.BATTLEFIELD, playerB, "Memnite"); addCard(Zone.HAND, playerA, "Disenchant"); addCard(Zone.HAND, playerA, "Flight"); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flight", "Memnite"); activateAbility(1, PhaseStep.BEGIN_COMBAT, playerA, "{T}: Gain control of target creature for as long as that creature is enchanted.", "Memnite"); - + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Disenchant", "Flight"); - + setStopAt(1, PhaseStep.END_TURN); execute(); - + assertPermanentCount(playerA, "Rootwater Matriarch", 1); assertPermanentCount(playerB, "Memnite", 1); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BecomesCreatureTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BecomesCreatureTest.java new file mode 100644 index 00000000000..612be152634 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BecomesCreatureTest.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.continuous; + +import mage.constants.CardType; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class BecomesCreatureTest extends CardTestPlayerBase { + + @Test + public void testChimericMass() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + + // Chimeric Mass enters the battlefield with X charge counters on it. + // {1}: Until end of turn, Chimeric Mass becomes a Construct artifact creature with "This creature's power and toughness are each equal to the number of charge counters on it." + addCard(Zone.HAND, playerA, "Chimeric Mass", 1); // Artifiact - {X} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chimeric Mass"); + setChoice(playerA, "X=3"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}:"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Chimeric Mass", 1); + assertPowerToughness(playerA, "Chimeric Mass", 3, 3); + assertType("Chimeric Mass", CardType.CREATURE, "Construct"); + + } + + @Test + public void testChimericMassAbilityRemoved() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + + // Chimeric Mass enters the battlefield with X charge counters on it. + // {1}: Until end of turn, Chimeric Mass becomes a Construct artifact creature with "This creature's power and toughness are each equal to the number of charge counters on it." + addCard(Zone.HAND, playerA, "Chimeric Mass", 1); // Artifiact - {X} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chimeric Mass"); + setChoice(playerA, "X=3"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}:"); + + setStopAt(2, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Chimeric Mass", 1); + assertPowerToughness(playerA, "Chimeric Mass", 0, 0); + assertType("Chimeric Mass", CardType.CREATURE, false); + + Assert.assertTrue("All layered effect have to be removed", currentGame.getContinuousEffects().getLayeredEffects(currentGame).isEmpty()); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BoostEnchantedTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BoostEnchantedTest.java new file mode 100644 index 00000000000..ffe53bab72c --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/BoostEnchantedTest.java @@ -0,0 +1,125 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.continuous; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class BoostEnchantedTest extends CardTestPlayerBase { + + @Test + public void testFirebreathingNormal() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + // {R}: Enchanted creature gets +1/+0 until end of turn. + addCard(Zone.HAND, playerA, "Firebreathing"); // {R} Enchantment - Aura + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Silvercoat Lion"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: Enchanted creature"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Firebreathing", 1); + assertPowerToughness(playerA, "Silvercoat Lion", 3, 2); + } + + /** + * On Ghitu Firebreathing (and probably other similar cards), when you + * activate the ability to give +1/0 to the enchanted creature and the + * return Ghitu Firebreathing to your hand, the +1/0 goes away on the + * creature. If you re-cast Ghitu Firebreathing onto the creature, the boost + * returns. + * + * Gatherer Rulings: 9/25/2006 If you return Ghitu Firebreathing to its + * owner's hand while the +1/+0 ability is on the stack, that ability will + * still give the creature that was last enchanted by Ghitu Firebreathing + * +1/+0. + * + */ + @Test + public void testFirebreathingReturnToHand() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + // {R}: Enchanted creature gets +1/+0 until end of turn. + addCard(Zone.HAND, playerA, "Firebreathing"); // {R} Enchantment - Aura + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Zone.HAND, playerB, "Boomerang"); // {U}{U} Instant + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Boomerang", "Firebreathing"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: Enchanted creature", NO_TARGET, "Boomerang"); + + setStopAt(1, PhaseStep.END_COMBAT); + execute(); + + assertHandCount(playerA, "Firebreathing", 1); + assertGraveyardCount(playerB, "Boomerang", 1); + assertPowerToughness(playerA, "Silvercoat Lion", 3, 2); + } + + /** + * If the aura moves between activation and resolution, the new enchanted + * creature should be boosted, not the old one. + */ + + @Test + public void testFirebreathingWithAuraGraft() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + // {R}: Enchanted creature gets +1/+0 until end of turn. + addCard(Zone.HAND, playerA, "Firebreathing"); // {R} Enchantment - Aura + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 1); + // Gain control of target Aura that's attached to a permanent. Attach it to another permanent it can enchant. + addCard(Zone.HAND, playerB, "Aura Graft"); // {1}{U} Instant + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Firebreathing", "Silvercoat Lion"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: Enchanted creature"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Aura Graft", "Firebreathing"); + setChoice(playerB, "Pillarfield Ox"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Aura Graft", 1); + assertPermanentCount(playerB, "Firebreathing", 1); + assertPowerToughness(playerA, "Silvercoat Lion", 2, 2); + assertPowerToughness(playerB, "Pillarfield Ox", 3, 4); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java new file mode 100644 index 00000000000..e844aacf1f8 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java @@ -0,0 +1,176 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.continuous; + +import mage.abilities.Ability; +import mage.constants.AbilityType; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.game.permanent.Permanent; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class DependentEffectsTest extends CardTestPlayerBase { + + /** + * Opalescence plus Enchanted Evening are still not wiping any lands. + */ + @Test + public void testLandsAreDestroyed() { + // Each other non-Aura enchantment is a creature in addition to its other types and has base power and base toughness each equal to its converted mana cost. + addCard(Zone.HAND, playerA, "Opalescence", 1); // {2}{W}{W} + + addCard(Zone.BATTLEFIELD, playerA, "Plains", 9); + addCard(Zone.BATTLEFIELD, playerA, "War Horn", 1); + + // All permanents are enchantments in addition to their other types. + addCard(Zone.HAND, playerA, "Enchanted Evening"); // {3}{W/U}{W/U} + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Opalescence"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Enchanted Evening"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPowerToughness(playerA, "Enchanted Evening", 5, 5); + assertPowerToughness(playerA, "War Horn", 3, 3); + + assertPermanentCount(playerA, "Island", 0); + assertPermanentCount(playerB, "Plains", 0); + } + + /** + * Opalescense is dependent on Enchanted Evening, so it will be applied + * after it regardless of timestamp. + * + * Tokens can also have mana costs, and as a consequence of that, converted + * mana costs. A token created with Rite of Replication would have the mana + * cost of the creature it targeted. Most tokens do not have mana costs + * though. + * + * Tokens with no mana costs would be 0/0, as you said, and would indeed be + * put into owner's graveyard next time State Based Actionas are performed. + * Tokens with mana costs would naturally have whatever power and toughness + * their CMC indicated. + */ + @Test + public void testTokensAreDestroyed() { + // Each other non-Aura enchantment is a creature in addition to its other types and has base power and base toughness each equal to its converted mana cost. + addCard(Zone.BATTLEFIELD, playerA, "Opalescence", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 9); + // Kicker {5} + // Put a token that's a copy of target creature onto the battlefield. If Rite of Replication was kicked, put five of those tokens onto the battlefield instead. + addCard(Zone.HAND, playerA, "Rite of Replication", 1); // This token can have a cmc + // All permanents are enchantments in addition to their other types. + addCard(Zone.HAND, playerA, "Enchanted Evening"); // {3}{W/U}{W/U} + + addCard(Zone.BATTLEFIELD, playerB, "Cobblebrute", 1); // 5/2 cmc = 4 + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + // Put two 1/1 white Soldier creature tokens onto the battlefield. + addCard(Zone.HAND, playerB, "Raise the Alarm"); // Instant {1}{W} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rite of Replication", "Cobblebrute"); + setChoice(playerA, "No"); // no kicker + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Raise the Alarm"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Enchanted Evening"); + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerA, "Rite of Replication", 1); + assertGraveyardCount(playerB, "Raise the Alarm", 1); + + assertPowerToughness(playerA, "Enchanted Evening", 5, 5); + + assertPowerToughness(playerB, "Cobblebrute", 4, 4); + assertPowerToughness(playerA, "Cobblebrute", 4, 4); + + assertPermanentCount(playerB, "Soldier", 0); + assertPermanentCount(playerA, "Island", 0); + assertPermanentCount(playerB, "Plains", 0); + } + + @Test + public void testYixlidJailerAndNecroticOozeBasic() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + // As long as Necrotic Ooze is on the battlefield, it has all activated abilities of all creature cards in all graveyards + addCard(Zone.BATTLEFIELD, playerA, "Necrotic Ooze", 1); + // {2}{1},{T}: Tap target creature. + addCard(Zone.GRAVEYARD, playerA, "Akroan Jailer", 1); + // {T}: Target attacking creature gets +1/+1 until end of turn. + addCard(Zone.GRAVEYARD, playerB, "Anointer of Champions", 1); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + Permanent necroticOoze = getPermanent("Necrotic Ooze", playerA); + int numberOfActivatedAbilities = 0; + for (Ability ability : necroticOoze.getAbilities(currentGame)) { + if (ability.getAbilityType().equals(AbilityType.ACTIVATED)) { + numberOfActivatedAbilities++; + } + } + Assert.assertEquals("Two abilities for Necrotic Ooze", 2, numberOfActivatedAbilities); + } + + @Test + public void testYixlidJailerAndNecroticOozeLooseAll() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + // As long as Necrotic Ooze is on the battlefield, it has all activated abilities of all creature cards in all graveyards + addCard(Zone.BATTLEFIELD, playerA, "Necrotic Ooze", 1); + // {2}{1},{T}: Tap target creature. + addCard(Zone.GRAVEYARD, playerA, "Akroan Jailer", 1); + // {T}: Target attacking creature gets +1/+1 until end of turn. + addCard(Zone.GRAVEYARD, playerB, "Anointer of Champions", 1); + + // Cards in graveyards lose all abilities. + addCard(Zone.HAND, playerA, "Yixlid Jailer", 1); // Creature - {1}{B} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Yixlid Jailer"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Yixlid Jailer", 1); + + Permanent necroticOoze = getPermanent("Necrotic Ooze", playerA); + int numberOfActivatedAbilities = 0; + for (Ability ability : necroticOoze.getAbilities(currentGame)) { + if (ability.getAbilityType().equals(AbilityType.ACTIVATED)) { + numberOfActivatedAbilities++; + } + } + Assert.assertEquals("All abilities from cards in graveyard are removed - so no abilities for Necrotic Ooze", 0, numberOfActivatedAbilities); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/LandTypeChangingEffects.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/LandTypeChangingEffects.java new file mode 100644 index 00000000000..3805325ccb2 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/LandTypeChangingEffects.java @@ -0,0 +1,100 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.continuous; + +import mage.abilities.mana.AnyColorManaAbility; +import mage.constants.CardType; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class LandTypeChangingEffects extends CardTestPlayerBase { + + /** + * + * Playing a commander game. Opponent had a Magus of the Moon, and I later + * dropped a Chromatic Lantern. + * + * I was not allowed to use the Chromatic Lantern's ability. Since layers + * are tricky I asked on the Judge's chat to confirm and the user "luma" + * said it should work on this scenario. + * + */ + @Test + public void testMagusOfTheMoonAndChromaticLantern() { + // Nonbasic lands are Mountains. + addCard(Zone.BATTLEFIELD, playerA, "Magus of the Moon"); + + addCard(Zone.BATTLEFIELD, playerB, "Canopy Vista", 1); + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + // Lands you control have "{T}: Add one mana of any color to your mana pool." + // {T}: Add one mana of any color to your mana pool. + addCard(Zone.HAND, playerB, "Chromatic Lantern"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Chromatic Lantern"); + + setStopAt(2, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerB, "Chromatic Lantern", 1); + + assertType("Canopy Vista", CardType.LAND, "Mountain"); + assertAbility(playerB, "Canopy Vista", new AnyColorManaAbility(), true); + } + + @Test + public void testChromaticLanternBeforeMagusOfTheMoon() { + // Nonbasic lands are Mountains. + addCard(Zone.HAND, playerA, "Magus of the Moon");// {2}{R} + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); + + addCard(Zone.BATTLEFIELD, playerB, "Canopy Vista", 1); + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + // Lands you control have "{T}: Add one mana of any color to your mana pool." + // {T}: Add one mana of any color to your mana pool. + addCard(Zone.HAND, playerB, "Chromatic Lantern"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Chromatic Lantern"); + + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Magus of the Moon"); + setStopAt(3, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerB, "Chromatic Lantern", 1); + assertPermanentCount(playerA, "Magus of the Moon", 1); + + assertType("Canopy Vista", CardType.LAND, "Mountain"); + assertAbility(playerB, "Canopy Vista", new AnyColorManaAbility(), true); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/PlatinumEmperionTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/PlatinumEmperionTest.java new file mode 100644 index 00000000000..c6051d9e327 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/PlatinumEmperionTest.java @@ -0,0 +1,104 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.continuous; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class PlatinumEmperionTest extends CardTestPlayerBase { + + @Test + public void testLifeGain() { + // Your life total can't change. + addCard(Zone.BATTLEFIELD, playerA, "Platinum Emperion", 1); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 3); + // You gain 3 life. + // Draw a card. + addCard(Zone.HAND, playerA, "Reviving Dose"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reviving Dose"); + + setStopAt(2, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Reviving Dose", 1); + assertHandCount(playerA, 1); + + assertLife(playerA, 20); + } + + @Test + public void testLifeLoose() { + // Your life total can't change. + addCard(Zone.BATTLEFIELD, playerA, "Platinum Emperion", 1); + // You draw two cards and you lose 2 life. + addCard(Zone.HAND, playerA, "Night's Whisper"); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Night's Whisper"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Night's Whisper", 1); + assertHandCount(playerA, 2); + + assertLife(playerA, 20); + } + + /** + * Swords to Plowshares and Platinum Emperion doesn't work + */ + @Test + public void testSwordsToPlowshares() { + // Your life total can't change. + addCard(Zone.BATTLEFIELD, playerA, "Platinum Emperion", 1); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + // Exile target creature. + // Its controller gains life equal to its power. + addCard(Zone.HAND, playerB, "Swords to Plowshares"); + addCard(Zone.BATTLEFIELD, playerB, "Plains", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Swords to Plowshares", "Silvercoat Lion"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Swords to Plowshares", 1); + assertExileCount("Silvercoat Lion", 1); + + assertLife(playerA, 20); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/ExileAndReturnUnderYourControl.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/ExileAndReturnUnderYourControl.java index 5f1c950fb75..13f434621e6 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/ExileAndReturnUnderYourControl.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/ExileAndReturnUnderYourControl.java @@ -7,11 +7,12 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** - * Tests the effect: - * - Exile target creature you control, then return that card to the battlefield under your control + * Tests the effect: - Exile target creature you control, then return that card + * to the battlefield under your control * - * This effect grants you permanent control over the returned creature. - * So you mail steal opponent's creature with "Act of Treason" and then use this effect for permanent control effect. + * This effect grants you permanent control over the returned creature. So you + * mail steal opponent's creature with "Act of Treason" and then use this effect + * for permanent control effect. * * @author noxx */ @@ -67,7 +68,7 @@ public class ExileAndReturnUnderYourControl extends CardTestPlayerBase { Assert.assertTrue("player A should play with top card revealed", playerA.isTopCardRevealed()); Assert.assertFalse("player B should play NOT with top card revealed", playerB.isTopCardRevealed()); } - + @Test public void testVillainousWealthExilesBoost() { // Villainous Wealth {X}{B}{G}{U} @@ -76,14 +77,14 @@ public class ExileAndReturnUnderYourControl extends CardTestPlayerBase { // their mana costs. addCard(Zone.HAND, playerA, "Villainous Wealth"); addCard(Zone.HAND, playerA, "Master of Pearls"); - + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4); addCard(Zone.BATTLEFIELD, playerA, "Forest", 4); addCard(Zone.BATTLEFIELD, playerA, "Island", 4); // Secret Plans {G}{U} // Face-down creatures you control get +0/+1. - // Whenever a permanent you control is turned face up, draw a card. + // Whenever a permanent you control is turned face up, draw a card. addCard(Zone.LIBRARY, playerB, "Secret Plans"); skipInitShuffling(); // to keep this card on top of library @@ -101,9 +102,50 @@ public class ExileAndReturnUnderYourControl extends CardTestPlayerBase { assertExileCount(playerB, 2); assertExileCount("Secret Plans", 0); assertPermanentCount(playerA, "Secret Plans", 1); - + assertPermanentCount(playerA, "", 1); - assertPowerToughness(playerA, "", 2, 3); - } + assertPowerToughness(playerA, "", 2, 3); + } + + /** + * My opponent cast Villainous Wealth and took control of my Sylvan Library. + * On his next turn, when Sylvan Library's trigger resolved, he kept the two + * extra cards without paying life. + */ + @Test + public void testVillainousWealthExilesSylvanLibrary() { + // Villainous Wealth {X}{B}{G}{U} + // Target opponent exiles the top X cards of his or her library. You may cast any number + // of nonland cards with converted mana cost X or less from among them without paying + // their mana costs. + addCard(Zone.HAND, playerA, "Villainous Wealth"); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + + // At the beginning of your draw step, you may draw two additional cards. + // If you do, choose two cards in your hand drawn this turn. + // For each of those cards, pay 4 life or put the card on top of your library. + addCard(Zone.LIBRARY, playerB, "Sylvan Library"); + skipInitShuffling(); // to keep this card on top of library + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Villainous Wealth", playerB); + setChoice(playerA, "X=3"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sylvan Library"); + + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertGraveyardCount(playerA, "Villainous Wealth", 1); + assertExileCount(playerB, 2); + assertExileCount("Sylvan Library", 0); + assertPermanentCount(playerA, "Sylvan Library", 1); + + assertHandCount(playerB, 1); + assertHandCount(playerA, 3); + assertLife(playerA, 12); + assertLife(playerB, 20); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java index 3293ebacf13..ed2edd68978 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/GainControlTargetEffectTest.java @@ -18,10 +18,11 @@ public class GainControlTargetEffectTest extends CardTestPlayerBase { /** * Checks if control has changed and the controlled creature has Haste - * + * */ @Test public void testPermanentControlEffect() { + // When Smelt-Ward Gatekeepers enters the battlefield, if you control two or more Gates, gain control of target creature an opponent controls until end of turn. Untap that creature. That creature gains haste until end of turn. addCard(Zone.HAND, playerA, "Smelt-Ward Gatekeepers", 1); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); addCard(Zone.BATTLEFIELD, playerA, "Boros Guildgate", 2); @@ -39,13 +40,12 @@ public class GainControlTargetEffectTest extends CardTestPlayerBase { } /** - * I gained control of my opponent's Glen Elendra Archmage with Vedalken Shackles. - * After I sacrificed it to counter a spell, it Persisted back to my battlefield, - * but it should return under its owner's control. Maybe a Persist problem, but I - * am thinking Vedalken Shackles doesn't realize that it is a different object - * when it returns from the graveyard instead. + * I gained control of my opponent's Glen Elendra Archmage with Vedalken + * Shackles. After I sacrificed it to counter a spell, it Persisted back to + * my battlefield, but it should return under its owner's control. Maybe a + * Persist problem, but I am thinking Vedalken Shackles doesn't realize that + * it is a different object when it returns from the graveyard instead. */ - @Test public void testGainControlOfCreatureWithPersistEffect() { // {2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as Vedalken Shackles remains tapped. @@ -60,7 +60,7 @@ public class GainControlTargetEffectTest extends CardTestPlayerBase { // Persist (When this creature dies, if it had no -1/-1 counters on it, return it to the battlefield under its owner's control with a -1/-1 counter on it.) addCard(Zone.BATTLEFIELD, playerB, "Glen Elendra Archmage"); - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as {this} remains tapped.","Glen Elendra Archmage"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as {this} remains tapped.", "Glen Elendra Archmage"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Strike", playerA); activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{U},Sacrifice {this}: Counter target noncreature spell.", "Lightning Strike"); @@ -76,4 +76,33 @@ public class GainControlTargetEffectTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Glen Elendra Archmage", 1); } + + /** + * The shackles can maintain control of Mutavault indefinitely, even when + * it's not a creature. + * + */ + @Test + public void testKeepControlOfMutavault() { + // {2},{T}: Gain control of target creature with power less than or equal to the number of Islands you control for as long as Vedalken Shackles remains tapped. + addCard(Zone.BATTLEFIELD, playerA, "Vedalken Shackles", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 1); + // {T}: Add {1} to your mana pool. + // {1}: Mutavault becomes a 2/2 creature with all creature types until end of turn. It's still a land. + addCard(Zone.BATTLEFIELD, playerB, "Mutavault", 1); + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}: Until end of turn {this} becomes"); + activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "{2},{T}: Gain control", "Mutavault"); + + setChoice(playerA, "No"); // Don't untap the Shackles + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + // under control of Shackles even if it's no longer a creature + assertPermanentCount(playerB, "Mutavault", 0); + assertPermanentCount(playerA, "Mutavault", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/ItThatBetraysTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/ItThatBetraysTest.java index e48bd054ec9..3dd7735cd8e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/control/ItThatBetraysTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/ItThatBetraysTest.java @@ -27,7 +27,6 @@ */ package org.mage.test.cards.control; -import mage.abilities.keyword.HasteAbility; import mage.constants.PhaseStep; import mage.constants.Zone; import org.junit.Test; @@ -37,15 +36,15 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class ItThatBetraysTest extends CardTestPlayerBase { /** * https://github.com/magefree/mage/issues/796 * - * When an opponent sacrifices a fetchland and you have an It That Betrays in play, - * sacrificing the fetchland that comes under your control from its ability returns - * it to play under your control, allowing you to fetch infinite lands. + * When an opponent sacrifices a fetchland and you have an It That Betrays + * in play, sacrificing the fetchland that comes under your control from its + * ability returns it to play under your control, allowing you to fetch + * infinite lands. * */ @Test @@ -62,7 +61,7 @@ public class ItThatBetraysTest extends CardTestPlayerBase { assertLife(playerA, 19); assertLife(playerB, 19); - + // Going to graveyard if player B sacrifices it assertGraveyardCount(playerA, "Flooded Strand", 1); } @@ -71,7 +70,7 @@ public class ItThatBetraysTest extends CardTestPlayerBase { @Test public void testExileItThatBetraysEffect() { addCard(Zone.BATTLEFIELD, playerA, "Flooded Strand", 1); - + addCard(Zone.BATTLEFIELD, playerA, "Rest in Peace", 1); addCard(Zone.BATTLEFIELD, playerB, "It That Betrays"); @@ -83,7 +82,7 @@ public class ItThatBetraysTest extends CardTestPlayerBase { assertLife(playerA, 19); assertLife(playerB, 20); - + // Player B now controls a Flooded Strand, even though it went to exile assertPermanentCount(playerB, "Flooded Strand", 1); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/control/WillbreakerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/control/WillbreakerTest.java new file mode 100644 index 00000000000..92b78b12a08 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/control/WillbreakerTest.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.control; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class WillbreakerTest extends CardTestPlayerBase { + + /** + * http://www.slightlymagic.net/forum/viewtopic.php?f=70&t=17664&start=120#p186736 + * + * I tried to activate Retribution of the Ancients while I only controlled + * Nantuko Husk and Willbreaker without +1/+1 counters on them. The program + * didn't let me activate the RotA, even though the creature you choose + * doesn't need to have any counters on it (X can be 0, doesn't say + * otherwise on the card and it isn't a target requirement). It asked me to + * pay B, then choose a creature I controlled, which I did... and then + * nothing happened. + * + */ + @Test + public void testRetributionOfTheAncientsZeroCounter() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + // {B}, Remove X +1/+1 counters from among creatures you control: Target creature gets -X/-X until end of turn. + addCard(Zone.BATTLEFIELD, playerA, "Retribution of the Ancients", 1); // Enchantment {B} + // Whenever a creature an opponent controls becomes the target of a spell or ability you control, gain control of that creature for as long as you control Willbreaker. + addCard(Zone.BATTLEFIELD, playerA, "Willbreaker", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{B},Remove", "Silvercoat Lion"); + setChoice(playerA, "X=0"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Willbreaker", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/ArtisanOfFormsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/ArtisanOfFormsTest.java index 75a884fc286..e4304f68480 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/ArtisanOfFormsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/ArtisanOfFormsTest.java @@ -38,28 +38,28 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class ArtisanOfFormsTest extends CardTestPlayerBase { /** - * Targeting a Artisan of Forms triggers it Heroic ability. So it can copy a target creature. - * If Cackling Counterpart later resolves, it should copy the creature that Artisan of Forms copies, not - * the Artisan itself. + * Targeting a Artisan of Forms triggers it Heroic ability. So it can copy a + * target creature. If Cackling Counterpart later resolves, it should copy + * the creature that Artisan of Forms copies, not the Artisan itself. */ @Test public void testCopyTriggeredByCracklingCounterpart() { // Heroic - Whenever you cast a spell that targets Artisan of Forms, you may have Artisan of Forms become a copy of target creature and gain this ability. - addCard(Zone.BATTLEFIELD, playerA, "Artisan of Forms"); + addCard(Zone.HAND, playerA, "Artisan of Forms"); // {1}{U} // {1}{U}{U} Put a token onto the battlefield that's a copy of target creature you control. addCard(Zone.HAND, playerA, "Cackling Counterpart"); - addCard(Zone.BATTLEFIELD, playerA, "Island",3); + addCard(Zone.BATTLEFIELD, playerA, "Island", 5); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cackling Counterpart", "Artisan of Forms"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Artisan of Forms"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cackling Counterpart", "Artisan of Forms"); addTarget(playerA, "Silvercoat Lion"); - setStopAt(1, PhaseStep.BEGIN_COMBAT); + setStopAt(1, PhaseStep.END_TURN); execute(); assertLife(playerA, 20); @@ -70,18 +70,18 @@ public class ArtisanOfFormsTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Silvercoat Lion", 1); // 1 + 2 Silvercoat Lion at the end assertPermanentCount(playerA, "Silvercoat Lion", 2); - - for (Permanent permanent :currentGame.getBattlefield().getAllActivePermanents(playerA.getId())) { + + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(playerA.getId())) { if (permanent.getName().equals("Silvercoat Lion")) { Assert.assertEquals("Creature has to have Cast + Heroic ability", 2, permanent.getAbilities().size()); } } } - -/** - * Targeting a Artisan of Forms triggers it Heroic ability. So it can copy a target creature. - * If populate spell later resolves, it should copy the creature that Artisan of Forms copies, not - * the Artisan itself. + + /** + * Targeting a Artisan of Forms triggers it Heroic ability. So it can copy a + * target creature. If populate spell later resolves, it should copy the + * creature that Artisan of Forms copies, not the Artisan itself. */ @Test public void testCopyTriggeredByPopulate() { @@ -90,17 +90,17 @@ public class ArtisanOfFormsTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Artisan of Forms"); // {1}{U}{U} Put a token onto the battlefield that's a copy of target creature you control. addCard(Zone.HAND, playerA, "Cackling Counterpart"); - addCard(Zone.BATTLEFIELD, playerA, "Island",3); + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); addCard(Zone.HAND, playerA, "Eyes in the Skies"); - addCard(Zone.BATTLEFIELD, playerA, "Plains",4); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cackling Counterpart", "Artisan of Forms"); addTarget(playerA, "Silvercoat Lion"); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Eyes in the Skies"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Eyes in the Skies"); addTarget(playerA, "Silvercoat Lion"); - + setStopAt(1, PhaseStep.END_TURN); execute(); @@ -113,12 +113,12 @@ public class ArtisanOfFormsTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Bird", 1); // 3 Silvercoat Lion at the end assertPermanentCount(playerA, "Silvercoat Lion", 3); - - for (Permanent permanent :currentGame.getBattlefield().getAllActivePermanents(playerA.getId())) { + + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(playerA.getId())) { if (permanent.getName().equals("Silvercoat Lion")) { Assert.assertEquals("Creature has to have Cast + Heroic ability", 2, permanent.getAbilities().size()); } } - } - + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CleverImpersonatorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CleverImpersonatorTest.java index c045c0998af..06a37801110 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CleverImpersonatorTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CleverImpersonatorTest.java @@ -29,6 +29,7 @@ package org.mage.test.cards.copy; import mage.constants.PhaseStep; import mage.constants.Zone; +import mage.counters.CounterType; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -72,4 +73,109 @@ public class CleverImpersonatorTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Gilded Drake", 1); assertPermanentCount(playerB, "Pillarfield Ox", 1); } + + /** + * Copy a planeswalker on the battlefield + */ + @Test + public void testCopyPlaneswalker() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + + // You may have Clever Impersonator enter the battlefield as a copy of any nonland permanent on the battlefield. + addCard(Zone.HAND, playerA, "Clever Impersonator", 1); // {2}{U}{U} + + // +2: Each player discards a card. + // -X: Return target nonlegendary creature with converted mana cost X from your graveyard to the battlefield. + // -8: You get an emblem with "Whenever a creature dies, return it to the battlefield under your control at the beginning of the next end step."; + addCard(Zone.BATTLEFIELD, playerB, "Liliana, Defiant Necromancer", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clever Impersonator"); + setChoice(playerA, "Liliana, Defiant Necromancer"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+2: Each player discards a card"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, "Clever Impersonator", 0); + assertCounterCount(playerB, "Liliana, Defiant Necromancer", CounterType.LOYALTY, 3); // 3 + assertPermanentCount(playerB, "Liliana, Defiant Necromancer", 1); + assertPermanentCount(playerA, "Liliana, Defiant Necromancer", 1); + assertCounterCount(playerA, "Liliana, Defiant Necromancer", CounterType.LOYALTY, 5); // 3 + 2 + } + + /** + * I had an Alesha, Who Smiles at Death returning a Clever Impersonator who + * was supposed to copy a flipped Liliana, Defiant Necromancer, but it + * entered the battlefield with 0 loyalty and died immediately. If I am not + * mistaken it should have entered with 3 loyalty (see Gatherer entry). + */ + @Test + public void testCopyPlaneswalkerFromGraveyard() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + // First strike + // Whenever Alesha, Who Smiles at Death attacks, you may pay {W/B}{W/B}. If you do, return target creature card with power 2 or less from your graveyard to the battlefield tapped and attacking. + addCard(Zone.BATTLEFIELD, playerA, "Alesha, Who Smiles at Death", 1); // {2}{R} - 3/2 + + // You may have Clever Impersonator enter the battlefield as a copy of any nonland permanent on the battlefield. + addCard(Zone.GRAVEYARD, playerA, "Clever Impersonator", 1); // {2}{U}{U} + + // +2: Each player discards a card. + // -X: Return target nonlegendary creature with converted mana cost X from your graveyard to the battlefield. + // -8: You get an emblem with "Whenever a creature dies, return it to the battlefield under your control at the beginning of the next end step."; + addCard(Zone.BATTLEFIELD, playerB, "Liliana, Defiant Necromancer", 1); + + attack(1, playerA, "Alesha, Who Smiles at Death"); + addTarget(playerA, "Clever Impersonator"); + setChoice(playerA, "Liliana, Defiant Necromancer"); + + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "+2: Each player discards a card"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertTapped("Alesha, Who Smiles at Death", true); + assertLife(playerB, 17); + assertGraveyardCount(playerA, "Clever Impersonator", 0); + + assertCounterCount(playerB, "Liliana, Defiant Necromancer", CounterType.LOYALTY, 3); // 3 + assertPermanentCount(playerB, "Liliana, Defiant Necromancer", 1); + assertPermanentCount(playerA, "Liliana, Defiant Necromancer", 1); + assertCounterCount(playerA, "Liliana, Defiant Necromancer", CounterType.LOYALTY, 5); // 3 + 2 + } + + /** + * So I copied Jace, Vryns Prodigy with Clever Impersonator (it was tapped + * and I needed a blocker for a token...), and Jace got to survive until the + * next turn. When I looted, he flipped, and I got an error message I + * couldn't get rid of, forcing me to concede. I'm not sure what the correct + * outcome is rules-wise. + */ + @Test + public void testCopyCreatureOfFlipPlaneswalker() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + + // {T}: Draw a card, then discard a card. If there are five or more cards in your graveyard, exile Jace, Vryn's Prodigy, then return him to the battefield transformed under his owner's control. + addCard(Zone.BATTLEFIELD, playerA, "Jace, Vryn's Prodigy", 1); // {2}{R} - 3/2 + + // You may have Clever Impersonator enter the battlefield as a copy of any nonland permanent on the battlefield. + addCard(Zone.HAND, playerA, "Clever Impersonator", 1); // {2}{U}{U} + addCard(Zone.GRAVEYARD, playerA, "Mountain", 4); + + addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Clever Impersonator"); + setChoice(playerA, "Jace, Vryn's Prodigy"); + addTarget(playerA, "Jace, Vryn's Prodigy[only copy]"); // keep the copied Jace + + activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Draw a card"); + setChoice(playerA, "Pillarfield Ox"); + + setStopAt(3, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Jace, Vryn's Prodigy", 1); + assertPermanentCount(playerA, "Pillarfield Ox", 1); + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CopySpellTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CopySpellTest.java new file mode 100644 index 00000000000..e3701dd6a48 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CopySpellTest.java @@ -0,0 +1,122 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.copy; + +import mage.abilities.keyword.FlyingAbility; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class CopySpellTest extends CardTestPlayerBase { + + @Test + public void copyChainOfVapor() { + // Return target nonland permanent to its owner's hand. Then that permanent's controller may sacrifice a land. If the player does, he or she may copy this spell and may choose a new target for that copy. + addCard(Zone.HAND, playerA, "Chain of Vapor", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 1); + addCard(Zone.BATTLEFIELD, playerB, "Island", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Chain of Vapor", "Pillarfield Ox"); + setChoice(playerB, "Yes"); + addTarget(playerB, "Silvercoat Lion"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Island", 1); + assertHandCount(playerB, "Pillarfield Ox", 1); + assertHandCount(playerA, "Silvercoat Lion", 1); + } + + @Test + public void ZadaHedronGrinderBoost() { + // Target creature gets +3/+3 and gains flying until end of turn. + addCard(Zone.HAND, playerA, "Angelic Blessing", 1); // {2}{W} + addCard(Zone.BATTLEFIELD, playerA, "Plains", 3); + + // Whenever you cast an instant or sorcery spell that targets only Zada, Hedron Grinder, copy that spell for each other creature you control that the spell could target. Each copy targets a different one of those creatures. + addCard(Zone.BATTLEFIELD, playerA, "Zada, Hedron Grinder", 1); + addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Angelic Blessing", "Zada, Hedron Grinder"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Angelic Blessing", 1); + assertPowerToughness(playerA, "Pillarfield Ox", 5, 7); + assertAbility(playerA, "Pillarfield Ox", FlyingAbility.getInstance(), true); + assertPowerToughness(playerA, "Zada, Hedron Grinder", 6, 6); + assertAbility(playerA, "Zada, Hedron Grinder", FlyingAbility.getInstance(), true); + + assertPowerToughness(playerB, "Silvercoat Lion", 2, 2); + assertAbility(playerB, "Silvercoat Lion", FlyingAbility.getInstance(), false); + } + + @Test + public void ZadaHedronGrinderBoostWithCharm() { + // Choose two - + // • Counter target spell. + // • Return target permanent to its owner's hand. + // • Tap all creatures your opponents control. + // • Draw a card. + addCard(Zone.HAND, playerA, "Cryptic Command", 1); // {2}{U}{U}{U} + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + + // Whenever you cast an instant or sorcery spell that targets only Zada, Hedron Grinder, copy that spell for each other creature you control that the spell could target. Each copy targets a different one of those creatures. + addCard(Zone.BATTLEFIELD, playerA, "Zada, Hedron Grinder", 1); + addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Command", "mode=2Zada, Hedron Grinder"); + setModeChoice(playerA, "2"); // Return target permanent to its owner's hand + setModeChoice(playerA, "4"); // Draw a card + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPowerToughness(playerB, "Silvercoat Lion", 2, 2); + + assertGraveyardCount(playerA, "Cryptic Command", 1); + assertPermanentCount(playerA, "Zada, Hedron Grinder", 0); + assertPermanentCount(playerA, "Pillarfield Ox", 0); + assertHandCount(playerA, 4); // 2 draw + 2 creatures returned to hand + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java index 1242402d45e..f2985fdfaac 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java @@ -19,4 +19,120 @@ public class CryptoplasmTest extends CardTestPlayerBase { assertLife(playerB, 20); assertPermanentCount(playerA, "Craw Wurm", 2); } + + /** + * I have a Cryptoplasm in play, currently copying a Sigiled Paladin, and I + * enchant it with a Followed Footsteps. Next turn the aura triggers (the + * Crypto is still copying the same creature) and places a token on the + * battlefield, except the token is an untransformed Cryptoplasm, when it + * should be a Sigiled Paladin with Cryptoplasm's ability (as per rule + * 706.3), since that's what the enchanted creature currently is. + * + * 6/1/2011 If another creature becomes a copy of Cryptoplasm, it will + * become a copy of whatever Cryptoplasm is currently copying (if anything), + * plus it will have Cryptoplasm's triggered ability. + */ + @Test + public void testFollowedFootsteps() { + // First strike + // Exalted (Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn.) + addCard(Zone.BATTLEFIELD, playerA, "Sigiled Paladin", 1); // {W}{W} + + addCard(Zone.BATTLEFIELD, playerB, "Island", 5); + // Enchant creature + // At the beginning of your upkeep, put a token that's a copy of enchanted creature onto the battlefield. + addCard(Zone.HAND, playerB, "Followed Footsteps", 1); // {3}{U}{U} + // At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability. + addCard(Zone.BATTLEFIELD, playerB, "Cryptoplasm", 1); // {1}{U}{U} + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Followed Footsteps"); + addTarget(playerB, "Sigiled Paladin[only copy]"); + + setStopAt(4, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerB, "Followed Footsteps", 1); + assertPermanentCount(playerB, "Cryptoplasm", 0); + assertPermanentCount(playerB, "Sigiled Paladin", 2); + } + + /** + * I'm at 8 life, opponent (AI) is at 21. I have a Cryptoplasm currently + * copying my opponent's Divinity of Pride, the Crypto also has my Followed + * Footsteps attached to it. Additionally, I have another Cryptoplasm on the + * battlefield also copying the same Divinity, and a Clever Impersonator + * that ETB copying the first Cryptoplasm and is currently also a copy of + * the Divinity. + * + * Opponent attacks with his only Divinity of Pride (4/4) and a Serra + * Avenger (3/3). I block the Divinity with two of my Divinity copies (the + * Clever Impersonator and unenchanted Cryptoplasm) and the Avenger with the + * enchanted Divinity (originally a Cryptoplasm). My opponent's Divinity + * kills my two copies and dies, and then his Avenger dies and kills the + * Divinity blocking it, also sending my Followed Footsteps down with it. + * + * How does any of that add up? Not only should his Divinity only kill one + * of mine since it was a 4/4 and only becomes an 8/8 after dealing its + * damage (at which point it should be too late to go back and say the 4 + * damage are now 8, since it was that exact damage that put him at 25 + * life), but even more confusing is how the Serra Avenger, which is a 3/3, + * somehow kills my 4/4 that had suffered no other damage that turn. + * + * No other permanents in play at that moment had any influence in this + * either, they were only basic lands and a couple of creatures with no + * relevant abilities. + * + * I won't put aside me completely missing something here, but I really + * can't see any other explanation to this other than a game bug. + */ + @Test + public void testDamageLifelink() { + setLife(playerA, 21); + setLife(playerB, 8); + // First strike + // Exalted (Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn.) + addCard(Zone.BATTLEFIELD, playerA, "Divinity of Pride", 1); // {W}{W} + + addCard(Zone.BATTLEFIELD, playerB, "Island", 5); + // At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability. + addCard(Zone.BATTLEFIELD, playerB, "Cryptoplasm", 2); // {1}{U}{U} + addTarget(playerB, "Divinity of Pride"); + addTarget(playerB, "Divinity of Pride"); + + attack(3, playerA, "Divinity of Pride"); + block(3, playerB, "Divinity of Pride", "Divinity of Pride"); + block(3, playerB, "Divinity of Pride", "Divinity of Pride"); + + setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertPermanentCount(playerB, "Cryptoplasm", 0); + + assertPermanentCount(playerA, "Divinity of Pride", 0); + assertPermanentCount(playerB, "Divinity of Pride", 1); + + assertLife(playerB, 16); + assertLife(playerA, 25); + } + + @Test + public void testTransformMultipleTime() { + // At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability. + addCard(Zone.BATTLEFIELD, playerA, "Cryptoplasm", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); // 6/4 + addCard(Zone.BATTLEFIELD, playerB, "Craw Wurm", 1); // 6/4 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptoplasm"); + addTarget(playerA, "Silvercoat Lion"); + addTarget(playerA, "Craw Wurm"); + setStopAt(5, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + assertPermanentCount(playerA, "Silvercoat Lion", 0); + assertPermanentCount(playerA, "Craw Wurm", 1); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/FelhideSpiritbinderTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/FelhideSpiritbinderTest.java index 341d497d74a..97b7f57c8d9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/FelhideSpiritbinderTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/FelhideSpiritbinderTest.java @@ -94,4 +94,35 @@ public class FelhideSpiritbinderTest extends CardTestPlayerBase { assertLife(playerB, 20); } + + @Test + public void testCopyATokenCreature() { + + addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); + addCard(Zone.HAND, playerA, "Call of the Herd", 1); + + // Inspired - Whenever Felhide Spiritbinder becomes untapped, you may pay {1}{R}. + // If you do, put a token onto the battlefield that's a copy of another target creature + // except it's an enchantment in addition to its other types. It gains haste. Exile it at the beginning of the next end step. + addCard(Zone.BATTLEFIELD, playerB, "Felhide Spiritbinder", 1); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Call of the Herd"); + + attack(2, playerB, "Felhide Spiritbinder"); + + setStopAt(4, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Elephant", 1); + assertPermanentCount(playerB, "Elephant", 1); + assertAbility(playerB, "Elephant", HasteAbility.getInstance(), true); + + Permanent copiedTokenElephant = getPermanent("Elephant", playerB); + Assert.assertEquals("Elephant has Enchantment card type", true, copiedTokenElephant.getCardType().contains(CardType.ENCHANTMENT)); + + assertLife(playerA, 17); + assertLife(playerB, 20); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/FlameshadowConjuringTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/FlameshadowConjuringTest.java index 423ac6c2084..7b8b1dc02c6 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/FlameshadowConjuringTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/FlameshadowConjuringTest.java @@ -72,4 +72,41 @@ public class FlameshadowConjuringTest extends CardTestPlayerBase { assertLife(playerA, 18); } + /** + * I created a token copy of Wurmcoil Engine and sacrificed it. This gave me + * 4 tokens + */ + @Test + public void testWurmcoilEngine() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 7); + // Whenever a nontoken creature enters the battlefield under your control, you may pay {R}. If you do, put a token onto the battlefield that's a copy of that creature. + // That token gains haste. Exile it at the beginning of the next end step. + addCard(Zone.BATTLEFIELD, playerA, "Flameshadow Conjuring", 1); + // Deathtouch, lifelink + // When Wurmcoil Engine dies, put a 3/3 colorless Wurm artifact creature token with deathtouch and a 3/3 colorless Wurm artifact creature token with lifelink onto the battlefield. + addCard(Zone.HAND, playerA, "Wurmcoil Engine", 1); // 6/6 - {6} + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 3); + // Destroy target attacking creature. + addCard(Zone.HAND, playerB, "Kill Shot", 1); // {2}{U} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wurmcoil Engine"); + setChoice(playerA, "Yes"); + + attack(1, playerA, "Wurmcoil Engine"); + + castSpell(1, PhaseStep.END_COMBAT, playerB, "Kill Shot", "Wurmcoil Engine"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerB, "Kill Shot", 1); + assertPermanentCount(playerA, "Wurmcoil Engine", 1); + assertLife(playerB, 14); + assertLife(playerA, 26); + + assertPermanentCount(playerA, "Wurm", 2); + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/InfiniteReflectionTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/InfiniteReflectionTest.java new file mode 100644 index 00000000000..c60f7e912b9 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/InfiniteReflectionTest.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.copy; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class InfiniteReflectionTest extends CardTestPlayerBase { + + /** + * + */ + @Test + public void testCopyAsEnters() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 9); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); +// addCard(Zone.BATTLEFIELD, playerA, "Birds of Paradise", 1); +// addCard(Zone.HAND, playerA, "Nantuko Husk", 1);// {2}{B} + addCard(Zone.GRAVEYARD, playerA, "Pillarfield Ox", 1); + // Put target creature card from a graveyard onto the battlefield under your control. You lose life equal to its converted mana cost. + addCard(Zone.HAND, playerA, "Reanimate", 1); // {B} + + // Enchant creature + // When Infinite Reflection enters the battlefield attached to a creature, each other nontoken creature you control becomes a copy of that creature. + // Nontoken creatures you control enter the battlefield as a copy of enchanted creature. + addCard(Zone.HAND, playerA, "Infinite Reflection", 1); // {5}{U} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Infinite Reflection", "Silvercoat Lion"); +// castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nantuko Husk"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reanimate", "Pillarfield Ox"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Silvercoat Lion", 2); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/IsochronScepterTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/IsochronScepterTest.java index 71506a20563..2036f56dc25 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/IsochronScepterTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/IsochronScepterTest.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package org.mage.test.cards.copy; import mage.constants.PhaseStep; @@ -39,16 +38,13 @@ import org.mage.test.serverside.base.CardTestPlayerBase; */ public class IsochronScepterTest extends CardTestPlayerBase { - /** - * Isochron Scepter - * Artifact, 2 (2) - * Imprint — When Isochron Scepter enters the battlefield, you may exile an - * instant card with converted mana cost 2 or less from your hand. - * {2}, {T}: You may copy the exiled card. If you do, you may cast the copy - * without paying its mana cost. - * - */ + * Isochron Scepter Artifact, 2 (2) Imprint — When Isochron Scepter enters + * the battlefield, you may exile an instant card with converted mana cost 2 + * or less from your hand. {2}, {T}: You may copy the exiled card. If you + * do, you may cast the copy without paying its mana cost. + * + */ @Test public void testImprint() { addCard(Zone.BATTLEFIELD, playerA, "Forest", 4); @@ -64,9 +60,9 @@ public class IsochronScepterTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Isochron Scepter", 1); assertExileCount("Lightning Bolt", 1); assertLife(playerB, 20); - + } - + @Test public void testCopyCard() { addCard(Zone.BATTLEFIELD, playerA, "Forest", 4); @@ -86,7 +82,7 @@ public class IsochronScepterTest extends CardTestPlayerBase { assertExileCount("Lightning Bolt", 1); assertGraveyardCount(playerA, "Lightning Bolt", 0); assertLife(playerB, 17); - + } @Test @@ -108,20 +104,33 @@ public class IsochronScepterTest extends CardTestPlayerBase { assertExileCount("Lightning Bolt", 1); assertGraveyardCount(playerA, "Lightning Bolt", 0); assertLife(playerB, 20); - + } - + + /** + * Not sure if it's triggered by just casting Angel's Grace or by casting it + * from an Isochron Scepter, but when the bug happens neither player is able + * to play spells or activate abilities anymore for the rest of the game. + * + * Maybe something related to Split Second? + */ @Test public void testAngelsGrace() { addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); addCard(Zone.HAND, playerA, "Isochron Scepter"); + // Split second (As long as this spell is on the stack, players can't cast spells or activate abilities that aren't mana abilities.) + // 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. + addCard(Zone.HAND, playerA, "Angel's Grace"); - addCard(Zone.BATTLEFIELD, playerB, "Dross Crocodile", 4); + addCard(Zone.BATTLEFIELD, playerB, "Dross Crocodile", 4);// 5/1 + addCard(Zone.HAND, playerB, "Lightning Bolt", 2); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Isochron Scepter"); addTarget(playerA, "Angel's Grace"); - + attack(2, playerB, "Dross Crocodile"); attack(2, playerB, "Dross Crocodile"); attack(2, playerB, "Dross Crocodile"); @@ -131,24 +140,34 @@ public class IsochronScepterTest extends CardTestPlayerBase { setChoice(playerA, "Yes"); setChoice(playerA, "Yes"); - setStopAt(2, PhaseStep.END_COMBAT); + // Damage life loss is reduced to 0 because of Angel's Grace effect active + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); + + // Spells can be cast again + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Dross Crocodile"); + + setStopAt(3, PhaseStep.BEGIN_COMBAT); execute(); - assertPermanentCount(playerA, "Isochron Scepter", 1); assertExileCount("Angel's Grace", 1); assertGraveyardCount(playerA, "Angel's Grace", 0); assertLife(playerA, 1); assertLife(playerB, 20); + assertGraveyardCount(playerB, "Lightning Bolt", 2); + assertGraveyardCount(playerB, "Dross Crocodile", 1); + assertPermanentCount(playerB, "Dross Crocodile", 3); + assertPermanentCount(playerA, "Isochron Scepter", 1); + } - + /** - * Resolving a Silence cast from exile via Isochron Scepter during my opponent's upkeep does - * not prevent that opponent from casting spells that turn. - * + * Resolving a Silence cast from exile via Isochron Scepter during my + * opponent's upkeep does not prevent that opponent from casting spells that + * turn. + * */ - @Test public void testSilence() { addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); @@ -160,7 +179,7 @@ public class IsochronScepterTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Isochron Scepter"); addTarget(playerA, "Silence"); - + activateAbility(2, PhaseStep.UPKEEP, playerA, "{2},{T}:"); setChoice(playerA, "Yes"); setChoice(playerA, "Yes"); @@ -175,6 +194,6 @@ public class IsochronScepterTest extends CardTestPlayerBase { assertHandCount(playerB, "Silvercoat Lion", 1); assertPermanentCount(playerB, "Silvercoat Lion", 0); - - } + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java index ac9048c91a4..6567fa4edd3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java @@ -25,11 +25,15 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package org.mage.test.cards.copy; +import mage.abilities.keyword.HasteAbility; import mage.constants.PhaseStep; import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.permanent.Permanent; +import mage.game.permanent.PermanentToken; +import org.junit.Assert; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -79,6 +83,7 @@ public class KikiJikiMirrorBreakerTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Voice of Resurgence", 1); addCard(Zone.BATTLEFIELD, playerB, "Mountain", 3); + // Flamebreak deals 3 damage to each creature without flying and each player. Creatures dealt damage this way can't be regenerated this turn. addCard(Zone.HAND, playerB, "Flamebreak"); activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Put a token that's a copy of target nonlegendary creature you control onto the battlefield. That token has haste. Sacrifice it at the beginning of the next end step."); @@ -97,7 +102,91 @@ public class KikiJikiMirrorBreakerTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Elemental", 2); - } -} \ No newline at end of file + /** + * Kiki-Jiki, Mirror Breaker creates a copy of Humble Defector, activate + * Humble defector, token gets sacrificed while under opponents control. + */ + @Test + public void testTokenNotSacrificedIfNotControlled() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + // Tap target creature you don't control. + // Overload {3}{U} + addCard(Zone.HAND, playerA, "Blustersquall", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Kiki-Jiki, Mirror Breaker", 1); + // {T}: Draw two cards. Target opponent gains control of Humble Defector. Activate this ability only during your turn. + addCard(Zone.BATTLEFIELD, playerB, "Humble Defector", 1); + + castSpell(2, PhaseStep.UPKEEP, playerA, "Blustersquall", "Humble Defector"); // Tap nontoken Defector so only the Token can be used later + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}: Put a token that's a copy of target nonlegendary creature you control onto the battlefield. That token has haste. Sacrifice it at the beginning of the next end step."); + + activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{T}: Draw two cards. Target opponent gains control"); + + setStopAt(3, PhaseStep.UPKEEP); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertHandCount(playerB, 3); // normal 1 draw of turn two + 2 from Defector + + assertGraveyardCount(playerA, "Blustersquall", 1); + assertPermanentCount(playerB, "Humble Defector", 1); + assertPermanentCount(playerA, "Humble Defector", 1); + + } + + /** + * + * Kiki-Jiki, Mirror Breaker tokens are not entering with haste... + * + * I just tried to reproduce this but I was not able-- + * + * In the game in question I used a card (Body Double) to target a card in a + * graveyard (don't remember the name) and copy it + * + * I then used Kiki to copy Body Double that copied a graveyard card of my + * opponent---that copy did not have haste... + */ + @Test + public void testCopyBodyDouble() { + addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 5); + addCard(Zone.BATTLEFIELD, playerB, "Kiki-Jiki, Mirror Breaker", 1); + // You may have Body Double enter the battlefield as a copy of any creature card in a graveyard. + addCard(Zone.HAND, playerB, "Body Double", 1); // {4}{U} + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Body Double"); + setChoice(playerB, "Silvercoat Lion"); + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}: Put a token that's a copy of target nonlegendary creature you control onto the battlefield. That token has haste. Sacrifice it at the beginning of the next end step."); + + attack(2, playerB, "Silvercoat Lion"); + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertGraveyardCount(playerA, "Silvercoat Lion", 1); + assertPermanentCount(playerB, "Silvercoat Lion", 2); // one from Body Double and one from Kiki + + Permanent kikiCopy = null; + for (Permanent permanent : currentGame.getState().getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), currentGame)) { + if (permanent.getName().equals("Silvercoat Lion") && (permanent instanceof PermanentToken)) { + kikiCopy = permanent; + break; + } + } + if (kikiCopy != null) { + Assert.assertEquals("Has to have haste", kikiCopy.getAbilities(currentGame).containsClass(HasteAbility.class), true); + } else { + Assert.assertEquals("Silvercoat Lion copied by Kiki is missing", kikiCopy != null, true); + } + + assertLife(playerA, 18); + assertLife(playerB, 20); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java index 7b1ecd66b1e..7326f3ec5cc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhantasmalImageTest.java @@ -202,6 +202,9 @@ public class PhantasmalImageTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Island", 5); addCard(Zone.BATTLEFIELD, playerA, "Llanowar Elves"); addCard(Zone.HAND, playerA, "Phantasmal Image"); + + // As Lurebound Scarecrow enters the battlefield, choose a color. + // When you control no permanents of the chosen color, sacrifice Lurebound Scarecrow. addCard(Zone.HAND, playerA, "Lurebound Scarecrow"); setChoice(playerA, "Green"); @@ -324,7 +327,7 @@ public class PhantasmalImageTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Phantasmal Image"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Phantasmal Image"); // not targeted - castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerA, "Veil of Secrecy", "Frost Titan"); // so it's no longer targetable + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerA, "Veil of Secrecy", "Frost Titan"); // so it's no longer targetable setChoice(playerB, "Frost Titan"); castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "Terror", "Frost Titan"); // of player Bs Phantasmal Image copying Frost Titan @@ -346,7 +349,7 @@ public class PhantasmalImageTest extends CardTestPlayerBase { } // I've casted a Phantasmal Image targeting opponent's Wurmcoil Engine - // When my Phantasmal Image died, it didn't triggered the Wurmcoil Engine's last ability + // When my Phantasmal Image died, it didn't triggered the Wurmcoil Engine's last ability // (When Wurmcoil Engine dies, put a 3/3 colorless Wurm artifact creature token with deathtouch and // a 3/3 colorless Wurm artifact creature token with lifelink onto the battlefield.) @Test @@ -418,31 +421,39 @@ public class PhantasmalImageTest extends CardTestPlayerBase { } /** - * Action - * Game State 1 -----------------> Game State 2 - * (On 'field) (Move to GY) (In graveyard) - * - * LTB abilities such as Persist are expceptional in that they trigger based on their existence and - * state of objects before the event (Game State 1, when the card is on the battlefield) rather than - * after (Game State 2, when the card is in the graveyard). It doesn't matter that the LTB ability - * doesn't exist in Game State 2. [CR 603.6d] - * - * 603.6d Normally, objects that exist immediately after an event are checked to see if the event matched any trigger conditions. - * Continuous effects that exist at that time are used to determine what the trigger conditions are and what the objects involved - * in the event look like. However, some triggered abilities must be treated specially. Leaves-the-battlefield abilities, abilities - * that trigger when a permanent phases out, abilities that trigger when an object that all players can see is put into a hand or - * library, abilities that trigger specifically when an object becomes unattached, abilities that trigger when a player loses control - * of an object, and abilities that trigger when a player planeswalks away from a plane will trigger based on their existence, and - * the appearance of objects, prior to the event rather than afterward. The game has to “look back in time” to determine if these abilities trigger. - * - * Example: Two creatures are on the battlefield along with an artifact that has the ability “Whenever a creature dies, you gain 1 life.” - * Someone plays a spell that destroys all artifacts, creatures, and enchantments. The artifact’s ability triggers twice, even though - * the artifact goes to its owner’s graveyard at the same time as the creatures. - * + * Action Game State 1 -----------------> Game State 2 (On 'field) (Move to + * GY) (In graveyard) + * + * LTB abilities such as Persist are expceptional in that they trigger based + * on their existence and state of objects before the event (Game State 1, + * when the card is on the battlefield) rather than after (Game State 2, + * when the card is in the graveyard). It doesn't matter that the LTB + * ability doesn't exist in Game State 2. [CR 603.6d] + * + * 603.6d Normally, objects that exist immediately after an event are + * checked to see if the event matched any trigger conditions. Continuous + * effects that exist at that time are used to determine what the trigger + * conditions are and what the objects involved in the event look like. + * However, some triggered abilities must be treated specially. + * Leaves-the-battlefield abilities, abilities that trigger when a permanent + * phases out, abilities that trigger when an object that all players can + * see is put into a hand or library, abilities that trigger specifically + * when an object becomes unattached, abilities that trigger when a player + * loses control of an object, and abilities that trigger when a player + * planeswalks away from a plane will trigger based on their existence, and + * the appearance of objects, prior to the event rather than afterward. The + * game has to “look back in time” to determine if these abilities trigger. + * + * Example: Two creatures are on the battlefield along with an artifact that + * has the ability “Whenever a creature dies, you gain 1 life.” Someone + * plays a spell that destroys all artifacts, creatures, and enchantments. + * The artifact’s ability triggers twice, even though the artifact goes to + * its owner’s graveyard at the same time as the creatures. + * */ @Test public void testPersist() { - addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); // When Kitchen Finks enters the battlefield, you gain 2 life. // Persist (When this creature dies, if it had no -1/-1 counters on it, return it to the battlefield under its owner's control with a -1/-1 counter on it.) addCard(Zone.HAND, playerA, "Kitchen Finks"); @@ -452,21 +463,20 @@ public class PhantasmalImageTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 6); addCard(Zone.BATTLEFIELD, playerB, "Island", 2); - + // You may have Phantasmal Image enter the battlefield as a copy of any creature // on the battlefield, except it's an Illusion in addition to its other types and - // it gains "When this creature becomes the target of a spell or ability, sacrifice it." + // it gains "When this creature becomes the target of a spell or ability, sacrifice it." addCard(Zone.HAND, playerB, "Phantasmal Image"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Kitchen Finks"); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Kitchen Finks"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Phantasmal Image"); // not targeted setChoice(playerB, "Kitchen Finks"); - castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "Public Execution", "Kitchen Finks"); setChoice(playerB, "Kitchen Finks"); - + setStopAt(2, PhaseStep.END_TURN); execute(); @@ -480,13 +490,13 @@ public class PhantasmalImageTest extends CardTestPlayerBase { assertHandCount(playerB, "Phantasmal Image", 0); assertGraveyardCount(playerB, "Phantasmal Image", 0); assertPermanentCount(playerB, "Kitchen Finks", 1); - assertPowerToughness(playerB, "Kitchen Finks", 2, 1); + assertPowerToughness(playerB, "Kitchen Finks", 2, 1); } - + @Test public void testUndying() { - addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); // Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.) addCard(Zone.HAND, playerA, "Butcher Ghoul"); @@ -495,21 +505,20 @@ public class PhantasmalImageTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 6); addCard(Zone.BATTLEFIELD, playerB, "Island", 2); - + // You may have Phantasmal Image enter the battlefield as a copy of any creature // on the battlefield, except it's an Illusion in addition to its other types and - // it gains "When this creature becomes the target of a spell or ability, sacrifice it." + // it gains "When this creature becomes the target of a spell or ability, sacrifice it." addCard(Zone.HAND, playerB, "Phantasmal Image"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Butcher Ghoul"); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Butcher Ghoul"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Phantasmal Image"); // not targeted setChoice(playerB, "Butcher Ghoul"); - castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "Public Execution", "Butcher Ghoul"); setChoice(playerB, "Butcher Ghoul"); - + setStopAt(2, PhaseStep.END_TURN); execute(); @@ -523,29 +532,25 @@ public class PhantasmalImageTest extends CardTestPlayerBase { assertHandCount(playerB, "Phantasmal Image", 0); assertGraveyardCount(playerB, "Phantasmal Image", 0); assertPermanentCount(playerB, "Butcher Ghoul", 1); - assertPowerToughness(playerB, "Butcher Ghoul", 2, 2); + assertPowerToughness(playerB, "Butcher Ghoul", 2, 2); } /** * 12:29: Attacker: Wurmcoil Engine [466] (6/6) blocked by Wurmcoil Engine - * [4ed] (6/6) - * 12:29: yespair gains 6 life - * 12:29: HipSomHap gains 6 life - * 12:29: Wurmcoil Engine [4ed] died - * 12:29: Ability triggers: Wurmcoil Engine [4ed] - When Wurmcoil Engine [4ed] dies, put a a 3/3 colorless + * [4ed] (6/6) 12:29: yespair gains 6 life 12:29: HipSomHap gains 6 life + * 12:29: Wurmcoil Engine [4ed] died 12:29: Ability triggers: Wurmcoil + * Engine [4ed] - When Wurmcoil Engine [4ed] dies, put a a 3/3 colorless * Wurm artifact creature token with deathtouch onto the battlefield. Put a * a 3/3 colorless Wurm artifact creature token with lifelink onto the - * battlefield. - * 12:29: Phantasmal Image [466] died - * 12:29: HipSomHap puts a Wurm [7d0] token onto the battlefield - * 12:29: HipSomHap puts a Wurm [186] token onto the battlefield + * battlefield. 12:29: Phantasmal Image [466] died 12:29: HipSomHap puts a + * Wurm [7d0] token onto the battlefield 12:29: HipSomHap puts a Wurm [186] + * token onto the battlefield * * To the best of my knowledge, the Phantasmal Image [466], which entered * the battlefield as a Wurmcoil Engine, should grant tokens through the * Dies-trigger as well, right? */ - @Test public void testDiesTriggered2() { addCard(Zone.BATTLEFIELD, playerB, "Wurmcoil Engine"); @@ -570,5 +575,5 @@ public class PhantasmalImageTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Wurm", 2); assertPermanentCount(playerB, "Wurm", 2); - } + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java index 460ac83b825..1f3ac8a3242 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java @@ -36,10 +36,8 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class PhyrexianMetamorphTest extends CardTestPlayerBase { - @Test public void testCopyCreature() { addCard(Zone.BATTLEFIELD, playerA, "Island", 1); @@ -48,7 +46,7 @@ public class PhyrexianMetamorphTest extends CardTestPlayerBase { // You may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types. addCard(Zone.HAND, playerA, "Phyrexian Metamorph"); // {3}{UP} addCard(Zone.HAND, playerA, "Cloudshift"); - + //Flying // Vanishing 3 (This permanent enters the battlefield with three time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.) // When Aven Riftwatcher enters the battlefield or leaves the battlefield, you gain 2 life. @@ -68,13 +66,13 @@ public class PhyrexianMetamorphTest extends CardTestPlayerBase { assertLife(playerA, 24); assertLife(playerB, 20); - + assertGraveyardCount(playerA, "Cloudshift", 1); - + assertPermanentCount(playerA, "Ponyback Brigade", 1); assertPermanentCount(playerA, "Goblin", 3); - } + } /** * An opponent cast Phyrexian Metamorph and cloned another opponent's @@ -84,7 +82,6 @@ public class PhyrexianMetamorphTest extends CardTestPlayerBase { * to choose a new creature to clone when the Phyrexian Metamorph re-entered * the battlefield. */ - @Test public void testFlickerWithBrago() { addCard(Zone.BATTLEFIELD, playerA, "Island", 4); @@ -93,9 +90,9 @@ public class PhyrexianMetamorphTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Phyrexian Metamorph"); // {3}{UP} // Flying - // When Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner's control. + // When Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner's control. addCard(Zone.BATTLEFIELD, playerA, "Brago, King Eternal"); // 2/4 - + // Creatures you control have haste. // Cascade, cascade addCard(Zone.BATTLEFIELD, playerB, "Maelstrom Wanderer"); // 7/5 @@ -106,19 +103,19 @@ public class PhyrexianMetamorphTest extends CardTestPlayerBase { setChoice(playerA, "Maelstrom Wanderer"); attack(3, playerA, "Brago, King Eternal"); - addTarget(playerA, "Maelstrom Wanderer"); + addTarget(playerA, "Maelstrom Wanderer"); setChoice(playerA, "Ponyback Brigade"); - + setStopAt(3, PhaseStep.END_COMBAT); execute(); assertLife(playerA, 20); assertLife(playerB, 18); - + assertPermanentCount(playerA, "Ponyback Brigade", 1); assertPermanentCount(playerA, "Goblin", 3); - } + } /** * I had a Harmonic Sliver, my opponent played Phyrexian Metamorph copying @@ -126,7 +123,7 @@ public class PhyrexianMetamorphTest extends CardTestPlayerBase { * destroying ability, where it should have had two of them and triggered * twice (the Metamorph might have nothing to do with this) */ - @Test + @Test public void testHarmonicSliver() { addCard(Zone.BATTLEFIELD, playerA, "Island", 4); @@ -137,7 +134,7 @@ public class PhyrexianMetamorphTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Kitesail", 1); // All Slivers have "When this permanent enters the battlefield, destroy target artifact or enchantment." addCard(Zone.BATTLEFIELD, playerB, "Harmonic Sliver"); // 2/4 - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phyrexian Metamorph"); setChoice(playerA, "Harmonic Sliver"); addTarget(playerA, "Alloy Myr"); @@ -145,66 +142,116 @@ public class PhyrexianMetamorphTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.END_COMBAT); execute(); - + assertPermanentCount(playerA, "Harmonic Sliver", 1); assertGraveyardCount(playerB, "Alloy Myr", 1); assertGraveyardCount(playerB, "Kitesail", 1); - } - + } + /** - * If a Harmonic Sliver enters the battlefield - * the controller has to destroy one artifacts or enchantments + * If a Harmonic Sliver enters the battlefield the controller has to destroy + * one artifacts or enchantments */ @Test public void testHarmonicSliverNative1() { addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); - - // All Slivers have "When this permanent enters the battlefield, destroy target artifact or enchantment." - addCard(Zone.HAND, playerA, "Harmonic Sliver"); - addCard(Zone.BATTLEFIELD, playerB, "Alloy Myr", 2); // 2/2 - + // All Slivers have "When this permanent enters the battlefield, destroy target artifact or enchantment." + addCard(Zone.HAND, playerA, "Harmonic Sliver"); + + addCard(Zone.BATTLEFIELD, playerB, "Alloy Myr", 2); // 2/2 + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Harmonic Sliver"); setStopAt(1, PhaseStep.END_COMBAT); execute(); - + assertPermanentCount(playerA, "Harmonic Sliver", 1); assertGraveyardCount(playerB, "Alloy Myr", 1); - } - + } + /** - * If a Harmonic Sliver enters the battlefield and there is already one on the battlefield - * the controller has to destroy two artifacts or enchantments + * If a Harmonic Sliver enters the battlefield and there is already one on + * the battlefield the controller has to destroy two artifacts or + * enchantments */ @Test public void testHarmonicSliverNative2() { addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); - - addCard(Zone.HAND, playerA, "Harmonic Sliver"); + + addCard(Zone.HAND, playerA, "Harmonic Sliver"); addCard(Zone.BATTLEFIELD, playerB, "Alloy Myr", 1); addCard(Zone.BATTLEFIELD, playerB, "Kitesail", 1); // All Slivers have "When this permanent enters the battlefield, destroy target artifact or enchantment." addCard(Zone.BATTLEFIELD, playerB, "Harmonic Sliver"); // 2/4 - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Harmonic Sliver"); addTarget(playerA, "Alloy Myr"); addTarget(playerA, "Kitesail"); setStopAt(1, PhaseStep.END_COMBAT); execute(); - + assertPermanentCount(playerA, "Harmonic Sliver", 1); assertGraveyardCount(playerB, "Alloy Myr", 1); assertGraveyardCount(playerB, "Kitesail", 1); - } + } + + /** + * I cast Show and Tell, and put Sheoldred, Whispering One into play and my + * opponent put Phyrexian Metamorph into play and he was able to clone my + * Sheoldred, Whispering One. + * + * 6/1/2011 If Phyrexian Metamorph somehow enters the battlefield at the + * same time as another permanent (due to Mass Polymorph or Liliana Vess's + * third ability, for example), Phyrexian Metamorph can't become a copy of + * that permanent. You may only choose a permanent that's already on the + * battlefield. + * + * 400.6. If an object would move from one zone to another, determine what + * event is moving the object. If the object is moving to a public zone, all + * players look at it to see if it has any abilities that would affect the + * move. Then any appropriate replacement effects, whether they come from + * that object or from elsewhere, are applied to that event. If any effects + * or rules try to do two or more contradictory or mutually exclusive things + * to a particular object, that object's controller -- or its owner if it + * has no controller -- chooses which effect to apply, and what that effect + * does. (Note that multiple instances of the same thing may be mutually + * exclusive; for example, two simultaneous "destroy" effects.) Then the + * event moves the object. + */ + @Test + public void testShowAndTell() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + + // Each player may put an artifact, creature, enchantment, or land card from his or her hand onto the battlefield. + addCard(Zone.HAND, playerA, "Show and Tell"); // SORCERY {2}{U} + + // Swampwalk + // At the beginning of your upkeep, return target creature card from your graveyard to the battlefield. + // At the beginning of each opponent's upkeep, that player sacrifices a creature. + addCard(Zone.HAND, playerA, "Sheoldred, Whispering One"); + + addCard(Zone.HAND, playerB, "Phyrexian Metamorph"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Show and Tell"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Sheoldred, Whispering One", 1); + assertPermanentCount(playerB, "Sheoldred, Whispering One", 0); + + assertGraveyardCount(playerB, "Phyrexian Metamorph", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/SpelltwineTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/SpelltwineTest.java index dc1ed92799c..5c788c4d38d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/SpelltwineTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/SpelltwineTest.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package org.mage.test.cards.copy; import mage.constants.PhaseStep; @@ -39,15 +38,13 @@ import org.mage.test.serverside.base.CardTestPlayerBase; */ public class SpelltwineTest extends CardTestPlayerBase { - /** - * Spelltwine - * Sorcery, 5U (6) - * Exile target instant or sorcery card from your graveyard and target instant - * or sorcery card from an opponent's graveyard. Copy those cards. Cast the - * copies if able without paying their mana costs. Exile Spelltwine. - * - */ + * Spelltwine Sorcery, 5U (6) Exile target instant or sorcery card from your + * graveyard and target instant or sorcery card from an opponent's + * graveyard. Copy those cards. Cast the copies if able without paying their + * mana costs. Exile Spelltwine. + * + */ @Test public void testCopyCards() { addCard(Zone.BATTLEFIELD, playerA, "Island", 6); @@ -66,7 +63,55 @@ public class SpelltwineTest extends CardTestPlayerBase { assertExileCount("Lightning Bolt", 1); assertExileCount("Shock", 1); assertLife(playerB, 15); - + + } + + /** + * In a game of Commander, I cast Spelltwine, targeting Impulse and + * Blasphemous Act. This triggered my Mirari, which I paid the 3 and copied + * the Spelltwine. I chose new targets for the copy, naming Path to Exile + * and Shape Anew. Somehow, the original Spelltwine was completely lost + * after this, failing to be in the stack box or resolve all. + */ + @Test + public void testCopyCardsMirari() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 9); + // Exile target instant or sorcery card from your graveyard and target instant or sorcery card from an opponent's graveyard. + // Copy those cards. Cast the copies if able without paying their mana costs. Exile Spelltwine. + addCard(Zone.HAND, playerA, "Spelltwine"); // {5}{U} + // Look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order. + addCard(Zone.GRAVEYARD, playerA, "Impulse"); + // You draw two cards and you lose 2 life. + addCard(Zone.GRAVEYARD, playerA, "Night's Whisper"); + // Blasphemous Act costs {1} less to cast for each creature on the battlefield. + // Blasphemous Act deals 13 damage to each creature. + addCard(Zone.GRAVEYARD, playerB, "Blasphemous Act"); + // Draw two cards. + addCard(Zone.GRAVEYARD, playerB, "Divination"); + + // Whenever you cast an instant or sorcery spell, you may pay {3}. If you do, copy that spell. You may choose new targets for the copy. + addCard(Zone.BATTLEFIELD, playerA, "Mirari", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spelltwine"); + addTarget(playerA, "Impulse"); + addTarget(playerA, "Blasphemous Act"); + setChoice(playerA, "Yes"); // pay {3} and copy spell + setChoice(playerA, "Yes"); // Change targets + addTarget(playerA, "Night's Whisper"); + addTarget(playerA, "Divination"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertExileCount("Impulse", 1); + assertExileCount("Blasphemous Act", 1); + assertExileCount("Spelltwine", 1); + assertExileCount("Night's Whisper", 1); + assertExileCount("Divination", 1); + + assertHandCount(playerA, 5); + + assertLife(playerA, 18); + assertLife(playerB, 20); + } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/VesuvaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/VesuvaTest.java index 601be2d21f4..fe600b1e415 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/VesuvaTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/VesuvaTest.java @@ -60,12 +60,11 @@ public class VesuvaTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Glimmerpost", 1); - playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Glimmerpost"); playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Glimmerpost"); playLand(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Vesuva"); setChoice(playerA, "Glimmerpost"); - + setStopAt(3, PhaseStep.BEGIN_COMBAT); execute(); @@ -75,31 +74,31 @@ public class VesuvaTest extends CardTestPlayerBase { assertLife(playerA, 24); // 20 + 1 + 3 assertLife(playerB, 22); // 20 + 2 } - + @Test public void testDarkDepth() { // Dark Depths enters the battlefield with ten ice counters on it. // {3}: Remove an ice counter from Dark Depths. // When Dark Depths has no ice counters on it, sacrifice it. If you do, put a legendary 20/20 black Avatar creature token with flying and "This creature is indestructible" named Marit Lage onto the battlefield. addCard(Zone.BATTLEFIELD, playerB, "Dark Depths", 1); - + // You may have Vesuva enter the battlefield tapped as a copy of any land on the battlefield. - addCard(Zone.HAND, playerA, "Vesuva", 1); - + addCard(Zone.HAND, playerA, "Vesuva", 1); + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vesuva"); setChoice(playerA, "Dark Depths"); - + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); - assertPermanentCount(playerA, "Dark Depths", 1); assertPermanentCount(playerB, "Dark Depths", 1); - + assertPermanentCount(playerA, "Dark Depths", 1); + Permanent darkDepth = getPermanent("Dark Depths", playerA); if (darkDepth != null) { - Assert.assertEquals(darkDepth.getCounters().getCount("ice"), 10); + Assert.assertEquals(10, darkDepth.getCounters().getCount("ice")); } - + assertTappedCount("Dark Depths", true, 1); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/kicker/GatekeeperOfMalakirTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/kicker/GatekeeperOfMalakirTest.java index 322cc8f4201..770f6265f6d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/cost/kicker/GatekeeperOfMalakirTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/kicker/GatekeeperOfMalakirTest.java @@ -17,6 +17,8 @@ public class GatekeeperOfMalakirTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Gatekeeper of Malakir"); addCard(Zone.BATTLEFIELD, playerB, "Llanowar Elves"); + // Kicker {B} (You may pay an additional {B} as you cast this spell.) + // When Gatekeeper of Malakir enters the battlefield, if it was kicked, target player sacrifices a creature. castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gatekeeper of Malakir"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -29,5 +31,4 @@ public class GatekeeperOfMalakirTest extends CardTestPlayerBase { assertGraveyardCount(playerB, 1); } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/MizzixOfTheIzmagnusTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/MizzixOfTheIzmagnusTest.java new file mode 100644 index 00000000000..131b85a69b6 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/cost/modification/MizzixOfTheIzmagnusTest.java @@ -0,0 +1,123 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.cost.modification; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.counters.CounterType; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class MizzixOfTheIzmagnusTest extends CardTestPlayerBase { + + @Test + public void testSpellsFixedCost() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + // Whenever you cast an instant or sorcery spell with converted mana cost greater than the number of experience counters you have, you get an experience counter. + // Instant and sorcery spells you cast cost {1} less to cast for each experience counter you have. + addCard(Zone.BATTLEFIELD, playerA, "Mizzix of the Izmagnus"); + addCard(Zone.HAND, playerA, "Lightning Bolt"); // {R} + // Incinerate deals 3 damage to target creature or player. A creature dealt damage this way can't be regenerated this turn. + addCard(Zone.HAND, playerA, "Incinerate"); // {1}{R} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Incinerate", playerB); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Lightning Bolt", 1); + assertGraveyardCount(playerA, "Incinerate", 1); + + assertCounterCount(playerA, CounterType.EXPERIENCE, 2); + assertLife(playerA, 20); + assertLife(playerB, 14); + + } + + /** + * Does not reduce the cost of {X} spells + */ + @Test + public void testSpellsVariableCost() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + // Whenever you cast an instant or sorcery spell with converted mana cost greater than the number of experience counters you have, you get an experience counter. + // Instant and sorcery spells you cast cost {1} less to cast for each experience counter you have. + addCard(Zone.BATTLEFIELD, playerA, "Mizzix of the Izmagnus"); + // Blaze deals X damage to target creature or player. + addCard(Zone.HAND, playerA, "Blaze", 2); // Sorcery - {X}{R} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Blaze", playerB); + setChoice(playerA, "X=1"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Blaze", playerB); + setChoice(playerA, "X=2"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Blaze", 2); + + assertCounterCount(playerA, CounterType.EXPERIENCE, 2); + assertLife(playerA, 20); + assertLife(playerB, 17); + + } + + /** + * Test to reduce Buyback costs + */ + @Test + public void testSpellsBuybackCost() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + // Whenever you cast an instant or sorcery spell with converted mana cost greater than the number of experience counters you have, you get an experience counter. + // Instant and sorcery spells you cast cost {1} less to cast for each experience counter you have. + addCard(Zone.BATTLEFIELD, playerA, "Mizzix of the Izmagnus");// 2/2 + addCard(Zone.HAND, playerA, "Lightning Bolt"); // {R} + // Target creature gets +3/+0 until end of turn. + addCard(Zone.HAND, playerA, "Seething Anger"); // {R} Buyback {3} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Seething Anger", "Mizzix of the Izmagnus"); + setChoice(playerA, "Yes"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Lightning Bolt", 1); + assertHandCount(playerA, "Seething Anger", 1); + + assertPowerToughness(playerA, "Mizzix of the Izmagnus", 5, 2); + assertCounterCount(playerA, CounterType.EXPERIENCE, 1); + assertLife(playerA, 20); + assertLife(playerB, 17); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java index 0c211862d2c..103cd628814 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java @@ -125,11 +125,11 @@ public class EmblemsTest extends CardTestPlayerBase { /** * Liliana, Defiant Necromancer: -8: You get an emblem with "Whenever a - * creature you control dies, return it to the battlefield under your - * control at the beginning of the next end step."; + * creature dies, return it to the battlefield under your control at the + * beginning of the next end step."; * - * Tests "Whenever a creature you control dies, return it to the battlefield - * under your control at the beginning of the next end step." + * Tests "Whenever a creature dies, return it to the battlefield under your + * control at the beginning of the next end step." */ @Test public void testLilianaDefiantNecromancer() { @@ -152,7 +152,7 @@ public class EmblemsTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Liliana, Defiant Necromancer", 1); assertPermanentCount(playerA, "Elite Vanguard", 1); - assertGraveyardCount(playerB, "Silvercoat Lion", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); assertHandCount(playerA, 0); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/InfernalScarringTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/InfernalScarringTest.java new file mode 100644 index 00000000000..af3806772ed --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/InfernalScarringTest.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.enchantments; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class InfernalScarringTest extends CardTestPlayerBase { + + /** + * The 'draw a card, when this creature dies' didn't trigger after i + * sacrificed a creature enchanted with infernal scarring (enchanted + * creature was Fetid Imp and the sac trigger came from a Nantuko Husk). + * + */ + @Test + public void testDiesTrigger() { + // Sacrifice a creature: Nantuko Husk gets +2/+2 until end of turn. + addCard(Zone.BATTLEFIELD, playerA, "Nantuko Husk", 1); // {2}{B} + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + // Enchant creature + // Enchanted creature gets +2/+0 and has "When this creature dies, draw a card." + addCard(Zone.HAND, playerA, "Infernal Scarring"); // {1}{B} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Infernal Scarring", "Silvercoat Lion"); + + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sacrifice a creature"); + setChoice(playerA, "Silvercoat Lion"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerA, "Silvercoat Lion", 1); + assertPowerToughness(playerA, "Nantuko Husk", 4, 4); + assertGraveyardCount(playerA, "Infernal Scarring", 1); + assertHandCount(playerA, 1); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/OathOfLiegesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/OathOfLiegesTest.java new file mode 100644 index 00000000000..df0c508f1e2 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/OathOfLiegesTest.java @@ -0,0 +1,125 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.enchantments; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class OathOfLiegesTest extends CardTestPlayerBase { + + @Test + public void testSearchLandOwner() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + // At the beginning of each player's upkeep, that player chooses target player who controls more lands than he or she does and is his or her opponent. + // The first player may search his or her library for a basic land card, put that card onto the battlefield, then shuffle his or her library. + addCard(Zone.HAND, playerA, "Oath of Lieges", 1); // {1}{W} + addCard(Zone.LIBRARY, playerA, "Plains", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 3); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oath of Lieges"); + addTarget(playerA, playerB); + addTarget(playerA, "Plains"); + + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Oath of Lieges", 1); + assertPermanentCount(playerA, "Plains", 3); + + } + + @Test + public void testSearchLandOpponent() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + // At the beginning of each player's upkeep, that player chooses target player who controls more lands than he or she does and is his or her opponent. + // The first player may search his or her library for a basic land card, put that card onto the battlefield, then shuffle his or her library. + addCard(Zone.HAND, playerA, "Oath of Lieges", 1); // {1}{W} + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 1); + addCard(Zone.LIBRARY, playerB, "Plains", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oath of Lieges"); + addTarget(playerB, playerA); + addTarget(playerB, "Plains"); + + setStopAt(2, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Oath of Lieges", 1); + assertPermanentCount(playerA, "Plains", 2); + assertPermanentCount(playerB, "Plains", 2); + } + + @Test + public void testSearchLandOwnerCopy() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + // At the beginning of each player's upkeep, that player chooses target player who controls more lands than he or she does and is his or her opponent. + // The first player may search his or her library for a basic land card, put that card onto the battlefield, then shuffle his or her library. + addCard(Zone.HAND, playerA, "Oath of Lieges", 1); // {1}{W} + addCard(Zone.LIBRARY, playerA, "Plains", 3); + addCard(Zone.HAND, playerA, "Plains", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 3); + addCard(Zone.HAND, playerB, "Copy Enchantment", 1); // {2}{U} + addCard(Zone.LIBRARY, playerB, "Plains", 3); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oath of Lieges"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Copy Enchantment"); + setChoice(playerB, "Oath of Lieges"); + + // turn 3 + addTarget(playerA, playerB); + addTarget(playerA, "Plains"); // 3rd land + addTarget(playerA, "Plains"); // second trigger will fail because target player has no longer more lands than controller + + playLand(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Plains"); // 4th land + + // turn 4 + addTarget(playerB, playerA); + addTarget(playerB, "Plains"); + addTarget(playerB, "Plains"); // second trigger will fail because target player has no longer more lands than controller + + setStopAt(4, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerB, "Oath of Lieges", 1); + assertPermanentCount(playerA, "Oath of Lieges", 1); + + assertPermanentCount(playerB, "Plains", 1); + assertPermanentCount(playerA, "Plains", 4); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/ParadoxHazeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/ParadoxHazeTest.java new file mode 100644 index 00000000000..917e25519d4 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/ParadoxHazeTest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.enchantments; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class ParadoxHazeTest extends CardTestPlayerBase { + + @Test + public void testNormal() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 8); + // Enchant player + // At the beginning of enchanted player's first upkeep each turn, that player gets an additional upkeep step after this step. + addCard(Zone.HAND, playerA, "Paradox Haze", 1); // {2}{U} + // At the beginning of each upkeep, put a 1/1 green Saproling creature token onto the battlefield. + addCard(Zone.HAND, playerA, "Verdant Force", 1); // {5}{G}{G}{G} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Paradox Haze", playerA); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Verdant Force"); + + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Paradox Haze", 1); + assertPermanentCount(playerA, "Verdant Force", 1); + assertPermanentCount(playerA, "Saproling", 3);// 1 from turn 2 and 2 from turn 3 + } + + @Test + public void testCopied() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 6); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 8); + // Enchant player + // At the beginning of enchanted player's first upkeep each turn, that player gets an additional upkeep step after this step. + addCard(Zone.HAND, playerA, "Paradox Haze", 1); // {2}{U} + + // You may have Copy Enchantment enter the battlefield as a copy of any enchantment on the battlefield. + addCard(Zone.HAND, playerA, "Copy Enchantment", 1); // {2}{U} + + // At the beginning of each upkeep, put a 1/1 green Saproling creature token onto the battlefield. + addCard(Zone.HAND, playerA, "Verdant Force", 1); // {5}{G}{G}{G} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Paradox Haze", playerA); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Copy Enchantment"); + setChoice(playerA, "Paradox Haze"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Verdant Force"); + + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Paradox Haze", 2); + assertPermanentCount(playerA, "Verdant Force", 1); + assertPermanentCount(playerA, "Saproling", 4); // 1 from turn 2 and 3 from turn 3 + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SagesReverieTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SagesReverieTest.java new file mode 100644 index 00000000000..76ac28c6922 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SagesReverieTest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.enchantments; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class SagesReverieTest extends CardTestPlayerBase { + + /* + 21:11: MarioPineda casts Sage's Reverie [26d] targeting face down creature + 21:11: Ability triggers: Sage's Reverie [26d] - When Sage's Reverie [26d] enters the battlefield, draw a card for each aura you control that's attached to a creature. + 21:11: mbvash casts Crackling Doom [b78] + 21:11: MarioPineda loses 2 life + 21:11: MarioPineda sacrificed face down creature + 21:11: mbvash puts Crackling Doom [b78] from stack into his or her graveyard + 21:11: Cloudform [9cd] is put into graveyard from battlefield + 21:11: Sage's Reverie [26d] is put into graveyard from battlefield + 21:11: MarioPineda draws two cards + + There were two other Auras on the battlefield, and Sage's Reverie made me draw two cards even though the creature it was going to enchant left the battlefield. + + http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/604851-sages-reverie-question + */ + @Test + public void testNoCardDrawIfTargetIllegal() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 5); + // Enchant creature + // When Sage's Reverie enters the battlefield, draw a card for each aura you control that's attached to a creature. + addCard(Zone.BATTLEFIELD, playerA, "Sage's Reverie", 1); // {3}{W} + // Enchant creature + // Enchanted creature has lifelink + addCard(Zone.HAND, playerA, "Lifelink", 1); // {W} + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Swamp", 3); + // Destroy target creature or planeswalker. + addCard(Zone.HAND, playerB, "Hero's Downfall"); // {1}{B}{B} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lifelink", "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sage's Reverie", "Pillarfield Ox"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Hero's Downfall", "Pillarfield Ox"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Lifelink", 1); + assertGraveyardCount(playerB, "Hero's Downfall", 1); + assertGraveyardCount(playerA, "Pillarfield Ox", 1); + assertGraveyardCount(playerA, "Sage's Reverie", 1); + + assertHandCount(playerA, 0); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SkullclampTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SkullclampTest.java new file mode 100644 index 00000000000..8f4e7415e6b --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SkullclampTest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.enchantments; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class SkullclampTest extends CardTestPlayerBase { + + /** + * Skullclamp and the creature it's attached to are destroyed by same + * Pernicious Deed activation. AFAIK Skullclamp should trigger, but it + * doesn't. + * + * 400.7e Abilities of Auras that trigger when the enchanted permanent + * leaves the battlefield can find the new object that Aura became in its + * owners graveyard if it was put into that graveyard at the same time the + * enchanted permanent left the battlefield. It can also find the new object + * that Aura became in its owners graveyard as a result of being put there + * as a state-based action for not being attached to a permanent. (See rule + * 704.5n.) + * + */ + @Test + public void testPerniciousDeed() { + // Equipped creature gets +1/-1. + // Whenever equipped creature dies, draw two cards. + // Equip {1} + addCard(Zone.BATTLEFIELD, playerA, "Skullclamp", 1); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2); + // {X}, Sacrifice Pernicious Deed: Destroy each artifact, creature, and enchantment with converted mana cost X or less. + addCard(Zone.BATTLEFIELD, playerB, "Pernicious Deed"); // Enchantment + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip", "Silvercoat Lion"); + + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "{X},Sacrifice"); + setChoice(playerB, "X=2"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerA, "Skullclamp", 1); + assertGraveyardCount(playerA, "Silvercoat Lion", 1); + + assertGraveyardCount(playerB, "Pernicious Deed", 1); + + assertPermanentCount(playerA, "Pillarfield Ox", 1); + + assertHandCount(playerA, 2); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SpreadingSeasTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SpreadingSeasTest.java new file mode 100644 index 00000000000..1c5f87fabb9 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/SpreadingSeasTest.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.enchantments; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class SpreadingSeasTest extends CardTestPlayerBase { + + /** + * Played Spreading Seas on opps manland (e.g. Blinkmoth Nexus) . He + * activated it on response, seas resolves but the manland loses creature + * type what should not happened. + * + * 305.7. If an effect changes a land’s subtype to one or more of the basic + * land types, the land no longer has its old land type. It loses all + * abilities generated from its rules text and its old land types, and it + * gains the appropriate mana ability for each new basic land type. Note + * that this doesn’t remove any abilities that were granted to the land by + * other effects. Changing a land’s subtype doesn’t add or remove any card + * types (such as creature) or supertypes (such as basic, legendary, and + * snow) the land may have. If a land gains one or more land types in + * addition to its own, it keeps its land types and rules text, and it gains + * the new land types and mana abilities. + * + */ + @Test + public void testCreatureTypeStays() { + // Enchant land + // When Spreading Seas enters the battlefield, draw a card. + // Enchanted land is an Island. + addCard(Zone.HAND, playerA, "Spreading Seas", 1); // {1}{U} + addCard(Zone.BATTLEFIELD, playerA, "Island", 2); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 1); + // Tap: Add 1 to your mana pool. + // {1}: Blinkmoth Nexus becomes a 1/1 Blinkmoth artifact creature with flying until end of turn. It's still a land. + // {1}, {T}: Target Blinkmoth gets +1/+1 until end of turn. + addCard(Zone.BATTLEFIELD, playerB, "Blinkmoth Nexus"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Spreading Seas", "Blinkmoth Nexus"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}:", NO_TARGET, "Spreading Seas"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, "Spreading Seas", 0); + assertGraveyardCount(playerA, "Spreading Seas", 0); + assertPowerToughness(playerB, "Blinkmoth Nexus", 1, 1); + + assertPermanentCount(playerA, "Spreading Seas", 1); + assertHandCount(playerA, 1); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/StarfieldOfNyxTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/StarfieldOfNyxTest.java new file mode 100644 index 00000000000..25921da3b33 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/enchantments/StarfieldOfNyxTest.java @@ -0,0 +1,125 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.enchantments; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.game.permanent.Permanent; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class StarfieldOfNyxTest extends CardTestPlayerBase { + + /** + * I had Starfield of Nyx out. With the upkeep trigger, I brought back a + * Cloudform, which was the fifth enchantment. I had another Cloudform, and + * Starfield of Nyx not only turned both of them into creatures (it + * shouldn't, because they're auras), but it also destroyed them. The + * manifests stayed on the battlefield without Flying or Hexproof. + * + */ + @Test + public void testCloudform() { + // At the beginning of your upkeep, if you control an artifact, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield. + // Whenever one or more artifact creatures you control deal combat damage to a player, draw a card. + addCard(Zone.BATTLEFIELD, playerA, "Thopter Spy Network", 2); // {2}{U}{U} - added to come to 5 enchantments on the battlefield + addCard(Zone.BATTLEFIELD, playerA, "Island", 8); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + // At the beginning of your upkeep, you may return target enchantment card from your graveyard to the battlefield. + // As long as you control five or more enchantments, each other non-Aura enchantment you control is a creature in + // addition to its other types and has base power and base toughness each equal to its converted mana cost. + addCard(Zone.HAND, playerA, "Starfield of Nyx"); // "{4}{W}" + // When Cloudform enters the battlefield, it becomes an Aura with enchant creature. Manifest the top card of your library and attach Cloudform to it. + // Enchanted creature has flying and hexproof. + addCard(Zone.HAND, playerA, "Cloudform"); // {1}{U}{U} + addCard(Zone.GRAVEYARD, playerA, "Cloudform"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Starfield of Nyx"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cloudform"); + + addTarget(playerA, "Cloudform"); + + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertGraveyardCount(playerA, "Thopter Spy Network", 0); + assertPowerToughness(playerA, "", 2, 2, Filter.ComparisonScope.All); // the manifested cards + assertPermanentCount(playerA, "Starfield of Nyx", 1); + assertPowerToughness(playerA, "Thopter Spy Network", 4, 4, Filter.ComparisonScope.All); + assertPermanentCount(playerA, "Cloudform", 2); + } + + /** + * Regarding Starfield of Nyx: I tried to bring back a Singing Bell Strike + * to enchant Silumgar, the Drifting Death. I chose the Aura, but instead of + * enchanting Silumgar, it stayed in the graveyard. This shouldn't be the + * case, because Auras only target when they're cast as spells. + */ + @Test + public void testHexproof() { + // At the beginning of your upkeep, if you control an artifact, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield. + // Whenever one or more artifact creatures you control deal combat damage to a player, draw a card. + addCard(Zone.BATTLEFIELD, playerA, "Plains", 5); + // At the beginning of your upkeep, you may return target enchantment card from your graveyard to the battlefield. + // As long as you control five or more enchantments, each other non-Aura enchantment you control is a creature in + // addition to its other types and has base power and base toughness each equal to its converted mana cost. + addCard(Zone.HAND, playerA, "Starfield of Nyx"); // "{4}{W}" + // Enchant creature + // When Singing Bell Strike enters the battlefield, tap enchanted creature. + // Enchanted creature doesn't untap during its controller's untap step. + // Enchanted creature has "{6}: Untap this creature." + addCard(Zone.GRAVEYARD, playerA, "Singing Bell Strike"); + + addCard(Zone.BATTLEFIELD, playerB, "Silumgar, the Drifting Death", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Starfield of Nyx"); + + addTarget(playerA, "Singing Bell Strike"); + setChoice(playerA, "Silumgar, the Drifting Death"); + + setStopAt(3, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Starfield of Nyx", 1); + assertPermanentCount(playerA, "Singing Bell Strike", 1); + + Permanent enchantment = getPermanent("Singing Bell Strike", playerA); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent enchanted = currentGame.getPermanent(enchantment.getAttachedTo()); + Assert.assertEquals("Silumgar was enchanted", enchanted.getName().equals("Silumgar, the Drifting Death"), true); + } else { + Assert.assertEquals("Singing Bell Strike not on the battlefield", false, true); + } + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/facedown/BaneAlleyBrokerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/facedown/BaneAlleyBrokerTest.java index 025c46e4f3f..d8f254f899e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/facedown/BaneAlleyBrokerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/facedown/BaneAlleyBrokerTest.java @@ -3,9 +3,7 @@ package org.mage.test.cards.facedown; import mage.cards.Card; import mage.constants.PhaseStep; import mage.constants.Zone; -import mage.game.ExileZone; import org.junit.Assert; -import static org.junit.Assert.assertTrue; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -15,14 +13,12 @@ import org.mage.test.serverside.base.CardTestPlayerBase; public class BaneAlleyBrokerTest extends CardTestPlayerBase { /** - * Bane Alley Broker - * Creature — Human Rogue 0/3, 1UB (3) - * {T}: Draw a card, then exile a card from your hand face down. - * You may look at cards exiled with Bane Alley Broker. - * {U}{B}, {T}: Return a card exiled with Bane Alley Broker to its owner's hand. - * + * Bane Alley Broker Creature — Human Rogue 0/3, 1UB (3) {T}: Draw a card, + * then exile a card from your hand face down. You may look at cards exiled + * with Bane Alley Broker. {U}{B}, {T}: Return a card exiled with Bane Alley + * Broker to its owner's hand. + * */ - // test that cards exiled using Bane Alley Broker are face down @Test public void testBaneAlleyBroker() { @@ -31,20 +27,20 @@ public class BaneAlleyBrokerTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Sejiri Merfolk"); addCard(Zone.BATTLEFIELD, playerA, "Island"); addCard(Zone.BATTLEFIELD, playerA, "Swamp"); - + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Draw a card, then exile a card from your hand face down."); addTarget(playerA, "Goblin Roughrider"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); - + assertHandCount(playerA, 2); assertHandCount(playerA, "Sejiri Merfolk", 1); assertHandCount(playerA, "Goblin Roughrider", 0); assertExileCount("Goblin Roughrider", 1); - for (Card card :currentGame.getExile().getAllCards(currentGame)){ + for (Card card : currentGame.getExile().getAllCards(currentGame)) { if (card.getName().equals("Goblin Roughrider")) { Assert.assertTrue("Exiled card is not face down", card.isFaceDown(currentGame)); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/ConditionalManaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/ConditionalManaTest.java index d7a9ca20297..80560b23bec 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/ConditionalManaTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/ConditionalManaTest.java @@ -36,7 +36,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class ConditionalManaTest extends CardTestPlayerBase { @Test @@ -47,11 +46,11 @@ public class ConditionalManaTest extends CardTestPlayerBase { // Target player gains 7 life. addCard(Zone.HAND, playerA, "Heroes' Reunion", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Heroes' Reunion", playerA); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Heroes' Reunion", playerA); + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); - + assertGraveyardCount(playerA, "Heroes' Reunion", 1); assertHandCount(playerA, "Heroes' Reunion", 0); // player A could not cast it assertLife(playerA, 27); @@ -63,16 +62,16 @@ public class ConditionalManaTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Pillar of the Paruns", 2); addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); playerA.addChoice("White"); playerA.addChoice("White"); - + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); assertHandCount(playerA, "Silvercoat Lion", 1); // player A could not cast Silvercoat Lion because the conditional mana is not available } - + @Test public void testWorkingWithReflectingPool() { addCard(Zone.BATTLEFIELD, playerA, "Cavern of Souls", 1); @@ -80,13 +79,13 @@ public class ConditionalManaTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); - + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); - assertPermanentCount(playerA, "Silvercoat Lion", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); } - + @Test public void testWorkingWithReflectingPool2() { addCard(Zone.BATTLEFIELD, playerA, "Reflecting Pool", 1); // can create white mana without restriction from the Hive @@ -98,10 +97,48 @@ public class ConditionalManaTest extends CardTestPlayerBase { setChoice(playerA, "White"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); - + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); - - assertPermanentCount(playerA, "Silvercoat Lion", 1); - } + + assertPermanentCount(playerA, "Silvercoat Lion", 1); + } + + /** + * I wasunable to use "Rosheen Meanderer" ability to pay for "Candelabra of + * Tawnos" ability even thought it has "X" on its cost + */ + @Test + public void testRosheenMeandererUsingAbility() { + // Flying + addCard(Zone.HAND, playerB, "Snapping Drake", 2); // {3}{U} + // {T}: Add {4} to your mana pool. Spend this mana only on costs that contain {X}. + addCard(Zone.BATTLEFIELD, playerB, "Rosheen Meanderer", 1); + // {X}, {T}: Untap X target lands. + addCard(Zone.BATTLEFIELD, playerB, "Candelabra of Tawnos", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 4); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Snapping Drake"); + + activateManaAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{T}: Add {4}"); + + activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{X},{T}: Untap"); + setChoice(playerB, "X=4"); + addTarget(playerB, "Island"); + addTarget(playerB, "Island"); + addTarget(playerB, "Island"); + addTarget(playerB, "Island"); + + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Snapping Drake"); + + setStopAt(2, PhaseStep.END_TURN); + execute(); + + assertTappedCount("Island", true, 4); + assertTappedCount("Rosheen Meanderer", true, 1); + assertTappedCount("Candelabra of Tawnos", true, 1); + + assertPermanentCount(playerB, "Snapping Drake", 2); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/HybridManaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/HybridManaTest.java new file mode 100644 index 00000000000..d39028ab764 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/HybridManaTest.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.mana; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class HybridManaTest extends CardTestPlayerBase { + + @Test + public void testCastReaperKingMonoHybrid() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + + // Other Scarecrow creatures you control get +1/+1. + // Whenever another Scarecrow enters the battlefield under your control, destroy target permanent. + addCard(Zone.HAND, playerA, "Reaper King", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reaper King"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Reaper King", 1); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/NykthosShrineToNyxTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/NykthosShrineToNyxTest.java index 792b0c9678e..256c4dfc7a6 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/NykthosShrineToNyxTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/NykthosShrineToNyxTest.java @@ -52,7 +52,7 @@ public class NykthosShrineToNyxTest extends CardTestPlayerBase { // Omnath, Locus of Mana gets +1/+1 for each green mana in your mana pool. addCard(Zone.BATTLEFIELD, playerA, "Omnath, Locus of Mana", 1); - activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color. (Your devotion to a color is the number of mana symbols of that color in the mana costs of permanents you control.)."); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color."); setChoice(playerA, "Green"); setStopAt(1, PhaseStep.PRECOMBAT_MAIN); @@ -75,12 +75,12 @@ public class NykthosShrineToNyxTest extends CardTestPlayerBase { // Omnath, Locus of Mana gets +1/+1 for each green mana in your mana pool. addCard(Zone.BATTLEFIELD, playerA, "Omnath, Locus of Mana", 1); - activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color. (Your devotion to a color is the number of mana symbols of that color in the mana costs of permanents you control.)."); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color."); setChoice(playerA, "Green"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Untap another target permanent.","Nykthos, Shrine to Nyx"); - activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color. (Your devotion to a color is the number of mana symbols of that color in the mana costs of permanents you control.)."); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color."); setChoice(playerA, "Green"); setStopAt(1, PhaseStep.PRECOMBAT_MAIN); @@ -106,12 +106,12 @@ public class NykthosShrineToNyxTest extends CardTestPlayerBase { // If unused mana would empty from your mana pool, that mana becomes colorless instead. addCard(Zone.BATTLEFIELD, playerA, "Kruphix, God of Horizons", 1); // 1 G devotion - activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color. (Your devotion to a color is the number of mana symbols of that color in the mana costs of permanents you control.)."); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color."); setChoice(playerA, "Green"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Untap another target permanent.","Nykthos, Shrine to Nyx"); - activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color. (Your devotion to a color is the number of mana symbols of that color in the mana costs of permanents you control.)."); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Choose a color. Add to your mana pool an amount of mana of that color equal to your devotion to that color."); setChoice(playerA, "Green"); setStopAt(1, PhaseStep.BEGIN_COMBAT); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/VorinclexVoiceOfHungerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/VorinclexVoiceOfHungerTest.java new file mode 100644 index 00000000000..abc87ae69d3 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/VorinclexVoiceOfHungerTest.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.mana; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class VorinclexVoiceOfHungerTest extends CardTestPlayerBase { + + /** + * Vorinclex, Voice of Hunger is not mana doubling River of Tears. + */ + @Test + public void testRiverOfTears() { + // Trample + // Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced. + // Whenever an opponent taps a land for mana, that land doesn't untap during its controller's next untap step. + addCard(Zone.BATTLEFIELD, playerA, "Vorinclex, Voice of Hunger", 1); + // {T}: Add {U} to your mana pool. If you played a land this turn, add {B} to your mana pool instead. + addCard(Zone.BATTLEFIELD, playerA, "River of Tears", 1); + addCard(Zone.HAND, playerA, "Vedalken Mastermind", 1); + + // because available mana calculation does not work correctly with Vorinclex, Voice of Hunger we have to tap the land manually + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {U} to your mana pool"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vedalken Mastermind"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Vedalken Mastermind", 1); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/modal/ModalTriggeredAbilityTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/modal/ModalTriggeredAbilityTest.java new file mode 100644 index 00000000000..750d5f83474 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/modal/ModalTriggeredAbilityTest.java @@ -0,0 +1,95 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.modal; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class ModalTriggeredAbilityTest extends CardTestPlayerBase { + + @Test + public void testBlizzardSpecterReturn() { + // Flying + // Whenever Blizzard Specter deals combat damage to a player, choose one + // - That player returns a permanent he or she controls to its owner's hand; + // or that player discards a card. + addCard(Zone.BATTLEFIELD, playerB, "Blizzard Specter"); + + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); + addCard(Zone.HAND, playerA, "Pillarfield Ox"); + + attack(2, playerB, "Blizzard Specter"); + setModeChoice(playerB, "1"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertHandCount(playerA, "Silvercoat Lion", 1); + assertHandCount(playerA, "Pillarfield Ox", 1); + + assertLife(playerA, 18); + assertLife(playerB, 20); + + } + + @Test + public void testBlizzardSpecterDiscard() { + // Flying + // Whenever Blizzard Specter deals combat damage to a player, choose one + // - That player returns a permanent he or she controls to its owner's hand; + // or that player discards a card. + addCard(Zone.BATTLEFIELD, playerB, "Blizzard Specter"); + + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); + addCard(Zone.HAND, playerA, "Pillarfield Ox"); + + attack(2, playerB, "Blizzard Specter"); + setModeChoice(playerB, "2"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Silvercoat Lion", 1); + + assertHandCount(playerA, "Silvercoat Lion", 0); + assertHandCount(playerA, "Pillarfield Ox", 0); + + assertGraveyardCount(playerA, "Pillarfield Ox", 1); + + assertLife(playerA, 18); + assertLife(playerB, 20); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/JaceTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/JaceTest.java new file mode 100644 index 00000000000..c8e6cd1adf8 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/JaceTest.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.planeswalker; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.counters.CounterType; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class JaceTest extends CardTestPlayerBase { + + @Test + public void TelepathUnboundSecondAbility() { + // +1: Up to one target creature gets -2/-0 until your next turn. + // -3: You may cast target instant or sorcery card from your graveyard this turn. If that card would be put into your graveyard this turn, exile it instead. + // -9: You get an emblem with "Whenever you cast a spell, target opponent puts the top five cards of his or her library into his or her graveyard". + addCard(Zone.BATTLEFIELD, playerA, "Jace, Telepath Unbound"); // starts with 7 Loyality counters + + // As an additional cost to cast Magmatic Insight, discard a land card. + // Draw two cards. + addCard(Zone.GRAVEYARD, playerA, "Magmatic Insight");// {R} + addCard(Zone.HAND, playerA, "Plains"); + + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-3: You may cast target instant", "Magmatic Insight"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Magmatic Insight"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Jace, Telepath Unbound", 1); + assertCounterCount("Jace, Telepath Unbound", CounterType.LOYALTY, 2); // 5 - 3 = 2 + + assertExileCount("Magmatic Insight", 1); + + assertHandCount(playerA, 2); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/RedirectDamageToPlaneswalkerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/RedirectDamageToPlaneswalkerTest.java new file mode 100644 index 00000000000..3b95c44288e --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/planeswalker/RedirectDamageToPlaneswalkerTest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.planeswalker; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.counters.CounterType; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class RedirectDamageToPlaneswalkerTest extends CardTestPlayerBase { + + @Test + public void testDirectDamage() { + // +2: Look at the top card of target player's library. You may put that card on the bottom of that player's library. + // 0: Draw three cards, then put two cards from your hand on top of your library in any order. + // −1: Return target creature to its owner's hand. + addCard(Zone.BATTLEFIELD, playerA, "Jace, the Mind Sculptor"); // starts with 3 Loyality counters + + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); + addCard(Zone.HAND, playerB, "Lightning Bolt"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+2:", playerB); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); + setChoice(playerB, "Yes"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, "Jace, the Mind Sculptor", 1); + assertCounterCount("Jace, the Mind Sculptor", CounterType.LOYALTY, 2); // 3 + 2 - 3 = 2 + + assertGraveyardCount(playerB, "Lightning Bolt", 1); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/protection/ProtectionTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/protection/ProtectionTest.java new file mode 100644 index 00000000000..fff79b5cca9 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/protection/ProtectionTest.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.protection; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class ProtectionTest extends CardTestPlayerBase { + + @Test + public void testProtectionFromColoredSpells() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); + // Delve + // Destroy target creature. + addCard(Zone.HAND, playerA, "Murderous Cut"); // {4}{B} + + // Emrakul, the Aeons Torn can't be countered. + // When you cast Emrakul, take an extra turn after this one. + // Flying, protection from colored spells, annihilator 6 + // When Emrakul is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library. + addCard(Zone.BATTLEFIELD, playerB, "Emrakul, the Aeons Torn"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Murderous Cut", "Emrakul, the Aeons Torn"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerB, "Emrakul, the Aeons Torn", 1); + assertHandCount(playerA, "Murderous Cut", 1); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/protection/gain/GainProtectionTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/protection/gain/GainProtectionTest.java index 945d61b8325..d3bb9c3eea8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/protection/gain/GainProtectionTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/protection/gain/GainProtectionTest.java @@ -70,4 +70,64 @@ public class GainProtectionTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Elite Vanguard", 6, 5); } + @Test + public void testGainProtectionByEnchantment() { + addCard(Zone.BATTLEFIELD, playerB, "Plains", 5); + // Flying + // When Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner's control. + addCard(Zone.BATTLEFIELD, playerB, "Brago, King Eternal"); + // Enchant creature + // When Pentarch Ward enters the battlefield, draw a card. + // As Pentarch Ward enters the battlefield, choose a color. + // Enchanted creature has protection from the chosen color. This effect doesn't remove Pentarch Ward. + addCard(Zone.HAND, playerB, "Pentarch Ward");// "{2}{W}" + // Enchant creature + // Enchanted creature gets +1/+1 and has "Whenever this creature attacks, tap target creature defending player controls." + addCard(Zone.HAND, playerB, "Grasp of the Hieromancer"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Pentarch Ward", "Brago, King Eternal"); + setChoice(playerB, "White"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Grasp of the Hieromancer", "Brago, King Eternal"); + + setStopAt(2, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerB, "Pentarch Ward", 1); + assertHandCount(playerB, "Grasp of the Hieromancer", 1); + assertHandCount(playerB, 3); + } + + /** + * Pentarch Ward on Brago naming white. Brago combat trigger resolves + * blinking Pentarch Ward. Brago retains protection from white even though + * Pentarch Ward is now exiled, making him unable to be re-enchanted by + * Pentarch Ward. + */ + @Test + public void testGainLooseProtectionByEnchantment() { + addCard(Zone.BATTLEFIELD, playerB, "Plains", 3); + // Flying + // When Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner's control. + addCard(Zone.BATTLEFIELD, playerB, "Brago, King Eternal"); + // Enchant creature + // When Pentarch Ward enters the battlefield, draw a card. + // As Pentarch Ward enters the battlefield, choose a color. + // Enchanted creature has protection from the chosen color. This effect doesn't remove Pentarch Ward. + addCard(Zone.HAND, playerB, "Pentarch Ward");// "{2}{W}" + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Pentarch Ward", "Brago, King Eternal"); + setChoice(playerB, "White"); + + attack(2, playerB, "Brago, King Eternal"); + addTarget(playerB, "Pentarch Ward"); + addTarget(playerB, "Brago, King Eternal"); + + setStopAt(2, PhaseStep.END_COMBAT); + execute(); + + assertLife(playerA, 18); + assertPermanentCount(playerB, "Pentarch Ward", 1); + assertHandCount(playerB, 3); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java index e1cb48a3b5a..677561abbcb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DoublingSeasonTest.java @@ -7,17 +7,19 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** - * Doubling Season: - * If an effect would put one or more tokens onto the battlefield under your control, it puts twice that many of those tokens onto the battlefield instead. - * If an effect would place one or more counters on a permanent you control, it places twice that many of those counters on that permanent instead. + * Doubling Season: If an effect would put one or more tokens onto the + * battlefield under your control, it puts twice that many of those tokens onto + * the battlefield instead. If an effect would place one or more counters on a + * permanent you control, it places twice that many of those counters on that + * permanent instead. * * @author LevelX2 */ public class DoublingSeasonTest extends CardTestPlayerBase { /** - * Tests that instead of one spore counter there were two spore counters added to Pallid Mycoderm - * if Doubling Season is on the battlefield. + * Tests that instead of one spore counter there were two spore counters + * added to Pallid Mycoderm if Doubling Season is on the battlefield. */ @Test public void testDoubleSporeCounter() { @@ -35,8 +37,9 @@ public class DoublingSeasonTest extends CardTestPlayerBase { } /** - * Tests if 3 damage are prevented with Test of Faith and Doubling Season is on - * the battlefield, that 6 +1/+1 counters are added to the target creature. + * Tests if 3 damage are prevented with Test of Faith and Doubling Season is + * on the battlefield, that 6 +1/+1 counters are added to the target + * creature. */ @Test public void testDoubleP1P1Counter() { @@ -63,9 +66,10 @@ public class DoublingSeasonTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Silvercoat Lion", 8, 8); } + /** - * Tests that 2 Saproling tokens are created instead of one if Doubling Season is on - * the battlefield. + * Tests that 2 Saproling tokens are created instead of one if Doubling + * Season is on the battlefield. */ @Test public void testDoubleTokens() { @@ -89,4 +93,43 @@ public class DoublingSeasonTest extends CardTestPlayerBase { } + /** + * Creatures with enter the battlefield triggers are causing a bug when + * multiple copies are made simultaneously (ie via Doubling Season + + * Kiki-Jiki, Mirror Breaker or Rite of Replication). After the tokens have + * entered the battlefield it asks their controller to choose the order that + * the triggered abilities on the stack but no window opens to select the + * triggers leaving no option to move the game forward (besides rollback and + * just not making the tokens). Several attempts with the different + * combinations make it *seem to be a general bug about duplicates entering + * at the same time and not related to the specific cards. + */ + @Test + public void testDoubleRiteOfReplication() { + /** + * If an effect would put one or more tokens onto the battlefield under + * your control, it puts twice that many of those tokens onto the + * battlefield instead. If an effect would place one or more counters on + * a permanent you control, it places twice that many of those counters + * on that permanent instead. + */ + + addCard(Zone.BATTLEFIELD, playerA, "Doubling Season"); + addCard(Zone.BATTLEFIELD, playerA, "Island", 9); + + // Put a token that's a copy of target creature onto the battlefield. If Rite of Replication was kicked, put five of those tokens onto the battlefield instead. + addCard(Zone.HAND, playerA, "Rite of Replication"); + // When Venerable Monk enters the battlefield, you gain 2 life. + addCard(Zone.BATTLEFIELD, playerB, "Venerable Monk", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rite of Replication", "Venerable Monk"); + setChoice(playerA, "Yes"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 40); + assertPermanentCount(playerA, "Venerable Monk", 10); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DrawEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DrawEffectsTest.java index e5141680ace..05811424a5d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DrawEffectsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/DrawEffectsTest.java @@ -82,4 +82,32 @@ public class DrawEffectsTest extends CardTestPlayerBase { assertHandCount(playerB, 1); } + /** + * Notion thief and Reforge the Soul - opponent got 0 cards - ok but I got + * only 7 cards (should be 14) + */ + @Test + public void testNotionThief2() { + addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 3); + skipInitShuffling(); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5); + // Flash + // If an opponent would draw a card except the first one he or she draws in each of his or her draw steps, instead that player skips that draw and you draw a card. + addCard(Zone.BATTLEFIELD, playerA, "Notion Thief", 1); + // Each player discards his or her hand, then draws seven cards. + // Miracle {1}{R} + addCard(Zone.HAND, playerA, "Reforge the Soul", 1); + + addCard(Zone.HAND, playerB, "Mountain", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reforge the Soul"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Reforge the Soul", 1); + assertGraveyardCount(playerB, "Mountain", 1); + assertHandCount(playerA, 14); + assertHandCount(playerB, 0); + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/HumilityTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/HumilityTest.java new file mode 100644 index 00000000000..e8fdbcb958a --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/HumilityTest.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.replacement; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class HumilityTest extends CardTestPlayerBase { + + /** + * During a commander game both were on the battlefield, and Masumaro's P/T + * was not displaying as 1/1. + */ + @Test + public void testHumilityAndMasumaro() { + + // Masumaro, First to Live's power and toughness are each equal to twice the number of cards in your hand. + addCard(Zone.BATTLEFIELD, playerB, "Masumaro, First to Live"); + + // Enchantment {2}{W}{W} + // All creatures lose all abilities and are 1/1. + addCard(Zone.BATTLEFIELD, playerA, "Humility"); + + addCard(Zone.HAND, playerB, "Plains", 3); + + setStopAt(1, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPowerToughness(playerB, "Masumaro, First to Live", 1, 1); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/LeylineOfTheVoidTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/LeylineOfTheVoidTest.java index 20b7bdec98d..56e196a91f8 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/LeylineOfTheVoidTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/LeylineOfTheVoidTest.java @@ -29,7 +29,6 @@ package org.mage.test.cards.replacement; import mage.constants.PhaseStep; import mage.constants.Zone; -import org.junit.Assert; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -37,7 +36,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class LeylineOfTheVoidTest extends CardTestPlayerBase { /** @@ -57,20 +55,51 @@ public class LeylineOfTheVoidTest extends CardTestPlayerBase { // If Leyline of the Void is in your opening hand, you may begin the game with it on the battlefield. // If a card would be put into an opponent's graveyard from anywhere, exile it instead. addCard(Zone.BATTLEFIELD, playerA, "Leyline of the Void"); - + // {X}, {T}: Target opponent puts cards from the top of his or her library into his or her graveyard until a creature card or X cards are put into that graveyard this way, whichever comes first. If a creature card is put into that graveyard this way, sacrifice Helm of Obedience and put that card onto the battlefield under your control. X can't be 0. addCard(Zone.BATTLEFIELD, playerA, "Helm of Obedience"); - activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{X},{T}: Target opponent puts cards", playerB); setChoice(playerA, "X=1"); setStopAt(1, PhaseStep.END_TURN); execute(); - + assertExileCount(playerB, 71); // All cards go to exile replaced from Leyline of the void } - + + /** + * Today i casted Ill-gotten Gains in EDH (with a leyline of the veil in + * play) and the spell simply discarded both players hands not letting + * either of us choose cards to get back, this ended up with me losing the + * game as i was going to combo off some cards in yard. + */ + @Test + public void testIllgottenGains() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4); + + // If Leyline of the Void is in your opening hand, you may begin the game with it on the battlefield. + // If a card would be put into an opponent's graveyard from anywhere, exile it instead. + addCard(Zone.BATTLEFIELD, playerA, "Leyline of the Void"); + + // Exile Ill-Gotten Gains. + // Each player discards his or her hand, + // then returns up to three cards from his or her graveyard to his or her hand. + addCard(Zone.HAND, playerA, "Ill-Gotten Gains"); // Sorcery - {2}{B}{B} + addCard(Zone.HAND, playerA, "Silvercoat Lion", 4); + addCard(Zone.HAND, playerB, "Silvercoat Lion", 4); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ill-Gotten Gains"); + setChoice(playerA, "Silvercoat Lion^Silvercoat Lion^Silvercoat Lion"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertExileCount(playerB, 4); + assertHandCount(playerB, 0); + + assertExileCount(playerA, 1); + assertHandCount(playerA, 3); + } + } - - diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/PillarOfFlameTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/PillarOfFlameTest.java index 6c1e294d57c..082e3440095 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/PillarOfFlameTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/PillarOfFlameTest.java @@ -6,22 +6,30 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** - * Pillar of Flame: - * Pillar of Flame deals 2 damage to target creature or player. If a creature dealt damage this way would die this turn, exile it instead. + * Pillar of Flame: Pillar of Flame deals 2 damage to target creature or player. + * If a creature dealt damage this way would die this turn, exile it instead. * * @author LevelX2 */ public class PillarOfFlameTest extends CardTestPlayerBase { /** - * Tests when cast Pillar of Flame targeting opponent there is no influence on dying creature of opponent + * Tests when cast Pillar of Flame targeting opponent there is no influence + * on dying creature of opponent */ @Test public void testNotTriggeringExileItInstead() { - addCard(Zone.BATTLEFIELD, playerA, "Lightning Mauler"); - addCard(Zone.BATTLEFIELD, playerA, "Rakdos Cackler"); + // Soulbond + // As long as Lightning Mauler is paired with another creature, both creatures have haste. + addCard(Zone.BATTLEFIELD, playerA, "Lightning Mauler"); // 2/1 + // Unleash (You may have this creature enter the battlefield with a +1/+1 counter on it. It can't block as long as it has a +1/+1 counter on it.) + addCard(Zone.BATTLEFIELD, playerA, "Rakdos Cackler"); // 1/1 + // Pillar of Flame deals 2 damage to target creature or player. + // If a creature dealt damage this way would die this turn, exile it instead. addCard(Zone.HAND, playerA, "Pillar of Flame"); + // Soulbond + // As long as Stonewright is paired with another creature, each of those creatures has "{R}: This creature gets +1/+0 until end of turn." addCard(Zone.HAND, playerA, "Stonewright"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); @@ -49,7 +57,8 @@ public class PillarOfFlameTest extends CardTestPlayerBase { } /** - * Tests when cast Pillar of Flame targeting creature it goes to exile if dying later + * Tests when cast Pillar of Flame targeting creature it goes to exile if + * dying later */ @Test public void testTriggeringExileItInstead() { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/TorporOrbTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/TorporOrbTest.java index 441d68754b9..c8694f3540b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/TorporOrbTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/TorporOrbTest.java @@ -6,8 +6,8 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** - * Torpor Orb: - * Creatures entering the battlefield don't cause abilities to trigger. + * Torpor Orb: Creatures entering the battlefield don't cause abilities to + * trigger. * * @author noxx */ @@ -15,7 +15,10 @@ public class TorporOrbTest extends CardTestPlayerBase { @Test public void testWallOfOmens() { + // Creatures entering the battlefield don't cause abilities to trigger. addCard(Zone.BATTLEFIELD, playerA, "Torpor Orb"); + // Defender + // When Wall of Omens enters the battlefield, draw a card. addCard(Zone.HAND, playerA, "Wall of Omens"); addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); @@ -33,7 +36,8 @@ public class TorporOrbTest extends CardTestPlayerBase { } /** - * Treacherous Pit-Dweller doesnt function properly with Torpor Orb and Hushwing Gryff + * Treacherous Pit-Dweller doesnt function properly with Torpor Orb and + * Hushwing Gryff */ @Test public void testPitTweller() { @@ -42,8 +46,8 @@ public class TorporOrbTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Lightning Bolt"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); - - attack(2, playerB, "Treacherous Pit-Dweller"); + + attack(2, playerB, "Treacherous Pit-Dweller"); castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerA, "Lightning Bolt", "Treacherous Pit-Dweller"); setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); @@ -53,9 +57,9 @@ public class TorporOrbTest extends CardTestPlayerBase { assertLife(playerB, 20); assertGraveyardCount(playerA, "Lightning Bolt", 1); - + assertPermanentCount(playerB, "Treacherous Pit-Dweller", 1); - assertPowerToughness(playerB, "Treacherous Pit-Dweller", 5,4); + assertPowerToughness(playerB, "Treacherous Pit-Dweller", 5, 4); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/ZoneChangeReplacementTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/ZoneChangeReplacementTest.java index b2f712686de..b113e20ba6a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/ZoneChangeReplacementTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/ZoneChangeReplacementTest.java @@ -382,4 +382,39 @@ public class ZoneChangeReplacementTest extends CardTestPlayerBase { } + /** + * I was using Anafenza, the Foremost as Commander. She attacked and traded + * with two creatures. I moved Anafenza to the Command Zone, but the + * opponent's creatures "when {this} dies" abilities triggered. Since + * Anafenza and those creatures all received lethal damage at the same time, + * the creatures should have been exiled due to Anafenza's replacement + * effect, but I guess since the logic asks if you want to use the Command + * Zone replacement effect first, that it doesn't see her leaving the + * battlefield at the same time as the other creatures. + * + * http://blogs.magicjudges.org/rulestips/2015/05/anafenza-vs-deathmist-raptor/ + */ + @Test + public void testAnafenzaExileInCombat() { + // Whenever Anafenza, the Foremost attacks, put a +1/+1 counter on another target tapped creature you control. + // If a creature card would be put into an opponent's graveyard from anywhere, exile it instead. + addCard(Zone.BATTLEFIELD, playerA, "Anafenza, the Foremost"); // 4/4 + + // Reach (This creature can block creatures with flying.) + addCard(Zone.BATTLEFIELD, playerB, "Skyraker Giant"); // 4/3 + + attack(2, playerB, "Skyraker Giant"); + block(2, playerA, "Anafenza, the Foremost", "Skyraker Giant"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertExileCount("Skyraker Giant", 1); + assertPermanentCount(playerA, "Anafenza, the Foremost", 0); + assertGraveyardCount(playerA, "Anafenza, the Foremost", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/canttarget/CanopyCoverTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/canttarget/CanopyCoverTest.java new file mode 100644 index 00000000000..d3c0125f01a --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/canttarget/CanopyCoverTest.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.replacement.canttarget; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class CanopyCoverTest extends CardTestPlayerBase { + + /** + * Test spell + */ + @Test + public void testCantBeTargetedWithSpells() { + addCard(Zone.HAND, playerB, "Lightning Bolt"); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); // 2/2 Creature - Lion + // Enchanted creature can't be the target of spells or abilities your opponents control. + addCard(Zone.HAND, playerA, "Canopy Cover"); // Enchantment - Aura + + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Canopy Cover", "Silvercoat Lion"); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, "Canopy Cover", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + + assertHandCount(playerB, "Lightning Bolt", 1); + } + + @Test + public void testCantBeTargetedWithAbilities() { + // {U},Sacrifice AEther Spellbomb: Return target creature to its owner's hand. + addCard(Zone.BATTLEFIELD, playerB, "AEther Spellbomb"); + addCard(Zone.BATTLEFIELD, playerB, "Island", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); // 2/2 Creature - Lion + // Enchanted creature can't be the target of spells or abilities your opponents control. + addCard(Zone.HAND, playerA, "Canopy Cover"); // Enchantment - Aura + + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Canopy Cover", "Silvercoat Lion"); + + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "{U},Sacrifice", "Silvercoat Lion"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, "Canopy Cover", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + + assertGraveyardCount(playerB, "AEther Spellbomb", 0); + assertPermanentCount(playerB, "AEther Spellbomb", 1); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/canttarget/GaeasRevengeTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/canttarget/GaeasRevengeTest.java new file mode 100644 index 00000000000..34fa2d09766 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/canttarget/GaeasRevengeTest.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.replacement.canttarget; + +import mage.abilities.keyword.TrampleAbility; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class GaeasRevengeTest extends CardTestPlayerBase { + + /** + * Test spell + */ + @Test + public void testGreenCanTargetWithSpells() { + addCard(Zone.HAND, playerA, "Titanic Growth"); + // Gaea's Revenge can't be countered. + // Haste + // Gaea's Revenge can't be the target of nongreen spells or abilities from nongreen sources. + addCard(Zone.BATTLEFIELD, playerA, "Gaea's Revenge"); // 8/5 Creature - Elemental + + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Titanic Growth", "Gaea's Revenge"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + assertPowerToughness(playerA, "Gaea's Revenge", 12, 9); + } + + @Test + public void testGreenCanTargetWithAnAbilitiy() { + // Gaea's Revenge can't be countered. + // Haste + // Gaea's Revenge can't be the target of nongreen spells or abilities from nongreen sources. + addCard(Zone.BATTLEFIELD, playerB, "Gaea's Revenge"); // 8/5 Creature - Elemental + // Whenever a creature you control becomes blocked, it gets +1/+1 until end of turn. + // {1}{G}: Target creature you control gains trample until end of turn. + addCard(Zone.BATTLEFIELD, playerB, "Somberwald Alpha"); // 3/2 Creature - Wolf + + addCard(Zone.BATTLEFIELD, playerB, "Forest", 2); + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}{G}: Target creature", "Gaea's Revenge"); + + setStopAt(2, PhaseStep.BEGIN_COMBAT); + execute(); + assertAbility(playerB, "Gaea's Revenge", TrampleAbility.getInstance(), true); + assertPowerToughness(playerB, "Gaea's Revenge", 8, 5); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/entersBattlefield/KjeldoranOutpostTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/entersBattlefield/KjeldoranOutpostTest.java new file mode 100644 index 00000000000..01cbc154ab1 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/entersBattlefield/KjeldoranOutpostTest.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.replacement.entersBattlefield; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class KjeldoranOutpostTest extends CardTestPlayerBase { + + @Test + public void testNoPlainsAvailable() { + // If Kjeldoran Outpost would enter the battlefield, sacrifice a Plains instead. If you do, put Kjeldoran Outpost onto the battlefield. If you don't, put it into its owner's graveyard. + // {T}: Add {W} to your mana pool. + // {1}{W}, {tap}: Put a 1/1 white Soldier creature token onto the battlefield. + addCard(Zone.HAND, playerA, "Kjeldoran Outpost"); + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Kjeldoran Outpost"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Kjeldoran Outpost", 0); + assertGraveyardCount(playerA, "Kjeldoran Outpost", 1); + } + + @Test + public void testPlainsAvailable() { + addCard(Zone.BATTLEFIELD, playerA, "Plains"); + // If Kjeldoran Outpost would enter the battlefield, sacrifice a Plains instead. If you do, put Kjeldoran Outpost onto the battlefield. If you don't, put it into its owner's graveyard. + // {T}: Add {W} to your mana pool. + // {1}{W}, {tap}: Put a 1/1 white Soldier creature token onto the battlefield. + addCard(Zone.HAND, playerA, "Kjeldoran Outpost"); + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Kjeldoran Outpost"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Kjeldoran Outpost", 1); + assertGraveyardCount(playerA, "Kjeldoran Outpost", 0); + assertGraveyardCount(playerA, "Plains", 1); + } + + @Test + public void testOnlySnowcoveredPlainsAvailable() { + addCard(Zone.BATTLEFIELD, playerA, "Snow-Covered Plains"); + // If Kjeldoran Outpost would enter the battlefield, sacrifice a Plains instead. If you do, put Kjeldoran Outpost onto the battlefield. If you don't, put it into its owner's graveyard. + // {T}: Add {W} to your mana pool. + // {1}{W}, {tap}: Put a 1/1 white Soldier creature token onto the battlefield. + addCard(Zone.HAND, playerA, "Kjeldoran Outpost"); + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Kjeldoran Outpost"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Kjeldoran Outpost", 1); + assertGraveyardCount(playerA, "Kjeldoran Outpost", 0); + assertGraveyardCount(playerA, "Snow-Covered Plains", 1); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/entersBattlefield/LivingLoreTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/entersBattlefield/LivingLoreTest.java new file mode 100644 index 00000000000..217636f7e2a --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/entersBattlefield/LivingLoreTest.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.replacement.entersBattlefield; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class LivingLoreTest extends CardTestPlayerBase { + + /** + * That the +1/+1 counters are added to Living Lore before state based + * actions take place + */ + @Test + public void testCountersAdded() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + addCard(Zone.HAND, playerA, "Living Lore"); //{3}{U} + addCard(Zone.GRAVEYARD, playerA, "Natural Connection", 1); // {2}{G} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Living Lore"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Living Lore", 1); + assertPowerToughness(playerA, "Living Lore", 3, 3); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/prevent/HarmsWayRedirectDamageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/redirect/HarmsWayRedirectDamageTest.java similarity index 57% rename from Mage.Tests/src/test/java/org/mage/test/cards/replacement/prevent/HarmsWayRedirectDamageTest.java rename to Mage.Tests/src/test/java/org/mage/test/cards/replacement/redirect/HarmsWayRedirectDamageTest.java index f609e5ed8e8..7f7508a5ab6 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/prevent/HarmsWayRedirectDamageTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/redirect/HarmsWayRedirectDamageTest.java @@ -1,4 +1,4 @@ -package org.mage.test.cards.replacement.prevent; +package org.mage.test.cards.replacement.redirect; import mage.constants.PhaseStep; import mage.constants.Zone; @@ -6,15 +6,17 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** - * Harm's Way: - * The next 2 damage that a source of your choice would deal to you and/or permanents you control this turn is dealt to target creature or player instead. + * Harm's Way: The next 2 damage that a source of your choice would deal to you + * and/or permanents you control this turn is dealt to target creature or player + * instead. * * @author noxx */ public class HarmsWayRedirectDamageTest extends CardTestPlayerBase { /** - * Tests that 2 of 3 damage is redirected while 1 damage is still dealt to original target + * Tests that 2 of 3 damage is redirected while 1 damage is still dealt to + * original target */ @Test public void testRedirectTwoDamage() { @@ -51,7 +53,7 @@ public class HarmsWayRedirectDamageTest extends CardTestPlayerBase { attack(2, playerB, "Craw Wurm"); castSpell(2, PhaseStep.DECLARE_BLOCKERS, playerA, "Harm's Way", playerB); setChoice(playerA, "Craw Wurm"); - + setStopAt(2, PhaseStep.END_TURN); execute(); @@ -79,8 +81,11 @@ public class HarmsWayRedirectDamageTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Magma Phoenix"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Harm's Way", playerB); - setChoice(playerA, "Magma Phoenix"); - /** When Magma Phoenix dies, Magma Phoenix deals 3 damage to each creature and each player **/ + setChoice(playerA, "Magma Phoenix"); + /** + * When Magma Phoenix dies, Magma Phoenix deals 3 damage to each + * creature and each player * + */ castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", "Magma Phoenix"); setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); @@ -91,4 +96,38 @@ public class HarmsWayRedirectDamageTest extends CardTestPlayerBase { assertLife(playerB, 15); // 3 damage from dying Phoenix directly and 2 redirected damage from playerA } + /** + * Tests that not preventable damage is redirected + */ + @Test + public void testRedirectNotPreventableDamage() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain"); + // Ferocious If you control a creature with power 4 or greater, damage can't be prevented this turn. + // Wild Slash deals 2 damage to target creature or player. + addCard(Zone.HAND, playerA, "Wild Slash"); // {R} + addCard(Zone.BATTLEFIELD, playerA, "Serra Angel"); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); + + // The next 2 damage that a source of your choice would deal to you and/or permanents + // you control this turn is dealt to target creature or player instead. + addCard(Zone.HAND, playerB, "Harm's Way"); // {W} + addCard(Zone.BATTLEFIELD, playerB, "Plains"); + addCard(Zone.BATTLEFIELD, playerB, "Birds of Paradise"); + + // the 2 damage can't be prevented and have to be redirected to Silvercoat Lion of player A + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wild Slash", "Birds of Paradise"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Harm's Way", "Silvercoat Lion", "Wild Slash"); + setChoice(playerB, "Wild Slash"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Wild Slash", 1); + assertGraveyardCount(playerB, "Harm's Way", 1); + assertPermanentCount(playerB, "Birds of Paradise", 1); + assertGraveyardCount(playerA, "Silvercoat Lion", 1); + assertLife(playerA, 20); + assertLife(playerB, 20); + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/redirect/ShamenEnKorTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/redirect/ShamenEnKorTest.java new file mode 100644 index 00000000000..a8ffe681e75 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/redirect/ShamenEnKorTest.java @@ -0,0 +1,94 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.replacement.redirect; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class ShamenEnKorTest extends CardTestPlayerBase { + + /** + * Tests that 2 of 3 damage is redirected while 1 damage is still dealt to + * original target + */ + @Test + public void testFirstAbilityNonCombatDamage() { + addCard(Zone.HAND, playerA, "Lightning Bolt"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain"); + + // {0}: The next 1 damage that would be dealt to Shaman en-Kor this turn is dealt to target creature you control instead. + // {1}{W}: The next time a source of your choice would deal damage to target creature this turn, that damage is dealt to Shaman en-Kor instead. + addCard(Zone.BATTLEFIELD, playerB, "Shaman en-Kor"); // 1/2 + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); // 2/2 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Shaman en-Kor"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{0}: The next 1 damage", "Silvercoat Lion", "Lightning Bolt"); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{0}: The next 1 damage", "Silvercoat Lion", "Lightning Bolt"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Lightning Bolt", 1); + assertPermanentCount(playerB, "Shaman en-Kor", 1); + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + + } + + @Test + public void testSecondAbilityNonCombatDamage() { + addCard(Zone.HAND, playerA, "Lightning Bolt"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain"); + + // {0}: The next 1 damage that would be dealt to Shaman en-Kor this turn is dealt to target creature you control instead. + // {1}{W}: The next time a source of your choice would deal damage to target creature this turn, that damage is dealt to Shaman en-Kor instead. + addCard(Zone.BATTLEFIELD, playerB, "Shaman en-Kor"); // 1/2 + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); // 2/2 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Silvercoat Lion"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}{W}: The next time", "Silvercoat Lion", "Lightning Bolt"); + setChoice(playerB, "Lightning Bolt"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Lightning Bolt", 1); + assertPermanentCount(playerB, "Silvercoat Lion", 1); + assertGraveyardCount(playerB, "Shaman en-Kor", 1); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/replacement/redirect/WardOfPietyTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/redirect/WardOfPietyTest.java new file mode 100644 index 00000000000..17b12464d7f --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/replacement/redirect/WardOfPietyTest.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.replacement.redirect; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class WardOfPietyTest extends CardTestPlayerBase { + + @Test + public void testNonCombatDamageToPlayer() { + addCard(Zone.HAND, playerB, "Lightning Bolt"); + addCard(Zone.BATTLEFIELD, playerB, "Mountain"); + + // Enchant creature + // {1}{W}: The next 1 damage that would be dealt to enchanted creature this turn is dealt to target creature or player instead. + addCard(Zone.HAND, playerA, "Ward of Piety"); // {1}{W} + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); // 2/2 + addCard(Zone.BATTLEFIELD, playerA, "Plains", 6); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ward of Piety", "Silvercoat Lion"); + + activateAbility(1, PhaseStep.BEGIN_COMBAT, playerA, "{1}{W}: The next 1 damage", playerB); + activateAbility(1, PhaseStep.BEGIN_COMBAT, playerA, "{1}{W}: The next 1 damage", playerB); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerB, "Lightning Bolt", 1); + assertPermanentCount(playerA, "Ward of Piety", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + + assertLife(playerA, 20); + assertLife(playerB, 18); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/rules/CantCastTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/rules/CantCastTest.java new file mode 100644 index 00000000000..1e55f7efd58 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/rules/CantCastTest.java @@ -0,0 +1,139 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.rules; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class CantCastTest extends CardTestPlayerBase { + + /** + * I control Void Winnower. But my opponent can cast Jayemdae Tome (that's + * converted mana cost is even) He can cast other even spell. + * + */ + @Test + public void testVoidWinnower() { + // Your opponent can't cast spells with even converted mana costs. (Zero is even.) + // Your opponents can't block with creatures with even converted mana costs. + addCard(Zone.BATTLEFIELD, playerB, "Void Winnower"); + + addCard(Zone.BATTLEFIELD, playerA, "Forest", 4); + + addCard(Zone.HAND, playerA, "Jayemdae Tome", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Jayemdae Tome"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, "Jayemdae Tome", 1); + + assertPermanentCount(playerA, "Jayemdae Tome", 0); + + } + + @Test + public void testVoidWinnower2() { + // Your opponent can't cast spells with even converted mana costs. (Zero is even.) + // Your opponents can't block with creatures with even converted mana costs. + addCard(Zone.BATTLEFIELD, playerB, "Void Winnower"); + + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + + // Blaze deals X damage to target creature or player. + addCard(Zone.HAND, playerA, "Blaze", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Blaze", playerA); + setChoice(playerA, "X=3"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, "Blaze", 1); + + assertLife(playerB, 20); + + } + + @Test + public void testVoidWinnower3() { + // Your opponent can't cast spells with even converted mana costs. (Zero is even.) + // Your opponents can't block with creatures with even converted mana costs. + addCard(Zone.BATTLEFIELD, playerB, "Void Winnower"); + + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5); + + // Blaze deals X damage to target creature or player. + addCard(Zone.HAND, playerA, "Blaze", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Blaze", playerB); + setChoice(playerA, "X=4"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertHandCount(playerA, "Blaze", 0); + assertGraveyardCount(playerA, "Blaze", 1); + + assertLife(playerB, 16); + + } + + @Test + public void testVoidWinnowerWithMorph() { + // Your opponent can't cast spells with even converted mana costs. (Zero is even.) + // Your opponents can't block with creatures with even converted mana costs. + addCard(Zone.BATTLEFIELD, playerB, "Void Winnower"); + /* + Pine Walker + Creature - Elemental + 5/5 + Morph {4}{G} (You may cast this card face down as a 2/2 creature for . Turn it face up any time for its morph cost.) + Whenever Pine Walker or another creature you control is turned face up, untap that creature. + */ + addCard(Zone.HAND, playerA, "Pine Walker"); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Pine Walker"); + setChoice(playerA, "Yes"); // cast it face down as 2/2 creature + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "", 0); + assertHandCount(playerA, "Pine Walker", 1); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/OmniscienceTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/OmniscienceTest.java index ad4f7febe71..fe2d8ea9fb3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/OmniscienceTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/OmniscienceTest.java @@ -192,4 +192,104 @@ public class OmniscienceTest extends CardTestPlayerBase { assertGraveyardCount(playerB, "Pillarfield Ox", 1); } + /** + * If another effect (e.g. Future Sight) allows you to cast nonland cards + * from zones other than your hand, Xmage incorrectly lets you cast those + * cards without paying their mana costs. Omniscience only lets you cast + * spells from your hand without paying their mana costs. + */ + @Test + public void testCastingWithFutureSight() { + // You may cast nonland cards from your hand without paying their mana costs. + addCard(Zone.BATTLEFIELD, playerA, "Omniscience"); + // Play with the top card of your library revealed. + // You may play the top card of your library. + addCard(Zone.BATTLEFIELD, playerA, "Future Sight", 1); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + + addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 1); + skipInitShuffling(); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion"); + setChoice(playerA, "Yes"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertPermanentCount(playerA, "Silvercoat Lion", 1); + assertTapped("Plains", true); // plains have to be tapped because {2} have to be paid + } + + /** + * If a spell has an additional cost (optional or mandatory, e.g. Entwine), + * Omniscience incorrectly allows you cast the spell as if that cost had + * been paid without paying that spell's mana cost. 117.9d If an alternative + * cost is being paid to cast a spell, any additional costs, cost increases, + * and cost reductions that affect that spell are applied to that + * alternative cost. (See rule 601.2f.) + */ + @Test + public void testCastingWithCyclonicRiftWithOverload() { + // You may cast nonland cards from your hand without paying their mana costs. + addCard(Zone.BATTLEFIELD, playerA, "Omniscience"); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + + // Choose one - Barbed Lightning deals 3 damage to target creature; or Barbed Lightning deals 3 damage to target player. + // Entwine {2} (Choose both if you pay the entwine cost.) + addCard(Zone.HAND, playerA, "Barbed Lightning", 1); + + // Creature - 3/3 Swampwalk + addCard(Zone.BATTLEFIELD, playerB, "Bog Wraith", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barbed Lightning", "Bog Wraith"); + addTarget(playerA, playerB); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Barbed Lightning", 1); + assertGraveyardCount(playerB, "Bog Wraith", 1); + + assertLife(playerA, 20); + assertLife(playerB, 17); + + assertTapped("Plains", true); // plains have to be tapped because {2} from Entwine have to be paid + } + + /** + * If a spell has an unpayable cost (e.g. Ancestral Vision, which has no + * mana cost), Omniscience should allow you to cast that spell without + * paying its mana cost. In the case of Ancestral Vision, for example, Xmage + * only gives you the option to suspend Ancestral Vision. 117.6a If an + * unpayable cost is increased by an effect or an additional cost is + * imposed, the cost is still unpayable. If an alternative cost is applied + * to an unpayable cost, including an effect that allows a player to cast a + * spell without paying its mana cost, the alternative cost may be paid. + */ + @Test + public void testCastingUnpayableCost() { + // You may cast nonland cards from your hand without paying their mana costs. + addCard(Zone.BATTLEFIELD, playerA, "Omniscience"); + + // Suspend 4-{U} + // Target player draws three cards. + addCard(Zone.HAND, playerA, "Ancestral Vision", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ancestral Vision", playerA); + addTarget(playerA, playerB); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Ancestral Vision", 1); + + assertHandCount(playerA, 3); + assertLife(playerA, 20); + assertLife(playerB, 20); + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java index eb69c8b1c41..5062c9244ab 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/avr/CavernOfSoulsTest.java @@ -33,8 +33,9 @@ public class CavernOfSoulsTest extends CardTestPlayerBase { } /** - * Tests "Cavern of Souls" with "Human" creature type chosen. - * Then tests casting Azure Drake (should fail) and Elite Vanguard (should be ok as it has "Human" subtype) + * Tests "Cavern of Souls" with "Human" creature type chosen. Then tests + * casting Azure Drake (should fail) and Elite Vanguard (should be ok as it + * has "Human" subtype) */ @Test public void testNoCastBecauseOfCreatureType() { @@ -87,6 +88,9 @@ public class CavernOfSoulsTest extends CardTestPlayerBase { @Test public void testDrakeCantBeCountered() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); + // As Cavern of Souls enters the battlefield, choose a creature type. + // {T}: Add {1} to your mana pool. + // {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a creature spell of the chosen type, and that spell can't be countered. addCard(Zone.HAND, playerA, "Cavern of Souls"); addCard(Zone.HAND, playerA, "Azure Drake"); @@ -108,6 +112,7 @@ public class CavernOfSoulsTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Azure Drake", 0); assertPermanentCount(playerA, "Azure Drake", 1); } + /** * Tests spell can be countered if cast with colorless mana from Cavern */ @@ -136,59 +141,59 @@ public class CavernOfSoulsTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Azure Drake", 1); assertPermanentCount(playerA, "Azure Drake", 0); } - + /** - * Tests conditional mana from Cavern in pool will still work if Cavern got back to hand and is played again with other creature type + * Tests conditional mana from Cavern in pool will still work if Cavern got + * back to hand and is played again with other creature type */ @Test public void testConditionlManaWorksIfCavernIsReplayed() { addCard(Zone.HAND, playerA, "Cavern of Souls"); addCard(Zone.HAND, playerA, "Gladecover Scout"); // Elf costing {G} // addCard(Zone.HAND, playerA, "Fume Spitter"); // Horror costing {B} - + // Instant - {U}{U} - Return target permanent to its owner's hand. addCard(Zone.HAND, playerB, "Boomerang"); addCard(Zone.BATTLEFIELD, playerB, "Island", 2); playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cavern of Souls"); setChoice(playerA, "Elf"); - + // getting green mana for Elf into pool activateManaAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add 1 mana of any one color to your mana pool. Spend this mana only to cast a creature spell of the chosen type, and that spell can't be countered."); - setChoice(playerA, "Green"); - + setChoice(playerA, "Green"); + // return cavern to hand castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerB, "Boomerang", "Cavern of Souls"); - + // playing the cavern again choose different creature type playLand(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Cavern of Souls"); setChoice(playerA, "Horror"); - // the green mana usable for Elf should be in the mana pool + // the green mana usable for Elf should be in the mana pool castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Gladecover Scout"); activateManaAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add 1 mana of any one color to your mana pool. Spend this mana only to cast a creature spell of the chosen type, and that spell can't be countered."); - setChoice(playerA, "Black"); + setChoice(playerA, "Black"); - // the black mana usable for Horror should be in the mana pool + // the black mana usable for Horror should be in the mana pool // castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Fume Spitter"); - setStopAt(3, PhaseStep.BEGIN_COMBAT); execute(); - assertGraveyardCount(playerB, "Boomerang", 1); assertPermanentCount(playerA, "Cavern of Souls", 1); - + // Check the elf was cast assertPermanentCount(playerA, "Gladecover Scout", 1); // Check Horror on the Battlefield // assertPermanentCount(playerA, "Fume Spitter", 1); - } + } /** - * Return to the Ranks cannot be countered if mana produced by Cavern of Souls - * was used to pay X. Can be bug also for all other spells with X in their cost, not sure. + * Return to the Ranks cannot be countered if mana produced by Cavern of + * Souls was used to pay X. Can be bug also for all other spells with X in + * their cost, not sure. * */ @Test @@ -205,12 +210,11 @@ public class CavernOfSoulsTest extends CardTestPlayerBase { addCard(Zone.HAND, playerB, "Counterspell"); addCard(Zone.BATTLEFIELD, playerB, "Island", 2); - playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cavern of Souls"); setChoice(playerA, "Drake"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Return to the Ranks", "Silvercoat Lion"); setChoice(playerA, "X=1"); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Counterspell", "Return to the Ranks"); setStopAt(1, PhaseStep.BEGIN_COMBAT); @@ -223,11 +227,12 @@ public class CavernOfSoulsTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Silvercoat Lion", 0); } - + /** - * Cavern of Souls can produce any colour of mana with its second ability when Contamination is in play. + * Cavern of Souls can produce any colour of mana with its second ability + * when Contamination is in play. */ - @Test + @Test public void testUseWithConversionInPlay() { addCard(Zone.BATTLEFIELD, playerA, "Plains", 3); addCard(Zone.HAND, playerA, "Cavern of Souls"); @@ -235,8 +240,6 @@ public class CavernOfSoulsTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Desert Drake"); addCard(Zone.BATTLEFIELD, playerB, "Contamination", 1); - - playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cavern of Souls"); setChoice(playerA, "Drake"); @@ -249,5 +252,5 @@ public class CavernOfSoulsTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Desert Drake", 0); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/lrw/HostilityTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/lrw/HostilityTest.java new file mode 100644 index 00000000000..6e57f51737e --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/lrw/HostilityTest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.single.lrw; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author Kranken, LevelX2 + */ + +public class HostilityTest extends CardTestPlayerBase { + + @Test + public void testCombatDamage() { + addCard(Zone.BATTLEFIELD, playerA, "Hostility"); + attack(1, playerA, "Hostility"); + + setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 14); + } + + @Test + public void testSpellDamage() { + addCard(Zone.BATTLEFIELD, playerA, "Hostility"); + + addCard(Zone.HAND, playerA, "Lightning Bolt"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertPermanentCount(playerA, 5); // hostility, mountain, and 3 tokens + } + + @Test + public void testOpponentSpellDamage() { + addCard(Zone.BATTLEFIELD, playerA, "Hostility"); + + addCard(Zone.HAND, playerB, "Lightning Bolt"); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerB); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 17); + } + +} \ No newline at end of file diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/mir/GrinningTotemTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/mir/GrinningTotemTest.java new file mode 100644 index 00000000000..0484faccaa5 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/mir/GrinningTotemTest.java @@ -0,0 +1,41 @@ +package org.mage.test.cards.single.mir; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +public class GrinningTotemTest extends CardTestPlayerBase { + + @Test + public void testCardsGoToGraveyard() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + addCard(Zone.BATTLEFIELD, playerA, "Grinning Totem"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}, Sacrifice {this}: Search target opponent's library for a card and exile it", playerB); + + setStopAt(3, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, 1); // Grinning Totem + assertGraveyardCount(playerB, 1); // the exiled Mountain + } + + @Test + public void testCardsGoToGraveyard2() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + addCard(Zone.BATTLEFIELD, playerA, "Grinning Totem"); + + addCard(Zone.BATTLEFIELD, playerB, "Tormod's Crypt"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}, Sacrifice {this}: Search target opponent's library for a card and exile it", playerB); + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "{T}, Sacrifice {this}: Exile all cards", playerA); + + setStopAt(3, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, 0); + assertGraveyardCount(playerB, 2); // the exiled Mountain and Tormod's Crypt + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/AbattoirGhoulTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/AbattoirGhoulTest.java index fc9b33bc592..03c88dc4749 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/AbattoirGhoulTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/AbattoirGhoulTest.java @@ -13,25 +13,25 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author jeffwadsworth */ -public class AbattoirGhoulTest extends CardTestPlayerBase{ - +public class AbattoirGhoulTest extends CardTestPlayerBase { + @Test public void testAbattoirGhoulEffect() { - + // Whenever a creature dealt damage by Abattoir Ghoul this turn dies, you gain life equal to that creature's toughness. addCard(Zone.BATTLEFIELD, playerA, "Abattoir Ghoul", 1); addCard(Zone.BATTLEFIELD, playerB, "Memnite", 1); addCard(Zone.BATTLEFIELD, playerB, "Shivan Dragon", 1); - + attack(1, playerA, "Abattoir Ghoul"); block(1, playerB, "Memnite", "Abattoir Ghoul"); block(1, playerB, "Shivan Dragon", "Abattoir Ghoul"); - + setStopAt(1, PhaseStep.END_TURN); execute(); - + assertLife(playerA, 21); assertLife(playerB, 20); - + } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ColorCausedTriggerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ColorCausedTriggerTest.java new file mode 100644 index 00000000000..29344603010 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ColorCausedTriggerTest.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class ColorCausedTriggerTest extends CardTestPlayerBase { + + @Test + public void testGhostfire() { + // Whenever a player casts a red spell, you may gain 1 life. + addCard(Zone.BATTLEFIELD, playerA, "Dragon's Claw", 1); + + // Ghostfire deals 3 damage to target creature or player. + addCard(Zone.HAND, playerA, "Ghostfire", 1); // {2}{R} + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ghostfire", playerB); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Ghostfire", 1); + + assertLife(playerA, 20); + assertLife(playerB, 17); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/DayOfTheDragonsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/DayOfTheDragonsTest.java new file mode 100644 index 00000000000..467f540a782 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/DayOfTheDragonsTest.java @@ -0,0 +1,96 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class DayOfTheDragonsTest extends CardTestPlayerBase { + + @Test + public void TestTokensAreCreated() { + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 7); + // When Day of the Dragons enters the battlefield, exile all creatures you control. Then put that many 5/5 red Dragon creature tokens with flying onto the battlefield. + // When Day of the Dragons leaves the battlefield, sacrifice all Dragons you control. Then return the exiled cards to the battlefield under your control. + addCard(Zone.HAND, playerA, "Day of the Dragons"); // Enchantment - {4}{U}{U}{U} + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + addCard(Zone.BATTLEFIELD, playerB, "Shivan Dragon"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Day of the Dragons"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertExileCount("Silvercoat Lion", 1); + assertExileCount("Pillarfield Ox", 1); + assertPermanentCount(playerA, "Dragon", 2); + + assertPermanentCount(playerB, "Silvercoat Lion", 1); + assertPermanentCount(playerB, "Shivan Dragon", 1); + } + + @Test + public void TestTokensAreCreatedAndExiled() { + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 7); + // When Day of the Dragons enters the battlefield, exile all creatures you control. Then put that many 5/5 red Dragon creature tokens with flying onto the battlefield. + // When Day of the Dragons leaves the battlefield, sacrifice all Dragons you control. Then return the exiled cards to the battlefield under your control. + addCard(Zone.HAND, playerA, "Day of the Dragons"); // Enchantment - {4}{U}{U}{U} + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + addCard(Zone.BATTLEFIELD, playerB, "Shivan Dragon"); + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + addCard(Zone.HAND, playerB, "Disenchant"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Day of the Dragons"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Disenchant", "Day of the Dragons"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerA, "Day of the Dragons", 1); + assertGraveyardCount(playerB, "Disenchant", 1); + + assertPermanentCount(playerA, "Silvercoat Lion", 1); + assertPermanentCount(playerA, "Pillarfield Ox", 1); + assertPermanentCount(playerA, "Dragon", 0); + + assertPermanentCount(playerB, "Silvercoat Lion", 1); + assertPermanentCount(playerB, "Shivan Dragon", 1); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/DrawTriggeredTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/DrawTriggeredTest.java new file mode 100644 index 00000000000..ce6196e7492 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/DrawTriggeredTest.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class DrawTriggeredTest extends CardTestPlayerBase { + + /* + * Day's Undoing - Doesn't create card draw triggers "Specifically, it + * doesn't work with Chasm Skulker. + * + * Steps to reproduce: + 1) Have Chasm Skulker on the battlefield. + 2) Cast Day's Undoing. + 3) You will draw 7 cards, but Chasm Skulker's ""when you draw a card"" trigger does not trigger." ==> What is correct + */ + @Test + public void DaysUndoingTriggeredDrewEventAreRemovedTest() { + // Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards. If it's your turn, end the turn. + addCard(Zone.HAND, playerA, "Day's Undoing"); + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + + // Whenever you draw a card, put a +1/+1 counter on Chasm Skulker. + // When Chasm Skulker dies, put X 1/1 blue Squid creature tokens with islandwalk onto the battlefield, where X is the number of +1/+1 counters on Chasm Skulker. + addCard(Zone.BATTLEFIELD, playerB, "Chasm Skulker", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Day's Undoing"); + + setStopAt(2, PhaseStep.UNTAP); + execute(); + + assertExileCount("Day's Undoing", 1); + assertPermanentCount(playerB, "Chasm Skulker", 1); + assertPowerToughness(playerB, "Chasm Skulker", 1, 1); + + } + + /** + * Consecrated Sphinx does not trigger when "Edric, Spymaster of Trest" lets + * my opponent draw cards. + */ + @Test + public void EdricSpymasterOfTrestTest() { + // Flying + // Whenever an opponent draws a card, you may draw two cards. + addCard(Zone.BATTLEFIELD, playerA, "Consecrated Sphinx", 1); + + // Whenever a creature deals combat damage to one of your opponents, its controller may draw a card. + addCard(Zone.BATTLEFIELD, playerB, "Edric, Spymaster of Trest", 1); + + attack(2, playerB, "Edric, Spymaster of Trest"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertHandCount(playerB, 2); // 1 from start of turn and 1 from Edric + assertHandCount(playerA, 4); // 2 * 2 from Sphinx = 4 + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/EntersTheBattlefieldTriggerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/EntersTheBattlefieldTriggerTest.java new file mode 100644 index 00000000000..fbeebe9d6eb --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/EntersTheBattlefieldTriggerTest.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class EntersTheBattlefieldTriggerTest extends CardTestPlayerBase { + + @Test + public void testDrawCardsAddedCounters() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + addCard(Zone.HAND, playerA, "Soul Warden"); + + // You may have Clever Impersonator enter the battlefield as a copy of any nonland permanent on the battlefield. + addCard(Zone.HAND, playerB, "Clever Impersonator", 1); + addCard(Zone.BATTLEFIELD, playerB, "Island", 4); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Soul Warden"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Clever Impersonator"); + setChoice(playerB, "Silvercoat Lion"); + + setStopAt(2, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Soul Warden", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + assertPermanentCount(playerB, "Silvercoat Lion", 1); + + assertLife(playerA, 21); + assertLife(playerB, 20); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/FathomMageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/FathomMageTest.java index 5d8f468f12c..145785ccc8b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/FathomMageTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/FathomMageTest.java @@ -2,6 +2,8 @@ package org.mage.test.cards.triggers; import mage.constants.PhaseStep; import mage.constants.Zone; +import mage.game.permanent.Permanent; +import org.junit.Assert; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -13,14 +15,16 @@ public class FathomMageTest extends CardTestPlayerBase { /** * Fathom Mage - Creature — Human Wizard 1/1, 2UG * - * Evolve (Whenever a creature enters the battlefield under your control, if that creature has greater power or toughness than this creature, put a +1/+1 counter on this creature.) - * Whenever a +1/+1 counter is placed on Fathom Mage, you may draw a card. + * Evolve (Whenever a creature enters the battlefield under your control, if + * that creature has greater power or toughness than this creature, put a + * +1/+1 counter on this creature.) Whenever a +1/+1 counter is placed on + * Fathom Mage, you may draw a card. + * * - */ @Test public void testDrawCardsAddedCounters() { - // card draw triggered ability will trigger once for each of those counters from Blessings of Nature. + // card draw triggered ability will trigger once for each of those counters from Blessings of Nature. addCard(Zone.HAND, playerA, "Blessings of Nature"); addCard(Zone.BATTLEFIELD, playerA, "Fathom Mage", 1); @@ -38,20 +42,26 @@ public class FathomMageTest extends CardTestPlayerBase { @Test public void testDrawCardsEntersTheBattlefield() { - // card draw triggered ability will trigger once for each of those counters from Master Biomancer. + // card draw triggered ability will trigger once for each of those counters from Master Biomancer. addCard(Zone.HAND, playerA, "Fathom Mage"); + // Each other creature you control enters the battlefield with a number of additional +1/+1 counters on it equal to + // Master Biomancer's power and as a Mutant in addition to its other types. addCard(Zone.BATTLEFIELD, playerA, "Master Biomancer", 1); - addCard(Zone.BATTLEFIELD, playerA, "Forest", 4); - addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + addCard(Zone.BATTLEFIELD, playerA, "Island", 2); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Fathom Mage"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Fathom Mage"); // {2}{G}{U} setStopAt(1, PhaseStep.END_TURN); execute(); assertPermanentCount(playerA, "Fathom Mage", 1); assertPowerToughness(playerA, "Fathom Mage", 3, 3); + + Permanent fathomMage = getPermanent("Fathom Mage", playerA); + Assert.assertEquals("Fathom Mage has to be a Mutant", true, fathomMage.getSubtype().contains("Mutant")); + assertHandCount(playerA, 2); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/GoldnightCommanderTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/GoldnightCommanderTest.java index 6da6f33709e..acdced5c75f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/GoldnightCommanderTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/GoldnightCommanderTest.java @@ -37,20 +37,16 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class GoldnightCommanderTest extends CardTestPlayerBase { - /** - * Goldnight Commander {3}{W} - * Human Cleric Soldier - * Whenever another creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn. - * - + /* + * Goldnight Commander {3}{W} Human Cleric Soldier + * Whenever another creature enters the battlefield under your control, creatures you control get + * +1/+1 until end of turn. */ @Test public void testThreeCreaturesEnterAtTheSameTime() { // The ability of the Commander triggers three times and each trigger sees all three creatures - addCard(Zone.HAND, playerA, "Thatcher Revolt"); addCard(Zone.BATTLEFIELD, playerA, "Goldnight Commander", 1); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/JourneyToNowhereTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/JourneyToNowhereTest.java index 8cef82f8998..c6590662513 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/JourneyToNowhereTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/JourneyToNowhereTest.java @@ -36,23 +36,21 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LeveX2 */ - public class JourneyToNowhereTest extends CardTestPlayerBase { /* Journey to Nowhere Enchantment {1}{W} - When Journey to Nowhere enters the battlefield, exile target creature. - When Journey to Nowhere leaves the battlefield, return the exiled card to the battlefield under its owner's control. - - 10/1/2009: If Journey to Nowhere leaves the battlefield before its first ability has resolved, its second ability will - trigger and do nothing. Then its first ability will resolve and exile the targeted creature forever. - */ + When Journey to Nowhere enters the battlefield, exile target creature. + When Journey to Nowhere leaves the battlefield, return the exiled card to the battlefield under its owner's control. + 10/1/2009: If Journey to Nowhere leaves the battlefield before its first ability has resolved, its second ability will + trigger and do nothing. Then its first ability will resolve and exile the targeted creature forever. + */ @Test public void testTargetGetsExiled() { addCard(Zone.HAND, playerA, "Journey to Nowhere"); addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); - + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Journey to Nowhere"); @@ -63,13 +61,12 @@ public class JourneyToNowhereTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Journey to Nowhere", 1); assertExileCount("Silvercoat Lion", 1); } - - + @Test public void testTargetGetsExiledAndReturns() { addCard(Zone.HAND, playerA, "Journey to Nowhere"); addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); - + addCard(Zone.HAND, playerB, "Disenchant", 1); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); @@ -78,7 +75,7 @@ public class JourneyToNowhereTest extends CardTestPlayerBase { addTarget(playerA, "Silvercoat Lion"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Disenchant", "Journey to Nowhere"); - + setStopAt(1, PhaseStep.END_TURN); execute(); @@ -88,14 +85,14 @@ public class JourneyToNowhereTest extends CardTestPlayerBase { } /* - 10/1/2009: If Journey to Nowhere leaves the battlefield before its first ability has resolved, its second ability will - trigger and do nothing. Then its first ability will resolve and exile the targeted creature forever. - */ + 10/1/2009: If Journey to Nowhere leaves the battlefield before its first ability has resolved, its second ability will + trigger and do nothing. Then its first ability will resolve and exile the targeted creature forever. + */ @Test public void testTargetGetsExiledAndDoesNeverReturn() { addCard(Zone.HAND, playerA, "Journey to Nowhere"); addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); - + addCard(Zone.HAND, playerB, "Disenchant", 1); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); @@ -103,29 +100,29 @@ public class JourneyToNowhereTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Journey to Nowhere"); addTarget(playerA, "Silvercoat Lion"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Disenchant", "Journey to Nowhere"); - + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); assertGraveyardCount(playerA, "Journey to Nowhere", 1); assertGraveyardCount(playerB, "Disenchant", 1); assertExileCount("Silvercoat Lion", 1); - } + } /* - Journey is played and targets the creature as it enters the battlefield. - The Journey will be returned to hand before the ability resolves. - The Journey will be played again targeting another creature. - The Journey will be disenchanted later, so only the second creature has to return to battlefield. - - */ + Journey is played and targets the creature as it enters the battlefield. + The Journey will be returned to hand before the ability resolves. + The Journey will be played again targeting another creature. + The Journey will be disenchanted later, so only the second creature has to return to battlefield. + + */ @Test public void testTargetGetsExiledAndDoesNeverReturnAndJourneyPlayedAgain() { addCard(Zone.HAND, playerA, "Journey to Nowhere"); addCard(Zone.HAND, playerA, "Boomerang"); addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); addCard(Zone.BATTLEFIELD, playerA, "Island", 4); - + addCard(Zone.HAND, playerB, "Disenchant", 1); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 1); @@ -133,11 +130,11 @@ public class JourneyToNowhereTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Journey to Nowhere"); addTarget(playerA, "Silvercoat Lion"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boomerang", "Journey to Nowhere"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boomerang", "Journey to Nowhere", "Journey to Nowhere", StackClause.WHILE_NOT_ON_STACK); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Journey to Nowhere"); addTarget(playerA, "Pillarfield Ox"); - + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Disenchant", "Journey to Nowhere"); setStopAt(2, PhaseStep.BEGIN_COMBAT); @@ -145,11 +142,11 @@ public class JourneyToNowhereTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Boomerang", 1); assertGraveyardCount(playerA, "Journey to Nowhere", 1); - assertGraveyardCount(playerB, "Disenchant", 1); + assertGraveyardCount(playerB, "Disenchant", 1); assertPermanentCount(playerB, "Pillarfield Ox", 1); - + assertPermanentCount(playerB, "Silvercoat Lion", 0); assertExileCount("Silvercoat Lion", 1); - - } + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/MelekIzzetParagonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/MelekIzzetParagonTest.java new file mode 100644 index 00000000000..8560a101906 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/MelekIzzetParagonTest.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class MelekIzzetParagonTest extends CardTestPlayerBase { + + /** + * Wenn Melek, Izzet Paragon liegt und man einen Red/Blue Sun's Zenith von + * der Bib spielt, wird er nicht kopiert, auch wenn der Effekt auf dem Stack + * sichtbar ist. + * + * Meine Theorie ist, dass die Kopie beim in die Bib mischen den Originalen + * nimmt und er daher nicht mehr dem Stack ist um selbst verrechnet zu + * werden + * + */ + @Test + public void testCopyZenith() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5); + // Play with the top card of your library revealed. + // You may cast the top card of your library if it's an instant or sorcery card. + // Whenever you cast an instant or sorcery spell from your library, copy it. You may choose new targets for the copy. + addCard(Zone.BATTLEFIELD, playerA, "Melek, Izzet Paragon"); + + // Red Sun's Zenith deals X damage to target creature or player. + // If a creature dealt damage this way would die this turn, exile it instead. + // Shuffle Red Sun's Zenith into its owner's library. + addCard(Zone.LIBRARY, playerA, "Red Sun's Zenith"); // {X}{R} + skipInitShuffling(); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Red Sun's Zenith", playerB); + setChoice(playerA, "X=4"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Red Sun's Zenith", 0); + + assertLife(playerA, 20); + assertLife(playerB, 12); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/OblivionRingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/OblivionRingTest.java index 8ff5563c5b8..d09251969fc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/OblivionRingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/OblivionRingTest.java @@ -8,13 +8,15 @@ import org.mage.test.serverside.base.CardTestPlayerBase; /** * @author noxx * - * Card: When Oblivion Ring enters the battlefield, exile another target nonland permanent. - * When Oblivion Ring leaves the battlefield, return the exiled card to the battlefield under its owner's control. + * Card: When Oblivion Ring enters the battlefield, exile another target nonland + * permanent. When Oblivion Ring leaves the battlefield, return the exiled card + * to the battlefield under its owner's control. */ public class OblivionRingTest extends CardTestPlayerBase { /** - * When Oblivion Ring enters the battlefield, exile another target nonland permanent. + * When Oblivion Ring enters the battlefield, exile another target nonland + * permanent. */ @Test public void testFirstTriggeredAbility() { @@ -24,7 +26,7 @@ public class OblivionRingTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oblivion Ring"); - setStopAt(2, PhaseStep.END_TURN); + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); assertLife(playerA, 20); @@ -34,7 +36,8 @@ public class OblivionRingTest extends CardTestPlayerBase { } /** - * When Oblivion Ring leaves the battlefield, return the exiled card to the battlefield under its owner's control. + * When Oblivion Ring leaves the battlefield, return the exiled card to the + * battlefield under its owner's control. */ @Test public void testSecondTriggeredAbility() { @@ -79,25 +82,62 @@ public class OblivionRingTest extends CardTestPlayerBase { } /** - * Tests that when Oblivion Ring gets destroyed planeswalker returns with new counters and can be used second time at the same turn + * Tests that when Oblivion Ring gets destroyed planeswalker returns with + * new counters and can be used second time at the same turn */ @Test public void testExilePlaneswalker() { addCard(Zone.BATTLEFIELD, playerA, "Plains", 5); addCard(Zone.HAND, playerA, "Oblivion Ring"); addCard(Zone.BATTLEFIELD, playerA, "Jace Beleren"); + // Exile target artifact or enchantment. addCard(Zone.HAND, playerA, "Revoke Existence"); - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-1: Target player draws one card", playerA); + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-1: Target player draws a card", playerA); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Oblivion Ring"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Revoke Existence", "Oblivion Ring"); - activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "-1: Target player draws one card", playerA); + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "-1: Target player draws a card", playerA); setStopAt(1, PhaseStep.END_TURN); execute(); + assertExileCount("Oblivion Ring", 1); + assertGraveyardCount(playerA, "Revoke Existence", 1); assertPermanentCount(playerA, "Oblivion Ring", 0); + assertGraveyardCount(playerA, "Jace Beleren", 0); assertPermanentCount(playerA, "Jace Beleren", 1); // returns back assertHandCount(playerA, 2); // can use ability twice } + + /** + * Oblivion Ring leaves from battlefield Effect brings Hangarback Walker + * back with counters. But with rules it should come back with no counters + */ + @Test + public void testReturningHangarbackWalker() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 4); + // Hangarback Walker enters the battlefield with X +1/+1 counters on it. + // When Hangarback Walker dies, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield for each +1/+1 counter on Hangarback Walker. + // {1}, {t}: Put a +1/+1 counter on Hangarback Walker. + addCard(Zone.HAND, playerA, "Hangarback Walker"); // {X}{X} + addCard(Zone.HAND, playerA, "Naturalize"); + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 3); + addCard(Zone.HAND, playerB, "Oblivion Ring"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hangarback Walker"); + setChoice(playerA, "X=2"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Oblivion Ring"); + + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Naturalize", "Oblivion Ring"); + setStopAt(3, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerB, "Oblivion Ring", 0); + assertGraveyardCount(playerB, "Oblivion Ring", 1); + assertPermanentCount(playerA, "Hangarback Walker", 0); + assertGraveyardCount(playerA, "Hangarback Walker", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ReturnToHandEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ReturnToHandEffectsTest.java index 9159d14fd9d..16dc31153e2 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ReturnToHandEffectsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ReturnToHandEffectsTest.java @@ -36,7 +36,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class ReturnToHandEffectsTest extends CardTestPlayerBase { /** @@ -49,24 +48,59 @@ public class ReturnToHandEffectsTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); // Play with your hand revealed. // If you would draw a card, reveal the top card of your library instead. If it's a creature card, put it into your graveyard. Otherwise, draw a card. - // Whenever a creature is put into your graveyard from the battlefield, return it to your hand. + // Whenever a creature is put into your graveyard from the battlefield, return it to your hand. addCard(Zone.BATTLEFIELD, playerA, "Enduring Renewal"); // {T}, Sacrifice an artifact: Target player puts the top three cards of his or her library into his or her graveyard. - // Whenever an artifact enters the battlefield, you may untap Grinding Station. + // Whenever an artifact enters the battlefield, you may untap Grinding Station. addCard(Zone.BATTLEFIELD, playerA, "Grinding Station", 1); addCard(Zone.BATTLEFIELD, playerA, "Ornithopter", 1); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}, Sacrifice an artifact", playerB); - // addTarget(playerA, "Ornithopter"); + // addTarget(playerA, "Ornithopter"); setChoice(playerA, "Ornithopter"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); - assertGraveyardCount(playerB, 3); + assertGraveyardCount(playerB, 3); assertHandCount(playerA, "Ornithopter", 1); - + } - + + @Test + public void testStormfrontRidersTriggerForToken() { + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 2); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + // Flying + // When Stormfront Riders enters the battlefield, return two creatures you control to their owner's hand. + // Whenever Stormfront Riders or another creature is returned to your hand from the battlefield, put a 1/1 white Soldier creature token onto the battlefield. + addCard(Zone.HAND, playerA, "Stormfront Riders"); // {4}{W} + // Buyback {4} (You may pay an additional {4} as you cast this spell. If you do, put this card into your hand as it resolves.) + // Put a 1/1 black Rat creature token onto the battlefield. + addCard(Zone.HAND, playerA, "Lab Rats"); // {B} + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Zone.HAND, playerB, "Boomerang", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Stormfront Riders"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lab Rats"); + setChoice(playerA, "No"); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Boomerang", "Rat"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, "Stormfront Riders", 1); + assertHandCount(playerA, "Silvercoat Lion", 2); + assertGraveyardCount(playerA, "Lab Rats", 1); + assertGraveyardCount(playerB, "Boomerang", 1); + + assertPermanentCount(playerA, "Soldier", 3); + assertPermanentCount(playerA, "Rat", 0); + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java index 083a1936058..5c2a7cdd982 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java @@ -36,11 +36,11 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class SpellskiteTest extends CardTestPlayerBase { /** - * Tests that Wild Defiance triggers for Spellskite if spell target is changed to Spellskite + * Tests that Wild Defiance triggers for Spellskite if spell target is + * changed to Spellskite */ @Test public void testDisabledEffectOnChangeZone() { @@ -64,19 +64,22 @@ public class SpellskiteTest extends CardTestPlayerBase { assertLife(playerB, 20); assertPowerToughness(playerA, "Spellskite", 3, 7); - + } /** - * If Spellskite changes controller, its activated ability can activate but doesn't resolve properly. - * - * The specific instance was a Spellskite controlled by Vedalken Shackles. Land was targeted by Frost Titan, - * controller (not owner) of Spellskite paid the redirection cost, ability went on the stack, seemed to resolve, + * If Spellskite changes controller, its activated ability can activate but + * doesn't resolve properly. + * + * The specific instance was a Spellskite controlled by Vedalken Shackles. + * Land was targeted by Frost Titan, controller (not owner) of Spellskite + * paid the redirection cost, ability went on the stack, seemed to resolve, * target never changed. - * + * */ /** - * TODO: This test fails sometimes when building the complete Test Project -> Find the reason + * TODO: This test fails sometimes when building the complete Test Project + * -> Find the reason */ @Test public void testAfterChangeOfController() { @@ -88,17 +91,17 @@ public class SpellskiteTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerB, "Island", 6); // {UP}: Change a target of target spell or ability to Spellskite. - addCard(Zone.BATTLEFIELD, playerB, "Spellskite", 1); + addCard(Zone.BATTLEFIELD, playerB, "Spellskite", 1); // {4}{U}{U} - // Whenever Frost Titan becomes the target of a spell or ability an opponent controls, counter that spell or ability unless its controller pays 2. + // Whenever Frost Titan becomes the target of a spell or ability an opponent controls, counter that spell or ability unless its controller pays 2. // Whenever Frost Titan enters the battlefield or attacks, tap target permanent. It doesn't untap during its controller's next untap step. addCard(Zone.HAND, playerB, "Frost Titan", 1); - + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2},{T}: Gain control", "Spellskite"); castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Frost Titan"); addTarget(playerB, "Silvercoat Lion"); - + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerA, "{UP}: Change a target", "stack ability (Whenever {this} enters "); setStopAt(2, PhaseStep.BEGIN_COMBAT); @@ -106,13 +109,13 @@ public class SpellskiteTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Spellskite", 1); assertPermanentCount(playerB, "Frost Titan", 1); - + assertTapped("Spellskite", true); // (Battlefield) Tapped state is not equal (Silvercoat Lion) expected: but was: assertTapped("Silvercoat Lion", false); - - } - + + } + /** * Spellskite fails to redirect Cryptic Command on itself */ @@ -120,25 +123,25 @@ public class SpellskiteTest extends CardTestPlayerBase { public void testSpellskite() { addCard(Zone.BATTLEFIELD, playerA, "Island", 4); // Choose two - - // Counter target spell; - // or return target permanent to its owner's hand; - // or tap all creatures your opponents control; - // or draw a card. + // - Counter target spell; + // - return target permanent to its owner's hand; + // - tap all creatures your opponents control; + // - draw a card. addCard(Zone.HAND, playerA, "Cryptic Command"); - + addCard(Zone.BATTLEFIELD, playerB, "Spellskite", 1); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); addCard(Zone.BATTLEFIELD, playerB, "Island", 1); addCard(Zone.HAND, playerB, "Lightning Bolt", 1); - + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA); - - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Command", "mode=1Lightning Bolt^mode=2Silvercoat Lion", "Lightning Bolt"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Command", "mode=1Lightning Bolt^mode=2Silvercoat Lion", "Lightning Bolt"); setModeChoice(playerA, "1"); // Counter target spell - setModeChoice(playerA, "2"); // return target permanent to its owner's hand - - activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{UP}: Change a target of target spell or ability to {this}.", "Cryptic Command"); + setModeChoice(playerA, "2"); // return target permanent to its owner's hand + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{UP}: Change a target of target spell or ability to {this}.", "Cryptic Command", "Cryptic Command"); setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); @@ -146,12 +149,80 @@ public class SpellskiteTest extends CardTestPlayerBase { assertGraveyardCount(playerB, "Lightning Bolt", 1); assertGraveyardCount(playerA, "Cryptic Command", 1); - + assertHandCount(playerB, "Spellskite", 1); assertPermanentCount(playerB, "Silvercoat Lion", 1); assertLife(playerA, 20); assertLife(playerB, 20); - - } -} \ No newline at end of file + + } + + /** + * My opponent cast Cryptic Command tapping all of my creatures and bouncing + * a Blade Splicer token I had. I activated a Spellskite but got an error + * stating that Spellskite is not a legal target. + */ + @Test + public void testSpellskite2() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + // Choose two - + // Counter target spell; + // or return target permanent to its owner's hand; + // or tap all creatures your opponents control; + // or draw a card. + addCard(Zone.HAND, playerA, "Cryptic Command"); + + addCard(Zone.BATTLEFIELD, playerB, "Spellskite", 1); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 1); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Command", "mode=2Silvercoat Lion"); + setModeChoice(playerA, "2"); // return target permanent to its owner's hand + setModeChoice(playerA, "3"); // tap all creatures your opponents control + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{UP}: Change a target of target spell or ability to {this}.", "Cryptic Command"); + + setStopAt(2, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Cryptic Command", 1); + + assertHandCount(playerB, "Spellskite", 1); + assertPermanentCount(playerB, "Silvercoat Lion", 1); + assertTapped("Silvercoat Lion", true); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + } + + /** + * My opponent cast Lightning Bolt, targeting me. I redirected it to my + * Spellskite. The log window said Spellskite was an invalid target (though + * it should be valid). Spellskite still appeared to be targeted and took + * the damage, so just a log issue I guess. + */ + @Test + public void testRedirectBolt() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + addCard(Zone.HAND, playerA, "Lightning Bolt"); + + addCard(Zone.BATTLEFIELD, playerB, "Spellskite", 1); + addCard(Zone.BATTLEFIELD, playerB, "Island", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{UP}: Change a target of target spell or ability to {this}.", "Lightning Bolt"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Lightning Bolt", 1); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java new file mode 100644 index 00000000000..834852f20fa --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Ignore; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class TargetedTriggeredTest extends CardTestPlayerBase { + + /** + * Tests that the first spell that targets Kira, Great Glass-Spinner is + * countered. + * + */ + @Test + @Ignore + // this does currently not work in test, because the target event will be fired earlier during tests, + // so the zone change counter for the fixed target of the counterspell will not work + public void testKiraGreatGlassSpinnerFirstSpellTurn() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.HAND, playerA, "Lightning Bolt"); + + addCard(Zone.BATTLEFIELD, playerB, "Kira, Great Glass-Spinner", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Kira, Great Glass-Spinner"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Lightning Bolt", 1); + + assertPermanentCount(playerB, "Kira, Great Glass-Spinner", 1); + } + + /** + * With Ashenmoor Liege on the battlefield, my opponent casts Claustrophobia + * on it without losing 4hp. + */ + @Test + public void testAshenmoorLiege() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + addCard(Zone.HAND, playerA, "Claustrophobia"); // {1}{U}{U} + + // Other black creatures you control get +1/+1. + // Other red creatures you control get +1/+1. + // Whenever Ashenmoor Liege becomes the target of a spell or ability an opponent controls, that player loses 4 life. + addCard(Zone.BATTLEFIELD, playerB, "Ashenmoor Liege", 1); // 4/1 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Claustrophobia", "Ashenmoor Liege"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 16); + + assertPermanentCount(playerA, "Claustrophobia", 1); + assertPowerToughness(playerB, "Ashenmoor Liege", 4, 1); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/UlamogTheInfiniteGyreTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/UlamogTheInfiniteGyreTest.java index 44a39cd25c7..dfde867688b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/UlamogTheInfiniteGyreTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/UlamogTheInfiniteGyreTest.java @@ -36,11 +36,11 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class UlamogTheInfiniteGyreTest extends CardTestPlayerBase { /** - * Tests if Ulamog, the Infinite Gyre is countered its triggered ability resolves anyway + * Tests if Ulamog, the Infinite Gyre is countered its triggered ability + * resolves anyway */ @Test public void testDisabledEffectOnChangeZone() { @@ -57,11 +57,57 @@ public class UlamogTheInfiniteGyreTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); - assertHandCount(playerA, "Ulamog, the Infinite Gyre", 0); assertPermanentCount(playerA, "Ulamog, the Infinite Gyre", 0); assertGraveyardCount(playerB, "Counterspell", 1); assertPermanentCount(playerB, "Island", 1); } + /** + * If one of the big eldrazi is under the control of someone that is not its + * owner when it goes to the graveyard, it's ability doesn't trigger + * correctly. + */ + @Test + public void testControlledByOtherPlayer() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 15); + // When you cast Kozilek, Butcher of Truth, draw four cards. + // Annihilator 4 (Whenever this creature attacks, defending player sacrifices four permanents.) + // When Kozilek is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library. + addCard(Zone.HAND, playerA, "Kozilek, Butcher of Truth"); // {10} + // Destroy target creature. + // Spell mastery - If there are two or more instant and/or sorcery cards in your graveyard, you gain 2 life. + addCard(Zone.HAND, playerA, "Unholy Hunger"); // {3}{B}{B} + addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion"); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 4); + addCard(Zone.HAND, playerB, "Control Magic", 1); + addCard(Zone.GRAVEYARD, playerB, "Silvercoat Lion"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Kozilek, Butcher of Truth"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Control Magic", "Kozilek, Butcher of Truth"); + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "Unholy Hunger", "Kozilek, Butcher of Truth"); + setStopAt(2, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, "Kozilek, Butcher of Truth", 0); + assertPermanentCount(playerB, "Kozilek, Butcher of Truth", 0); + + assertLife(playerA, 20); + + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + assertHandCount(playerB, "Control Magic", 0); + assertGraveyardCount(playerB, "Control Magic", 1); + + assertGraveyardCount(playerA, "Kozilek, Butcher of Truth", 0); + + assertHandCount(playerA, "Kozilek, Butcher of Truth", 0); + assertGraveyardCount(playerA, "Silvercoat Lion", 0); + + assertGraveyardCount(playerA, "Unholy Hunger", 0); + + assertHandCount(playerA, 4); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/WorldgorgerDragonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/WorldgorgerDragonTest.java index db1557a3bd4..f21dade9e3c 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/WorldgorgerDragonTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/WorldgorgerDragonTest.java @@ -5,7 +5,6 @@ */ package org.mage.test.cards.triggers; - import mage.constants.PhaseStep; import mage.constants.Zone; import org.junit.Assert; @@ -16,7 +15,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class WorldgorgerDragonTest extends CardTestPlayerBase { /** @@ -25,20 +23,23 @@ public class WorldgorgerDragonTest extends CardTestPlayerBase { @Test public void testDisabledEffectOnChangeZone() { addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6); + // Flying + // Trample + // When Worldgorger Dragon enters the battlefield, exile all other permanents you control. + // When Worldgorger Dragon leaves the battlefield, return the exiled cards to the battlefield under their owners' control. addCard(Zone.HAND, playerA, "Worldgorger Dragon"); - + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); addCard(Zone.BATTLEFIELD, playerA, "Gerrard's Battle Cry", 1); - + addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2); // Destroy target nonartifact, nonblack creature. It can't be regenerated. addCard(Zone.HAND, playerB, "Terror", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Worldgorger Dragon"); - + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Terror", "Worldgorger Dragon"); - + setStopAt(2, PhaseStep.BEGIN_COMBAT); execute(); @@ -47,30 +48,35 @@ public class WorldgorgerDragonTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Worldgorger Dragon", 1); assertGraveyardCount(playerB, "Terror", 1); - + assertPermanentCount(playerA, "Silvercoat Lion", 1); assertPermanentCount(playerA, "Gerrard's Battle Cry", 1); - + } - /** - 1. Cast Animate Dead, targeting the Dragon - 2. Dragon comes into play, it's ability goes on the stack. - 3. The ability resolves, and all my other permanents leave play - 4. Since Animate Dead left play, Dragon goes to the graveyard - 5. Since the Dragon left play, the land and Animate Dead return to play. Animate Dead triggers, targeting the Dragon. - 6. In response to Animate Dead's ability going on the stack, tap the lands for mana. - 7. Animate Dead resolves, Dragon comes into play, everything else leaves play. - 8. Steps 4-7 repeat endlessly. Your mana pool fills. - 9. You can interrupt the sequence to play an instant. + /* + * 1. Cast Animate Dead, targeting the Dragon + * 2. Dragon comes into play, it's ability goes on the stack. + * 3. The ability resolves, and all my other permanents leave play + * 4. Since Animate Dead left play, Dragon goes to the graveyard + * 5. Since the Dragon left play, the land and Animate Dead return to play. Animate Dead triggers, targeting the Dragon. + * 6. In response to Animate Dead's ability going on the stack, tap the lands for mana. + * 7. Animate Dead resolves, Dragon comes into play, everything else leaves play. + * 8. Steps 4-7 repeat endlessly. Your mana pool fills. + * 9. You can interrupt the sequence to play an instant. */ @Test public void testWithAnimateDead() { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); - + // When Worldgorger Dragon enters the battlefield, exile all other permanents you control. // When Worldgorger Dragon leaves the battlefield, return the exiled cards to the battlefield under their owners' control. addCard(Zone.GRAVEYARD, playerA, "Worldgorger Dragon", 1); + // Enchant creature card in a graveyard + // When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" + // and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield + // under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it. + // Enchanted creature gets -1/-0. addCard(Zone.HAND, playerA, "Animate Dead"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); // Instant {X}{R}{R} @@ -78,10 +84,9 @@ public class WorldgorgerDragonTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Volcanic Geyser", 1); // When Staunch Defenders enters the battlefield, you gain 4 life. addCard(Zone.BATTLEFIELD, playerA, "Staunch Defenders", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Animate Dead", "Worldgorger Dragon"); - + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); @@ -107,43 +112,44 @@ public class WorldgorgerDragonTest extends CardTestPlayerBase { castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Geyser", playerB, 22); setChoice(playerA, "X=20"); - + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); - assertLife(playerA, 20); + assertLife(playerA, 44); assertLife(playerB, 0); assertGraveyardCount(playerA, "Volcanic Geyser", 1); - + } - + /** - * v9: Worldgorger Dragon + Animate Dead is still acting up (yey complex rules interactions!). - * The first time you return Animate Dead from Worldgorger's exile, it works like it's supposed - * to. You have to pick a creature, and it brings it back. But if you pick Worldgorger Dragon - * again, it allows you to not pick a creature, and regardless of whether you choose to skip or pick - * a different creature, it always returns the first creature you picked. Kind of hard to explain, - * but here's how to reproduce: - * - * 1) Cast Animate Dead, targeting Worldgorger Dragon - * 2) Worldgorger Dragon will exile Animate Dead, killing the dragon and returning the permanents - * 3) Select Worldgorger again - * 4) Step 2 repeats - * 5) Attempt to select a different creature. Worldgorger Dragon is returned instead. - * + * v9: Worldgorger Dragon + Animate Dead is still acting up (yey complex + * rules interactions!). The first time you return Animate Dead from + * Worldgorger's exile, it works like it's supposed to. You have to pick a + * creature, and it brings it back. But if you pick Worldgorger Dragon + * again, it allows you to not pick a creature, and regardless of whether + * you choose to skip or pick a different creature, it always returns the + * first creature you picked. Kind of hard to explain, but here's how to + * reproduce: + * + * 1) Cast Animate Dead, targeting Worldgorger Dragon 2) Worldgorger Dragon + * will exile Animate Dead, killing the dragon and returning the permanents + * 3) Select Worldgorger again 4) Step 2 repeats 5) Attempt to select a + * different creature. Worldgorger Dragon is returned instead. + * */ @Test public void testWithAnimateDeadDifferentTargets() { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); - + // When Worldgorger Dragon enters the battlefield, exile all other permanents you control. // When Worldgorger Dragon leaves the battlefield, return the exiled cards to the battlefield under their owners' control. addCard(Zone.GRAVEYARD, playerA, "Worldgorger Dragon", 1); addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion", 1); - // When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" - // and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield + // When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" + // and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield // under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it. addCard(Zone.HAND, playerA, "Animate Dead"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); @@ -152,43 +158,42 @@ public class WorldgorgerDragonTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Volcanic Geyser", 1); // When Staunch Defenders enters the battlefield, you gain 4 life. addCard(Zone.BATTLEFIELD, playerA, "Staunch Defenders", 1); - + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {B}"); activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {B}"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Animate Dead", "Worldgorger Dragon"); - activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); setChoice(playerA, "Worldgorger Dragon"); - activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); setChoice(playerA, "Silvercoat Lion"); - activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); - - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Geyser", playerB, 9); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Geyser", playerB, 9); setChoice(playerA, "X=9"); - + setStopAt(1, PhaseStep.BEGIN_COMBAT); execute(); assertGraveyardCount(playerA, "Volcanic Geyser", 1); - assertGraveyardCount(playerA, "Worldgorger Dragon", 1); + assertGraveyardCount(playerA, "Worldgorger Dragon", 1); assertPermanentCount(playerA, "Silvercoat Lion", 1); - + assertLife(playerA, 28); assertLife(playerB, 11); Assert.assertEquals("Mana pool", "[]", playerA.getManaAvailable(currentGame).toString()); - } - -} \ No newline at end of file + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ZadaHedronGrinderTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ZadaHedronGrinderTest.java new file mode 100644 index 00000000000..13a0c25179e --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ZadaHedronGrinderTest.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers; + +import mage.abilities.keyword.TrampleAbility; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class ZadaHedronGrinderTest extends CardTestPlayerBase { + + /** + * Playing Zada edh, strive cards such as Rouse the Mob do not copy when + * targeting only Zada. + */ + @Test + public void testWithStriveSpell() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + + // Whenever you cast an instant or sorcery spell that targets only Zada, Hedron Grinder, copy that spell for each other creature you control that the spell could target. Each copy targets a different one of those creatures. + addCard(Zone.BATTLEFIELD, playerA, "Zada, Hedron Grinder", 1); // 3/3 + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + + // Strive — Rouse the Mob costs {2}{R} more to cast for each target beyond the first. + // Any number of target creatures each get +2/+0 and gain trample until end of turn. + addCard(Zone.HAND, playerA, "Rouse the Mob", 1); // Instant - {R} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rouse the Mob", "Zada, Hedron Grinder"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertGraveyardCount(playerA, "Rouse the Mob", 1); + + assertPowerToughness(playerA, "Zada, Hedron Grinder", 5, 3); + assertAbility(playerA, "Zada, Hedron Grinder", TrampleAbility.getInstance(), true); + assertPowerToughness(playerA, "Silvercoat Lion", 4, 2); + assertAbility(playerA, "Silvercoat Lion", TrampleAbility.getInstance(), true); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ZurTheEnchanterTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ZurTheEnchanterTest.java new file mode 100644 index 00000000000..a0ce50e2430 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/ZurTheEnchanterTest.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class ZurTheEnchanterTest extends CardTestPlayerBase { + + /** + * Zur the Enchanter's ability + shroud + * + * You can reproduce this by attacking with a Zur the Enchanter that has + * shroud (Lightning Greaves, Diplomatic Immunity, Greater Auramancy + an + * aura on him, etc.) and when his ability triggers searching for an aura + * (in this case, Empyrial Armor) and trying to attach it to Zur himself. + * The game won't allow you to attach it him, even though it should, since + * the enchantment is put onto the battlefield and not cast, hence, no + * targeting is done. The rulings page for Zur itself say it so on Gatherer: + * + * Shroud shouldn't stop Empyrial Armor from attaching to Zur, only + * something like protection from white, for example, would do that. + */ + @Test + public void testAuraToBattlefieldDoesNotTarget() { + // Flying + // Whenever Zur the Enchanter attacks, you may search your library for an enchantment card with converted mana cost 3 or less and put it onto the battlefield. If you do, shuffle your library. + addCard(Zone.BATTLEFIELD, playerB, "Zur the Enchanter"); // 1/4 + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + // Enchant creature + // Shroud (This permanent can't be the target of spells or abilities.) + // Enchanted creature has shroud. + addCard(Zone.HAND, playerB, "Diplomatic Immunity"); // {1}{U} + // Enchant creature + // Enchanted creature gets +1/+1 for each card in your hand. + addCard(Zone.LIBRARY, playerB, "Empyrial Armor"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Diplomatic Immunity", "Zur the Enchanter"); + + attack(2, playerB, "Zur the Enchanter"); + setChoice(playerB, "Empyrial Armor"); + setChoice(playerB, "Zur the Enchanter"); + + setStopAt(2, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerB, "Diplomatic Immunity", 1); + assertPermanentCount(playerB, "Empyrial Armor", 1); + assertPowerToughness(playerB, "Zur the Enchanter", 2, 5); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/delayed/OnduRisingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/delayed/OnduRisingTest.java new file mode 100644 index 00000000000..d6b92fe2fee --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/delayed/OnduRisingTest.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers.delayed; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class OnduRisingTest extends CardTestPlayerBase { + + @Test + public void testLiflinkGained() { + addCard(Zone.BATTLEFIELD, playerB, "Plains", 5); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + // Whenever a creature attacks this turn, it gains lifelink until end of turn. + // Awaken 4—{4}{W} + addCard(Zone.HAND, playerB, "Ondu Rising", 1); + + activateManaAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}: Add {W}"); + activateManaAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}: Add {W}"); + activateManaAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}: Add {W}"); + activateManaAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}: Add {W}"); + activateManaAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{T}: Add {W}"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Ondu Rising with awaken"); + + attack(2, playerB, "Silvercoat Lion"); + attack(2, playerB, "Mountain"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertGraveyardCount(playerB, "Ondu Rising", 1); + assertPowerToughness(playerB, "Mountain", 4, 4); + + assertLife(playerA, 14); + assertLife(playerB, 26); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/OmnathLocusOfRageTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/OmnathLocusOfRageTest.java new file mode 100644 index 00000000000..4e95b114847 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/OmnathLocusOfRageTest.java @@ -0,0 +1,98 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers.dies; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class OmnathLocusOfRageTest extends CardTestPlayerBase { + + /** + * The new Omnath's ability doesn't trigger when he dies, although it + * explicitely states in the card's text that it should. + */ + @Test + public void testDiesTriggeredAbility() { + // Landfall - Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield. + // Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player. + addCard(Zone.BATTLEFIELD, playerA, "Omnath, Locus of Rage", 1); + + // Target player sacrifices a creature. + addCard(Zone.HAND, playerB, "Diabolic Edict", 1); // {1}{B} + addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Diabolic Edict", playerA); + addTarget(playerA, playerB); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Diabolic Edict", 1); + assertGraveyardCount(playerA, "Omnath, Locus of Rage", 1); + + assertLife(playerA, 20); + assertLife(playerB, 17); + + } + + @Test + public void testDiesTriggeredAbilityOnlyIfPresent() { + // Landfall - Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield. + // Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player. + addCard(Zone.BATTLEFIELD, playerA, "Omnath, Locus of Rage", 1); + addCard(Zone.BATTLEFIELD, playerA, "Lightning Elemental", 1); // 4/1 Elemental - Haste + + // Blastfire Bolt deals 5 damage to target creature. Destroy all Equipment attached to that creature. + addCard(Zone.HAND, playerB, "Blastfire Bolt", 1); // {5}{R} + addCard(Zone.HAND, playerB, "Lightning Bolt", 1); // {R} + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 7); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Lightning Elemental"); // Dying Lightning Elemental does no longer trigger ability of Omnath + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Blastfire Bolt", "Omnath, Locus of Rage", "Lightning Bolt"); + addTarget(playerA, playerB); + addTarget(playerA, playerB); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Lightning Bolt", 1); + assertGraveyardCount(playerB, "Blastfire Bolt", 1); + assertGraveyardCount(playerA, "Omnath, Locus of Rage", 1); + assertGraveyardCount(playerA, "Lightning Elemental", 1); + + assertLife(playerA, 20); + assertLife(playerB, 17); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SidisiBroodTyrantTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SidisiBroodTyrantTest.java index eaaefeed1d8..63a43d80069 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SidisiBroodTyrantTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SidisiBroodTyrantTest.java @@ -112,4 +112,48 @@ public class SidisiBroodTyrantTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Zombie", 2); } + + /* + Sidisi's zombie trigger still resolves even with Anafenza on the battle field. + + Steps: + Cast Anafenza + Pass + Cast Sidisi, mill creature. + Zombie is still created. + + Due to replacement effect of exiling creatures, the second phase of sidisi is null with Anafenza out. + + */ + @Test + public void testWithAnafenza() { + addCard(Zone.BATTLEFIELD, playerA, "Island"); + addCard(Zone.BATTLEFIELD, playerA, "Swamp"); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 4); + // {1}{B}{G}{U} + // Whenever Sidisi, Brood Tyrant enters the battlefield or attacks, put the top three cards of your library into your graveyard + // Whenever one or more creature cards are put into your graveyard from your library, put a 2/2 black Zombie creature token onto the battlefield. + addCard(Zone.HAND, playerA, "Sidisi, Brood Tyrant"); // 2/2 {1}{B}{G}{U} + addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 1); + addCard(Zone.LIBRARY, playerA, "Swamp", 1); + addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 1); + skipInitShuffling(); + + // Whenever Anafenza, the Foremost attacks, put a +1/+1 counter on another target tapped creature you control. + // If a creature card would be put into an opponent's graveyard from anywhere, exile it instead. + addCard(Zone.BATTLEFIELD, playerB, "Anafenza, the Foremost"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sidisi, Brood Tyrant"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, "Sidisi, Brood Tyrant", 1); + assertGraveyardCount(playerA, "Swamp", 1); + assertGraveyardCount(playerA, "Silvercoat Lion", 0); + assertExileCount("Silvercoat Lion", 2); + assertPermanentCount(playerA, "Zombie", 0); + + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SunderingTitanTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SunderingTitanTest.java new file mode 100644 index 00000000000..325257cf28c --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/SunderingTitanTest.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers.dies; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class SunderingTitanTest extends CardTestPlayerBase { + + /** + * the card Sundering Titan doesn't trigger for the aposing player + * + */ + @Test + public void testComesIntoTriggeredAbility() { + // // When Sundering Titan enters the battlefield or leaves the battlefield, choose a land of each basic land type, then destroy those lands. + addCard(Zone.HAND, playerA, "Sundering Titan"); // {8} + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + addCard(Zone.BATTLEFIELD, playerA, "Island", 2); + + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2); + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sundering Titan"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Sundering Titan", 1); + assertGraveyardCount(playerA, "Swamp", 1); + assertGraveyardCount(playerA, "Forest", 1); + assertGraveyardCount(playerA, "Island", 1); + + assertGraveyardCount(playerB, "Mountain", 1); + assertGraveyardCount(playerB, "Plains", 1); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/state/PhyrexianDevourerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/state/PhyrexianDevourerTest.java new file mode 100644 index 00000000000..8b62413c146 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/state/PhyrexianDevourerTest.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.triggers.state; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class PhyrexianDevourerTest extends CardTestPlayerBase { + + /** + * Check that Phyrexian Devourer is sacrifriced as soon as the counters are + * added + * + */ + @Test + public void testBoostChecked() { + // When Phyrexian Devourer's power is 7 or greater, sacrifice it. + // Exile the top card of your library: Put X +1/+1 counters on Phyrexian Devourer, where X is the exiled card's converted mana cost. + addCard(Zone.BATTLEFIELD, playerA, "Phyrexian Devourer"); + addCard(Zone.LIBRARY, playerA, "Phyrexian Devourer"); + skipInitShuffling(); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + + attack(2, playerB, "Silvercoat Lion"); + block(2, playerA, "Phyrexian Devourer", "Silvercoat Lion"); + + activateAbility(2, PhaseStep.DECLARE_BLOCKERS, playerA, "Exile the top card of your library"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertGraveyardCount(playerA, "Phyrexian Devourer", 1); + assertExileCount("Phyrexian Devourer", 1); + + assertPermanentCount(playerB, "Silvercoat Lion", 1); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java b/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java index e515286e02e..191d4f0c89b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/combat/AttackBlockRestrictionsTest.java @@ -298,4 +298,38 @@ public class AttackBlockRestrictionsTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Walking Corpse", 1); assertPermanentCount(playerB, "Llanowar Elves", 1); } + + /** + * Reproduces a bug when a creature that must be blocked is not attacking + */ + @Test + public void testTurntimberBasilisk() { + // Landfall - Whenever a land enters the battlefield under your control, you may + // have target creature block Turntimber Basilisk this turn if able. + addCard(Zone.BATTLEFIELD, playerA, "Turntimber Basilisk"); + addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears"); + addCard(Zone.HAND, playerA, "Forest"); + + addCard(Zone.BATTLEFIELD, playerB, "Storm Crow"); + + // Turntimber Basilisk's Landfall ability targets Storm Crow, + // so Storm Crow must block Turntimber Basilisk if able + playLand(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest"); + addTarget(playerA, "Storm Crow"); + + // Turntimber Basilisk doesn't attack and Storm Crow can block Grizzly Bears + attack(3, playerA, "Grizzly Bears"); + block(3, playerB, "Storm Crow", "Grizzly Bears"); + + setStopAt(3, PhaseStep.END_TURN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertPermanentCount(playerA, "Turntimber Basilisk", 1); + assertPermanentCount(playerA, "Grizzly Bears", 1); + assertPermanentCount(playerB, "Storm Crow", 0); + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/AnafenzaTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/AnafenzaTest.java new file mode 100644 index 00000000000..a1624958674 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/AnafenzaTest.java @@ -0,0 +1,175 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.commander.duel; + +import java.io.FileNotFoundException; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.GameException; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestCommanderDuelBase; + +/** + * + * @author LevelX2 + */ +public class AnafenzaTest extends CardTestCommanderDuelBase { + + @Override + protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { + setDecknamePlayerA("CommanderAnafenza_WBG.dck"); // Commander = Anafenza, the Foremost + return super.createNewGameAndPlayers(); + } + + /** + * I was using Anafenza, the Foremost as Commander. She attacked and traded + * with two creatures. I moved Anafenza to the Command Zone, but the + * opponent's creatures "when {this} dies" abilities triggered. Since + * Anafenza and those creatures all received lethal damage at the same time, + * the creatures should have been exiled due to Anafenza's replacement + * effect, but I guess since the logic asks if you want to use the Command + * Zone replacement effect first, that it doesn't see her leaving the + * battlefield at the same time as the other creatures. + * + * http://blogs.magicjudges.org/rulestips/2015/05/anafenza-vs-deathmist-raptor/ + */ + @Test + public void testAnafenzaExileInCombat() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + + // When Runed Servitor dies, each player draws a card. + addCard(Zone.BATTLEFIELD, playerB, "Runed Servitor", 2); + + // Whenever Anafenza, the Foremost attacks, put a +1/+1 counter on another target tapped creature you control. + // If a creature card would be put into an opponent's graveyard from anywhere, exile it instead. + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Anafenza, the Foremost"); + + attack(3, playerA, "Anafenza, the Foremost"); + block(3, playerB, "Runed Servitor", "Anafenza, the Foremost"); + block(3, playerB, "Runed Servitor", "Anafenza, the Foremost"); + + setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerA, 40); + assertLife(playerB, 40); + + assertExileCount("Runed Servitor", 2); + + assertCommandZoneCount(playerA, "Anafenza, the Foremost", 1); + assertGraveyardCount(playerA, "Anafenza, the Foremost", 0); + + assertHandCount(playerA, 1); // turn 3 draw + assertHandCount(playerB, 1); // turn 2 draw + + } + + /** + * Token don't go to exile because they are no creature cards + */ + @Test + public void testAnafenzaExileInCombatOmnathToken() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + addCard(Zone.BATTLEFIELD, playerA, "Acidic Slime", 1); + + addCard(Zone.HAND, playerB, "Forest", 2); + // Landfall - Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield. + // Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player. + addCard(Zone.BATTLEFIELD, playerB, "Omnath, Locus of Rage", 1); + + // Whenever Anafenza, the Foremost attacks, put a +1/+1 counter on another target tapped creature you control. + // If a creature card would be put into an opponent's graveyard from anywhere, exile it instead. + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Anafenza, the Foremost"); + + playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Forest"); + playLand(4, PhaseStep.PRECOMBAT_MAIN, playerB, "Forest"); + + attack(5, playerA, "Acidic Slime"); + block(5, playerB, "Elemental", "Acidic Slime"); + attack(5, playerA, "Anafenza, the Foremost"); + block(5, playerB, "Elemental", "Anafenza, the Foremost"); + addTarget(playerB, playerA); + + setStopAt(5, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertExileCount(playerA, 0); + assertExileCount(playerB, 0); + + assertPermanentCount(playerB, "Elemental", 1); + + assertGraveyardCount(playerA, "Acidic Slime", 1); + assertGraveyardCount(playerA, "Anafenza, the Foremost", 0); + assertCommandZoneCount(playerA, "Anafenza, the Foremost", 1); + + assertHandCount(playerA, 2); // turn 3 + 5 draw + assertHandCount(playerB, 2); // turn 2 + 4 draw + + assertLife(playerA, 37); + assertLife(playerB, 40); + } + + // Anafenza + Animated permanents + @Test + public void testAnafenzaExileAnimatedPermanents() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + + // {0}: Tap all lands you control. Chimeric Idol becomes a 3/3 Turtle artifact creature until end of turn. + addCard(Zone.BATTLEFIELD, playerB, "Chimeric Idol"); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 3); + + // Whenever Anafenza, the Foremost attacks, put a +1/+1 counter on another target tapped creature you control. + // If a creature card would be put into an opponent's graveyard from anywhere, exile it instead. + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Anafenza, the Foremost"); // 4/4 + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{0}: Tap all lands you control"); + + attack(2, playerB, "Chimeric Idol"); + block(2, playerA, "Anafenza, the Foremost", "Chimeric Idol"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerA, 40); + assertLife(playerB, 40); + + assertExileCount("Chimeric Idol", 1); + assertGraveyardCount(playerB, "Chimeric Idol", 0); + assertPermanentCount(playerB, "Chimeric Idol", 0); + + assertTappedCount("Mountain", true, 3); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastBRGCommanderTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastBRGCommanderTest.java index b7732e593b4..12dc632f2f3 100644 --- a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastBRGCommanderTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastBRGCommanderTest.java @@ -69,4 +69,31 @@ public class CastBRGCommanderTest extends CardTestCommanderDuelBase { } + /** + * Activating Karn Liberated 's ultimate in an edh game (human OR ai) causes + * all the command zones to lose their generals upon the new game restart + */ + @Test + public void castCommanderAfterKarnUltimate() { + // +4: Target player exiles a card from his or her hand. + // -3: Exile target permanent. + // -14: Restart the game, leaving in exile all non-Aura permanent cards exiled with Karn Liberated. Then put those cards onto the battlefield under your control. + addCard(Zone.BATTLEFIELD, playerA, "Karn Liberated", 1); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 2); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+4: Target player", playerA); + addTarget(playerA, "Silvercoat Lion"); + activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "+4: Target player", playerA); + addTarget(playerA, "Silvercoat Lion"); + activateAbility(5, PhaseStep.PRECOMBAT_MAIN, playerA, "-14: Restart"); + + setStopAt(5, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Karn Liberated", 0); + assertPermanentCount(playerA, "Silvercoat Lion", 2); + assertCommandZoneCount(playerA, "Prossh, Skyraider of Kher", 1); + assertCommandZoneCount(playerB, "Ob Nixilis of the Black Oath", 1); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/lki/LastKnownInformationTest.java b/Mage.Tests/src/test/java/org/mage/test/lki/LastKnownInformationTest.java index 5449da60a6b..64d79632015 100644 --- a/Mage.Tests/src/test/java/org/mage/test/lki/LastKnownInformationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/lki/LastKnownInformationTest.java @@ -3,7 +3,6 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ - package org.mage.test.lki; import mage.constants.PhaseStep; @@ -20,10 +19,10 @@ public class LastKnownInformationTest extends CardTestPlayerBase { /** * see here for more information * http://www.slightlymagic.net/forum/viewtopic.php?f=116&t=14516 - * - * Tests Safehold Elite with persist returns to battlefield with -1/-1 counter - * Murder Investigation has to put 2 tokens onto battlefield because enchanted Safehold Elite - * was 2/2 + * + * Tests Safehold Elite with persist returns to battlefield with -1/-1 + * counter Murder Investigation has to put 2 tokens onto battlefield because + * enchanted Safehold Elite was 2/2 * * @author LevelX */ @@ -38,9 +37,9 @@ public class LastKnownInformationTest extends CardTestPlayerBase { // {1}{W} // Enchant creature you control // When enchanted creature dies, put X 1/1 white Soldier creature tokens onto the battlefield, where X is its power. - addCard(Zone.HAND, playerA, "Murder Investigation",1); + addCard(Zone.HAND, playerA, "Murder Investigation", 1); - addCard(Zone.HAND, playerB, "Lightning Bolt",2); + addCard(Zone.HAND, playerB, "Lightning Bolt", 2); addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Murder Investigation", "Safehold Elite"); @@ -58,17 +57,20 @@ public class LastKnownInformationTest extends CardTestPlayerBase { // because enchanted Safehold Elite's P/T was 2/2, Murder Investigation has to put 2 Soldier onto the battlefield assertPermanentCount(playerA, "Soldier", 2); assertGraveyardCount(playerB, "Lightning Bolt", 2); - - assertActionCount(playerB, 0); + + assertActionCount(playerB, 0); } - + /** - * Here we test that Trostani's first ability checks the toughness on resolve. + * Here we test that Trostani's first ability checks the toughness on + * resolve. * */ @Test public void testTrostaniSelesnyasVoice1() { + // Whenever another creature enters the battlefield under your control, you gain life equal to that creature's toughness. + // {1}{G}{W}, {T}: Populate. (Put a token onto the battlefield that's a copy of a creature token you control.) addCard(Zone.BATTLEFIELD, playerA, "Trostani, Selesnya's Voice"); addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); @@ -76,20 +78,21 @@ public class LastKnownInformationTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Grizzly Bears", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Grizzly Bears"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Grizzly Bears", "Grizzly Bears", StackClause.WHILE_NOT_ON_STACK); setStopAt(1, PhaseStep.END_TURN); execute(); + assertGraveyardCount(playerA, "Giant Growth", 1); assertPermanentCount(playerA, "Grizzly Bears", 1); assertLife(playerA, 25); } /** - * Here we test correct spell interaction by playing Cloudshift BEFORE Giant Growth resolves. - * Cloudshift will remove 2/2 creature and it will return as 2/2. - * Giant Growth will be fizzled. - * That means that player should gain 2 + 2 life. + * Here we test correct spell interaction by playing Cloudshift BEFORE Giant + * Growth resolves. Cloudshift will remove 2/2 creature and it will return + * as 2/2. Giant Growth will be fizzled. That means that player should gain + * 2 + 2 life. */ @Test public void testTrostaniSelesnyasVoice2() { @@ -102,7 +105,7 @@ public class LastKnownInformationTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Grizzly Bears", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Grizzly Bears"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Grizzly Bears", "Grizzly Bears", StackClause.WHILE_NOT_ON_STACK); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cloudshift", "Grizzly Bears", "Giant Growth", StackClause.WHILE_ON_STACK); @@ -114,8 +117,8 @@ public class LastKnownInformationTest extends CardTestPlayerBase { } /** - * Here we test actual use of LKI by playing Cloudshift AFTER Giant Growth resolves. - * Cloudshift will remove 5/5 creature and it will return as 2/2. + * Here we test actual use of LKI by playing Cloudshift AFTER Giant Growth + * resolves. Cloudshift will remove 5/5 creature and it will return as 2/2. * That means that player should gain 5 + 2 life. * */ @@ -130,7 +133,7 @@ public class LastKnownInformationTest extends CardTestPlayerBase { addCard(Zone.HAND, playerA, "Grizzly Bears", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears"); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Grizzly Bears"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Giant Growth", "Grizzly Bears", "Grizzly Bears", StackClause.WHILE_NOT_ON_STACK); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cloudshift", "Grizzly Bears", "Giant Growth", StackClause.WHILE_NOT_ON_STACK); @@ -142,5 +145,4 @@ public class LastKnownInformationTest extends CardTestPlayerBase { } - } diff --git a/Mage.Tests/src/test/java/org/mage/test/load/LoadCallbackClient.java b/Mage.Tests/src/test/java/org/mage/test/load/LoadCallbackClient.java index 7a4e7cfa9ee..8f6943bd0d5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/load/LoadCallbackClient.java +++ b/Mage.Tests/src/test/java/org/mage/test/load/LoadCallbackClient.java @@ -17,7 +17,7 @@ import java.util.UUID; */ public class LoadCallbackClient implements CallbackClient { - private static final transient Logger log = Logger.getLogger(LoadCallbackClient.class); + private static final Logger log = Logger.getLogger(LoadCallbackClient.class); private Session session; private UUID gameId; diff --git a/Mage.Tests/src/test/java/org/mage/test/load/SimpleMageClient.java b/Mage.Tests/src/test/java/org/mage/test/load/SimpleMageClient.java index 88f0532070a..deb80b873c1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/load/SimpleMageClient.java +++ b/Mage.Tests/src/test/java/org/mage/test/load/SimpleMageClient.java @@ -18,7 +18,7 @@ public class SimpleMageClient implements MageClient { private final UUID clientId; private static final MageVersion version = new MageVersion(MageVersion.MAGE_VERSION_MAJOR, MageVersion.MAGE_VERSION_MINOR, MageVersion.MAGE_VERSION_PATCH, MageVersion.MAGE_VERSION_MINOR_PATCH, MageVersion.MAGE_VERSION_INFO); - private static final transient Logger log = Logger.getLogger(SimpleMageClient.class); + private static final Logger log = Logger.getLogger(SimpleMageClient.class); private final CallbackClient callbackClient; diff --git a/Mage.Tests/src/test/java/org/mage/test/mana/ManaTest.java b/Mage.Tests/src/test/java/org/mage/test/mana/ManaTest.java new file mode 100644 index 00000000000..49f158d6628 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/mana/ManaTest.java @@ -0,0 +1,686 @@ +package org.mage.test.mana; + +import mage.Mana; +import mage.constants.ColoredManaSymbol; +import mage.constants.ManaType; +import mage.filter.FilterMana; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +import static junit.framework.Assert.assertTrue; +import static junit.framework.TestCase.assertFalse; +import static org.junit.Assert.assertEquals; + +/** + * Custom unit tests for {link Mana}. + * + * @author githubpoixen@github.com + */ +public class ManaTest { + + @Rule + public ExpectedException expectedException = ExpectedException.none(); + + + @Test + public void shouldNotAllowNullCopyConstructor() { + // given + expectedException.expect(NullPointerException.class); + expectedException.expectMessage("The passed in mana can not be null"); + + // when + Mana nullMana = null; + new Mana(nullMana); + } + + + @Test + public void shouldCreateManaFromCopy() { + // given + Mana original = new Mana(); + original.increaseBlack(); + + // when + Mana copy = new Mana(original); + + // then + assertEquals(0, copy.getGreen()); + assertEquals(0, copy.getRed()); + assertEquals(1, copy.getBlack()); + assertEquals(0, copy.getBlue()); + assertEquals(0, copy.getWhite()); + } + + + @Test + public void shouldCreateManaFromGreenColoredManaSymbol() { + // given + ColoredManaSymbol symbol = ColoredManaSymbol.G; + + // when + Mana mana = new Mana(symbol); + + // then + assertEquals(1, mana.getGreen()); + assertEquals(0, mana.getRed()); + assertEquals(0, mana.getBlack()); + assertEquals(0, mana.getBlue()); + assertEquals(0, mana.getWhite()); + } + + + @Test + public void shouldCreateManaFromRedColoredManaSymbol() { + // given + ColoredManaSymbol symbol = ColoredManaSymbol.R; + + // when + Mana mana = new Mana(symbol); + + // then + assertEquals(0, mana.getGreen()); + assertEquals(1, mana.getRed()); + assertEquals(0, mana.getBlack()); + assertEquals(0, mana.getBlue()); + assertEquals(0, mana.getWhite()); + } + + + @Test + public void shouldCreateManaFromBlackColoredManaSymbol() { + // given + ColoredManaSymbol symbol = ColoredManaSymbol.B; + + // when + Mana mana = new Mana(symbol); + + // then + assertEquals(0, mana.getGreen()); + assertEquals(0, mana.getRed()); + assertEquals(1, mana.getBlack()); + assertEquals(0, mana.getBlue()); + assertEquals(0, mana.getWhite()); + } + + + @Test + public void shouldCreateManaFromBlueColoredManaSymbol() { + // given + ColoredManaSymbol symbol = ColoredManaSymbol.U; + + // when + Mana mana = new Mana(symbol); + + // then + assertEquals(0, mana.getGreen()); + assertEquals(0, mana.getRed()); + assertEquals(0, mana.getBlack()); + assertEquals(1, mana.getBlue()); + assertEquals(0, mana.getWhite()); + } + + + @Test + public void shouldCreateManaFromWhiteColoredManaSymbol() { + // given + ColoredManaSymbol symbol = ColoredManaSymbol.W; + + // when + Mana mana = new Mana(symbol); + + // then + assertEquals(0, mana.getGreen()); + assertEquals(0, mana.getRed()); + assertEquals(0, mana.getBlack()); + assertEquals(0, mana.getBlue()); + assertEquals(1, mana.getWhite()); + } + + + @Test + public void shouldNotCreateManaFromNullColoredManaSymbol() { + // given + ColoredManaSymbol nullSymbol = null; + + expectedException.expect(NullPointerException.class); + expectedException.expectMessage("The passed in ColoredManaSymbol can not be null"); + + // when + new Mana(nullSymbol); + } + + + @Test + public void shouldCreateManaFromIntegers() { + + // when + Mana mana = new Mana(1, 2, 3, 4, 5, 6, 7); + + // then + assertEquals(1, mana.getRed()); + assertEquals(2, mana.getGreen()); + assertEquals(3, mana.getBlue()); + assertEquals(4, mana.getWhite()); + assertEquals(5, mana.getBlack()); + assertEquals(6, mana.getColorless()); + assertEquals(7, mana.getAny()); + } + + + @Test + public void shouldNotAllowNegativeIntegers() { + // given + + // when + Mana mana = new Mana(-1, 2, 3, 4, 5, 6, 7); + + // then + assertEquals(0, mana.getRed()); + } + + + @Test + public void shouldCreateRedMana() { + + // when + Mana mana = Mana.RedMana(1); + + // then + assertEquals(1, mana.getRed()); + } + + + @Test + public void shouldCreateGreenMana() { + + // when + Mana mana = Mana.GreenMana(1); + + // then + assertEquals(1, mana.getGreen()); + } + + + @Test + public void shouldCreateBlueMana() { + + // when + Mana mana = Mana.BlueMana(1); + + // then + assertEquals(1, mana.getBlue()); + } + + + @Test + public void shouldCreateWhiteMana() { + + // when + Mana mana = Mana.WhiteMana(1); + + // then + assertEquals(1, mana.getWhite()); + } + + + @Test + public void shouldCreateBlackMana() { + + // when + Mana mana = Mana.BlackMana(1); + + // then + assertEquals(1, mana.getBlack()); + } + + + @Test + public void shouldCreateColorlessMana() { + + // when + Mana mana = Mana.ColorlessMana(1); + + // then + assertEquals(1, mana.getColorless()); + } + + + @Test + public void shouldNotAllowNegativeRedMana() { + // given + + // when + Mana mana = Mana.RedMana(-1); + + //then + assertEquals(0, mana.getRed()); + } + + + @Test + public void shouldNotAllowNegativeGreenMana() { + // given + + // when + Mana mana = Mana.GreenMana(-1); + + //then + assertEquals(0, mana.getGreen()); + } + + + @Test + public void shouldNotAllowNegativeBlueMana() { + // given + + // when + Mana mana = Mana.BlueMana(-1); + + //then + assertEquals(0, mana.getBlue()); + } + + + @Test + public void shouldNotAllowNegativeWhiteMana() { + // given + + // when + Mana mana = Mana.WhiteMana(-1); + + //then + assertEquals(0, mana.getWhite()); + } + + + @Test + public void shouldNotAllowNegativeBlackMana() { + // given + + // when + Mana mana = Mana.BlackMana(-1); + + //then + assertEquals(0, mana.getBlack()); + } + + + @Test + public void shouldNotAllowNegativeColorlessMana() { + // given + + // when + Mana mana = Mana.ColorlessMana(-1); + + //then + assertEquals(0, mana.getColorless()); + } + + + @Test + public void shouldAddMana() { + // given + Mana thisMana = new Mana(1, 2, 3, 4, 5, 6, 7); + Mana thatMana = new Mana(1, 2, 3, 4, 5, 6, 7); + + + // when + thisMana.add(thatMana); + + // then + assertEquals(2, thisMana.getRed()); + assertEquals(4, thisMana.getGreen()); + assertEquals(6, thisMana.getBlue()); + assertEquals(8, thisMana.getWhite()); + assertEquals(10, thisMana.getBlack()); + assertEquals(12, thisMana.getColorless()); + assertEquals(14, thisMana.getAny()); + } + + + @Test + public void shouldIncreaseRedMana() { + // given + Mana mana = new Mana(); + + // when + mana.increaseRed(); + + // then + assertEquals(1, mana.getRed()); + } + + + @Test + public void shouldIncreaseGreenMana() { + // given + Mana mana = new Mana(); + + // when + mana.increaseGreen(); + + // then + assertEquals(1, mana.getGreen()); + } + + @Test + public void shouldIncreaseBlueMana() { + // given + Mana mana = new Mana(); + + // when + mana.increaseBlue(); + + // then + assertEquals(1, mana.getBlue()); + } + + @Test + public void shouldIncreaseWhiteMana() { + // given + Mana mana = new Mana(); + + // when + mana.increaseWhite(); + + // then + assertEquals(1, mana.getWhite()); + } + + @Test + public void shouldIncreaseBlackMana() { + // given + Mana mana = new Mana(); + + // when + mana.increaseBlack(); + + // then + assertEquals(1, mana.getBlack()); + } + + @Test + public void shouldIncreaseColorlessMana() { + // given + Mana mana = new Mana(); + + // when + mana.increaseColorless(); + + // then + assertEquals(1, mana.getColorless()); + } + + @Test + public void shouldSubtractMana() { + // given + Mana thisMana = new Mana(2, 2, 2, 2, 2, 2, 2); + Mana thatMana = new Mana(1, 1, 1, 1, 1, 1, 1); + + // when + thisMana.subtract(thatMana); + + // then + assertEquals(1, thisMana.getRed()); + assertEquals(1, thisMana.getGreen()); + assertEquals(1, thisMana.getBlue()); + assertEquals(1, thisMana.getWhite()); + assertEquals(1, thisMana.getBlack()); + assertEquals(1, thisMana.getColorless()); + assertEquals(1, thisMana.getAny()); + } + + + @Test + public void shouldSubtractCost() { + // given + Mana thisMana = new Mana(2, 2, 2, 2, 2, 2, 2); + Mana thatMana = new Mana(10, 1, 1, 1, 10, 1, 1); + + // when + thisMana.subtractCost(thatMana); + + // then + assertEquals(-8, thisMana.getRed()); + assertEquals(1, thisMana.getGreen()); + assertEquals(1, thisMana.getBlue()); + assertEquals(1, thisMana.getWhite()); + assertEquals(-8, thisMana.getBlack()); + assertEquals(1, thisMana.getColorless()); + assertEquals(1, thisMana.getAny()); + } + + + @Test + public void shouldUseExistingManaToPayColorless() { + // given + Mana available = new Mana(); + available.setRed(7); + + Mana cost = new Mana(); + cost.setRed(4); + cost.setColorless(2); + + // when + available.subtractCost(cost); + + // then + assertEquals(1, available.getRed()); + } + + + @Test + public void shouldThrowExceptionOnUnavailableColorless() { + // given + expectedException.expect(ArithmeticException.class); + expectedException.expectMessage("Not enough mana to pay colorless"); + Mana available = new Mana(); + available.setRed(4); + + Mana cost = new Mana(); + cost.setRed(4); + cost.setColorless(2); + + // when + available.subtractCost(cost); + } + + + @Test + public void shouldReturnCount() { + // given + Mana mana = new Mana(1, 2, 3, 4, 5, 6, 7); + FilterMana filter = new FilterMana(); + filter.setBlack(true); + + // when + int totalCount = mana.count(); + int coloredCount = mana.countColored(); + int filteredMana = mana.count(filter); + + // then + assertEquals(28, totalCount); + assertEquals(22, coloredCount); + assertEquals(5, filteredMana); + } + + + @Test + public void shouldReturnString() { + // given + Mana mana = new Mana(1, 2, 3, 0, 3, 6, 2); + + // when + String ret = mana.toString(); + + // then + assertEquals("{6}{R}{G}{G}{U}{U}{U}{B}{B}{B}{Any}{Any}", ret); + } + + @Test + public void shouldClearMana() { + // given + Mana mana = new Mana(1, 2, 3, 4, 5, 6, 7); + + // when + mana.clear(); + + // then + assertEquals(0, mana.getRed()); + assertEquals(0, mana.getGreen()); + assertEquals(0, mana.getBlue()); + assertEquals(0, mana.getWhite()); + assertEquals(0, mana.getBlack()); + assertEquals(0, mana.getColorless()); + assertEquals(0, mana.getAny()); + } + + + @Test + public void shouldReturnCopy() { + // given + Mana mana = new Mana(1, 2, 3, 4, 5, 6, 7); + + // when + Mana copy = mana.copy(); + + // then + assertEquals(mana, copy); // are equal + assertFalse(mana == copy); // are not the same object + } + + @Test + public void shouldGetColorByColoredManaSymbol() { + // given + Mana mana = new Mana(1, 1, 1, 1, 1, 1, 1); + + // when + int redMana = mana.getColor(ColoredManaSymbol.R); + int greenMana = mana.getColor(ColoredManaSymbol.G); + int blueMana = mana.getColor(ColoredManaSymbol.U); + int blackMana = mana.getColor(ColoredManaSymbol.B); + int whiteMana = mana.getColor(ColoredManaSymbol.W); + + // then + assertEquals(1, redMana); + assertEquals(1, greenMana); + assertEquals(1, blueMana); + assertEquals(1, blackMana); + assertEquals(1, whiteMana); + } + + + @Test + public void shouldGetColorByManaType() { + // given + Mana mana = new Mana(1, 1, 1, 1, 1, 1, 1); + + // when + int redMana = mana.get(ManaType.RED); + int greenMana = mana.get(ManaType.GREEN); + int blueMana = mana.get(ManaType.BLUE); + int blackMana = mana.get(ManaType.BLACK); + int whiteMana = mana.get(ManaType.WHITE); + int colorlessMana = mana.get(ManaType.COLORLESS); + + // then + assertEquals(1, redMana); + assertEquals(1, greenMana); + assertEquals(1, blueMana); + assertEquals(1, blackMana); + assertEquals(1, whiteMana); + assertEquals(1, colorlessMana); + } + + + @Test + public void shouldSetManaFromType() { + // given + Mana mana = new Mana(); + + // when + mana.set(ManaType.BLACK, 3); + mana.set(ManaType.BLUE, 4); + mana.set(ManaType.RED, 5); + mana.set(ManaType.GREEN, 6); + mana.set(ManaType.WHITE, 7); + mana.set(ManaType.COLORLESS, 8); + + // then + assertEquals(3, mana.getBlack()); + assertEquals(4, mana.getBlue()); + assertEquals(5, mana.getRed()); + assertEquals(6, mana.getGreen()); + assertEquals(7, mana.getWhite()); + assertEquals(8, mana.getColorless()); + } + + @Test + public void shouldSetToMana() { + // given + Mana mana = new Mana(); + Mana newMana = new Mana(1, 2, 3, 4, 5, 6, 7); + + // when + mana.setToMana(newMana); + + // then + assertEquals(mana, newMana); + assertFalse(mana == newMana); + } + + + @Test + public void shouldHaveEqualManaValue() { + // given + Mana mana = new Mana(1, 2, 3, 4, 5, 6, 7); + Mana newMana = new Mana(1, 2, 3, 4, 5, 6, 7); + + // when + boolean equalMana = mana.equalManaValue(newMana); + + // then + assertTrue(equalMana); + } + + + @Test + public void shouldGetDifferentColors() { + // given + Mana mana = new Mana(); + mana.setRed(3); + mana.setGreen(2); + + // when + int colors = mana.getDifferentColors(); + + // then + assertEquals(2, colors); + } + + + @Test + public void shouldNotSetManaLessThanZero() { + // given + Mana mana = new Mana(); + + // when + mana.setRed(-4); + mana.setGreen(-4); + mana.setBlue(-4); + mana.setWhite(-4); + mana.setBlack(-4); + mana.setColorless(-4); + mana.setAny(-4); + + // then + assertEquals(0, mana.getRed()); + assertEquals(0, mana.getGreen()); + assertEquals(0, mana.getBlue()); + assertEquals(0, mana.getWhite()); + assertEquals(0, mana.getBlack()); + assertEquals(0, mana.getColorless()); + assertEquals(0, mana.getAny()); + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/multiplayer/MyriadTest.java b/Mage.Tests/src/test/java/org/mage/test/multiplayer/MyriadTest.java new file mode 100644 index 00000000000..eb0c3c4477c --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/multiplayer/MyriadTest.java @@ -0,0 +1,123 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.multiplayer; + +import java.io.FileNotFoundException; +import mage.constants.MultiplayerAttackOption; +import mage.constants.PhaseStep; +import mage.constants.RangeOfInfluence; +import mage.constants.Zone; +import mage.game.FreeForAll; +import mage.game.Game; +import mage.game.GameException; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestMultiPlayerBase; + +/** + * + * @author LevelX2 + */ +public class MyriadTest extends CardTestMultiPlayerBase { + + @Override + protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { + Game game = new FreeForAll(MultiplayerAttackOption.MULTIPLE, RangeOfInfluence.ALL, 0, 40); + // Player order: A -> D -> C -> B + playerA = createPlayer(game, playerA, "PlayerA"); + playerB = createPlayer(game, playerB, "PlayerB"); + playerC = createPlayer(game, playerC, "PlayerC"); + playerD = createPlayer(game, playerD, "PlayerD"); + return game; + } + + /** + * Tests Myriad multiplayer effects Player order: A -> D -> C -> B + */ + @Test + public void CallerOfThePackTest() { + // Trample + // Myriad (Whenever this creature attacks, for each opponent other than the defending player, put a token that's a copy of this creature onto the battlefield tapped and attacking that player or a planeswalker he or she controls. Exile those tokens at the end of combat.) + addCard(Zone.BATTLEFIELD, playerD, "Caller of the Pack"); // 8/6 + + attack(2, playerD, "Caller of the Pack", playerA); + + setStopAt(2, PhaseStep.DECLARE_BLOCKERS); + execute(); + + assertPermanentCount(playerD, "Caller of the Pack", 3); + } + + @Test + public void CallerOfThePackTestExile() { + // Trample + // Myriad (Whenever this creature attacks, for each opponent other than the defending player, put a token that's a copy of this creature onto the battlefield tapped and attacking that player or a planeswalker he or she controls. Exile those tokens at the end of combat.) + addCard(Zone.BATTLEFIELD, playerD, "Caller of the Pack"); // 8/6 + + attack(2, playerD, "Caller of the Pack", playerA); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertPermanentCount(playerD, "Caller of the Pack", 1); + + assertLife(playerA, 32); + assertLife(playerB, 32); + assertLife(playerC, 32); + assertLife(playerD, 40); + + } + + @Test + public void CallerOfThePackTestExilePlaneswalker() { + // Trample + // Myriad (Whenever this creature attacks, for each opponent other than the defending player, put a token that's a copy of this creature onto the battlefield tapped and attacking that player or a planeswalker he or she controls. Exile those tokens at the end of combat.) + addCard(Zone.BATTLEFIELD, playerD, "Caller of the Pack"); // 8/6 + + // +1: You gain 2 life. + // -1: Put a +1/+1 counter on each creature you control. Those creatures gain vigilance until end of turn. + // -6: Put a white Avatar creature token onto the battlefield. It has "This creature's power and toughness are each equal to your life total." + addCard(Zone.BATTLEFIELD, playerA, "Ajani Goldmane"); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1:"); + + attack(2, playerD, "Caller of the Pack", playerC); + addTarget(playerD, "Ajani Goldmane"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertPermanentCount(playerD, "Caller of the Pack", 1); + assertGraveyardCount(playerA, "Ajani Goldmane", 1); + + assertLife(playerA, 42); + assertLife(playerB, 32); + assertLife(playerC, 32); + assertLife(playerD, 40); + + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java index e76f6cc21ea..2d070c4fa7f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java @@ -29,7 +29,6 @@ package org.mage.test.player; import java.io.Serializable; import java.util.ArrayList; -import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -44,6 +43,8 @@ import mage.abilities.Modes; import mage.abilities.SpellAbility; import mage.abilities.TriggeredAbility; import mage.abilities.costs.AlternativeSourceCosts; +import mage.abilities.costs.Cost; +import mage.abilities.costs.Costs; import mage.abilities.costs.VariableCost; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; @@ -53,6 +54,7 @@ import mage.cards.Card; import mage.cards.Cards; import mage.cards.decks.Deck; import mage.choices.Choice; +import mage.constants.AbilityType; import mage.constants.ManaType; import mage.constants.Outcome; import mage.constants.PhaseStep; @@ -70,6 +72,7 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.NamePredicate; import mage.filter.predicate.permanent.AttackingPredicate; import mage.filter.predicate.permanent.BlockingPredicate; +import mage.filter.predicate.permanent.SummoningSicknessPredicate; import mage.game.Game; import mage.game.Graveyard; import mage.game.Table; @@ -92,11 +95,13 @@ import mage.target.TargetPermanent; import mage.target.TargetPlayer; import mage.target.TargetSource; import mage.target.TargetSpell; -import mage.target.common.TargetCardInGraveyard; import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetCardInOpponentsGraveyard; +import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCreaturePermanentAmount; import mage.target.common.TargetPermanentOrPlayer; +import mage.util.MessageToClient; import org.junit.Ignore; /** @@ -117,6 +122,8 @@ public class TestPlayer implements Player { private final ComputerPlayer computerPlayer; + private String[] groupsForTargetHandling = null; + public TestPlayer(ComputerPlayer computerPlayer) { this.computerPlayer = computerPlayer; AIPlayer = false; @@ -203,23 +210,14 @@ public class TestPlayer implements Player { return true; } -// private boolean checkSpellOnTopOfStackCondition(String[] groups, Game game) { -// if (groups.length > 2 && groups[2].startsWith("spellOnTopOfStack=")) { -// String spellOnTopOFStack = groups[2].substring(18); -// if (game.getStack().size() > 0) { -// StackObject stackObject = game.getStack().getFirst(); -// if (stackObject != null && stackObject.getStackAbility().toString().contains(spellOnTopOFStack)) { -// return true; -// } -// } -// return false; -// } -// return true; -// } - private boolean addTargets(Ability ability, String[] groups, Game game) { + @Override + public boolean addTargets(Ability ability, Game game) { + if (groupsForTargetHandling == null) { + return true; + } boolean result = true; - for (int i = 1; i < groups.length; i++) { - String group = groups[i]; + for (int i = 1; i < groupsForTargetHandling.length; i++) { + String group = groupsForTargetHandling[i]; if (group.startsWith("spellOnStack") || group.startsWith("spellOnTopOfStack") || group.startsWith("!spellOnStack") || group.startsWith("target=null") || group.startsWith("manaInPool=")) { break; } @@ -276,29 +274,36 @@ public class TestPlayer implements Player { int index = 0; int targetsSet = 0; for (String targetName : targetList) { + Mode selectedMode = null; if (targetName.startsWith("mode=")) { int modeNr = Integer.parseInt(targetName.substring(5, 6)); if (modeNr == 0 || modeNr > ability.getModes().size()) { throw new UnsupportedOperationException("Given mode number (" + modeNr + ") not available for " + ability.toString()); } - int modeCounter = 1; - for (Mode mode : ability.getModes().values()) { - if (modeCounter == modeNr) { - ability.getModes().setMode(mode); + UUID modeId = ability.getModes().getModeId(modeNr); + + for (Mode mode : ability.getModes().getSelectedModes()) { + if (mode.getId().equals(modeId)) { + selectedMode = mode; + ability.getModes().setActiveMode(mode); index = 0; // reset target index if mode changes break; } - modeCounter++; } targetName = targetName.substring(6); + } else { + selectedMode = ability.getModes().getMode(); } - if (ability.getTargets().size() == 0) { + if (selectedMode == null) { + throw new UnsupportedOperationException("Mode not available for " + ability.toString()); + } + if (selectedMode.getTargets().size() == 0) { throw new AssertionError("Ability has no targets. " + ability.toString()); } - if (index >= ability.getTargets().size()) { + if (index >= selectedMode.getTargets().size()) { break; // this can happen if targets should be set but can't be used because of hexproof e.g. } - Target currentTarget = ability.getTargets().get(index); + Target currentTarget = selectedMode.getTargets().get(index); if (targetName.startsWith("targetPlayer=")) { target = targetName.substring(targetName.indexOf("targetPlayer=") + 13); for (Player player : game.getPlayers().values()) { @@ -361,22 +366,26 @@ public class TestPlayer implements Player { if (action.getAction().startsWith("activate:")) { String command = action.getAction(); command = command.substring(command.indexOf("activate:") + 9); + groupsForTargetHandling = null; String[] groups = command.split("\\$"); if (groups.length > 2 && !checkExecuteCondition(groups, game)) { break; } for (Ability ability : computerPlayer.getPlayable(game, true)) { if (ability.toString().startsWith(groups[0])) { + int bookmark = game.bookmarkState(); Ability newAbility = ability.copy(); if (groups.length > 1 && !groups[1].equals("target=NO_TARGET")) { - if (!addTargets(newAbility, groups, game)) { - // targets could not be set -> try next priority - break; - } + groupsForTargetHandling = groups; } - computerPlayer.activateAbility((ActivatedAbility) newAbility, game); - actions.remove(action); - return true; + if (computerPlayer.activateAbility((ActivatedAbility) newAbility, game)) { + actions.remove(action); + groupsForTargetHandling = null; + return true; + } else { + game.restoreState(bookmark, ability.getRule()); + } + } } } else if (action.getAction().startsWith("manaActivate:")) { @@ -476,6 +485,7 @@ public class TestPlayer implements Player { FilterCreatureForCombat filter = new FilterCreatureForCombat(); filter.add(new NamePredicate(groups[0])); filter.add(Predicates.not(new AttackingPredicate())); + filter.add(Predicates.not(new SummoningSicknessPredicate())); Permanent attacker = findPermanent(filter, computerPlayer.getId(), game); if (attacker != null && attacker.canAttack(defenderId, game)) { computerPlayer.declareAttacker(attacker.getId(), defenderId, game, false); @@ -545,7 +555,7 @@ public class TestPlayer implements Player { if (!choices.isEmpty()) { for (String choice : choices) { for (int index = 0; index < rEffects.size(); index++) { - if (choice.equals(rEffects.get(index))) { + if (choice.equals(rEffects.get(Integer.toString(index)))) { choices.remove(choice); return index; } @@ -558,6 +568,11 @@ public class TestPlayer implements Player { @Override public boolean choose(Outcome outcome, Target target, UUID sourceId, Game game, Map options) { if (!choices.isEmpty()) { + Ability source = null; + StackObject stackObject = game.getStack().getStackObject(sourceId); + if (stackObject != null) { + source = stackObject.getStackAbility(); + } if ((target instanceof TargetPermanent) || (target instanceof TargetPermanentOrPlayer)) { // player target not implemted yet FilterPermanent filterPermanent; if (target instanceof TargetPermanentOrPlayer) { @@ -569,21 +584,38 @@ public class TestPlayer implements Player { String[] targetList = choose2.split("\\^"); boolean targetFound = false; for (String targetName : targetList) { + boolean originOnly = false; + boolean copyOnly = false; + if (targetName.endsWith("]")) { + if (targetName.endsWith("[no copy]")) { + originOnly = true; + targetName = targetName.substring(0, targetName.length() - 9); + } + if (targetName.endsWith("[only copy]")) { + copyOnly = true; + targetName = targetName.substring(0, targetName.length() - 11); + } + } for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filterPermanent, game)) { if (target.getTargets().contains(permanent.getId())) { continue; } if (permanent.getName().equals(targetName)) { - if (target.isNotTarget() || ((TargetPermanent) target).canTarget(computerPlayer.getId(), permanent.getId(), null, game)) { - target.add(permanent.getId(), game); - targetFound = true; - break; + + if (target.isNotTarget() || ((TargetPermanent) target).canTarget(computerPlayer.getId(), permanent.getId(), source, game)) { + if ((permanent.isCopy() && !originOnly) || (!permanent.isCopy() && !copyOnly)) { + target.add(permanent.getId(), game); + targetFound = true; + break; + } } } else if ((permanent.getName() + "-" + permanent.getExpansionSetCode()).equals(targetName)) { - if (target.isNotTarget() || ((TargetPermanent) target).canTarget(computerPlayer.getId(), permanent.getId(), null, game)) { - target.add(permanent.getId(), game); - targetFound = true; - break; + if (target.isNotTarget() || ((TargetPermanent) target).canTarget(computerPlayer.getId(), permanent.getId(), source, game)) { + if ((permanent.isCopy() && !originOnly) || (!permanent.isCopy() && !copyOnly)) { + target.add(permanent.getId(), game); + targetFound = true; + break; + } } } } @@ -607,40 +639,38 @@ public class TestPlayer implements Player { } } } - if (target instanceof TargetCardInGraveyard) { - TargetCardInGraveyard targetCardInGraveyard = ((TargetCardInGraveyard) target); - Set possibleTargets = new HashSet<>(); - for (UUID playerId : this.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { - possibleTargets.addAll(player.getGraveyard()); - } - } - + if (target instanceof TargetCard) { + TargetCard targetCard = ((TargetCard) target); + Set possibleTargets = targetCard.possibleTargets(sourceId, target.getTargetController() == null ? getId() : target.getTargetController(), game); for (String choose2 : choices) { String[] targetList = choose2.split("\\^"); boolean targetFound = false; - for (UUID targetId : possibleTargets) { - MageObject targetObject = game.getObject(targetId); - if (targetObject != null) { - for (String targetName : targetList) { + Choice: + for (String targetName : targetList) { + for (UUID targetId : possibleTargets) { + MageObject targetObject = game.getObject(targetId); + if (targetObject != null) { if (targetObject.getName().equals(targetName)) { - List alreadyTargetted = targetCardInGraveyard.getTargets(); - if (targetCardInGraveyard.canTarget(targetObject.getId(), game)) { - if (alreadyTargetted != null && !alreadyTargetted.contains(targetObject.getId())) { - targetCardInGraveyard.add(targetObject.getId(), game); + if (targetCard.canTarget(targetObject.getId(), game)) { + if (targetCard.getTargets() != null && !targetCard.getTargets().contains(targetObject.getId())) { + targetCard.add(targetObject.getId(), game); targetFound = true; if (target.getTargets().size() >= target.getMaxNumberOfTargets()) { - break; + break Choice; } } } } } - if (targetFound && targetCardInGraveyard.isChosen()) { - choices.remove(choose2); - return true; - } + + } + } + if (targetFound) { + if (targetCard.isChosen()) { + choices.remove(choose2); + return true; + } else { + target.clearChosen(); } } } @@ -757,6 +787,57 @@ public class TestPlayer implements Player { } } + } + if (target instanceof TargetCardInYourGraveyard) { + for (String targetDefinition : targets) { + String[] targetList = targetDefinition.split("\\^"); + boolean targetFound = false; + for (String targetName : targetList) { + for (Card card : computerPlayer.getGraveyard().getCards(((TargetCardInYourGraveyard) target).getFilter(), game)) { + if (card.getName().equals(targetName) || (card.getName() + "-" + card.getExpansionSetCode()).equals(targetName)) { + if (((TargetCardInYourGraveyard) target).canTarget(abilityControllerId, card.getId(), source, game) && !target.getTargets().contains(card.getId())) { + target.add(card.getId(), game); + targetFound = true; + break; + } + } + } + } + if (targetFound) { + targets.remove(targetDefinition); + return true; + } + } + + } + if (target instanceof TargetCardInOpponentsGraveyard) { + for (String targetDefinition : targets) { + String[] targetList = targetDefinition.split("\\^"); + boolean targetFound = false; + + for (String targetName : targetList) { + IterateOpponentsGraveyards: + for (UUID opponentId : game.getState().getPlayersInRange(getId(), game)) { + if (computerPlayer.hasOpponent(opponentId, game)) { + Player opponent = game.getPlayer(opponentId); + for (Card card : opponent.getGraveyard().getCards(((TargetCardInOpponentsGraveyard) target).getFilter(), game)) { + if (card.getName().equals(targetName) || (card.getName() + "-" + card.getExpansionSetCode()).equals(targetName)) { + if (((TargetCardInOpponentsGraveyard) target).canTarget(abilityControllerId, card.getId(), source, game) && !target.getTargets().contains(card.getId())) { + target.add(card.getId(), game); + targetFound = true; + break IterateOpponentsGraveyards; + } + } + } + } + } + } + if (targetFound) { + targets.remove(targetDefinition); + return true; + } + } + } if (target instanceof TargetSpell) { for (String targetDefinition : targets) { @@ -782,6 +863,30 @@ public class TestPlayer implements Player { return computerPlayer.chooseTarget(outcome, target, source, game); } + @Override + public boolean chooseTarget(Outcome outcome, Cards cards, TargetCard target, Ability source, Game game) { + if (!targets.isEmpty()) { + for (String targetDefinition : targets) { + String[] targetList = targetDefinition.split("\\^"); + boolean targetFound = false; + for (String targetName : targetList) { + for (Card card : cards.getCards(game)) { + if (card.getName().equals(targetName) && !target.getTargets().contains(card.getId())) { + target.add(card.getId(), game); + targetFound = true; + break; + } + } + } + if (targetFound) { + targets.remove(targetDefinition); + return true; + } + } + } + return computerPlayer.chooseTarget(outcome, cards, target, source, game); + } + @Override public TriggeredAbility chooseTriggeredAbility(List abilities, Game game) { if (!choices.isEmpty()) { @@ -797,6 +902,14 @@ public class TestPlayer implements Player { @Override public boolean chooseUse(Outcome outcome, String message, Ability source, Game game) { + return this.chooseUse(outcome, new MessageToClient(message), source, game); + } + + @Override + public boolean chooseUse(Outcome outcome, MessageToClient message, Ability source, Game game) { + if (message.getMessage().equals("Scry 1?")) { + return false; + } if (!choices.isEmpty()) { if (choices.get(0).equals("No")) { choices.remove(0); @@ -807,7 +920,7 @@ public class TestPlayer implements Player { return true; } } - return true; + return computerPlayer.chooseUse(outcome, message, source, game); } @Override @@ -1064,8 +1177,8 @@ public class TestPlayer implements Player { } @Override - public void setCastSourceIdWithAlternateMana(UUID sourceId, ManaCosts manaCosts) { - computerPlayer.setCastSourceIdWithAlternateMana(sourceId, manaCosts); + public void setCastSourceIdWithAlternateMana(UUID sourceId, ManaCosts manaCosts, Costs costs) { + computerPlayer.setCastSourceIdWithAlternateMana(sourceId, manaCosts, costs); } @Override @@ -1078,6 +1191,11 @@ public class TestPlayer implements Player { return computerPlayer.getCastSourceIdManaCosts(); } + @Override + public Costs getCastSourceIdCosts() { + return computerPlayer.getCastSourceIdCosts(); + } + @Override public boolean isInPayManaMode() { return computerPlayer.isInPayManaMode(); @@ -1089,8 +1207,13 @@ public class TestPlayer implements Player { } @Override - public boolean playLand(Card card, Game game) { - return computerPlayer.playLand(card, game); + public boolean playCard(Card card, Game game, boolean noMana, boolean ignoreTiming) { + return computerPlayer.playCard(card, game, noMana, ignoreTiming); + } + + @Override + public boolean playLand(Card card, Game game, boolean ignoreTiming) { + return computerPlayer.playLand(card, game, ignoreTiming); } @Override @@ -1358,6 +1481,11 @@ public class TestPlayer implements Player { computerPlayer.resetPassed(); } + @Override + public void resetPlayerPassedActions() { + computerPlayer.resetPlayerPassedActions(); + } + @Override public void quit(Game game) { computerPlayer.quit(game); @@ -1379,8 +1507,8 @@ public class TestPlayer implements Player { } @Override - public void sendPlayerAction(mage.constants.PlayerAction playerAction, Game game) { - computerPlayer.sendPlayerAction(playerAction, game); + public void sendPlayerAction(mage.constants.PlayerAction playerAction, Game game, Object data) { + computerPlayer.sendPlayerAction(playerAction, game, data); } @Override @@ -1608,8 +1736,8 @@ public class TestPlayer implements Player { } @Override - public void revealFaceDownCard(Card card, Game game) { - computerPlayer.revealFaceDownCard(card, game); + public boolean lookAtFaceDownCard(Card card, Game game) { + return computerPlayer.lookAtFaceDownCard(card, game); } @Override @@ -1663,35 +1791,23 @@ public class TestPlayer implements Player { } @Override + @Deprecated public boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game) { return computerPlayer.moveCards(cards, fromZone, toZone, source, game); } @Override + @Deprecated public boolean moveCards(Card card, Zone fromZone, Zone toZone, Ability source, Game game) { return computerPlayer.moveCards(card, fromZone, toZone, source, game); } @Override + @Deprecated public boolean moveCards(Set cards, Zone fromZone, Zone toZone, Ability source, Game game) { return computerPlayer.moveCards(cards, fromZone, toZone, source, game); } - @Override - public boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game, boolean withName) { - return computerPlayer.moveCards(cards, fromZone, toZone, source, game); - } - - @Override - public boolean moveCards(Card card, Zone fromZone, Zone toZone, Ability source, Game game, boolean withName) { - return computerPlayer.moveCards(card, fromZone, toZone, source, game); - } - - @Override - public boolean moveCards(Set cards, Zone fromZone, Zone toZone, Ability source, Game game, boolean withName) { - return computerPlayer.moveCards(cards, fromZone, toZone, source, game); - } - @Override public boolean moveCardToHandWithInfo(Card card, UUID sourceId, Game game) { return computerPlayer.moveCardToHandWithInfo(card, sourceId, game); @@ -1702,13 +1818,18 @@ public class TestPlayer implements Player { return computerPlayer.moveCardToHandWithInfo(card, sourceId, game, withName); } + @Override + public boolean moveCardsToExile(Card card, Ability source, Game game, boolean withName, UUID exileId, String exileZoneName) { + return computerPlayer.moveCardsToExile(card, source, game, withName, exileId, exileZoneName); + } + @Override public boolean moveCardsToExile(Set cards, Ability source, Game game, boolean withName, UUID exileId, String exileZoneName) { return computerPlayer.moveCardsToExile(cards, source, game, withName, exileId, exileZoneName); } @Override - public boolean moveCardsToGraveyardWithInfo(Set allCards, Ability source, Game game, Zone fromZone) { + public Set moveCardsToGraveyardWithInfo(Set allCards, Ability source, Game game, Zone fromZone) { return computerPlayer.moveCardsToGraveyardWithInfo(allCards, source, game, fromZone); } @@ -1727,21 +1848,6 @@ public class TestPlayer implements Player { return computerPlayer.moveCardToExileWithInfo(card, exileId, exileName, sourceId, game, fromZone, withName); } - @Override - public boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId) { - return computerPlayer.putOntoBattlefieldWithInfo(card, game, fromZone, sourceId); - } - - @Override - public boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId, boolean tapped) { - return computerPlayer.putOntoBattlefieldWithInfo(card, game, fromZone, sourceId, tapped); - } - - @Override - public boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId, boolean tapped, boolean facedown) { - return computerPlayer.putOntoBattlefieldWithInfo(card, game, fromZone, sourceId, tapped, facedown); - } - @Override public boolean hasOpponent(UUID playerToCheckId, Game game) { return computerPlayer.hasOpponent(playerToCheckId, game); @@ -1807,6 +1913,16 @@ public class TestPlayer implements Player { return computerPlayer.getMatchPlayer(); } + @Override + public AbilityType getJustActivatedType() { + return computerPlayer.getJustActivatedType(); + } + + @Override + public void setJustActivatedType(AbilityType justActivatedType) { + computerPlayer.setJustActivatedType(justActivatedType); + } + @Override public void cleanUpOnMatchEnd() { computerPlayer.cleanUpOnMatchEnd(); @@ -1833,11 +1949,6 @@ public class TestPlayer implements Player { return computerPlayer.choose(outcome, cards, target, game); } - @Override - public boolean chooseTarget(Outcome outcome, Cards cards, TargetCard target, Ability source, Game game) { - return computerPlayer.chooseTarget(outcome, cards, target, source, game); - } - @Override public boolean chooseTargetAmount(Outcome outcome, TargetAmount target, Ability source, Game game) { return computerPlayer.chooseTargetAmount(outcome, target, source, game); @@ -1855,6 +1966,7 @@ public class TestPlayer implements Player { @Override public boolean playMana(Ability ability, ManaCost unpaid, String promptText, Game game) { + groupsForTargetHandling = null; return computerPlayer.playMana(ability, unpaid, promptText, game); } @@ -1888,6 +2000,36 @@ public class TestPlayer implements Player { computerPlayer.pickCard(cards, deck, draft); } + @Override + public boolean scry(int value, Ability source, Game game) { + return computerPlayer.scry(value, source, game); + } + + @Override + public boolean moveCards(Card card, Zone toZone, Ability source, Game game) { + return computerPlayer.moveCards(card, toZone, source, game); + } + + @Override + public boolean moveCards(Card card, Zone toZone, Ability source, Game game, boolean tapped, boolean faceDown, boolean byOwner, ArrayList appliedEffects) { + return computerPlayer.moveCards(card, toZone, source, game, tapped, faceDown, byOwner, appliedEffects); + } + + @Override + public boolean moveCards(Cards cards, Zone toZone, Ability source, Game game) { + return computerPlayer.moveCards(cards, toZone, source, game); + } + + @Override + public boolean moveCards(Set cards, Zone toZone, Ability source, Game game) { + return computerPlayer.moveCards(cards, toZone, source, game); + } + + @Override + public boolean moveCards(Set cards, Zone toZone, Ability source, Game game, boolean tapped, boolean faceDown, boolean byOwner, ArrayList appliedEffects) { + return computerPlayer.moveCards(cards, toZone, source, game, tapped, faceDown, byOwner, appliedEffects); + } + public void setAIPlayer(boolean AIPlayer) { this.AIPlayer = AIPlayer; } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestAPI.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestAPI.java index 67cf6484b5f..08b16ef8861 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestAPI.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestAPI.java @@ -8,8 +8,6 @@ import mage.filter.Filter; import mage.players.Player; import org.mage.test.player.TestPlayer; - - /** * Interface for all test initialization and assertion operations. */ @@ -19,21 +17,23 @@ public interface CardTestAPI { * Types of game result. */ public enum GameResult { + WON, LOST, DRAW } //******* INITIALIZATION METHODS *******/ - /** - * Default game initialization params for red player (that plays with Mountains) + * Default game initialization params for red player (that plays with + * Mountains) */ void useRedDefault(); /** - * Removes all cards from player's library from the game. - * Usually this should be used once before initialization to form the library in certain order. + * Removes all cards from player's library from the game. Usually this + * should be used once before initialization to form the library in certain + * order. * * @param player {@link Player} to remove all library cards from. */ @@ -43,7 +43,8 @@ public interface CardTestAPI { * Add a card to specified zone of specified player. * * @param gameZone {@link mage.constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. + * @param player {@link Player} to add cards for. Use either playerA or + * playerB. * @param cardName Card name in string format. */ void addCard(Zone gameZone, TestPlayer player, String cardName); @@ -52,9 +53,10 @@ public interface CardTestAPI { * Add any amount of cards to specified zone of specified player. * * @param gameZone {@link mage.constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. + * @param player {@link Player} to add cards for. Use either playerA or + * playerB. * @param cardName Card name in string format. - * @param count Amount of cards to be added. + * @param count Amount of cards to be added. */ void addCard(Zone gameZone, TestPlayer player, String cardName, int count); @@ -62,11 +64,13 @@ public interface CardTestAPI { * Add any amount of cards to specified zone of specified player. * * @param gameZone {@link mage.constants.Zone} to add cards to. - * @param player {@link Player} to add cards for. Use either playerA or playerB. + * @param player {@link Player} to add cards for. Use either playerA or + * playerB. * @param cardName Card name in string format. - * @param count Amount of cards to be added. - * @param tapped In case gameZone is Battlefield, determines whether permanent should be tapped. - * In case gameZone is other than Battlefield, {@link IllegalArgumentException} is thrown + * @param count Amount of cards to be added. + * @param tapped In case gameZone is Battlefield, determines whether + * permanent should be tapped. In case gameZone is other than Battlefield, + * {@link IllegalArgumentException} is thrown */ void addCard(Zone gameZone, TestPlayer player, String cardName, int count, boolean tapped); @@ -74,27 +78,27 @@ public interface CardTestAPI { * Set player's initial life count. * * @param player {@link Player} to set life count for. - * @param life Life count to set. + * @param life Life count to set. */ void setLife(TestPlayer player, int life); //******* GAME OPTIONS *******/ - /** * Define turn number to stop the game on. + * * @param turn */ void setStopOnTurn(int turn); /** * Define the turn number and step to stop the game on. + * * @param turn * @param step */ void setStopAt(int turn, PhaseStep step); //******* ASSERT METHODS *******/ - /** * Assert turn number after test execution. * @@ -114,26 +118,26 @@ public interface CardTestAPI { * Assert player's life count after test execution. * * @param player {@link Player} to get life for comparison. - * @param life Expected player's life to compare with. + * @param life Expected player's life to compare with. */ void assertLife(Player player, int life) throws AssertionError; /** * Assert creature's power and toughness by card name. *

- * Throws {@link AssertionError} in the following cases: - * 1. no such player - * 2. no such creature under player's control - * 3. depending on comparison scope: - * 3a. any: no creature under player's control with the specified p\t params - * 3b. all: there is at least one creature with the cardName with the different p\t params + * Throws {@link AssertionError} in the following cases: 1. no such player + * 2. no such creature under player's control 3. depending on comparison + * scope: 3a. any: no creature under player's control with the specified p\t + * params 3b. all: there is at least one creature with the cardName with the + * different p\t params * - * @param player {@link Player} to get creatures for comparison. - * @param cardName Card name to compare with. - * @param power Expected power to compare with. + * @param player {@link Player} to get creatures for comparison. + * @param cardName Card name to compare with. + * @param power Expected power to compare with. * @param toughness Expected toughness to compare with. - * @param scope {@link Filter.ComparisonScope} Use ANY, if you want "at least one creature with given name should have specified p\t" - * Use ALL, if you want "all creature with gived name should have specified p\t" + * @param scope {@link Filter.ComparisonScope} Use ANY, if you want "at + * least one creature with given name should have specified p\t" Use ALL, if + * you want "all creature with gived name should have specified p\t" */ void assertPowerToughness(Player player, String cardName, int power, int toughness, Filter.ComparisonScope scope) throws AssertionError; @@ -141,13 +145,12 @@ public interface CardTestAPI { /** * Assert creature's abilities. *

- * Throws {@link AssertionError} in the following cases: - * 1. no such player - * 2. no such creature under player's control - * 3. there is more than one creature with such name + * Throws {@link AssertionError} in the following cases: 1. no such player + * 2. no such creature under player's control 3. there is more than one + * creature with such name * - * @param player {@link Player} to get creatures for comparison. - * @param cardName Card name to compare with. + * @param player {@link Player} to get creatures for comparison. + * @param cardName Card name to compare with. * @param abilities Expected abilities */ void assertAbilities(Player player, String cardName, List abilities) @@ -157,7 +160,7 @@ public interface CardTestAPI { * Assert permanent count under player's control. * * @param player {@link Player} which permanents should be counted. - * @param count Expected count. + * @param count Expected count. */ void assertPermanentCount(Player player, int count) throws AssertionError; @@ -166,7 +169,26 @@ public interface CardTestAPI { * * @param player {@link Player} which permanents should be counted. * @param cardName Name of the cards that should be counted. - * @param count Expected count. + * @param count Expected count. */ void assertPermanentCount(Player player, String cardName, int count) throws AssertionError; + + /** + * Assert command zone object count in player's command zone + * + * @param player {@link Player} which permanents should be counted. + * @param commandZoneObjectName Name of the commander or emblem that should + * be counted. + * @param count Expected count. + */ + void assertCommandZoneCount(Player player, String commandZoneObjectName, int count) throws AssertionError; + + /** + * Assert emblem count under player's control + * + * @param player + * @param count + * @throws AssertionError + */ + void assertEmblemCount(Player player, int count) throws AssertionError; } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestMultiPlayerBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestMultiPlayerBase.java index 36ededfe4a3..863ac2b2565 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestMultiPlayerBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestMultiPlayerBase.java @@ -1,22 +1,18 @@ package org.mage.test.serverside.base; -import mage.cards.Card; -import mage.cards.decks.Deck; -import mage.cards.decks.importer.DeckImporterUtil; +import java.io.FileNotFoundException; import mage.constants.MultiplayerAttackOption; import mage.constants.RangeOfInfluence; -import mage.game.*; -import mage.game.permanent.Permanent; -import mage.players.Player; -import org.junit.Assert; +import mage.game.FreeForAll; +import mage.game.Game; +import mage.game.GameException; import org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl; -import java.io.File; -import java.io.FileNotFoundException; - /** - * Base class for testing single cards and effects in multiplayer game. - * For PvP games {@see CardTestPlayerBase} + * Base class for testing single cards and effects in multiplayer game. For PvP + * games { + * + * @see CardTestPlayerBase} * * @author magenoxx_at_gmail.com */ @@ -25,12 +21,12 @@ public abstract class CardTestMultiPlayerBase extends CardTestPlayerAPIImpl { @Override protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { Game game = new FreeForAll(MultiplayerAttackOption.LEFT, RangeOfInfluence.ONE, 0, 20); - + // Player order: A -> D -> C -> B playerA = createPlayer(game, playerA, "PlayerA"); playerB = createPlayer(game, playerB, "PlayerB"); playerC = createPlayer(game, playerC, "PlayerC"); playerD = createPlayer(game, playerD, "PlayerD"); return game; } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBaseAI.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBaseAI.java index 910f3de6ec4..94e0699a280 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBaseAI.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBaseAI.java @@ -55,13 +55,13 @@ public abstract class CardTestPlayerBaseAI extends CardTestPlayerAPIImpl { } @Override - protected TestPlayer createPlayer(String name) { + protected TestPlayer createPlayer(String name, RangeOfInfluence rangeOfInfluence) { if (name.equals("PlayerA")) { TestPlayer testPlayer = new TestPlayer(new ComputerPlayer7("PlayerA", RangeOfInfluence.ONE, skill)); testPlayer.setAIPlayer(true); return testPlayer; } - return super.createPlayer(name); + return super.createPlayer(name, rangeOfInfluence); } public void setAISkill(int skill) { diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java index 32805289ed6..6568f377b3f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/MageTestPlayerBase.java @@ -1,15 +1,26 @@ package org.mage.test.serverside.base; -import mage.constants.PhaseStep; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FilenameFilter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Scanner; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import mage.cards.Card; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; +import mage.constants.PhaseStep; import mage.constants.RangeOfInfluence; import mage.constants.Zone; import mage.game.Game; import mage.game.match.MatchType; import mage.game.permanent.PermanentCard; import mage.game.tournament.TournamentType; +import mage.player.ai.ComputerPlayer; import mage.players.Player; import mage.server.game.GameFactory; import mage.server.util.ConfigSettings; @@ -22,20 +33,13 @@ import org.apache.log4j.Logger; import org.junit.BeforeClass; import org.mage.test.player.TestPlayer; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FilenameFilter; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import mage.player.ai.ComputerPlayer; - /** * Base class for all tests. * * @author ayratn */ public abstract class MageTestPlayerBase { + protected static Logger logger = Logger.getLogger(MageTestPlayerBase.class); public static PluginClassLoader classLoader = new PluginClassLoader(); @@ -62,8 +66,7 @@ public abstract class MageTestPlayerBase { protected static Game currentGame = null; /** - * Player thats starts the game first. - * By default, it is ComputerA. + * Player thats starts the game first. By default, it is ComputerA. */ protected static Player activePlayer = null; @@ -72,6 +75,7 @@ public abstract class MageTestPlayerBase { protected PhaseStep stopAtStep = PhaseStep.UNTAP; protected enum ParserState { + INIT, OPTIONS, EXPECTED @@ -80,16 +84,11 @@ public abstract class MageTestPlayerBase { protected ParserState parserState; /** - * Expected results of the test. - * Read from test case in {@link String} based format: + * Expected results of the test. Read from test case in {@link String} based + * format: *

- * Example: - * turn:1 - * result:won:ComputerA - * life:ComputerA:20 - * life:ComputerB:0 - * battlefield:ComputerB:Tine Shrike:0 - * graveyard:ComputerB:Tine Shrike:1 + * Example: turn:1 result:won:ComputerA life:ComputerA:20 life:ComputerB:0 + * battlefield:ComputerB:Tine Shrike:0 graveyard:ComputerB:Tine Shrike:1 */ protected List expectedResults = new ArrayList<>(); @@ -259,7 +258,7 @@ public abstract class MageTestPlayerBase { logger.warn("Init string wasn't parsed: " + line); } } - + private TestPlayer getPlayer(String name) { switch (name) { case "ComputerA": @@ -282,7 +281,7 @@ public abstract class MageTestPlayerBase { handCards.put(player, hand); return hand; } - + protected List getGraveCards(TestPlayer player) { if (graveyardCards.containsKey(player)) { return graveyardCards.get(player); @@ -319,7 +318,6 @@ public abstract class MageTestPlayerBase { return command; } - private void includeFrom(String line) throws FileNotFoundException { String[] params = line.split(" "); if (params.length == 2) { @@ -340,8 +338,8 @@ public abstract class MageTestPlayerBase { } } - protected TestPlayer createPlayer(String name) { - return new TestPlayer(new ComputerPlayer(name, RangeOfInfluence.ONE)); + protected TestPlayer createPlayer(String name, RangeOfInfluence rangeOfInfluence) { + return new TestPlayer(new ComputerPlayer(name, rangeOfInfluence)); } - + } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index d40b5113bff..9a02e9bcf80 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -12,6 +12,7 @@ import mage.cards.repository.CardRepository; import mage.cards.repository.CardScanner; import mage.constants.CardType; import mage.constants.PhaseStep; +import mage.constants.RangeOfInfluence; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.Filter; @@ -141,7 +142,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } protected TestPlayer createPlayer(Game game, TestPlayer player, String name, String deckName) throws GameException { - player = createNewPlayer(name); + player = createNewPlayer(name, game.getRangeOfInfluence()); player.setTestMode(true); logger.debug("Loading deck..."); Deck deck = Deck.load(DeckImporterUtil.importDeck(deckName), false, false); @@ -187,8 +188,8 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } - protected TestPlayer createNewPlayer(String playerName) { - return createPlayer(playerName); + protected TestPlayer createNewPlayer(String playerName, RangeOfInfluence rangeOfInfluence) { + return createPlayer(playerName, rangeOfInfluence); } protected Player getPlayerFromName(String playerName, String line) { @@ -283,7 +284,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement if (card == null) { throw new IllegalArgumentException("[TEST] Couldn't find a card: " + cardName); } - PermanentCard p = new PermanentCard(card, null, currentGame); + PermanentCard p = new PermanentCard(card, player.getId(), currentGame); p.setTapped(tapped); getBattlefieldCards(player).add(p); } @@ -533,10 +534,10 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement if (flag) { Assert.assertTrue("No such ability=" + ability.toString() + ", player=" + player.getName() - + ", cardName" + cardName, found.getAbilities().containsRule(ability)); + + ", cardName" + cardName, found.getAbilities(currentGame).containsRule(ability)); } else { Assert.assertFalse("Card shouldn't have such ability=" + ability.toString() + ", player=" + player.getName() - + ", cardName" + cardName, found.getAbilities().containsRule(ability)); + + ", cardName" + cardName, found.getAbilities(currentGame).containsRule(ability)); } } @@ -574,7 +575,18 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } } } - Assert.assertEquals("(Battlefield) Card counts are not equal (" + cardName + ")", count, actualCount); + Assert.assertEquals("(Battlefield) Permanents counts for " + player.getName() + " are not equal (" + cardName + ")", count, actualCount); + } + + @Override + public void assertCommandZoneCount(Player player, String commandZoneObjectName, int count) throws AssertionError { + int actualCount = 0; + for (CommandObject commandObject : currentGame.getState().getCommand()) { + if (commandObject.getControllerId().equals(player.getId()) && commandObject.getName().equals(commandZoneObjectName)) { + actualCount++; + } + } + Assert.assertEquals("(Command Zone) Card counts are not equal (" + commandZoneObjectName + ")", count, actualCount); } /** @@ -584,6 +596,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement * @param count * @throws AssertionError */ + @Override public void assertEmblemCount(Player player, int count) throws AssertionError { int actualCount = 0; for (CommandObject commandObject : currentGame.getState().getCommand()) { @@ -602,14 +615,18 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement * @param count Expected count. */ public void assertCounterCount(String cardName, CounterType type, int count) throws AssertionError { + this.assertCounterCount(null, cardName, type, count); + } + + public void assertCounterCount(Player player, String cardName, CounterType type, int count) throws AssertionError { Permanent found = null; for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents()) { - if (permanent.getName().equals(cardName)) { + if (permanent.getName().equals(cardName) && (player == null || permanent.getControllerId().equals(player.getId()))) { found = permanent; break; } } - Assert.assertNotNull("There is no such permanent on the battlefield, cardName=" + cardName, found); + Assert.assertNotNull("There is no such permanent " + (player == null ? "" : "for player " + player.getName()) + " on the battlefield, cardName=" + cardName, found); Assert.assertEquals("(Battlefield) Counter counts are not equal (" + cardName + ":" + type + ")", count, found.getCounters().getCount(type)); } @@ -765,7 +782,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement */ public void assertHandCount(Player player, int count) throws AssertionError { int actual = currentGame.getPlayer(player.getId()).getHand().size(); - Assert.assertEquals("(Hand) Card counts are not equal ", count, actual); + Assert.assertEquals("(Hand " + player.getName() + ") Card counts are not equal ", count, actual); } /** @@ -779,7 +796,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement FilterCard filter = new FilterCard(); filter.add(new NamePredicate(cardName)); int actual = currentGame.getPlayer(player.getId()).getHand().count(filter, player.getId(), currentGame); - Assert.assertEquals("(Hand) Card counts for card " + cardName + " are not equal ", count, actual); + Assert.assertEquals("(Hand) Card counts for card " + cardName + " for " + player.getName() + " are not equal ", count, actual); } /** @@ -846,7 +863,25 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement } } - Assert.assertEquals("(Graveyard) Card counts are not equal (" + cardName + ")", count, actualCount); + Assert.assertEquals("(Graveyard " + player.getName() + ") Card counts are not equal (" + cardName + ")", count, actualCount); + } + + /** + * Assert card count in player's library. + * + * @param player {@link Player} who's library should be counted. + * @param cardName Name of the cards that should be counted. + * @param count Expected count. + */ + public void assertLibraryCount(Player player, String cardName, int count) throws AssertionError { + int actualCount = 0; + for (Card card : player.getLibrary().getCards(currentGame)) { + if (card.getName().equals(cardName)) { + actualCount++; + } + } + + Assert.assertEquals("(Library " + player.getName() + ") Card counts are not equal (" + cardName + ")", count, actualCount); } /** @@ -923,7 +958,8 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement * @param step * @param player * @param cardName - * @param targetName + * @param targetName for modal spells add the mode to the name e.g. + * "mode=2SilvercoatLion^mode3=PillarfieldOx" * @param spellOnStack */ public void castSpell(int turnNum, PhaseStep step, TestPlayer player, String cardName, String targetName, String spellOnStack) { @@ -977,6 +1013,10 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement player.addAction(turnNum, step, "activate:" + ability + "$target=" + targetName); } + public void activateAbility(int turnNum, PhaseStep step, TestPlayer player, String ability, String targetName, String spellOnStack) { + this.activateAbility(turnNum, step, player, ability, targetName, spellOnStack, StackClause.WHILE_ON_STACK); + } + /** * * @param turnNum @@ -987,13 +1027,13 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement * NO_TARGET * @param spellOnStack */ - public void activateAbility(int turnNum, PhaseStep step, TestPlayer player, String ability, String targetName, String spellOnStack) { + public void activateAbility(int turnNum, PhaseStep step, TestPlayer player, String ability, String targetName, String spellOnStack, StackClause clause) { StringBuilder sb = new StringBuilder("activate:").append(ability); if (targetName != null && !targetName.isEmpty()) { sb.append("$target=").append(targetName); } if (spellOnStack != null && !spellOnStack.isEmpty()) { - sb.append("$spellOnStack=").append(spellOnStack); + sb.append("$").append(StackClause.WHILE_ON_STACK.equals(clause) ? "" : "!").append("spellOnStack=").append(spellOnStack); } player.addAction(turnNum, step, sb.toString()); } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/tournament/SwissPairingMinimalWeightMatchingTest.java b/Mage.Tests/src/test/java/org/mage/test/serverside/tournament/SwissPairingMinimalWeightMatchingTest.java new file mode 100644 index 00000000000..c132059c797 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/tournament/SwissPairingMinimalWeightMatchingTest.java @@ -0,0 +1,360 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package org.mage.test.serverside.tournament; + + +import java.util.*; + +import mage.game.tournament.*; +import mage.game.tournament.pairing.RoundPairings; +import mage.game.tournament.pairing.SwissPairingMinimalWeightMatching; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.stub.PlayerStub; +import org.mage.test.stub.TournamentStub; + + +/** + * + * @author Quercitron + */ +public class SwissPairingMinimalWeightMatchingTest { + + @Test + public void FourPlayersSecondRoundTest() { + // 1 > 3 + // 2 > 4 + + TournamentPlayer player1 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player2 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player3 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player4 = new TournamentPlayer(new PlayerStub(), null); + List players = new ArrayList<>(); + players.add(player4); + players.add(player2); + players.add(player3); + players.add(player1); + + player1.setPoints(3); + player2.setPoints(3); + player3.setPoints(0); + player4.setPoints(0); + + List rounds = new ArrayList<>(); + Round round = new Round(1, new TournamentStub()); + TournamentPairing pair1 = new TournamentPairing(player1, player3); + round.addPairing(pair1); + TournamentPairing pair2 = new TournamentPairing(player4, player2); + round.addPairing(pair2); + rounds.add(round); + + SwissPairingMinimalWeightMatching swissPairing = new SwissPairingMinimalWeightMatching(players, rounds, false); + RoundPairings roundPairings = swissPairing.getRoundPairings(); + + Assert.assertEquals(2, roundPairings.getPairings().size()); + Assert.assertEquals(0, roundPairings.getPlayerByes().size()); + + CheckPair(roundPairings.getPairings(), player1, player2); + CheckPair(roundPairings.getPairings(), player3, player4); + Assert.assertEquals(0, roundPairings.getPlayerByes().size()); + } + + @Test + public void FourPlayersSecondThirdTest() { + // 1 > 3 + // 2 > 4 + // + // 1 > 2 + // 3 > 4 + + TournamentPlayer player3 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player2 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player4 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player1 = new TournamentPlayer(new PlayerStub(), null); + List players = new ArrayList<>(); + players.add(player4); + players.add(player2); + players.add(player3); + players.add(player1); + + player1.setPoints(6); + player2.setPoints(3); + player3.setPoints(3); + player4.setPoints(0); + + List rounds = new ArrayList<>(); + // round 1 + Round round = new Round(1, new TournamentStub()); + TournamentPairing pair1 = new TournamentPairing(player1, player3); + round.addPairing(pair1); + TournamentPairing pair2 = new TournamentPairing(player4, player2); + round.addPairing(pair2); + rounds.add(round); + // round 2 + round = new Round(2, new TournamentStub()); + pair1 = new TournamentPairing(player2, player1); + round.addPairing(pair1); + pair2 = new TournamentPairing(player4, player3); + round.addPairing(pair2); + rounds.add(round); + + SwissPairingMinimalWeightMatching swissPairing = new SwissPairingMinimalWeightMatching(players, rounds, true); + RoundPairings roundPairings = swissPairing.getRoundPairings(); + + Assert.assertEquals(2, roundPairings.getPairings().size()); + Assert.assertEquals(0, roundPairings.getPlayerByes().size()); + + CheckPair(roundPairings.getPairings(), player1, player4); + CheckPair(roundPairings.getPairings(), player2, player3); + Assert.assertEquals(0, roundPairings.getPlayerByes().size()); + } + + @Test + public void PlayerLeftTournamentAfterFirstRound() { + // 1 > 3 + // 2 > 4 + // 4 left the tournament + + TournamentPlayer player1 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player2 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player3 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player4 = new TournamentPlayer(new PlayerStub(), null); + List players = new ArrayList<>(); + //players.add(player4); -- player 4 is not active + players.add(player2); + players.add(player3); + players.add(player1); + + player1.setPoints(3); + player2.setPoints(3); + player3.setPoints(0); + player4.setPoints(0); + + List rounds = new ArrayList<>(); + Round round = new Round(1, new TournamentStub()); + TournamentPairing pair1 = new TournamentPairing(player1, player3); + round.addPairing(pair1); + TournamentPairing pair2 = new TournamentPairing(player4, player2); + round.addPairing(pair2); + rounds.add(round); + + SwissPairingMinimalWeightMatching swissPairing = new SwissPairingMinimalWeightMatching(players, rounds, false); + RoundPairings roundPairings = swissPairing.getRoundPairings(); + + Assert.assertEquals(1, roundPairings.getPairings().size()); + Assert.assertEquals(1, roundPairings.getPlayerByes().size()); + + CheckPair(roundPairings.getPairings(), player1, player2); + Assert.assertTrue(roundPairings.getPlayerByes().contains(player3)); + } + + @Test + public void FivePlayersThirdRoundTest() { + // 1 > 2 + // 3 > 4 + // 5 + // + // 1 > 5 + // 2 > 3 + // 4 + + TournamentPlayer player1 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player2 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player3 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player4 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player5 = new TournamentPlayer(new PlayerStub(), null); + List players = new ArrayList<>(); + players.add(player4); + players.add(player2); + players.add(player5); + players.add(player3); + players.add(player1); + + player1.setPoints(6); + player2.setPoints(3); + player3.setPoints(3); + player4.setPoints(3); + player5.setPoints(3); + + List rounds = new ArrayList<>(); + // first round + Round round = new Round(1, new TournamentStub()); + TournamentPairing pair1 = new TournamentPairing(player1, player2); + round.addPairing(pair1); + TournamentPairing pair2 = new TournamentPairing(player3, player4); + round.addPairing(pair2); + round.getPlayerByes().add(player5); + rounds.add(round); + // second round + round = new Round(1, new TournamentStub()); + pair1 = new TournamentPairing(player1, player5); + round.addPairing(pair1); + pair2 = new TournamentPairing(player2, player3); + round.addPairing(pair2); + round.getPlayerByes().add(player4); + rounds.add(round); + + SwissPairingMinimalWeightMatching swissPairing = new SwissPairingMinimalWeightMatching(players, rounds, false); + RoundPairings roundPairings = swissPairing.getRoundPairings(); + + Assert.assertEquals(2, roundPairings.getPairings().size()); + Assert.assertEquals(1, roundPairings.getPlayerByes().size()); + + CheckPair(roundPairings.getPairings(), player1, player4); + CheckPair(roundPairings.getPairings(), player2, player5); + Assert.assertTrue(roundPairings.getPlayerByes().contains(player3)); + } + + @Test + public void PlayerWithByeLeftTournament() { + // 1 > 2 + // 3 > 4 + // 5 + // 5 left the tournament + + + TournamentPlayer player1 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player2 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player3 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player4 = new TournamentPlayer(new PlayerStub(), null); + TournamentPlayer player5 = new TournamentPlayer(new PlayerStub(), null); + List players = new ArrayList<>(); + //players.add(player5); -- player 5 is not active + players.add(player4); + players.add(player2); + players.add(player3); + players.add(player1); + + player1.setPoints(3); + player2.setPoints(0); + player3.setPoints(3); + player4.setPoints(0); + player5.setPoints(3); + + List rounds = new ArrayList<>(); + // first round + Round round = new Round(1, new TournamentStub()); + TournamentPairing pair1 = new TournamentPairing(player1, player2); + round.addPairing(pair1); + TournamentPairing pair2 = new TournamentPairing(player3, player4); + round.addPairing(pair2); + round.getPlayerByes().add(player5); + rounds.add(round); + + SwissPairingMinimalWeightMatching swissPairing = new SwissPairingMinimalWeightMatching(players, rounds, false); + RoundPairings roundPairings = swissPairing.getRoundPairings(); + + Assert.assertEquals(2, roundPairings.getPairings().size()); + Assert.assertEquals(0, roundPairings.getPlayerByes().size()); + + CheckPair(roundPairings.getPairings(), player1, player3); + CheckPair(roundPairings.getPairings(), player2, player4); + Assert.assertEquals(0, roundPairings.getPlayerByes().size()); + } + + @Test + public void SimulateDifferentTournaments() { + int playersCount = 12; + for (int i = 0; i <= playersCount; i++) { + int roundsCount = ((i + 1) / 2) * 2 - 1; + for (int j = 1; j <= roundsCount; j++) { + SimulateTournament(i, j); + } + } + } + + private void SimulateTournament(int playersCount, int roundsCount) { + Random rnd = new Random(); + + List players = new ArrayList<>(); + for (int i = 0; i < playersCount; i++) { + players.add(new TournamentPlayer(new PlayerStub(), null)); + } + + List playedPairs = new ArrayList<>(); + Set playersByes = new HashSet<>(); + + List rounds = new ArrayList<>(); + for (int i = 0; i < roundsCount; i++) { + SwissPairingMinimalWeightMatching swissPairing = + new SwissPairingMinimalWeightMatching(new ArrayList<>(players), rounds, i + 1 == roundsCount); + RoundPairings roundPairings = swissPairing.getRoundPairings(); + + Assert.assertEquals(playersCount / 2, roundPairings.getPairings().size()); + Assert.assertEquals(playersCount % 2, roundPairings.getPlayerByes().size()); + + Round round = new Round(1, new TournamentStub()); + rounds.add(round); + for (TournamentPairing pairing : roundPairings.getPairings()) { + if (ContainsPair(playedPairs, pairing.getPlayer1(), pairing.getPlayer2())) { + if (i < (playersCount + 1) / 2) { + throw new AssertionError("Match between players has been played already."); + } + } + playedPairs.add(pairing); + + round.addPairing(pairing); + if (rnd.nextBoolean()) { + pairing.getPlayer1().setPoints(pairing.getPlayer1().getPoints() + 3); + } else { + pairing.getPlayer2().setPoints(pairing.getPlayer2().getPoints() + 3); + } + } + for (TournamentPlayer playerBye : roundPairings.getPlayerByes()) { + if (playersByes.contains(playerBye)) { + throw new AssertionError("Player already had bye."); + } + playersByes.add(playerBye); + + round.getPlayerByes().add(playerBye); + playerBye.setPoints(playerBye.getPoints() + 3); + } + } + } + + private void CheckPair(List pairs, TournamentPlayer player1, TournamentPlayer player2) { + if (!ContainsPair(pairs, player1, player2)) { + throw new AssertionError("Pairing doesn't contain expected pair of players."); + } + } + + private boolean ContainsPair(List pairs, TournamentPlayer player1, TournamentPlayer player2) { + for (TournamentPairing pair : pairs) { + if (pair.getPlayer1().equals(player1) && pair.getPlayer2().equals(player2)) { + return true; + } + if (pair.getPlayer1().equals(player2) && pair.getPlayer2().equals(player1)) { + return true; + } + } + return false; + } +} + + diff --git a/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java b/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java new file mode 100644 index 00000000000..4142d713ba3 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/sets/BoosterGenerationTest.java @@ -0,0 +1,103 @@ +package org.mage.test.sets; + +import mage.cards.Card; +import mage.cards.repository.CardScanner; +import mage.sets.FateReforged; +import mage.sets.MastersEditionII; +import mage.sets.MastersEditionIV; +import org.junit.Before; +import org.junit.Test; +import org.mage.test.serverside.base.MageTestBase; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +/** + * + * @author nigelzor + */ +public class BoosterGenerationTest extends MageTestBase { + + @Before + public void setUp() { + CardScanner.scan(); + } + + private static final List basics = Arrays.asList("Plains", "Island", "Swamp", "Mountain", "Forest"); + + @Test + public void testFateReforged() { + List tapland = Arrays.asList( + "Bloodfell Caves", "Blossoming Sands", "Dismal Backwater", "Jungle Hollow", "Rugged Highlands", + "Scoured Barrens", "Swiftwater Cliffs", "Thornwood Falls", "Tranquil Cove", "Wind-Scarred Crag"); + List fetchland = Arrays.asList( + "Bloodstained Mire", "Flooded Strand", "Polluted Delta", "Windswept Heath", "Wooded Foothills"); + + List booster = FateReforged.getInstance().createBooster(); + assertTrue(str(booster), contains(booster, tapland, "FRF") || contains(booster, fetchland, "KTK")); + assertFalse(str(booster), contains(booster, basics, null)); + } + + @Test + public void testMastersEditionII() { + List snowCoveredLand = Arrays.asList( + "Snow-Covered Plains", + "Snow-Covered Island", + "Snow-Covered Swamp", + "Snow-Covered Mountain", + "Snow-Covered Forest" + ); + List booster = MastersEditionII.getInstance().createBooster(); + assertTrue(str(booster), contains(booster, snowCoveredLand, "ME2")); + assertFalse(str(booster), contains(booster, basics, null)); + } + + @Test + public void testMastersEditionIV() { + List urzaLand = Arrays.asList( + "Urza's Mine", + "Urza's Power Plant", + "Urza's Tower" + ); + List booster = MastersEditionIV.getInstance().createBooster(); + assertTrue(str(booster), contains(booster, urzaLand, "ME4")); + assertFalse(str(booster), contains(booster, basics, null)); + } + + private static String str(List cards) { + StringBuilder sb = new StringBuilder("["); + Iterator iterator = cards.iterator(); + while (iterator.hasNext()) { + Card next = iterator.next(); + sb.append(next.getName()); + if (iterator.hasNext()) { + sb.append(", "); + } + } + sb.append("] (").append(cards.size()).append(")"); + return sb.toString(); + } + + private static boolean contains(List cards, List names, String code) { + for (String name : names) { + if (contains(cards, name, code)) { + return true; + } + } + return false; + } + + private static boolean contains(List cards, String name, String code) { + for (Card card : cards) { + if (card.getName().equals(name) && (code == null || card.getExpansionSetCode().equals(code))) { + return true; + } + } + return false; + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/stub/PlayerStub.java b/Mage.Tests/src/test/java/org/mage/test/stub/PlayerStub.java new file mode 100644 index 00000000000..d076ed3265c --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/stub/PlayerStub.java @@ -0,0 +1,1240 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.stub; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Abilities; +import mage.abilities.Ability; +import mage.abilities.ActivatedAbility; +import mage.abilities.Mode; +import mage.abilities.Modes; +import mage.abilities.SpellAbility; +import mage.abilities.TriggeredAbility; +import mage.abilities.costs.AlternativeSourceCosts; +import mage.abilities.costs.Cost; +import mage.abilities.costs.Costs; +import mage.abilities.costs.VariableCost; +import mage.abilities.costs.mana.ManaCost; +import mage.abilities.costs.mana.ManaCosts; +import mage.abilities.mana.ManaOptions; +import mage.cards.Card; +import mage.cards.Cards; +import mage.cards.decks.Deck; +import mage.choices.Choice; +import mage.constants.AbilityType; +import mage.constants.ManaType; +import mage.constants.Outcome; +import mage.constants.PlayerAction; +import mage.constants.RangeOfInfluence; +import mage.constants.Zone; +import mage.counters.Counter; +import mage.counters.Counters; +import mage.game.Game; +import mage.game.Graveyard; +import mage.game.Table; +import mage.game.combat.CombatGroup; +import mage.game.draft.Draft; +import mage.game.match.Match; +import mage.game.match.MatchPlayer; +import mage.game.permanent.Permanent; +import mage.game.tournament.Tournament; +import mage.players.Library; +import mage.players.ManaPool; +import mage.players.Player; +import mage.players.net.UserData; +import mage.target.Target; +import mage.target.TargetAmount; +import mage.target.TargetCard; +import mage.target.common.TargetCardInLibrary; +import mage.util.MessageToClient; + +/** + * + * @author Quercitron + */ +public class PlayerStub implements Player { + + private final UUID id = UUID.randomUUID(); + + @Override + public UUID getId() { + return id; + } + + @Override + public boolean isHuman() { + return false; + } + + @Override + public String getName() { + return null; + } + + @Override + public String getLogName() { + return null; + } + + @Override + public RangeOfInfluence getRange() { + return null; + } + + @Override + public Library getLibrary() { + return null; + } + + @Override + public Cards getSideboard() { + return null; + } + + @Override + public Graveyard getGraveyard() { + return null; + } + + @Override + public Abilities getAbilities() { + return null; + } + + @Override + public void addAbility(Ability ability) { + + } + + @Override + public Counters getCounters() { + return null; + } + + @Override + public int getLife() { + return 0; + } + + @Override + public void initLife(int life) { + + } + + @Override + public void setLife(int life, Game game) { + + } + + @Override + public int loseLife(int amount, Game game) { + return 0; + } + + @Override + public int gainLife(int amount, Game game) { + return 0; + } + + @Override + public int damage(int damage, UUID sourceId, Game game, boolean combatDamage, boolean preventable) { + return 0; + } + + @Override + public int damage(int damage, UUID sourceId, Game game, boolean combatDamage, boolean preventable, ArrayList appliedEffects) { + return 0; + } + + @Override + public boolean isCanLoseLife() { + return false; + } + + @Override + public void setCanLoseLife(boolean canLoseLife) { + + } + + @Override + public void setCanGainLife(boolean canGainLife) { + + } + + @Override + public boolean isCanGainLife() { + return false; + } + + @Override + public void setCanPayLifeCost(boolean canPayLifeCost) { + + } + + @Override + public boolean canPayLifeCost() { + return false; + } + + @Override + public void setCanPaySacrificeCost(boolean canPaySacrificeCost) { + + } + + @Override + public boolean canPaySacrificeCost() { + return false; + } + + @Override + public void setLifeTotalCanChange(boolean lifeTotalCanChange) { + + } + + @Override + public boolean isLifeTotalCanChange() { + return false; + } + + @Override + public void setLoseByZeroOrLessLife(boolean loseByZeroOrLessLife) { + + } + + @Override + public boolean canLoseByZeroOrLessLife() { + return false; + } + + @Override + public void setPlayCardsFromGraveyard(boolean playCardsFromGraveyard) { + + } + + @Override + public boolean canPlayCardsFromGraveyard() { + return false; + } + + @Override + public List getAlternativeSourceCosts() { + return null; + } + + @Override + public Cards getHand() { + return null; + } + + @Override + public int getLandsPlayed() { + return 0; + } + + @Override + public int getLandsPerTurn() { + return 0; + } + + @Override + public void setLandsPerTurn(int landsPerTurn) { + + } + + @Override + public int getLoyaltyUsePerTurn() { + return 0; + } + + @Override + public void setLoyaltyUsePerTurn(int loyaltyUsePerTurn) { + + } + + @Override + public int getMaxHandSize() { + return 0; + } + + @Override + public void setMaxHandSize(int maxHandSize) { + + } + + @Override + public int getMaxAttackedBy() { + return 0; + } + + @Override + public void setMaxAttackedBy(int maxAttackedBy) { + + } + + @Override + public boolean isPassed() { + return false; + } + + @Override + public boolean isEmptyDraw() { + return false; + } + + @Override + public void pass(Game game) { + + } + + @Override + public void resetPassed() { + + } + + @Override + public void resetPlayerPassedActions() { + + } + + @Override + public boolean getPassedTurn() { + return false; + } + + @Override + public boolean getPassedUntilEndOfTurn() { + return false; + } + + @Override + public boolean getPassedUntilNextMain() { + return false; + } + + @Override + public boolean getPassedUntilStackResolved() { + return false; + } + + @Override + public boolean getPassedAllTurns() { + return false; + } + + @Override + public AbilityType getJustActivatedType() { + return null; + } + + @Override + public void setJustActivatedType(AbilityType abilityType) { + + } + + @Override + public boolean hasLost() { + return false; + } + + @Override + public boolean hasWon() { + return false; + } + + @Override + public boolean hasQuit() { + return false; + } + + @Override + public void quit(Game game) { + + } + + @Override + public boolean hasTimerTimeout() { + return false; + } + + @Override + public void timerTimeout(Game game) { + + } + + @Override + public boolean hasIdleTimeout() { + return false; + } + + @Override + public void idleTimeout(Game game) { + + } + + @Override + public boolean hasLeft() { + return false; + } + + @Override + public boolean isInGame() { + return false; + } + + @Override + public boolean canRespond() { + return false; + } + + @Override + public void otherPlayerLeftGame(Game game) { + + } + + @Override + public ManaPool getManaPool() { + return null; + } + + @Override + public Set getInRange() { + return null; + } + + @Override + public boolean isTopCardRevealed() { + return false; + } + + @Override + public void setTopCardRevealed(boolean topCardRevealed) { + + } + + @Override + public UserData getUserData() { + return null; + } + + @Override + public void setUserData(UserData userData) { + + } + + @Override + public boolean canLose(Game game) { + return false; + } + + @Override + public boolean autoLoseGame() { + return false; + } + + @Override + public Set getPlayersUnderYourControl() { + return null; + } + + @Override + public void controlPlayersTurn(Game game, UUID playerId) { + + } + + @Override + public void setTurnControlledBy(UUID playerId) { + + } + + @Override + public UUID getTurnControlledBy() { + return null; + } + + @Override + public void resetOtherTurnsControlled() { + + } + + @Override + public boolean isGameUnderControl() { + return false; + } + + @Override + public void setGameUnderYourControl(boolean value) { + + } + + @Override + public boolean isTestMode() { + return false; + } + + @Override + public void setTestMode(boolean value) { + + } + + @Override + public void addAction(String action) { + + } + + @Override + public int getActionCount() { + return 0; + } + + @Override + public void setAllowBadMoves(boolean allowBadMoves) { + + } + + @Override + public void init(Game game) { + + } + + @Override + public void init(Game game, boolean testMode) { + + } + + @Override + public void useDeck(Deck deck, Game game) { + + } + + @Override + public void reset() { + + } + + @Override + public void shuffleLibrary(Game game) { + + } + + @Override + public int drawCards(int num, Game game) { + return 0; + } + + @Override + public int drawCards(int num, Game game, ArrayList appliedEffects) { + return 0; + } + + @Override + public boolean cast(SpellAbility ability, Game game, boolean noMana) { + return false; + } + + @Override + public SpellAbility chooseSpellAbilityForCast(SpellAbility ability, Game game, boolean noMana) { + return null; + } + + @Override + public boolean putInHand(Card card, Game game) { + return false; + } + + @Override + public boolean removeFromHand(Card card, Game game) { + return false; + } + + @Override + public boolean removeFromBattlefield(Permanent permanent, Game game) { + return false; + } + + @Override + public boolean putInGraveyard(Card card, Game game, boolean fromBattlefield) { + return false; + } + + @Override + public boolean removeFromGraveyard(Card card, Game game) { + return false; + } + + @Override + public boolean removeFromLibrary(Card card, Game game) { + return false; + } + + @Override + public boolean searchLibrary(TargetCardInLibrary target, Game game) { + return false; + } + + @Override + public boolean searchLibrary(TargetCardInLibrary target, Game game, UUID targetPlayerId) { + return false; + } + + @Override + public boolean canPlayLand() { + return false; + } + + @Override + public boolean playCard(Card card, Game game, boolean noMana, boolean checkTiming) { + return false; + } + + @Override + public boolean playLand(Card card, Game game, boolean ignoreTiming) { + return false; + } + + @Override + public boolean activateAbility(ActivatedAbility ability, Game game) { + return false; + } + + @Override + public boolean triggerAbility(TriggeredAbility ability, Game game) { + return false; + } + + @Override + public boolean canBeTargetedBy(MageObject source, UUID sourceControllerId, Game game) { + return false; + } + + @Override + public boolean hasProtectionFrom(MageObject source, Game game) { + return false; + } + + @Override + public boolean flipCoin(Game game) { + return false; + } + + @Override + public boolean flipCoin(Game game, ArrayList appliedEffects) { + return false; + } + + @Override + public void discard(int amount, Ability source, Game game) { + + } + + @Override + public Card discardOne(boolean random, Ability source, Game game) { + return null; + } + + @Override + public Cards discard(int amount, boolean random, Ability source, Game game) { + return null; + } + + @Override + public void discardToMax(Game game) { + + } + + @Override + public boolean discard(Card card, Ability source, Game game) { + return false; + } + + @Override + public void lost(Game game) { + + } + + @Override + public void lostForced(Game game) { + + } + + @Override + public void won(Game game) { + + } + + @Override + public void leave() { + + } + + @Override + public void concede(Game game) { + + } + + @Override + public void abort() { + + } + + @Override + public void abortReset() { + + } + + @Override + public void skip() { + + } + + @Override + public void sendPlayerAction(PlayerAction passPriorityAction, Game game, Object data) { + + } + + @Override + public int getStoredBookmark() { + return 0; + } + + @Override + public void setStoredBookmark(int bookmark) { + + } + + @Override + public void resetStoredBookmark(Game game) { + + } + + @Override + public void revealCards(String name, Cards cards, Game game) { + + } + + @Override + public void revealCards(String name, Cards cards, Game game, boolean postToLog) { + + } + + @Override + public void lookAtCards(String name, Card card, Game game) { + + } + + @Override + public void lookAtCards(String name, Cards cards, Game game) { + + } + + @Override + public Player copy() { + return null; + } + + @Override + public void restore(Player player) { + + } + + @Override + public void setResponseString(String responseString) { + + } + + @Override + public void setResponseUUID(UUID responseUUID) { + + } + + @Override + public void setResponseBoolean(Boolean responseBoolean) { + + } + + @Override + public void setResponseInteger(Integer data) { + + } + + @Override + public void setResponseManaType(UUID manaTypePlayerId, ManaType responseManaType) { + + } + + @Override + public boolean priority(Game game) { + return false; + } + + @Override + public boolean choose(Outcome outcome, Target target, UUID sourceId, Game game) { + return false; + } + + @Override + public boolean choose(Outcome outcome, Target target, UUID sourceId, Game game, Map options) { + return false; + } + + @Override + public boolean choose(Outcome outcome, Cards cards, TargetCard target, Game game) { + return false; + } + + @Override + public boolean chooseTarget(Outcome outcome, Target target, Ability source, Game game) { + return false; + } + + @Override + public boolean chooseTarget(Outcome outcome, Cards cards, TargetCard target, Ability source, Game game) { + return false; + } + + @Override + public boolean chooseTargetAmount(Outcome outcome, TargetAmount target, Ability source, Game game) { + return false; + } + + @Override + public boolean chooseMulligan(Game game) { + return false; + } + + @Override + public boolean chooseUse(Outcome outcome, String message, Ability source, Game game) { + return false; + } + + @Override + public boolean chooseUse(Outcome outcome, MessageToClient message, Ability source, Game game) { + return false; + } + + @Override + public boolean choose(Outcome outcome, Choice choice, Game game) { + return false; + } + + @Override + public boolean choosePile(Outcome outcome, String message, List pile1, List pile2, Game game) { + return false; + } + + @Override + public boolean playMana(Ability ability, ManaCost unpaid, String promptText, Game game) { + return false; + } + + @Override + public boolean putCardsOnBottomOfLibrary(Cards cards, Game game, Ability source, boolean anyOrder) { + return false; + } + + @Override + public boolean putCardsOnTopOfLibrary(Cards cards, Game game, Ability source, boolean anyOrder) { + return false; + } + + @Override + public int announceXMana(int min, int max, String message, Game game, Ability ability) { + return 0; + } + + @Override + public int announceXCost(int min, int max, String message, Game game, Ability ability, VariableCost variableCost) { + return 0; + } + + @Override + public int chooseReplacementEffect(Map abilityMap, Game game) { + return 0; + } + + @Override + public TriggeredAbility chooseTriggeredAbility(List abilities, Game game) { + return null; + } + + @Override + public Mode chooseMode(Modes modes, Ability source, Game game) { + return null; + } + + @Override + public void selectAttackers(Game game, UUID attackingPlayerId) { + + } + + @Override + public void selectBlockers(Game game, UUID defendingPlayerId) { + + } + + @Override + public UUID chooseAttackerOrder(List attacker, Game game) { + return null; + } + + @Override + public UUID chooseBlockerOrder(List blockers, CombatGroup combatGroup, List blockerOrder, Game game) { + return null; + } + + @Override + public void assignDamage(int damage, List targets, String singleTargetName, UUID sourceId, Game game) { + + } + + @Override + public int getAmount(int min, int max, String message, Game game) { + return 0; + } + + @Override + public void sideboard(Match match, Deck deck) { + + } + + @Override + public void construct(Tournament tournament, Deck deck) { + + } + + @Override + public void pickCard(List cards, Deck deck, Draft draft) { + + } + + @Override + public void declareAttacker(UUID attackerId, UUID defenderId, Game game, boolean allowUndo) { + + } + + @Override + public void declareBlocker(UUID defenderId, UUID blockerId, UUID attackerId, Game game) { + + } + + @Override + public List getAvailableAttackers(Game game) { + return null; + } + + @Override + public List getAvailableAttackers(UUID defenderId, Game game) { + return null; + } + + @Override + public List getAvailableBlockers(Game game) { + return null; + } + + @Override + public void beginTurn(Game game) { + + } + + @Override + public void endOfTurn(Game game) { + + } + + @Override + public void phasing(Game game) { + + } + + @Override + public void untap(Game game) { + + } + + @Override + public ManaOptions getManaAvailable(Game game) { + return null; + } + + @Override + public List getPlayable(Game game, boolean hidden) { + return null; + } + + @Override + public List getPlayableOptions(Ability ability, Game game) { + return null; + } + + @Override + public Set getPlayableInHand(Game game) { + return null; + } + + @Override + public LinkedHashMap getUseableActivatedAbilities(MageObject object, Zone zone, Game game) { + return null; + } + + @Override + public void addCounters(Counter counter, Game game) { + + } + + @Override + public List getAttachments() { + return null; + } + + @Override + public boolean addAttachment(UUID permanentId, Game game) { + return false; + } + + @Override + public boolean removeAttachment(Permanent permanent, Game game) { + return false; + } + + @Override + public void becomesActivePlayer() { + + } + + @Override + public int getTurns() { + return 0; + } + + @Override + public boolean lookAtFaceDownCard(Card card, Game game) { + return false; + } + + @Override + public void setPriorityTimeLeft(int timeLeft) { + + } + + @Override + public int getPriorityTimeLeft() { + return 0; + } + + @Override + public void setReachedNextTurnAfterLeaving(boolean reachedNextTurnAfterLeaving) { + + } + + @Override + public boolean hasReachedNextTurnAfterLeaving() { + return false; + } + + @Override + public boolean canJoinTable(Table table) { + return false; + } + + @Override + public void setCommanderId(UUID commanderId) { + + } + + @Override + public UUID getCommanderId() { + return null; + } + + @Override + public boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game) { + return false; + } + + @Override + public boolean moveCards(Card card, Zone fromZone, Zone toZone, Ability source, Game game) { + return false; + } + + @Override + public boolean moveCards(Set cards, Zone fromZone, Zone toZone, Ability source, Game game) { + return false; + } + + @Override + public boolean moveCards(Card card, Zone toZone, Ability source, Game game) { + return false; + } + + @Override + public boolean moveCards(Card card, Zone toZone, Ability source, Game game, boolean tapped, boolean faceDown, boolean byOwner, ArrayList appliedEffects) { + return false; + } + + @Override + public boolean moveCards(Cards cards, Zone toZone, Ability source, Game game) { + return false; + } + + @Override + public boolean moveCards(Set cards, Zone toZone, Ability source, Game game) { + return false; + } + + @Override + public boolean moveCards(Set cards, Zone toZone, Ability source, Game game, boolean tapped, boolean faceDown, boolean byOwner, ArrayList appliedEffects) { + return false; + } + + @Override + public boolean moveCardsToExile(Card card, Ability source, Game game, boolean withName, UUID exileId, String exileZoneName) { + return false; + } + + @Override + public boolean moveCardsToExile(Set cards, Ability source, Game game, boolean withName, UUID exileId, String exileZoneName) { + return false; + } + + @Override + public boolean moveCardToHandWithInfo(Card card, UUID sourceId, Game game) { + return false; + } + + @Override + public boolean moveCardToHandWithInfo(Card card, UUID sourceId, Game game, boolean withName) { + return false; + } + + @Override + public boolean moveCardToExileWithInfo(Card card, UUID exileId, String exileName, UUID sourceId, Game game, Zone fromZone, boolean withName) { + return false; + } + + @Override + public boolean moveCardToGraveyardWithInfo(Card card, UUID sourceId, Game game, Zone fromZone) { + return false; + } + + @Override + public Set moveCardsToGraveyardWithInfo(Set cards, Ability source, Game game, Zone fromZone) { + return null; + } + + @Override + public boolean moveCardToLibraryWithInfo(Card card, UUID sourceId, Game game, Zone fromZone, boolean toTop, boolean withName) { + return false; + } + + @Override + public boolean hasOpponent(UUID playerToCheckId, Game game) { + return false; + } + + @Override + public void cleanUpOnMatchEnd() { + + } + + @Override + public void setCastSourceIdWithAlternateMana(UUID sourceId, ManaCosts manaCosts, Costs costs) { + + } + + @Override + public UUID getCastSourceIdWithAlternateMana() { + return null; + } + + @Override + public ManaCosts getCastSourceIdManaCosts() { + return null; + } + + @Override + public Costs getCastSourceIdCosts() { + return null; + } + + @Override + public void addPermissionToShowHandCards(UUID watcherUserId) { + + } + + @Override + public boolean hasUserPermissionToSeeHand(UUID userId) { + return false; + } + + @Override + public void revokePermissionToSeeHandCards() { + + } + + @Override + public boolean isRequestToShowHandCardsAllowed() { + return false; + } + + @Override + public Set getUsersAllowedToSeeHandCards() { + return null; + } + + @Override + public boolean isInPayManaMode() { + return false; + } + + @Override + public void setMatchPlayer(MatchPlayer matchPlayer) { + + } + + @Override + public MatchPlayer getMatchPlayer() { + return null; + } + + @Override + public boolean scry(int value, Ability source, Game game) { + return false; + } + + @Override + public boolean addTargets(Ability ability, Game game) { + return false; + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/stub/TournamentStub.java b/Mage.Tests/src/test/java/org/mage/test/stub/TournamentStub.java new file mode 100644 index 00000000000..acdc6c43e74 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/stub/TournamentStub.java @@ -0,0 +1,237 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package org.mage.test.stub; + +import mage.cards.ExpansionSet; +import mage.cards.decks.Deck; +import mage.game.draft.Draft; +import mage.game.events.Listener; +import mage.game.events.PlayerQueryEvent; +import mage.game.events.TableEvent; +import mage.game.tournament.*; +import mage.players.Player; + +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +/** + * + * @author Quercitron + */ +public class TournamentStub implements Tournament { + + private final UUID id = UUID.randomUUID(); + + @Override + public UUID getId() { + return id; + } + + @Override + public void addPlayer(Player player, String playerType) { + + } + + @Override + public void removePlayer(UUID playerId) { + + } + + @Override + public TournamentPlayer getPlayer(UUID playerId) { + return null; + } + + @Override + public Collection getPlayers() { + return null; + } + + @Override + public Collection getRounds() { + return null; + } + + @Override + public List getSets() { + return null; + } + + @Override + public void updateResults() { + + } + + @Override + public void setBoosterInfo(String setInfo) { + + } + + @Override + public String getBoosterInfo() { + return null; + } + + @Override + public void submitDeck(UUID playerId, Deck deck) { + + } + + @Override + public void updateDeck(UUID playerId, Deck deck) { + + } + + @Override + public void autoSubmit(UUID playerId, Deck deck) { + + } + + @Override + public boolean allJoined() { + return false; + } + + @Override + public boolean isDoneConstructing() { + return false; + } + + @Override + public void quit(UUID playerId) { + + } + + @Override + public void leave(UUID playerId) { + + } + + @Override + public void nextStep() { + + } + + @Override + public void addTableEventListener(Listener listener) { + + } + + @Override + public void addPlayerQueryEventListener(Listener listener) { + + } + + @Override + public void fireConstructEvent(UUID playerId) { + + } + + @Override + public TournamentOptions getOptions() { + return null; + } + + @Override + public void setStartTime() { + + } + + @Override + public Date getStartTime() { + return null; + } + + @Override + public Date getEndTime() { + return null; + } + + @Override + public Date getStepStartTime() { + return null; + } + + @Override + public void setStepStartTime(Date date) { + + } + + @Override + public TournamentType getTournamentType() { + return null; + } + + @Override + public void setTournamentType(TournamentType tournamentType) { + + } + + @Override + public String getTournamentState() { + return null; + } + + @Override + public void setTournamentState(String tournamentState) { + + } + + @Override + public int getNumberRounds() { + return 0; + } + + @Override + public void cleanUpOnTournamentEnd() { + + } + + @Override + public boolean isAbort() { + return false; + } + + @Override + public void setAbort(boolean abort) { + + } + + @Override + public void clearDraft() { + + } + + @Override + public Draft getDraft() { + return null; + } +} diff --git a/Mage.Tests/src/test/java/org/mage/test/utils/ManaUtilTest.java b/Mage.Tests/src/test/java/org/mage/test/utils/ManaUtilTest.java index 3534b4a6acf..fbc1cd7518b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/utils/ManaUtilTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/utils/ManaUtilTest.java @@ -3,6 +3,7 @@ package org.mage.test.utils; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.UUID; +import mage.Mana; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCostsImpl; @@ -88,6 +89,42 @@ public class ManaUtilTest extends CardTestPlayerBase { Assert.assertEquals("", ManaUtil.condenseManaCostString("{}")); } + /** + * Mana.enough is used to check if a spell can be cast with an given amount + * of avalable mana + */ + @Test + public void testManaEnough() { + testManaAvailEnough("{G}", 1, "", true); + testManaAvailEnough("{G}", 0, "{G}", true); + testManaAvailEnough("{R}", 0, "{G}", false); + testManaAvailEnough("{B}", 0, "{G}", false); + testManaAvailEnough("{U}", 0, "{G}", false); + testManaAvailEnough("{W}", 0, "{G}", false); + + testManaAvailEnough("{R}", 1, "", true); + testManaAvailEnough("{R}", 0, "{R}", true); + testManaAvailEnough("{G}", 0, "{R}", false); + testManaAvailEnough("{B}", 0, "{R}", false); + testManaAvailEnough("{U}", 0, "{R}", false); + testManaAvailEnough("{W}", 0, "{R}", false); + + testManaAvailEnough("{U}{B}{W}{G}{R}", 4, "{R}", true); + testManaAvailEnough("{U}{B}{W}{G}{R}", 3, "{R}{B}", true); + + testManaAvailEnough("{U}{U}{U}{G}{G}{2}", 2, "{U}{U}{G}{R}{B}", true); + + testManaAvailEnough("{2}{U}{U}", 0, "{U}{U}{U}{U}", true); + testManaAvailEnough("{2}{U}{U}", 0, "{4}", false); + testManaAvailEnough("{2}{U}{U}", 0, "{B}{B}{4}", false); + + testManaAvailEnough("{G}", 0, "{G/W}", true); + testManaAvailEnough("{G}{W}", 0, "{G/W}{G/W}", true); + testManaAvailEnough("{W}{W}", 0, "{G/W}{G/W}", true); + testManaAvailEnough("{G}{G}", 0, "{G/W}{G/W}", true); + + } + /** * Common way to test ManaUtil.tryToAutoPay * @@ -142,6 +179,26 @@ public class ManaUtilTest extends CardTestPlayerBase { Assert.assertTrue("Wrong mana ability has been chosen", expectedChosen.isInstance(ability)); } + /** + * Checks if the given available Mana is enough to pay a given mana cost + * + * @param manaCostsToPay + * @param availablyAny + * @param available + * @param expected + */ + private void testManaAvailEnough(String manaCostsToPay, int availablyAny, String available, boolean expected) { + ManaCost unpaid = new ManaCostsImpl(manaCostsToPay); + ManaCost costAvailable = new ManaCostsImpl(available); + Mana manaAvailable = costAvailable.getMana(); + manaAvailable.setAny(availablyAny); + if (expected) { + Assert.assertTrue("The available Mana " + costAvailable.getText() + " should be enough to pay the costs " + unpaid.getText(), unpaid.getMana().enough(manaAvailable)); + } else { + Assert.assertFalse("The available Mana " + costAvailable.getText() + " shouldn't be enough to pay the costs " + unpaid.getText(), unpaid.getMana().enough(manaAvailable)); + } + } + /** * Extracts mana abilities from the card. * diff --git a/Mage.Updater/pom.xml b/Mage.Updater/pom.xml index 90d4db3a1a6..20e013ae56c 100644 --- a/Mage.Updater/pom.xml +++ b/Mage.Updater/pom.xml @@ -5,7 +5,7 @@ mage-root org.mage - 1.4.3 + 1.4.5 4.0.0 diff --git a/Mage/pom.xml b/Mage/pom.xml index c13b047036a..88d849517fa 100644 --- a/Mage/pom.xml +++ b/Mage/pom.xml @@ -7,7 +7,7 @@ org.mage mage-root - 1.4.3 + 1.4.5 mage diff --git a/Mage/src/mage/MageObjectReference.java b/Mage/src/mage/MageObjectReference.java index 8242aff19ad..b2516798d20 100644 --- a/Mage/src/mage/MageObjectReference.java +++ b/Mage/src/mage/MageObjectReference.java @@ -25,24 +25,27 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage; import java.io.Serializable; import java.util.UUID; import mage.cards.Card; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; +import mage.game.stack.StackObject; +import org.apache.log4j.Logger; /** * A object reference that takes zone changes into account. * * @author LevelX2 */ - public class MageObjectReference implements Comparable, Serializable { + private static final Logger logger = Logger.getLogger(MageObjectReference.class); + private final UUID sourceId; private final int zoneChangeCounter; @@ -50,20 +53,21 @@ public class MageObjectReference implements Comparable, Ser this.sourceId = mageObject.getId(); this.zoneChangeCounter = mageObject.getZoneChangeCounter(game); } + /** - * That values manually (can be used to let it reference to a Permanent - * that is not yet on the battlefield. - * + * That values manually (can be used to let it reference to a Permanent that + * is not yet on the battlefield. + * * @param sourceId * @param zoneChangeCounter - * @param game + * @param game */ public MageObjectReference(UUID sourceId, int zoneChangeCounter, Game game) { this.sourceId = sourceId; this.zoneChangeCounter = zoneChangeCounter; } - public MageObjectReference(UUID sourceId, Game game) { + public MageObjectReference(UUID sourceId, Game game) { this.sourceId = sourceId; MageObject mageObject = game.getObject(sourceId); if (mageObject != null) { @@ -72,7 +76,18 @@ public class MageObjectReference implements Comparable, Ser if (game.getPlayerList().contains(sourceId)) { this.zoneChangeCounter = 0; } else { - throw new IllegalArgumentException("The provided sourceId is not connected to an object in the game"); + logger.error("The provided sourceId is not connected to an object in the game id:" + sourceId); + for (StackObject stackObject : game.getStack()) { + logger.error("StackObject: " + stackObject.getId() + " sourceId" + stackObject.getSourceId() + " name" + stackObject.getName()); + } + mageObject = game.getLastKnownInformation(sourceId, Zone.STACK); + if (mageObject != null) { + this.zoneChangeCounter = mageObject.getZoneChangeCounter(game); + logger.error("SourceId found in LKI"); + } else { + logger.error("SourceId NOT found in LKI"); + this.zoneChangeCounter = 0; + } } } } @@ -96,8 +111,8 @@ public class MageObjectReference implements Comparable, Ser @Override public boolean equals(Object v) { if (v instanceof MageObjectReference) { - if (((MageObjectReference)v).getSourceId().equals(this.sourceId)) { - return ((MageObjectReference)v).getZoneChangeCounter() == this.zoneChangeCounter; + if (((MageObjectReference) v).getSourceId().equals(this.sourceId)) { + return ((MageObjectReference) v).getZoneChangeCounter() == this.zoneChangeCounter; } } return false; @@ -117,7 +132,7 @@ public class MageObjectReference implements Comparable, Ser public boolean refersTo(MageObject mageObject, Game game) { if (mageObject != null) { if (mageObject instanceof Spell) { - return ((Spell)mageObject).getSourceId().equals(sourceId) && this.zoneChangeCounter == mageObject.getZoneChangeCounter(game); + return ((Spell) mageObject).getSourceId().equals(sourceId) && this.zoneChangeCounter == mageObject.getZoneChangeCounter(game); } return mageObject.getId().equals(sourceId) && this.zoneChangeCounter == mageObject.getZoneChangeCounter(game); } diff --git a/Mage/src/mage/Mana.java b/Mage/src/mage/Mana.java index b9b3e04c8fa..cde03cc10cf 100644 --- a/Mage/src/mage/Mana.java +++ b/Mage/src/mage/Mana.java @@ -28,19 +28,25 @@ package mage; import java.io.Serializable; +import java.util.Objects; + import mage.constants.ColoredManaSymbol; import mage.constants.ManaType; + import static mage.constants.ManaType.COLORLESS; + import mage.filter.FilterMana; import mage.util.Copyable; import mage.util.ThreadLocalStringBuilder; +import org.apache.log4j.Logger; /** - * * @author BetaSteward_at_googlemail.com */ public class Mana implements Comparable, Serializable, Copyable { + private static final transient Logger logger = Logger.getLogger(Mana.class); + protected int red; protected int green; protected int blue; @@ -48,8 +54,9 @@ public class Mana implements Comparable, Serializable, Copyable { protected int black; protected int colorless; protected int any; - protected boolean flag = false; + protected boolean flag; + //TODO These are unsafe and mutable public static final Mana RedMana = RedMana(1); public static final Mana GreenMana = GreenMana(1); public static final Mana BlueMana = BlueMana(1); @@ -57,10 +64,45 @@ public class Mana implements Comparable, Serializable, Copyable { public static final Mana BlackMana = BlackMana(1); public static final Mana ColorlessMana = ColorlessMana(1); + + /** + * Default constructor. Creates a {@link Mana} object with 0 values. + */ public Mana() { } + + /** + * Creates a {@link Mana} object with the passed in values. Values can + * not be less than 0. Any values less than 0 will be logged and set to 0. + * + * @param red total Red mana to have. + * @param green total Green mana to have. + * @param blue total Blue mana to have. + * @param white total White mana to have. + * @param black total Black mana to have. + * @param colorless total Colorless mana to have. + * @param any total Any mana to have. + */ + public Mana(final int red, final int green, final int blue, final int white, + final int black, final int colorless, final int any) { + this.red = notNegative(red, "Red"); + this.green = notNegative(green, "Green"); + this.blue = notNegative(blue, "Blue"); + this.white = notNegative(white, "White"); + this.black = notNegative(black, "Black"); + this.colorless = notNegative(colorless, "Colorless"); + this.any = notNegative(any, "Any"); + } + + + /** + * Copy constructor. Creates a {@link Mana} object from existing {@link Mana} + * + * @param mana object to create copy from + */ public Mana(final Mana mana) { + Objects.requireNonNull(mana, "The passed in mana can not be null"); this.red = mana.red; this.green = mana.green; this.blue = mana.blue; @@ -71,7 +113,15 @@ public class Mana implements Comparable, Serializable, Copyable { this.flag = mana.flag; } - public Mana(ColoredManaSymbol color) { + + /** + * Creates {@link Mana} object from {@link ColoredManaSymbol}. + * Created {@link Mana} will have a single mana of the passed in {@link ColoredManaSymbol} color. + * + * @param color The color to create the {@link Mana} object with. + */ + public Mana(final ColoredManaSymbol color) { + Objects.requireNonNull(color, "The passed in ColoredManaSymbol can not be null"); switch (color) { case G: green = 1; @@ -88,44 +138,96 @@ public class Mana implements Comparable, Serializable, Copyable { case W: white = 1; break; + default: + throw new IllegalArgumentException("Unknown mana color: " + color); } } + + /** + * Creates a {@link Mana} object with the passed in {@code num} of Red mana. + * {@code num} can not be a negative value. Negative values will be logged + * and set to 0. + * + * @param num value of Red mana to create. + * @return a {@link Mana} object with the passed in {@code num} of Red mana. + */ public static Mana RedMana(int num) { - return new Mana(num, 0, 0, 0, 0, 0, 0); + return new Mana(notNegative(num, "Red"), 0, 0, 0, 0, 0, 0); } + + /** + * Creates a {@link Mana} object with the passed in {@code num} of Green mana. + * {@code num} can not be a negative value. Negative values will be logged + * and set to 0. + * + * @param num value of Green mana to create. + * @return a {@link Mana} object with the passed in {@code num} of Green mana. + */ public static Mana GreenMana(int num) { - return new Mana(0, num, 0, 0, 0, 0, 0); + return new Mana(0, notNegative(num, "Green"), 0, 0, 0, 0, 0); } + + /** + * Creates a {@link Mana} object with the passed in {@code num} of Blue mana. + * {@code num} can not be a negative value. Negative values will be logged + * and set to 0. + * + * @param num value of Blue mana to create. + * @return a {@link Mana} object with the passed in {@code num} of Blue mana. + */ public static Mana BlueMana(int num) { - return new Mana(0, 0, num, 0, 0, 0, 0); + return new Mana(0, 0, notNegative(num, "Blue"), 0, 0, 0, 0); } + + /** + * Creates a {@link Mana} object with the passed in {@code num} of White mana. + * {@code num} can not be a negative value. Negative values will be logged + * and set to 0. + * + * @param num value of White mana to create. + * @return a {@link Mana} object with the passed in {@code num} of White mana. + */ public static Mana WhiteMana(int num) { - return new Mana(0, 0, 0, num, 0, 0, 0); + return new Mana(0, 0, 0, notNegative(num, "White"), 0, 0, 0); } + + /** + * Creates a {@link Mana} object with the passed in {@code num} of Black mana. + * {@code num} can not be a negative value. Negative values will be logged + * and set to 0. + * + * @param num value of Black mana to create. + * @return a {@link Mana} object with the passed in {@code num} of Black mana. + */ public static Mana BlackMana(int num) { - return new Mana(0, 0, 0, 0, num, 0, 0); + return new Mana(0, 0, 0, 0, notNegative(num, "Black"), 0, 0); } + + /** + * Creates a {@link Mana} object with the passed in {@code num} of Colorless mana. + * {@code num} can not be a negative value. Negative values will be logged + * and set to 0. + * + * @param num value of Colorless mana to create. + * @return a {@link Mana} object with the passed in {@code num} of Colorless mana. + */ public static Mana ColorlessMana(int num) { - return new Mana(0, 0, 0, 0, 0, num, 0); + return new Mana(0, 0, 0, 0, 0, notNegative(num, "Colorless"), 0); } - public Mana(int red, int green, int blue, int white, int black, int colorless, int any) { - this.red = red; - this.green = green; - this.blue = blue; - this.white = white; - this.black = black; - this.colorless = colorless; - this.any = any; - } - public void add(Mana mana) { + /** + * Adds mana from the passed in {@link Mana} object to this object. + * + * @param mana mana to add to this object. + */ + public void add(final Mana mana) { red += mana.getRed(); green += mana.getGreen(); blue += mana.getBlue(); @@ -135,48 +237,89 @@ public class Mana implements Comparable, Serializable, Copyable { any += mana.getAny(); } - public void addRed() { + + /** + * Increases the Red mana by one. + */ + public void increaseRed() { red++; } - public void addGreen() { + + /** + * Increases the Green mana by one. + */ + public void increaseGreen() { green++; } - public void addBlue() { + + /** + * Increases the Blue mana by one. + */ + public void increaseBlue() { blue++; } - public void addWhite() { + + /** + * Increases the White mana by one. + */ + public void increaseWhite() { white++; } - public void addBlack() { + + /** + * Increases the Black mana by one. + */ + public void increaseBlack() { black++; } - public void addColorless() { + + /** + * Increases the Colorless mana by one. + */ + public void increaseColorless() { colorless++; } - public void subtract(Mana mana) { - red -= mana.getRed(); - green -= mana.getGreen(); - blue -= mana.getBlue(); - white -= mana.getWhite(); - black -= mana.getBlack(); - colorless -= mana.getColorless(); - any -= mana.getAny(); + + /** + * Subtracts the passed in mana values from this instance. + * + * @param mana mana values to subtract + */ + public void subtract(final Mana mana) { + red -= mana.red; + green -= mana.green; + blue -= mana.blue; + white -= mana.white; + black -= mana.black; + colorless -= mana.colorless; + any -= mana.any; } - public void subtractCost(Mana cost) { - red -= cost.getRed(); - green -= cost.getGreen(); - blue -= cost.getBlue(); - white -= cost.getWhite(); - black -= cost.getBlack(); - any -= cost.getAny(); - colorless -= cost.getColorless(); + + /** + * Subtracts the passed in mana values from this instance. The difference between this and + * {@code subtract()} is that if we do not have the available colorless + * mana to pay, we take mana from our colored mana pools. + * + * @param mana mana values to subtract + * @throws ArithmeticException thrown if there is not enough available + * colored mana to pay the colorless cost + */ + public void subtractCost(final Mana mana) throws ArithmeticException { + red -= mana.red; + green -= mana.green; + blue -= mana.blue; + white -= mana.white; + black -= mana.black; + any -= mana.any; + colorless -= mana.colorless; + while (colorless < 0) { int oldColorless = colorless; if (red > 0) { @@ -208,20 +351,40 @@ public class Mana implements Comparable, Serializable, Copyable { colorless++; } if (oldColorless == colorless) { - break; // to prevent endless loop -> should not be possible, but who knows + throw new ArithmeticException("Not enough mana to pay colorless"); } } } + + /** + * Returns the total count of all combined mana. + * + * @return the total count of all combined mana. + */ public int count() { return red + green + blue + white + black + colorless + any; } + + /** + * Returns the total count of all colored mana. + * + * @return the total count of all colored mana. + */ public int countColored() { return red + green + blue + white + black + any; } - public int count(FilterMana filter) { + + /** + * Returns the count of filtered mana provided by the passed in {@link FilterMana}. + * If {@link FilterMana} is null, the total mana count is returned via {@link #count() count}. + * + * @param filter the colors of mana to return the count for. + * @return the count of filtered mana provided by the passed in {@link FilterMana}. + */ + public int count(final FilterMana filter) { if (filter == null) { return count(); } @@ -247,6 +410,10 @@ public class Mana implements Comparable, Serializable, Copyable { return count; } + + /** + * Sets all mana to 0. + */ public void clear() { red = 0; green = 0; @@ -257,9 +424,15 @@ public class Mana implements Comparable, Serializable, Copyable { any = 0; } + + /** + * Returns this objects values as a {@link String}. + * + * @return this objects values as a {@link String}. + */ @Override public String toString() { - StringBuilder sbMana = threadLocalBuilder.get(); + StringBuilder sbMana = new StringBuilder(); if (colorless > 0) { sbMana.append("{").append(Integer.toString(colorless)).append("}"); } @@ -284,190 +457,309 @@ public class Mana implements Comparable, Serializable, Copyable { return sbMana.toString(); } - private static final transient ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(10); + /** + * Returns a deep copy of this object. + * + * @return a deep copy of this object. + */ @Override public Mana copy() { return new Mana(this); } - public boolean enough(Mana avail) { - Mana compare = avail.copy(); + + /** + * Returns if there is enough available mana to pay the mana provided by the + * passed in {@link Mana} object. + * + * @param cost the cost to compare too. + * @return if there is enough available mana to pay. + */ + public boolean enough(final Mana cost) { + Mana compare = cost.copy(); compare.subtract(this); - if (compare.getRed() < 0) { - compare.setAny(compare.getAny() + compare.getRed()); - if (compare.getAny() < 0) { + if (compare.red < 0) { + compare.any = compare.getAny() + compare.getRed(); + if (compare.any < 0) { return false; } - compare.setRed(0); + compare.red = 0; } - if (compare.getGreen() < 0) { - compare.setAny(compare.getAny() + compare.getGreen()); - if (compare.getAny() < 0) { + if (compare.green < 0) { + compare.any = compare.getAny() + compare.getGreen(); + if (compare.any < 0) { return false; } - compare.setGreen(0); + compare.green = 0; } - if (compare.getBlue() < 0) { - compare.setAny(compare.getAny() + compare.getBlue()); - if (compare.getAny() < 0) { + if (compare.blue < 0) { + compare.any = compare.getAny() + compare.getBlue(); + if (compare.any < 0) { return false; } - compare.setBlue(0); + compare.blue = 0; } - if (compare.getBlack() < 0) { - compare.setAny(compare.getAny() + compare.getBlack()); - if (compare.getAny() < 0) { + if (compare.black < 0) { + compare.any = compare.getAny() + compare.getBlack(); + if (compare.any < 0) { return false; } - compare.setBlack(0); + compare.black = 0; } - if (compare.getWhite() < 0) { - compare.setAny(compare.getAny() + compare.getWhite()); - if (compare.getAny() < 0) { + if (compare.white < 0) { + compare.any = compare.getAny() + compare.getWhite(); + if (compare.any < 0) { return false; } - compare.setWhite(0); + compare.white = 0; } - if (compare.getColorless() < 0) { - int remaining = compare.getRed() + compare.getGreen() + compare.getBlack() + compare.getBlue() + compare.getWhite() + compare.getAny(); - if (compare.getColorless() + remaining < 0) { + if (compare.colorless < 0) { + int remaining = compare.red + compare.green + compare.black + compare.blue + compare.white + compare.any; + if (compare.colorless + remaining < 0) { return false; } } return true; } - public Mana needed(Mana avail) { - Mana compare = avail.copy(); + + /** + * Returns the total mana needed to meet the passed in {@link Mana} object. + * + * @param cost the mana cost + * @return the total mana needed to meet the passes in {@link Mana} object. + */ + public Mana needed(final Mana cost) { + Mana compare = cost.copy(); compare.subtract(this); - if (compare.getRed() < 0 && compare.getAny() > 0) { - int diff = Math.min(compare.getAny(), Math.abs(compare.getRed())); - compare.setAny(compare.getAny() - diff); - compare.setRed(compare.getRed() + diff); + if (compare.red < 0 && compare.any > 0) { + int diff = Math.min(compare.any, Math.abs(compare.red)); + compare.any = compare.getAny() - diff; + compare.red = compare.getRed() + diff; } - if (compare.getGreen() < 0 && compare.getAny() > 0) { - int diff = Math.min(compare.getAny(), Math.abs(compare.getGreen())); - compare.setAny(compare.getAny() - diff); - compare.setGreen(compare.getGreen() + diff); + if (compare.green < 0 && compare.any > 0) { + int diff = Math.min(compare.any, Math.abs(compare.green)); + compare.any = compare.any - diff; + compare.green = compare.green + diff; } - if (compare.getBlue() < 0 && compare.getAny() > 0) { - int diff = Math.min(compare.getAny(), Math.abs(compare.getBlue())); - compare.setAny(compare.getAny() - diff); - compare.setBlue(compare.getBlue() + diff); + if (compare.blue < 0 && compare.any > 0) { + int diff = Math.min(compare.any, Math.abs(compare.blue)); + compare.any = compare.any - diff; + compare.blue = compare.blue + diff; } - if (compare.getBlack() < 0 && compare.getAny() > 0) { - int diff = Math.min(compare.getAny(), Math.abs(compare.getBlack())); - compare.setAny(compare.getAny() - diff); - compare.setBlack(compare.getBlack() + diff); + if (compare.black < 0 && compare.any > 0) { + int diff = Math.min(compare.any, Math.abs(compare.black)); + compare.any = compare.any - diff; + compare.black = compare.getBlack() + diff; } - if (compare.getWhite() < 0 && compare.getAny() > 0) { - int diff = Math.min(compare.getAny(), Math.abs(compare.getWhite())); - compare.setAny(compare.getAny() - diff); - compare.setWhite(compare.getWhite() + diff); + if (compare.white < 0 && compare.any > 0) { + int diff = Math.min(compare.any, Math.abs(compare.white)); + compare.any = compare.any - diff; + compare.white = compare.white + diff; } - if (compare.getColorless() < 0) { + if (compare.colorless < 0) { int remaining = 0; - remaining += Math.min(0, compare.getRed()); - remaining += Math.min(0, compare.getWhite()); - remaining += Math.min(0, compare.getGreen()); - remaining += Math.min(0, compare.getBlack()); - remaining += Math.min(0, compare.getBlue()); - remaining += Math.min(0, compare.getAny()); + remaining += Math.min(0, compare.red); + remaining += Math.min(0, compare.white); + remaining += Math.min(0, compare.green); + remaining += Math.min(0, compare.black); + remaining += Math.min(0, compare.blue); + remaining += Math.min(0, compare.any); if (remaining > 0) { - int diff = Math.min(remaining, Math.abs(compare.getColorless())); - compare.setColorless(compare.getColorless() + diff); + int diff = Math.min(remaining, Math.abs(compare.colorless)); + compare.colorless = compare.colorless + diff; } } Mana needed = new Mana(); - if (compare.getRed() < 0) { - needed.setRed(Math.abs(compare.getRed())); + if (compare.red < 0) { + needed.red = Math.abs(compare.red); } - if (compare.getWhite() < 0) { - needed.setWhite(Math.abs(compare.getWhite())); + if (compare.white < 0) { + needed.white = Math.abs(compare.white); } - if (compare.getGreen() < 0) { - needed.setGreen(Math.abs(compare.getGreen())); + if (compare.green < 0) { + needed.green = Math.abs(compare.green); } - if (compare.getBlack() < 0) { - needed.setBlack(Math.abs(compare.getBlack())); + if (compare.black < 0) { + needed.black = Math.abs(compare.black); } - if (compare.getBlue() < 0) { - needed.setBlue(Math.abs(compare.getBlue())); + if (compare.blue < 0) { + needed.blue = Math.abs(compare.blue); } - if (compare.getColorless() < 0) { - needed.setColorless(Math.abs(compare.getColorless())); + if (compare.colorless < 0) { + needed.colorless = Math.abs(compare.colorless); } return needed; } + + /** + * Returns total Red mana. + * + * @return total Red mana. + */ public int getRed() { return red; } + + /** + * Sets the total Red mana. Can not be negative. + * Negative values will be logged and set to 0. + * + * @param red total Red mana. + */ public void setRed(int red) { - this.red = red; + this.red = notNegative(red, "Red"); } + + /** + * Returns total Green mana. + * + * @return total Green mana. + */ public int getGreen() { return green; } + + /** + * Sets the total Green mana. Can not be negative. + * Negative values will be logged and set to 0. + * + * @param green total Green mana. + */ public void setGreen(int green) { - this.green = green; + this.green = notNegative(green, "Green"); } + + /** + * Returns total Blue mana. + * + * @return total Blue mana. + */ public int getBlue() { return blue; } + + /** + * Sets the total Blue mana. Can not be negative. + * Negative values will be logged and set to 0. + * + * @param blue total Blue mana. + */ public void setBlue(int blue) { - this.blue = blue; + this.blue = notNegative(blue, "Blue"); } + + /** + * Returns total White mana. + * + * @return total White mana. + */ public int getWhite() { return white; } + + /** + * Sets the total White mana. Can not be negative. + * Negative values will be logged and set to 0. + * + * @param white total White mana. + */ public void setWhite(int white) { - this.white = white; + this.white = notNegative(white, "White"); } + + /** + * Returns total Black mana. + * + * @return total Black mana. + */ public int getBlack() { return black; } + + /** + * Sets the total Black mana. Can not be negative. + * Negative values will be logged and set to 0. + * + * @param black total Black mana. + */ public void setBlack(int black) { - this.black = black; + this.black = notNegative(black, "Black"); } + + /** + * Returns total Colorless mana. + * + * @return total Colorless mana. + */ public int getColorless() { return colorless; } + + /** + * Sets the total Colorless mana. Can not be negative. + * Negative values will be logged and set to 0. + * + * @param colorless total Colorless mana. + */ public void setColorless(int colorless) { - this.colorless = colorless; + this.colorless = notNegative(colorless, "Colorless"); } + + /** + * Returns total Any mana. + * + * @return total Any mana. + */ public int getAny() { return any; } + + /** + * Sets the total Any mana. Can not be negative. + * Negative values will be logged and set to 0. + * + * @param any total Any mana. + */ public void setAny(int any) { - this.any = any; + this.any = notNegative(any, "Any"); } + + /** + * Returns this objects total mana minus the passed in {@link Mana}'s mana. + * + * @param o the object to compare to. + * @return this objects total mana minus the passed in {@link Mana}'s mana. + */ @Override - public int compareTo(Mana o) { + public int compareTo(final Mana o) { return this.count() - o.count(); } + /** + * Returns if this objects mana contains any number of the passed in {@link Mana}'s mana. * - * @param mana + * @param mana the mana to check for * @return true if this contains any values that mana has */ - public boolean contains(Mana mana) { + public boolean contains(final Mana mana) { if (mana.black > 0 && this.black > 0) { return true; } @@ -490,26 +782,40 @@ public class Mana implements Comparable, Serializable, Copyable { return false; } - public int getColor(ColoredManaSymbol color) { + + /** + * Returns the total count of mana in this object as specified by the passed in {@link ColoredManaSymbol}. + * + * @param color the color to return the count for. + * @return the total count of mana in this object as specified by the passed in {@link ColoredManaSymbol}. + */ + public int getColor(final ColoredManaSymbol color) { if (color.equals(ColoredManaSymbol.G)) { - return getGreen(); + return green; } if (color.equals(ColoredManaSymbol.R)) { - return getRed(); + return red; } if (color.equals(ColoredManaSymbol.B)) { - return getBlack(); + return black; } if (color.equals(ColoredManaSymbol.U)) { - return getBlue(); + return blue; } if (color.equals(ColoredManaSymbol.W)) { - return getWhite(); + return white; } return 0; } - public int get(ManaType manaType) { + + /** + * Returns the total count of mana in this object as specified by the passed in {@link ManaType}. + * + * @param manaType the type to return the count for. + * @return the total count of mana in this object as specified by the passed in {@link ManaType}. + */ + public int get(final ManaType manaType) { switch (manaType) { case BLACK: return black; @@ -527,7 +833,14 @@ public class Mana implements Comparable, Serializable, Copyable { return 0; } - public void set(ManaType manaType, int amount) { + + /** + * Set the color of mana specified by the passed in {@link ManaType} to {@code amount} . + * + * @param manaType the color of the mana to set + * @param amount the value to set the mana too + */ + public void set(final ManaType manaType, final int amount) { switch (manaType) { case BLACK: black = amount; @@ -547,9 +860,12 @@ public class Mana implements Comparable, Serializable, Copyable { case COLORLESS: colorless = amount; break; + default: + throw new IllegalArgumentException("Unknown color: " + manaType); } } + public void setFlag(boolean flag) { this.flag = flag; } @@ -558,7 +874,13 @@ public class Mana implements Comparable, Serializable, Copyable { return flag; } - public void setToMana(Mana mana) { + + /** + * Sets this objects mana to that of the passed in {@link Mana} + * + * @param mana the mana to set this object to. + */ + public void setToMana(final Mana mana) { this.any = mana.any; this.red = mana.red; this.green = mana.green; @@ -568,7 +890,14 @@ public class Mana implements Comparable, Serializable, Copyable { this.colorless = mana.colorless; } - public boolean equalManaValue(Mana mana) { + + /** + * Returns if the passed in {@link Mana} values are equal to this objects. + * + * @param mana the {@link Mana} to compare to. + * @return if the passed in {@link Mana} values are equal to this object. + */ + public boolean equalManaValue(final Mana mana) { return this.any == mana.any && this.red == mana.red && this.green == mana.green @@ -578,12 +907,13 @@ public class Mana implements Comparable, Serializable, Copyable { && this.colorless == mana.colorless; } + /** - * Don't takes any mana into account to be usable in calculating available - * mana + * Returns if this {@link Mana} object has more than or equal values of mana + * as the passed in {@link Mana} object. * - * @param mana - * @return + * @param mana the mana to compare with + * @return if this object has more than or equal mana to the passed in {@link Mana}. */ public boolean includesMana(Mana mana) { return this.green >= mana.green @@ -596,6 +926,7 @@ public class Mana implements Comparable, Serializable, Copyable { } + /** * Returns the mana that is more colored or has a greater amount but does * not contain one less mana in any color but colorless if you call with @@ -607,7 +938,7 @@ public class Mana implements Comparable, Serializable, Copyable { * @param mana2 * @return */ - public static Mana getMoreValuableMana(Mana mana1, Mana mana2) { + public static Mana getMoreValuableMana(final Mana mana1, final Mana mana2) { Mana moreMana; Mana lessMana; if (mana2.countColored() > mana1.countColored() || mana2.getAny() > mana1.getAny() || mana2.count() > mana1.count()) { @@ -628,6 +959,12 @@ public class Mana implements Comparable, Serializable, Copyable { return moreMana; } + + /** + * Returns the total count of mana colors that have at least one. + * + * @return the total count of mana colors that have at least one. + */ public int getDifferentColors() { int count = 0; if (blue > 0) { @@ -647,4 +984,53 @@ public class Mana implements Comparable, Serializable, Copyable { } return count; } + + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Mana mana = (Mana) o; + + if (red != mana.red) return false; + if (green != mana.green) return false; + if (blue != mana.blue) return false; + if (white != mana.white) return false; + if (black != mana.black) return false; + if (colorless != mana.colorless) return false; + if (any != mana.any) return false; + return flag == mana.flag; + + } + + @Override + public int hashCode() { + int result = red; + result = 31 * result + green; + result = 31 * result + blue; + result = 31 * result + white; + result = 31 * result + black; + result = 31 * result + colorless; + result = 31 * result + any; + result = 31 * result + (flag ? 1 : 0); + return result; + } + + /** + * Checks that the {@code value} passed in is not less than 0. + * If the value is negative, it is logged and 0 is returned. + * + * @param value the value to check. + * @param name the name of the value to check. Used to make logging of + * the {@code value} easier + * @return the {@code value} passed in, unless it is minus, in which case 0 is returned. + */ + private static int notNegative(int value, final String name) { + if (value < 0) { + logger.info(name + " can not be less than 0. Passed in: " + value + " Defaulting to 0."); + value = 0; + } + return value; + } } diff --git a/Mage/src/mage/ManaSymbol.java b/Mage/src/mage/ManaSymbol.java index befde22923a..4e0c0fe32bc 100644 --- a/Mage/src/mage/ManaSymbol.java +++ b/Mage/src/mage/ManaSymbol.java @@ -1,65 +1,66 @@ package mage; + + /** * Enum representing the mana symbols. - * + *

* 107.4. The mana symbols are {W}, {U}, {B}, {R}, {G}, and {X}; the numerals - * {0}, {1}, {2}, {3}, {4}, and so on; the hybrid symbols {W/U}, {W/B}, {U/B}, - * {U/R}, {B/R}, {B/G}, {R/G}, {R/W}, {G/W}, and {G/U}; the monocolored hybrid - * symbols {2/W}, {2/U}, {2/B}, {2/R}, and {2/G}; the Phyrexian mana symbols - * {W/P}, {U/P}, {B/P}, {R/P}, and {G/P}; and the snow symbol {S}. - * + * {0}, {1}, {2}, {3}, {4}, and so on; the hybrid symbols {W/U}, {W/B}, {U/B}, + * {U/R}, {B/R}, {B/G}, {R/G}, {R/W}, {G/W}, and {G/U}; the monocolored hybrid + * symbols {2/W}, {2/U}, {2/B}, {2/R}, and {2/G}; the Phyrexian mana symbols + * {W/P}, {U/P}, {B/P}, {R/P}, and {G/P}; and the snow symbol {S}. + *

* 107.4a. There are five primary colored mana symbols: {W} is white, {U} blue, - * {B} black, {R} red, and {G} green. These symbols are used to represent colored - * mana, and also to represent colored mana in costs. Colored mana in costs can - * be paid only with the appropriate color of mana. See rule 202, "Mana Cost and - * Color." - * + * {B} black, {R} red, and {G} green. These symbols are used to represent colored + * mana, and also to represent colored mana in costs. Colored mana in costs can + * be paid only with the appropriate color of mana. See rule 202, "Mana Cost and + * Color." + *

* 107.4b. Numeral symbols (such as {1}) and variable symbols (such as {X}) - * represent generic mana in costs. Generic mana in costs can be paid with any - * type of mana. For more information about {X}, see rule 107.3. - * + * represent generic mana in costs. Generic mana in costs can be paid with any + * type of mana. For more information about {X}, see rule 107.3. + *

* 107.4c. Numeral symbols (such as {1}) and variable symbols (such as {X}) can - * also represent colorless mana if they appear in the effect of a spell or - * ability that reads "add [mana symbol] to your mana pool" or something similar. - * (See rule 107.3e.) - * + * also represent colorless mana if they appear in the effect of a spell or + * ability that reads "add [mana symbol] to your mana pool" or something similar. + * (See rule 107.3e.) + *

* 107.4d. The symbol {0} represents zero mana and is used as a placeholder for a - * cost that can be paid with no resources. (See rule 117.5.) - * + * cost that can be paid with no resources. (See rule 117.5.) + *

* 107.4e. Hybrid mana symbols are also colored mana symbols. Each one represents - * a cost that can be paid in one of two ways, as represented by the two halves - * of the symbol. A hybrid symbol such as {W/U} can be paid with either white or - * blue mana, and a monocolored hybrid symbol such as {2/B} can be paid with - * either one black mana or two mana of any type. A hybrid mana symbol is all of - * its component colors. Example: {G/W}{G/W} can be paid by spending {G}{G}, - * {G}{W}, or {W}{W}. - * + * a cost that can be paid in one of two ways, as represented by the two halves + * of the symbol. A hybrid symbol such as {W/U} can be paid with either white or + * blue mana, and a monocolored hybrid symbol such as {2/B} can be paid with + * either one black mana or two mana of any type. A hybrid mana symbol is all of + * its component colors. Example: {G/W}{G/W} can be paid by spending {G}{G}, + * {G}{W}, or {W}{W}. + *

* 107.4f. Phyrexian mana symbols are colored mana symbols: {W/P} is white, {U/P} - * is blue, {B/P} is black, {R/P} is red, and {G/P} is green. A Phyrexian mana - * symbol represents a cost that can be paid either with one mana of its color or - * by paying 2 life. Example: {W/P}{W/P} can be paid by spending {W}{W}, by - * spending {W} and paying 2 life, or by paying 4 life. - * + * is blue, {B/P} is black, {R/P} is red, and {G/P} is green. A Phyrexian mana + * symbol represents a cost that can be paid either with one mana of its color or + * by paying 2 life. Example: {W/P}{W/P} can be paid by spending {W}{W}, by + * spending {W} and paying 2 life, or by paying 4 life. + *

* 107.4g. In rules text, the Phyrexian symbol {P} with no colored background - * means any of the five Phyrexian mana symbols. - * + * means any of the five Phyrexian mana symbols. + *

* 107.4h. The snow mana symbol {S} represents one generic mana in a cost. This - * generic mana can be paid with one mana of any type produced by a snow - * permanent (see rule 205.4f). Effects that reduce the amount of generic mana - * you pay don't affect {S} costs. (There is no such thing as "snow mana"; "snow" - * is not a type of mana.) - * + * generic mana can be paid with one mana of any type produced by a snow + * permanent (see rule 205.4f). Effects that reduce the amount of generic mana + * you pay don't affect {S} costs. (There is no such thing as "snow mana"; "snow" + * is not a type of mana.) * * @author noxx */ public enum ManaSymbol { - W("{W}", Type.PRIMARY, Type.COLORED), - U("{U}", Type.PRIMARY, Type.COLORED), - B("{B}", Type.PRIMARY, Type.COLORED), - R("{R}", Type.PRIMARY, Type.COLORED), - G("{G}", Type.PRIMARY, Type.COLORED), + W("{W}", Type.PRIMARY, Type.COLORED, Type.MONOCOLORED), + U("{U}", Type.PRIMARY, Type.COLORED, Type.MONOCOLORED), + B("{B}", Type.PRIMARY, Type.COLORED, Type.MONOCOLORED), + R("{R}", Type.PRIMARY, Type.COLORED, Type.MONOCOLORED), + G("{G}", Type.PRIMARY, Type.COLORED, Type.MONOCOLORED), X("{X}", Type.GENERIC, Type.COLORLESS), NUMERIC("{N/A}", Type.GENERIC, Type.COLORLESS), HYBRID_WU("{W/U}", W, U, Type.HYBRID, Type.COLORED), @@ -72,16 +73,16 @@ public enum ManaSymbol { HYBRID_RW("{R/W}", R, W, Type.HYBRID, Type.COLORED), HYBRID_GW("{G/W}", G, W, Type.HYBRID, Type.COLORED), HYBRID_GU("{G/U}", G, U, Type.HYBRID, Type.COLORED), - MONOCOLORED_HYBRID_W("{2/W}", W, Type.HYBRID, Type.MONOCOLORED), - MONOCOLORED_HYBRID_U("{2/U}", U, Type.HYBRID, Type.MONOCOLORED), - MONOCOLORED_HYBRID_B("{2/B}", B, Type.HYBRID, Type.MONOCOLORED), - MONOCOLORED_HYBRID_R("{2/R}", R, Type.HYBRID, Type.MONOCOLORED), - MONOCOLORED_HYBRID_G("{2/G}", G, Type.HYBRID, Type.MONOCOLORED), - PHYREXIAN_W("{W/P}", W, Type.PHYREXIAN, Type.COLORED), - PHYREXIAN_G("{G/P}", G, Type.PHYREXIAN, Type.COLORED), - PHYREXIAN_R("{R/P}", R, Type.PHYREXIAN, Type.COLORED), - PHYREXIAN_B("{B/P}", B, Type.PHYREXIAN, Type.COLORED), - PHYREXIAN_U("{U/P}", U, Type.PHYREXIAN, Type.COLORED), + MONOCOLORED_HYBRID_W("{2/W}", W, Type.HYBRID, Type.MONOCOLORED, Type.COLORED), + MONOCOLORED_HYBRID_U("{2/U}", U, Type.HYBRID, Type.MONOCOLORED, Type.COLORED), + MONOCOLORED_HYBRID_B("{2/B}", B, Type.HYBRID, Type.MONOCOLORED, Type.COLORED), + MONOCOLORED_HYBRID_R("{2/R}", R, Type.HYBRID, Type.MONOCOLORED, Type.COLORED), + MONOCOLORED_HYBRID_G("{2/G}", G, Type.HYBRID, Type.MONOCOLORED, Type.COLORED), + PHYREXIAN_W("{W/P}", W, Type.PHYREXIAN, Type.COLORED, Type.MONOCOLORED), + PHYREXIAN_G("{G/P}", G, Type.PHYREXIAN, Type.COLORED, Type.MONOCOLORED), + PHYREXIAN_R("{R/P}", R, Type.PHYREXIAN, Type.COLORED, Type.MONOCOLORED), + PHYREXIAN_B("{B/P}", B, Type.PHYREXIAN, Type.COLORED, Type.MONOCOLORED), + PHYREXIAN_U("{U/P}", U, Type.PHYREXIAN, Type.COLORED, Type.MONOCOLORED), SNOW("{S}", Type.SNOW); private enum Type { @@ -115,26 +116,41 @@ public enum ManaSymbol { private final ManaSymbol manaSymbol2; /** - * * @param symbol * @param manaSymbol1 First associated mana symbol. For hybrid mana symbol. * @param manaSymbol2 Second associated mana symbol. For hybrid mana symbol. * @param types */ - private ManaSymbol(String symbol, ManaSymbol manaSymbol1, ManaSymbol manaSymbol2, Type... types) { + ManaSymbol(String symbol, ManaSymbol manaSymbol1, ManaSymbol manaSymbol2, Type... types) { this.symbol = symbol; boolean lPrimary = false, lColored = false, lGeneric = false, lColorless = false; boolean lMonocolored = false, lHybrid = false, lPhyrexian = false, lSnow = false; for (Type type : types) { switch (type) { - case PRIMARY: lPrimary = true; break; - case COLORED: lColored = true; break; - case GENERIC: lGeneric = true; break; - case COLORLESS: lColorless = true; break; - case MONOCOLORED: lMonocolored = true; break; - case HYBRID: lHybrid = true; break; - case PHYREXIAN: lPhyrexian = true; break; - case SNOW: lSnow = true; break; + case PRIMARY: + lPrimary = true; + break; + case COLORED: + lColored = true; + break; + case GENERIC: + lGeneric = true; + break; + case COLORLESS: + lColorless = true; + break; + case MONOCOLORED: + lMonocolored = true; + break; + case HYBRID: + lHybrid = true; + break; + case PHYREXIAN: + lPhyrexian = true; + break; + case SNOW: + lSnow = true; + break; } } primary = lPrimary; @@ -155,17 +171,16 @@ public enum ManaSymbol { } /** - * * @param symbol * @param manaSymbol Associated mana symbol. For monocolored hybrid and phyrexian mana. * @param types */ - private ManaSymbol(String symbol, ManaSymbol manaSymbol, Type... types) { + ManaSymbol(String symbol, ManaSymbol manaSymbol, Type... types) { this(symbol, manaSymbol, null, types); } - private ManaSymbol(String symbol, Type... types) { - this(symbol, null, null, types); + ManaSymbol(String symbol, Type... types) { + this(symbol, null, null, types); } public boolean isPrimary() { diff --git a/Mage/src/mage/ObjectColor.java b/Mage/src/mage/ObjectColor.java index c34ea4269d5..dca7bfabd2e 100644 --- a/Mage/src/mage/ObjectColor.java +++ b/Mage/src/mage/ObjectColor.java @@ -35,7 +35,7 @@ import mage.util.ThreadLocalStringBuilder; public class ObjectColor implements Serializable, Copyable, Comparable { - private static final transient ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(10); + private static final ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(10); public static final ObjectColor WHITE = new ObjectColor("W"); public static final ObjectColor BLUE = new ObjectColor("U"); diff --git a/Mage/src/mage/abilities/AbilitiesImpl.java b/Mage/src/mage/abilities/AbilitiesImpl.java index 3e3b4d7ebd1..bec3cc96efb 100644 --- a/Mage/src/mage/abilities/AbilitiesImpl.java +++ b/Mage/src/mage/abilities/AbilitiesImpl.java @@ -50,7 +50,7 @@ import mage.util.ThreadLocalStringBuilder; */ public class AbilitiesImpl extends ArrayList implements Abilities { - private static final transient ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(200); + private static final ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(200); public AbilitiesImpl() {} diff --git a/Mage/src/mage/abilities/Ability.java b/Mage/src/mage/abilities/Ability.java index 81393981ce2..fedff00e85d 100644 --- a/Mage/src/mage/abilities/Ability.java +++ b/Mage/src/mage/abilities/Ability.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities; import java.io.Serializable; @@ -54,48 +53,54 @@ import mage.target.Targets; import mage.watchers.Watcher; /** - * Practically everything in the game is started from an Ability. This - * interface describes what an Ability is composed of at the highest level. + * Practically everything in the game is started from an Ability. This interface + * describes what an Ability is composed of at the highest level. */ public interface Ability extends Controllable, Serializable { /** * Gets the globally unique id of the ability contained within the game. - * - * @return A {@link java.util.UUID} which the game will use to store and retrieve - * the exact instance of this ability. + * + * @return A {@link java.util.UUID} which the game will use to store and + * retrieve the exact instance of this ability. */ @Override UUID getId(); /** * Assigns a new {@link java.util.UUID} - * - * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, mage.game.Game) - * @see mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility) - * @see mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) + * + * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, + * mage.game.Game) + * @see + * mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility) + * @see + * mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) */ void newId(); /** * Assigns a new {@link java.util.UUID} - * - * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, mage.game.Game) - * @see mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility) - * @see mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) + * + * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, + * mage.game.Game) + * @see + * mage.game.GameImpl#addTriggeredAbility(mage.abilities.TriggeredAbility) + * @see + * mage.game.GameImpl#addDelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) */ void newOriginalId(); /** * Gets the {@link AbilityType} of this ability. - * + * * @return The {@link AbilityType type} of this ability. */ AbilityType getAbilityType(); /** * Gets the id of the player in control of this ability. - * + * * @return The {@link java.util.UUID} of the controlling player. */ @Override @@ -103,28 +108,29 @@ public interface Ability extends Controllable, Serializable { /** * Sets the id of the controller of this ability. - * + * * @param controllerId The {@link java.util.UUID} of the controller. */ void setControllerId(UUID controllerId); /** * Gets the id of the object which put this ability in motion. - * - * @return The {@link java.util.UUID} of the object this ability is associated with. + * + * @return The {@link java.util.UUID} of the object this ability is + * associated with. */ UUID getSourceId(); /** * Sets the id of the object which this ability orignates from. - * + * * @param sourceID {@link java.util.UUID} the source id to set. */ void setSourceId(UUID sourceID); /** * Gets all {@link Costs} associated with this ability. - * + * * @return All {@link Costs} associated with this ability. */ Costs getCosts(); @@ -132,25 +138,25 @@ public interface Ability extends Controllable, Serializable { /** * Adds a {@link Cost} to this ability that must be paid before this ability * is activated. - * + * * @param cost The {@link Cost} to add. */ void addCost(Cost cost); /** - * Gets all {@link ManaCosts} associated with this ability. These returned + * Gets all {@link ManaCosts} associated with this ability. These returned * costs should never be modified as they represent the base costs before * any modifications. - * + * * @return All {@link ManaCosts} that must be paid. */ ManaCosts getManaCosts(); /** * Gets all the {@link ManaCosts} that must be paid before activating this - * ability. These costs should be modified by any modification effects currently - * present within the game state. - * + * ability. These costs should be modified by any modification effects + * currently present within the game state. + * * @return All {@link ManaCosts} that must be paid. */ ManaCosts getManaCostsToPay(); @@ -158,52 +164,61 @@ public interface Ability extends Controllable, Serializable { /** * Adds a {@link ManaCost} to this ability that must be paid before this * ability is activated. - * + * * @param cost The {@link ManaCost} to add. */ void addManaCost(ManaCost cost); /** * Gets all {@link AlternativeCost} associated with this ability. - * - * @return All {@link AlternativeCost}'s that can be paid instead of the {@link ManaCosts} + * + * @return All {@link AlternativeCost}'s that can be paid instead of the + * {@link ManaCosts} */ List getAlternativeCosts(); /** * Adds an {@link AlternativeCost} this ability that may be paid instead of * any other cost. - * + * * @param cost The {@link AlternativeCost} to add. */ void addAlternativeCost(AlternativeCost cost); /** * TODO Method is unused, keep it around? - * - * Gets all costs that are optional to this ability. These costs can be paid + * + * Gets all costs that are optional to this ability. These costs can be paid * in addition to other costs to have other effects put into place. - * + * * @return All {@link Costs} that can be paid above and beyond other costs. */ Costs getOptionalCosts(); /** * Adds a {@link Cost} that is optional to this ability. - * + * * @param cost The {@link Cost} to add to the optional costs. */ void addOptionalCost(Cost cost); /** - * Retrieves the effects that are put into the place by the resolution of this - * ability. - * + * Retrieves the effects that are put into the place by the resolution of + * this ability. + * * @return All {@link Effects} that will be put into place by the resolution * of this ability. */ Effects getEffects(); + /** + * Retrieves all effects of an ability. That means effects from all modes + * event those modes that are not seleced (yet). + * + * @return All {@link Effects} of this ability. + */ + Effects getAllEffects(); + /** * Retrieves the effects of the specified {@link EffectType type} that are * put into place by the resolution of this ability. @@ -216,26 +231,28 @@ public interface Ability extends Controllable, Serializable { /** * Adds an effect to this ability. - * + * * @param effect The {@link Effect} to add. */ void addEffect(Effect effect); /** - * Retrieves all targets that must be satisfied before this ability is + * Retrieves all targets that must be satisfied before this ability is put + * onto the stack. + * + * @return All {@link Targets} that must be satisfied before this ability is * put onto the stack. - * - * @return All {@link Targets} that must be satisfied before this ability is put onto - * the stack. */ Targets getTargets(); /** - * Retrieves the {@link Target} located at the 0th index in the {@link Targets}. - * A call to the method is equivalent to {@link #getTargets()}.get(0).getFirstTarget(). - * - * @return The {@link java.util.UUID} of the first target within the targets list. - * + * Retrieves the {@link Target} located at the 0th index in the + * {@link Targets}. A call to the method is equivalent to + * {@link #getTargets()}.get(0).getFirstTarget(). + * + * @return The {@link java.util.UUID} of the first target within the targets + * list. + * * @see mage.target.Target */ UUID getFirstTarget(); @@ -243,53 +260,54 @@ public interface Ability extends Controllable, Serializable { /** * Adds a target to this ability that must be satisfied before this ability * is put onto the stack. - * + * * @param target The {@link Target} to add. */ void addTarget(Target target); /** * Choices - * - * @return + * + * @return */ Choices getChoices(); /** * TODO: Javadoc me - * - * @param choice + * + * @param choice */ void addChoice(Choice choice); /** * Retrieves the {@link Zone} that this ability is active within. - * - * @return + * + * @return */ Zone getZone(); /** * Retrieves whether or not this abilities activation will use the stack. - * - * @return + * + * @return */ boolean isUsesStack(); /** * Retrieves a human readable string representing what the ability states it - * accomplishes. This call is equivalent to {@link #getRule(boolean) getRule(false)} - * + * accomplishes. This call is equivalent to + * {@link #getRule(boolean) getRule(false)} + * * @return A human readable string representing what the ability states it * accomplishes */ String getRule(); /** - * Retrieves a human readable string including any costs associated with this - * ability if the all parameter is true, and just the abilities rule text if - * the all parameter is false. - * + * Retrieves a human readable string including any costs associated with + * this ability if the all parameter is true, and just the abilities rule + * text if the all parameter is false. + * * @param all True if costs are desired in the output, false otherwise. * @return */ @@ -297,51 +315,60 @@ public interface Ability extends Controllable, Serializable { /** * Retrieves the rule associated with the given source. - * + * * @param source - * @return + * @return */ String getRule(String source); /** * Activates this ability prompting the controller to pay any mandatory * {@link Costs} or {@link AlternativeCost} associated with this ability. - * - * @param game A reference the {@link Game} for which this ability should be activated within. + * + * @param game A reference the {@link Game} for which this ability should be + * activated within. * @param noMana Whether or not {@link ManaCosts} have to be paid. * @return True if this ability was successfully activated. - * - * @see mage.players.PlayerImpl#cast(mage.abilities.SpellAbility, mage.game.Game, boolean) - * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, mage.game.Game) - * @see mage.players.PlayerImpl#triggerAbility(mage.abilities.TriggeredAbility, mage.game.Game) + * + * @see mage.players.PlayerImpl#cast(mage.abilities.SpellAbility, + * mage.game.Game, boolean) + * @see mage.players.PlayerImpl#playAbility(mage.abilities.ActivatedAbility, + * mage.game.Game) + * @see + * mage.players.PlayerImpl#triggerAbility(mage.abilities.TriggeredAbility, + * mage.game.Game) */ boolean activate(Game game, boolean noMana); boolean isActivated(); - + /** - * Resolves this ability and puts any effects it produces into play. This - * method should only be called if the {@link #activate(mage.game.Game, boolean)} - * method returned true. - * + * Resolves this ability and puts any effects it produces into play. This + * method should only be called if the + * {@link #activate(mage.game.Game, boolean)} method returned true. + * * @param game The {@link Game} for which this ability resolves within. * @return Whether or not this ability successfully resolved. - * - * @see mage.players.PlayerImpl#playManaAbility(mage.abilities.mana.ManaAbility, mage.game.Game) - * @see mage.players.PlayerImpl#specialAction(mage.abilities.SpecialAction, mage.game.Game) + * + * @see + * mage.players.PlayerImpl#playManaAbility(mage.abilities.mana.ManaAbility, + * mage.game.Game) + * @see mage.players.PlayerImpl#specialAction(mage.abilities.SpecialAction, + * mage.game.Game) */ boolean resolve(Game game); /** * Used to reset the state of this ability. - * - * @param game + * + * @param game */ void reset(Game game); /** - * Overridden by triggered abilities with intervening if clauses - rule 20110715 - 603.4 - * + * Overridden by triggered abilities with intervening if clauses - rule + * 20110715 - 603.4 + * * @param game * @return Whether or not the intervening if clause is satisfied */ @@ -349,7 +376,7 @@ public interface Ability extends Controllable, Serializable { /** * Creates a fresh copy of this ability. - * + * * @return A new copy of this ability. */ Ability copy(); @@ -364,43 +391,47 @@ public interface Ability extends Controllable, Serializable { /** * Gets the list of sub-abilities associated with this ability. - * @return + * + * @return */ List getSubAbilities(); /** * Adds a sub-ability to this ability. - * + * * @param ability The {@link Ability} to add. */ void addSubAbility(Ability ability); List getWatchers(); + void addWatcher(Watcher watcher); - + /** * Returns true if this abilities source is in the zone for the ability - * + * * @param game * @param source * @param event - * @return + * @return */ boolean isInUseableZone(Game game, MageObject source, GameEvent event); /** - * Returns true if the source object has currently the ability - * (e.g. The object can have lost all or some abilities for some time (e.g. Turn to Frog) - * + * Returns true if the source object has currently the ability (e.g. The + * object can have lost all or some abilities for some time (e.g. Turn to + * Frog) + * * @param game * @param source * @param event - * @return + * @return */ boolean hasSourceObjectAbility(Game game, MageObject source, GameEvent event); /** - * Returns true if this ability has to be shown as topmost of all the rules of the object + * Returns true if this ability has to be shown as topmost of all the rules + * of the object * * @return */ @@ -415,10 +446,9 @@ public interface Ability extends Controllable, Serializable { */ void setRuleAtTheTop(boolean ruleAtTheTop); - /** - * Returns true if this ability has to work also with face down object - * (set to not visible normally). + * Returns true if this ability has to work also with face down object (set + * to not visible normally). * * @return */ @@ -439,20 +469,20 @@ public interface Ability extends Controllable, Serializable { * @return */ boolean getRuleVisible(); - /** * Sets the value for the ruleVisible attribute * - * true = rule will be shown for the card / permanent - * false = rule won't be shown + * true = rule will be shown for the card / permanent false = rule won't be + * shown * * @param ruleVisible */ void setRuleVisible(boolean ruleVisible); /** - * Returns true if the additional costs of the abilitiy should be visible on the tooltip text + * Returns true if the additional costs of the abilitiy should be visible on + * the tooltip text * * @return */ @@ -461,35 +491,34 @@ public interface Ability extends Controllable, Serializable { /** * Sets the value for the additional costs rule attribute * - * true = rule will be shown for the card / permanent - * false = rule won't be shown + * true = rule will be shown for the card / permanent false = rule won't be + * shown * * @param ruleAdditionalCostsVisible */ void setAdditionalCostsRuleVisible(boolean ruleAdditionalCostsVisible); - /** * Get the originalId of the ability - * + * * @return originalId */ UUID getOriginalId(); - + /** - * Sets the ability word for the given ability. - * An ability word is a word that, in essence, groups, and reminds players of, cards - * that have a common functionality and does not imply any particular rules. - * + * Sets the ability word for the given ability. An ability word is a word + * that, in essence, groups, and reminds players of, cards that have a + * common functionality and does not imply any particular rules. + * * --- Not usable yet for rule text generation of triggered abilities --- - * - * @param abilityWord + * + * @param abilityWord */ void setAbilityWord(AbilityWord abilityWord); /** - * Creates the message about the ability casting/triggering/activating to post in the game log - * before the ability resolves. + * Creates the message about the ability casting/triggering/activating to + * post in the game log before the ability resolves. * * @param game * @return @@ -497,46 +526,46 @@ public interface Ability extends Controllable, Serializable { String getGameLogMessage(Game game); /** - * Used to deactivate cost modification logic of ability activation for some special handling - * (e.g. FlashbackAbility gets cost modifiaction twice because of how it's handled now) + * Used to deactivate cost modification logic of ability activation for some + * special handling (e.g. FlashbackAbility gets cost modifiaction twice + * because of how it's handled now) * * @param active execute no cost modification */ void setCostModificationActive(boolean active); boolean activateAlternateOrAdditionalCosts(MageObject sourceObject, boolean noMana, Player controller, Game game); - + /** - * Sets the object that actually existed while a ability triggerd or - * an ability was activated. - * - * @param mageObject - * @param game + * Sets the object that actually existed while a ability triggerd or an + * ability was activated. + * + * @param mageObject + * @param game */ void setSourceObject(MageObject mageObject, Game game); - + /** - * Returns the object that actually existed while a ability triggerd or - * an ability was activated. - * If not set yet, the current object will be retrieved from the game. - * + * Returns the object that actually existed while a ability triggerd or an + * ability was activated. If not set yet, the current object will be + * retrieved from the game. + * * @param game - * @return + * @return */ MageObject getSourceObject(Game game); int getSourceObjectZoneChangeCounter(); - + /** - * Returns the object that actually existed while a ability triggerd or - * an ability was activated only if it has not changed zone meanwhile. - * If not set yet, the current object will be retrieved from the game. - * + * Returns the object that actually existed while a ability triggerd or an + * ability was activated only if it has not changed zone meanwhile. If not + * set yet, the current object will be retrieved from the game. + * * @param game - * @return + * @return */ - MageObject getSourceObjectIfItStillExists(Game game); - + String getTargetDescription(Targets targets, Game game); } diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index bc6ccd434b1..c4d7e73616a 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -84,8 +84,8 @@ import org.apache.log4j.Logger; */ public abstract class AbilityImpl implements Ability { - private static final transient Logger logger = Logger.getLogger(AbilityImpl.class); - private static final transient ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(100); + private static final Logger logger = Logger.getLogger(AbilityImpl.class); + private static final ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(100); private static final List emptyWatchers = new ArrayList<>(); private static final List emptyAbilities = new ArrayList<>(); @@ -155,7 +155,7 @@ public abstract class AbilityImpl implements Ability { subAbilities.add(subAbility.copy()); } } - this.modes = ability.modes.copy(); + this.modes = ability.getModes().copy(); this.ruleAtTheTop = ability.ruleAtTheTop; this.ruleVisible = ability.ruleVisible; this.ruleAdditionalCostsVisible = ability.ruleAdditionalCostsVisible; @@ -196,6 +196,7 @@ public abstract class AbilityImpl implements Ability { boolean result = true; //20100716 - 117.12 if (checkIfClause(game)) { + for (Effect effect : getEffects()) { if (effect instanceof OneShotEffect) { boolean effectResult = effect.apply(game, this); @@ -237,6 +238,7 @@ public abstract class AbilityImpl implements Ability { */ if (effect.applyEffectsAfter()) { game.applyEffects(); + game.getState().getTriggers().checkStateTriggers(game); } } } @@ -254,9 +256,14 @@ public abstract class AbilityImpl implements Ability { /* 20130201 - 601.2b * If the spell is modal the player announces the mode choice (see rule 700.2). */ - if (!modes.choose(game, this)) { + if (!getModes().choose(game, this)) { return false; } + if (controller.isTestMode()) { + if (!controller.addTargets(this, game)) { + return false; + } + } getSourceObject(game); @@ -273,9 +280,8 @@ public abstract class AbilityImpl implements Ability { } // TODO: Because all (non targeted) choices have to be done during resolution // this has to be removed, if all using effects are changed - for (UUID modeId : this.getModes().getSelectedModes()) { - this.getModes().setActiveMode(modeId); - if (getChoices().size() > 0 && getChoices().choose(game, this) == false) { + for (Mode mode : this.getModes().getSelectedModes()) { + if (mode.getChoices().size() > 0 && mode.getChoices().choose(game, this) == false) { logger.debug("activate failed - choice"); return false; } @@ -311,9 +317,12 @@ public abstract class AbilityImpl implements Ability { // its mana cost; see rule 107.3), the player announces the value of that variable. VariableManaCost variableManaCost = handleManaXCosts(game, noMana, controller); String announceString = handleOtherXCosts(game, controller); - - for (UUID modeId : this.getModes().getSelectedModes()) { - this.getModes().setActiveMode(modeId); + // For effects from cards like Void Winnower x costs have to be set + if (game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.CAST_SPELL_LATE, getId(), getSourceId(), getControllerId()), this)) { + return false; + } + for (Mode mode : this.getModes().getSelectedModes()) { + this.getModes().setActiveMode(mode); //20121001 - 601.2c // 601.2c The player announces his or her choice of an appropriate player, object, or zone for // each target the spell requires. A spell may require some targets only if an alternative or @@ -334,7 +343,7 @@ public abstract class AbilityImpl implements Ability { if (sourceObject != null && !this.getAbilityType().equals(AbilityType.TRIGGERED)) { // triggered abilities check this already in playerImpl.triggerAbility sourceObject.adjustTargets(this, game); } - if (getTargets().size() > 0 && getTargets().chooseTargets(getEffects().get(0).getOutcome(), this.controllerId, this, game) == false) { + if (mode.getTargets().size() > 0 && mode.getTargets().chooseTargets(getEffects().get(0).getOutcome(), this.controllerId, this, noMana, game) == false) { if ((variableManaCost != null || announceString != null) && !game.isSimulation()) { game.informPlayer(controller, (sourceObject != null ? sourceObject.getIdName() : "") + ": no valid targets with this value of X"); } @@ -407,7 +416,7 @@ public abstract class AbilityImpl implements Ability { } if (variableManaCost != null) { int xValue = getManaCostsToPay().getX(); - game.informPlayers(new StringBuilder(controller.getLogName()).append(" announces a value of ").append(xValue).append(" for ").append(variableManaCost.getText()).toString()); + game.informPlayers(controller.getLogName() + " announces a value of " + xValue + " for " + variableManaCost.getText()); } } activated = true; @@ -444,25 +453,36 @@ public abstract class AbilityImpl implements Ability { public boolean activateAlternateOrAdditionalCosts(MageObject sourceObject, boolean noMana, Player controller, Game game) { boolean alternativeCostisUsed = false; if (sourceObject != null && !(sourceObject instanceof Permanent) && !(this instanceof FlashbackAbility)) { - for (Ability ability : sourceObject.getAbilities()) { - // if cast for noMana no Alternative costs are allowed - if (!noMana && ability instanceof AlternativeSourceCosts) { - AlternativeSourceCosts alternativeSpellCosts = (AlternativeSourceCosts) ability; - if (alternativeSpellCosts.isAvailable(this, game)) { - if (alternativeSpellCosts.askToActivateAlternativeCosts(this, game)) { - // only one alternative costs may be activated - alternativeCostisUsed = true; - break; + Abilities abilities = null; + if (sourceObject instanceof Card) { + abilities = ((Card) sourceObject).getAbilities(game); + } else { + sourceObject.getAbilities(); + } + if (abilities != null) { + for (Ability ability : abilities) { + // if cast for noMana no Alternative costs are allowed + if (!noMana && ability instanceof AlternativeSourceCosts) { + AlternativeSourceCosts alternativeSpellCosts = (AlternativeSourceCosts) ability; + if (alternativeSpellCosts.isAvailable(this, game)) { + if (alternativeSpellCosts.askToActivateAlternativeCosts(this, game)) { + // only one alternative costs may be activated + alternativeCostisUsed = true; + break; + } } } - } - if (ability instanceof OptionalAdditionalSourceCosts) { - ((OptionalAdditionalSourceCosts) ability).addOptionalAdditionalCosts(this, game); + if (ability instanceof OptionalAdditionalSourceCosts) { + ((OptionalAdditionalSourceCosts) ability).addOptionalAdditionalCosts(this, game); + } } } // controller specific alternate spell costs if (!noMana && !alternativeCostisUsed) { - if (this.getAbilityType().equals(AbilityType.SPELL)) { + if (this.getAbilityType().equals(AbilityType.SPELL) + // 117.9a Only one alternative cost can be applied to any one spell as it’s being cast. + // So an alternate spell ability can't be paid with Omniscience + && !((SpellAbility) this).getSpellAbilityType().equals(SpellAbilityType.BASE_ALTERNATE)) { for (AlternativeSourceCosts alternativeSourceCosts : controller.getAlternativeSourceCosts()) { if (alternativeSourceCosts.isAvailable(this, game)) { if (alternativeSourceCosts.askToActivateAlternativeCosts(this, game)) { @@ -496,12 +516,11 @@ public abstract class AbilityImpl implements Ability { // set the xcosts to paid variableCost.setAmount(xValue); ((Cost) variableCost).setPaid(); - String message = new StringBuilder(controller.getLogName()) - .append(" announces a value of ").append(xValue).append(" (").append(variableCost.getActionText()).append(")").toString(); + String message = controller.getLogName() + " announces a value of " + xValue + " (" + variableCost.getActionText() + ")"; if (announceString == null) { announceString = message; } else { - announceString = new StringBuilder(announceString).append(" ").append(message).toString(); + announceString = announceString + " " + message; } } } @@ -669,7 +688,16 @@ public abstract class AbilityImpl implements Ability { @Override public Effects getEffects() { - return modes.getMode().getEffects(); + return getModes().getMode().getEffects(); + } + + @Override + public Effects getAllEffects() { + Effects allEffects = new Effects(); + for (Mode mode : getModes().values()) { + allEffects.addAll(mode.getEffects()); + } + return allEffects; } @Override @@ -685,7 +713,7 @@ public abstract class AbilityImpl implements Ability { @Override public Choices getChoices() { - return modes.getMode().getChoices(); + return getModes().getMode().getChoices(); } @Override @@ -758,23 +786,28 @@ public abstract class AbilityImpl implements Ability { sbRule.append(": "); } } - if (abilityWord != null) { - sbRule.insert(0, new StringBuilder("").append(abilityWord.toString()).append(" — ")); - } - String text = modes.getText(); + + String ruleStart = sbRule.toString(); + String text = getModes().getText(); + String rule; if (!text.isEmpty()) { - if (sbRule.length() > 1) { - String end = sbRule.substring(sbRule.length() - 2).trim(); + if (ruleStart.length() > 1) { + String end = ruleStart.substring(ruleStart.length() - 2).trim(); if (end.isEmpty() || end.equals(":") || end.equals(".")) { - sbRule.append(Character.toUpperCase(text.charAt(0))).append(text.substring(1)); + rule = ruleStart + Character.toUpperCase(text.charAt(0)) + text.substring(1); } else { - sbRule.append(text); + rule = ruleStart + text; } } else { - sbRule.append(text); + rule = ruleStart + text; } + } else { + rule = ruleStart; } - return sbRule.toString(); + if (abilityWord != null) { + rule = "" + abilityWord + " — " + Character.toUpperCase(rule.charAt(0)) + rule.substring(1); + } + return rule; } @Override @@ -847,7 +880,7 @@ public abstract class AbilityImpl implements Ability { @Override public Targets getTargets() { - return modes.getMode().getTargets(); + return getModes().getMode().getTargets(); } @Override @@ -857,12 +890,12 @@ public abstract class AbilityImpl implements Ability { @Override public boolean isModal() { - return this.modes.size() > 1; + return getModes().size() > 1; } @Override public void addMode(Mode mode) { - this.modes.addMode(mode); + getModes().addMode(mode); } @Override @@ -873,9 +906,12 @@ public abstract class AbilityImpl implements Ability { @Override public boolean canChooseTarget(Game game) { int found = 0; - for (Mode mode : modes.values()) { + for (Mode mode : getModes().values()) { if (mode.getTargets().canChoose(sourceId, controllerId, game)) { found++; + if (getModes().isEachModeMoreThanOnce()) { + return true; + } if (found >= getModes().getMinModes()) { return true; } @@ -929,7 +965,10 @@ public abstract class AbilityImpl implements Ability { // for singleton abilities like Flying we can't rely on abilities' source because it's only once in continuous effects // so will use the sourceId of the object itself that came as a parameter if it is not null if (object == null) { - object = game.getObject(getSourceId()); + object = game.getPermanentEntering(getSourceId()); + if (object == null) { + object = game.getObject(getSourceId()); + } } if (object != null && !object.getAbilities().contains(this)) { if (object instanceof Permanent) { @@ -1005,7 +1044,7 @@ public abstract class AbilityImpl implements Ability { logger.warn("Could get no object: " + this.toString()); } return new StringBuilder(" activates: ") - .append(object != null ? this.formatRule(modes.getText(), object.getLogName()) : modes.getText()) + .append(object != null ? this.formatRule(getModes().getText(), object.getLogName()) : getModes().getText()) .append(" from ") .append(getMessageText(game)).toString(); } @@ -1074,13 +1113,15 @@ public abstract class AbilityImpl implements Ability { } } else if (object instanceof Spell && ((Spell) object).getSpellAbility().getModes().size() > 1) { Modes spellModes = ((Spell) object).getSpellAbility().getModes(); - int item = 0; - for (Mode mode : spellModes.values()) { - item++; - if (spellModes.getSelectedModes().contains(mode.getId())) { - spellModes.setActiveMode(mode.getId()); - sb.append(" (mode ").append(item).append(")"); - sb.append(getTargetDescriptionForLog(getTargets(), game)); + for (Mode selectedMode : spellModes.getSelectedModes()) { + int item = 0; + for (Mode mode : spellModes.values()) { + item++; + if (mode.getId().equals(selectedMode.getId())) { + sb.append(" (mode ").append(item).append(")"); + sb.append(getTargetDescriptionForLog(selectedMode.getTargets(), game)); + break; + } } } } else { diff --git a/Mage/src/mage/abilities/Modes.java b/Mage/src/mage/abilities/Modes.java index be01464e4f0..08a317f95cf 100644 --- a/Mage/src/mage/abilities/Modes.java +++ b/Mage/src/mage/abilities/Modes.java @@ -30,7 +30,6 @@ package mage.abilities; import java.util.ArrayList; import java.util.HashSet; import java.util.LinkedHashMap; -import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -50,33 +49,52 @@ import mage.util.CardUtil; */ public class Modes extends LinkedHashMap { - private UUID modeId; - private final Set selectedModes = new LinkedHashSet<>(); + private Mode mode; // the current mode of the selected modes + private final ArrayList selectedModes = new ArrayList<>(); private int minModes; private int maxModes; private TargetController modeChooser; - private boolean eachModeOnlyOnce; // state if each mode can be chosen only once + private boolean eachModeMoreThanOnce; // each mode can be selected multiple times during one choice + private boolean eachModeOnlyOnce; // state if each mode can be chosen only once as long as the source object exists public Modes() { - Mode mode = new Mode(); + this.mode = new Mode(); this.put(mode.getId(), mode); - this.modeId = mode.getId(); this.minModes = 1; this.maxModes = 1; - this.selectedModes.add(modeId); + this.selectedModes.add(mode); this.modeChooser = TargetController.YOU; + this.eachModeOnlyOnce = false; + this.eachModeMoreThanOnce = false; } public Modes(final Modes modes) { - this.modeId = modes.modeId; for (Map.Entry entry : modes.entrySet()) { this.put(entry.getKey(), entry.getValue().copy()); } this.minModes = modes.minModes; this.maxModes = modes.maxModes; - this.selectedModes.addAll(modes.selectedModes); + + if (modes.size() == 1) { + this.mode = values().iterator().next(); + this.selectedModes.add(mode); + } else { + // probably there is still a problem with copying modes with the same mode selected multiple times. + for (Mode selectedMode : modes.getSelectedModes()) { + Mode copiedMode = selectedMode.copy(); + this.selectedModes.add(copiedMode); + if (modes.getSelectedModes().size() == 1) { + this.mode = copiedMode; + } else { + if (selectedMode.equals(modes.getMode())) { + this.mode = copiedMode; + } + } + } + } this.modeChooser = modes.modeChooser; this.eachModeOnlyOnce = modes.eachModeOnlyOnce; + this.eachModeMoreThanOnce = modes.eachModeMoreThanOnce; } public Modes copy() { @@ -84,10 +102,21 @@ public class Modes extends LinkedHashMap { } public Mode getMode() { - return get(modeId); + return mode; } - public Set getSelectedModes() { + public UUID getModeId(int index) { + int idx = 0; + for (Mode currentMode : this.values()) { + idx++; + if (idx == index) { + return currentMode.getId(); + } + } + return null; + } + + public ArrayList getSelectedModes() { return selectedModes; } @@ -115,24 +144,9 @@ public class Modes extends LinkedHashMap { return this.modeChooser; } - public void setActiveMode(UUID modeId) { - if (selectedModes.contains(modeId)) { - this.modeId = modeId; - } - } - - public void setMode(Mode mode) { - if (this.containsKey(mode.getId())) { - this.modeId = mode.getId(); - this.selectedModes.add(mode.getId()); - Set copySelectedModes = new LinkedHashSet<>(); - copySelectedModes.addAll(selectedModes); - selectedModes.clear(); - for (UUID basicModeId : this.keySet()) { - if (copySelectedModes.contains(basicModeId)) { - selectedModes.add(basicModeId); - } - } + public void setActiveMode(Mode mode) { + if (selectedModes.contains(mode)) { + this.mode = mode; } } @@ -153,7 +167,7 @@ public class Modes extends LinkedHashMap { } } // check if all modes can be activated automatically - if (this.size() == this.getMinModes()) { + if (this.size() == this.getMinModes() && !isEachModeMoreThanOnce()) { Set onceSelectedModes = null; if (isEachModeOnlyOnce()) { onceSelectedModes = getAlreadySelectedModes(source, game); @@ -161,7 +175,7 @@ public class Modes extends LinkedHashMap { for (Mode mode : this.values()) { if ((!isEachModeOnlyOnce() || onceSelectedModes == null || !onceSelectedModes.contains(mode.getId())) && mode.getTargets().canChoose(source.getSourceId(), source.getControllerId(), game)) { - this.selectedModes.add(mode.getId()); + this.selectedModes.add(mode.copy()); } } if (isEachModeOnlyOnce()) { @@ -189,6 +203,7 @@ public class Modes extends LinkedHashMap { Player player = game.getPlayer(playerId); // player chooses modes manually + this.mode = null; while (this.selectedModes.size() < this.getMaxModes()) { Mode choice = player.chooseMode(this, source, game); if (choice == null) { @@ -197,28 +212,38 @@ public class Modes extends LinkedHashMap { } return this.selectedModes.size() >= this.getMinModes(); } - setMode(choice); + this.selectedModes.add(choice.copy()); + if (mode == null) { + mode = choice; + } } if (isEachModeOnlyOnce()) { setAlreadySelectedModes(selectedModes, source, game); } return true; } - this.modeId = this.values().iterator().next().getId(); - this.selectedModes.add(modeId); + if (mode == null) { + this.selectedModes.clear(); + Mode copiedMode = this.values().iterator().next().copy(); + this.selectedModes.add(copiedMode); + this.setActiveMode(copiedMode); + } if (isEachModeOnlyOnce()) { setAlreadySelectedModes(selectedModes, source, game); } return true; } - private void setAlreadySelectedModes(Set selectedModes, Ability source, Game game) { + private void setAlreadySelectedModes(ArrayList selectedModes, Ability source, Game game) { String key = getKey(source, game); Set onceSelectedModes = (Set) game.getState().getValue(key); if (onceSelectedModes == null) { onceSelectedModes = new HashSet<>(); } - onceSelectedModes.addAll(selectedModes); + for (Mode mode : selectedModes) { + onceSelectedModes.add(mode.getId()); + } + game.getState().setValue(key, onceSelectedModes); } @@ -232,7 +257,12 @@ public class Modes extends LinkedHashMap { public List getAvailableModes(Ability source, Game game) { List availableModes = new ArrayList<>(); - Set nonAvailableModes = getAlreadySelectedModes(source, game); + Set nonAvailableModes; + if (isEachModeMoreThanOnce()) { + nonAvailableModes = new HashSet<>(); + } else { + nonAvailableModes = getAlreadySelectedModes(source, game); + } for (Mode mode : this.values()) { if (isEachModeOnlyOnce() && nonAvailableModes != null && nonAvailableModes.contains(mode.getId())) { continue; @@ -253,13 +283,19 @@ public class Modes extends LinkedHashMap { sb.append("choose one or both "); } else if (this.getMinModes() == 2 && this.getMaxModes() == 2) { sb.append("choose two "); + } else if (this.getMinModes() == 3 && this.getMaxModes() == 3) { + sb.append("choose three "); } else { sb.append("choose one "); } if (isEachModeOnlyOnce()) { sb.append("that hasn't been chosen "); } - sb.append("—
"); + if (isEachModeMoreThanOnce()) { + sb.append(". You may choose the same mode more than once.
"); + } else { + sb.append("—
"); + } for (Mode mode : this.values()) { sb.append("&bull "); sb.append(mode.getEffects().getTextStartingUpperCase(mode)); @@ -283,4 +319,12 @@ public class Modes extends LinkedHashMap { this.eachModeOnlyOnce = eachModeOnlyOnce; } + public boolean isEachModeMoreThanOnce() { + return eachModeMoreThanOnce; + } + + public void setEachModeMoreThanOnce(boolean eachModeMoreThanOnce) { + this.eachModeMoreThanOnce = eachModeMoreThanOnce; + } + } diff --git a/Mage/src/mage/abilities/PlayLandAbility.java b/Mage/src/mage/abilities/PlayLandAbility.java index 60a60797ccf..602cb8f6f4f 100644 --- a/Mage/src/mage/abilities/PlayLandAbility.java +++ b/Mage/src/mage/abilities/PlayLandAbility.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities; import java.util.UUID; @@ -52,24 +51,24 @@ public class PlayLandAbility extends ActivatedAbilityImpl { @Override public boolean canActivate(UUID playerId, Game game) { - if (!controlsAbility(playerId, game) && - !game.getContinuousEffects().asThough(getSourceId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, playerId, game)) { + if (!controlsAbility(playerId, game) + && !game.getContinuousEffects().asThough(getSourceId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, playerId, game)) { return false; } - //20091005 - 114.2a - return game.canPlaySorcery(playerId) && game.getPlayer(playerId).canPlayLand(); + //20091005 - 114.2a + return game.getActivePlayerId().equals(playerId) && game.getPlayer(playerId).canPlayLand(); } @Override public String getGameLogMessage(Game game) { - return new StringBuilder(" plays ").append(getMessageText(game)).toString(); + return " plays " + getMessageText(game); } @Override public String toString() { return this.name; } - + @Override public String getRule() { return this.name; diff --git a/Mage/src/mage/abilities/SpellAbility.java b/Mage/src/mage/abilities/SpellAbility.java index 1dedf4b81e7..01adf094ffe 100644 --- a/Mage/src/mage/abilities/SpellAbility.java +++ b/Mage/src/mage/abilities/SpellAbility.java @@ -99,10 +99,6 @@ public class SpellAbility extends ActivatedAbilityImpl { && !controllerId.equals(playerId)) { return false; } - // Check if spell has no costs (not {0} mana costs), than it's not castable. E.g. for spells like Living End, that only can be cast by Suspend Ability. - if (this.getManaCosts().isEmpty() && this.getCosts().isEmpty()) { - return false; - } // Check if rule modifying events prevent to cast the spell in check playable mode if (this.isCheckPlayableMode()) { if (game.getContinuousEffects().preventedByRuleModification( @@ -182,4 +178,23 @@ public class SpellAbility extends ActivatedAbilityImpl { return cardName; } + public int getConvertedManaCost() { + int cmc = 0; + int xMultiplier = 0; + for (String symbolString : getManaCosts().getSymbols()) { + int index = symbolString.indexOf("{X}"); + while (index != -1) { + xMultiplier++; + symbolString = symbolString.substring(index + 3); + index = symbolString.indexOf("{X}"); + } + } + if (getSpellAbilityType().equals(SpellAbilityType.BASE_ALTERNATE)) { + cmc += getManaCostsToPay().getX() * xMultiplier; + } else { + cmc += getManaCosts().convertedManaCost() + getManaCostsToPay().getX() * xMultiplier; + } + return cmc; + + } } diff --git a/Mage/src/mage/abilities/StateTriggeredAbility.java b/Mage/src/mage/abilities/StateTriggeredAbility.java index 1c8cfadfb37..45425d8b32c 100644 --- a/Mage/src/mage/abilities/StateTriggeredAbility.java +++ b/Mage/src/mage/abilities/StateTriggeredAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities; import java.util.UUID; @@ -48,8 +47,7 @@ public abstract class StateTriggeredAbility extends TriggeredAbilityImpl { super(ability); } - @Override - public final boolean checkEventType(GameEvent event, Game game) { + public boolean canTrigger(Game game) { //20100716 - 603.8 Boolean triggered = (Boolean) game.getState().getValue(getSourceId().toString() + "triggered"); if (triggered == null) { @@ -58,7 +56,11 @@ public abstract class StateTriggeredAbility extends TriggeredAbilityImpl { return !triggered; } - + @Override + public final boolean checkEventType(GameEvent event, Game game) { + return false; + } + @Override public void trigger(Game game, UUID controllerId) { //20100716 - 603.8 @@ -71,7 +73,7 @@ public abstract class StateTriggeredAbility extends TriggeredAbilityImpl { //20100716 - 603.8 boolean result = super.resolve(game); game.getState().setValue(this.getSourceId().toString() + "triggered", Boolean.FALSE); - return result; + return result; } public void counter(Game game) { diff --git a/Mage/src/mage/abilities/TriggeredAbilities.java b/Mage/src/mage/abilities/TriggeredAbilities.java index 5bf7818a30a..2a9d07b1c99 100644 --- a/Mage/src/mage/abilities/TriggeredAbilities.java +++ b/Mage/src/mage/abilities/TriggeredAbilities.java @@ -43,6 +43,7 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; +import mage.game.stack.Spell; /** * @@ -68,42 +69,57 @@ public class TriggeredAbilities extends ConcurrentHashMap it = this.values().iterator(); it.hasNext();) { + TriggeredAbility ability = it.next(); + if (ability instanceof StateTriggeredAbility && ((StateTriggeredAbility) ability).canTrigger(game)) { + checkTrigger(ability, null, game); + } + } + } + public void checkTriggers(GameEvent event, Game game) { for (Iterator it = this.values().iterator(); it.hasNext();) { TriggeredAbility ability = it.next(); - if (!ability.checkEventType(event, game)) { - continue; + if (ability.checkEventType(event, game)) { + checkTrigger(ability, event, game); } - // for effects like when leaves battlefield or destroyed use ShortLKI to check if permanent was in the correct zone before (e.g. Oblivion Ring or Karmic Justice) - MageObject object = game.getObject(ability.getSourceId()); - if (ability.isInUseableZone(game, object, event)) { - if (!game.getContinuousEffects().preventedByRuleModification(event, ability, game, false)) { - if (object != null) { - boolean controllerSet = false; - if (!ability.getZone().equals(Zone.COMMAND) && event.getTargetId() != null && event.getTargetId().equals(ability.getSourceId()) - && (event.getType().equals(EventType.ZONE_CHANGE) || event.getType().equals(EventType.DESTROYED_PERMANENT))) { - // need to check if object was face down for dies and destroy events because the ability triggers in the new zone, zone counter -1 is used - Permanent permanent = (Permanent) game.getLastKnownInformation(ability.getSourceId(), Zone.BATTLEFIELD, ability.getSourceObjectZoneChangeCounter() - 1); - if (permanent != null) { - if (!ability.getWorksFaceDown() && permanent.isFaceDown(game)) { - continue; - } - controllerSet = true; - ability.setControllerId(permanent.getControllerId()); - } - } - if (!controllerSet) { - if (object instanceof Permanent) { - ability.setControllerId(((Permanent) object).getControllerId()); - } else if (object instanceof Card) { - ability.setControllerId(((Card) object).getOwnerId()); - } - } - } + } + } - if (ability.checkTrigger(event, game)) { - ability.trigger(game, ability.getControllerId()); + private void checkTrigger(TriggeredAbility ability, GameEvent event, Game game) { + // for effects like when leaves battlefield or destroyed use ShortLKI to check if permanent was in the correct zone before (e.g. Oblivion Ring or Karmic Justice) + MageObject object = game.getObject(ability.getSourceId()); + if (ability.isInUseableZone(game, object, event)) { + if (event == null || !game.getContinuousEffects().preventedByRuleModification(event, ability, game, false)) { + if (object != null) { + boolean controllerSet = false; + if (!ability.getZone().equals(Zone.COMMAND) && event != null && event.getTargetId() != null && event.getTargetId().equals(ability.getSourceId()) + && (event.getType().equals(EventType.ZONE_CHANGE) || event.getType().equals(EventType.DESTROYED_PERMANENT) || event.getType().equals(EventType.SACRIFICED_PERMANENT))) { + // need to check if object was face down for dies and destroy events because the ability triggers in the new zone, zone counter -1 is used + Permanent permanent = (Permanent) game.getLastKnownInformation(ability.getSourceId(), Zone.BATTLEFIELD, ability.getSourceObjectZoneChangeCounter() - 1); + if (permanent != null) { + if (!ability.getWorksFaceDown() && permanent.isFaceDown(game)) { + return; + } + controllerSet = true; + ability.setControllerId(permanent.getControllerId()); + } } + if (!controllerSet) { + if (object instanceof Permanent) { + ability.setControllerId(((Permanent) object).getControllerId()); + } else if (object instanceof Spell) { + // needed so that cast triggered abilities have to correct controller (e.g. Ulamog, the Infinite Gyre). + ability.setControllerId(((Spell) object).getControllerId()); + } else if (object instanceof Card) { + ability.setControllerId(((Card) object).getOwnerId()); + } + } + } + + if (ability.checkTrigger(event, game)) { + ability.trigger(game, ability.getControllerId()); } } } diff --git a/Mage/src/mage/abilities/TriggeredAbilityImpl.java b/Mage/src/mage/abilities/TriggeredAbilityImpl.java index 0c9cf7411c5..2db3f564bdd 100644 --- a/Mage/src/mage/abilities/TriggeredAbilityImpl.java +++ b/Mage/src/mage/abilities/TriggeredAbilityImpl.java @@ -77,11 +77,6 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge return true; } - // TODO: Implement for all TriggeredAbilities so this default method can be removed - /*@Override - public boolean checkEventType(GameEvent event, Game game) { - return true; - }*/ @Override public boolean resolve(Game game) { if (isOptional()) { @@ -138,7 +133,8 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge || ruleLow.startsWith("return") || ruleLow.startsWith("tap") || ruleLow.startsWith("untap") - || ruleLow.startsWith("put")) { + || ruleLow.startsWith("put") + || ruleLow.startsWith("remove")) { sb.append("you may "); } else { if (!ruleLow.startsWith("its controller may")) { diff --git a/Mage/src/mage/abilities/abilityword/StriveAbility.java b/Mage/src/mage/abilities/abilityword/StriveAbility.java index cc7c57bd046..8980398bd57 100644 --- a/Mage/src/mage/abilities/abilityword/StriveAbility.java +++ b/Mage/src/mage/abilities/abilityword/StriveAbility.java @@ -68,7 +68,7 @@ public class StriveAbility extends SimpleStaticAbility { @Override public String getRule() { - return new StringBuilder("Strive - {this} costs ").append(striveCost).append(" more to cast for each target beyond the first.").toString(); + return new StringBuilder("Strive - {this} costs ").append(striveCost).append(" more to cast for each target beyond the first.").toString(); } } diff --git a/Mage/src/mage/abilities/common/AllyEntersBattlefieldTriggeredAbility.java b/Mage/src/mage/abilities/common/AllyEntersBattlefieldTriggeredAbility.java index 341e1161952..9252d5d9e0d 100644 --- a/Mage/src/mage/abilities/common/AllyEntersBattlefieldTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/AllyEntersBattlefieldTriggeredAbility.java @@ -27,14 +27,12 @@ */ package mage.abilities.common; -import java.util.UUID; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.constants.Zone; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; /** * @@ -57,11 +55,10 @@ public class AllyEntersBattlefieldTriggeredAbility extends TriggeredAbilityImpl @Override public boolean checkTrigger(GameEvent event, Game game) { - UUID targetId = event.getTargetId(); - Permanent permanent = game.getPermanent(targetId); - if (permanent.getControllerId().equals(this.controllerId) - && (targetId.equals(this.getSourceId()) - || (permanent.hasSubtype("Ally") && !targetId.equals(this.getSourceId())))) { + EntersTheBattlefieldEvent ebe = (EntersTheBattlefieldEvent) event; + if (ebe.getTarget().getControllerId().equals(this.controllerId) + && (event.getTargetId().equals(this.getSourceId()) + || (ebe.getTarget().hasSubtype("Ally") && !event.getTargetId().equals(this.getSourceId())))) { return true; } return false; @@ -69,7 +66,7 @@ public class AllyEntersBattlefieldTriggeredAbility extends TriggeredAbilityImpl @Override public String getRule() { - return "Whenever {this} or another Ally enters the battlefield under your control, " + super.getRule(); + return "Rally — Whenever {this} or another Ally enters the battlefield under your control, " + super.getRule(); } @Override diff --git a/Mage/src/mage/abilities/common/AnotherCreatureEntersBattlefieldTriggeredAbility.java b/Mage/src/mage/abilities/common/AnotherCreatureEntersBattlefieldTriggeredAbility.java index cb67ac5ca14..accd6b22057 100644 --- a/Mage/src/mage/abilities/common/AnotherCreatureEntersBattlefieldTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/AnotherCreatureEntersBattlefieldTriggeredAbility.java @@ -30,8 +30,11 @@ public class AnotherCreatureEntersBattlefieldTriggeredAbility extends TriggeredA @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getTargetId() != this.getSourceId()) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.CREATURE)) { + Permanent permanent = game.getPermanentEntering(event.getTargetId()); + if (permanent == null) { + permanent = game.getPermanent(event.getTargetId()); + } + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { return true; } } diff --git a/Mage/src/mage/abilities/common/AsEntersBattlefieldAbility.java b/Mage/src/mage/abilities/common/AsEntersBattlefieldAbility.java index e41774bf772..d6f0e0fea6a 100644 --- a/Mage/src/mage/abilities/common/AsEntersBattlefieldAbility.java +++ b/Mage/src/mage/abilities/common/AsEntersBattlefieldAbility.java @@ -39,11 +39,11 @@ import mage.constants.Zone; public class AsEntersBattlefieldAbility extends StaticAbility { public AsEntersBattlefieldAbility(Effect effect) { - super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect)); + super(Zone.ALL, new EntersBattlefieldEffect(effect)); } public AsEntersBattlefieldAbility(Effect effect, String text) { - super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect, text)); + super(Zone.ALL, new EntersBattlefieldEffect(effect, text)); } public AsEntersBattlefieldAbility(AsEntersBattlefieldAbility ability) { @@ -59,10 +59,9 @@ public class AsEntersBattlefieldAbility extends StaticAbility { return; } } - super.addEffect(effect); + super.addEffect(effect); } - @Override public AsEntersBattlefieldAbility copy() { return new AsEntersBattlefieldAbility(this); diff --git a/Mage/src/mage/abilities/common/AttacksAloneTriggeredAbility.java b/Mage/src/mage/abilities/common/AttacksAloneTriggeredAbility.java new file mode 100644 index 00000000000..bcbf272c1ec --- /dev/null +++ b/Mage/src/mage/abilities/common/AttacksAloneTriggeredAbility.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.common; + +import java.util.UUID; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LoneFox + */ +public class AttacksAloneTriggeredAbility extends TriggeredAbilityImpl { + + public AttacksAloneTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + } + + public AttacksAloneTriggeredAbility(final AttacksAloneTriggeredAbility ability) { + super(ability); + } + + @Override + public AttacksAloneTriggeredAbility copy() { + return new AttacksAloneTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if(game.getActivePlayerId().equals(this.controllerId) ) { + UUID creatureId = this.getSourceId(); + if(creatureId != null) { + if(game.getCombat().attacksAlone() && creatureId == game.getCombat().getAttackers().get(0)) { + UUID defender = game.getCombat().getDefenderId(creatureId); + if(defender != null) { + for(Effect effect: getEffects()) { + effect.setTargetPointer(new FixedTarget(defender)); + } + } + return true; + } + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} attacks alone, " + super.getRule(); + } +} diff --git a/Mage/src/mage/abilities/common/AttacksAndIsNotBlockedTriggeredAbility.java b/Mage/src/mage/abilities/common/AttacksAndIsNotBlockedTriggeredAbility.java new file mode 100644 index 00000000000..d03ae849027 --- /dev/null +++ b/Mage/src/mage/abilities/common/AttacksAndIsNotBlockedTriggeredAbility.java @@ -0,0 +1,96 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.abilities.common; + +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.combat.CombatGroup; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +public class AttacksAndIsNotBlockedTriggeredAbility extends TriggeredAbilityImpl { + + private boolean setTargetPointer; + + public AttacksAndIsNotBlockedTriggeredAbility(Effect effect) { + this(effect, false, false); + } + + public AttacksAndIsNotBlockedTriggeredAbility(Effect effect, boolean optional) { + this(effect, optional, false); + } + + public AttacksAndIsNotBlockedTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) { + super(Zone.BATTLEFIELD, effect, optional); + this.setTargetPointer = setTargetPointer; + } + + public AttacksAndIsNotBlockedTriggeredAbility(final AttacksAndIsNotBlockedTriggeredAbility ability) { + super(ability); + this.setTargetPointer = ability.setTargetPointer; + } + + @Override + public AttacksAndIsNotBlockedTriggeredAbility copy() { + return new AttacksAndIsNotBlockedTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_BLOCKERS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent sourcePermanent = game.getPermanent(getSourceId()); + if(sourcePermanent.isAttacking()) { + for(CombatGroup combatGroup: game.getCombat().getGroups()) { + if(combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) { + if(setTargetPointer) { + for(Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(game.getCombat().getDefendingPlayerId(getSourceId(), game))); + } + } + return true; + } + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} attacks and isn't blocked, " + super.getRule(); + } +} diff --git a/Mage/src/mage/abilities/common/AttacksEachCombatStaticAbility.java b/Mage/src/mage/abilities/common/AttacksEachCombatStaticAbility.java index adb4be894b1..9f520471526 100644 --- a/Mage/src/mage/abilities/common/AttacksEachCombatStaticAbility.java +++ b/Mage/src/mage/abilities/common/AttacksEachCombatStaticAbility.java @@ -14,7 +14,6 @@ import mage.constants.Zone; * * @author LevelX2 */ - public class AttacksEachCombatStaticAbility extends StaticAbility { public AttacksEachCombatStaticAbility() { diff --git a/Mage/src/mage/abilities/common/AttacksOrBlocksTriggeredAbility.java b/Mage/src/mage/abilities/common/AttacksOrBlocksTriggeredAbility.java index 7c1bb123487..732e6c59a7b 100644 --- a/Mage/src/mage/abilities/common/AttacksOrBlocksTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/AttacksOrBlocksTriggeredAbility.java @@ -2,17 +2,25 @@ package mage.abilities.common; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; public class AttacksOrBlocksTriggeredAbility extends TriggeredAbilityImpl { + + protected String startText = "Whenever"; + public AttacksOrBlocksTriggeredAbility(Effect effect, boolean optional) { super(Zone.BATTLEFIELD, effect, optional); + if (effect instanceof CreateDelayedTriggeredAbilityEffect) { + startText = "When"; + } } public AttacksOrBlocksTriggeredAbility(final AttacksOrBlocksTriggeredAbility ability) { super(ability); + this.startText = ability.startText; } @Override @@ -22,8 +30,9 @@ public class AttacksOrBlocksTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "When {this} attacks or blocks, " + super.getRule(); + return startText + " {this} attacks or blocks, " + super.getRule(); } + @Override public boolean checkEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ATTACKER_DECLARED || event.getType() == GameEvent.EventType.BLOCKER_DECLARED; diff --git a/Mage/src/mage/abilities/common/AttacksTriggeredAbility.java b/Mage/src/mage/abilities/common/AttacksTriggeredAbility.java index c7e021de865..7d25d03291f 100644 --- a/Mage/src/mage/abilities/common/AttacksTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/AttacksTriggeredAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.common; import java.util.UUID; @@ -42,14 +41,14 @@ import mage.target.targetpointer.FixedTarget; * @author BetaSteward_at_googlemail.com */ public class AttacksTriggeredAbility extends TriggeredAbilityImpl { - + protected SetTargetPointer setTargetPointer; protected String text; public AttacksTriggeredAbility(Effect effect, boolean optional) { this(effect, optional, null); } - + public AttacksTriggeredAbility(Effect effect, boolean optional, String text) { this(effect, optional, text, SetTargetPointer.NONE); } @@ -73,12 +72,12 @@ public class AttacksTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (game.getCombat().getAttackers().contains(this.getSourceId()) ) { - switch(setTargetPointer) { + if (game.getCombat().getAttackers().contains(this.getSourceId())) { + switch (setTargetPointer) { case PLAYER: UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game); if (defendingPlayerId != null) { - for (Effect effect: getEffects()) { + for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(defendingPlayerId)); } } @@ -93,7 +92,7 @@ public class AttacksTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { if (text == null || text.isEmpty()) { - return "When {this} attacks, " + super.getRule(); + return "Whenever {this} attacks, " + super.getRule(); } return text; } diff --git a/Mage/src/mage/abilities/common/BecomesTappedAttachedTriggeredAbility.java b/Mage/src/mage/abilities/common/BecomesTappedAttachedTriggeredAbility.java index 3c09bae181c..2b8ef1b3426 100644 --- a/Mage/src/mage/abilities/common/BecomesTappedAttachedTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/BecomesTappedAttachedTriggeredAbility.java @@ -41,16 +41,20 @@ import mage.game.permanent.Permanent; */ public class BecomesTappedAttachedTriggeredAbility extends TriggeredAbilityImpl { - public BecomesTappedAttachedTriggeredAbility(Effect effect, boolean isOptional) { - super(Zone.BATTLEFIELD, effect, isOptional); + private final String description; + + public BecomesTappedAttachedTriggeredAbility(Effect effect, String description) { + this(effect, description, false); } - public BecomesTappedAttachedTriggeredAbility(Effect effect) { - super(Zone.BATTLEFIELD, effect); + public BecomesTappedAttachedTriggeredAbility(Effect effect, String description, boolean isOptional) { + super(Zone.BATTLEFIELD, effect, isOptional); + this.description = description; } public BecomesTappedAttachedTriggeredAbility(final BecomesTappedAttachedTriggeredAbility ability) { super(ability); + this.description = ability.description; } @Override @@ -75,6 +79,6 @@ public class BecomesTappedAttachedTriggeredAbility extends TriggeredAbilityImpl @Override public String getRule() { - return "Whenever enchanted creature becomes tapped, " + super.getRule(); + return "Whenever " + description + " becomes tapped, " + super.getRule(); } } diff --git a/Mage/src/mage/abilities/common/BecomesTappedCreatureControlledTriggeredAbility.java b/Mage/src/mage/abilities/common/BecomesTappedCreatureControlledTriggeredAbility.java deleted file mode 100644 index 4961f8af297..00000000000 --- a/Mage/src/mage/abilities/common/BecomesTappedCreatureControlledTriggeredAbility.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package mage.abilities.common; - -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.Effect; -import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; - -/** - * - * @author Jeff - */ -public class BecomesTappedCreatureControlledTriggeredAbility extends TriggeredAbilityImpl{ - - FilterControlledCreaturePermanent filter; - - public BecomesTappedCreatureControlledTriggeredAbility(Effect effect, boolean optional) { - this(effect, optional, new FilterControlledCreaturePermanent("a creature you control")); - } - public BecomesTappedCreatureControlledTriggeredAbility(Effect effect, boolean optional, FilterControlledCreaturePermanent filter) { - super(Zone.BATTLEFIELD, effect, optional); - this.filter = filter; - } - - public BecomesTappedCreatureControlledTriggeredAbility(final BecomesTappedCreatureControlledTriggeredAbility ability) { - super(ability); - this.filter = ability.filter; - } - - @Override - public BecomesTappedCreatureControlledTriggeredAbility copy() { - return new BecomesTappedCreatureControlledTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent permanent = game.getPermanent(event.getTargetId()); - return permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game); - } - - @Override - public String getRule() { - return "When " + filter.getMessage() + " becomes tapped, " + super.getRule(); - } -} diff --git a/Mage/src/mage/abilities/common/BecomesTappedSourceTriggeredAbility.java b/Mage/src/mage/abilities/common/BecomesTappedSourceTriggeredAbility.java new file mode 100644 index 00000000000..aeab425137c --- /dev/null +++ b/Mage/src/mage/abilities/common/BecomesTappedSourceTriggeredAbility.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.common; + +import mage.constants.Zone; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; + +/** + * + * @author nantuko + */ +public class BecomesTappedSourceTriggeredAbility extends TriggeredAbilityImpl { + + public BecomesTappedSourceTriggeredAbility(Effect effect, boolean isOptional) { + super(Zone.BATTLEFIELD, effect, isOptional); + } + + public BecomesTappedSourceTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + } + + public BecomesTappedSourceTriggeredAbility(final BecomesTappedSourceTriggeredAbility ability) { + super(ability); + } + + @Override + public BecomesTappedSourceTriggeredAbility copy() { + return new BecomesTappedSourceTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.TAPPED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getTargetId().equals(sourceId); + } + + @Override + public String getRule() { + return "When {this} becomes tapped, " + super.getRule(); + } +} diff --git a/Mage/src/mage/abilities/common/BecomesTappedTriggeredAbility.java b/Mage/src/mage/abilities/common/BecomesTappedTriggeredAbility.java index 666e6b1f893..c771945c0ed 100644 --- a/Mage/src/mage/abilities/common/BecomesTappedTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/BecomesTappedTriggeredAbility.java @@ -1,74 +1,56 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.abilities.common; - -import mage.constants.Zone; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.Effect; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; - -/** - * - * @author nantuko - */ -public class BecomesTappedTriggeredAbility extends TriggeredAbilityImpl { - - public BecomesTappedTriggeredAbility(Effect effect, boolean isOptional) { - super(Zone.BATTLEFIELD, effect, isOptional); - } - - public BecomesTappedTriggeredAbility(Effect effect) { - super(Zone.BATTLEFIELD, effect); - } - - public BecomesTappedTriggeredAbility(final BecomesTappedTriggeredAbility ability) { - super(ability); - } - - @Override - public BecomesTappedTriggeredAbility copy() { - return new BecomesTappedTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.TAPPED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return event.getTargetId().equals(sourceId); - } - - @Override - public String getRule() { - return "When {this} becomes tapped, " + super.getRule(); - } -} +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.common; + +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +/** + * + * @author Jeff + */ +public class BecomesTappedTriggeredAbility extends TriggeredAbilityImpl{ + + FilterPermanent filter; + + public BecomesTappedTriggeredAbility(Effect effect, boolean optional) { + this(effect, optional, new FilterPermanent("a permanent")); + } + public BecomesTappedTriggeredAbility(Effect effect, boolean optional, FilterPermanent filter) { + super(Zone.BATTLEFIELD, effect, optional); + this.filter = filter; + } + + public BecomesTappedTriggeredAbility(final BecomesTappedTriggeredAbility ability) { + super(ability); + this.filter = ability.filter.copy(); + } + + @Override + public BecomesTappedTriggeredAbility copy() { + return new BecomesTappedTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.TAPPED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + return permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game); + } + + @Override + public String getRule() { + return "When " + filter.getMessage() + " becomes tapped, " + super.getRule(); + } +} diff --git a/Mage/src/mage/abilities/common/BecomesTargetTriggeredAbility.java b/Mage/src/mage/abilities/common/BecomesTargetTriggeredAbility.java index c80efba2104..8232f7e1b2e 100644 --- a/Mage/src/mage/abilities/common/BecomesTargetTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/BecomesTargetTriggeredAbility.java @@ -27,11 +27,13 @@ */ package mage.abilities.common; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.filter.FilterStackObject; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.stack.StackObject; /** * @@ -39,12 +41,20 @@ import mage.game.events.GameEvent; */ public class BecomesTargetTriggeredAbility extends TriggeredAbilityImpl { + private final FilterStackObject filter; + public BecomesTargetTriggeredAbility(Effect effect) { + this(effect, new FilterStackObject("a spell or ability")); + } + + public BecomesTargetTriggeredAbility(Effect effect, FilterStackObject filter) { super(Zone.BATTLEFIELD, effect); + this.filter = filter.copy(); } public BecomesTargetTriggeredAbility(final BecomesTargetTriggeredAbility ability) { super(ability); + this.filter = ability.filter.copy(); } @Override @@ -59,11 +69,12 @@ public class BecomesTargetTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getTargetId().equals(getSourceId()); + StackObject sourceObject = game.getStack().getStackObject(event.getSourceId()); + return event.getTargetId().equals(getSourceId()) && filter.match(sourceObject, getSourceId(), getControllerId(), game); } @Override public String getRule() { - return "When {this} becomes the target of a spell or ability, " + super.getRule(); + return "When {this} becomes the target of " + filter.getMessage() + ", " + super.getRule(); } } diff --git a/Mage/src/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java b/Mage/src/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java index 2e87b2b424c..a81f7b7d76d 100644 --- a/Mage/src/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/BeginningOfEndStepTriggeredAbility.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.common; import mage.abilities.TriggeredAbilityImpl; @@ -40,6 +39,7 @@ import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; public class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl { + private TargetController targetController; private Condition interveningIfClauseCondition; @@ -91,8 +91,9 @@ public class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl { } return true; } - break; + break; case ANY: + case NEXT: if (getTargets().size() == 0) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); @@ -128,15 +129,17 @@ public class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl { public String getRule() { StringBuilder sb = new StringBuilder(getEffects().getText(modes.getMode())); if (this.optional) { - if (sb.substring(0, 6).toLowerCase().equals("target")){ + if (sb.substring(0, 6).toLowerCase().equals("target")) { sb.insert(0, "you may have "); - } else if (!sb.substring(0, 4).toLowerCase().equals("you ")){ + } else if (!sb.substring(0, 4).toLowerCase().equals("you ")) { sb.insert(0, "you may "); } } switch (targetController) { case YOU: return sb.insert(0, generateConditionString()).insert(0, "At the beginning of your end step, ").toString(); + case NEXT: + return sb.insert(0, generateConditionString()).insert(0, "At the beginning of the end step, ").toString(); case OPPONENT: return sb.insert(0, generateConditionString()).insert(0, "At the beginning of each opponent's end step, ").toString(); case ANY: diff --git a/Mage/src/mage/abilities/common/BlocksOrBecomesBlockedByCreatureTriggeredAbility.java b/Mage/src/mage/abilities/common/BlocksOrBecomesBlockedByCreatureTriggeredAbility.java index 88c172b7a1b..b4231f41b10 100644 --- a/Mage/src/mage/abilities/common/BlocksOrBecomesBlockedByCreatureTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/BlocksOrBecomesBlockedByCreatureTriggeredAbility.java @@ -30,8 +30,11 @@ package mage.abilities.common; import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; /** @@ -40,19 +43,29 @@ import mage.target.targetpointer.FixedTarget; */ public class BlocksOrBecomesBlockedByCreatureTriggeredAbility extends TriggeredAbilityImpl { + // note that this is using the Filter#match(E e, Game game), + // not FilterInPlay#(E o, UUID sourceId, UUID playerId, Game game) + // this triggers on both blocked and blocking, so source and player don't have a consistent definition + protected FilterPermanent filter; protected String rule; public BlocksOrBecomesBlockedByCreatureTriggeredAbility(Effect effect, boolean optional) { - this(effect, optional, null); + this(effect, new FilterCreaturePermanent(), optional, null); } - public BlocksOrBecomesBlockedByCreatureTriggeredAbility(Effect effect, boolean optional, String rule) { + public BlocksOrBecomesBlockedByCreatureTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional) { + this(effect, filter, optional, null); + } + + public BlocksOrBecomesBlockedByCreatureTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional, String rule) { super(Zone.BATTLEFIELD, effect, optional); + this.filter = filter; this.rule = rule; } public BlocksOrBecomesBlockedByCreatureTriggeredAbility(final BlocksOrBecomesBlockedByCreatureTriggeredAbility ability) { super(ability); + this.filter = ability.filter; this.rule = ability.rule; } @@ -64,16 +77,22 @@ public class BlocksOrBecomesBlockedByCreatureTriggeredAbility extends TriggeredA @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getSourceId().equals(this.getSourceId())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); + Permanent blocked = game.getPermanent(event.getTargetId()); + if (blocked != null && filter.match(blocked, game)) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + } + return true; } - return true; } if (event.getTargetId().equals(this.getSourceId())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getSourceId())); + Permanent blocker = game.getPermanent(event.getSourceId()); + if (blocker != null && filter.match(blocker, game)) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); + } + return true; } - return true; } return false; } @@ -83,7 +102,7 @@ public class BlocksOrBecomesBlockedByCreatureTriggeredAbility extends TriggeredA if (rule != null) { return rule; } - return "Whenever {this} blocks or becomes blocked by a creature, " + super.getRule(); + return "Whenever {this} blocks or becomes blocked by a " + filter.getMessage() + ", " + super.getRule(); } @Override diff --git a/Mage/src/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java b/Mage/src/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java index 38f3642e8a7..429f9c34340 100644 --- a/Mage/src/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DealsCombatDamageToAPlayerTriggeredAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,16 +20,16 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.abilities.common; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -72,7 +72,7 @@ public class DealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility if (event.getSourceId().equals(getSourceId()) && ((DamagedPlayerEvent) event).isCombatDamage()) { if (setTargetPointer) { - for (Effect effect : this.getEffects()) { + for (Effect effect : this.getAllEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); effect.setValue("damage", event.getAmount()); } diff --git a/Mage/src/mage/abilities/common/DealsDamageToAPlayerAllTriggeredAbility.java b/Mage/src/mage/abilities/common/DealsDamageToAPlayerAllTriggeredAbility.java index 69ac883329d..a06bfef568d 100644 --- a/Mage/src/mage/abilities/common/DealsDamageToAPlayerAllTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DealsDamageToAPlayerAllTriggeredAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.common; import mage.abilities.TriggeredAbilityImpl; @@ -43,8 +42,8 @@ import mage.target.targetpointer.FixedTarget; * * @author LevelX2 */ - public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImpl { + private final FilterPermanent filter; private final SetTargetPointer setTargetPointer; private final boolean onlyCombat; @@ -81,12 +80,12 @@ public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImp if (!setTargetPointer.equals(SetTargetPointer.NONE)) { for (Effect effect : this.getEffects()) { effect.setValue("damage", event.getAmount()); - switch(setTargetPointer) { + switch (setTargetPointer) { case PLAYER: effect.setTargetPointer(new FixedTarget(permanent.getControllerId())); break; case PERMANENT: - effect.setTargetPointer(new FixedTarget(permanent.getId())); + effect.setTargetPointer(new FixedTarget(permanent.getId(), permanent.getZoneChangeCounter(game))); break; } @@ -100,7 +99,7 @@ public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImp @Override public String getRule() { - return "Whenever " + filter.getMessage() + " deals "+(onlyCombat ? "combat ":"") + "damage to a player, " + super.getRule(); + return "Whenever " + filter.getMessage() + " deals " + (onlyCombat ? "combat " : "") + "damage to a player, " + super.getRule(); } } diff --git a/Mage/src/mage/abilities/common/DealsDamageToOpponentTriggeredAbility.java b/Mage/src/mage/abilities/common/DealsDamageToOpponentTriggeredAbility.java index 2641d757ed9..3f9f5d30f06 100644 --- a/Mage/src/mage/abilities/common/DealsDamageToOpponentTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DealsDamageToOpponentTriggeredAbility.java @@ -31,7 +31,6 @@ import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.constants.Zone; import mage.game.Game; -import mage.game.events.DamagePlayerEvent; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; import mage.target.targetpointer.FixedTarget; @@ -41,24 +40,30 @@ import mage.target.targetpointer.FixedTarget; */ public class DealsDamageToOpponentTriggeredAbility extends TriggeredAbilityImpl { - boolean onlyCombat; + private final boolean onlyCombat, setTargetPointer; public DealsDamageToOpponentTriggeredAbility(Effect effect) { - this(effect, false, false); - } + this(effect, false, false, false); + } public DealsDamageToOpponentTriggeredAbility(Effect effect, boolean optional) { - this(effect, optional, false); + this(effect, optional, false, false); } public DealsDamageToOpponentTriggeredAbility(Effect effect, boolean optional, boolean onlyCombat) { + this(effect, optional, onlyCombat, false); + } + + public DealsDamageToOpponentTriggeredAbility(Effect effect, boolean optional, boolean onlyCombat, boolean setTargetPointer) { super(Zone.BATTLEFIELD, effect, optional); this.onlyCombat = onlyCombat; + this.setTargetPointer = setTargetPointer; } public DealsDamageToOpponentTriggeredAbility(final DealsDamageToOpponentTriggeredAbility ability) { super(ability); this.onlyCombat = ability.onlyCombat; + this.setTargetPointer = ability.setTargetPointer; } @Override @@ -81,9 +86,11 @@ public class DealsDamageToOpponentTriggeredAbility extends TriggeredAbilityImpl return false; } } - for (Effect effect : getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - effect.setValue("damage", event.getAmount()); + if(setTargetPointer) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + effect.setValue("damage", event.getAmount()); + } } return true; } diff --git a/Mage/src/mage/abilities/common/DiesAttachedTriggeredAbility.java b/Mage/src/mage/abilities/common/DiesAttachedTriggeredAbility.java index 78fc74d57c1..d623e85a579 100644 --- a/Mage/src/mage/abilities/common/DiesAttachedTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DiesAttachedTriggeredAbility.java @@ -1,21 +1,26 @@ package mage.abilities.common; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; /** * "When enchanted/equipped creature dies" triggered ability + * * @author Loki */ public class DiesAttachedTriggeredAbility extends TriggeredAbilityImpl { - + private String attachedDescription; private boolean diesRuleText; - + protected SetTargetPointer setTargetPointer; + public DiesAttachedTriggeredAbility(Effect effect, String attachedDescription) { this(effect, attachedDescription, false); } @@ -25,16 +30,21 @@ public class DiesAttachedTriggeredAbility extends TriggeredAbilityImpl { } public DiesAttachedTriggeredAbility(Effect effect, String attachedDescription, boolean optional, boolean diesRuleText) { + this(effect, attachedDescription, optional, diesRuleText, SetTargetPointer.NONE); + } + + public DiesAttachedTriggeredAbility(Effect effect, String attachedDescription, boolean optional, boolean diesRuleText, SetTargetPointer setTargetPointer) { super(Zone.ALL, effect, optional); // because the trigger only triggers if the object was attached, it doesn't matter where the Attachment was moved to (e.g. by replacement effect) after the trigger triggered, so Zone.all this.attachedDescription = attachedDescription; this.diesRuleText = diesRuleText; + this.setTargetPointer = setTargetPointer; } - public DiesAttachedTriggeredAbility(final DiesAttachedTriggeredAbility ability) { super(ability); this.attachedDescription = ability.attachedDescription; this.diesRuleText = ability.diesRuleText; + this.setTargetPointer = ability.setTargetPointer; } @Override @@ -49,11 +59,38 @@ public class DiesAttachedTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (((ZoneChangeEvent)event).isDiesEvent()) { + if (((ZoneChangeEvent) event).isDiesEvent()) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + boolean triggered = false; if (zEvent.getTarget().getAttachments().contains(this.getSourceId())) { + triggered = true; + } else { + // If both (attachment and attached went to graveyard at the same time, the attachemnets can be already removed from the attached object.) + // So check here with the LKI of the enchantment + Permanent attachment = game.getPermanentOrLKIBattlefield(getSourceId()); + if (attachment != null + && zEvent.getTargetId() != null && attachment.getAttachedTo() != null + && zEvent.getTargetId().equals(attachment.getAttachedTo())) { + Permanent attachedTo = game.getPermanentOrLKIBattlefield(attachment.getAttachedTo()); + if (attachedTo != null + && attachment.getAttachedToZoneChangeCounter() == attachedTo.getZoneChangeCounter(game)) { // zoneChangeCounter is stored in Permanent + triggered = true; + } + } + } + if (triggered) { for (Effect effect : getEffects()) { effect.setValue("attachedTo", zEvent.getTarget()); + if (setTargetPointer.equals(SetTargetPointer.ATTACHED_TO_CONTROLLER)) { + Permanent attachment = game.getPermanentOrLKIBattlefield(getSourceId()); + if (attachment != null && attachment.getAttachedTo() != null) { + Permanent attachedTo = (Permanent) game.getLastKnownInformation(attachment.getAttachedTo(), Zone.BATTLEFIELD, attachment.getAttachedToZoneChangeCounter()); + if (attachedTo != null) { + effect.setTargetPointer(new FixedTarget(attachedTo.getControllerId())); + } + } + + } } return true; } diff --git a/Mage/src/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java b/Mage/src/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java index 2e8aefd917d..1ea17bda77d 100644 --- a/Mage/src/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java @@ -28,9 +28,9 @@ package mage.abilities.common; import mage.MageObject; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; @@ -49,7 +49,7 @@ public class DiesThisOrAnotherCreatureTriggeredAbility extends TriggeredAbilityI } public DiesThisOrAnotherCreatureTriggeredAbility(Effect effect, boolean optional, FilterCreaturePermanent filter) { - super(Zone.BATTLEFIELD, effect, optional); + super(Zone.ALL, effect, optional); // Needs "ALL" if the source itself should trigger or multiple (incl. source go to grave) this.filter = filter; } @@ -67,38 +67,37 @@ public class DiesThisOrAnotherCreatureTriggeredAbility extends TriggeredAbilityI public boolean checkEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ZONE_CHANGE; } - + @Override public boolean isInUseableZone(Game game, MageObject source, GameEvent event) { - Permanent sourcePermanent; + Permanent sourcePermanent = null; if (game.getState().getZone(getSourceId()) == Zone.BATTLEFIELD) { sourcePermanent = game.getPermanent(getSourceId()); } else { - sourcePermanent = (Permanent) game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD); + if (game.getShortLivingLKI(sourceId, Zone.BATTLEFIELD)) { + sourcePermanent = (Permanent) game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD); + } } if (sourcePermanent == null) { return false; } return hasSourceObjectAbility(game, sourcePermanent, event); } - + @Override public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (game.getPermanent(sourceId) == null) { - if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) { - return false; - } + if (game.getPermanentOrLKIBattlefield(getSourceId()) == null) { + return false; } if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { - Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null) { - if (permanent.getId().equals(this.getSourceId())) { + if (zEvent.getTarget() != null) { + if (zEvent.getTarget().getId().equals(this.getSourceId())) { return true; } else { - if (filter.match(permanent, sourceId, controllerId, game)) { + if (filter.match(zEvent.getTarget(), sourceId, controllerId, game)) { return true; } } diff --git a/Mage/src/mage/abilities/common/DiesTriggeredAbility.java b/Mage/src/mage/abilities/common/DiesTriggeredAbility.java index aac46fbe9d8..04a19c3c971 100644 --- a/Mage/src/mage/abilities/common/DiesTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DiesTriggeredAbility.java @@ -71,7 +71,7 @@ public class DiesTriggeredAbility extends ZoneChangeTriggeredAbility { if (super.checkEventType(event, game)) { return ((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD) && ((ZoneChangeEvent) event).getToZone().equals(Zone.GRAVEYARD); } - return event.getType() == GameEvent.EventType.ZONE_CHANGE; + return false; } @Override @@ -89,7 +89,7 @@ public class DiesTriggeredAbility extends ZoneChangeTriggeredAbility { } } for (Effect effect : getEffects()) { - effect.setValue("diedPermanent", zEvent.getTarget()); + effect.setValue("permanentLeftBattlefield", zEvent.getTarget()); } return true; } diff --git a/Mage/src/mage/abilities/common/DiscardsACardOpponentTriggeredAbility.java b/Mage/src/mage/abilities/common/DiscardsACardOpponentTriggeredAbility.java index 866245a65e4..d6dc5bfc459 100644 --- a/Mage/src/mage/abilities/common/DiscardsACardOpponentTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DiscardsACardOpponentTriggeredAbility.java @@ -6,10 +6,11 @@ package mage.abilities.common; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; +import mage.target.targetpointer.FixedTarget; /** * @@ -17,12 +18,20 @@ import mage.game.events.GameEvent.EventType; */ public class DiscardsACardOpponentTriggeredAbility extends TriggeredAbilityImpl { + private SetTargetPointer setTargetPointer; + public DiscardsACardOpponentTriggeredAbility(Effect effect, Boolean isOptional) { + this(effect, isOptional, SetTargetPointer.NONE); + } + + public DiscardsACardOpponentTriggeredAbility(Effect effect, Boolean isOptional, SetTargetPointer setTargetPointer) { super(Zone.BATTLEFIELD, effect, isOptional); + this.setTargetPointer = setTargetPointer; } public DiscardsACardOpponentTriggeredAbility(final DiscardsACardOpponentTriggeredAbility ability) { super(ability); + this.setTargetPointer = ability.setTargetPointer; } @Override @@ -37,7 +46,21 @@ public class DiscardsACardOpponentTriggeredAbility extends TriggeredAbilityImpl @Override public boolean checkTrigger(GameEvent event, Game game) { - return game.getOpponents(controllerId).contains(event.getPlayerId()); + if (game.getOpponents(controllerId).contains(event.getPlayerId())) { + switch (setTargetPointer) { + case PLAYER: + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); + } + break; + case NONE: + break; + default: + throw new UnsupportedOperationException(setTargetPointer.toString() + " not supported for this ability."); + } + return true; + } + return false; } @Override diff --git a/Mage/src/mage/abilities/common/EntersBattlefieldAbility.java b/Mage/src/mage/abilities/common/EntersBattlefieldAbility.java index fa51f390540..40231800591 100644 --- a/Mage/src/mage/abilities/common/EntersBattlefieldAbility.java +++ b/Mage/src/mage/abilities/common/EntersBattlefieldAbility.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.common; import mage.abilities.StaticAbility; @@ -41,39 +40,50 @@ import mage.constants.Zone; public class EntersBattlefieldAbility extends StaticAbility { protected String abilityRule; - + protected boolean optional; + public EntersBattlefieldAbility(Effect effect) { - this(effect, true); + this(effect, false); } -/** - * - * @param effect effect that happens when the permanent enters the battlefield - * @param showRule show the rule for this ability - */ - public EntersBattlefieldAbility(Effect effect, Boolean showRule) { - this(effect, null, showRule, null, null); + + /** + * + * @param effect effect that happens when the permanent enters the + * battlefiely + * @param optional + */ + public EntersBattlefieldAbility(Effect effect, boolean optional) { + this(effect, optional, null, null, null); } public EntersBattlefieldAbility(Effect effect, String effectText) { - this(effect, null, true, null, effectText); + this(effect, null, null, effectText); } -/** - * - * @param effect effect that happens when the permanent enters the battlefield - * @param condition only if this condition is true, the effect will happen - * @param ruleVisible show the rule for this ability - * @param abilityRule rule for this ability (no text from effects will be added) - * @param effectText this text will be used for the EnterBattlefieldEffect - */ - public EntersBattlefieldAbility(Effect effect, Condition condition, Boolean ruleVisible, String abilityRule, String effectText) { - super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect, condition, effectText)); - this.setRuleVisible(ruleVisible); + + public EntersBattlefieldAbility(Effect effect, Condition condition, String abilityRule, String effectText) { + this(effect, false, condition, abilityRule, effectText); + } + + /** + * + * @param effect effect that happens when the permanent enters the + * battlefield + * @param optional + * @param condition only if this condition is true, the effect will happen + * @param abilityRule rule for this ability (no text from effects will be + * added) + * @param effectText this text will be used for the EnterBattlefieldEffect + */ + public EntersBattlefieldAbility(Effect effect, boolean optional, Condition condition, String abilityRule, String effectText) { + super(Zone.ALL, new EntersBattlefieldEffect(effect, condition, effectText, true, optional)); this.abilityRule = abilityRule; + this.optional = optional; } public EntersBattlefieldAbility(final EntersBattlefieldAbility ability) { super(ability); this.abilityRule = ability.abilityRule; + this.optional = ability.optional; } @Override @@ -95,12 +105,9 @@ public class EntersBattlefieldAbility extends StaticAbility { @Override public String getRule() { - if (!ruleVisible) { - return ""; - } if (abilityRule != null && !abilityRule.isEmpty()) { return abilityRule; } - return "{this} enters the battlefield " + super.getRule(); + return (optional ? "you may have " : "") + "{this} enter" + (optional ? "" : "s") + " the battlefield " + super.getRule(); } } diff --git a/Mage/src/mage/abilities/common/EntersBattlefieldTappedAbility.java b/Mage/src/mage/abilities/common/EntersBattlefieldTappedAbility.java index 1d8d119f17c..f62f02ab29e 100644 --- a/Mage/src/mage/abilities/common/EntersBattlefieldTappedAbility.java +++ b/Mage/src/mage/abilities/common/EntersBattlefieldTappedAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,18 +20,17 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.common; -import mage.constants.Zone; import mage.abilities.StaticAbility; import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.TapSourceEffect; +import mage.constants.Zone; /** * @@ -40,9 +39,9 @@ import mage.abilities.effects.common.TapSourceEffect; public class EntersBattlefieldTappedAbility extends StaticAbility { private String ruleText; - + public EntersBattlefieldTappedAbility() { - super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new TapSourceEffect(true))); + super(Zone.ALL, new EntersBattlefieldEffect(new TapSourceEffect(true))); } public EntersBattlefieldTappedAbility(String ruleText) { diff --git a/Mage/src/mage/abilities/common/EntersBattlefieldTriggeredAbility.java b/Mage/src/mage/abilities/common/EntersBattlefieldTriggeredAbility.java index ddaf6be2b8a..528a8c65c10 100644 --- a/Mage/src/mage/abilities/common/EntersBattlefieldTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/EntersBattlefieldTriggeredAbility.java @@ -27,9 +27,9 @@ */ package mage.abilities.common; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; @@ -73,7 +73,7 @@ public class EntersBattlefieldTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getTargetId().equals(getSourceId()); + return event.getTargetId().equals(getSourceId()); } @Override @@ -81,7 +81,7 @@ public class EntersBattlefieldTriggeredAbility extends TriggeredAbilityImpl { if (noRule) { return super.getRule(); } - return (rulePrefix != null ? rulePrefix : "") + "When {this} enters the battlefield, "+ super.getRule(); + return (rulePrefix != null ? rulePrefix : "") + "When {this} enters the battlefield, " + super.getRule(); } @Override diff --git a/Mage/src/mage/abilities/common/LandfallAbility.java b/Mage/src/mage/abilities/common/LandfallAbility.java index db19efb0ffd..6e8651d8f00 100644 --- a/Mage/src/mage/abilities/common/LandfallAbility.java +++ b/Mage/src/mage/abilities/common/LandfallAbility.java @@ -1,40 +1,41 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.common; -import mage.constants.CardType; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.constants.CardType; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; /** * @@ -42,16 +43,26 @@ import mage.game.permanent.Permanent; */ public class LandfallAbility extends TriggeredAbilityImpl { + protected SetTargetPointer setTargetPointer; + protected Permanent triggeringLand; + public LandfallAbility(Effect effect, boolean optional) { - this(Zone.BATTLEFIELD, effect, optional); + this(Zone.BATTLEFIELD, effect, optional); } - public LandfallAbility (Zone zone, Effect effect, Boolean optional ) { + public LandfallAbility(Zone zone, Effect effect, Boolean optional) { + this(zone, effect, optional, SetTargetPointer.NONE); + } + + public LandfallAbility(Zone zone, Effect effect, Boolean optional, SetTargetPointer setTargetPointer) { super(zone, effect, optional); + this.setTargetPointer = setTargetPointer; } public LandfallAbility(final LandfallAbility ability) { super(ability); + this.setTargetPointer = ability.setTargetPointer; + this.triggeringLand = ability.triggeringLand; } @Override @@ -62,7 +73,18 @@ public class LandfallAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - return permanent != null && permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId); + if (permanent != null + && permanent.getCardType().contains(CardType.LAND) + && permanent.getControllerId().equals(this.controllerId)) { + triggeringLand = permanent; + if (setTargetPointer.equals(SetTargetPointer.PERMANENT)) { + for (Effect effect : getAllEffects()) { + effect.setTargetPointer(new FixedTarget(permanent, game)); + } + } + return true; + } + return false; } @Override @@ -75,4 +97,7 @@ public class LandfallAbility extends TriggeredAbilityImpl { return new LandfallAbility(this); } + public Permanent getTriggeringPermanent() { + return triggeringLand; + } } diff --git a/Mage/src/mage/abilities/common/LeavesBattlefieldTriggeredAbility.java b/Mage/src/mage/abilities/common/LeavesBattlefieldTriggeredAbility.java index 48ba332c550..23a867af0dd 100644 --- a/Mage/src/mage/abilities/common/LeavesBattlefieldTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/LeavesBattlefieldTriggeredAbility.java @@ -1,36 +1,37 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.common; import mage.abilities.effects.Effect; import mage.constants.Zone; - +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; /** * @@ -46,6 +47,17 @@ public class LeavesBattlefieldTriggeredAbility extends ZoneChangeTriggeredAbilit super(ability); } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (super.checkTrigger(event, game)) { + for (Effect effect : getEffects()) { + effect.setValue("permanentLeftBattlefield", ((ZoneChangeEvent) event).getTarget()); + } + return true; + } + return false; + } + @Override public LeavesBattlefieldTriggeredAbility copy() { return new LeavesBattlefieldTriggeredAbility(this); diff --git a/Mage/src/mage/abilities/common/LicidAbility.java b/Mage/src/mage/abilities/common/LicidAbility.java index a321266836d..bdc12b0b6cf 100644 --- a/Mage/src/mage/abilities/common/LicidAbility.java +++ b/Mage/src/mage/abilities/common/LicidAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.common; import java.util.UUID; @@ -42,6 +41,7 @@ import mage.abilities.effects.common.CreateSpecialActionEffect; import mage.abilities.effects.common.RemoveSpecialActionEffect; import mage.abilities.keyword.EnchantAbility; import mage.constants.CardType; +import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; @@ -76,25 +76,25 @@ public class LicidAbility extends ActivatedAbilityImpl { } class LicidEffect extends OneShotEffect { - + private final ManaCost specialActionCost; - + LicidEffect(ManaCost specialActionCost) { super(Outcome.Neutral); this.specialActionCost = specialActionCost; this.staticText = "{this} loses this ability and becomes an Aura enchantment with enchant creature. Attach it to target creature. You may pay " + specialActionCost.getText() + " to end this effect"; } - + LicidEffect(final LicidEffect effect) { super(effect); this.specialActionCost = effect.specialActionCost; } - + @Override public LicidEffect copy() { return new LicidEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Permanent licid = (Permanent) source.getSourceObjectIfItStillExists(game); @@ -113,15 +113,16 @@ class LicidEffect extends OneShotEffect { } class LicidContinuousEffect extends ContinuousEffectImpl { - + private final UUID messageId; - + LicidContinuousEffect(UUID messageId) { super(Duration.Custom, Outcome.Neutral); this.messageId = messageId; + dependencyTypes.add(DependencyType.AuraAddingRemoving); } - LicidContinuousEffect(LicidContinuousEffect ability) { + LicidContinuousEffect(final LicidContinuousEffect ability) { super(ability); this.messageId = ability.messageId; } @@ -201,28 +202,28 @@ class LicidSpecialAction extends SpecialAction { } class LicidSpecialActionEffect extends OneShotEffect { - + private final UUID messageId; private final UUID generatingSpecialActionId; - + LicidSpecialActionEffect(UUID messageId, UUID generatingSpecialActionId, String licidName) { super(Outcome.Neutral); this.messageId = messageId; this.generatingSpecialActionId = generatingSpecialActionId; this.staticText = "End " + licidName + " Effect"; } - + LicidSpecialActionEffect(final LicidSpecialActionEffect effect) { super(effect); this.messageId = effect.messageId; this.generatingSpecialActionId = effect.generatingSpecialActionId; } - + @Override public LicidSpecialActionEffect copy() { return new LicidSpecialActionEffect(this); } - + @Override public boolean apply(Game game, Ability source) { new RemoveSpecialActionEffect(this.generatingSpecialActionId).apply(game, source); diff --git a/Mage/src/mage/abilities/common/LimitedTimesPerTurnActivatedAbility.java b/Mage/src/mage/abilities/common/LimitedTimesPerTurnActivatedAbility.java index 53d40539031..a415bb19a18 100644 --- a/Mage/src/mage/abilities/common/LimitedTimesPerTurnActivatedAbility.java +++ b/Mage/src/mage/abilities/common/LimitedTimesPerTurnActivatedAbility.java @@ -71,16 +71,17 @@ public class LimitedTimesPerTurnActivatedAbility extends ActivatedAbilityImpl { @Override public boolean canActivate(UUID playerId, Game game) { - if (super.canActivate(playerId, game)) { - ActivationInfo activationInfo = getActivationInfo(game); - return activationInfo == null || activationInfo.turnNum != game.getTurnNum() || activationInfo.activationCounter < maxActivationsPerTurn; - } - return false; + return super.canActivate(playerId, game) && hasMoreActivationsThisTurn(game); + } + + private boolean hasMoreActivationsThisTurn(Game game) { + ActivationInfo activationInfo = getActivationInfo(game); + return activationInfo == null || activationInfo.turnNum != game.getTurnNum() || activationInfo.activationCounter < maxActivationsPerTurn; } @Override public boolean activate(Game game, boolean noMana) { - if (canActivate(this.controllerId, game)) { + if (hasMoreActivationsThisTurn(game)) { if (super.activate(game, noMana)) { ActivationInfo activationInfo = getActivationInfo(game); if (activationInfo == null) { diff --git a/Mage/src/mage/abilities/common/PayMoreToCastAsThoughtItHadFlashAbility.java b/Mage/src/mage/abilities/common/PayMoreToCastAsThoughtItHadFlashAbility.java index 7045c08433b..d36f220ea0a 100644 --- a/Mage/src/mage/abilities/common/PayMoreToCastAsThoughtItHadFlashAbility.java +++ b/Mage/src/mage/abilities/common/PayMoreToCastAsThoughtItHadFlashAbility.java @@ -6,6 +6,7 @@ package mage.abilities.common; import mage.abilities.SpellAbility; +import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; import mage.cards.Card; import mage.constants.SpellAbilityType; @@ -21,7 +22,7 @@ public class PayMoreToCastAsThoughtItHadFlashAbility extends SpellAbility { private final ManaCosts costsToAdd; - public PayMoreToCastAsThoughtItHadFlashAbility(Card card, ManaCosts costsToAdd) { + public PayMoreToCastAsThoughtItHadFlashAbility(Card card, ManaCosts costsToAdd) { super(card.getSpellAbility().getManaCosts().copy(), card.getName() + " as though it had flash", Zone.HAND, SpellAbilityType.BASE_ALTERNATE); this.costsToAdd = costsToAdd; this.timing = TimingRule.INSTANT; diff --git a/Mage/src/mage/abilities/common/PlanswalkerEntersWithLoyalityCountersAbility.java b/Mage/src/mage/abilities/common/PlanswalkerEntersWithLoyalityCountersAbility.java new file mode 100644 index 00000000000..05e208b0815 --- /dev/null +++ b/Mage/src/mage/abilities/common/PlanswalkerEntersWithLoyalityCountersAbility.java @@ -0,0 +1,30 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.common; + +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.counters.CounterType; + +/** + * + * @author LevelX2 + */ +public class PlanswalkerEntersWithLoyalityCountersAbility extends EntersBattlefieldAbility { + + public PlanswalkerEntersWithLoyalityCountersAbility(int loyality) { + super(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(loyality))); + setRuleVisible(false); + } + + public PlanswalkerEntersWithLoyalityCountersAbility(final PlanswalkerEntersWithLoyalityCountersAbility ability) { + super(ability); + } + + @Override + public PlanswalkerEntersWithLoyalityCountersAbility copy() { + return new PlanswalkerEntersWithLoyalityCountersAbility(this); + } +} diff --git a/Mage/src/mage/abilities/common/PutIntoGraveFromAnywhereSourceTriggeredAbility.java b/Mage/src/mage/abilities/common/PutIntoGraveFromAnywhereSourceTriggeredAbility.java index 96fae22b3b7..4a2ec10503a 100644 --- a/Mage/src/mage/abilities/common/PutIntoGraveFromAnywhereSourceTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/PutIntoGraveFromAnywhereSourceTriggeredAbility.java @@ -7,6 +7,7 @@ import mage.constants.Zone; * @author Loki */ public class PutIntoGraveFromAnywhereSourceTriggeredAbility extends ZoneChangeTriggeredAbility { + public PutIntoGraveFromAnywhereSourceTriggeredAbility(Effect effect, boolean optional) { super(Zone.GRAVEYARD, effect, "When {this} is put into a graveyard from anywhere, ", optional); } diff --git a/Mage/src/mage/abilities/common/PutIntoGraveFromBattlefieldAllTriggeredAbility.java b/Mage/src/mage/abilities/common/PutIntoGraveFromBattlefieldAllTriggeredAbility.java index 45b41aec3ef..835cfeb2c2d 100644 --- a/Mage/src/mage/abilities/common/PutIntoGraveFromBattlefieldAllTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/PutIntoGraveFromBattlefieldAllTriggeredAbility.java @@ -60,7 +60,7 @@ public class PutIntoGraveFromBattlefieldAllTriggeredAbility extends TriggeredAbi public PutIntoGraveFromBattlefieldAllTriggeredAbility(final PutIntoGraveFromBattlefieldAllTriggeredAbility ability) { super(ability); this.filter = ability.filter; - this.onlyToControllerGraveyard = ability.onlyToControllerGraveyard; + this.onlyToControllerGraveyard = ability.onlyToControllerGraveyard; this.setTargetPointer = ability.setTargetPointer; } @@ -73,8 +73,11 @@ public class PutIntoGraveFromBattlefieldAllTriggeredAbility extends TriggeredAbi public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD - && zEvent.getToZone() == Zone.GRAVEYARD) { + && zEvent.getToZone() == Zone.GRAVEYARD) { if (filter.match(zEvent.getTarget(), this.getSourceId(), this.getControllerId(), game)) { + if(onlyToControllerGraveyard && !this.getControllerId().equals(game.getOwnerId(zEvent.getTargetId()))) { + return false; + } if (setTargetPointer) { for (Effect effect :this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); diff --git a/Mage/src/mage/abilities/common/SacrificeIfCastAtInstantTimeTriggeredAbility.java b/Mage/src/mage/abilities/common/SacrificeIfCastAtInstantTimeTriggeredAbility.java new file mode 100644 index 00000000000..6941a1b66b1 --- /dev/null +++ b/Mage/src/mage/abilities/common/SacrificeIfCastAtInstantTimeTriggeredAbility.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.abilities.common; + +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.delayed.AtTheBeginOfNextCleanupDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; + +/** + * + * @author Lonefox + */ +public class SacrificeIfCastAtInstantTimeTriggeredAbility extends TriggeredAbilityImpl { + + public SacrificeIfCastAtInstantTimeTriggeredAbility() { + super(Zone.STACK, new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextCleanupDelayedTriggeredAbility(new SacrificeSourceEffect()))); + } + + public SacrificeIfCastAtInstantTimeTriggeredAbility(final SacrificeIfCastAtInstantTimeTriggeredAbility ability) { + super(ability); + } + + @Override + public SacrificeIfCastAtInstantTimeTriggeredAbility copy() { + return new SacrificeIfCastAtInstantTimeTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + // The sacrifice occurs only if you cast it using its own ability. If you cast it using some other + // effect (for instance, if it gained flash from Vedalken Orrery), then it won't be sacrificed. + // CHECK + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getSourceId().equals(getSourceId())) { + return !(game.isMainPhase() && game.getActivePlayerId().equals(event.getPlayerId()) && game.getStack().size() == 1); + } + return false; + } + + @Override + public String getRule() { + return "If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step."; + } +} + diff --git a/Mage/src/mage/abilities/common/SpellCastAllTriggeredAbility.java b/Mage/src/mage/abilities/common/SpellCastAllTriggeredAbility.java index 51882dc3bbd..4b552ae9ed0 100644 --- a/Mage/src/mage/abilities/common/SpellCastAllTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/SpellCastAllTriggeredAbility.java @@ -86,10 +86,10 @@ public class SpellCastAllTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && filter.match(spell, getControllerId(), game)) { + if (spell != null && filter.match(spell, getSourceId(), getControllerId(), game)) { if (!setTargetPointer.equals(SetTargetPointer.NONE)) { for (Effect effect : this.getEffects()) { - switch(setTargetPointer) { + switch (setTargetPointer) { case SPELL: effect.setTargetPointer(new FixedTarget(spell.getId())); break; diff --git a/Mage/src/mage/abilities/common/SpellCastControllerTriggeredAbility.java b/Mage/src/mage/abilities/common/SpellCastControllerTriggeredAbility.java index 471bda4c7ec..d576a13690a 100644 --- a/Mage/src/mage/abilities/common/SpellCastControllerTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/SpellCastControllerTriggeredAbility.java @@ -47,7 +47,8 @@ public class SpellCastControllerTriggeredAbility extends TriggeredAbilityImpl { protected String rule; /** - * If true, the source that triggered the ability will be set as target to effect. + * If true, the source that triggered the ability will be set as target to + * effect. */ protected boolean rememberSource = false; @@ -58,7 +59,7 @@ public class SpellCastControllerTriggeredAbility extends TriggeredAbilityImpl { public SpellCastControllerTriggeredAbility(Effect effect, FilterSpell filter, boolean optional) { this(effect, filter, optional, false); } - + public SpellCastControllerTriggeredAbility(Effect effect, FilterSpell filter, boolean optional, String rule) { this(effect, filter, optional, false); this.rule = rule; @@ -90,7 +91,7 @@ public class SpellCastControllerTriggeredAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game) { if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && filter.match(spell, getControllerId(), game)) { + if (spell != null && filter.match(spell, getSourceId(), getControllerId(), game)) { if (rememberSource) { this.getEffects().get(0).setTargetPointer(new FixedTarget(spell.getId())); } diff --git a/Mage/src/mage/abilities/common/delayed/AtTheBeginOMainPhaseDelayedTriggeredAbility.java b/Mage/src/mage/abilities/common/delayed/AtTheBeginOfMainPhaseDelayedTriggeredAbility.java similarity index 89% rename from Mage/src/mage/abilities/common/delayed/AtTheBeginOMainPhaseDelayedTriggeredAbility.java rename to Mage/src/mage/abilities/common/delayed/AtTheBeginOfMainPhaseDelayedTriggeredAbility.java index 4017e25c576..d1cd7427c41 100644 --- a/Mage/src/mage/abilities/common/delayed/AtTheBeginOMainPhaseDelayedTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/delayed/AtTheBeginOfMainPhaseDelayedTriggeredAbility.java @@ -1,149 +1,149 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.abilities.common.delayed; - -import mage.constants.TargetController; -import mage.abilities.DelayedTriggeredAbility; -import mage.abilities.effects.Effect; -import mage.constants.Duration; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; - -/** - * - * @author LevelX2 - */ -public class AtTheBeginOMainPhaseDelayedTriggeredAbility extends DelayedTriggeredAbility { - - public enum PhaseSelection { - - NEXT_PRECOMBAT_MAIN("next precombat"), - NEXT_POSTCOMAT_MAIN("next postcombat"), - NEXT_MAIN("next"); - - private final String text; - - PhaseSelection(String text) { - this.text = text; - } - - @Override - public String toString() { - return text; - } - } - - private final TargetController targetController; - private final PhaseSelection phaseSelection; - - - public AtTheBeginOMainPhaseDelayedTriggeredAbility(Effect effect, boolean optional, TargetController targetController, PhaseSelection phaseSelection) { - super(effect, Duration.EndOfGame, true, optional); - this.targetController = targetController; - this.phaseSelection = phaseSelection; - - } - - public AtTheBeginOMainPhaseDelayedTriggeredAbility(final AtTheBeginOMainPhaseDelayedTriggeredAbility ability) { - super(ability); - this.targetController = ability.targetController; - this.phaseSelection = ability.phaseSelection; - } - - @Override - public AtTheBeginOMainPhaseDelayedTriggeredAbility copy() { - return new AtTheBeginOMainPhaseDelayedTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return checkPhase(event.getType()); - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - switch (targetController) { - case ANY: - return true; - case YOU: - boolean yours = event.getPlayerId().equals(this.controllerId); - return yours; - case OPPONENT: - if (game.getPlayer(this.getControllerId()).hasOpponent(event.getPlayerId(), game)) { - return true; - } - break; - - case CONTROLLER_ATTACHED_TO: - Permanent attachment = game.getPermanent(sourceId); - if (attachment != null && attachment.getAttachedTo() != null) { - Permanent attachedTo = game.getPermanent(attachment.getAttachedTo()); - if (attachedTo != null && attachedTo.getControllerId().equals(event.getPlayerId())) { - return true; - } - } - } - return false; - } - - private boolean checkPhase(EventType eventType) { - switch (phaseSelection) { - case NEXT_MAIN: - return EventType.PRECOMBAT_MAIN_PHASE_PRE.equals(eventType) || EventType.POSTCOMBAT_MAIN_PHASE_PRE.equals(eventType); - case NEXT_POSTCOMAT_MAIN: - return EventType.POSTCOMBAT_MAIN_PHASE_PRE.equals(eventType); - case NEXT_PRECOMBAT_MAIN: - return EventType.PRECOMBAT_MAIN_PHASE_PRE.equals(eventType); - default: - return false; - } - } - - @Override - public String getRule() { - StringBuilder sb = new StringBuilder(); - switch (targetController) { - case YOU: - sb.append("At the beginning of your ").append(phaseSelection.toString()).append(" main phase, "); - break; - case OPPONENT: - sb.append("At the beginning of an opponent's ").append(phaseSelection.toString()).append(" main phase, "); - break; - case ANY: - sb.append("At the beginning of the ").append(phaseSelection.toString()).append(" main phase, "); - break; - case CONTROLLER_ATTACHED_TO: - sb.append("At the beginning of the ").append(phaseSelection.toString()).append(" main phase of enchanted creature's controller, "); - break; - } - sb.append(getEffects().getText(modes.getMode())); - return sb.toString(); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.common.delayed; + +import mage.constants.TargetController; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.constants.Duration; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class AtTheBeginOfMainPhaseDelayedTriggeredAbility extends DelayedTriggeredAbility { + + public enum PhaseSelection { + + NEXT_PRECOMBAT_MAIN("next precombat"), + NEXT_POSTCOMAT_MAIN("next postcombat"), + NEXT_MAIN("next"); + + private final String text; + + PhaseSelection(String text) { + this.text = text; + } + + @Override + public String toString() { + return text; + } + } + + private final TargetController targetController; + private final PhaseSelection phaseSelection; + + + public AtTheBeginOfMainPhaseDelayedTriggeredAbility(Effect effect, boolean optional, TargetController targetController, PhaseSelection phaseSelection) { + super(effect, Duration.EndOfGame, true, optional); + this.targetController = targetController; + this.phaseSelection = phaseSelection; + + } + + public AtTheBeginOfMainPhaseDelayedTriggeredAbility(final AtTheBeginOfMainPhaseDelayedTriggeredAbility ability) { + super(ability); + this.targetController = ability.targetController; + this.phaseSelection = ability.phaseSelection; + } + + @Override + public AtTheBeginOfMainPhaseDelayedTriggeredAbility copy() { + return new AtTheBeginOfMainPhaseDelayedTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return checkPhase(event.getType()); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + switch (targetController) { + case ANY: + return true; + case YOU: + boolean yours = event.getPlayerId().equals(this.controllerId); + return yours; + case OPPONENT: + if (game.getPlayer(this.getControllerId()).hasOpponent(event.getPlayerId(), game)) { + return true; + } + break; + + case CONTROLLER_ATTACHED_TO: + Permanent attachment = game.getPermanent(sourceId); + if (attachment != null && attachment.getAttachedTo() != null) { + Permanent attachedTo = game.getPermanent(attachment.getAttachedTo()); + if (attachedTo != null && attachedTo.getControllerId().equals(event.getPlayerId())) { + return true; + } + } + } + return false; + } + + private boolean checkPhase(EventType eventType) { + switch (phaseSelection) { + case NEXT_MAIN: + return EventType.PRECOMBAT_MAIN_PHASE_PRE.equals(eventType) || EventType.POSTCOMBAT_MAIN_PHASE_PRE.equals(eventType); + case NEXT_POSTCOMAT_MAIN: + return EventType.POSTCOMBAT_MAIN_PHASE_PRE.equals(eventType); + case NEXT_PRECOMBAT_MAIN: + return EventType.PRECOMBAT_MAIN_PHASE_PRE.equals(eventType); + default: + return false; + } + } + + @Override + public String getRule() { + StringBuilder sb = new StringBuilder(); + switch (targetController) { + case YOU: + sb.append("At the beginning of your ").append(phaseSelection.toString()).append(" main phase, "); + break; + case OPPONENT: + sb.append("At the beginning of an opponent's ").append(phaseSelection.toString()).append(" main phase, "); + break; + case ANY: + sb.append("At the beginning of the ").append(phaseSelection.toString()).append(" main phase, "); + break; + case CONTROLLER_ATTACHED_TO: + sb.append("At the beginning of the ").append(phaseSelection.toString()).append(" main phase of enchanted creature's controller, "); + break; + } + sb.append(getEffects().getText(modes.getMode())); + return sb.toString(); + } +} diff --git a/Mage/src/mage/abilities/common/delayed/OnLeaveReturnExiledToBattlefieldAbility.java b/Mage/src/mage/abilities/common/delayed/OnLeaveReturnExiledToBattlefieldAbility.java index 62e94044571..3d61104c9ad 100644 --- a/Mage/src/mage/abilities/common/delayed/OnLeaveReturnExiledToBattlefieldAbility.java +++ b/Mage/src/mage/abilities/common/delayed/OnLeaveReturnExiledToBattlefieldAbility.java @@ -27,13 +27,12 @@ */ package mage.abilities.common.delayed; -import java.util.LinkedList; +import java.util.LinkedHashSet; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Zone; @@ -50,9 +49,9 @@ import mage.util.CardUtil; * Returns the exiled cards/permanents as source leaves battlefield * * Uses no stack + * * @author LevelX2 */ - public class OnLeaveReturnExiledToBattlefieldAbility extends DelayedTriggeredAbility { public OnLeaveReturnExiledToBattlefieldAbility() { @@ -108,22 +107,12 @@ class ReturnExiledPermanentsEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (sourceObject != null && controller != null) { - int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() -1; + int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() - 1; UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter); if (exileZone != null) { ExileZone exile = game.getExile().getExileZone(exileZone); if (exile != null) { - LinkedList cards = new LinkedList<>(exile); - for (UUID cardId : cards) { - Card card = game.getCard(cardId); - if (card != null) { - Player owner = game.getPlayer(card.getOwnerId()); - if (owner != null && owner.isInGame()) { - owner.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); - } - } - } - exile.clear(); + controller.moveCards(new LinkedHashSet<>(exile.getCards(game)), Zone.BATTLEFIELD, source, game, false, false, true, null); } return true; } diff --git a/Mage/src/mage/abilities/condition/common/CastFromHandCondition.java b/Mage/src/mage/abilities/condition/common/CastFromHandCondition.java index 27811130bdc..1abc7306f5f 100644 --- a/Mage/src/mage/abilities/condition/common/CastFromHandCondition.java +++ b/Mage/src/mage/abilities/condition/common/CastFromHandCondition.java @@ -12,10 +12,14 @@ import mage.watchers.Watcher; * @author Loki */ public class CastFromHandCondition implements Condition { + @Override public boolean apply(Game game, Ability source) { - Permanent p = game.getPermanent(source.getSourceId()); - if (p != null) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent == null) { + permanent = game.getPermanentEntering(source.getSourceId()); + } + if (permanent != null) { Watcher watcher = game.getState().getWatchers().get("CastFromHand", source.getSourceId()); if (watcher != null && watcher.conditionMet()) { return true; @@ -29,5 +33,4 @@ public class CastFromHandCondition implements Condition { return "you cast it from your hand"; } - } diff --git a/Mage/src/mage/abilities/condition/common/CommanderInPlayCondition.java b/Mage/src/mage/abilities/condition/common/CommanderInPlayCondition.java index 26196743f86..1a7e9fc3938 100644 --- a/Mage/src/mage/abilities/condition/common/CommanderInPlayCondition.java +++ b/Mage/src/mage/abilities/condition/common/CommanderInPlayCondition.java @@ -30,11 +30,11 @@ package mage.abilities.condition.common; import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.players.Player; - /** - * Checks if the player has its commander in play + * Checks if the player has its commander in play and controls it * * @author LevelX2 */ @@ -42,7 +42,8 @@ public class CommanderInPlayCondition implements Condition { private static CommanderInPlayCondition fInstance = null; - private CommanderInPlayCondition() {} + private CommanderInPlayCondition() { + } public static Condition getInstance() { if (fInstance == null) { @@ -55,7 +56,8 @@ public class CommanderInPlayCondition implements Condition { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - return game.getPermanent(controller.getCommanderId()) != null; + Permanent commander = game.getPermanent(controller.getCommanderId()); + return commander != null && commander.getControllerId().equals(source.getControllerId()); } return false; } @@ -65,4 +67,4 @@ public class CommanderInPlayCondition implements Condition { return "As long as you control your commander"; } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/condition/common/EnchantedTargetCondition.java b/Mage/src/mage/abilities/condition/common/EnchantedTargetCondition.java index ccdc65b27aa..98cd2632909 100644 --- a/Mage/src/mage/abilities/condition/common/EnchantedTargetCondition.java +++ b/Mage/src/mage/abilities/condition/common/EnchantedTargetCondition.java @@ -1,8 +1,6 @@ - package mage.abilities.condition.common; import java.util.UUID; - import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.constants.CardType; @@ -15,8 +13,8 @@ import mage.target.Target; * @author Jeff */ public class EnchantedTargetCondition implements Condition { - - private static EnchantedTargetCondition fInstance = new EnchantedTargetCondition(); + + private static final EnchantedTargetCondition fInstance = new EnchantedTargetCondition(); public static Condition getInstance() { return fInstance; diff --git a/Mage/src/mage/abilities/condition/common/HellbentCondition.java b/Mage/src/mage/abilities/condition/common/HellbentCondition.java index 598c207fd4d..842e960e508 100644 --- a/Mage/src/mage/abilities/condition/common/HellbentCondition.java +++ b/Mage/src/mage/abilities/condition/common/HellbentCondition.java @@ -43,4 +43,9 @@ public class HellbentCondition implements Condition { public boolean apply(Game game, Ability source) { return game.getPlayer(source.getControllerId()).getHand().size() == 0; } + + @Override + public String toString() { + return "if you have no cards in hand"; + } } diff --git a/Mage/src/mage/abilities/condition/common/MorbidCondition.java b/Mage/src/mage/abilities/condition/common/MorbidCondition.java index 04de2a9aec9..22a4bc7a74c 100644 --- a/Mage/src/mage/abilities/condition/common/MorbidCondition.java +++ b/Mage/src/mage/abilities/condition/common/MorbidCondition.java @@ -49,4 +49,9 @@ public class MorbidCondition implements Condition { return watcher.conditionMet(); } + @Override + public String toString() { + return "if a creature died this turn"; + } + } diff --git a/Mage/src/mage/abilities/condition/common/NotMyTurnCondition.java b/Mage/src/mage/abilities/condition/common/NotMyTurnCondition.java index c7940eeed00..6a1755e773c 100644 --- a/Mage/src/mage/abilities/condition/common/NotMyTurnCondition.java +++ b/Mage/src/mage/abilities/condition/common/NotMyTurnCondition.java @@ -33,7 +33,7 @@ import mage.abilities.condition.Condition; import mage.game.Game; public class NotMyTurnCondition implements Condition { - + private static final NotMyTurnCondition fInstance = new NotMyTurnCondition(); public static Condition getInstance() { @@ -48,4 +48,9 @@ public class NotMyTurnCondition implements Condition { } return false; } + + @Override + public String toString() { + return "if it's not your turn"; + } } diff --git a/Mage/src/mage/abilities/condition/common/OpponentControllsMoreCondition.java b/Mage/src/mage/abilities/condition/common/OpponentControlsMoreCondition.java similarity index 92% rename from Mage/src/mage/abilities/condition/common/OpponentControllsMoreCondition.java rename to Mage/src/mage/abilities/condition/common/OpponentControlsMoreCondition.java index 8a8183af340..f4a0ccc106e 100644 --- a/Mage/src/mage/abilities/condition/common/OpponentControllsMoreCondition.java +++ b/Mage/src/mage/abilities/condition/common/OpponentControlsMoreCondition.java @@ -39,11 +39,11 @@ import mage.game.Game; * @author LevelX2 */ -public class OpponentControllsMoreCondition implements Condition { +public class OpponentControlsMoreCondition implements Condition { private final FilterPermanent filter; - public OpponentControllsMoreCondition(FilterPermanent filter) { + public OpponentControlsMoreCondition(FilterPermanent filter) { this.filter = filter; } diff --git a/Mage/src/mage/abilities/costs/AlternativeCost2Impl.java b/Mage/src/mage/abilities/costs/AlternativeCost2Impl.java index b6b73034a93..b69b73b278c 100644 --- a/Mage/src/mage/abilities/costs/AlternativeCost2Impl.java +++ b/Mage/src/mage/abilities/costs/AlternativeCost2Impl.java @@ -25,20 +25,18 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.costs; import mage.game.Game; /** * Alternative costs - * + * * @author LevelX2 - * + * * @param */ - -public class AlternativeCost2Impl > extends CostsImpl implements AlternativeCost2 { +public class AlternativeCost2Impl> extends CostsImpl implements AlternativeCost2 { protected String name; protected String reminderText; @@ -72,6 +70,7 @@ public class AlternativeCost2Impl > extends Co public String getName() { return this.name; } + /** * Returns the complete text for the addional cost or if onlyCost is true * only the pure text for the included native cost @@ -84,7 +83,7 @@ public class AlternativeCost2Impl > extends Co if (onlyCost) { return getText(); } else { - return new StringBuffer(name != null ? name: "").append(delimiter != null ? delimiter: "").append(getText()).toString(); + return (name != null ? name : "") + (delimiter != null ? delimiter : "") + getText(); } } @@ -103,20 +102,20 @@ public class AlternativeCost2Impl > extends Co } /** - * Returns a text suffix for the game log, that can be added to - * the cast message. + * Returns a text suffix for the game log, that can be added to the cast + * message. * - * @param position - if there are multiple costs, it's the postion the cost is set (starting with 0) + * @param position - if there are multiple costs, it's the postion the cost + * is set (starting with 0) * @return */ @Override public String getCastSuffixMessage(int position) { - StringBuilder sb = new StringBuilder(position > 0 ? " and ":"").append(" with "); + StringBuilder sb = new StringBuilder(position > 0 ? " and " : "").append(" with "); sb.append(name); - return sb.toString(); + return sb.toString(); } - /** * If the player intends to pay the cost, the cost will be activated * @@ -124,7 +123,7 @@ public class AlternativeCost2Impl > extends Co @Override public void activate() { activated = true; - }; + } /** * Reset the activate and count information @@ -142,9 +141,11 @@ public class AlternativeCost2Impl > extends Co * @return */ @Override - public boolean isActivated(Game game){ + public boolean isActivated(Game game) { return activated; - }; + } + + ; @Override public AlternativeCost2Impl copy() { diff --git a/Mage/src/mage/abilities/costs/AlternativeCostSourceAbility.java b/Mage/src/mage/abilities/costs/AlternativeCostSourceAbility.java index 5fb7fd20f90..be4893b1b45 100644 --- a/Mage/src/mage/abilities/costs/AlternativeCostSourceAbility.java +++ b/Mage/src/mage/abilities/costs/AlternativeCostSourceAbility.java @@ -29,6 +29,7 @@ package mage.abilities.costs; import java.util.Iterator; import mage.abilities.Ability; +import mage.abilities.SpellAbility; import mage.abilities.StaticAbility; import mage.abilities.condition.Condition; import mage.abilities.costs.mana.ManaCost; @@ -39,6 +40,7 @@ import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; +import mage.util.CardUtil; /** * @@ -145,28 +147,39 @@ public class AlternativeCostSourceAbility extends StaticAbility implements Alter } Player player = game.getPlayer(ability.getControllerId()); if (player != null) { - Costs alternativeCosts; + Costs alternativeCostsToCheck; if (dynamicCost != null) { - alternativeCosts = new CostsImpl<>(); - alternativeCosts.add(convertToAlternativeCost(dynamicCost.getCost(ability, game))); + alternativeCostsToCheck = new CostsImpl<>(); + alternativeCostsToCheck.add(convertToAlternativeCost(dynamicCost.getCost(ability, game))); } else { - alternativeCosts = this.alternateCosts; + alternativeCostsToCheck = this.alternateCosts; } String costChoiceText; if (dynamicCost != null) { costChoiceText = dynamicCost.getText(ability, game); } else { - costChoiceText = alternativeCosts.isEmpty() ? "Cast without paying its mana cost?" : "Pay alternative costs? (" + alternativeCosts.getText() + ")"; + costChoiceText = alternativeCostsToCheck.isEmpty() ? "Cast without paying its mana cost?" : "Pay alternative costs? (" + alternativeCostsToCheck.getText() + ")"; } - if (alternativeCosts.canPay(ability, ability.getSourceId(), ability.getControllerId(), game) + if (alternativeCostsToCheck.canPay(ability, ability.getSourceId(), ability.getControllerId(), game) && player.chooseUse(Outcome.Benefit, costChoiceText, this, game)) { - ability.getManaCostsToPay().clear(); + if (ability instanceof SpellAbility) { + for (Iterator iterator = ability.getManaCostsToPay().iterator(); iterator.hasNext();) { + ManaCost manaCost = iterator.next(); + if (manaCost instanceof VariableCost) { + iterator.remove(); + } + } + CardUtil.reduceCost((SpellAbility) ability, ability.getManaCosts()); + + } else { + ability.getManaCostsToPay().clear(); + } if (!onlyMana) { ability.getCosts().clear(); } - for (Cost cost : alternativeCosts) { + for (Cost cost : alternativeCostsToCheck) { AlternativeCost2 alternateCost = (AlternativeCost2) cost; alternateCost.activate(); for (Iterator it = ((Costs) alternateCost).iterator(); it.hasNext();) { @@ -190,14 +203,14 @@ public class AlternativeCostSourceAbility extends StaticAbility implements Alter @Override public boolean isActivated(Ability source, Game game) { - Costs alternativeCosts; + Costs alternativeCostsToCheck; if (dynamicCost != null) { - alternativeCosts = new CostsImpl<>(); - alternativeCosts.add(convertToAlternativeCost(dynamicCost.getCost(source, game))); + alternativeCostsToCheck = new CostsImpl<>(); + alternativeCostsToCheck.add(convertToAlternativeCost(dynamicCost.getCost(source, game))); } else { - alternativeCosts = this.alternateCosts; + alternativeCostsToCheck = this.alternateCosts; } - for (AlternativeCost2 cost : alternativeCosts) { + for (AlternativeCost2 cost : alternativeCostsToCheck) { if (cost.isActivated(game)) { return true; } diff --git a/Mage/src/mage/abilities/costs/CompositeCost.java b/Mage/src/mage/abilities/costs/CompositeCost.java index f76693fb185..1d497d43793 100644 --- a/Mage/src/mage/abilities/costs/CompositeCost.java +++ b/Mage/src/mage/abilities/costs/CompositeCost.java @@ -1,14 +1,14 @@ package mage.abilities.costs; +import java.util.UUID; import mage.abilities.Ability; import mage.game.Game; import mage.target.Targets; -import java.util.UUID; - public class CompositeCost implements Cost { - private Cost firstCost; - private Cost secondCost; + + private final Cost firstCost; + private final Cost secondCost; private String description; public CompositeCost(Cost firstCost, Cost secondCost, String description) { @@ -28,6 +28,11 @@ public class CompositeCost implements Cost { throw new RuntimeException("Not supported method"); } + @Override + public void setText(String text) { + this.description = text; + } + @Override public String getText() { return description; diff --git a/Mage/src/mage/abilities/costs/Cost.java b/Mage/src/mage/abilities/costs/Cost.java index cd8696cd138..885ff8376fd 100644 --- a/Mage/src/mage/abilities/costs/Cost.java +++ b/Mage/src/mage/abilities/costs/Cost.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.costs; import java.io.Serializable; @@ -37,12 +36,21 @@ import mage.target.Targets; public interface Cost extends Serializable { UUID getId(); + String getText(); + + void setText(String text); + boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game); + boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana); + boolean isPaid(); + void clearPaid(); + void setPaid(); + Targets getTargets(); Cost copy(); diff --git a/Mage/src/mage/abilities/costs/CostImpl.java b/Mage/src/mage/abilities/costs/CostImpl.java index e423f30fed4..57f6c5a7471 100644 --- a/Mage/src/mage/abilities/costs/CostImpl.java +++ b/Mage/src/mage/abilities/costs/CostImpl.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.costs; import java.util.UUID; @@ -57,6 +56,7 @@ public abstract class CostImpl implements Cost { return text; } + @Override public void setText(String text) { this.text = text; } diff --git a/Mage/src/mage/abilities/costs/CostsImpl.java b/Mage/src/mage/abilities/costs/CostsImpl.java index a2624f3f29d..df64087a373 100644 --- a/Mage/src/mage/abilities/costs/CostsImpl.java +++ b/Mage/src/mage/abilities/costs/CostsImpl.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.costs; import java.util.ArrayList; @@ -44,12 +43,16 @@ import mage.target.Targets; */ public class CostsImpl extends ArrayList implements Costs { - public CostsImpl() {} + protected String text = null; + + public CostsImpl() { + } public CostsImpl(final CostsImpl costs) { - for (Cost cost: costs) { - this.add((T)cost.copy()); + for (Cost cost : costs) { + this.add((T) cost.copy()); } + this.text = costs.text; } @Override @@ -57,20 +60,28 @@ public class CostsImpl extends ArrayList implements Costs throw new RuntimeException("Not supported method"); } + @Override + public void setText(String text) { + this.text = text; + } + @Override public String getText() { + if (text != null) { + return text; + } if (this.size() == 0) { return ""; } StringBuilder sbText = new StringBuilder(); - for (T cost: this) { - String text = cost.getText(); - if (text != null && !text.isEmpty()) { - sbText.append(Character.toUpperCase(text.charAt(0))).append(text.substring(1)).append(", "); + for (T cost : this) { + String textCost = cost.getText(); + if (textCost != null && !textCost.isEmpty()) { + sbText.append(Character.toUpperCase(textCost.charAt(0))).append(textCost.substring(1)).append(", "); } } - if (sbText.length() > 1){ + if (sbText.length() > 1) { sbText.setLength(sbText.length() - 2); } return sbText.toString(); @@ -78,7 +89,7 @@ public class CostsImpl extends ArrayList implements Costs @Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - for (T cost: this) { + for (T cost : this) { if (!cost.canPay(ability, sourceId, controllerId, game)) { return false; } @@ -101,7 +112,7 @@ public class CostsImpl extends ArrayList implements Costs @Override public boolean isPaid() { - for (T cost: this) { + for (T cost : this) { if (!(cost instanceof VariableManaCost) && !cost.isPaid()) { return false; } @@ -111,14 +122,14 @@ public class CostsImpl extends ArrayList implements Costs @Override public void clearPaid() { - for (T cost: this) { + for (T cost : this) { cost.clearPaid(); } } @Override public void setPaid() { - for (T cost: this) { + for (T cost : this) { cost.setPaid(); } } @@ -126,7 +137,7 @@ public class CostsImpl extends ArrayList implements Costs @Override public Costs getUnpaid() { Costs unpaid = new CostsImpl<>(); - for (T cost: this) { + for (T cost : this) { if (!cost.isPaid()) { unpaid.add(cost); } @@ -140,17 +151,17 @@ public class CostsImpl extends ArrayList implements Costs return unpaid.get(0); } return null; - } + } @Override public List getVariableCosts() { List variableCosts = new ArrayList<>(); - for (T cost: this) { + for (T cost : this) { if (cost instanceof VariableCost) { variableCosts.add((VariableCost) cost); } if (cost instanceof ManaCosts) { - variableCosts.addAll(((ManaCosts)cost).getVariableCosts()); + variableCosts.addAll(((ManaCosts) cost).getVariableCosts()); } } return variableCosts; @@ -159,7 +170,7 @@ public class CostsImpl extends ArrayList implements Costs @Override public Targets getTargets() { Targets targets = new Targets(); - for (T cost: this) { + for (T cost : this) { if (cost.getTargets() != null) { targets.addAll(cost.getTargets()); } diff --git a/Mage/src/mage/abilities/costs/OptionalAdditionalCostImpl.java b/Mage/src/mage/abilities/costs/OptionalAdditionalCostImpl.java index 489d8690ea7..3646a9c3ec0 100644 --- a/Mage/src/mage/abilities/costs/OptionalAdditionalCostImpl.java +++ b/Mage/src/mage/abilities/costs/OptionalAdditionalCostImpl.java @@ -50,7 +50,7 @@ public class OptionalAdditionalCostImpl ex this.activated = false; this.name = name; this.delimiter = delimiter; - this.reminderText = new StringBuilder("").append(reminderText).append("").toString(); + this.reminderText = "(" + reminderText + ")"; this.activatedCounter = 0; this.add((Cost) cost); } @@ -81,7 +81,7 @@ public class OptionalAdditionalCostImpl ex if (onlyCost) { return getText(); } else { - return new StringBuffer(name).append(delimiter).append(getText()).toString(); + return name + delimiter + getText(); } } diff --git a/Mage/src/mage/abilities/costs/OptionalAdditionalSourceCosts.java b/Mage/src/mage/abilities/costs/OptionalAdditionalSourceCosts.java index 41bebeb4fa6..041d11a3c84 100644 --- a/Mage/src/mage/abilities/costs/OptionalAdditionalSourceCosts.java +++ b/Mage/src/mage/abilities/costs/OptionalAdditionalSourceCosts.java @@ -33,11 +33,14 @@ import mage.game.Game; /** * Interface for abilities that add additional costs to the source. * - * Example of such additional source costs: {@link mage.abilities.keyword.KickerAbility} + * Example of such additional source costs: + * {@link mage.abilities.keyword.KickerAbility} * * @author LevelX2 */ public interface OptionalAdditionalSourceCosts { + void addOptionalAdditionalCosts(Ability ability, Game game); + String getCastMessageSuffix(); -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/costs/OrCost.java b/Mage/src/mage/abilities/costs/OrCost.java index 2c5a7740e7c..0707741244f 100644 --- a/Mage/src/mage/abilities/costs/OrCost.java +++ b/Mage/src/mage/abilities/costs/OrCost.java @@ -37,8 +37,8 @@ import mage.target.Targets; public class OrCost implements Cost { - private Cost firstCost; - private Cost secondCost; + private final Cost firstCost; + private final Cost secondCost; private String description; // which cost was slected to pay private Cost selectedCost; @@ -61,6 +61,11 @@ public class OrCost implements Cost { throw new RuntimeException("Not supported method"); } + @Override + public void setText(String text) { + this.description = text; + } + @Override public String getText() { return description; diff --git a/Mage/src/mage/abilities/costs/VariableCostImpl.java b/Mage/src/mage/abilities/costs/VariableCostImpl.java index c020d7922ba..e1002b91eb4 100644 --- a/Mage/src/mage/abilities/costs/VariableCostImpl.java +++ b/Mage/src/mage/abilities/costs/VariableCostImpl.java @@ -77,6 +77,11 @@ public abstract class VariableCostImpl implements Cost, VariableCost { this.amountPaid = cost.amountPaid; } + @Override + public void setText(String text) { + this.text = text; + } + @Override public String getText() { return text; @@ -157,8 +162,7 @@ public abstract class VariableCostImpl implements Cost, VariableCost { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { xValue = controller.announceXCost(getMinValue(source, game), getMaxValue(source, game), - new StringBuilder("Announce the number of ").append(actionText).toString(), - game, source, this); + "Announce the number of " + actionText, game, source, this); } return xValue; } diff --git a/Mage/src/mage/abilities/costs/common/DiscardTargetCost.java b/Mage/src/mage/abilities/costs/common/DiscardTargetCost.java index 69fb9b62298..da388060961 100644 --- a/Mage/src/mage/abilities/costs/common/DiscardTargetCost.java +++ b/Mage/src/mage/abilities/costs/common/DiscardTargetCost.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,21 +20,20 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.costs.common; import java.util.ArrayList; import java.util.List; import java.util.UUID; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.costs.CostImpl; import mage.cards.Card; +import mage.constants.Outcome; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInHand; @@ -44,47 +43,46 @@ import mage.target.common.TargetCardInHand; * @author BetaSteward_at_googlemail.com */ public class DiscardTargetCost extends CostImpl { - + List cards = new ArrayList<>(); protected boolean randomDiscard; public DiscardTargetCost(TargetCardInHand target) { this(target, false); } - + public DiscardTargetCost(TargetCardInHand target, boolean randomDiscard) { this.addTarget(target); this.randomDiscard = randomDiscard; - this.text = "Discard " + target.getTargetName(); + this.text = "discard " + target.getTargetName(); } public DiscardTargetCost(DiscardTargetCost cost) { super(cost); - for (Card card: cost.cards) { - this.cards.add(card.copy()); - } + this.cards.addAll(cost.cards); this.randomDiscard = cost.randomDiscard; } @Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { this.cards.clear(); + this.targets.clearChosen();; Player player = game.getPlayer(controllerId); if (player == null) { return false; } int amount = this.getTargets().get(0).getNumberOfTargets(); - if (randomDiscard) { + if (randomDiscard) { this.cards.addAll(player.discard(amount, true, ability, game).getCards(game)); } else { - if (targets.choose(Outcome.Discard, controllerId, sourceId, game)) { - for (UUID targetId: targets.get(0).getTargets()) { + if (targets.choose(Outcome.Discard, controllerId, sourceId, game)) { + for (UUID targetId : targets.get(0).getTargets()) { Card card = player.getHand().get(targetId, game); if (card == null) { return false; } player.discard(card, ability, game); - this.cards.add(card.copy()); + this.cards.add(card); } } } @@ -94,8 +92,9 @@ public class DiscardTargetCost extends CostImpl { @Override public void clearPaid() { - super.clearPaid(); - cards.clear(); + super.clearPaid(); + this.cards.clear(); + this.targets.clearChosen(); } @Override diff --git a/Mage/src/mage/abilities/costs/common/ExileOpponentsCardFromExileToGraveyardCost.java b/Mage/src/mage/abilities/costs/common/ExileOpponentsCardFromExileToGraveyardCost.java new file mode 100644 index 00000000000..94e498b2e3d --- /dev/null +++ b/Mage/src/mage/abilities/costs/common/ExileOpponentsCardFromExileToGraveyardCost.java @@ -0,0 +1,76 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.costs.common; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.CostImpl; +import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.other.OwnerPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCardInExile; + +/** + * + * @author LevelX2 + */ +public class ExileOpponentsCardFromExileToGraveyardCost extends CostImpl { + + public ExileOpponentsCardFromExileToGraveyardCost(boolean thatPlayersText) { + if (false) { + this.text = "put a card an opponent owns from exile into its owner's graveyard"; + } else { + this.text = "put a card an opponent owns from exile into that player's graveyard"; + } + } + + public ExileOpponentsCardFromExileToGraveyardCost(ExileOpponentsCardFromExileToGraveyardCost cost) { + super(cost); + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Player controller = game.getPlayer(controllerId); + if (controller != null) { + FilterCard filter = new FilterCard(); + filter.add(new OwnerPredicate(TargetController.OPPONENT)); + Target target = new TargetCardInExile(filter); + if (controller.chooseTarget(Outcome.Damage, target, ability, game)) { + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { + paid = true; + controller.moveCards(card, null, Zone.GRAVEYARD, ability, game); + } + } + } + return paid; + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + Player controller = game.getPlayer(controllerId); + if (controller != null) { + for (Card card : game.getExile().getAllCards(game)) { + if (controller.hasOpponent(card.getOwnerId(), game)) { + return true; + } + } + } + return false; + } + + @Override + public ExileOpponentsCardFromExileToGraveyardCost copy() { + return new ExileOpponentsCardFromExileToGraveyardCost(this); + } + +} diff --git a/Mage/src/mage/abilities/costs/common/ExileTopCardOfGraveyardCost.java b/Mage/src/mage/abilities/costs/common/ExileTopCardOfGraveyardCost.java new file mode 100644 index 00000000000..997753dc722 --- /dev/null +++ b/Mage/src/mage/abilities/costs/common/ExileTopCardOfGraveyardCost.java @@ -0,0 +1,63 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.costs.common; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.CostImpl; +import mage.cards.Card; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class ExileTopCardOfGraveyardCost extends CostImpl { + + private final int amount; + + public ExileTopCardOfGraveyardCost(int amount) { + this.amount = amount; + this.text = "Exile the top card of your graveyard"; + } + + public ExileTopCardOfGraveyardCost(ExileTopCardOfGraveyardCost cost) { + super(cost); + this.amount = cost.amount; + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + Player controller = game.getPlayer(controllerId); + if(controller == null) { + return false; + } + return controller.getGraveyard().size() >= amount; + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Player controller = game.getPlayer(controllerId); + if(controller != null) { + Card topCard = null; + for (Card card :controller.getGraveyard().getCards(game)) { + topCard = card; + } + if (topCard != null) { + controller.moveCardToExileWithInfo(topCard, null, "", ability.getSourceId(), game, Zone.GRAVEYARD, true); + paid = true; + } + } + return paid; + } + + @Override + public ExileTopCardOfGraveyardCost copy() { + return new ExileTopCardOfGraveyardCost(this); + } +} \ No newline at end of file diff --git a/Mage/src/mage/abilities/costs/common/ExileTopCreatureCardOfGraveyardCost.java b/Mage/src/mage/abilities/costs/common/ExileTopCreatureCardOfGraveyardCost.java new file mode 100644 index 00000000000..00f0b18eef0 --- /dev/null +++ b/Mage/src/mage/abilities/costs/common/ExileTopCreatureCardOfGraveyardCost.java @@ -0,0 +1,66 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.costs.common; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.CostImpl; +import mage.cards.Card; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author fireshoes + */ +public class ExileTopCreatureCardOfGraveyardCost extends CostImpl { + + private final int amount; + + public ExileTopCreatureCardOfGraveyardCost(int amount) { + this.amount = amount; + this.text = "Exile the top creature card of your graveyard"; + } + + public ExileTopCreatureCardOfGraveyardCost(ExileTopCreatureCardOfGraveyardCost cost) { + super(cost); + this.amount = cost.amount; + } + + @Override + public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { + Player controller = game.getPlayer(controllerId); + if(controller == null) { + return false; + } + return controller.getGraveyard().size() >= amount; + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + Player controller = game.getPlayer(controllerId); + if(controller != null) { + Card topCard = null; + for (Card card :controller.getGraveyard().getCards(game)) { + if (card.getCardType().contains(CardType.CREATURE)) { + topCard = card; + } + } + if (topCard != null) { + controller.moveCardToExileWithInfo(topCard, null, "", ability.getSourceId(), game, Zone.GRAVEYARD, true); + paid = true; + } + } + return paid; + } + + @Override + public ExileTopCreatureCardOfGraveyardCost copy() { + return new ExileTopCreatureCardOfGraveyardCost(this); + } +} diff --git a/Mage/src/mage/abilities/costs/common/PutTopCardOfYourLibraryToGraveyardCost.java b/Mage/src/mage/abilities/costs/common/PutTopCardOfYourLibraryToGraveyardCost.java index bd097d47ab7..2b1b4f28595 100644 --- a/Mage/src/mage/abilities/costs/common/PutTopCardOfYourLibraryToGraveyardCost.java +++ b/Mage/src/mage/abilities/costs/common/PutTopCardOfYourLibraryToGraveyardCost.java @@ -25,26 +25,16 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.costs.common; import java.util.UUID; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.costs.CostImpl; -import mage.cards.Card; -import mage.cards.Cards; -import mage.cards.CardsImpl; +import mage.constants.Zone; import mage.game.Game; import mage.players.Player; import mage.util.CardUtil; -/** - * - * @author LevelX2 - */ - - public class PutTopCardOfYourLibraryToGraveyardCost extends CostImpl { int numberOfCards; diff --git a/Mage/src/mage/abilities/costs/common/RemoveCounterCost.java b/Mage/src/mage/abilities/costs/common/RemoveCounterCost.java index 85f7676eb46..0167f67807f 100644 --- a/Mage/src/mage/abilities/costs/common/RemoveCounterCost.java +++ b/Mage/src/mage/abilities/costs/common/RemoveCounterCost.java @@ -84,6 +84,9 @@ public class RemoveCounterCost extends CostImpl { int countersRemoved = 0; Player controller = game.getPlayer(controllerId); if (controller != null) { + if (countersToRemove == 0) { // Can happen when used for X costs where X = 0; + return paid = true; + } target.clearChosen(); if (target.choose(Outcome.UnboostCreature, controllerId, sourceId, game)) { for (UUID targetId : target.getTargets()) { diff --git a/Mage/src/mage/abilities/costs/common/ReturnToHandTargetPermanentCost.java b/Mage/src/mage/abilities/costs/common/ReturnToHandChosenControlledPermanentCost.java similarity index 88% rename from Mage/src/mage/abilities/costs/common/ReturnToHandTargetPermanentCost.java rename to Mage/src/mage/abilities/costs/common/ReturnToHandChosenControlledPermanentCost.java index 6a0e383c83f..238377fdf4b 100644 --- a/Mage/src/mage/abilities/costs/common/ReturnToHandTargetPermanentCost.java +++ b/Mage/src/mage/abilities/costs/common/ReturnToHandChosenControlledPermanentCost.java @@ -40,9 +40,10 @@ import mage.target.common.TargetControlledPermanent; * * @author BetaSteward_at_googlemail.com */ -public class ReturnToHandTargetPermanentCost extends CostImpl { +public class ReturnToHandChosenControlledPermanentCost extends CostImpl { - public ReturnToHandTargetPermanentCost(TargetControlledPermanent target) { + public ReturnToHandChosenControlledPermanentCost(TargetControlledPermanent target) { + target.setNotTarget(true); this.addTarget(target); if (target.getMaxNumberOfTargets() > 1 && target.getMaxNumberOfTargets() == target.getNumberOfTargets()) { this.text = new StringBuilder("return ").append(target.getMaxNumberOfTargets()).append(" ").append(target.getTargetName()).append(" you control to its owner's hand").toString(); @@ -51,7 +52,7 @@ public class ReturnToHandTargetPermanentCost extends CostImpl { } } - public ReturnToHandTargetPermanentCost(ReturnToHandTargetPermanentCost cost) { + public ReturnToHandChosenControlledPermanentCost(ReturnToHandChosenControlledPermanentCost cost) { super(cost); } @@ -78,8 +79,8 @@ public class ReturnToHandTargetPermanentCost extends CostImpl { } @Override - public ReturnToHandTargetPermanentCost copy() { - return new ReturnToHandTargetPermanentCost(this); + public ReturnToHandChosenControlledPermanentCost copy() { + return new ReturnToHandChosenControlledPermanentCost(this); } } diff --git a/Mage/src/mage/abilities/costs/common/RevealTargetFromHandCost.java b/Mage/src/mage/abilities/costs/common/RevealTargetFromHandCost.java index 492a07fff12..a5ef7e33cba 100644 --- a/Mage/src/mage/abilities/costs/common/RevealTargetFromHandCost.java +++ b/Mage/src/mage/abilities/costs/common/RevealTargetFromHandCost.java @@ -28,6 +28,8 @@ // author jeffwadsworth package mage.abilities.costs.common; +import java.util.ArrayList; +import java.util.List; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; @@ -44,16 +46,19 @@ public class RevealTargetFromHandCost extends CostImpl { public int convertedManaCosts = 0; protected int numberCardsRevealed = 0; + protected List revealedCards; public RevealTargetFromHandCost(TargetCardInHand target) { this.addTarget(target); this.text = (target.getNumberOfTargets() == 0 ? "you may " : "") + "reveal " + target.getTargetName(); + this.revealedCards = new ArrayList<>(); } public RevealTargetFromHandCost(final RevealTargetFromHandCost cost) { super(cost); this.convertedManaCosts = cost.convertedManaCosts; this.numberCardsRevealed = cost.numberCardsRevealed; + this.revealedCards = new ArrayList<>(cost.revealedCards); } @Override @@ -69,6 +74,7 @@ public class RevealTargetFromHandCost extends CostImpl { convertedManaCosts += card.getManaCost().convertedManaCost(); numberCardsRevealed++; cards.add(card); + revealedCards.add(card); } } if (numberCardsRevealed > 0) { @@ -92,6 +98,10 @@ public class RevealTargetFromHandCost extends CostImpl { return numberCardsRevealed; } + public List getRevealedCards() { + return revealedCards; + } + @Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { return targets.canChoose(controllerId, game); diff --git a/Mage/src/mage/abilities/costs/common/SacrificeTargetCost.java b/Mage/src/mage/abilities/costs/common/SacrificeTargetCost.java index 96f21b26ec7..be90768d5fd 100644 --- a/Mage/src/mage/abilities/costs/common/SacrificeTargetCost.java +++ b/Mage/src/mage/abilities/costs/common/SacrificeTargetCost.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.costs.common; import java.util.ArrayList; @@ -51,16 +50,17 @@ public class SacrificeTargetCost extends CostImpl { public SacrificeTargetCost(TargetControlledPermanent target) { this.addTarget(target); target.setNotTarget(true); // sacrifice is never targeted - this.text = "Sacrifice " + target.getTargetName(); + this.text = "sacrifice " + target.getTargetName(); + target.setTargetName(target.getTargetName() + " (to sacrifice)"); } - + public SacrificeTargetCost(TargetControlledPermanent target, boolean noText) { this.addTarget(target); } public SacrificeTargetCost(SacrificeTargetCost cost) { super(cost); - for (Permanent permanent: cost.permanents) { + for (Permanent permanent : cost.permanents) { this.permanents.add(permanent.copy()); } } @@ -69,10 +69,10 @@ public class SacrificeTargetCost extends CostImpl { public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { UUID activator = controllerId; if (ability.getAbilityType().equals(AbilityType.ACTIVATED) || ability.getAbilityType().equals(AbilityType.SPECIAL_ACTION)) { - activator = ((ActivatedAbilityImpl)ability).getActivatorId(); + activator = ((ActivatedAbilityImpl) ability).getActivatorId(); } if (targets.choose(Outcome.Sacrifice, activator, sourceId, game)) { - for (UUID targetId: targets.get(0).getTargets()) { + for (UUID targetId : targets.get(0).getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent == null) { return false; @@ -91,8 +91,8 @@ public class SacrificeTargetCost extends CostImpl { public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { UUID activator = controllerId; if (ability.getAbilityType().equals(AbilityType.ACTIVATED) || ability.getAbilityType().equals(AbilityType.SPECIAL_ACTION)) { - if (((ActivatedAbilityImpl)ability).getActivatorId() != null) { - activator = ((ActivatedAbilityImpl)ability).getActivatorId(); + if (((ActivatedAbilityImpl) ability).getActivatorId() != null) { + activator = ((ActivatedAbilityImpl) ability).getActivatorId(); } else { // Aktivator not filled? activator = controllerId; diff --git a/Mage/src/mage/abilities/costs/common/TapTargetCost.java b/Mage/src/mage/abilities/costs/common/TapTargetCost.java index a793bd6e3ba..8f448eaa093 100644 --- a/Mage/src/mage/abilities/costs/common/TapTargetCost.java +++ b/Mage/src/mage/abilities/costs/common/TapTargetCost.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.costs.common; import java.util.List; @@ -49,10 +48,10 @@ public class TapTargetCost extends CostImpl { public TapTargetCost(TargetControlledPermanent target) { this.target = target; this.target.setNotTarget(true); // costs are never targeted - this.text = - new StringBuilder("Tap ") - .append(target.getTargetName().startsWith("a ") || target.getTargetName().startsWith("an ") ? "":CardUtil.numberToText(target.getMaxNumberOfTargets())) - .append(" ") + this.text + = new StringBuilder("Tap ") + .append((target.getTargetName().startsWith("a ") || target.getTargetName().startsWith("an ") || target.getTargetName().startsWith("another")) + ? "" : CardUtil.numberToText(target.getMaxNumberOfTargets()) + " ") .append(target.getTargetName()).toString(); } @@ -64,7 +63,7 @@ public class TapTargetCost extends CostImpl { @Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { if (target.choose(Outcome.Tap, controllerId, sourceId, game)) { - for (UUID targetId: (List)target.getTargets()) { + for (UUID targetId : (List) target.getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent == null) { return false; @@ -77,7 +76,7 @@ public class TapTargetCost extends CostImpl { @Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - return target.canChoose(controllerId, game); + return target.canChoose(sourceId, controllerId, game); } @Override @@ -85,5 +84,4 @@ public class TapTargetCost extends CostImpl { return new TapTargetCost(this); } - } diff --git a/Mage/src/mage/abilities/costs/common/UntapSourceCost.java b/Mage/src/mage/abilities/costs/common/UntapSourceCost.java index ad86161595d..8c28bce5b52 100644 --- a/Mage/src/mage/abilities/costs/common/UntapSourceCost.java +++ b/Mage/src/mage/abilities/costs/common/UntapSourceCost.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.costs.common; import java.util.UUID; @@ -61,7 +60,7 @@ public class UntapSourceCost extends CostImpl { public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { Permanent permanent = game.getPermanent(sourceId); if (permanent != null) { - return permanent.isTapped(); + return permanent.isTapped() && !permanent.hasSummoningSickness(); } return false; } diff --git a/Mage/src/mage/abilities/costs/mana/ManaCostImpl.java b/Mage/src/mage/abilities/costs/mana/ManaCostImpl.java index c33e0f5799b..11c4a66e9aa 100644 --- a/Mage/src/mage/abilities/costs/mana/ManaCostImpl.java +++ b/Mage/src/mage/abilities/costs/mana/ManaCostImpl.java @@ -118,31 +118,31 @@ public abstract class ManaCostImpl extends CostImpl implements ManaCost { switch (mana) { case B: if (pool.pay(ManaType.BLACK, ability, sourceFilter, game)) { - this.payment.addBlack(); + this.payment.increaseBlack(); return true; } break; case U: if (pool.pay(ManaType.BLUE, ability, sourceFilter, game)) { - this.payment.addBlue(); + this.payment.increaseBlue(); return true; } break; case W: if (pool.pay(ManaType.WHITE, ability, sourceFilter, game)) { - this.payment.addWhite(); + this.payment.increaseWhite(); return true; } break; case G: if (pool.pay(ManaType.GREEN, ability, sourceFilter, game)) { - this.payment.addGreen(); + this.payment.increaseGreen(); return true; } break; case R: if (pool.pay(ManaType.RED, ability, sourceFilter, game)) { - this.payment.addRed(); + this.payment.increaseRed(); return true; } break; @@ -154,27 +154,27 @@ public abstract class ManaCostImpl extends CostImpl implements ManaCost { int conditionalCount = pool.getConditionalCount(ability, game, null); while (mana > payment.count() && (pool.count() > 0 || conditionalCount > 0)) { if (pool.pay(ManaType.COLORLESS, ability, sourceFilter, game)) { - this.payment.addColorless(); + this.payment.increaseColorless(); continue; } if (pool.pay(ManaType.BLACK, ability, sourceFilter, game)) { - this.payment.addBlack(); + this.payment.increaseBlack(); continue; } if (pool.pay(ManaType.BLUE, ability, sourceFilter, game)) { - this.payment.addBlue(); + this.payment.increaseBlue(); continue; } if (pool.pay(ManaType.WHITE, ability, sourceFilter, game)) { - this.payment.addWhite(); + this.payment.increaseWhite(); continue; } if (pool.pay(ManaType.GREEN, ability, sourceFilter, game)) { - this.payment.addGreen(); + this.payment.increaseGreen(); continue; } if (pool.pay(ManaType.RED, ability, sourceFilter, game)) { - this.payment.addRed(); + this.payment.increaseRed(); continue; } break; diff --git a/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java b/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java index c6d7654244a..08d189c601d 100644 --- a/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java +++ b/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java @@ -51,6 +51,7 @@ import mage.util.ManaUtil; public class ManaCostsImpl extends ArrayList implements ManaCosts { protected UUID id; + protected String text = null; private static Map costs = new HashMap<>(); @@ -66,12 +67,12 @@ public class ManaCostsImpl extends ArrayList implements M public ManaCostsImpl(final ManaCostsImpl costs) { this.id = costs.id; for (T cost : costs) { - this.add((T) cost.copy()); + this.add(cost.copy()); } } @Override - public boolean add(ManaCost cost) { + public final boolean add(ManaCost cost) { if (cost instanceof ManaCosts) { for (ManaCost manaCost : (ManaCosts) cost) { super.add((T) manaCost); @@ -228,30 +229,62 @@ public class ManaCostsImpl extends ArrayList implements M for (ManaCost cost : this) { if (!cost.isPaid() && cost instanceof ColoredManaCost) { cost.assignPayment(game, ability, pool); + if (pool.count() == 0) { + return; + } } } for (ManaCost cost : this) { if (!cost.isPaid() && cost instanceof HybridManaCost) { cost.assignPayment(game, ability, pool); + if (pool.count() == 0) { + return; + } } } + // Mono Hybrid mana costs + // First try only to pay colored mana with the pool + for (ManaCost cost : this) { + if (!cost.isPaid() && cost instanceof MonoHybridManaCost) { + if (((((MonoHybridManaCost) cost).containsColor(ColoredManaSymbol.W)) && pool.getWhite() > 0) + || ((((MonoHybridManaCost) cost).containsColor(ColoredManaSymbol.B)) && pool.getBlack() > 0) + || ((((MonoHybridManaCost) cost).containsColor(ColoredManaSymbol.R)) && pool.getRed() > 0) + || ((((MonoHybridManaCost) cost).containsColor(ColoredManaSymbol.G)) && pool.getGreen() > 0) + || ((((MonoHybridManaCost) cost).containsColor(ColoredManaSymbol.U)) && pool.getBlue() > 0)) { + cost.assignPayment(game, ability, pool); + if (pool.count() == 0) { + return; + } + } + } + } + // if colored didn't fit pay colorless with the mana for (ManaCost cost : this) { if (!cost.isPaid() && cost instanceof MonoHybridManaCost) { cost.assignPayment(game, ability, pool); + if (pool.count() == 0) { + return; + } } } for (ManaCost cost : this) { if (!cost.isPaid() && cost instanceof SnowManaCost) { cost.assignPayment(game, ability, pool); + if (pool.count() == 0) { + return; + } } } for (ManaCost cost : this) { if (!cost.isPaid() && cost instanceof GenericManaCost) { cost.assignPayment(game, ability, pool); + if (pool.count() == 0) { + return; + } } } @@ -265,7 +298,7 @@ public class ManaCostsImpl extends ArrayList implements M } @Override - public void load(String mana) { + public final void load(String mana) { this.clear(); if (costs.containsKey(mana)) { ManaCosts savedCosts = costs.get(mana); @@ -284,7 +317,10 @@ public class ManaCostsImpl extends ArrayList implements M if (Character.isDigit(symbol.charAt(0))) { this.add((T) new GenericManaCost(Integer.valueOf(symbol))); } else { - if (!symbol.equals("X")) { + if(symbol.equals("S")) { + this.add((T) new SnowManaCost()); + } + else if (!symbol.equals("X")) { this.add((T) new ColoredManaCost(ColoredManaSymbol.lookup(symbol.charAt(0)))); } else { // check X wasn't added before @@ -301,9 +337,7 @@ public class ManaCostsImpl extends ArrayList implements M //TODO: handle multiple {X} and/or {Y} symbols } } else { - if (symbol.equals("snow")) { - this.add((T) new SnowManaCost()); - } else if (Character.isDigit(symbol.charAt(0))) { + if (Character.isDigit(symbol.charAt(0))) { this.add((T) new MonoHybridManaCost(ColoredManaSymbol.lookup(symbol.charAt(2)))); } else if (symbol.contains("P")) { this.add((T) new PhyrexianManaCost(ColoredManaSymbol.lookup(symbol.charAt(0)))); @@ -340,8 +374,16 @@ public class ManaCostsImpl extends ArrayList implements M return this.id; } + @Override + public void setText(String text) { + this.text = text; + } + @Override public String getText() { + if (text != null) { + return text; + } if (this.size() == 0) { return ""; } @@ -392,7 +434,7 @@ public class ManaCostsImpl extends ArrayList implements M @Override public boolean isPaid() { for (T cost : this) { - if (!((T) cost instanceof VariableManaCost) && !cost.isPaid()) { + if (!(cost instanceof VariableManaCost) && !cost.isPaid()) { return false; } } @@ -424,7 +466,7 @@ public class ManaCostsImpl extends ArrayList implements M @Override public ManaCosts copy() { - return new ManaCostsImpl(this); + return new ManaCostsImpl<>(this); } @Override diff --git a/Mage/src/mage/abilities/decorator/ConditionalContinuousEffect.java b/Mage/src/mage/abilities/decorator/ConditionalContinuousEffect.java index 7ea23fd4443..fb7f004e162 100644 --- a/Mage/src/mage/abilities/decorator/ConditionalContinuousEffect.java +++ b/Mage/src/mage/abilities/decorator/ConditionalContinuousEffect.java @@ -1,5 +1,8 @@ package mage.abilities.decorator; +import java.util.List; +import java.util.Set; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.condition.Condition; @@ -25,7 +28,6 @@ public class ConditionalContinuousEffect extends ContinuousEffectImpl { protected Condition condition; protected boolean initDone = false; - public ConditionalContinuousEffect(ContinuousEffect effect, Condition condition, String text) { this(effect, null, condition, text); } @@ -61,7 +63,7 @@ public class ConditionalContinuousEffect extends ContinuousEffectImpl { public boolean isDiscarded() { return this.discarded || effect.isDiscarded() || (otherwiseEffect != null && otherwiseEffect.isDiscarded()); } - + @Override public void init(Ability source, Game game) { if (baseCondition instanceof LockedInCondition) { @@ -70,7 +72,7 @@ public class ConditionalContinuousEffect extends ContinuousEffectImpl { condition = baseCondition; } effect.setTargetPointer(this.targetPointer); - effect.init(source, game); + effect.init(source, game); if (otherwiseEffect != null) { otherwiseEffect.setTargetPointer(this.targetPointer); otherwiseEffect.init(source, game); @@ -134,4 +136,13 @@ public class ConditionalContinuousEffect extends ContinuousEffectImpl { public ConditionalContinuousEffect copy() { return new ConditionalContinuousEffect(this); } + + @Override + public Set isDependentTo(List allEffectsInLayer) { + if (effect != null) { + return effect.isDependentTo(allEffectsInLayer); + } + return super.isDependentTo(allEffectsInLayer); + } + } diff --git a/Mage/src/mage/abilities/decorator/ConditionalContinuousRuleModifyingEffect.java b/Mage/src/mage/abilities/decorator/ConditionalContinuousRuleModifyingEffect.java index 8028e727066..c289550a5ff 100644 --- a/Mage/src/mage/abilities/decorator/ConditionalContinuousRuleModifyingEffect.java +++ b/Mage/src/mage/abilities/decorator/ConditionalContinuousRuleModifyingEffect.java @@ -41,7 +41,7 @@ import mage.game.events.GameEvent; * * @author LevelX2 */ -public class ConditionalContinuousRuleModifyingEffect extends ContinuousRuleModifyingEffectImpl { +public class ConditionalContinuousRuleModifyingEffect extends ContinuousRuleModifyingEffectImpl { protected ContinuousRuleModifyingEffect effect; protected ContinuousRuleModifyingEffect otherwiseEffect; @@ -88,7 +88,6 @@ public class ConditionalContinuousRuleModifyingEffect extends ContinuousRuleModi initDone = true; } - @Override public boolean isDiscarded() { return effect.isDiscarded() || (otherwiseEffect != null && otherwiseEffect.isDiscarded()); @@ -136,4 +135,20 @@ public class ConditionalContinuousRuleModifyingEffect extends ContinuousRuleModi public ConditionalContinuousRuleModifyingEffect copy() { return new ConditionalContinuousRuleModifyingEffect(this); } + + @Override + public boolean sendMessageToGameLog() { + return effect.sendMessageToGameLog(); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public boolean sendMessageToUser() { + return effect.sendMessageToUser(); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public String getInfoMessage(Ability source, GameEvent event, Game game) { + return effect.getInfoMessage(source, event, game); //To change body of generated methods, choose Tools | Templates. + } + } diff --git a/Mage/src/mage/abilities/decorator/ConditionalManaEffect.java b/Mage/src/mage/abilities/decorator/ConditionalManaEffect.java index 4ec4d37870e..77eaf343e2e 100644 --- a/Mage/src/mage/abilities/decorator/ConditionalManaEffect.java +++ b/Mage/src/mage/abilities/decorator/ConditionalManaEffect.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.decorator; import mage.Mana; @@ -33,14 +32,14 @@ import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.effects.common.ManaEffect; +import mage.choices.ChoiceColor; import mage.game.Game; +import mage.players.Player; /** * * @author LevelX2 */ - - public class ConditionalManaEffect extends ManaEffect { private BasicManaEffect effect; @@ -70,14 +69,46 @@ public class ConditionalManaEffect extends ManaEffect { @Override public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } if (condition.apply(game, source)) { effect.setTargetPointer(this.targetPointer); - return effect.apply(game, source); } else if (otherwiseEffect != null) { otherwiseEffect.setTargetPointer(this.targetPointer); - return otherwiseEffect.apply(game, source); } - return false; + Mana mana = getMana(game, source); + + if (mana != null && mana.getAny() > 0) { + int amount = mana.getAny(); + + ChoiceColor choice = new ChoiceColor(true); + Mana createdMana = null; + if (controller.choose(outcome, choice, game)) { + if (choice.getColor() == null) { + return false; // it happens, don't know how + } + + if (choice.getColor().isBlack()) { + createdMana = Mana.BlackMana(amount); + } else if (choice.getColor().isBlue()) { + createdMana = Mana.BlueMana(amount); + } else if (choice.getColor().isRed()) { + createdMana = Mana.RedMana(amount); + } else if (choice.getColor().isGreen()) { + createdMana = Mana.GreenMana(amount); + } else if (choice.getColor().isWhite()) { + createdMana = Mana.WhiteMana(amount); + } + } + mana = createdMana; + } + + if (mana != null) { + controller.getManaPool().addMana(mana, game, source); + } + return true; } @Override @@ -85,12 +116,18 @@ public class ConditionalManaEffect extends ManaEffect { return new ConditionalManaEffect(this); } - public Mana getMana(Game game, Ability source) { + @Override + public Mana getMana(Game game, Ability source + ) { + Mana mana = null; if (condition.apply(game, source)) { - return effect.getMana(); + mana = effect.getMana(); } else if (otherwiseEffect != null) { - return otherwiseEffect.getMana(); + mana = otherwiseEffect.getMana(); } - return null; + if (mana != null) { + checkToFirePossibleEvents(mana, game, source); + } + return mana; } } diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java index caec5c530a7..901845974a5 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInAllGraveyardsCount.java @@ -51,8 +51,8 @@ public class CardsInAllGraveyardsCount implements DynamicValue { this.filter = filter; } - private CardsInAllGraveyardsCount(CardsInAllGraveyardsCount dynamicValue) { - this.filter = dynamicValue.filter; + public CardsInAllGraveyardsCount(CardsInAllGraveyardsCount dynamicValue) { + this.filter = dynamicValue.filter.copy(); } @Override diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInControllerHandCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInControllerHandCount.java index 71e9836cb8a..476057003c4 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/CardsInControllerHandCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInControllerHandCount.java @@ -1,36 +1,36 @@ -package mage.abilities.dynamicvalue.common; - -import mage.abilities.Ability; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.effects.Effect; -import mage.game.Game; -import mage.players.Player; - -public class CardsInControllerHandCount implements DynamicValue { - - @Override - public int calculate(Game game, Ability sourceAbility, Effect effect) { - if (sourceAbility != null) { - Player controller = game.getPlayer(sourceAbility.getControllerId()); - if (controller != null) { - return controller.getHand().size(); - } - } - return 0; - } - - @Override - public CardsInControllerHandCount copy() { - return new CardsInControllerHandCount(); - } - - @Override - public String getMessage() { - return "card in your hand"; - } - - @Override - public String toString() { - return "1"; - } -} +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; +import mage.players.Player; + +public class CardsInControllerHandCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + if (sourceAbility != null) { + Player controller = game.getPlayer(sourceAbility.getControllerId()); + if (controller != null) { + return controller.getHand().size(); + } + } + return 0; + } + + @Override + public CardsInControllerHandCount copy() { + return new CardsInControllerHandCount(); + } + + @Override + public String getMessage() { + return "cards in your hand"; + } + + @Override + public String toString() { + return "1"; + } +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayersGraveyardCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayersGraveyardCount.java new file mode 100644 index 00000000000..b5f39f1276c --- /dev/null +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayersGraveyardCount.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LoneFox + */ +public class CardsInTargetPlayersGraveyardCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Player player = game.getPlayer(effect.getTargetPointer().getFirst(game, sourceAbility)); + if (player != null) { + return player.getGraveyard().size(); + } + return 0; + } + + @Override + public CardsInTargetPlayersGraveyardCount copy() { + return new CardsInTargetPlayersGraveyardCount(); + } + + @Override + public String getMessage() { + return "cards in target player's graveyard"; + } + +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/ColorsOfManaSpentToCastCount.java b/Mage/src/mage/abilities/dynamicvalue/common/ColorsOfManaSpentToCastCount.java new file mode 100644 index 00000000000..88c54fd7fb8 --- /dev/null +++ b/Mage/src/mage/abilities/dynamicvalue/common/ColorsOfManaSpentToCastCount.java @@ -0,0 +1,81 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.dynamicvalue.common; + +import java.io.ObjectStreamException; +import mage.MageObject; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.stack.Spell; + +/** + * + * @author LevelX2 + */ +public class ColorsOfManaSpentToCastCount implements DynamicValue { + + private static final ColorsOfManaSpentToCastCount fINSTANCE = new ColorsOfManaSpentToCastCount(); + + private Object readResolve() throws ObjectStreamException { + return fINSTANCE; + } + + public static ColorsOfManaSpentToCastCount getInstance() { + return fINSTANCE; + } + + @Override + public int calculate(Game game, Ability source, Effect effect) { + int count = 0; + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell == null) { + MageObject mageObject = game.getLastKnownInformation(source.getSourceId(), Zone.STACK); + if (mageObject instanceof Spell) { + spell = (Spell) mageObject; + } + } + if (spell != null) { + // NOT the cmc of the spell on the stack + Mana mana = spell.getSpellAbility().getManaCostsToPay().getPayment(); + if (mana.getBlack() > 0) { + count++; + } + if (mana.getBlue() > 0) { + count++; + } + if (mana.getGreen() > 0) { + count++; + } + if (mana.getRed() > 0) { + count++; + } + if (mana.getWhite() > 0) { + count++; + } + } + return count; + } + + @Override + public ColorsOfManaSpentToCastCount copy() { + return new ColorsOfManaSpentToCastCount(); + } + + @Override + public String toString() { + return "X"; + } + + @Override + public String getMessage() { + return "the number of colors of mana spent to cast {this}"; + } + +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CreaturesDiedThisTurnCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CreaturesDiedThisTurnCount.java new file mode 100644 index 00000000000..5f596b83536 --- /dev/null +++ b/Mage/src/mage/abilities/dynamicvalue/common/CreaturesDiedThisTurnCount.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; +import mage.watchers.common.CreaturesDiedWatcher; + +/** + * @author LoneFox + */ +public class CreaturesDiedThisTurnCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + CreaturesDiedWatcher watcher = (CreaturesDiedWatcher)game.getState().getWatchers().get("CreaturesDiedWatcher"); + if (watcher != null) { + return watcher.getAmountOfCreaturesDiesThisTurn(); + } + return 0; + } + + @Override + public CreaturesDiedThisTurnCount copy() { + return new CreaturesDiedThisTurnCount(); + } + + @Override + public String toString() { + return "X"; + } + + @Override + public String getMessage() { + return "creature that died this turn"; + } + +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/DevotionCount.java b/Mage/src/mage/abilities/dynamicvalue/common/DevotionCount.java index fd8edb3ebe5..8036e623e81 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/DevotionCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/DevotionCount.java @@ -55,12 +55,12 @@ public class DevotionCount implements DynamicValue { @Override public String toString() { - return "put a number of"; + return "X"; } @Override public String getMessage() { - StringBuilder sb = new StringBuilder("devotion to "); + StringBuilder sb = new StringBuilder("your devotion to "); int count = 0; for (ColoredManaSymbol coloredManaSymbol : devotionColors) { if (count > 0) { diff --git a/Mage/src/mage/abilities/dynamicvalue/common/DomainValue.java b/Mage/src/mage/abilities/dynamicvalue/common/DomainValue.java index 06c0efeef47..9470119c0d6 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/DomainValue.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/DomainValue.java @@ -53,11 +53,10 @@ public class DomainValue implements DynamicValue { int haveSwamps = 0; int haveForests = 0; UUID targetPlayer; - if(playerId != null) { + if (playerId != null) { targetPlayer = playerId; - } - else if(countTargetPlayer) { - targetPlayer = sourceAbility.getTargets().getFirstTarget(); + } else if (countTargetPlayer) { + targetPlayer = effect.getTargetPointer().getFirst(game, sourceAbility); } else { targetPlayer = sourceAbility.getControllerId(); } diff --git a/Mage/src/mage/abilities/dynamicvalue/common/HighestConvertedManaCostValue.java b/Mage/src/mage/abilities/dynamicvalue/common/HighestConvertedManaCostValue.java new file mode 100644 index 00000000000..0acf8d10df0 --- /dev/null +++ b/Mage/src/mage/abilities/dynamicvalue/common/HighestConvertedManaCostValue.java @@ -0,0 +1,47 @@ +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author nigelzor + */ +public class HighestConvertedManaCostValue implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + int highCMC = 0; + Player controller = game.getPlayer(sourceAbility.getControllerId()); + if (controller != null) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(controller.getId())) { + if (permanent.getSpellAbility() != null) { + int cmc = permanent.getSpellAbility().getManaCosts().convertedManaCost(); + if (cmc > highCMC) { + highCMC = cmc; + } + } + } + } + return highCMC; + } + + @Override + public DynamicValue copy() { + return new HighestConvertedManaCostValue(); + } + + @Override + public String getMessage() { + return "the highest converted mana cost among permanents you control"; + } + + @Override + public String toString() { + return "X"; + } +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/SacrificeCostConvertedMana.java b/Mage/src/mage/abilities/dynamicvalue/common/SacrificeCostConvertedMana.java new file mode 100644 index 00000000000..5de2bff16dc --- /dev/null +++ b/Mage/src/mage/abilities/dynamicvalue/common/SacrificeCostConvertedMana.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * @author LoneFox + */ +public class SacrificeCostConvertedMana implements DynamicValue { + + private final String type; + + public SacrificeCostConvertedMana(String type) { + this.type = type; + } + + public SacrificeCostConvertedMana(SacrificeCostConvertedMana value) { + this.type = value.type; + } + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + for(Cost cost : sourceAbility.getCosts()) { + if(cost instanceof SacrificeTargetCost) { + SacrificeTargetCost sacrificeCost = (SacrificeTargetCost) cost; + int totalCMC = 0; + for(Permanent permanent : sacrificeCost.getPermanents()) { + totalCMC += permanent.getManaCost().convertedManaCost(); + } + return totalCMC; + } + } + return 0; + } + + @Override + public SacrificeCostConvertedMana copy() { + return new SacrificeCostConvertedMana(this); + } + + @Override + public String toString() { + return "X"; + } + + @Override + public String getMessage() { + return "the sacrificed " + type + "'s converted mana cost"; + } +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/UrzaTerrainValue.java b/Mage/src/mage/abilities/dynamicvalue/common/UrzaTerrainValue.java index 3db1e5f9aab..d3dd6be074c 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/UrzaTerrainValue.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/UrzaTerrainValue.java @@ -18,21 +18,24 @@ public class UrzaTerrainValue implements DynamicValue { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { FilterControlledPermanent pp = new FilterControlledPermanent("Urza's Power Plant"); - pp.add(new SubtypePredicate("Urza's Power-Plant")); + pp.add(new SubtypePredicate("Urza's")); + pp.add(new SubtypePredicate("Power-Plant")); PermanentsOnBattlefieldCount ppP = new PermanentsOnBattlefieldCount(pp); if (ppP.calculate(game, sourceAbility, effect) < 1) { return 1; } FilterControlledPermanent to = new FilterControlledPermanent("Urza's Tower"); - to.add(new SubtypePredicate("Urza's Tower")); + to.add(new SubtypePredicate("Urza's")); + to.add(new SubtypePredicate("Tower")); PermanentsOnBattlefieldCount toP = new PermanentsOnBattlefieldCount(to); if (toP.calculate(game, sourceAbility, effect) < 1) { return 1; } FilterControlledPermanent mi = new FilterControlledPermanent("Urza's Mine"); - mi.add(new SubtypePredicate("Urza's Mine")); + mi.add(new SubtypePredicate("Urza's")); + mi.add(new SubtypePredicate("Mine")); PermanentsOnBattlefieldCount miP = new PermanentsOnBattlefieldCount(mi); if (miP.calculate(game, sourceAbility, effect) < 1) { return 1; diff --git a/Mage/src/mage/abilities/effects/AsThoughEffect.java b/Mage/src/mage/abilities/effects/AsThoughEffect.java index c65b2638e78..a134aa53b72 100644 --- a/Mage/src/mage/abilities/effects/AsThoughEffect.java +++ b/Mage/src/mage/abilities/effects/AsThoughEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,17 +20,16 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects; import java.util.UUID; -import mage.constants.AsThoughEffectType; import mage.abilities.Ability; +import mage.constants.AsThoughEffectType; import mage.game.Game; /** @@ -40,7 +39,9 @@ import mage.game.Game; public interface AsThoughEffect extends ContinuousEffect { boolean applies(UUID sourceId, Ability affectedAbility, Ability source, Game game); + boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game); + AsThoughEffectType getAsThoughEffectType(); @Override diff --git a/Mage/src/mage/abilities/effects/AsThoughEffectImpl.java b/Mage/src/mage/abilities/effects/AsThoughEffectImpl.java index 5b2812b01d5..bd1448d8e9f 100644 --- a/Mage/src/mage/abilities/effects/AsThoughEffectImpl.java +++ b/Mage/src/mage/abilities/effects/AsThoughEffectImpl.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects; import java.util.UUID; @@ -54,7 +53,7 @@ public abstract class AsThoughEffectImpl extends ContinuousEffectImpl implements super(effect); this.type = effect.type; } - + @Override public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game) { return applies(objectId, source, affectedAbility.getControllerId(), game); diff --git a/Mage/src/mage/abilities/effects/AsThoughManaEffect.java b/Mage/src/mage/abilities/effects/AsThoughManaEffect.java new file mode 100644 index 00000000000..e6ba34f0f3d --- /dev/null +++ b/Mage/src/mage/abilities/effects/AsThoughManaEffect.java @@ -0,0 +1,45 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.constants.ManaType; +import mage.game.Game; +import mage.players.ManaPoolItem; + +/** + * + * @author LevelX2 + */ +public interface AsThoughManaEffect extends AsThoughEffect { + + // return a mana type that can be used to pay a mana cost instead of the normally needed mana type + ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game); + +} diff --git a/Mage/src/mage/abilities/effects/AuraReplacementEffect.java b/Mage/src/mage/abilities/effects/AuraReplacementEffect.java index 8c4a0e063e9..116930ba282 100644 --- a/Mage/src/mage/abilities/effects/AuraReplacementEffect.java +++ b/Mage/src/mage/abilities/effects/AuraReplacementEffect.java @@ -36,13 +36,13 @@ import mage.cards.Card; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentCard; -import mage.game.stack.Spell; import mage.game.stack.StackAbility; import mage.players.Player; import mage.target.Target; @@ -103,12 +103,12 @@ public class AuraReplacementEffect extends ReplacementEffectImpl { UUID targetId = null; MageObject sourceObject = game.getObject(sourceId); boolean enchantCardInGraveyard = false; - if (sourceObject instanceof Spell) { - if (fromZone.equals(Zone.EXILED)) { - // cast from exile (e.g. Neightveil Spector) -> no replacement - return false; - } - } +// if (sourceObject instanceof Spell) { +// if (fromZone.equals(Zone.EXILED)) { +// // cast from exile (e.g. Neightveil Spector) -> no replacement +// return false; +// } +// } if (sourceObject instanceof StackAbility) { StackAbility stackAbility = (StackAbility) sourceObject; if (!stackAbility.getEffects().isEmpty()) { @@ -116,25 +116,36 @@ public class AuraReplacementEffect extends ReplacementEffectImpl { } } + game.applyEffects(); // So continuousEffects are removed if previous effect of the same ability did move objects that cuase continuous effects if (targetId == null) { - Target target = card.getSpellAbility().getTargets().get(0); - enchantCardInGraveyard = target instanceof TargetCardInGraveyard; - if (target != null) { - target.clearChosen(); // neccessary if e.g. aura is blinked multiple times - } - Player player = game.getPlayer(card.getOwnerId()); - Outcome auraOutcome = Outcome.BoostCreature; - Ability: - for (Ability ability : card.getAbilities()) { - if (ability instanceof SpellAbility) { - for (Effect effect : ability.getEffects()) { - if (effect instanceof AttachEffect) { - auraOutcome = effect.getOutcome(); - break Ability; - } + SpellAbility spellAbility = card.getSpellAbility(); + if (spellAbility.getTargets().isEmpty()) { + for (Ability ability : card.getAbilities(game)) { + if ((ability instanceof SpellAbility) + && SpellAbilityType.BASE_ALTERNATE.equals(((SpellAbility) ability).getSpellAbilityType()) + && !ability.getTargets().isEmpty()) { + spellAbility = (SpellAbility) ability; + break; } } } + if (spellAbility.getTargets().isEmpty()) { + return false; + } + Target target = spellAbility.getTargets().get(0).copy(); + Outcome auraOutcome = Outcome.BoostCreature; + for (Effect effect : spellAbility.getEffects()) { + if (effect instanceof AttachEffect) { + auraOutcome = effect.getOutcome(); + break; + } + } + enchantCardInGraveyard = target instanceof TargetCardInGraveyard; + if (target != null) { + target.setNotTarget(true); // always not target because this way it's not handled targeted + target.clearChosen(); // neccessary if e.g. aura is blinked multiple times + } + Player player = game.getPlayer(card.getOwnerId()); if (target != null && player != null && player.choose(auraOutcome, target, card.getId(), game)) { targetId = target.getFirstTarget(); } @@ -149,45 +160,27 @@ public class AuraReplacementEffect extends ReplacementEffectImpl { } Player targetPlayer = game.getPlayer(targetId); if (targetCard != null || targetPermanent != null || targetPlayer != null) { - switch (fromZone) { - case EXILED: - game.getExile().removeCard(card, game); - break; - case GRAVEYARD: - game.getPlayer(card.getOwnerId()).removeFromGraveyard(card, game); - break; - case HAND: - game.getPlayer(card.getOwnerId()).removeFromHand(card, game); - break; - case LIBRARY: - game.getPlayer(card.getOwnerId()).removeFromLibrary(card, game); - break; - default: - } - game.rememberLKI(card.getId(), fromZone, card); - + card.removeFromZone(game, fromZone, sourceId); + card.updateZoneChangeCounter(game); PermanentCard permanent = new PermanentCard(card, card.getOwnerId(), game); game.getBattlefield().addPermanent(permanent); card.setZone(Zone.BATTLEFIELD, game); - game.applyEffects(); - boolean entered = permanent.entersBattlefield(event.getSourceId(), game, fromZone, true); - game.applyEffects(); - if (!entered) { - return false; - } - game.fireEvent(new ZoneChangeEvent(permanent, controllerId, fromZone, Zone.BATTLEFIELD)); + if (permanent.entersBattlefield(event.getSourceId(), game, fromZone, true)) { + if (targetCard != null) { + permanent.attachTo(targetCard.getId(), game); + } else if (targetPermanent != null) { + targetPermanent.addAttachment(permanent.getId(), game); + } else if (targetPlayer != null) { + targetPlayer.addAttachment(permanent.getId(), game); + } + game.applyEffects(); - if (targetCard != null) { - permanent.attachTo(targetCard.getId(), game); - } - if (targetPermanent != null) { - targetPermanent.addAttachment(permanent.getId(), game); - } - if (targetPlayer != null) { - targetPlayer.addAttachment(permanent.getId(), game); + game.fireEvent(new ZoneChangeEvent(permanent, controllerId, fromZone, Zone.BATTLEFIELD)); + return true; } + } - return true; + return false; } @Override @@ -198,7 +191,7 @@ public class AuraReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (((ZoneChangeEvent) event).getToZone().equals(Zone.BATTLEFIELD) - && !(((ZoneChangeEvent) event).getFromZone().equals(Zone.HAND))) { + && !(((ZoneChangeEvent) event).getFromZone().equals(Zone.STACK))) { Card card = game.getCard(event.getTargetId()); if (card != null && card.getCardType().contains(CardType.ENCHANTMENT) && card.hasSubtype("Aura")) { return true; diff --git a/Mage/src/mage/abilities/effects/ContinuousEffect.java b/Mage/src/mage/abilities/effects/ContinuousEffect.java index 5f6987ab47c..0e3635eeea9 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffect.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffect.java @@ -1,36 +1,38 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects; import java.util.List; +import java.util.Set; +import java.util.UUID; import mage.MageObjectReference; import mage.abilities.Ability; +import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.SubLayer; @@ -43,25 +45,44 @@ import mage.game.Game; public interface ContinuousEffect extends Effect { boolean isUsed(); + boolean isDiscarded(); + void discard(); + Duration getDuration(); + long getOrder(); + void setOrder(long order); + boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game); + boolean hasLayer(Layer layer); + boolean isInactive(Ability source, Game game); + void init(Ability source, Game game); + Layer getLayer(); + SubLayer getSublayer(); + void overrideRuleText(String text); + List getAffectedObjects(); + Set isDependentTo(List allEffectsInLayer); + + Set getDependencyTypes(); + @Override void newId(); + @Override ContinuousEffect copy(); - + boolean isTemporary(); + void setTemporary(boolean temporary); } diff --git a/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java b/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java index a3603203321..0d2a81670be 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java @@ -1,35 +1,36 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects; import java.util.ArrayList; +import java.util.EnumSet; import java.util.List; +import java.util.Set; import java.util.UUID; import mage.MageObjectReference; import mage.abilities.Ability; @@ -39,6 +40,7 @@ import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.constants.AbilityType; +import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.EffectType; import mage.constants.Layer; @@ -69,7 +71,8 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu protected boolean affectedObjectsSet = false; protected List affectedObjectList = new ArrayList<>(); protected boolean temporary = false; - + protected EnumSet dependencyTypes; + // until your next turn protected int startingTurn; protected UUID startingControllerId; @@ -79,6 +82,7 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu this.duration = duration; this.order = 0; this.effectType = EffectType.CONTINUOUS; + this.dependencyTypes = EnumSet.noneOf(DependencyType.class); } public ContinuousEffectImpl(Duration duration, Layer layer, SubLayer sublayer, Outcome outcome) { @@ -96,10 +100,11 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu this.used = effect.used; this.discarded = effect.discarded; this.affectedObjectsSet = effect.affectedObjectsSet; - this.affectedObjectList.addAll(effect.affectedObjectList); + this.affectedObjectList.addAll(effect.affectedObjectList); this.temporary = effect.temporary; this.startingTurn = effect.startingTurn; this.startingControllerId = effect.startingControllerId; + this.dependencyTypes = effect.dependencyTypes; } @Override @@ -148,8 +153,8 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu } /** - * Sets the discarded state of the effect. So it - * will be removed on next check. + * Sets the discarded state of the effect. So it will be removed on next + * check. */ @Override public void discard() { @@ -160,7 +165,7 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu public void init(Ability source, Game game) { targetPointer.init(game, source); //20100716 - 611.2c - if (AbilityType.ACTIVATED.equals(source.getAbilityType()) + if (AbilityType.ACTIVATED.equals(source.getAbilityType()) || AbilityType.SPELL.equals(source.getAbilityType()) || AbilityType.TRIGGERED.equals(source.getAbilityType())) { if (layer != null) { @@ -174,11 +179,10 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu case PTChangingEffects_7: this.affectedObjectsSet = true; } - } - else { - if (hasLayer(Layer.CopyEffects_1) || hasLayer(Layer.ControlChangingEffects_2) || hasLayer(Layer.TextChangingEffects_3) || - hasLayer(Layer.TypeChangingEffects_4) || hasLayer(Layer.ColorChangingEffects_5) || hasLayer(Layer.AbilityAddingRemovingEffects_6) || - hasLayer(Layer.PTChangingEffects_7)) { + } else { + if (hasLayer(Layer.CopyEffects_1) || hasLayer(Layer.ControlChangingEffects_2) || hasLayer(Layer.TextChangingEffects_3) + || hasLayer(Layer.TypeChangingEffects_4) || hasLayer(Layer.ColorChangingEffects_5) || hasLayer(Layer.AbilityAddingRemovingEffects_6) + || hasLayer(Layer.PTChangingEffects_7)) { this.affectedObjectsSet = true; } } @@ -226,7 +230,7 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu return true; } if (toughness instanceof DomainValue) { - return ((DomainValue)toughness).getAmount() < 0; + return ((DomainValue) toughness).getAmount() < 0; } return false; } @@ -237,8 +241,10 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu } /** - * Returns the status if the effect is temporary added to the ContinuousEffects - * @return + * Returns the status if the effect is temporary added to the + * ContinuousEffects + * + * @return */ @Override public boolean isTemporary() { @@ -250,4 +256,14 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu this.temporary = temporary; } + @Override + public Set isDependentTo(List allEffectsInLayer) { + return null; + } + + @Override + public EnumSet getDependencyTypes() { + return dependencyTypes; + } + } diff --git a/Mage/src/mage/abilities/effects/ContinuousEffects.java b/Mage/src/mage/abilities/effects/ContinuousEffects.java index a6030dc051b..6d6c73d06d4 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffects.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffects.java @@ -38,6 +38,7 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.UUID; import mage.MageObject; @@ -54,6 +55,7 @@ import mage.constants.CostModificationType; import mage.constants.Duration; import mage.constants.EffectType; import mage.constants.Layer; +import mage.constants.ManaType; import mage.constants.Outcome; import mage.constants.SpellAbilityType; import mage.constants.SubLayer; @@ -69,6 +71,7 @@ import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentCard; import mage.game.stack.Spell; +import mage.players.ManaPoolItem; import mage.players.Player; import mage.target.common.TargetCardInHand; import org.apache.log4j.Logger; @@ -79,7 +82,7 @@ import org.apache.log4j.Logger; */ public class ContinuousEffects implements Serializable { - private static final transient Logger logger = Logger.getLogger(ContinuousEffects.class); + private static final Logger logger = Logger.getLogger(ContinuousEffects.class); private long order = 0; @@ -385,7 +388,9 @@ public class ContinuousEffects implements Serializable { // for replacment effects of static abilities do not use LKI to check if to apply if (ability.getAbilityType() != AbilityType.STATIC || ability.isInUseableZone(game, null, event)) { if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) { - if (!game.getScopeRelevant() || effect.hasSelfScope() || !event.getTargetId().equals(ability.getSourceId())) { + if (!game.getScopeRelevant() + || effect.hasSelfScope() + || !event.getTargetId().equals(ability.getSourceId())) { if (effect.applies(event, ability, game)) { applicableAbilities.add(ability); } @@ -545,6 +550,37 @@ public class ContinuousEffects implements Serializable { } + public ManaType asThoughMana(ManaType manaType, ManaPoolItem mana, UUID objectId, Ability affectedAbility, UUID controllerId, Game game) { + // First check existing only effects + List asThoughEffectsList = getApplicableAsThoughEffects(AsThoughEffectType.SPEND_ONLY_MANA, game); + for (AsThoughEffect effect : asThoughEffectsList) { + HashSet abilities = asThoughEffectsMap.get(AsThoughEffectType.SPEND_ONLY_MANA).getAbility(effect.getId()); + for (Ability ability : abilities) { + if ((affectedAbility == null && effect.applies(objectId, ability, controllerId, game)) + || effect.applies(objectId, affectedAbility, ability, game)) { + if (((AsThoughManaEffect) effect).getAsThoughManaType(manaType, mana, controllerId, ability, game) == null) { + return null; + } + } + } + } + // then check effects that allow to use other mana types to pay the current mana type to pay + asThoughEffectsList = getApplicableAsThoughEffects(AsThoughEffectType.SPEND_OTHER_MANA, game); + for (AsThoughEffect effect : asThoughEffectsList) { + HashSet abilities = asThoughEffectsMap.get(AsThoughEffectType.SPEND_OTHER_MANA).getAbility(effect.getId()); + for (Ability ability : abilities) { + if ((affectedAbility == null && effect.applies(objectId, ability, controllerId, game)) + || effect.applies(objectId, affectedAbility, ability, game)) { + ManaType usableManaType = ((AsThoughManaEffect) effect).getAsThoughManaType(manaType, mana, controllerId, ability, game); + if (usableManaType != null) { + return usableManaType; + } + } + } + } + return manaType; + } + /** * Filters out asThough effects that are not active. * @@ -842,8 +878,10 @@ public class ContinuousEffects implements Serializable { } } // Must be called here for some effects to be able to work correctly - // TODO: add info which effects need that call - game.applyEffects(); + // For example: Vesuva copying a Dark Depth (VesuvaTest:testDarkDepth) + // This call should be removed if possible as replacement effects of EntersTheBattlefield events + // do no longer work correctly because the entering permanents are not yet on the battlefield (before they were). + // game.applyEffects(); } while (true); return caught; } @@ -851,8 +889,9 @@ public class ContinuousEffects implements Serializable { //20091005 - 613 public void apply(Game game) { removeInactiveEffects(game); - List layerEffects = getLayeredEffects(game); - List layer = filterLayeredEffects(layerEffects, Layer.CopyEffects_1); + List activeLayerEffects = getLayeredEffects(game); + + List layer = filterLayeredEffects(activeLayerEffects, Layer.CopyEffects_1); for (ContinuousEffect effect : layer) { HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { @@ -861,10 +900,10 @@ public class ContinuousEffects implements Serializable { } //Reload layerEffect if copy effects were applied if (layer.size() > 0) { - layerEffects = getLayeredEffects(game); + activeLayerEffects = getLayeredEffects(game); } - layer = filterLayeredEffects(layerEffects, Layer.ControlChangingEffects_2); + layer = filterLayeredEffects(activeLayerEffects, Layer.ControlChangingEffects_2); // apply control changing effects multiple times if it's needed // for cases when control over permanents with change control abilities is changed // e.g. Mind Control is controlled by Steal Enchantment @@ -882,55 +921,78 @@ public class ContinuousEffects implements Serializable { // reset control before reapplying control changing effects game.getBattlefield().resetPermanentsControl(); } - layer = filterLayeredEffects(layerEffects, Layer.TextChangingEffects_3); - for (ContinuousEffect effect : layer) { - HashSet abilities = layeredEffects.getAbility(effect.getId()); - for (Ability ability : abilities) { - effect.apply(Layer.TextChangingEffects_3, SubLayer.NA, ability, game); - } - } - layer = filterLayeredEffects(layerEffects, Layer.TypeChangingEffects_4); - for (ContinuousEffect effect : layer) { - HashSet abilities = layeredEffects.getAbility(effect.getId()); - for (Ability ability : abilities) { - effect.apply(Layer.TypeChangingEffects_4, SubLayer.NA, ability, game); - } - } - layer = filterLayeredEffects(layerEffects, Layer.ColorChangingEffects_5); - for (ContinuousEffect effect : layer) { - HashSet abilities = layeredEffects.getAbility(effect.getId()); - for (Ability ability : abilities) { - effect.apply(Layer.ColorChangingEffects_5, SubLayer.NA, ability, game); - } - } - Map> appliedEffects = new HashMap<>(); + applyLayer(activeLayerEffects, Layer.TextChangingEffects_3, game); + applyLayer(activeLayerEffects, Layer.TypeChangingEffects_4, game); + applyLayer(activeLayerEffects, Layer.ColorChangingEffects_5, game); + + Map> appliedEffectAbilities = new HashMap<>(); boolean done = false; + Map> waitingEffects = new LinkedHashMap<>(); + Set appliedEffects = new HashSet<>(); while (!done) { // loop needed if a added effect adds again an effect (e.g. Level 5- of Joraga Treespeaker) done = true; - layer = filterLayeredEffects(layerEffects, Layer.AbilityAddingRemovingEffects_6); + layer = filterLayeredEffects(activeLayerEffects, Layer.AbilityAddingRemovingEffects_6); for (ContinuousEffect effect : layer) { - if (layerEffects.contains(effect)) { - List appliedAbilities = appliedEffects.get(effect); + if (activeLayerEffects.contains(effect) && !appliedEffects.contains(effect.getId())) { // Effect does still exist and was not applied yet + Set dependentTo = effect.isDependentTo(layer); + if (dependentTo != null && !appliedEffects.containsAll(dependentTo)) { + waitingEffects.put(effect, dependentTo); + continue; + } + List appliedAbilities = appliedEffectAbilities.get(effect); HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { if (appliedAbilities == null || !appliedAbilities.contains(ability)) { if (appliedAbilities == null) { appliedAbilities = new ArrayList<>(); - appliedEffects.put(effect, appliedAbilities); + appliedEffectAbilities.put(effect, appliedAbilities); } appliedAbilities.add(ability); effect.apply(Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, ability, game); done = false; // list must be updated after each applied effect (eg. if "Turn to Frog" removes abilities) - layerEffects = getLayeredEffects(game); + activeLayerEffects = getLayeredEffects(game); + } + } + appliedEffects.add(effect.getId()); + + if (!waitingEffects.isEmpty()) { + // check if waiting effects can be applied now + for (Iterator>> iterator = waitingEffects.entrySet().iterator(); iterator.hasNext();) { + Map.Entry> entry = iterator.next(); + if (appliedEffects.containsAll(entry.getValue())) { // all dependent to effects are applied now so apply the effect itself + appliedAbilities = appliedEffectAbilities.get(entry.getKey()); + abilities = layeredEffects.getAbility(entry.getKey().getId()); + for (Ability ability : abilities) { + if (appliedAbilities == null || !appliedAbilities.contains(ability)) { + if (appliedAbilities == null) { + appliedAbilities = new ArrayList<>(); + appliedEffectAbilities.put(entry.getKey(), appliedAbilities); + } + appliedAbilities.add(ability); + entry.getKey().apply(Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, ability, game); + done = false; + // list must be updated after each applied effect (eg. if "Turn to Frog" removes abilities) + activeLayerEffects = getLayeredEffects(game); + } + } + appliedEffects.add(entry.getKey().getId()); + iterator.remove(); + } } } } } } - layer = filterLayeredEffects(layerEffects, Layer.PTChangingEffects_7); + layer = filterLayeredEffects(activeLayerEffects, Layer.PTChangingEffects_7); + for (ContinuousEffect effect : layer) { + HashSet abilities = layeredEffects.getAbility(effect.getId()); + for (Ability ability : abilities) { + effect.apply(Layer.PTChangingEffects_7, SubLayer.CharacteristicDefining_7a, ability, game); + } + } for (ContinuousEffect effect : layer) { HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { @@ -952,14 +1014,14 @@ public class ContinuousEffects implements Serializable { effect.apply(Layer.PTChangingEffects_7, SubLayer.SwitchPT_e, ability, game); } } - layer = filterLayeredEffects(layerEffects, Layer.PlayerEffects); + layer = filterLayeredEffects(activeLayerEffects, Layer.PlayerEffects); for (ContinuousEffect effect : layer) { HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { effect.apply(Layer.PlayerEffects, SubLayer.NA, ability, game); } } - layer = filterLayeredEffects(layerEffects, Layer.RulesEffects); + layer = filterLayeredEffects(activeLayerEffects, Layer.RulesEffects); for (ContinuousEffect effect : layer) { HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { @@ -968,6 +1030,42 @@ public class ContinuousEffects implements Serializable { } } + private void applyLayer(List activeLayerEffects, Layer currentLayer, Game game) { + List layer = filterLayeredEffects(activeLayerEffects, currentLayer); + if (!layer.isEmpty()) { + int numberOfEffects = layer.size(); + Set appliedEffects = new HashSet<>(); + Map> waitingEffects = new LinkedHashMap<>(); + for (ContinuousEffect effect : layer) { + if (numberOfEffects > 1) { // If an effect is dependent to not applied effects yet of this layer, so wait to apply this effect + Set dependentTo = effect.isDependentTo(layer); + if (dependentTo != null && !appliedEffects.containsAll(dependentTo)) { + waitingEffects.put(effect, dependentTo); + continue; + } + } + applyContinuousEffect(effect, currentLayer, game); + appliedEffects.add(effect.getId()); + if (!waitingEffects.isEmpty()) { + // check if waiting effects can be applied now + for (Entry> entry : waitingEffects.entrySet()) { + if (appliedEffects.containsAll(entry.getValue())) { // all dependent to effects are applied now so apply the effect itself + applyContinuousEffect(entry.getKey(), currentLayer, game); + appliedEffects.add(entry.getKey().getId()); + } + } + } + } + } + } + + private void applyContinuousEffect(ContinuousEffect effect, Layer currentLayer, Game game) { + HashSet abilities = layeredEffects.getAbility(effect.getId()); + for (Ability ability : abilities) { + effect.apply(currentLayer, SubLayer.NA, ability, game); + } + } + /** * Adds a continuous ability with a reference to a sourceId. It's used for * effects that cease to exist again So this effects were removed again @@ -1059,18 +1157,18 @@ public class ContinuousEffects implements Serializable { } } - private void setControllerForEffect(ContinuousEffectsList effects, UUID cardId, UUID controllerId) { + private void setControllerForEffect(ContinuousEffectsList effects, UUID sourceId, UUID controllerId) { for (Effect effect : effects) { HashSet abilities = effects.getAbility(effect.getId()); if (abilities != null) { for (Ability ability : abilities) { if (ability.getSourceId() != null) { - if (ability.getSourceId().equals(cardId)) { + if (ability.getSourceId().equals(sourceId)) { ability.setControllerId(controllerId); } } else { if (!ability.getZone().equals(Zone.COMMAND)) { - logger.fatal(new StringBuilder("No sourceId Ability: ").append(ability)); + logger.fatal("Continuous effect for ability with no sourceId Ability: " + ability); } } } @@ -1158,7 +1256,7 @@ public class ContinuousEffects implements Serializable { HashSet abilities = preventionEffects.getAbility(effect.getId()); for (Ability ability : abilities) { if (ability.getSourceId().equals(sourceId)) { - if (controllerFound == null || controllerFound == ability.getControllerId()) { + if (controllerFound == null || controllerFound.equals(ability.getControllerId())) { controllerFound = ability.getControllerId(); } else { // not unique controller - No solution yet @@ -1170,13 +1268,17 @@ public class ContinuousEffects implements Serializable { for (ReplacementEffect effect : replacementEffects) { HashSet abilities = replacementEffects.getAbility(effect.getId()); for (Ability ability : abilities) { - if (ability.getSourceId().equals(sourceId)) { - if (controllerFound == null || controllerFound == ability.getControllerId()) { - controllerFound = ability.getControllerId(); - } else { - // not unique controller - No solution yet - return null; + if (ability.getSourceId() != null) { + if (ability.getSourceId().equals(sourceId)) { + if (controllerFound == null || controllerFound.equals(ability.getControllerId())) { + controllerFound = ability.getControllerId(); + } else { + // not unique controller - No solution yet + return null; + } } + } else { + logger.warn("Ability without sourceId:" + ability.getRule()); } } } diff --git a/Mage/src/mage/abilities/effects/ContinuousEffectsList.java b/Mage/src/mage/abilities/effects/ContinuousEffectsList.java index cbad22a927f..234a30e4564 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffectsList.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffectsList.java @@ -1,30 +1,30 @@ /* -* Copyright 2012 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL , EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2012 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL , EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects; import java.util.ArrayList; @@ -46,18 +46,19 @@ import org.apache.log4j.Logger; * @param */ public class ContinuousEffectsList extends ArrayList { - + private static final Logger logger = Logger.getLogger(ContinuousEffectsList.class); // the effectAbilityMap holds for each effect all abilities that are connected (used) with this effect private final Map> effectAbilityMap = new HashMap<>(); - public ContinuousEffectsList() { } + public ContinuousEffectsList() { + } public ContinuousEffectsList(final ContinuousEffectsList effects) { this.ensureCapacity(effects.size()); - for (ContinuousEffect cost: effects) { - this.add((T)cost.copy()); + for (ContinuousEffect cost : effects) { + this.add((T) cost.copy()); } for (Map.Entry> entry : effects.effectAbilityMap.entrySet()) { HashSet newSet = new HashSet<>(); @@ -113,12 +114,12 @@ public class ContinuousEffectsList extends ArrayList Ability ability = it.next(); if (ability == null) { it.remove(); - } else if (ability instanceof MageSingleton) { + } else if (ability instanceof MageSingleton) { return false; - } else if (effect.isDiscarded()) { + } else if (effect.isDiscarded()) { it.remove(); } else { - switch(effect.getDuration()) { + switch (effect.getDuration()) { case WhileOnBattlefield: case WhileInGraveyard: case WhileOnStack: @@ -133,8 +134,8 @@ public class ContinuousEffectsList extends ArrayList break; case Custom: case UntilYourNextTurn: - if (effect.isInactive(ability , game)) { - it.remove(); + if (effect.isInactive(ability, game)) { + it.remove(); } } } @@ -143,9 +144,9 @@ public class ContinuousEffectsList extends ArrayList } /** - * Adds an effect and its connected ability to the list. - * For each effect will be stored, which abilities are connected to the effect. - * So an effect can be connected to multiple abilities. + * Adds an effect and its connected ability to the list. For each effect + * will be stored, which abilities are connected to the effect. So an effect + * can be connected to multiple abilities. * * @param effect - effect to add * @param source - connected ability @@ -153,8 +154,8 @@ public class ContinuousEffectsList extends ArrayList public void addEffect(T effect, Ability source) { if (effectAbilityMap.containsKey(effect.getId())) { HashSet set = effectAbilityMap.get(effect.getId()); - for (Ability ability: set) { - if (ability.getId().equals(source.getId()) && ability.getSourceId().equals(source.getSourceId()) ) { + for (Ability ability : set) { + if (ability.getId().equals(source.getId()) && ability.getSourceId().equals(source.getSourceId())) { return; } } diff --git a/Mage/src/mage/abilities/effects/ContinuousRuleModifyingEffectImpl.java b/Mage/src/mage/abilities/effects/ContinuousRuleModifyingEffectImpl.java index 5dcf58d5e90..541873718fc 100644 --- a/Mage/src/mage/abilities/effects/ContinuousRuleModifyingEffectImpl.java +++ b/Mage/src/mage/abilities/effects/ContinuousRuleModifyingEffectImpl.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects; import mage.MageObject; @@ -45,20 +44,18 @@ public abstract class ContinuousRuleModifyingEffectImpl extends ContinuousEffect protected final boolean messageToUser; protected final boolean messageToGameLog; protected final String infoMessage; - + // 613.10 - // Some continuous effects affect game rules rather than objects. For example, effects may modify + // Some continuous effects affect game rules rather than objects. For example, effects may modify // a player’s maximum hand size, or say that a creature must attack this turn if able. These effects // are applied after all other continuous effects have been applied. Continuous effects that affect - // the costs of spells or abilities are applied according to the order specified in rule 601.2e. - // All other such effects are applied in timestamp order. See also the rules for timestamp order + // the costs of spells or abilities are applied according to the order specified in rule 601.2e. + // All other such effects are applied in timestamp order. See also the rules for timestamp order // and dependency (rules 613.6 and 613.7). - // Some of this rule modifying effects are implemented as normal CONTINUOUS effects using the Layer.RulesEffects. // But if the rule change can be implemented simply by preventing an event from happening, CONTINUOUS_RULE_MODIFICATION effects can be used. - // They work technical like a replacement effect that replaces the event completely. + // They work technical like a replacement effect that replaces the event completely. // But player isn't asked to choose order of effects if multiple are applied to the same event. - public ContinuousRuleModifyingEffectImpl(Duration duration, Outcome outcome) { this(duration, outcome, true, false); } @@ -67,11 +64,13 @@ public abstract class ContinuousRuleModifyingEffectImpl extends ContinuousEffect * * @param duration * @param outcome - * @param messageToUser - Every time the effect replaces an event, the user gets a message in a dialog window. - * Don't set it to true if the event happens regularly or very often. The message itself can be - * changed by overriding the getInfoMessage method. - * @param messageToLog - Every time the effect replaces an event, a message is posted to the game log. The message - * can be changed by overriding the getInfoMessage method. + * @param messageToUser - Every time the effect replaces an event, the user + * gets a message in a dialog window. Don't set it to true if the event + * happens regularly or very often. The message itself can be changed by + * overriding the getInfoMessage method. + * @param messageToLog - Every time the effect replaces an event, a message + * is posted to the game log. The message can be changed by overriding the + * getInfoMessage method. */ public ContinuousRuleModifyingEffectImpl(Duration duration, Outcome outcome, boolean messageToUser, boolean messageToLog) { super(duration, outcome); @@ -89,9 +88,11 @@ public abstract class ContinuousRuleModifyingEffectImpl extends ContinuousEffect } /** - * An early check for the event types this effect applies to. This check was added - * to speed up event handling. Once all existing ContinuousRuleModifiyingEffects have - * implemented this method, the method should be changed to abstract here or removed. + * An early check for the event types this effect applies to. This check was + * added to speed up event handling. Once all existing + * ContinuousRuleModifiyingEffects have implemented this method, the method + * should be changed to abstract here or removed. + * * @param event * @param game * @return @@ -112,10 +113,10 @@ public abstract class ContinuousRuleModifyingEffectImpl extends ContinuousEffect String message; MageObject object = game.getObject(source.getSourceId()); if (object != null) { - message = source.getRule(object.getLogName()); + message = source.getRule(messageToUser ? object.getIdName() : object.getLogName()); } else { message = source.getRule(); - } + } return message; } else { return infoMessage; @@ -132,5 +133,4 @@ public abstract class ContinuousRuleModifyingEffectImpl extends ContinuousEffect return messageToGameLog; } - } diff --git a/Mage/src/mage/abilities/effects/CopyCardEffect.java b/Mage/src/mage/abilities/effects/CopyCardEffect.java deleted file mode 100644 index 3435e707673..00000000000 --- a/Mage/src/mage/abilities/effects/CopyCardEffect.java +++ /dev/null @@ -1,51 +0,0 @@ -package mage.abilities.effects; - -import mage.abilities.Ability; -import mage.cards.Card; -import mage.constants.Outcome; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; -import mage.util.CardUtil; - -/** - * Created by glerman on 20/6/15. - */ -public class CopyCardEffect extends OneShotEffect { - - private final Card card; - private final int copies; - - public CopyCardEffect(Card card, int copies) { - super(Outcome.PutCreatureInPlay); - this.card = card; - this.copies = copies; - staticText = "Put a token onto the battlefield that's a copy of {this}"; - } - - public CopyCardEffect(final CopyCardEffect effect) { - super(effect); - this.card = effect.card; - this.copies = effect.copies; - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - } - if (permanent != null) { - EmptyToken newToken = new EmptyToken(); - CardUtil.copyTo(newToken).from(permanent); - return newToken.putOntoBattlefield(copies, game, source.getSourceId(), source.getControllerId()); - } - return false; - } - - @Override - public CopyCardEffect copy() { - return new CopyCardEffect(this); - } -} diff --git a/Mage/src/mage/abilities/effects/Effects.java b/Mage/src/mage/abilities/effects/Effects.java index 0dff8f53322..36a78daa694 100644 --- a/Mage/src/mage/abilities/effects/Effects.java +++ b/Mage/src/mage/abilities/effects/Effects.java @@ -89,7 +89,7 @@ public class Effects extends ArrayList { !lastRule.endsWith("\"") && !lastRule.startsWith("Level ") && !lastRule.endsWith(".)") && - !lastRule.endsWith("") ) { + !lastRule.endsWith("") ) { sbText.append("."); } return sbText.toString(); diff --git a/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java b/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java index 90bdfaf14c3..052d4ee5d4b 100644 --- a/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java +++ b/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java @@ -1,42 +1,43 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects; -import mage.constants.Duration; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.condition.Condition; +import mage.constants.Duration; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; +import mage.game.stack.StackObject; import mage.players.Player; /** @@ -64,10 +65,6 @@ public class EntersBattlefieldEffect extends ReplacementEffectImpl { this(baseEffect, null, text, true, optional); } - public EntersBattlefieldEffect(Effect baseEffect, Condition condition, String text) { - this(baseEffect, condition, text, true, false); - } - public EntersBattlefieldEffect(Effect baseEffect, Condition condition, String text, boolean selfScope, boolean optional) { super(Duration.WhileOnBattlefield, baseEffect.getOutcome(), selfScope); this.baseEffects.add(baseEffect); @@ -111,24 +108,29 @@ public class EntersBattlefieldEffect extends ReplacementEffectImpl { if (controller == null || object == null) { return false; } - if (!controller.chooseUse(outcome, new StringBuilder("Use effect of ").append(object.getLogName()).append("?").toString(), source, game)) { + if (!controller.chooseUse(outcome, "Use effect of " + object.getLogName() + "?", source, game)) { return false; } } Spell spell = game.getStack().getSpell(event.getSourceId()); - for (Effect effect: baseEffects) { - if (source.activate(game, false)) { - if (effect instanceof ContinuousEffect) { - game.addEffect((ContinuousEffect) effect, source); - } - else { - if (spell != null) { - effect.setValue(SOURCE_CAST_SPELL_ABILITY, spell.getSpellAbility()); - } - effect.apply(game, source); - } + if (spell == null) { + StackObject stackObject = (StackObject) game.getLastKnownInformation(event.getSourceId(), Zone.STACK); + if (stackObject instanceof Spell) { + spell = (Spell) stackObject; } } + for (Effect effect : baseEffects) { + // if (source.activate(game, false)) { // Why is this needed???? + if (effect instanceof ContinuousEffect) { + game.addEffect((ContinuousEffect) effect, source); + } else { + if (spell != null) { + effect.setValue(SOURCE_CAST_SPELL_ABILITY, spell.getSpellAbility()); + } + effect.apply(game, source); + } + // } + } return false; } diff --git a/Mage/src/mage/abilities/effects/PlaneswalkerRedirectionEffect.java b/Mage/src/mage/abilities/effects/PlaneswalkerRedirectionEffect.java index 7f2ee3c504d..e435a88f4c4 100644 --- a/Mage/src/mage/abilities/effects/PlaneswalkerRedirectionEffect.java +++ b/Mage/src/mage/abilities/effects/PlaneswalkerRedirectionEffect.java @@ -109,6 +109,7 @@ public class PlaneswalkerRedirectionEffect extends RedirectionEffect { if (permanent != null) { return permanent.getControllerId(); } - return null; + // for effects like Deflecting Palm (could be wrong if card was played multiple times by different players) + return game.getContinuousEffects().getControllerOfSourceId(sourceId); } } diff --git a/Mage/src/mage/abilities/effects/PutTokenOntoBattlefieldCopySourceEffect.java b/Mage/src/mage/abilities/effects/PutTokenOntoBattlefieldCopySourceEffect.java new file mode 100644 index 00000000000..ac09d741514 --- /dev/null +++ b/Mage/src/mage/abilities/effects/PutTokenOntoBattlefieldCopySourceEffect.java @@ -0,0 +1,47 @@ +package mage.abilities.effects; + +import mage.abilities.Ability; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * Created by glerman on 20/6/15. + */ +public class PutTokenOntoBattlefieldCopySourceEffect extends OneShotEffect { + + private final int number; + + public PutTokenOntoBattlefieldCopySourceEffect() { + this(1); + } + + public PutTokenOntoBattlefieldCopySourceEffect(int copies) { + super(Outcome.PutCreatureInPlay); + this.number = copies; + staticText = "put a token onto the battlefield that's a copy of {this}"; + } + + public PutTokenOntoBattlefieldCopySourceEffect(final PutTokenOntoBattlefieldCopySourceEffect effect) { + super(effect); + this.number = effect.number; + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (permanent != null) { + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(source.getControllerId(), null, false, number); + effect.setTargetPointer(new FixedTarget(source.getSourceId())); + return effect.apply(game, source); + } + return false; + } + + @Override + public PutTokenOntoBattlefieldCopySourceEffect copy() { + return new PutTokenOntoBattlefieldCopySourceEffect(this); + } +} diff --git a/Mage/src/mage/abilities/effects/RedirectionEffect.java b/Mage/src/mage/abilities/effects/RedirectionEffect.java index 6c339460edf..7979ad8f1b1 100644 --- a/Mage/src/mage/abilities/effects/RedirectionEffect.java +++ b/Mage/src/mage/abilities/effects/RedirectionEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects; import mage.abilities.Ability; @@ -46,36 +45,67 @@ import mage.target.Target; public abstract class RedirectionEffect extends ReplacementEffectImpl { protected Target redirectTarget; + protected int amountToRedirect; + protected boolean oneUsage; public RedirectionEffect(Duration duration) { + this(duration, Integer.MAX_VALUE, false); + } + + public RedirectionEffect(Duration duration, int amountToRedirect, boolean oneUsage) { super(duration, Outcome.RedirectDamage); this.effectType = EffectType.REDIRECTION; + this.amountToRedirect = amountToRedirect; + this.oneUsage = oneUsage; } public RedirectionEffect(final RedirectionEffect effect) { super(effect); this.redirectTarget = effect.redirectTarget; + this.amountToRedirect = effect.amountToRedirect; + this.oneUsage = effect.oneUsage; } @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - DamageEvent damageEvent = (DamageEvent)event; - Permanent permanent = game.getPermanent(redirectTarget.getFirstTarget()); - if (permanent != null) { - permanent.damage(damageEvent.getAmount(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects()); - return true; - } - Player player = game.getPlayer(redirectTarget.getFirstTarget()); - if (player != null) { - player.damage(damageEvent.getAmount(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects()); - return true; + public boolean checksEventType(GameEvent event, Game game) { + switch (event.getType()) { + case DAMAGE_CREATURE: + case DAMAGE_PLAYER: + case DAMAGE_PLANESWALKER: + return true; } return false; } + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + String sourceLogName = source != null ? game.getObject(source.getSourceId()).getLogName() + ": " : ""; + DamageEvent damageEvent = (DamageEvent) event; + int restDamage = 0; + int damageToRedirect = event.getAmount(); + if (damageEvent.getAmount() > amountToRedirect) { + restDamage = damageEvent.getAmount() - amountToRedirect; + damageToRedirect = amountToRedirect; + } + if (damageToRedirect > 0 && oneUsage) { + this.discard(); + } + Permanent permanent = game.getPermanent(redirectTarget.getFirstTarget()); + if (permanent != null) { + permanent.damage(damageToRedirect, event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects()); + game.informPlayers(sourceLogName + "Redirected " + damageToRedirect + " damage to " + permanent.getLogName()); + } else { + Player player = game.getPlayer(redirectTarget.getFirstTarget()); + if (player != null) { + player.damage(damageToRedirect, event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects()); + game.informPlayers(sourceLogName + "Redirected " + damageToRedirect + " damage to " + player.getLogName()); + } + } + if (restDamage > 0) { + damageEvent.setAmount(restDamage); + return false; + } + return true; + } + } diff --git a/Mage/src/mage/abilities/effects/ReplacementEffectImpl.java b/Mage/src/mage/abilities/effects/ReplacementEffectImpl.java index a0c22083815..9d77944003c 100644 --- a/Mage/src/mage/abilities/effects/ReplacementEffectImpl.java +++ b/Mage/src/mage/abilities/effects/ReplacementEffectImpl.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects; import mage.abilities.Ability; @@ -50,13 +49,19 @@ public abstract class ReplacementEffectImpl extends ContinuousEffectImpl impleme // the resolution of spells or abilities that changed the permanent's characteristics on the stack // (see rule 400.7a), and continuous effects from the permanent's own static abilities, but ignoring // continuous effects from any other source that would affect it. - protected boolean selfScope; public ReplacementEffectImpl(Duration duration, Outcome outcome) { this(duration, outcome, true); } + /** + * + * @param duration + * @param outcome + * @param selfScope - is only relevant while permanents entering the + * battlefield events + */ public ReplacementEffectImpl(Duration duration, Outcome outcome, boolean selfScope) { super(duration, outcome); this.effectType = EffectType.REPLACEMENT; diff --git a/Mage/src/mage/abilities/effects/common/AddConditionalColorlessManaEffect.java b/Mage/src/mage/abilities/effects/common/AddConditionalColorlessManaEffect.java index 495d234b7a5..7e0de77c756 100644 --- a/Mage/src/mage/abilities/effects/common/AddConditionalColorlessManaEffect.java +++ b/Mage/src/mage/abilities/effects/common/AddConditionalColorlessManaEffect.java @@ -3,7 +3,6 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ - package mage.abilities.effects.common; import mage.Mana; @@ -16,7 +15,6 @@ import mage.players.Player; * * @author LevelX2 */ - public class AddConditionalColorlessManaEffect extends ManaEffect { private final int amount; @@ -26,7 +24,7 @@ public class AddConditionalColorlessManaEffect extends ManaEffect { super(); this.amount = amount; this.manaBuilder = manaBuilder; - staticText = "Add {" + amount + "} to your mana pool. " + manaBuilder.getRule(); + staticText = "Add {" + amount + "} to your mana pool. " + manaBuilder.getRule(); } public AddConditionalColorlessManaEffect(final AddConditionalColorlessManaEffect effect) { @@ -54,4 +52,8 @@ public class AddConditionalColorlessManaEffect extends ManaEffect { public Mana getMana(Game game, Ability source) { return manaBuilder.setMana(Mana.ColorlessMana(amount), source, game).build(); } + + public Mana getMana() { + return new Mana(0, 0, 0, 0, 0, amount, 0); + } } diff --git a/Mage/src/mage/abilities/effects/common/AddConditionalManaOfAnyColorEffect.java b/Mage/src/mage/abilities/effects/common/AddConditionalManaOfAnyColorEffect.java index 1b37d1e395d..e0275a85c62 100644 --- a/Mage/src/mage/abilities/effects/common/AddConditionalManaOfAnyColorEffect.java +++ b/Mage/src/mage/abilities/effects/common/AddConditionalManaOfAnyColorEffect.java @@ -59,9 +59,9 @@ public class AddConditionalManaOfAnyColorEffect extends ManaEffect { this.manaBuilder = manaBuilder; this.oneChoice = oneChoice; // - staticText = "Add " + amount + " mana of " + - (oneChoice ? "any one color":"in any combination of colors") + - " to your mana pool. " + manaBuilder.getRule(); + staticText = "Add " + amount + " mana of " + + (oneChoice ? "any one color" : "in any combination of colors") + + " to your mana pool. " + manaBuilder.getRule(); } public AddConditionalManaOfAnyColorEffect(final AddConditionalManaOfAnyColorEffect effect) { @@ -85,7 +85,7 @@ public class AddConditionalManaOfAnyColorEffect extends ManaEffect { int value = amount.calculate(game, source, this); boolean result = false; - ChoiceColor choice = new ChoiceColor(); + ChoiceColor choice = new ChoiceColor(false); for (int i = 0; i < value; i++) { if (!choice.isChosen()) { if (!controller.choose(outcome, choice, game)) { @@ -115,7 +115,6 @@ public class AddConditionalManaOfAnyColorEffect extends ManaEffect { } } - return result; } diff --git a/Mage/src/mage/abilities/effects/common/AddManaInAnyCombinationEffect.java b/Mage/src/mage/abilities/effects/common/AddManaInAnyCombinationEffect.java index 4a87a976677..722fc0468d9 100644 --- a/Mage/src/mage/abilities/effects/common/AddManaInAnyCombinationEffect.java +++ b/Mage/src/mage/abilities/effects/common/AddManaInAnyCombinationEffect.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; import java.util.ArrayList; @@ -62,17 +61,17 @@ public class AddManaInAnyCombinationEffect extends ManaEffect { this.amount = amount; this.staticText = setText(); } - + public AddManaInAnyCombinationEffect(int amount, String text) { this(amount); this.staticText = text; } - + public AddManaInAnyCombinationEffect(int amount, String text, ColoredManaSymbol... coloredManaSymbols) { this(amount, coloredManaSymbols); this.staticText = text; } - + public AddManaInAnyCombinationEffect(DynamicValue amount, String text, ColoredManaSymbol... coloredManaSymbols) { this(amount, coloredManaSymbols); this.staticText = text; @@ -92,13 +91,13 @@ public class AddManaInAnyCombinationEffect extends ManaEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player != null){ + if (player != null) { Mana mana = new Mana(); int amountOfManaLeft = amount.calculate(game, source, this); while (amountOfManaLeft > 0 && player.canRespond()) { - for (ColoredManaSymbol coloredManaSymbol: manaSymbols) { - int number = player.getAmount(0, amountOfManaLeft, new StringBuilder("How many ").append(coloredManaSymbol.name()).append(" mana?").toString(), game); + for (ColoredManaSymbol coloredManaSymbol : manaSymbols) { + int number = player.getAmount(0, amountOfManaLeft, "How many " + coloredManaSymbol.getColorName() + " mana?", game); if (number > 0) { for (int i = 0; i < number; i++) { mana.add(new Mana(coloredManaSymbol)); @@ -111,7 +110,7 @@ public class AddManaInAnyCombinationEffect extends ManaEffect { } } checkToFirePossibleEvents(mana, game, source); - player.getManaPool().addMana(mana, game, source); + player.getManaPool().addMana(mana, game, source); return true; } return false; @@ -130,7 +129,7 @@ public class AddManaInAnyCombinationEffect extends ManaEffect { sb.append("colors"); } else { int i = 0; - for (ColoredManaSymbol coloredManaSymbol: manaSymbols) { + for (ColoredManaSymbol coloredManaSymbol : manaSymbols) { i++; if (i > 1) { sb.append(" and/or "); diff --git a/Mage/src/mage/abilities/effects/common/AmplifyEffect.java b/Mage/src/mage/abilities/effects/common/AmplifyEffect.java index a06e008ad7a..b05ddd626c1 100644 --- a/Mage/src/mage/abilities/effects/common/AmplifyEffect.java +++ b/Mage/src/mage/abilities/effects/common/AmplifyEffect.java @@ -19,6 +19,7 @@ import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -27,15 +28,13 @@ import mage.target.common.TargetCardInHand; /** * Effect for the AmplifyAbility * - * 702.37. Amplify - * 702.37a Amplify is a static ability. “Amplify N” means “As - * this object enters the battlefield, reveal any number of cards from your hand - * that share a creature type with it. This permanent enters the battlefield - * with N +1/+1 counters on it for each card revealed this way. You can’t reveal - * this card or any other cards that are entering the battlefield at the same - * time as this card.” - * 702.37b If a creature has multiple instances of amplify, - * each one works separately. + * 702.37. Amplify 702.37a Amplify is a static ability. “Amplify N” means “As + * this object enters the battlefield, reveal any number of cards from your hand + * that share a creature type with it. This permanent enters the battlefield + * with N +1/+1 counters on it for each card revealed this way. You can’t reveal + * this card or any other cards that are entering the battlefield at the same + * time as this card.” 702.37b If a creature has multiple instances of amplify, + * each one works separately. * * * @author FenrisulfrX @@ -45,6 +44,7 @@ public class AmplifyEffect extends ReplacementEffectImpl { private final AmplifyFactor amplifyFactor; public enum AmplifyFactor { + Amplify1("Amplify 1", "put one +1/+1 counters on it", 1), Amplify2("Amplify 2", "put two +1/+1 counters on it", 2), Amplify3("Amplify 3", "put three +1/+1 counters on it", 3); @@ -95,7 +95,7 @@ public class AmplifyEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent sourceCreature = game.getPermanent(event.getTargetId()); + Permanent sourceCreature = ((EntersTheBattlefieldEvent) event).getTarget(); Player controller = game.getPlayer(source.getControllerId()); if (controller != null && sourceCreature != null) { FilterCreatureCard filter = new FilterCreatureCard("creatures cards to reveal"); @@ -108,7 +108,7 @@ public class AmplifyEffect extends ReplacementEffectImpl { } else if (filterSubtypes.size() == 1) { filter.add(filterSubtypes.get(0)); } - if (controller.getHand().count(filter, source.getSourceId(), source.getControllerId(), game) > 0){ + if (controller.getHand().count(filter, source.getSourceId(), source.getControllerId(), game) > 0) { if (controller.chooseUse(outcome, "Reveal cards to Amplify?", source, game)) { TargetCardInHand target = new TargetCardInHand(0, Integer.MAX_VALUE, filter); if (controller.chooseTarget(outcome, target, source, game) && !target.getTargets().isEmpty()) { @@ -116,7 +116,7 @@ public class AmplifyEffect extends ReplacementEffectImpl { cards.addAll(target.getTargets()); int amountCounters = cards.size() * amplifyFactor.getFactor(); sourceCreature.addCounters(CounterType.P1P1.createInstance(amountCounters), game); - controller.revealCards(sourceCreature.getName(), cards, game); + controller.revealCards(sourceCreature.getIdName(), cards, game); } } } @@ -128,11 +128,11 @@ public class AmplifyEffect extends ReplacementEffectImpl { public String getText(Mode mode) { StringBuilder sb = new StringBuilder(amplifyFactor.toString()); sb.append("(As this enter the battlefield, "); - sb.append(amplifyFactor.getRuleText()).append(" for each card" + - " you reveal that shares a type with it in your hand.)"); + sb.append(amplifyFactor.getRuleText()).append(" for each card" + + " you reveal that shares a type with it in your hand.)"); return sb.toString(); } - + @Override public AmplifyEffect copy() { return new AmplifyEffect(this); diff --git a/Mage/src/mage/abilities/effects/common/BasicManaEffect.java b/Mage/src/mage/abilities/effects/common/BasicManaEffect.java index b98d1dd7efb..95e7faa8eac 100644 --- a/Mage/src/mage/abilities/effects/common/BasicManaEffect.java +++ b/Mage/src/mage/abilities/effects/common/BasicManaEffect.java @@ -6,18 +6,19 @@ import mage.abilities.Ability; import mage.game.Game; public class BasicManaEffect extends ManaEffect { + protected Mana mana; public BasicManaEffect(Mana mana) { super(); this.mana = mana; - staticText = "Add " + mana.toString() + " to your mana pool"; + staticText = "add " + mana.toString() + " to your mana pool"; } public BasicManaEffect(ConditionalMana conditionalMana) { super(); this.mana = conditionalMana; - staticText = "Add " + mana.toString() + " to your mana pool. " + conditionalMana.getDescription(); + staticText = "add " + mana.toString() + " to your mana pool. " + conditionalMana.getDescription(); } public BasicManaEffect(final BasicManaEffect effect) { diff --git a/Mage/src/mage/abilities/effects/common/CantBeCounteredControlledEffect.java b/Mage/src/mage/abilities/effects/common/CantBeCounteredControlledEffect.java index 4776c73bf84..1d4de4da42d 100644 --- a/Mage/src/mage/abilities/effects/common/CantBeCounteredControlledEffect.java +++ b/Mage/src/mage/abilities/effects/common/CantBeCounteredControlledEffect.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; import mage.MageObject; @@ -89,7 +88,7 @@ public class CantBeCounteredControlledEffect extends ContinuousRuleModifyingEffe public boolean applies(GameEvent event, Ability source, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getControllerId().equals(source.getControllerId()) - && filterTarget.match(spell, source.getControllerId(), game)) { + && filterTarget.match(spell, source.getSourceId(), source.getControllerId(), game)) { if (filterSource == null) { return true; } else { diff --git a/Mage/src/mage/abilities/effects/common/CantBeTargetedAllEffect.java b/Mage/src/mage/abilities/effects/common/CantBeTargetedAllEffect.java index 8fd76143d28..6e4322ca0cb 100644 --- a/Mage/src/mage/abilities/effects/common/CantBeTargetedAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/CantBeTargetedAllEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; import mage.abilities.Ability; @@ -60,7 +59,6 @@ public class CantBeTargetedAllEffect extends ContinuousRuleModifyingEffectImpl { setText(); } - public CantBeTargetedAllEffect(final CantBeTargetedAllEffect effect) { super(effect); if (effect.filterTarget != null) { @@ -92,10 +90,9 @@ public class CantBeTargetedAllEffect extends ContinuousRuleModifyingEffectImpl { if (permanent != null && filterTarget.match(permanent, source.getSourceId(), source.getControllerId(), game)) { if (filterSource == null) { return true; - } - else { + } else { StackObject sourceObject = game.getStack().getStackObject(event.getSourceId()); - if (sourceObject != null && filterSource.match(sourceObject, sourceObject.getSourceId(), game)) { + if (sourceObject != null && filterSource.match(sourceObject, source.getSourceId(), sourceObject.getControllerId(), game)) { return true; } } @@ -108,8 +105,7 @@ public class CantBeTargetedAllEffect extends ContinuousRuleModifyingEffectImpl { sb.append(filterTarget.getMessage()).append(" can't be the targets of "); if (filterSource != null) { sb.append(filterSource.getMessage()); - } - else { + } else { sb.append("spells"); } if (!duration.toString().isEmpty()) { diff --git a/Mage/src/mage/abilities/effects/common/CantBeTargetedAttachedEffect.java b/Mage/src/mage/abilities/effects/common/CantBeTargetedAttachedEffect.java index bf055b18060..132375bef28 100644 --- a/Mage/src/mage/abilities/effects/common/CantBeTargetedAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/CantBeTargetedAttachedEffect.java @@ -27,39 +27,43 @@ */ package mage.abilities.effects.common; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.constants.AttachmentType; import mage.constants.Duration; import mage.constants.Outcome; -import mage.filter.FilterStackObject; +import mage.constants.TargetController; +import mage.filter.FilterObject; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; -import mage.game.stack.StackObject; +import mage.game.stack.StackAbility; /** * * @author LevelX2 */ - public class CantBeTargetedAttachedEffect extends ContinuousRuleModifyingEffectImpl { - private final FilterStackObject filterSource; + private final FilterObject filterSource; private final AttachmentType attachmentType; - - public CantBeTargetedAttachedEffect(FilterStackObject filterSource, Duration duration, AttachmentType attachmentType) { + private final TargetController targetController; + + public CantBeTargetedAttachedEffect(FilterObject filterSource, Duration duration, AttachmentType attachmentType, TargetController targetController) { super(duration, Outcome.Benefit); this.filterSource = filterSource; this.attachmentType = attachmentType; + this.targetController = targetController; } public CantBeTargetedAttachedEffect(final CantBeTargetedAttachedEffect effect) { super(effect); this.filterSource = effect.filterSource.copy(); this.attachmentType = effect.attachmentType; + this.targetController = effect.targetController; } @Override @@ -81,8 +85,18 @@ public class CantBeTargetedAttachedEffect extends ContinuousRuleModifyingEffectI public boolean applies(GameEvent event, Ability source, Game game) { Permanent attachment = game.getPermanent(source.getSourceId()); if (attachment != null && event.getTargetId().equals(attachment.getAttachedTo())) { - StackObject sourceObject = game.getStack().getStackObject(event.getSourceId()); - if (sourceObject != null && filterSource.match(sourceObject, source.getControllerId(), game)) { + if (targetController.equals(TargetController.OPPONENT) + && !game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { + return false; + } + MageObject mageObject = game.getObject(event.getSourceId()); + MageObject sourceObject; + if (mageObject instanceof StackAbility) { + sourceObject = ((StackAbility) mageObject).getSourceObject(game); + } else { + sourceObject = mageObject; + } + if (mageObject != null && filterSource.match(sourceObject, game)) { return true; } } @@ -103,13 +117,13 @@ public class CantBeTargetedAttachedEffect extends ContinuousRuleModifyingEffectI sb.append(" can't be the target of "); sb.append(filterSource.getMessage()); if (!duration.toString().isEmpty()) { - sb.append(" "); + sb.append(" "); if (duration.equals(Duration.EndOfTurn)) { sb.append("this turn"); } else { sb.append(duration.toString()); } - } + } return sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/CantBeTargetedSourceEffect.java b/Mage/src/mage/abilities/effects/common/CantBeTargetedSourceEffect.java index d49b331c814..2a09645f968 100644 --- a/Mage/src/mage/abilities/effects/common/CantBeTargetedSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/CantBeTargetedSourceEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,22 +20,23 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.constants.Duration; import mage.constants.Outcome; -import mage.filter.FilterStackObject; +import mage.filter.FilterObject; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; +import mage.game.stack.StackAbility; import mage.game.stack.StackObject; /** @@ -44,9 +45,9 @@ import mage.game.stack.StackObject; */ public class CantBeTargetedSourceEffect extends ContinuousRuleModifyingEffectImpl { - private final FilterStackObject filterSource; + private final FilterObject filterSource; - public CantBeTargetedSourceEffect(FilterStackObject filterSource, Duration duration) { + public CantBeTargetedSourceEffect(FilterObject filterSource, Duration duration) { super(duration, Outcome.Benefit); this.filterSource = filterSource; setText(); @@ -66,7 +67,7 @@ public class CantBeTargetedSourceEffect extends ContinuousRuleModifyingEffectImp public boolean apply(Game game, Ability source) { return true; } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.TARGET; @@ -75,8 +76,14 @@ public class CantBeTargetedSourceEffect extends ContinuousRuleModifyingEffectImp @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getSourceId())) { - StackObject sourceObject = game.getStack().getStackObject(event.getSourceId()); - if (sourceObject != null && filterSource.match(sourceObject, source.getControllerId(), game)) { + StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); + MageObject sourceObject; + if (stackObject instanceof StackAbility) { + sourceObject = ((StackAbility) stackObject).getSourceObject(game); + } else { + sourceObject = stackObject; + } + if (sourceObject != null && filterSource.match(sourceObject, game)) { return true; } } diff --git a/Mage/src/mage/abilities/effects/common/CantBeTargetedTargetEffect.java b/Mage/src/mage/abilities/effects/common/CantBeTargetedTargetEffect.java index 644b78b6459..387a5e03bfc 100644 --- a/Mage/src/mage/abilities/effects/common/CantBeTargetedTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/CantBeTargetedTargetEffect.java @@ -27,34 +27,43 @@ */ package mage.abilities.effects.common; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.constants.Duration; import mage.constants.Outcome; -import mage.filter.FilterStackObject; +import mage.constants.TargetController; +import mage.filter.FilterObject; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; +import mage.game.stack.StackAbility; import mage.game.stack.StackObject; /** * * @author LevelX2 */ - public class CantBeTargetedTargetEffect extends ContinuousRuleModifyingEffectImpl { - private final FilterStackObject filterSource; + private final FilterObject filterSource; + private final TargetController targetController; - public CantBeTargetedTargetEffect(FilterStackObject filterSource, Duration duration) { + public CantBeTargetedTargetEffect(FilterObject filterSource, Duration duration) { + this(filterSource, duration, TargetController.ANY); + } + + public CantBeTargetedTargetEffect(FilterObject filterSource, Duration duration, TargetController targetController) { super(duration, Outcome.Benefit, false, false); + this.targetController = targetController; this.filterSource = filterSource; } public CantBeTargetedTargetEffect(final CantBeTargetedTargetEffect effect) { super(effect); this.filterSource = effect.filterSource.copy(); + this.targetController = effect.targetController; } @Override @@ -75,8 +84,18 @@ public class CantBeTargetedTargetEffect extends ContinuousRuleModifyingEffectImp @Override public boolean applies(GameEvent event, Ability source, Game game) { if (getTargetPointer().getTargets(game, source).contains(event.getTargetId())) { - StackObject sourceObject = game.getStack().getStackObject(event.getSourceId()); - if (sourceObject != null && filterSource.match(sourceObject, source.getControllerId(), game)) { + if (targetController.equals(TargetController.OPPONENT) + && !game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { + return false; + } + StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); + MageObject sourceObject; + if (stackObject instanceof StackAbility) { + sourceObject = ((StackAbility) stackObject).getSourceObject(game); + } else { + sourceObject = stackObject; + } + if (sourceObject != null && filterSource.match(sourceObject, game)) { return true; } } @@ -95,13 +114,13 @@ public class CantBeTargetedTargetEffect extends ContinuousRuleModifyingEffectImp sb.append(" can't be the target of "); sb.append(filterSource.getMessage()); if (!duration.toString().isEmpty()) { - sb.append(" "); + sb.append(" "); if (duration.equals(Duration.EndOfTurn)) { sb.append("this turn"); } else { sb.append(duration.toString()); } - } + } return sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/ChangeATargetOfTargetSpellAbilityToSourceEffect.java b/Mage/src/mage/abilities/effects/common/ChangeATargetOfTargetSpellAbilityToSourceEffect.java new file mode 100644 index 00000000000..d332b7ac6cd --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/ChangeATargetOfTargetSpellAbilityToSourceEffect.java @@ -0,0 +1,130 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.game.stack.StackAbility; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.Target; +import mage.target.Targets; + +/** + * + * @author LevelX2 + */ +public class ChangeATargetOfTargetSpellAbilityToSourceEffect extends OneShotEffect { + + public ChangeATargetOfTargetSpellAbilityToSourceEffect() { + super(Outcome.Neutral); + staticText = "Change a target of target spell or ability to {this}"; + } + + public ChangeATargetOfTargetSpellAbilityToSourceEffect(final ChangeATargetOfTargetSpellAbilityToSourceEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (stackObject != null && sourceObject != null) { + Targets targets = new Targets(); + Ability sourceAbility; + String oldTargetName = null; + if (stackObject instanceof Spell) { + Spell spell = (Spell) stackObject; + sourceAbility = spell.getSpellAbility(); + } else if (stackObject instanceof StackAbility) { + StackAbility stackAbility = (StackAbility) stackObject; + sourceAbility = stackAbility; + } else { + return false; + } + for (Mode mode : sourceAbility.getModes().getSelectedModes()) { + targets.addAll(mode.getTargets()); + } + + boolean twoTimesTarget = false; + if (targets.size() == 1 && targets.get(0).getTargets().size() == 1) { + Target target = targets.get(0); + if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) { + oldTargetName = getTargetName(targets.getFirstTarget(), game); + target.clearChosen(); + // The source is still the spell on the stack + target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); + } + } else { + Player controller = game.getPlayer(source.getControllerId()); + boolean validTargets = false; + do { + for (Target target : targets) { + for (UUID targetId : target.getTargets()) { + String name = getTargetName(targets.getFirstTarget(), game); + if (!targetId.equals(source.getSourceId()) && target.getTargets().contains(source.getSourceId())) { + // you can't change this target to source because the source is already another targetId of that target. + twoTimesTarget = true; + continue; + } + if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) { + validTargets = true; + if (name != null + && controller.chooseUse(Outcome.Neutral, "Change target from " + name + " to " + sourceObject.getLogName() + "?", source, game)) { + oldTargetName = getTargetName(targetId, game); + target.remove(targetId); + // The source is still the spell on the stack + target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); + break; + } + } + } + if (oldTargetName != null) { + break; + } + } + if (oldTargetName == null) { + game.informPlayer(controller, "You have to select at least one target to change to " + sourceObject.getIdName() + "!"); + } + } while (validTargets && oldTargetName == null); + } + if (oldTargetName != null) { + game.informPlayers(sourceObject.getLogName() + ": Changed target of " + stackObject.getLogName() + " from " + oldTargetName + " to " + sourceObject.getLogName()); + } else { + if (twoTimesTarget) { + game.informPlayers(sourceObject.getLogName() + ": Target not changed to " + sourceObject.getLogName() + " because its not valid to target it twice for " + stackObject.getLogName()); + } else { + game.informPlayers(sourceObject.getLogName() + ": Target not changed to " + sourceObject.getLogName() + " because its no valid target for " + stackObject.getLogName()); + } + } + return true; + } + return false; + } + + @Override + public ChangeATargetOfTargetSpellAbilityToSourceEffect copy() { + return new ChangeATargetOfTargetSpellAbilityToSourceEffect(this); + } + + private String getTargetName(UUID objectId, Game game) { + MageObject object = game.getObject(objectId); + if (object != null) { + return object.getLogName(); + } + Player player = game.getPlayer(objectId); + if (player != null) { + return player.getLogName(); + } + return null; + } +} diff --git a/Mage/src/mage/abilities/effects/common/ChooseBasicLandTypeEffect.java b/Mage/src/mage/abilities/effects/common/ChooseBasicLandTypeEffect.java new file mode 100644 index 00000000000..9aa16ac8c56 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/ChooseBasicLandTypeEffect.java @@ -0,0 +1,61 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.choices.ChoiceBasicLandType; +import mage.choices.ChoiceImpl; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class ChooseBasicLandTypeEffect extends OneShotEffect { + + public static String VALUE_KEY = "BasicLandType"; + + public ChooseBasicLandTypeEffect(Outcome outcome) { + super(outcome); + this.staticText = "Choose a basic land type"; + } + + public ChooseBasicLandTypeEffect(final ChooseBasicLandTypeEffect effect) { + super(effect); + } + + @Override + public ChooseBasicLandTypeEffect copy() { + return new ChooseBasicLandTypeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject mageObject = game.getPermanentEntering(source.getSourceId()); + if (mageObject == null) { + mageObject = game.getObject(source.getSourceId()); + } + if (controller != null && mageObject != null) { + ChoiceImpl choices = new ChoiceBasicLandType(); + if (controller.choose(Outcome.Neutral, choices, game)) { + game.informPlayers(mageObject.getName() + ": Chosen basic land type is " + choices.getChoice()); + game.getState().setValue(mageObject.getId().toString() + VALUE_KEY, choices.getChoice()); + if (mageObject instanceof Permanent) { + ((Permanent) mageObject).addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen basic land type: " + choices.getChoice()), game); + } + return true; + } + } + return false; + } +} diff --git a/Mage/src/mage/abilities/effects/common/ChooseColorEffect.java b/Mage/src/mage/abilities/effects/common/ChooseColorEffect.java index 8f22a961ad7..161dec6767e 100644 --- a/Mage/src/mage/abilities/effects/common/ChooseColorEffect.java +++ b/Mage/src/mage/abilities/effects/common/ChooseColorEffect.java @@ -25,9 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.choices.ChoiceColor; @@ -55,8 +55,11 @@ public class ChooseColorEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (controller != null && permanent != null) { + MageObject mageObject = game.getPermanentEntering(source.getSourceId()); + if (mageObject == null) { + mageObject = game.getObject(source.getSourceId()); + } + if (controller != null && mageObject != null) { ChoiceColor choice = new ChoiceColor(); while (!choice.isChosen()) { controller.choose(outcome, choice, game); @@ -65,10 +68,12 @@ public class ChooseColorEffect extends OneShotEffect { } } if (!game.isSimulation()) { - game.informPlayers(permanent.getLogName()+": "+controller.getLogName()+" has chosen "+choice.getChoice()); + game.informPlayers(mageObject.getLogName() + ": " + controller.getLogName() + " has chosen " + choice.getChoice()); + } + game.getState().setValue(mageObject.getId() + "_color", choice.getColor()); + if (mageObject instanceof Permanent) { + ((Permanent) mageObject).addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen color: " + choice.getChoice()), game); } - game.getState().setValue(source.getSourceId() + "_color", choice.getColor()); - permanent.addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen color: " + choice.getChoice()), game); return true; } return false; @@ -79,4 +84,4 @@ public class ChooseColorEffect extends OneShotEffect { return new ChooseColorEffect(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/effects/common/ChooseCreatureTypeEffect.java b/Mage/src/mage/abilities/effects/common/ChooseCreatureTypeEffect.java index 2ebd99cc9d2..b1d4b0e6f62 100644 --- a/Mage/src/mage/abilities/effects/common/ChooseCreatureTypeEffect.java +++ b/Mage/src/mage/abilities/effects/common/ChooseCreatureTypeEffect.java @@ -27,6 +27,7 @@ */ package mage.abilities.effects.common; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.repository.CardRepository; @@ -42,7 +43,6 @@ import mage.util.CardUtil; * * @author LevelX2 */ - public class ChooseCreatureTypeEffect extends OneShotEffect { public ChooseCreatureTypeEffect(Outcome outcome) { @@ -57,8 +57,11 @@ public class ChooseCreatureTypeEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (controller != null && permanent != null) { + MageObject mageObject = game.getPermanentEntering(source.getSourceId()); + if (mageObject == null) { + mageObject = game.getObject(source.getSourceId()); + } + if (controller != null && mageObject != null) { Choice typeChoice = new ChoiceImpl(true); typeChoice.setMessage("Choose creature type"); typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); @@ -68,10 +71,12 @@ public class ChooseCreatureTypeEffect extends OneShotEffect { } } if (!game.isSimulation()) { - game.informPlayers(permanent.getName() + ": " + controller.getLogName() + " has chosen " + typeChoice.getChoice()); + game.informPlayers(mageObject.getName() + ": " + controller.getLogName() + " has chosen " + typeChoice.getChoice()); + } + game.getState().setValue(mageObject.getId() + "_type", typeChoice.getChoice()); + if (mageObject instanceof Permanent) { + ((Permanent) mageObject).addInfo("chosen type", CardUtil.addToolTipMarkTags("Chosen type: " + typeChoice.getChoice()), game); } - game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice()); - permanent.addInfo("chosen type", CardUtil.addToolTipMarkTags("Chosen type: " + typeChoice.getChoice()), game); } return false; } diff --git a/Mage/src/mage/abilities/effects/common/ChooseLandTypeEffect.java b/Mage/src/mage/abilities/effects/common/ChooseLandTypeEffect.java new file mode 100644 index 00000000000..bd59c25c334 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/ChooseLandTypeEffect.java @@ -0,0 +1,67 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.repository.CardRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.util.CardUtil; + +/** + * + * @author fireshoes + */ +public class ChooseLandTypeEffect extends OneShotEffect { + + public ChooseLandTypeEffect(Outcome outcome) { + super(outcome); + staticText = "choose a land type"; + } + + public ChooseLandTypeEffect(final ChooseLandTypeEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject mageObject = game.getPermanentEntering(source.getSourceId()); + if (mageObject == null) { + mageObject = game.getObject(source.getSourceId()); + } + if (controller != null && mageObject != null) { + Choice typeChoice = new ChoiceImpl(true); + typeChoice.setMessage("Choose land type"); + typeChoice.setChoices(CardRepository.instance.getLandTypes()); + while (!controller.choose(outcome, typeChoice, game)) { + if (!controller.canRespond()) { + return false; + } + } + if (!game.isSimulation()) { + game.informPlayers(mageObject.getName() + ": " + controller.getLogName() + " has chosen " + typeChoice.getChoice()); + } + game.getState().setValue(mageObject.getId() + "_type", typeChoice.getChoice()); + if (mageObject instanceof Permanent) { + ((Permanent) mageObject).addInfo("chosen type", CardUtil.addToolTipMarkTags("Chosen type: " + typeChoice.getChoice()), game); + } + } + return false; + } + + @Override + public ChooseLandTypeEffect copy() { + return new ChooseLandTypeEffect(this); + } + +} diff --git a/Mage/src/mage/abilities/effects/common/ChooseModeEffect.java b/Mage/src/mage/abilities/effects/common/ChooseModeEffect.java index 796f3e7fce7..bdfac9f3216 100644 --- a/Mage/src/mage/abilities/effects/common/ChooseModeEffect.java +++ b/Mage/src/mage/abilities/effects/common/ChooseModeEffect.java @@ -69,6 +69,9 @@ public class ChooseModeEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (sourcePermanent == null) { + sourcePermanent = game.getPermanentEntering(source.getSourceId()); + } if (controller != null) { Choice choice = new ChoiceImpl(true); choice.setMessage(choiceMessage); @@ -80,8 +83,9 @@ public class ChooseModeEffect extends OneShotEffect { controller.choose(Outcome.Neutral, choice, game); } if (choice.isChosen()) { - if (!game.isSimulation()) - game.informPlayers(new StringBuilder(sourcePermanent.getLogName()).append(": ").append(controller.getLogName()).append(" has chosen ").append(choice.getChoice()).toString()); + if (!game.isSimulation()) { + game.informPlayers(sourcePermanent.getLogName() + ": " + controller.getLogName() + " has chosen " + choice.getChoice()); + } game.getState().setValue(source.getSourceId() + "_modeChoice", choice.getChoice()); sourcePermanent.addInfo("_modeChoice", "Chosen mode: " + choice.getChoice() + "", game); } @@ -93,7 +97,7 @@ public class ChooseModeEffect extends OneShotEffect { private String setText() { StringBuilder sb = new StringBuilder("choose "); int count = 0; - for (String choice: modes) { + for (String choice : modes) { count++; sb.append(choice); if (count + 1 < modes.size()) { diff --git a/Mage/src/mage/abilities/effects/common/ChooseNewTargetsTargetEffect.java b/Mage/src/mage/abilities/effects/common/ChooseNewTargetsTargetEffect.java index 265b66e9cdd..35ac9818cd5 100644 --- a/Mage/src/mage/abilities/effects/common/ChooseNewTargetsTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ChooseNewTargetsTargetEffect.java @@ -1,38 +1,36 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; -import mage.filter.Filter; +import mage.constants.Outcome; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.stack.StackObject; @@ -46,21 +44,22 @@ public class ChooseNewTargetsTargetEffect extends OneShotEffect { private boolean forceChange; private boolean onlyOneTarget; private FilterPermanent filterNewTarget; - + public ChooseNewTargetsTargetEffect() { this(false, false); } + public ChooseNewTargetsTargetEffect(boolean forceChange, boolean onlyOneTarget) { this(forceChange, onlyOneTarget, null); } /** * - * @param forceChange forces the user to choose another target (only targets with maxtargets = 1 supported) + * @param forceChange forces the user to choose another target (only targets + * with maxtargets = 1 supported) * @param onlyOneTarget only one target can be selected for the change * @param filterNewTarget restriction to the new target */ - public ChooseNewTargetsTargetEffect(boolean forceChange, boolean onlyOneTarget, FilterPermanent filterNewTarget) { super(Outcome.Benefit); this.forceChange = forceChange; diff --git a/Mage/src/mage/abilities/effects/common/ChooseOpponentEffect.java b/Mage/src/mage/abilities/effects/common/ChooseOpponentEffect.java new file mode 100644 index 00000000000..bdb32a34a13 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/ChooseOpponentEffect.java @@ -0,0 +1,63 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetOpponent; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class ChooseOpponentEffect extends OneShotEffect { + + public static String VALUE_KEY = "_opponent"; + + public ChooseOpponentEffect(Outcome outcome) { + super(outcome); + this.staticText = "choose an opponent"; + } + + public ChooseOpponentEffect(final ChooseOpponentEffect effect) { + super(effect); + } + + @Override + public ChooseOpponentEffect copy() { + return new ChooseOpponentEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject mageObject = game.getPermanentEntering(source.getSourceId()); + if (mageObject == null) { + mageObject = game.getObject(source.getSourceId()); + } + if (controller != null && mageObject != null) { + TargetOpponent target = new TargetOpponent(true); + if (controller.choose(this.outcome, target, source.getSourceId(), game)) { + Player chosenPlayer = game.getPlayer(target.getFirstTarget()); + if (chosenPlayer != null) { + game.informPlayers(mageObject.getName() + ": " + controller.getLogName() + " has chosen " + chosenPlayer.getLogName()); + game.getState().setValue(mageObject.getId() + VALUE_KEY, target.getFirstTarget()); + if (mageObject instanceof Permanent) { + ((Permanent) mageObject).addInfo("chosen opponent", CardUtil.addToolTipMarkTags("Chosen player: " + chosenPlayer.getLogName()), game); + } + return true; + } + } + } + return false; + } +} diff --git a/Mage/src/mage/abilities/effects/common/ChoosePlayerEffect.java b/Mage/src/mage/abilities/effects/common/ChoosePlayerEffect.java new file mode 100644 index 00000000000..7f8ce4c72cc --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/ChoosePlayerEffect.java @@ -0,0 +1,61 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class ChoosePlayerEffect extends OneShotEffect { + + public ChoosePlayerEffect(Outcome outcome) { + super(outcome); + this.staticText = "choose a player"; + } + + public ChoosePlayerEffect(final ChoosePlayerEffect effect) { + super(effect); + } + + @Override + public ChoosePlayerEffect copy() { + return new ChoosePlayerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject mageObject = game.getPermanentEntering(source.getSourceId()); + if (mageObject == null) { + mageObject = game.getObject(source.getSourceId()); + } + if (controller != null && mageObject != null) { + TargetPlayer target = new TargetPlayer(1, 1, true); + if (controller.choose(this.outcome, target, source.getSourceId(), game)) { + Player chosenPlayer = game.getPlayer(target.getFirstTarget()); + if (chosenPlayer != null) { + game.informPlayers(mageObject.getName() + ": " + controller.getLogName() + " has chosen " + chosenPlayer.getLogName()); + game.getState().setValue(mageObject.getId() + "_player", target.getFirstTarget()); + if (mageObject instanceof Permanent) { + ((Permanent) mageObject).addInfo("chosen player", CardUtil.addToolTipMarkTags("Chosen player: " + chosenPlayer.getLogName()), game); + } + return true; + } + } + } + return false; + } +} diff --git a/Mage/src/mage/abilities/effects/common/CipherEffect.java b/Mage/src/mage/abilities/effects/common/CipherEffect.java index d4bbdb20a20..89e6b391124 100644 --- a/Mage/src/mage/abilities/effects/common/CipherEffect.java +++ b/Mage/src/mage/abilities/effects/common/CipherEffect.java @@ -28,8 +28,6 @@ package mage.abilities.effects.common; import java.util.UUID; -import mage.constants.Duration; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; @@ -38,6 +36,9 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.cards.Card; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -46,37 +47,37 @@ import mage.target.targetpointer.FixedTarget; /** * FAQ 2013/01/11 - * + * * 702.97. Cipher * - * 702.97a Cipher appears on some instants and sorceries. It represents two static - * abilities, one that functions while the spell is on the stack and one that functions - * while the card with cipher is in the exile zone. "Cipher" means "If this spell is - * represented by a card, you may exile this card encoded on a creature you control" - * and "As long as this card is encoded on that creature, that creature has 'Whenever - * this creature deals combat damage to a player, you may copy this card and you may - * cast the copy without paying its mana cost.'" + * 702.97a Cipher appears on some instants and sorceries. It represents two + * static abilities, one that functions while the spell is on the stack and one + * that functions while the card with cipher is in the exile zone. "Cipher" + * means "If this spell is represented by a card, you may exile this card + * encoded on a creature you control" and "As long as this card is encoded on + * that creature, that creature has 'Whenever this creature deals combat damage + * to a player, you may copy this card and you may cast the copy without paying + * its mana cost.'" * - * 702.97b The term "encoded" describes the relationship between the card with cipher - * while in the exile zone and the creature chosen when the spell represented by that - * card resolves. + * 702.97b The term "encoded" describes the relationship between the card with + * cipher while in the exile zone and the creature chosen when the spell + * represented by that card resolves. * - * 702.97c The card with cipher remains encoded on the chosen creature as long as the - * card with cipher remains exiled and the creature remains on the battlefield. The - * card remains encoded on that object even if it changes controller or stops being - * a creature, as long as it remains on the battlefield. + * 702.97c The card with cipher remains encoded on the chosen creature as long + * as the card with cipher remains exiled and the creature remains on the + * battlefield. The card remains encoded on that object even if it changes + * controller or stops being a creature, as long as it remains on the + * battlefield. * * TODO: Implement Cipher as two static abilities concerning the rules. * * @author LevelX2 */ - - public class CipherEffect extends OneShotEffect { public CipherEffect() { super(Outcome.Copy); - staticText ="

Cipher (Then you may exile this spell card encoded on a creature you control. Whenever that creature deals combat damage to a player, its controller may cast a copy of the encoded card without paying its mana cost.)"; + staticText = "

Cipher (Then you may exile this spell card encoded on a creature you control. Whenever that creature deals combat damage to a player, its controller may cast a copy of the encoded card without paying its mana cost.)"; } public CipherEffect(final CipherEffect effect) { @@ -86,10 +87,11 @@ public class CipherEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(); if (controller != null) { + TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(); + target.setNotTarget(true); if (target.canChoose(source.getControllerId(), game) - && controller.chooseUse(outcome, "Cipher this spell to a creature?", source, game)) { + && controller.chooseUse(outcome, "Cipher this spell to a creature?", source, game)) { controller.chooseTarget(outcome, target, source, game); Card sourceCard = game.getCard(source.getSourceId()); Permanent targetCreature = game.getPermanent(target.getFirstTarget()); @@ -99,9 +101,10 @@ public class CipherEffect extends OneShotEffect { ContinuousEffect effect = new GainAbilityTargetEffect(ability, Duration.Custom); effect.setTargetPointer(new FixedTarget(target.getFirstTarget())); game.addEffect(effect, source); - if (!game.isSimulation()) + if (!game.isSimulation()) { game.informPlayers(new StringBuilder(sourceCard.getLogName()).append(": Spell ciphered to ").append(targetCreature.getLogName()).toString()); - return sourceCard.moveToExile(null, "", source.getSourceId(), game); + } + return controller.moveCards(sourceCard, null, Zone.EXILED, source, game); } else { return false; } @@ -119,7 +122,7 @@ public class CipherEffect extends OneShotEffect { class CipherStoreEffect extends OneShotEffect { - private UUID cipherCardId; + private final UUID cipherCardId; public CipherStoreEffect(UUID cipherCardId, String ruleText) { super(Outcome.Copy); @@ -141,13 +144,13 @@ class CipherStoreEffect extends OneShotEffect { SpellAbility ability = copyCard.getSpellAbility(); // remove the cipher effect from the copy Effect cipherEffect = null; - for (Effect effect :ability.getEffects()) { + for (Effect effect : ability.getEffects()) { if (effect instanceof CipherEffect) { cipherEffect = effect; } } ability.getEffects().remove(cipherEffect); - if (ability != null && ability instanceof SpellAbility) { + if (ability instanceof SpellAbility) { controller.cast(ability, game, true); } } diff --git a/Mage/src/mage/abilities/effects/common/CopyEffect.java b/Mage/src/mage/abilities/effects/common/CopyEffect.java index 9d1194fda2a..9b6becb7198 100644 --- a/Mage/src/mage/abilities/effects/common/CopyEffect.java +++ b/Mage/src/mage/abilities/effects/common/CopyEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,21 +20,20 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; - import java.util.UUID; import mage.MageObject; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.Card; +import mage.constants.AbilityType; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -56,35 +55,47 @@ public class CopyEffect extends ContinuousEffectImpl { /** * Object we copy from */ - private MageObject target; - - private UUID sourceId; - private ApplyToPermanent applier; - - public CopyEffect(MageObject target, UUID sourceId) { - this(Duration.Custom, target, sourceId); + protected MageObject copyFromObject; + + protected UUID copyToObjectId; + protected ApplyToPermanent applier; + + public CopyEffect(MageObject copyFromObject, UUID copyToObjectId) { + this(Duration.Custom, copyFromObject, copyToObjectId); } - - public CopyEffect(Duration duration, MageObject target, UUID sourceId) { + + public CopyEffect(Duration duration, MageObject copyFromObject, UUID copyToObjectId) { super(duration, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature); - this.target = target; - this.sourceId = sourceId; + this.copyFromObject = copyFromObject; + this.copyToObjectId = copyToObjectId; } public CopyEffect(final CopyEffect effect) { super(effect); - this.target = effect.target.copy(); - this.sourceId = effect.sourceId; + this.copyFromObject = effect.copyFromObject.copy(); + this.copyToObjectId = effect.copyToObjectId; this.applier = effect.applier; } @Override public void init(Ability source, Game game) { super.init(source, game); - if (!(target instanceof Permanent) && (target instanceof Card)) { - this.target = new PermanentCard((Card)target, source.getControllerId(), game); + if (!(copyFromObject instanceof Permanent) && (copyFromObject instanceof Card)) { + this.copyFromObject = new PermanentCard((Card) copyFromObject, source.getControllerId(), game); + } + Permanent permanent = game.getPermanent(copyToObjectId); + if (permanent != null) { + affectedObjectList.add(new MageObjectReference(permanent, game)); + } else if (source.getAbilityType().equals(AbilityType.STATIC)) { + // for replacement effects that let a permanent enter the battlefield as a copy of another permanent we need to apply that copy + // before the permanent is added to the battlefield + permanent = game.getPermanentEntering(copyToObjectId); + if (permanent != null) { + copyToPermanent(permanent, game, source); + // set reference to the permanent later on the battlefield so we have to add already one to the zone change counter + affectedObjectList.add(new MageObjectReference(permanent.getId(), game.getState().getZoneChangeCounter(copyToObjectId) + 1, game)); + } } - affectedObjectList.add(new MageObjectReference(getSourceId(), game)); } @Override @@ -98,32 +109,36 @@ public class CopyEffect extends ContinuousEffectImpl { return false; } } + return copyToPermanent(permanent, game, source); + } + + protected boolean copyToPermanent(Permanent permanent, Game game, Ability source) { permanent.setCopy(true); - permanent.setName(target.getName()); - permanent.getColor(game).setColor(target.getColor(game)); + permanent.setName(copyFromObject.getName()); + permanent.getColor(game).setColor(copyFromObject.getColor(game)); permanent.getManaCost().clear(); - permanent.getManaCost().add(target.getManaCost()); + permanent.getManaCost().add(copyFromObject.getManaCost()); permanent.getCardType().clear(); - for (CardType type: target.getCardType()) { + for (CardType type : copyFromObject.getCardType()) { permanent.getCardType().add(type); } permanent.getSubtype().clear(); - for (String type: target.getSubtype()) { + for (String type : copyFromObject.getSubtype()) { permanent.getSubtype().add(type); } permanent.getSupertype().clear(); - for (String type: target.getSupertype()) { + for (String type : copyFromObject.getSupertype()) { permanent.getSupertype().add(type); } permanent.removeAllAbilities(source.getSourceId(), game); - for (Ability ability: target.getAbilities()) { - permanent.addAbility(ability, getSourceId(), game, false); // no new Id so consumed replacement effects are known while new continuousEffects.apply happen. + for (Ability ability : copyFromObject.getAbilities()) { + permanent.addAbility(ability, getSourceId(), game, false); // no new Id so consumed replacement effects are known while new continuousEffects.apply happen. } - permanent.getPower().setValue(target.getPower().getValue()); - permanent.getToughness().setValue(target.getToughness().getValue()); - if (target instanceof Permanent) { - Permanent targetPermanent = (Permanent) target; + permanent.getPower().setValue(copyFromObject.getPower().getValue()); + permanent.getToughness().setValue(copyFromObject.getToughness().getValue()); + if (copyFromObject instanceof Permanent) { + Permanent targetPermanent = (Permanent) copyFromObject; permanent.setTransformed(targetPermanent.isTransformed()); permanent.setSecondCardFace(targetPermanent.getSecondCardFace()); permanent.setFlipCard(targetPermanent.isFlipCard()); @@ -131,13 +146,13 @@ public class CopyEffect extends ContinuousEffectImpl { } // to get the image of the copied permanent copy number und expansionCode - if (target instanceof PermanentCard) { - permanent.setCardNumber(((PermanentCard) target).getCard().getCardNumber()); - permanent.setExpansionSetCode(((PermanentCard) target).getCard().getExpansionSetCode()); - } else if (target instanceof PermanentToken || target instanceof Card) { - permanent.setCardNumber(((Card) target).getCardNumber()); - permanent.setExpansionSetCode(((Card) target).getExpansionSetCode()); - } + if (copyFromObject instanceof PermanentCard) { + permanent.setCardNumber(((PermanentCard) copyFromObject).getCard().getCardNumber()); + permanent.setExpansionSetCode(((PermanentCard) copyFromObject).getCard().getExpansionSetCode()); + } else if (copyFromObject instanceof PermanentToken || copyFromObject instanceof Card) { + permanent.setCardNumber(((Card) copyFromObject).getCardNumber()); + permanent.setExpansionSetCode(((Card) copyFromObject).getExpansionSetCode()); + } return true; } @@ -147,15 +162,15 @@ public class CopyEffect extends ContinuousEffectImpl { } public MageObject getTarget() { - return target; + return copyFromObject; } public void setTarget(MageObject target) { - this.target = target; + this.copyFromObject = target; } public UUID getSourceId() { - return sourceId; + return copyToObjectId; } public ApplyToPermanent getApplier() { @@ -165,5 +180,5 @@ public class CopyEffect extends ContinuousEffectImpl { public void setApplier(ApplyToPermanent applier) { this.applier = applier; } - + } diff --git a/Mage/src/mage/abilities/effects/common/CopyPermanentEffect.java b/Mage/src/mage/abilities/effects/common/CopyPermanentEffect.java index 7860911a2dd..865adb292e8 100644 --- a/Mage/src/mage/abilities/effects/common/CopyPermanentEffect.java +++ b/Mage/src/mage/abilities/effects/common/CopyPermanentEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,13 +20,14 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.abilities.effects.common; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.constants.Outcome; @@ -66,12 +67,13 @@ public class CopyPermanentEffect extends OneShotEffect { public CopyPermanentEffect(FilterPermanent filter, ApplyToPermanent applier) { this(filter, applier, false); } + public CopyPermanentEffect(FilterPermanent filter, ApplyToPermanent applier, boolean useTarget) { super(Outcome.Copy); this.applier = applier; this.filter = filter; this.useTargetOfAbility = useTarget; - this.staticText = "You may have {this} enter the battlefield as a copy of any " + filter.getMessage() + " on the battlefield"; + this.staticText = "as a copy of any " + filter.getMessage() + " on the battlefield"; } public CopyPermanentEffect(final CopyPermanentEffect effect) { @@ -85,21 +87,24 @@ public class CopyPermanentEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (player != null && sourcePermanent != null) { + MageObject sourceObject = game.getPermanentEntering(source.getSourceId()); + if (sourceObject == null) { + sourceObject = game.getObject(source.getSourceId()); + } + if (player != null && sourceObject != null) { Permanent copyFromPermanent = null; if (useTargetOfAbility) { copyFromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); } else { Target target = new TargetPermanent(filter); target.setNotTarget(true); - if (target.canChoose(source.getControllerId(), game)) { + if (target.canChoose(source.getSourceId(), player.getId(), game)) { player.choose(Outcome.Copy, target, source.getSourceId(), game); copyFromPermanent = game.getPermanent(target.getFirstTarget()); } } if (copyFromPermanent != null) { - bluePrintPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent, source, applier); + bluePrintPermanent = game.copyPermanent(copyFromPermanent, sourceObject.getId(), source, applier); } return true; } diff --git a/Mage/src/mage/abilities/effects/common/CounterTargetWithReplacementEffect.java b/Mage/src/mage/abilities/effects/common/CounterTargetWithReplacementEffect.java index d23e2c8f2ff..5a9a0485f59 100644 --- a/Mage/src/mage/abilities/effects/common/CounterTargetWithReplacementEffect.java +++ b/Mage/src/mage/abilities/effects/common/CounterTargetWithReplacementEffect.java @@ -27,18 +27,12 @@ */ package mage.abilities.effects.common; -import java.util.UUID; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.stack.Spell; -import mage.game.stack.StackObject; import mage.players.Player; /** @@ -56,7 +50,8 @@ public class CounterTargetWithReplacementEffect extends OneShotEffect { /** * * @param targetZone - * @param flag use to specify when moving card to library

  • true = put on top
  • false = put on bottom
+ * @param flag use to specify when moving card to library
  • true = put + * on top
  • false = put on bottom
*/ public CounterTargetWithReplacementEffect(Zone targetZone, boolean flag) { super(Outcome.Detriment); @@ -77,39 +72,9 @@ public class CounterTargetWithReplacementEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - UUID objectId = source.getFirstTarget(); - UUID sourceId = source.getSourceId(); Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - StackObject stackObject = game.getStack().getStackObject(objectId); - if (stackObject != null && !game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) { - boolean spell = false; - if (stackObject instanceof Spell) { - game.rememberLKI(objectId, Zone.STACK, stackObject); - spell = true; - } - game.getStack().remove(stackObject); - if (spell && !((Spell) stackObject).isCopiedSpell()) { - MageObject mageObject = game.getObject(stackObject.getSourceId()); - if (mageObject instanceof Card) { - Card card = (Card) mageObject; - switch (targetZone) { - case LIBRARY: - controller.moveCardToLibraryWithInfo(card, sourceId, game, Zone.STACK, flag, true); - break; - case EXILED: - controller.moveCardToExileWithInfo(card, null, "", sourceId, game, Zone.STACK, true); - break; - default: - controller.moveCards(card, Zone.STACK, targetZone, source, game); - } - } else { - return false; - } - } - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId())); - return true; - } + return game.getStack().counter(targetPointer.getFirst(game, source), source.getSourceId(), game, targetZone, false, flag); } return false; } diff --git a/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java b/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java index be63142eb3e..585d8a8118e 100644 --- a/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java +++ b/Mage/src/mage/abilities/effects/common/CounterUnlessPaysEffect.java @@ -122,7 +122,7 @@ public class CounterUnlessPaysEffect extends OneShotEffect { sb.append("{X}"); } if (genericMana != null && !genericMana.getMessage().isEmpty()) { - sb.append(", where X is your "); + sb.append(", where X is "); sb.append(genericMana.getMessage()); } return sb.toString(); diff --git a/Mage/src/mage/abilities/effects/common/CreateDelayedTriggeredAbilityEffect.java b/Mage/src/mage/abilities/effects/common/CreateDelayedTriggeredAbilityEffect.java index de8085730a6..5d56cd403c8 100644 --- a/Mage/src/mage/abilities/effects/common/CreateDelayedTriggeredAbilityEffect.java +++ b/Mage/src/mage/abilities/effects/common/CreateDelayedTriggeredAbilityEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; import mage.abilities.Ability; @@ -43,21 +42,28 @@ public class CreateDelayedTriggeredAbilityEffect extends OneShotEffect { protected DelayedTriggeredAbility ability; protected boolean copyTargets; + protected boolean initAbility; public CreateDelayedTriggeredAbilityEffect(DelayedTriggeredAbility ability) { this(ability, true); } public CreateDelayedTriggeredAbilityEffect(DelayedTriggeredAbility ability, boolean copyTargets) { + this(ability, copyTargets, false); + } + + public CreateDelayedTriggeredAbilityEffect(DelayedTriggeredAbility ability, boolean copyTargets, boolean initAbility) { super(ability.getEffects().get(0).getOutcome()); this.ability = ability; this.copyTargets = copyTargets; + this.initAbility = initAbility; } public CreateDelayedTriggeredAbilityEffect(final CreateDelayedTriggeredAbilityEffect effect) { super(effect); this.ability = effect.ability.copy(); this.copyTargets = effect.copyTargets; + this.initAbility = effect.initAbility; } @Override @@ -73,23 +79,26 @@ public class CreateDelayedTriggeredAbilityEffect extends OneShotEffect { delayedAbility.setSourceObject(source.getSourceObject(game), game); if (this.copyTargets) { if (source.getTargets().isEmpty()) { - for(Effect effect : delayedAbility.getEffects()) { + for (Effect effect : delayedAbility.getEffects()) { effect.setTargetPointer(targetPointer); } } else { delayedAbility.getTargets().addAll(source.getTargets()); - for(Effect effect : delayedAbility.getEffects()) { + for (Effect effect : delayedAbility.getEffects()) { effect.getTargetPointer().init(game, source); } } } + if (initAbility) { + delayedAbility.init(game); + } game.addDelayedTriggeredAbility(delayedAbility); return true; } @Override public String getText(Mode mode) { - if (staticText != null && !staticText.isEmpty()){ + if (staticText != null && !staticText.isEmpty()) { return staticText; } if (ability.getRuleVisible()) { diff --git a/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java b/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java index 00c9dbd3a35..5b61e675d22 100644 --- a/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java +++ b/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java @@ -29,12 +29,10 @@ package mage.abilities.effects.common; import java.util.ArrayList; import java.util.UUID; -import mage.MageObject; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.token.Token; @@ -52,7 +50,6 @@ public class CreateTokenEffect extends OneShotEffect { private boolean attacking; private UUID lastAddedTokenId; private ArrayList lastAddedTokenIds = new ArrayList<>(); - private boolean expansionSetCodeChecked; public CreateTokenEffect(Token token) { this(token, new StaticValue(1)); @@ -76,7 +73,6 @@ public class CreateTokenEffect extends OneShotEffect { this.amount = amount.copy(); this.tapped = tapped; this.attacking = attacking; - this.expansionSetCodeChecked = false; setText(); } @@ -88,7 +84,6 @@ public class CreateTokenEffect extends OneShotEffect { this.attacking = effect.attacking; this.lastAddedTokenId = effect.lastAddedTokenId; this.lastAddedTokenIds.addAll(effect.lastAddedTokenIds); - this.expansionSetCodeChecked = effect.expansionSetCodeChecked; } @Override @@ -98,9 +93,6 @@ public class CreateTokenEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - if (!expansionSetCodeChecked) { - updateExpansionSetCode(game, source); - } int value = amount.calculate(game, source, this); token.putOntoBattlefield(value, game, source.getSourceId(), source.getControllerId(), tapped, attacking); this.lastAddedTokenId = token.getLastAddedToken(); @@ -108,14 +100,6 @@ public class CreateTokenEffect extends OneShotEffect { return true; } - private void updateExpansionSetCode(Game game, Ability source) { - MageObject sourceObject = source.getSourceObject(game); - if (sourceObject instanceof Card) { - token.setExpansionSetCodeForImage(((Card) sourceObject).getExpansionSetCode()); - } - expansionSetCodeChecked = true; - } - public UUID getLastAddedTokenId() { return lastAddedTokenId; } diff --git a/Mage/src/mage/abilities/effects/common/CreateTokenTargetEffect.java b/Mage/src/mage/abilities/effects/common/CreateTokenTargetEffect.java index 9c0e72eef9e..91fcdb1c40d 100644 --- a/Mage/src/mage/abilities/effects/common/CreateTokenTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/CreateTokenTargetEffect.java @@ -1,23 +1,20 @@ package mage.abilities.effects.common; -import java.util.Locale; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; import mage.constants.Outcome; -import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.token.Token; -import mage.players.Player; import mage.util.CardUtil; /** * @author Loki */ - public class CreateTokenTargetEffect extends OneShotEffect { + private Token token; private DynamicValue amount; private boolean tapped; @@ -59,14 +56,10 @@ public class CreateTokenTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int value = amount.calculate(game, source, this); - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - if (value < 1) { - return true; - } + if (value > 0) { return token.putOntoBattlefield(value, game, source.getSourceId(), targetPointer.getFirst(game, source), tapped, attacking); } - return false; + return true; } @Override diff --git a/Mage/src/mage/abilities/effects/common/DamageAllEffect.java b/Mage/src/mage/abilities/effects/common/DamageAllEffect.java index 7c2bb29618c..e537e7b304d 100644 --- a/Mage/src/mage/abilities/effects/common/DamageAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageAllEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,20 +20,19 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; import java.util.List; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -50,6 +49,7 @@ public class DamageAllEffect extends OneShotEffect { public DamageAllEffect(int amount, FilterPermanent filter) { this(new StaticValue(amount), filter); } + public DamageAllEffect(DynamicValue amount, FilterPermanent filter) { super(Outcome.Damage); this.amount = amount; @@ -71,7 +71,7 @@ public class DamageAllEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game); - for (Permanent permanent: permanents) { + for (Permanent permanent : permanents) { permanent.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, true); } return true; @@ -82,9 +82,13 @@ public class DamageAllEffect extends OneShotEffect { sb.append("{source} deals ").append(amount.toString()).append(" damage to each ").append(filter.getMessage()); String message = amount.getMessage(); if (message.length() > 0) { - sb.append(" for each "); + if (amount.toString().equals("X")) { + sb.append(", where X is "); + } else { + sb.append(" for each "); + } + sb.append(message); } - sb.append(message); staticText = sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/DamageMultiEffect.java b/Mage/src/mage/abilities/effects/common/DamageMultiEffect.java index 0ee8bdf7275..61baaaa19d6 100644 --- a/Mage/src/mage/abilities/effects/common/DamageMultiEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageMultiEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,21 +20,20 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; import java.util.UUID; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -71,12 +70,11 @@ public class DamageMultiEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { if (source.getTargets().size() > 0) { Target multiTarget = source.getTargets().get(0); - for (UUID target: multiTarget.getTargets()) { + for (UUID target : multiTarget.getTargets()) { Permanent permanent = game.getPermanent(target); if (permanent != null) { permanent.damage(multiTarget.getTargetAmount(target), source.getSourceId(), game, false, true); - } - else { + } else { Player player = game.getPlayer(target); if (player != null) { player.damage(multiTarget.getTargetAmount(target), source.getSourceId(), game, false, true); @@ -92,9 +90,6 @@ public class DamageMultiEffect extends OneShotEffect { if (staticText != null && !staticText.isEmpty()) { return staticText; } - StringBuilder sb = new StringBuilder(); - sb.append("{source} deals ").append(amount.toString()); - sb.append(" damage divided as you choose among any number of target ").append(mode.getTargets().get(0).getTargetName()); - return sb.toString(); + return "{source} deals " + amount.toString() + " damage divided as you choose among any number of target " + mode.getTargets().get(0).getTargetName(); } } diff --git a/Mage/src/mage/abilities/effects/common/DamageTargetControllerEffect.java b/Mage/src/mage/abilities/effects/common/DamageTargetControllerEffect.java index d8d7216746f..47b57fb15dc 100644 --- a/Mage/src/mage/abilities/effects/common/DamageTargetControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageTargetControllerEffect.java @@ -77,7 +77,7 @@ public class DamageTargetControllerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); if(permanent != null) { Player targetController = game.getPlayer(permanent.getControllerId()); if(targetController != null) { diff --git a/Mage/src/mage/abilities/effects/common/DestroyAllEffect.java b/Mage/src/mage/abilities/effects/common/DestroyAllEffect.java index f9199f93724..51331c4e819 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyAllEffect.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; import mage.abilities.Ability; @@ -43,22 +42,21 @@ public class DestroyAllEffect extends OneShotEffect { private FilterPermanent filter; private boolean noRegen; + public DestroyAllEffect(FilterPermanent filter) { + this(filter, false); + } + public DestroyAllEffect(FilterPermanent filter, boolean noRegen) { super(Outcome.DestroyPermanent); this.filter = filter; this.noRegen = noRegen; if (noRegen) { staticText = "destroy all " + filter.getMessage() + ". They can't be regenerated"; - } - else { + } else { staticText = "destroy all " + filter.getMessage(); } } - public DestroyAllEffect(FilterPermanent filter) { - this(filter, false); - } - public DestroyAllEffect(final DestroyAllEffect effect) { super(effect); this.filter = effect.filter.copy(); diff --git a/Mage/src/mage/abilities/effects/common/DestroyAttachedEffect.java b/Mage/src/mage/abilities/effects/common/DestroyAttachedEffect.java new file mode 100644 index 00000000000..68d51f9ad2f --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/DestroyAttachedEffect.java @@ -0,0 +1,78 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LoneFox + */ +public class DestroyAttachedEffect extends OneShotEffect { + + private final boolean noRegen; + + public DestroyAttachedEffect(String description) { + this(description, false); + } + + public DestroyAttachedEffect(String description, boolean noRegen) { + super(Outcome.DestroyPermanent); + this.noRegen = noRegen; + this.staticText = "destroy " + description; + if(noRegen) { + this.staticText += ". It can't be regenerated"; + } + } + + public DestroyAttachedEffect(final DestroyAttachedEffect effect) { + super(effect); + this.noRegen = effect.noRegen; + } + + @Override + public DestroyAttachedEffect copy() { + return new DestroyAttachedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if(enchantment != null) { + Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); + if(enchanted != null) { + return enchanted.destroy(source.getSourceId(), game, noRegen); + } + } + return false; + } +} diff --git a/Mage/src/mage/abilities/effects/common/DestroyTargetAtBeginningOfNextEndStepEffect.java b/Mage/src/mage/abilities/effects/common/DestroyTargetAtBeginningOfNextEndStepEffect.java new file mode 100644 index 00000000000..02bb9967730 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/DestroyTargetAtBeginningOfNextEndStepEffect.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.constants.Outcome; +import mage.game.Game; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LoneFox + */ +public class DestroyTargetAtBeginningOfNextEndStepEffect extends OneShotEffect { + + public DestroyTargetAtBeginningOfNextEndStepEffect() { + super(Outcome.Detriment); + this.staticText = "Destroy that creature at the beginning of the next end step"; + } + + public DestroyTargetAtBeginningOfNextEndStepEffect(final DestroyTargetAtBeginningOfNextEndStepEffect effect) { + super(effect); + } + + @Override + public DestroyTargetAtBeginningOfNextEndStepEffect copy() { + return new DestroyTargetAtBeginningOfNextEndStepEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + DestroyTargetEffect effect = new DestroyTargetEffect(); + effect.setTargetPointer(new FixedTarget(source.getFirstTarget())); + AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } +} diff --git a/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java b/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java index 9339079cb1f..751ecc86e4a 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java @@ -46,6 +46,7 @@ import mage.util.CardUtil; public class DestroyTargetEffect extends OneShotEffect { protected boolean noRegen; + protected boolean multitargetHandling; public DestroyTargetEffect() { this(false); @@ -57,13 +58,19 @@ public class DestroyTargetEffect extends OneShotEffect { } public DestroyTargetEffect(boolean noRegen) { + this(noRegen, false); + } + + public DestroyTargetEffect(boolean noRegen, boolean multitargetHandling) { super(Outcome.DestroyPermanent); this.noRegen = noRegen; + this.multitargetHandling = multitargetHandling; } public DestroyTargetEffect(final DestroyTargetEffect effect) { super(effect); this.noRegen = effect.noRegen; + this.multitargetHandling = effect.multitargetHandling; } @Override @@ -74,7 +81,7 @@ public class DestroyTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int affectedTargets = 0; - if (source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // for Rain of Thorns + if (multitargetHandling && source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // Decimate for (Target target : source.getTargets()) { for (UUID permanentId : target.getTargets()) { Permanent permanent = game.getPermanent(permanentId); @@ -84,7 +91,7 @@ public class DestroyTargetEffect extends OneShotEffect { } } } - } else if (targetPointer.getTargets(game, source).size() > 0) { + } else { for (UUID permanentId : targetPointer.getTargets(game, source)) { Permanent permanent = game.getPermanent(permanentId); if (permanent != null) { diff --git a/Mage/src/mage/abilities/effects/common/DevourEffect.java b/Mage/src/mage/abilities/effects/common/DevourEffect.java index 1d02ab1733d..18432616aa8 100644 --- a/Mage/src/mage/abilities/effects/common/DevourEffect.java +++ b/Mage/src/mage/abilities/effects/common/DevourEffect.java @@ -39,6 +39,7 @@ import mage.counters.CounterType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -47,30 +48,32 @@ import mage.target.common.TargetControlledCreaturePermanent; /** * Effect for the DevourAbility - * - * 702.81. Devour - * 702.81a Devour is a static ability. "Devour N" means "As this object enters the battlefield, - * you may sacrifice any number of creatures. This permanent enters the battlefield with N +1/+1 - * counters on it for each creature sacrificed this way." - * 702.81b Some objects have abilities that refer to the number of creatures the permanent devoured. - * "It devoured" means "sacrificed as a result of its devour ability as it entered the battlefield." * - * + * 702.81. Devour 702.81a Devour is a static ability. "Devour N" means "As this + * object enters the battlefield, you may sacrifice any number of creatures. + * This permanent enters the battlefield with N +1/+1 counters on it for each + * creature sacrificed this way." 702.81b Some objects have abilities that refer + * to the number of creatures the permanent devoured. "It devoured" means + * "sacrificed as a result of its devour ability as it entered the battlefield." + * + * * @author LevelX2 */ public class DevourEffect extends ReplacementEffectImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creatures to devour"); + static { filter.add(new AnotherPredicate()); } private final DevourFactor devourFactor; public enum DevourFactor { - Devour1 ("Devour 1", "that many +1/+1 counters on it", 1), - Devour2 ("Devour 2", "twice that many +1/+1 counters on it", 2), - Devour3 ("Devour 3", "three times that many +1/+1 counters on it", 3), - DevourX ("Devour X, where X is the number of creatures devoured this way", "X +1/+1 counters on it for each of those creatures", Integer.MAX_VALUE); + + Devour1("Devour 1", "that many +1/+1 counters on it", 1), + Devour2("Devour 2", "twice that many +1/+1 counters on it", 2), + Devour3("Devour 3", "three times that many +1/+1 counters on it", 3), + DevourX("Devour X, where X is the number of creatures devoured this way", "X +1/+1 counters on it for each of those creatures", Integer.MAX_VALUE); private final String text; private final String ruleText; @@ -114,9 +117,9 @@ public class DevourEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getSourceId())) { - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - game.getState().setValue(sourcePermanent.getId().toString() + "devoured", null); - return true; + Permanent sourcePermanent = ((EntersTheBattlefieldEvent) event).getTarget(); + game.getState().setValue(sourcePermanent.getId().toString() + "devoured", null); + return true; } return false; } @@ -128,7 +131,7 @@ public class DevourEffect extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getTargetId()); + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); Player controller = game.getPlayer(source.getControllerId()); if (creature != null && controller != null) { Target target = new TargetControlledCreaturePermanent(1, Integer.MAX_VALUE, filter, true); @@ -141,9 +144,10 @@ public class DevourEffect extends ReplacementEffectImpl { if (target.getTargets().size() > 0) { List> cardSubtypes = new ArrayList<>(); int devouredCreatures = target.getTargets().size(); - if (!game.isSimulation()) - game.informPlayers(new StringBuilder(creature.getName()).append(" devours ").append(devouredCreatures).append(" creatures").toString()); - for (UUID targetId: target.getTargets()) { + if (!game.isSimulation()) { + game.informPlayers(creature.getLogName() + " devours " + devouredCreatures + " creatures"); + } + for (UUID targetId : target.getTargets()) { Permanent targetCreature = game.getPermanent(targetId); if (targetCreature != null) { cardSubtypes.add((ArrayList) targetCreature.getSubtype()); @@ -172,7 +176,7 @@ public class DevourEffect extends ReplacementEffectImpl { StringBuilder sb = new StringBuilder(devourFactor.toString()); sb.append(" (As this enters the battlefield, you may sacrifice any number of creatures. This creature enters the battlefield with "); sb.append(devourFactor.getRuleText()).append(")"); - return sb.toString(); + return sb.toString(); } public List> getSubtypes(Game game, UUID permanentId) { diff --git a/Mage/src/mage/abilities/effects/common/DiscardOntoBattlefieldEffect.java b/Mage/src/mage/abilities/effects/common/DiscardOntoBattlefieldEffect.java index 137b33c5145..1a82af11cdf 100644 --- a/Mage/src/mage/abilities/effects/common/DiscardOntoBattlefieldEffect.java +++ b/Mage/src/mage/abilities/effects/common/DiscardOntoBattlefieldEffect.java @@ -34,8 +34,8 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; -import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.stack.StackObject; import mage.players.Player; @@ -85,7 +85,7 @@ public class DiscardOntoBattlefieldEffect extends ReplacementEffectImpl { if (card != null) { Player owner = game.getPlayer(card.getOwnerId()); if (owner != null) { - if (owner.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId())) { + if (owner.moveCards(card, Zone.BATTLEFIELD, source, game)) { return true; } } diff --git a/Mage/src/mage/abilities/effects/common/DoIfCostPaid.java b/Mage/src/mage/abilities/effects/common/DoIfCostPaid.java index 000ee2e2753..e16c66de7bb 100644 --- a/Mage/src/mage/abilities/effects/common/DoIfCostPaid.java +++ b/Mage/src/mage/abilities/effects/common/DoIfCostPaid.java @@ -18,16 +18,22 @@ public class DoIfCostPaid extends OneShotEffect { protected Effects executingEffects = new Effects(); private final Cost cost; private String chooseUseText; + private boolean optional; public DoIfCostPaid(Effect effect, Cost cost) { this(effect, cost, null); } public DoIfCostPaid(Effect effect, Cost cost, String chooseUseText) { + this(effect, cost, chooseUseText, true); + } + + public DoIfCostPaid(Effect effect, Cost cost, String chooseUseText, boolean optional) { super(Outcome.Benefit); this.executingEffects.add(effect); this.cost = cost; this.chooseUseText = chooseUseText; + this.optional = optional; } public DoIfCostPaid(final DoIfCostPaid effect) { @@ -35,6 +41,7 @@ public class DoIfCostPaid extends OneShotEffect { this.executingEffects = effect.executingEffects.copy(); this.cost = effect.cost.copy(); this.chooseUseText = effect.chooseUseText; + this.optional = effect.optional; } public void addEffect(Effect effect) { @@ -53,12 +60,14 @@ public class DoIfCostPaid extends OneShotEffect { effectText = effectText.substring(0, effectText.length() - 1); } message = getCostText() + " and " + effectText + "?"; + message = Character.toUpperCase(message.charAt(0)) + message.substring(1); } else { message = chooseUseText; } message = CardUtil.replaceSourceName(message, mageObject.getLogName()); boolean result = true; - if (cost.canPay(source, source.getSourceId(), player.getId(), game) && player.chooseUse(executingEffects.get(0).getOutcome(), message, source, game)) { + if (cost.canPay(source, source.getSourceId(), player.getId(), game) + && (optional && player.chooseUse(executingEffects.get(0).getOutcome(), message, source, game))) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) { for (Effect effect : executingEffects) { @@ -69,7 +78,7 @@ public class DoIfCostPaid extends OneShotEffect { game.addEffect((ContinuousEffect) effect, source); } } - player.resetStoredBookmark(game); // otherwise you can undo card drawn with Mentor of the Meek + player.resetStoredBookmark(game); // otherwise you can e.g. undo card drawn with Mentor of the Meek } } return result; @@ -86,13 +95,14 @@ public class DoIfCostPaid extends OneShotEffect { if (!staticText.isEmpty()) { return staticText; } - return "you may " + getCostText() + ". If you do, " + executingEffects.getText(mode); + return (optional ? "you may " : "") + getCostText() + ". If you do, " + executingEffects.getText(mode); } protected String getCostText() { StringBuilder sb = new StringBuilder(); String costText = cost.getText(); if (costText != null + && !costText.toLowerCase().startsWith("put") && !costText.toLowerCase().startsWith("exile") && !costText.toLowerCase().startsWith("discard") && !costText.toLowerCase().startsWith("sacrifice") diff --git a/Mage/src/mage/abilities/effects/common/DontUntapAsLongAsSourceTappedEffect.java b/Mage/src/mage/abilities/effects/common/DontUntapAsLongAsSourceTappedEffect.java new file mode 100644 index 00000000000..f84dc06ceed --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/DontUntapAsLongAsSourceTappedEffect.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.abilities.effects.common; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepTargetEffect; +import mage.constants.Duration; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author LoneFox + */ + +public class DontUntapAsLongAsSourceTappedEffect extends ConditionalContinuousRuleModifyingEffect { + + public DontUntapAsLongAsSourceTappedEffect() { + super(new DontUntapInControllersUntapStepTargetEffect(Duration.Custom), SourceTappedCondition.getInstance()); + staticText = "It doesn't untap during its controller's untap step for as long as {source} remains tapped."; + } + + public DontUntapAsLongAsSourceTappedEffect(final DontUntapAsLongAsSourceTappedEffect effect) { + super(effect); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if(event.getType() == GameEvent.EventType.UNTAP && event.getTargetId().equals(source.getSourceId())) { + effect.discard(); + } + return super.applies(event, source, game); + } + + @Override + public DontUntapAsLongAsSourceTappedEffect copy() { + return new DontUntapAsLongAsSourceTappedEffect(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/DontUntapInControllersNextUntapStepTargetEffect.java b/Mage/src/mage/abilities/effects/common/DontUntapInControllersNextUntapStepTargetEffect.java index 44403167deb..e679a45d44b 100644 --- a/Mage/src/mage/abilities/effects/common/DontUntapInControllersNextUntapStepTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DontUntapInControllersNextUntapStepTargetEffect.java @@ -148,7 +148,7 @@ public class DontUntapInControllersNextUntapStepTargetEffect extends ContinuousR if (targetName != null && targetName.length() > 0) { return targetName + " doesn't untap during its controller's next untap step"; } else { - return "Target " + (mode == null ? "creature" : mode.getTargets().get(0).getTargetName()) + " doesn't untap during its controller's next untap step"; + return "target " + (mode == null ? "creature" : mode.getTargets().get(0).getTargetName()) + " doesn't untap during its controller's next untap step"; } } diff --git a/Mage/src/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java b/Mage/src/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java index 7818cc0d242..a15aa089b8d 100644 --- a/Mage/src/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java +++ b/Mage/src/mage/abilities/effects/common/DontUntapInControllersUntapStepEnchantedEffect.java @@ -15,8 +15,12 @@ import mage.game.permanent.Permanent; public class DontUntapInControllersUntapStepEnchantedEffect extends ContinuousRuleModifyingEffectImpl { public DontUntapInControllersUntapStepEnchantedEffect() { + this("creature"); + } + + public DontUntapInControllersUntapStepEnchantedEffect(String description) { super(Duration.WhileOnBattlefield, Outcome.Detriment, false, true); - staticText = "Enchanted permanent doesn't untap during its controller's untap step"; + staticText = "Enchanted " + description + " doesn't untap during its controller's untap step"; } public DontUntapInControllersUntapStepEnchantedEffect(final DontUntapInControllersUntapStepEnchantedEffect effect) { @@ -40,7 +44,7 @@ public class DontUntapInControllersUntapStepEnchantedEffect extends ContinuousRu Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); if (enchanted != null) { return enchanted.getLogName() + " doesn't untap during its controller's untap step (" + enchantment.getLogName() + ")"; - } + } } return null; } @@ -49,7 +53,7 @@ public class DontUntapInControllersUntapStepEnchantedEffect extends ContinuousRu public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.UNTAP; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { if (PhaseStep.UNTAP.equals(game.getTurn().getStepType())) { diff --git a/Mage/src/mage/abilities/effects/common/DontUntapInControllersUntapStepSourceEffect.java b/Mage/src/mage/abilities/effects/common/DontUntapInControllersUntapStepSourceEffect.java index 576628205dc..fd5d40ed8ae 100644 --- a/Mage/src/mage/abilities/effects/common/DontUntapInControllersUntapStepSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/DontUntapInControllersUntapStepSourceEffect.java @@ -27,11 +27,11 @@ */ package mage.abilities.effects.common; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.PhaseStep; -import mage.abilities.Ability; -import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -44,7 +44,11 @@ import mage.game.permanent.Permanent; public class DontUntapInControllersUntapStepSourceEffect extends ContinuousRuleModifyingEffectImpl { public DontUntapInControllersUntapStepSourceEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment, false, true); + this(false, true); + } + + public DontUntapInControllersUntapStepSourceEffect(boolean messageToUser, boolean messageToLog) { + super(Duration.WhileOnBattlefield, Outcome.Detriment, messageToUser, messageToLog); staticText = "{this} doesn't untap during your untap step"; } @@ -78,4 +82,5 @@ public class DontUntapInControllersUntapStepSourceEffect extends ContinuousRuleM } return false; } + } diff --git a/Mage/src/mage/abilities/effects/common/DrawCardSourceControllerEffect.java b/Mage/src/mage/abilities/effects/common/DrawCardSourceControllerEffect.java index 00ce366db90..2a152eebc1d 100644 --- a/Mage/src/mage/abilities/effects/common/DrawCardSourceControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/DrawCardSourceControllerEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,20 +20,19 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; import mage.game.Game; import mage.players.Player; import mage.util.CardUtil; @@ -78,7 +77,7 @@ public class DrawCardSourceControllerEffect extends OneShotEffect { private void setText() { StringBuilder sb = new StringBuilder(); boolean oneCard = (amount instanceof StaticValue && amount.calculate(null, null, this) == 1) - || amount instanceof PermanentsOnBattlefieldCount || amount.toString().equals("1"); + || amount instanceof PermanentsOnBattlefieldCount || amount.toString().equals("1"); sb.append("draw ").append(oneCard ? "a" : CardUtil.numberToText(amount.toString())).append(" card"); if (!oneCard) { sb.append("s"); @@ -91,5 +90,4 @@ public class DrawCardSourceControllerEffect extends OneShotEffect { staticText = sb.toString(); } - } diff --git a/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java b/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java index 6443cc2efbc..7d7556fc7cf 100644 --- a/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; import mage.abilities.Ability; @@ -51,6 +50,7 @@ public class DrawCardTargetEffect extends OneShotEffect { public DrawCardTargetEffect(int amount) { this(new StaticValue(amount)); } + public DrawCardTargetEffect(int amount, boolean optional) { this(new StaticValue(amount), optional); } @@ -117,7 +117,7 @@ public class DrawCardTargetEffect extends OneShotEffect { if (upTo) { sb.append("up to "); } - sb.append(CardUtil.numberToText(amount.toString())).append(" card"); + sb.append(CardUtil.numberToText(amount.toString(), "a")).append(" card"); try { if (Integer.parseInt(amount.toString()) > 1) { sb.append("s"); @@ -133,5 +133,4 @@ public class DrawCardTargetEffect extends OneShotEffect { return sb.toString(); } - } diff --git a/Mage/src/mage/abilities/effects/common/DrawDiscardControllerEffect.java b/Mage/src/mage/abilities/effects/common/DrawDiscardControllerEffect.java index 811addcd588..a710d9aff7e 100644 --- a/Mage/src/mage/abilities/effects/common/DrawDiscardControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/DrawDiscardControllerEffect.java @@ -57,10 +57,12 @@ public class DrawDiscardControllerEffect extends OneShotEffect { this.cardsToDraw = cardsToDraw; this.cardsToDiscard = cardsToDiscard; this.optional = optional; - staticText = new StringBuilder("Draw ") + staticText = new StringBuilder(optional ? "you may " : "") + .append("draw ") .append(cardsToDraw == 1 ? "a" : CardUtil.numberToText(cardsToDraw)) .append(" card").append(cardsToDraw == 1 ? "" : "s") - .append(", then discard ") + .append(optional ? ", if you do" : ", then") + .append(" discard ") .append(cardsToDiscard == 1 ? "a" : CardUtil.numberToText(cardsToDiscard)) .append(" card").append(cardsToDiscard == 1 ? "" : "s").toString(); } diff --git a/Mage/src/mage/abilities/effects/common/DynamicManaEffect.java b/Mage/src/mage/abilities/effects/common/DynamicManaEffect.java index d6f5cf01087..6d6cc7597a7 100644 --- a/Mage/src/mage/abilities/effects/common/DynamicManaEffect.java +++ b/Mage/src/mage/abilities/effects/common/DynamicManaEffect.java @@ -154,15 +154,15 @@ public class DynamicManaEffect extends BasicManaEffect { } } if (choiceColor.getColor().isBlack()) { - computedMana.addBlack(); + computedMana.increaseBlack(); } else if (choiceColor.getColor().isBlue()) { - computedMana.addBlue(); + computedMana.increaseBlue(); } else if (choiceColor.getColor().isRed()) { - computedMana.addRed(); + computedMana.increaseRed(); } else if (choiceColor.getColor().isGreen()) { - computedMana.addGreen(); + computedMana.increaseGreen(); } else if (choiceColor.getColor().isWhite()) { - computedMana.addWhite(); + computedMana.increaseWhite(); } if (!oneChoice) { choiceColor.clearChoice(); diff --git a/Mage/src/mage/abilities/effects/common/EndTurnEffect.java b/Mage/src/mage/abilities/effects/common/EndTurnEffect.java index 2a5608c0f73..09dc3eb79af 100644 --- a/Mage/src/mage/abilities/effects/common/EndTurnEffect.java +++ b/Mage/src/mage/abilities/effects/common/EndTurnEffect.java @@ -36,7 +36,7 @@ public class EndTurnEffect extends OneShotEffect { public EndTurnEffect() { super(Outcome.Detriment); - staticText = "End the turn (Exile all spells and abilities on the stack. Discard down to your maximum hand size. Damage wears off, and \"this turn\" and \"until end of turn\" effects end.)"; + staticText = "End the turn (Exile all spells and abilities on the stack. Discard down to your maximum hand size. Damage wears off, and \"this turn\" and \"until end of turn\" effects end.)"; } public EndTurnEffect(EndTurnEffect effect) { diff --git a/Mage/src/mage/abilities/effects/common/EnterBattlefieldPayCostOrPutGraveyardEffect.java b/Mage/src/mage/abilities/effects/common/EnterBattlefieldPayCostOrPutGraveyardEffect.java index f485ee25c02..e4b3e481310 100644 --- a/Mage/src/mage/abilities/effects/common/EnterBattlefieldPayCostOrPutGraveyardEffect.java +++ b/Mage/src/mage/abilities/effects/common/EnterBattlefieldPayCostOrPutGraveyardEffect.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; import mage.MageObject; @@ -45,13 +44,12 @@ import mage.players.Player; * * @author LevelX2 */ - public class EnterBattlefieldPayCostOrPutGraveyardEffect extends ReplacementEffectImpl { private final Cost cost; public EnterBattlefieldPayCostOrPutGraveyardEffect(Cost cost) { - super(Duration.WhileOnBattlefield, Outcome.PutCardInPlay); + super(Duration.EndOfGame, Outcome.PutCardInPlay); this.cost = cost; staticText = "If {this} would enter the battlefield, " + cost.getText() + " instead. If you do, put {this} onto the battlefield. If you don't, put it into its owner's graveyard"; } @@ -75,7 +73,7 @@ public class EnterBattlefieldPayCostOrPutGraveyardEffect extends ReplacementEffe public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player player = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); - if (player != null && cost != null && sourceObject != null){ + if (player != null && cost != null && sourceObject != null) { boolean replace = true; if (cost.canPay(source, source.getSourceId(), player.getId(), game)) { if (player.chooseUse(outcome, cost.getText() + "? (otherwise " + sourceObject.getLogName() + " is put into graveyard)", source, game)) { @@ -86,7 +84,7 @@ public class EnterBattlefieldPayCostOrPutGraveyardEffect extends ReplacementEffe if (replace) { Card card = game.getCard(event.getTargetId()); if (card != null) { - player.moveCards(card, game.getState().getZone(event.getTargetId()), Zone.GRAVEYARD, source, game); + player.moveCards(card, Zone.GRAVEYARD, source, game); } return true; } @@ -103,7 +101,7 @@ public class EnterBattlefieldPayCostOrPutGraveyardEffect extends ReplacementEffe public boolean applies(GameEvent event, Ability source, Game game) { if (source.getSourceId().equals(event.getTargetId())) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if(zEvent.getToZone().equals(Zone.BATTLEFIELD)){ + if (zEvent.getToZone().equals(Zone.BATTLEFIELD)) { return true; } } diff --git a/Mage/src/mage/abilities/effects/common/EntersBattlefieldWithXCountersEffect.java b/Mage/src/mage/abilities/effects/common/EntersBattlefieldWithXCountersEffect.java new file mode 100644 index 00000000000..9c704852225 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/EntersBattlefieldWithXCountersEffect.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.effects.OneShotEffect; +import mage.constants.AbilityType; +import mage.constants.Outcome; +import mage.counters.Counter; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * Use this effect only (I guess) with EntersBattlefieldAbility like abilities + * + * @author LevelX2 + */ +public class EntersBattlefieldWithXCountersEffect extends OneShotEffect { + + protected final Counter counter; + + public EntersBattlefieldWithXCountersEffect(Counter counter) { + super(Outcome.BoostCreature); + this.counter = counter; + staticText = "with X " + counter.getName() + " counters on it"; + } + + public EntersBattlefieldWithXCountersEffect(final EntersBattlefieldWithXCountersEffect effect) { + super(effect); + this.counter = effect.counter; + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent == null) { + if (permanent == null && source.getAbilityType().equals(AbilityType.STATIC)) { + permanent = game.getPermanentEntering(source.getSourceId()); + } + } + if (permanent != null) { + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) { + if (spellAbility.getSourceId().equals(source.getSourceId())) { // put into play by normal cast + int amount = spellAbility.getManaCostsToPay().getX(); + if (amount > 0) { + Counter counterToAdd = counter.copy(); + counterToAdd.add(amount - counter.getCount()); + permanent.addCounters(counterToAdd, game); + } + } + } + } + return true; + } + + @Override + public EntersBattlefieldWithXCountersEffect copy() { + return new EntersBattlefieldWithXCountersEffect(this); + } + +} diff --git a/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java b/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java index 6e99909a49e..6f3170a0700 100644 --- a/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java @@ -61,12 +61,11 @@ public class ExileAndReturnTransformedSourceEffect extends OneShotEffect { Permanent sourceObject = game.getPermanent(source.getSourceId()); Player controller = game.getPlayer(source.getControllerId()); if (sourceObject != null && controller != null && sourceObject.getZoneChangeCounter(game) == source.getSourceObjectZoneChangeCounter()) { - Card card = (Card) sourceObject; - if (controller.moveCards(card, Zone.BATTLEFIELD, Zone.EXILED, source, game)) { - Player owner = game.getPlayer(card.getOwnerId()); - if (owner != null) { - game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE); - owner.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); + if (controller.moveCards(sourceObject, Zone.EXILED, source, game)) { + game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE); + Card cardFromExile = game.getCard(source.getSourceId()); + if (cardFromExile != null) { + controller.moveCards(cardFromExile, Zone.BATTLEFIELD, source, game, false, false, true, null); if (additionalEffect != null) { if (additionalEffect instanceof ContinuousEffect) { game.addEffect((ContinuousEffect) additionalEffect, source); diff --git a/Mage/src/mage/abilities/effects/common/ExileCardsFromTopOfLibraryTargetEffect.java b/Mage/src/mage/abilities/effects/common/ExileCardsFromTopOfLibraryTargetEffect.java new file mode 100644 index 00000000000..b0be1dd9fcc --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/ExileCardsFromTopOfLibraryTargetEffect.java @@ -0,0 +1,60 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class ExileCardsFromTopOfLibraryTargetEffect extends OneShotEffect { + + int amount; + String targetName; + + public ExileCardsFromTopOfLibraryTargetEffect(int amount) { + this(amount, null); + } + + public ExileCardsFromTopOfLibraryTargetEffect(int amount, String targetName) { + super(Outcome.Exile); + this.amount = amount; + this.staticText = (targetName == null ? "that player" : targetName) + " exiles the top " + + CardUtil.numberToText(amount, "") + + (amount == 1 ? "card" : " cards") + " of his or her library"; + } + + public ExileCardsFromTopOfLibraryTargetEffect(final ExileCardsFromTopOfLibraryTargetEffect effect) { + super(effect); + this.amount = effect.amount; + + } + + @Override + public ExileCardsFromTopOfLibraryTargetEffect copy() { + return new ExileCardsFromTopOfLibraryTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (targetPlayer != null) { + Cards cards = new CardsImpl(); + cards.addAll(targetPlayer.getLibrary().getTopCards(game, amount)); + return targetPlayer.moveCards(cards, null, Zone.EXILED, source, game); + } + return false; + } +} diff --git a/Mage/src/mage/abilities/effects/common/ExileFromZoneTargetEffect.java b/Mage/src/mage/abilities/effects/common/ExileFromZoneTargetEffect.java index 48be98f6899..97ecc487a04 100644 --- a/Mage/src/mage/abilities/effects/common/ExileFromZoneTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ExileFromZoneTargetEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -28,17 +28,18 @@ package mage.abilities.effects.common; import java.util.UUID; -import mage.constants.Outcome; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; +import mage.cards.CardsImpl; +import mage.constants.Outcome; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; import mage.target.Target; import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInYourGraveyard; +import mage.util.CardUtil; /** * @@ -90,16 +91,11 @@ public class ExileFromZoneTargetEffect extends OneShotEffect { default: } if (target != null && target.canChoose(source.getSourceId(), player.getId(), game)) { - if (target.choose(Outcome.Exile, player.getId(), source.getSourceId(), game)) { - for (UUID cardId : target.getTargets()) { - Card card = game.getCard(cardId); - if (card != null) { - card.moveToExile(exileId, exileName, source.getSourceId(), game); - } - } - return true; + if (target.chooseTarget(Outcome.Exile, player.getId(), source, game)) { + player.moveCardsToExile(new CardsImpl(target.getTargets()).getCards(game), source, game, true, exileId, exileName); } } + return true; } return false; } @@ -110,10 +106,6 @@ public class ExileFromZoneTargetEffect extends OneShotEffect { } private void setText() { - if (amount == 1) { - staticText = "Target player exiles a " + filter.getMessage() + " from his or her " + zone.toString().toLowerCase(); - } else { - staticText = "Target player exiles " + amount + " " + filter.getMessage() + " from his or her " + zone.toString().toLowerCase(); - } + staticText = "target player exiles " + CardUtil.numberToText(amount, "a") + " " + filter.getMessage() + " from his or her " + zone.toString().toLowerCase(); } } diff --git a/Mage/src/mage/abilities/effects/common/ExileSourceEffect.java b/Mage/src/mage/abilities/effects/common/ExileSourceEffect.java index f60cf67ba16..60efb497e97 100644 --- a/Mage/src/mage/abilities/effects/common/ExileSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/ExileSourceEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; import java.util.UUID; @@ -49,11 +48,12 @@ public class ExileSourceEffect extends OneShotEffect { public ExileSourceEffect() { this(false); } - + /** - * - * @param toUniqueExileZone moves the card to a source object dependant unique exile zone, so another - * effect of the same source object (e.g. Deadeye Navigator) can identify the card + * + * @param toUniqueExileZone moves the card to a source object dependant + * unique exile zone, so another effect of the same source object (e.g. + * Deadeye Navigator) can identify the card */ public ExileSourceEffect(boolean toUniqueExileZone) { super(Outcome.Exile); @@ -72,10 +72,10 @@ public class ExileSourceEffect extends OneShotEffect { } @Override - public boolean apply(Game game, Ability source) { + public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - MageObject sourceObject = source.getSourceObjectIfItStillExists(game); + MageObject sourceObject = source.getSourceObjectIfItStillExists(game); if (sourceObject instanceof Card) { UUID exileZoneId = null; String exileZoneName = ""; @@ -84,7 +84,7 @@ public class ExileSourceEffect extends OneShotEffect { exileZoneName = sourceObject.getName(); } Card sourceCard = (Card) sourceObject; - return controller.moveCardToExileWithInfo(sourceCard, exileZoneId, exileZoneName, source.getSourceId(), game, game.getState().getZone(sourceCard.getId()), true); + return controller.moveCardsToExile(sourceCard, source, game, true, exileZoneId, exileZoneName); } return true; } diff --git a/Mage/src/mage/abilities/effects/common/ExileSpellEffect.java b/Mage/src/mage/abilities/effects/common/ExileSpellEffect.java index df19c8af57e..dc531885637 100644 --- a/Mage/src/mage/abilities/effects/common/ExileSpellEffect.java +++ b/Mage/src/mage/abilities/effects/common/ExileSpellEffect.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; import mage.abilities.Ability; @@ -35,6 +34,7 @@ import mage.cards.Card; import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; +import mage.game.stack.Spell; import mage.players.Player; /** @@ -58,14 +58,17 @@ public class ExileSpellEffect extends OneShotEffect implements MageSingleton { public ExileSpellEffect copy() { return fINSTANCE; } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Card spellCard = game.getStack().getSpell(source.getSourceId()).getCard(); - if (spellCard != null) { - controller.moveCardToExileWithInfo(spellCard, null, "", source.getSourceId(), game, Zone.STACK, true); + Spell spell = game.getStack().getSpell(source.getId()); + if (spell != null && !spell.isCopiedSpell()) { + Card spellCard = spell.getCard(); + if (spellCard != null) { + controller.moveCards(spellCard, Zone.EXILED, source, game); + } } return true; } diff --git a/Mage/src/mage/abilities/effects/common/ExileTargetAndSearchGraveyardHandLibraryEffect.java b/Mage/src/mage/abilities/effects/common/ExileTargetAndSearchGraveyardHandLibraryEffect.java index 5c7d93bdaf6..58c9e3c03ae 100644 --- a/Mage/src/mage/abilities/effects/common/ExileTargetAndSearchGraveyardHandLibraryEffect.java +++ b/Mage/src/mage/abilities/effects/common/ExileTargetAndSearchGraveyardHandLibraryEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,31 +20,26 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; -import mage.abilities.SpellAbility; import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect; -import mage.cards.Card; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.Target; import mage.target.TargetPermanent; -import mage.target.TargetPlayer; /** * * @author LevelX2 */ - public class ExileTargetAndSearchGraveyardHandLibraryEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExileEffect { public ExileTargetAndSearchGraveyardHandLibraryEffect(Boolean graveyardExileOptional, String searchWhatText, String searchForText) { @@ -66,17 +61,16 @@ public class ExileTargetAndSearchGraveyardHandLibraryEffect extends SearchTarget exileTarget = target; break; } - } + } if (exileTarget != null) { Permanent permanentToExile = game.getPermanent(exileTarget.getFirstTarget()); if (permanentToExile != null) { targetPlayerId = permanentToExile.getControllerId(); result = permanentToExile.moveToExile(null, "", source.getSourceId(), game); - this.applySearchAndExile(game, source, permanentToExile.getName(), targetPlayerId); + this.applySearchAndExile(game, source, permanentToExile.getName(), targetPlayerId); } } - return result; } @@ -92,4 +86,4 @@ public class ExileTargetAndSearchGraveyardHandLibraryEffect extends SearchTarget sb.append(super.getText(mode)); return sb.toString(); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/effects/common/ExileTargetEffect.java b/Mage/src/mage/abilities/effects/common/ExileTargetEffect.java index 4f03c6d7a6e..0cd80c15af0 100644 --- a/Mage/src/mage/abilities/effects/common/ExileTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ExileTargetEffect.java @@ -1,39 +1,40 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; +import java.util.LinkedHashSet; +import java.util.Set; import java.util.UUID; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; +import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; @@ -85,23 +86,25 @@ public class ExileTargetEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { + Set toExile = new LinkedHashSet<>(); for (UUID targetId : getTargetPointer().getTargets(game, source)) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { Zone currentZone = game.getState().getZone(permanent.getId()); if (!currentZone.equals(Zone.EXILED) && (onlyFromZone == null || onlyFromZone.equals(Zone.BATTLEFIELD))) { - controller.moveCardToExileWithInfo(permanent, exileId, exileZone, source.getSourceId(), game, currentZone, true); + toExile.add(permanent); } } else { Card card = game.getCard(targetId); if (card != null) { Zone currentZone = game.getState().getZone(card.getId()); if (!currentZone.equals(Zone.EXILED) && (onlyFromZone == null || onlyFromZone.equals(currentZone))) { - controller.moveCardToExileWithInfo(card, exileId, exileZone, source.getSourceId(), game, currentZone, true); + toExile.add(card); } } } } + controller.moveCardsToExile(toExile, source, game, true, exileId, exileZone); return true; } return false; diff --git a/Mage/src/mage/abilities/effects/common/ExileTargetForSourceEffect.java b/Mage/src/mage/abilities/effects/common/ExileTargetForSourceEffect.java index 99b3a1e0bdc..697c07435ab 100644 --- a/Mage/src/mage/abilities/effects/common/ExileTargetForSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/ExileTargetForSourceEffect.java @@ -1,43 +1,39 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; -import mage.constants.AbilityType; import mage.constants.Outcome; -import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -49,7 +45,6 @@ import mage.util.CardUtil; */ public class ExileTargetForSourceEffect extends OneShotEffect { - public ExileTargetForSourceEffect() { super(Outcome.Exile); } @@ -71,11 +66,11 @@ public class ExileTargetForSourceEffect extends OneShotEffect { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); if (permanent != null) { - return controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.BATTLEFIELD, true); + return controller.moveCardsToExile(permanent, source, game, true, exileId, sourceObject.getIdName()); } else { Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null) { - return controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, game.getState().getZone(card.getId()), true); + return controller.moveCardsToExile(card, source, game, true, exileId, sourceObject.getIdName()); } } } @@ -84,10 +79,14 @@ public class ExileTargetForSourceEffect extends OneShotEffect { @Override public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + if (mode.getTargets().isEmpty()) { - return "Exile it"; + return "exile it"; } else { - return "Exile target " + mode.getTargets().get(0).getTargetName(); + return "exile target " + mode.getTargets().get(0).getTargetName(); } } } diff --git a/Mage/src/mage/abilities/effects/common/HideawayPlayEffect.java b/Mage/src/mage/abilities/effects/common/HideawayPlayEffect.java index b8333d2d39d..6c757284942 100644 --- a/Mage/src/mage/abilities/effects/common/HideawayPlayEffect.java +++ b/Mage/src/mage/abilities/effects/common/HideawayPlayEffect.java @@ -30,13 +30,11 @@ package mage.abilities.effects.common; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; -import mage.constants.CardType; import mage.constants.Outcome; import mage.game.ExileZone; import mage.game.Game; import mage.players.Player; import mage.util.CardUtil; -import org.apache.log4j.Logger; /** * @author LevelX2 @@ -61,39 +59,17 @@ public class HideawayPlayEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)); - if (zone ==null || zone.isEmpty()) { - return false; + if (zone == null || zone.isEmpty()) { + return true; } Card card = zone.getCards(game).iterator().next(); Player controller = game.getPlayer(source.getControllerId()); if (card != null && controller != null) { - if (card.getCardType().contains(CardType.LAND)) { - // If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn. - if (game.getActivePlayerId().equals(source.getControllerId()) && controller.canPlayLand()) { - if (controller.chooseUse(Outcome.Benefit, "Play " + card.getLogName() + " from Exile?", source, game)) { - card.setFaceDown(false, game); - return controller.playLand(card, game); - } - } else if (!game.isSimulation()) { - game.informPlayer(controller, "You're not able to play the land now due to regular restrictions."); - } - } else { - if (card.getSpellAbility() != null) { - // The land's last ability allows you to play the removed card as part of the resolution of that ability. - // Timing restrictions based on the card's type are ignored (for instance, if it's a creature or sorcery). - // Other play restrictions are not (such as "Play [this card] only during combat"). - if (controller.chooseUse(Outcome.Benefit, "Cast "+ card.getLogName() + " without paying its mana cost?", source, game)) { - card.setFaceDown(false, game); - return controller.cast(card.getSpellAbility(), game, true); - } - } else { - Logger.getLogger(HideawayPlayEffect.class).error("Non land card had no spell ability: " + card.getName()); - return false; - } + if (controller.chooseUse(Outcome.PlayForFree, "Do you want to play " + card.getIdName() + " for free now?", source, game)) { + controller.playCard(card, game, true, false); } return true; } return false; } } - diff --git a/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java b/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java index 88121480466..529760e039b 100644 --- a/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/LookLibraryAndPickControllerEffect.java @@ -1,5 +1,5 @@ /* - * + * * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are @@ -25,7 +25,7 @@ * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. - * + * */ package mage.abilities.effects.common; @@ -42,32 +42,28 @@ import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; - -import java.util.List; -import java.util.UUID; import mage.util.CardUtil; /** * * @author LevelX */ - public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEffect { protected FilterCard filter; // which kind of cards to reveal protected DynamicValue numberToPick; protected boolean revealPickedCards = true; - protected Zone targetPickedCards = Zone.HAND; // HAND + protected Zone targetPickedCards = Zone.HAND; // HAND protected int foundCardsToPick = 0; protected boolean optional; private boolean upTo; public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick, FilterCard pickFilter, boolean putOnTop) { - this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter, putOnTop, true); + this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter, putOnTop, true); } public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick, FilterCard pickFilter, boolean putOnTop, boolean reveal) { - this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter, Zone.LIBRARY, putOnTop, reveal); + this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter, Zone.LIBRARY, putOnTop, reveal); } public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick, @@ -92,13 +88,13 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick, FilterCard pickFilter, Zone targetZoneLookedCards, boolean putOnTop, boolean reveal, boolean upTo, Zone targetZonePickedCards, boolean optional) { - super(Outcome.DrawCard, numberOfCards, mayShuffleAfter, targetZoneLookedCards, putOnTop); - this.numberToPick = numberToPick; - this.filter = pickFilter; - this.revealPickedCards = reveal; - this.targetPickedCards = targetZonePickedCards; - this.upTo = upTo; - this.optional = optional; + super(Outcome.DrawCard, numberOfCards, mayShuffleAfter, targetZoneLookedCards, putOnTop); + this.numberToPick = numberToPick; + this.filter = pickFilter; + this.revealPickedCards = reveal; + this.targetPickedCards = targetZonePickedCards; + this.upTo = upTo; + this.optional = optional; } public LookLibraryAndPickControllerEffect(final LookLibraryAndPickControllerEffect effect) { @@ -116,6 +112,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff return new LookLibraryAndPickControllerEffect(this); } + @Override protected void cardLooked(Card card, Game game, Ability source) { if (numberToPick.calculate(game, source, this) > 0 && filter.match(card, game)) { @@ -130,27 +127,13 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff if (!optional || player.chooseUse(Outcome.DrawCard, getMayText(), source, game)) { FilterCard pickFilter = filter.copy(); pickFilter.setMessage(getPickText()); - TargetCard target = new TargetCard((upTo ? 0:numberToPick.calculate(game, source, this)),numberToPick.calculate(game, source, this), Zone.PICK, pickFilter); + TargetCard target = new TargetCard((upTo ? 0 : numberToPick.calculate(game, source, this)), numberToPick.calculate(game, source, this), Zone.LIBRARY, pickFilter); if (player.choose(Outcome.DrawCard, cards, target, game)) { - Cards reveal = new CardsImpl(); - for (UUID cardId : target.getTargets()) { - Card card = cards.get(cardId, game); - if (card != null) { - cards.remove(card); - if (targetZoneLookedCards.equals(Zone.BATTLEFIELD)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); - } else { - card.moveToZone(targetPickedCards, source.getSourceId(), game, false); - if (!game.isSimulation()) - game.informPlayers(player.getLogName() + " moves a card to " + targetPickedCards.toString().toLowerCase()); - } - if (revealPickedCards) { - reveal.add(card); - } - } - } + Cards pickedCards = new CardsImpl(target.getTargets()); + cards.removeAll(pickedCards); + player.moveCards(pickedCards.getCards(game), targetPickedCards, source, game); if (revealPickedCards) { - player.revealCards(windowName, reveal, game); + player.revealCards(windowName, pickedCards, game); } } @@ -161,7 +144,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff private String getMayText() { StringBuilder sb = new StringBuilder("Do you wish to "); - switch(targetPickedCards) { + switch (targetPickedCards) { case HAND: if (revealPickedCards) { sb.append("reveal ").append(filter.getMessage()).append(" and put into your hand"); @@ -181,7 +164,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff private String getPickText() { StringBuilder sb = new StringBuilder(filter.getMessage()).append(" to "); - switch(targetPickedCards) { + switch (targetPickedCards) { case HAND: if (revealPickedCards) { sb.append("reveal and put into your hand"); @@ -206,37 +189,37 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff } StringBuilder sb = new StringBuilder(); if (numberToPick.calculate(null, null, this) > 0) { - - if (revealPickedCards) { - sb.append(". You may reveal "); - sb.append(filter.getMessage()).append(" from among them and put it into your "); + + if (revealPickedCards) { + sb.append(". You may reveal "); + sb.append(filter.getMessage()).append(" from among them and put it into your "); + } else { + if (targetPickedCards.equals(Zone.BATTLEFIELD)) { + sb.append(". You "); + if (optional) { + sb.append("may "); + } + sb.append("put ").append(filter.getMessage()).append(" from among them onto the "); } else { - if (targetPickedCards.equals(Zone.BATTLEFIELD)) { - sb.append(". You "); - if (optional) { - sb.append("may "); - } - sb.append("put ").append(filter.getMessage()).append(" from among them onto the "); - } else { - sb.append(". Put "); - if (numberToPick.calculate(null, null, this) > 1 ) { - if (upTo) { - if (numberToPick.calculate(null, null, this) == (numberOfCards.calculate(null, null, this))) { - sb.append("any number"); - } else { - sb.append("up to ").append(CardUtil.numberToText(numberToPick.calculate(null, null, this))); - } - } else{ - sb.append(CardUtil.numberToText(numberToPick.calculate(null, null, this))); + sb.append(". Put "); + if (numberToPick.calculate(null, null, this) > 1) { + if (upTo) { + if (numberToPick.calculate(null, null, this) == (numberOfCards.calculate(null, null, this))) { + sb.append("any number"); + } else { + sb.append("up to ").append(CardUtil.numberToText(numberToPick.calculate(null, null, this))); } } else { - sb.append("one"); + sb.append(CardUtil.numberToText(numberToPick.calculate(null, null, this))); } - - sb.append(" of them into your "); + } else { + sb.append("one"); } + + sb.append(" of them into your "); } - sb.append(targetPickedCards.toString().toLowerCase()); + } + sb.append(targetPickedCards.toString().toLowerCase()); if (targetZoneLookedCards == Zone.LIBRARY) { sb.append(". Put the rest "); @@ -252,6 +235,6 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff } // get text frame from super class and inject action text return setText(mode, sb.toString()); - } + } } diff --git a/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java b/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java index c32ff30e18d..087323a12c2 100644 --- a/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/LookLibraryControllerEffect.java @@ -108,12 +108,12 @@ public class LookLibraryControllerEffect extends OneShotEffect { if (source instanceof SpellAbility) { Card sourceCard = game.getCard(source.getSourceId()); if (sourceCard != null) { - windowName = sourceCard.getName(); + windowName = sourceCard.getIdName(); } } else { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (sourcePermanent != null) { - windowName = sourcePermanent.getName(); + windowName = sourcePermanent.getIdName(); } } diff --git a/Mage/src/mage/abilities/effects/common/LoseHalfLifeEffect.java b/Mage/src/mage/abilities/effects/common/LoseHalfLifeEffect.java index 90d6b589300..939b59b90c9 100644 --- a/Mage/src/mage/abilities/effects/common/LoseHalfLifeEffect.java +++ b/Mage/src/mage/abilities/effects/common/LoseHalfLifeEffect.java @@ -13,7 +13,7 @@ public class LoseHalfLifeEffect extends OneShotEffect { public LoseHalfLifeEffect() { super(Outcome.LoseLife); - staticText = "You lose half your life, rounded up"; + staticText = "you lose half your life, rounded up"; } public LoseHalfLifeEffect(final LoseHalfLifeEffect effect) { @@ -37,4 +37,4 @@ public class LoseHalfLifeEffect extends OneShotEffect { } return false; } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/effects/common/LoseLifeControllerAttachedEffect.java b/Mage/src/mage/abilities/effects/common/LoseLifeControllerAttachedEffect.java new file mode 100644 index 00000000000..fb0f482d2e6 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/LoseLifeControllerAttachedEffect.java @@ -0,0 +1,98 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + + +public class LoseLifeControllerAttachedEffect extends OneShotEffect { + + protected DynamicValue amount; + + public LoseLifeControllerAttachedEffect(int amount) { + this(new StaticValue(amount)); + } + + public LoseLifeControllerAttachedEffect(DynamicValue amount) { + super(Outcome.LoseLife); + this.amount = amount; + setText(); + } + + public LoseLifeControllerAttachedEffect(final LoseLifeControllerAttachedEffect effect) { + super(effect); + this.amount = effect.amount.copy(); + } + + @Override + public LoseLifeControllerAttachedEffect copy() { + return new LoseLifeControllerAttachedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment == null) { + enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); + } + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature == null) { + creature = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); + } + if (creature != null) { + Player player = game.getPlayer(creature.getControllerId()); + if (player != null) { + player.loseLife(amount.calculate(game, source, this), game); + return true; + } + } + } + return false; + } + + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append("it's controller loses ").append(amount.toString()).append(" life"); + String message = amount.getMessage(); + if (message.length() > 0) { + sb.append(" for each "); + sb.append(message); + } + staticText = sb.toString(); + } +} diff --git a/Mage/src/mage/abilities/effects/common/NameACardEffect.java b/Mage/src/mage/abilities/effects/common/NameACardEffect.java index 0123f9fd6f6..7cf32682fa6 100644 --- a/Mage/src/mage/abilities/effects/common/NameACardEffect.java +++ b/Mage/src/mage/abilities/effects/common/NameACardEffect.java @@ -71,7 +71,10 @@ public class NameACardEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - MageObject sourceObject = game.getObject(source.getSourceId()); + MageObject sourceObject = game.getPermanentEntering(source.getSourceId()); + if (sourceObject == null) { + sourceObject = game.getObject(source.getSourceId()); + } if (controller != null && sourceObject != null) { Choice cardChoice = new ChoiceImpl(); switch (typeOfName) { diff --git a/Mage/src/mage/abilities/effects/common/PhaseOutSourceEffect.java b/Mage/src/mage/abilities/effects/common/PhaseOutSourceEffect.java new file mode 100644 index 00000000000..1df8ff9ff37 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/PhaseOutSourceEffect.java @@ -0,0 +1,44 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author fireshoes + */ +public class PhaseOutSourceEffect extends OneShotEffect { + + public PhaseOutSourceEffect() { + super(Outcome.Detriment); + this.staticText = "{this} phases out"; + } + + public PhaseOutSourceEffect(final PhaseOutSourceEffect effect) { + super(effect); + } + + @Override + public PhaseOutSourceEffect copy() { + return new PhaseOutSourceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = source.getSourceObjectIfItStillExists(game); + if (sourceObject instanceof Permanent) { + Permanent permanent = (Permanent) sourceObject; + return permanent.phaseOut(game); + } + return false; + } +} diff --git a/Mage/src/mage/abilities/effects/common/PhaseOutTargetEffect.java b/Mage/src/mage/abilities/effects/common/PhaseOutTargetEffect.java new file mode 100644 index 00000000000..68383139cf9 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/PhaseOutTargetEffect.java @@ -0,0 +1,68 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.Target; +import mage.util.CardUtil; + +/** + * + * @author fireshoes + */ +public class PhaseOutTargetEffect extends OneShotEffect { + + public PhaseOutTargetEffect() { + super(Outcome.Detriment); + } + + public PhaseOutTargetEffect(final PhaseOutTargetEffect effect) { + super(effect); + } + + @Override + public PhaseOutTargetEffect copy() { + return new PhaseOutTargetEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (UUID target : targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(target); + if (permanent != null) { + permanent.phaseOut(game); + } + } + return true; + } + + @Override + public String getText(Mode mode) { + if (staticText.length() > 0) { + return staticText + " phases out"; + } + + Target target = mode.getTargets().get(0); + if (target.getMaxNumberOfTargets() > 1) { + if (target.getMaxNumberOfTargets() == target.getNumberOfTargets()) { + return CardUtil.numberToText(target.getNumberOfTargets()) + " target " + target.getTargetName() + "s phase out"; + } else { + return "up to " + CardUtil.numberToText(target.getMaxNumberOfTargets()) + " target " + target.getTargetName() + "s phase out"; + } + } else if (target.getMaxNumberOfTargets() == 0){ + return "X target " + mode.getTargets().get(0).getTargetName() + " phase out"; + } else { + return "target " + mode.getTargets().get(0).getTargetName() + " phase out"; + } + } + +} \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/PreventDamageByTargetEffect.java b/Mage/src/mage/abilities/effects/common/PreventDamageByTargetEffect.java index 47550fe2b3a..873da6beac9 100644 --- a/Mage/src/mage/abilities/effects/common/PreventDamageByTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/PreventDamageByTargetEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -45,7 +45,7 @@ public class PreventDamageByTargetEffect extends PreventionEffectImpl { public PreventDamageByTargetEffect(Duration duration) { this(duration, false); } - + public PreventDamageByTargetEffect(Duration duration, int amount) { this(duration, amount, false); } @@ -53,11 +53,11 @@ public class PreventDamageByTargetEffect extends PreventionEffectImpl { public PreventDamageByTargetEffect(Duration duration, boolean onlyCombat) { this(duration, Integer.MAX_VALUE, onlyCombat); } - + public PreventDamageByTargetEffect(Duration duration, int amount, boolean onlyCombat) { super(duration, amount, onlyCombat); } - + public PreventDamageByTargetEffect(final PreventDamageByTargetEffect effect) { super(effect); } @@ -88,7 +88,7 @@ public class PreventDamageByTargetEffect extends PreventionEffectImpl { StringBuilder sb = new StringBuilder(); sb.append("Prevent all"); if (onlyCombat) { - sb.append("combat "); + sb.append(" combat "); } sb.append(" damage target "); sb.append(mode.getTargets().get(0).getTargetName()).append(" would deal ").append(duration.toString()); diff --git a/Mage/src/mage/abilities/effects/common/PutLandFromHandOntoBattlefieldEffect.java b/Mage/src/mage/abilities/effects/common/PutLandFromHandOntoBattlefieldEffect.java index 8d819291cc3..c08da1ba5b3 100644 --- a/Mage/src/mage/abilities/effects/common/PutLandFromHandOntoBattlefieldEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutLandFromHandOntoBattlefieldEffect.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; import mage.abilities.Ability; @@ -50,10 +49,11 @@ public class PutLandFromHandOntoBattlefieldEffect extends OneShotEffect { public PutLandFromHandOntoBattlefieldEffect() { this(false); } + public PutLandFromHandOntoBattlefieldEffect(boolean tapped) { super(Outcome.PutLandInPlay); this.tapped = tapped; - staticText = "you may put a land card from your hand onto the battlefield" + (tapped ? " tapped":""); + staticText = "you may put a land card from your hand onto the battlefield" + (tapped ? " tapped" : ""); } public PutLandFromHandOntoBattlefieldEffect(final PutLandFromHandOntoBattlefieldEffect effect) { @@ -66,12 +66,12 @@ public class PutLandFromHandOntoBattlefieldEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Target target = new TargetCardInHand(new FilterLandCard("land card")); - if (target.canChoose(source.getSourceId(), source.getControllerId(), game) && - controller.chooseUse(outcome, "Put land onto battlefield?", source, game) && - controller.choose(outcome, target, source.getSourceId(), game)) { + if (target.canChoose(source.getSourceId(), source.getControllerId(), game) + && controller.chooseUse(outcome, "Put land onto battlefield?", source, game) + && controller.choose(outcome, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId(), tapped); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, tapped, false, false, null); } } return true; @@ -85,4 +85,4 @@ public class PutLandFromHandOntoBattlefieldEffect extends OneShotEffect { return new PutLandFromHandOntoBattlefieldEffect(this); } - } +} diff --git a/Mage/src/mage/abilities/effects/common/PutPermanentOnBattlefieldEffect.java b/Mage/src/mage/abilities/effects/common/PutPermanentOnBattlefieldEffect.java index 09a89be1956..f559340ecce 100644 --- a/Mage/src/mage/abilities/effects/common/PutPermanentOnBattlefieldEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutPermanentOnBattlefieldEffect.java @@ -18,19 +18,26 @@ import mage.target.common.TargetCardInHand; public class PutPermanentOnBattlefieldEffect extends OneShotEffect { private final FilterCard filter; + private final boolean useTargetController; public PutPermanentOnBattlefieldEffect() { - this(new FilterPermanentCard("a permanent card")); + this(new FilterPermanentCard("a permanent card"), false); } public PutPermanentOnBattlefieldEffect(FilterCard filter) { + this(filter, false); + } + + public PutPermanentOnBattlefieldEffect(FilterCard filter, boolean useTargetController) { super(Outcome.PutCardInPlay); this.filter = filter; + this.useTargetController = useTargetController; } public PutPermanentOnBattlefieldEffect(final PutPermanentOnBattlefieldEffect effect) { super(effect); this.filter = effect.filter.copy(); + this.useTargetController = effect.useTargetController; } @Override @@ -40,7 +47,12 @@ public class PutPermanentOnBattlefieldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player player; + if (useTargetController) { + player = game.getPlayer(getTargetPointer().getFirst(game, source)); + } else { + player = game.getPlayer(source.getControllerId()); + } String choiceText = "Put " + filter.getMessage() + " from your hand onto the battlefield?"; if (player == null || !player.chooseUse(Outcome.PutCardInPlay, choiceText, source, game)) { return false; @@ -50,19 +62,22 @@ public class PutPermanentOnBattlefieldEffect extends OneShotEffect { if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId()); - return true; + return player.moveCards(card, Zone.BATTLEFIELD, source, game); } } - return false; + return true; } @Override public String getText(Mode mode) { - if(this.staticText != null && !this.staticText.isEmpty()) { + if (this.staticText != null && !this.staticText.isEmpty()) { return staticText; } - return "you may put " + filter.getMessage() + " from your hand onto the battlefield"; + if (useTargetController) { + return "that player may put " + filter.getMessage() + " from his or her hand onto the battlefield"; + } else { + return "you may put " + filter.getMessage() + " from your hand onto the battlefield"; + } } } diff --git a/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java b/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java index 43fd5f71205..61f433d298f 100644 --- a/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java @@ -27,23 +27,21 @@ */ package mage.abilities.effects.common; +import java.util.ArrayList; +import java.util.List; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; -import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.HasteAbility; +import mage.cards.Card; import mage.constants.CardType; -import mage.constants.Duration; import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.EmptyToken; -import mage.target.targetpointer.FixedTarget; import mage.util.CardUtil; import mage.util.functions.ApplyToPermanent; import mage.util.functions.EmptyApplyToPermanent; @@ -57,13 +55,21 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { private final UUID playerId; private final CardType additionalCardType; private boolean gainsHaste; - private Permanent addedTokenPermanent; + private final int number; + private List addedTokenPermanents; + private String additionalSubType; + private boolean tapped; + private boolean attacking; + private UUID attackedPlayer; public PutTokenOntoBattlefieldCopyTargetEffect() { super(Outcome.PutCreatureInPlay); this.playerId = null; this.additionalCardType = null; - this.addedTokenPermanent = null; + this.addedTokenPermanents = new ArrayList<>(); + this.number = 1; + this.additionalSubType = null; + this.attackedPlayer = null; } public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId) { @@ -71,11 +77,37 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { } public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste) { + this(playerId, additionalCardType, gainsHaste, 1); + } + + public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number) { + this(playerId, additionalCardType, gainsHaste, number, false, false); + } + + /** + * + * @param playerId null the token is controlled/owned by the controller of + * the source ability + * @param additionalCardType the token gains tis card types in addition + * @param gainsHaste the token gains haste + * @param number number of tokens to put into play + * @param tapped + * @param attacking + */ + public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number, boolean tapped, boolean attacking) { + this(playerId, additionalCardType, gainsHaste, number, tapped, attacking, null); + } + + public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste, int number, boolean tapped, boolean attacking, UUID attackedPlayer) { super(Outcome.PutCreatureInPlay); this.playerId = playerId; this.additionalCardType = additionalCardType; this.gainsHaste = gainsHaste; - this.addedTokenPermanent = null; + this.addedTokenPermanents = new ArrayList<>(); + this.number = number; + this.tapped = tapped; + this.attacking = attacking; + this.attackedPlayer = attackedPlayer; } public PutTokenOntoBattlefieldCopyTargetEffect(final PutTokenOntoBattlefieldCopyTargetEffect effect) { @@ -83,16 +115,22 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { this.playerId = effect.playerId; this.additionalCardType = effect.additionalCardType; this.gainsHaste = effect.gainsHaste; - this.addedTokenPermanent = effect.addedTokenPermanent; + this.addedTokenPermanents = new ArrayList<>(effect.addedTokenPermanents); + this.number = effect.number; + this.additionalSubType = effect.additionalSubType; + this.tapped = effect.tapped; + this.attacking = effect.attacking; + this.attackedPlayer = effect.attackedPlayer; } @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + Card copyFrom; + ApplyToPermanent applier = new EmptyApplyToPermanent(); if (permanent != null) { // handle copies of copies Permanent copyFromPermanent = permanent; - ApplyToPermanent applier = new EmptyApplyToPermanent(); for (Effect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) { if (effect instanceof CopyEffect) { CopyEffect copyEffect = (CopyEffect) effect; @@ -108,33 +146,35 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { } } } + copyFrom = copyFromPermanent; + } else { + copyFrom = game.getCard(getTargetPointer().getFirst(game, source)); + } - EmptyToken token = new EmptyToken(); - CardUtil.copyTo(token).from(copyFromPermanent); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer) - if (additionalCardType != null && !token.getCardType().contains(additionalCardType)) { - token.getCardType().add(additionalCardType); - } - if (gainsHaste) { - token.addAbility(HasteAbility.getInstance()); - } - token.putOntoBattlefield(1, game, source.getSourceId(), playerId == null ? source.getControllerId() : playerId); - addedTokenPermanent = game.getPermanent(token.getLastAddedToken()); - if (addedTokenPermanent != null) { - game.copyPermanent(copyFromPermanent, addedTokenPermanent, source, applier); - if (additionalCardType != null) { - ContinuousEffect effect = new AddCardTypeTargetEffect(additionalCardType, Duration.Custom); - effect.setTargetPointer(new FixedTarget(addedTokenPermanent.getId())); - game.addEffect(effect, source); - } - if (gainsHaste) { - ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); - effect.setTargetPointer(new FixedTarget(addedTokenPermanent.getId())); - game.addEffect(effect, source); - } - return true; + if (permanent == null && copyFrom == null) { + return false; + } + + EmptyToken token = new EmptyToken(); + CardUtil.copyTo(token).from(copyFrom); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer) + applier.apply(game, token); + if (additionalCardType != null && !token.getCardType().contains(additionalCardType)) { + token.getCardType().add(additionalCardType); + } + if (gainsHaste) { + token.addAbility(HasteAbility.getInstance()); + } + if (additionalSubType != null && !token.getSubtype().contains(additionalSubType)) { + token.getSubtype().add(additionalSubType); + } + token.putOntoBattlefield(number, game, source.getSourceId(), playerId == null ? source.getControllerId() : playerId, tapped, attacking, attackedPlayer); + for (UUID tokenId : token.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield + Permanent tokenPermanent = game.getPermanent(tokenId); + if (tokenPermanent != null) { + addedTokenPermanents.add(tokenPermanent); } } - return false; + return true; } @Override @@ -144,8 +184,19 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { @Override public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } StringBuilder sb = new StringBuilder(); - sb.append("Put a token onto the battlefield that's a copy of "); + sb.append("Put a token onto the battlefield "); + if (tapped && !attacking) { + sb.append("tapped "); + } else if (!tapped && attacking) { + sb.append("attacking "); + } else if (tapped && attacking) { + sb.append("tapped and attacking "); + } + sb.append("that's a copy of target "); if (mode.getTargets() != null) { sb.append(mode.getTargets().get(0).getTargetName()); } @@ -153,7 +204,11 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { } - public Permanent getAddedPermanent() { - return addedTokenPermanent; + public List getAddedPermanent() { + return addedTokenPermanents; + } + + public void setAdditionalSubType(String additionalSubType) { + this.additionalSubType = additionalSubType; } } diff --git a/Mage/src/mage/abilities/effects/common/PutTopCardOfLibraryIntoGraveEachPlayerEffect.java b/Mage/src/mage/abilities/effects/common/PutTopCardOfLibraryIntoGraveEachPlayerEffect.java index c52b88fff0a..421a97c768a 100644 --- a/Mage/src/mage/abilities/effects/common/PutTopCardOfLibraryIntoGraveEachPlayerEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutTopCardOfLibraryIntoGraveEachPlayerEffect.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; import java.util.UUID; @@ -44,7 +43,6 @@ import mage.util.CardUtil; * * @author LevelX2 */ - public class PutTopCardOfLibraryIntoGraveEachPlayerEffect extends OneShotEffect { private final DynamicValue numberCards; @@ -53,7 +51,7 @@ public class PutTopCardOfLibraryIntoGraveEachPlayerEffect extends OneShotEffect public PutTopCardOfLibraryIntoGraveEachPlayerEffect(int numberCards, TargetController targetController) { this(new StaticValue(numberCards), targetController); } - + public PutTopCardOfLibraryIntoGraveEachPlayerEffect(DynamicValue numberCards, TargetController targetController) { super(Outcome.Discard); this.numberCards = numberCards; @@ -76,42 +74,42 @@ public class PutTopCardOfLibraryIntoGraveEachPlayerEffect extends OneShotEffect public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - switch(targetController) { + switch (targetController) { case OPPONENT: - for(UUID playerId: game.getOpponents(source.getControllerId()) ) { + for (UUID playerId : game.getOpponents(source.getControllerId())) { putCardsToGravecard(playerId, source, game); } break; case ANY: - for(UUID playerId: player.getInRange() ) { + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { putCardsToGravecard(playerId, source, game); } break; case NOT_YOU: - for(UUID playerId: player.getInRange() ) { + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { if (!playerId.equals(source.getSourceId())) { putCardsToGravecard(playerId, source, game); } } break; default: - throw new UnsupportedOperationException("TargetController type not supported."); - } + throw new UnsupportedOperationException("TargetController type not supported."); + } return true; } return false; } - + private void putCardsToGravecard(UUID playerId, Ability source, Game game) { Player player = game.getPlayer(playerId); if (player != null) { - player.moveCards(player.getLibrary().getTopCards(game, numberCards.calculate(game, source, this)), Zone.LIBRARY, Zone.GRAVEYARD, source, game); + player.moveCards(player.getLibrary().getTopCards(game, numberCards.calculate(game, source, this)), Zone.GRAVEYARD, source, game); } } private String setText() { StringBuilder sb = new StringBuilder(); - switch(targetController) { + switch (targetController) { case OPPONENT: sb.append("Each opponent "); break; @@ -120,14 +118,14 @@ public class PutTopCardOfLibraryIntoGraveEachPlayerEffect extends OneShotEffect break; case NOT_YOU: sb.append("Each other player "); - break; + break; default: - throw new UnsupportedOperationException("TargetController type not supported."); + throw new UnsupportedOperationException("TargetController type not supported."); } sb.append("puts the top "); - sb.append(CardUtil.numberToText(numberCards.toString(),"a")); + sb.append(CardUtil.numberToText(numberCards.toString(), "a")); sb.append(" card"); - sb.append(numberCards.toString().equals("1")?"":"s"); + sb.append(numberCards.toString().equals("1") ? "" : "s"); sb.append(" of his or her library into his or her graveyard"); return sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/RedirectDamageFromSourceToTargetEffect.java b/Mage/src/mage/abilities/effects/common/RedirectDamageFromSourceToTargetEffect.java new file mode 100644 index 00000000000..61b35d63abd --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/RedirectDamageFromSourceToTargetEffect.java @@ -0,0 +1,42 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.effects.RedirectionEffect; +import mage.constants.Duration; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author LevelX2 + */ +public class RedirectDamageFromSourceToTargetEffect extends RedirectionEffect { + + public RedirectDamageFromSourceToTargetEffect(Duration duration, int amountToRedirect, boolean oneUsage) { + super(duration, amountToRedirect, oneUsage); + staticText = "The next " + amountToRedirect + " damage that would be dealt to {this} this turn is dealt to target creature you control instead."; + } + + public RedirectDamageFromSourceToTargetEffect(final RedirectDamageFromSourceToTargetEffect effect) { + super(effect); + } + + @Override + public RedirectDamageFromSourceToTargetEffect copy() { + return new RedirectDamageFromSourceToTargetEffect(this); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getTargetId().equals(source.getSourceId())) { + this.redirectTarget = source.getTargets().get(0); + return true; + } + return false; + } +} diff --git a/Mage/src/mage/abilities/effects/common/RemoveAllCountersSourceEffect.java b/Mage/src/mage/abilities/effects/common/RemoveAllCountersSourceEffect.java new file mode 100644 index 00000000000..abc70475f47 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/RemoveAllCountersSourceEffect.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LoneFox + */ +public class RemoveAllCountersSourceEffect extends OneShotEffect { + + private final CounterType counterType; + + public RemoveAllCountersSourceEffect(CounterType counterType) { + super(Outcome.Neutral); + this.counterType = counterType; + staticText = "remove all " + counterType.getName() + " counters from it."; + } + + public RemoveAllCountersSourceEffect(final RemoveAllCountersSourceEffect effect) { + super(effect); + this.counterType = effect.counterType; + } + + @Override + public RemoveAllCountersSourceEffect copy() { + return new RemoveAllCountersSourceEffect(this); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if(sourcePermanent != null) { + int count = sourcePermanent.getCounters().getCount(counterType); + sourcePermanent.getCounters().removeCounter(counterType, count); + return true; + } + return false; + } +} + diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromExileEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromExileEffect.java index a3eeb0a2c13..6d8b0880878 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnFromExileEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnFromExileEffect.java @@ -30,7 +30,6 @@ package mage.abilities.effects.common; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.constants.Outcome; import mage.constants.Zone; import static mage.constants.Zone.BATTLEFIELD; @@ -84,39 +83,12 @@ public class ReturnFromExileEffect extends OneShotEffect { ExileZone exile = game.getExile().getExileZone(exileId); Player controller = game.getPlayer(source.getControllerId()); if (controller != null && exile != null) { - if (zone == Zone.GRAVEYARD) { - controller.moveCards(exile, zone, Zone.EXILED, source, game); - } else { - exile = exile.copy(); - for (UUID cardId : exile) { - Card card = game.getCard(cardId); - Player owner = game.getPlayer(card.getOwnerId()); - if (owner != null) { - switch (zone) { - case BATTLEFIELD: - card.moveToZone(zone, source.getSourceId(), game, tapped); - if (!game.isSimulation()) { - game.informPlayers(controller.getLogName() + " moves " + card.getName() + " to " + zone.toString().toLowerCase()); - } - break; - case HAND: - controller.moveCards(card, Zone.EXILED, Zone.HAND, source, game); - break; - case LIBRARY: - controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.EXILED, true, true); - break; - case GRAVEYARD: - controller.moveCards(card, Zone.EXILED, Zone.GRAVEYARD, source, game); - break; - default: - card.moveToZone(zone, source.getSourceId(), game, tapped); - if (!game.isSimulation()) { - game.informPlayers(controller.getLogName() + " moves " + card.getName() + " to " + zone.toString().toLowerCase()); - } - } - } - } - game.getExile().getExileZone(exileId).clear(); + switch (zone) { + case LIBRARY: + controller.putCardsOnTopOfLibrary(exile, game, source, false); + break; + default: + controller.moveCards(exile.getCards(game), zone, source, game, tapped, false, true, null); } return true; } diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromExileForSourceEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromExileForSourceEffect.java index 181bb35f94c..1f24d70ccb1 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnFromExileForSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnFromExileForSourceEffect.java @@ -30,7 +30,6 @@ package mage.abilities.effects.common; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.constants.Outcome; import mage.constants.Zone; import static mage.constants.Zone.BATTLEFIELD; @@ -38,9 +37,10 @@ import static mage.constants.Zone.GRAVEYARD; import static mage.constants.Zone.HAND; import mage.game.ExileZone; import mage.game.Game; -import mage.game.permanent.PermanentToken; +import mage.game.permanent.Permanent; import mage.players.Player; import mage.util.CardUtil; +import org.apache.log4j.Logger; /** * @@ -96,21 +96,17 @@ public class ReturnFromExileForSourceEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (sourceObject != null && controller != null) { - int zoneChangeCounter = source.getSourceObjectZoneChangeCounter(); - if (zoneChangeCounter > 0 && previousZone && !(sourceObject instanceof PermanentToken)) { - zoneChangeCounter--; + Permanent permanentLeftBattlefield = (Permanent) getValue("permanentLeftBattlefield"); + if (permanentLeftBattlefield == null) { + Logger.getLogger(ReturnFromExileForSourceEffect.class).error("Permanent not found: " + sourceObject.getName()); + return false; } - ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter)); + ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), permanentLeftBattlefield.getZoneChangeCounter(game))); if (exile != null) { // null is valid if source left battlefield before enters the battlefield effect resolved if (returnToZone.equals(Zone.BATTLEFIELD)) { - for (Card card : exile.getCards(game)) { - Player owner = game.getPlayer(card.getOwnerId()); - if (owner != null) { - owner.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); - } - } + controller.moveCards(exile.getCards(game), returnToZone, source, game, false, false, true, null); } else { - controller.moveCards(exile, Zone.EXILED, returnToZone, source, game); + controller.moveCards(exile, returnToZone, source, game); } } return true; diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java index da7960e7437..dd2e2797041 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToBattlefieldTargetEffect.java @@ -73,7 +73,7 @@ public class ReturnFromGraveyardToBattlefieldTargetEffect extends OneShotEffect for (UUID targetId : getTargetPointer().getTargets(game, source)) { Card card = game.getCard(targetId); if (card != null) { - controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), tapped); + controller.moveCards(card, Zone.BATTLEFIELD, source, game, tapped, false, false, null); } } return true; diff --git a/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToBattlefieldEffect.java b/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToBattlefieldEffect.java index a87f0360ff8..a1c3ebe28ab 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToBattlefieldEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnSourceFromGraveyardToBattlefieldEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,19 +20,18 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; -import mage.constants.Outcome; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -54,6 +53,7 @@ public class ReturnSourceFromGraveyardToBattlefieldEffect extends OneShotEffect this.tapped = tapped; setText(); } + public ReturnSourceFromGraveyardToBattlefieldEffect(boolean tapped, boolean ownerControl) { super(Outcome.PutCreatureInPlay); this.tapped = tapped; @@ -76,32 +76,31 @@ public class ReturnSourceFromGraveyardToBattlefieldEffect extends OneShotEffect public boolean apply(Game game, Ability source) { if (!game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) { return false; - } + } Card card = game.getCard(source.getSourceId()); if (card == null) { return false; } - - Player player; + + Player player; if (ownerControl) { player = game.getPlayer(card.getOwnerId()); } else { player = game.getPlayer(source.getControllerId()); - } - if (player == null) { + } + if (player == null) { return false; - } - - return player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), tapped); + } + return player.moveCards(card, Zone.BATTLEFIELD, source, game, tapped, false, true, null); } private void setText() { StringBuilder sb = new StringBuilder("return {this} from your graveyard to the battlefield"); if (tapped) { sb.append(" tapped"); - } + } if (ownerControl) { - sb.append(" under its owner's control"); + sb.append(" under its owner's control"); } staticText = sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlTargetEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlTargetEffect.java index d386e7d944f..650e1c32cbe 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToBattlefieldUnderYourControlTargetEffect.java @@ -88,8 +88,7 @@ public class ReturnToBattlefieldUnderYourControlTargetEffect extends OneShotEffe card = game.getCard(getTargetPointer().getFirst(game, source)); } if (card != null) { - Zone currentZone = game.getState().getZone(card.getId()); - controller.putOntoBattlefieldWithInfo(card, game, currentZone, source.getSourceId()); + controller.moveCards(card, Zone.BATTLEFIELD, source, game); } return true; } diff --git a/Mage/src/mage/abilities/effects/common/ReturnToHandSourceEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToHandSourceEffect.java index 10893c286b6..237c026c746 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToHandSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToHandSourceEffect.java @@ -57,7 +57,7 @@ public class ReturnToHandSourceEffect extends OneShotEffect { /** * - * @param fromBattlefieldOnly the object is only returned if it's on the + * @param fromBattlefieldOnly the object is only returned if it is on the * battlefield as the effect resolves * @param returnFromNextZone the object is only returned, if it has changed * the zone one time after the source ability triggered or was activated @@ -67,7 +67,7 @@ public class ReturnToHandSourceEffect extends OneShotEffect { super(Outcome.ReturnToHand); this.fromBattlefieldOnly = fromBattlefieldOnly; this.returnFromNextZone = returnFromNextZone; - staticText = "return {this} to it's owner's hand"; + staticText = "return {this} to its owner's hand"; } public ReturnToHandSourceEffect(final ReturnToHandSourceEffect effect) { diff --git a/Mage/src/mage/abilities/effects/common/ReturnToHandTargetEffect.java b/Mage/src/mage/abilities/effects/common/ReturnToHandTargetEffect.java index ebf5260bbb5..c4f1fd5a98c 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnToHandTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnToHandTargetEffect.java @@ -27,14 +27,14 @@ */ package mage.abilities.effects.common; +import java.util.LinkedHashSet; +import java.util.Set; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; -import mage.cards.Cards; -import mage.cards.CardsImpl; import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; @@ -74,16 +74,14 @@ public class ReturnToHandTargetEffect extends OneShotEffect { if (controller == null) { return false; } - Cards cardsToHand = new CardsImpl(); - Zone fromZone = game.getState().getZone(targetPointer.getFirst(game, source)); - + Set cards = new LinkedHashSet<>(); for (UUID targetId : targetPointer.getTargets(game, source)) { MageObject mageObject = game.getObject(targetId); if (mageObject instanceof Card) { - cardsToHand.add((Card) mageObject); + cards.add((Card) mageObject); } } - return controller.moveCards(cardsToHand, fromZone, Zone.HAND, source, game); + return controller.moveCards(cards, Zone.HAND, source, game); } @Override @@ -106,7 +104,7 @@ public class ReturnToHandTargetEffect extends OneShotEffect { if (!target.getTargetName().startsWith("another")) { sb.append("target "); } - sb.append(target.getTargetName()).append(" to its owner's hand").toString(); + sb.append(target.getTargetName()).append(" to its owner's hand"); return sb.toString(); } } diff --git a/Mage/src/mage/abilities/effects/common/RevealTargetPlayerLibraryEffect.java b/Mage/src/mage/abilities/effects/common/RevealTargetPlayerLibraryEffect.java index c2a40e79706..5fb44e58499 100644 --- a/Mage/src/mage/abilities/effects/common/RevealTargetPlayerLibraryEffect.java +++ b/Mage/src/mage/abilities/effects/common/RevealTargetPlayerLibraryEffect.java @@ -27,11 +27,11 @@ */ package mage.abilities.effects.common; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.constants.Outcome; @@ -42,9 +42,8 @@ import mage.util.CardUtil; /** * - * @author anonymous + * @author Luna Skyrise */ - public class RevealTargetPlayerLibraryEffect extends OneShotEffect { private DynamicValue amountCards; @@ -73,28 +72,18 @@ public class RevealTargetPlayerLibraryEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); - - if (player == null || targetPlayer == null) { + MageObject sourceObject = source.getSourceObject(game); + if (player == null || targetPlayer == null || sourceObject == null) { return false; } Cards cards = new CardsImpl(Zone.LIBRARY); - int count = Math.min(targetPlayer.getLibrary().size(), amountCards.calculate(game, source, this)); - for (int i = 0; i < count; i++) { - Card card = targetPlayer.getLibrary().removeFromTop(game); - if (card != null) { - cards.add(card); - } - } - - player.lookAtCards("Top " + amountCards.toString() + "cards of " + targetPlayer.getName() + "\'s library", cards, game); - + cards.addAll(player.getLibrary().getTopCards(game, amountCards.calculate(game, source, this))); + player.revealCards(sourceObject.getIdName() + " - Top " + amountCards.toString() + "cards of " + targetPlayer.getName() + "\'s library", cards, game); return true; } private String setText() { - StringBuilder sb = new StringBuilder("Reveal the top "); - sb.append(CardUtil.numberToText(amountCards.toString())).append(" cards of target player's library."); - return sb.toString(); + return "Reveal the top " + CardUtil.numberToText(amountCards.toString()) + " cards of target player's library."; } } diff --git a/Mage/src/mage/abilities/effects/common/SacrificeOpponentsEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeOpponentsEffect.java index 6edd6c83449..54e94ab31b8 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeOpponentsEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeOpponentsEffect.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; import java.util.ArrayList; @@ -46,8 +45,7 @@ import mage.target.TargetPermanent; import mage.util.CardUtil; /** - * All opponents have to sacrifice [amount] permanents - * that match the [filter]. + * All opponents have to sacrifice [amount] permanents that match the [filter]. * * @author LevelX2 */ @@ -59,6 +57,7 @@ public class SacrificeOpponentsEffect extends OneShotEffect { public SacrificeOpponentsEffect(FilterPermanent filter) { this(1, filter); } + public SacrificeOpponentsEffect(int amount, FilterPermanent filter) { this(new StaticValue(amount), filter); } @@ -87,12 +86,14 @@ public class SacrificeOpponentsEffect extends OneShotEffect { filter.add(new ControllerPredicate(TargetController.YOU)); for (UUID playerId : game.getOpponents(source.getControllerId())) { Player player = game.getPlayer(playerId); - if (player != null) { + if (player != null) { int numTargets = Math.min(amount.calculate(game, source, this), game.getBattlefield().countAll(filter, player.getId(), game)); - TargetPermanent target = new TargetPermanent(numTargets, numTargets, filter, true); - if (target.canChoose(player.getId(), game)) { - player.chooseTarget(Outcome.Sacrifice, target, source, game); - perms.addAll(target.getTargets()); + if (numTargets > 0) { + TargetPermanent target = new TargetPermanent(numTargets, numTargets, filter, true); + if (target.canChoose(player.getId(), game)) { + player.chooseTarget(Outcome.Sacrifice, target, source, game); + perms.addAll(target.getTargets()); + } } } } diff --git a/Mage/src/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java index e9f188f41e5..f0904271903 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeSourceUnlessPaysEffect.java @@ -1,29 +1,26 @@ package mage.abilities.effects.common; -import mage.MageObject; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.costs.Cost; import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.util.CardUtil; /** - * Created by IntelliJ IDEA. - * User: Loki - * Date: 21.12.10 - * Time: 9:21 + * Created by IntelliJ IDEA. User: Loki Date: 21.12.10 Time: 9:21 */ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect { + protected Cost cost; public SacrificeSourceUnlessPaysEffect(Cost cost) { super(Outcome.Sacrifice); this.cost = cost; - } + } public SacrificeSourceUnlessPaysEffect(final SacrificeSourceUnlessPaysEffect effect) { super(effect); @@ -33,14 +30,13 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); - MageObject sourceObject = source.getSourceObject(game); - if (sourceObject != null && player != null && permanent != null) { + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (player != null && sourcePermanent != null) { StringBuilder sb = new StringBuilder(cost.getText()).append("?"); - if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ") ) { + if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) { sb.insert(0, "Pay "); - } - String message = CardUtil.replaceSourceName(sb.toString(), sourceObject.getLogName()); + } + String message = CardUtil.replaceSourceName(sb.toString(), sourcePermanent.getLogName()); message = Character.toUpperCase(message.charAt(0)) + message.substring(1); if (player.chooseUse(Outcome.Benefit, message, source, game)) { cost.clearPaid(); @@ -48,7 +44,7 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect { return true; } } - permanent.sacrifice(source.getSourceId(), game); + sourcePermanent.sacrifice(source.getSourceId(), game); return true; } return false; @@ -59,23 +55,25 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect { return new SacrificeSourceUnlessPaysEffect(this); } - @Override + @Override public String getText(Mode mode) { - StringBuilder sb = new StringBuilder("sacrifice {this} unless you "); - String costText = cost.getText(); - if (costText.toLowerCase().startsWith("discard") - || costText.toLowerCase().startsWith("remove") - || costText.toLowerCase().startsWith("return") - || costText.toLowerCase().startsWith("exile") - || costText.toLowerCase().startsWith("sacrifice")) { - sb.append(costText.substring(0, 1).toLowerCase()); - sb.append(costText.substring(1)); - } - else { - sb.append("pay ").append(costText); - } + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } - return sb.toString(); + StringBuilder sb = new StringBuilder("sacrifice {this} unless you "); + String costText = cost.getText(); + if (costText.toLowerCase().startsWith("discard") + || costText.toLowerCase().startsWith("remove") + || costText.toLowerCase().startsWith("return") + || costText.toLowerCase().startsWith("exile") + || costText.toLowerCase().startsWith("sacrifice")) { + sb.append(costText.substring(0, 1).toLowerCase()); + sb.append(costText.substring(1)); + } else { + sb.append("pay ").append(costText); + } + return sb.toString(); } - } +} diff --git a/Mage/src/mage/abilities/effects/common/SacrificeTargetEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeTargetEffect.java index 0421dd32f11..024b3a856c7 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeTargetEffect.java @@ -1,38 +1,37 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; import java.util.UUID; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.Permanent; @@ -42,17 +41,31 @@ import mage.game.permanent.Permanent; */ public class SacrificeTargetEffect extends OneShotEffect { + protected UUID playerIdThatHasToSacrifice; + public SacrificeTargetEffect() { - super(Outcome.Sacrifice); + this(""); } public SacrificeTargetEffect(String text) { - this(); + this(text, null); + } + + /** + * + * @param text use this text as rule text for the effect + * @param playerIdThatHasToSacrifice only this playerId has to sacrifice + * (others can't) + */ + public SacrificeTargetEffect(String text, UUID playerIdThatHasToSacrifice) { + super(Outcome.Sacrifice); + this.playerIdThatHasToSacrifice = playerIdThatHasToSacrifice; staticText = text; } public SacrificeTargetEffect(final SacrificeTargetEffect effect) { super(effect); + this.playerIdThatHasToSacrifice = effect.playerIdThatHasToSacrifice; } @Override @@ -65,7 +78,7 @@ public class SacrificeTargetEffect extends OneShotEffect { int affectedTargets = 0; for (UUID permanentId : targetPointer.getTargets(game, source)) { Permanent permanent = game.getPermanent(permanentId); - if (permanent != null) { + if (permanent != null && (playerIdThatHasToSacrifice == null || playerIdThatHasToSacrifice.equals(permanent.getControllerId()))) { permanent.sacrifice(source.getSourceId(), game); affectedTargets++; } diff --git a/Mage/src/mage/abilities/effects/common/SetPlayerLifeAllEffect.java b/Mage/src/mage/abilities/effects/common/SetPlayerLifeAllEffect.java new file mode 100644 index 00000000000..5f54db01260 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/SetPlayerLifeAllEffect.java @@ -0,0 +1,99 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.constants.TargetController; +import static mage.constants.TargetController.ANY; +import static mage.constants.TargetController.OPPONENT; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class SetPlayerLifeAllEffect extends OneShotEffect { + + private TargetController targetController; + protected DynamicValue amount; + + public SetPlayerLifeAllEffect(int amount) { + this(amount, TargetController.ANY); + } + + public SetPlayerLifeAllEffect(DynamicValue amount) { + this(amount, TargetController.ANY); + } + + public SetPlayerLifeAllEffect(int amount, TargetController targetController) { + this(new StaticValue(amount), targetController); + } + + public SetPlayerLifeAllEffect(DynamicValue amount, TargetController targetController) { + super(Outcome.DrawCard); + this.amount = amount; + this.targetController = targetController; + staticText = setText(); + } + + public SetPlayerLifeAllEffect(final SetPlayerLifeAllEffect effect) { + super(effect); + this.amount = effect.amount; + this.targetController = effect.targetController; + } + + @Override + public SetPlayerLifeAllEffect copy() { + return new SetPlayerLifeAllEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player sourcePlayer = game.getPlayer(source.getControllerId()); + switch (targetController) { + case ANY: + for (UUID playerId : sourcePlayer.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.setLife(amount.calculate(game, source, this), game); + } + } + break; + case OPPONENT: + for (UUID playerId : game.getOpponents(sourcePlayer.getId())) { + Player player = game.getPlayer(playerId); + if (player != null) { + player.setLife(amount.calculate(game, source, this), game); + } + } + break; + } + return true; + } + + private String setText() { + StringBuilder sb = new StringBuilder("Each "); + switch (targetController) { + case ANY: + sb.append("player"); + break; + case OPPONENT: + sb.append("opponent"); + break; + default: + throw new UnsupportedOperationException("Not supported value for targetController"); + } + sb.append(" 's life total becomes "); + sb.append(amount.toString()); + return sb.toString(); + } +} diff --git a/Mage/src/mage/abilities/effects/common/ShuffleIntoLibraryGraveOfSourceOwnerEffect.java b/Mage/src/mage/abilities/effects/common/ShuffleIntoLibraryGraveOfSourceOwnerEffect.java new file mode 100644 index 00000000000..149117f39f0 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/ShuffleIntoLibraryGraveOfSourceOwnerEffect.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class ShuffleIntoLibraryGraveOfSourceOwnerEffect extends OneShotEffect { + + public ShuffleIntoLibraryGraveOfSourceOwnerEffect() { + super(Outcome.Benefit); + staticText = "its owner shuffles his or her graveyard into his or her library"; + } + + public ShuffleIntoLibraryGraveOfSourceOwnerEffect(final ShuffleIntoLibraryGraveOfSourceOwnerEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID ownerId = game.getOwnerId(source.getSourceId()); + if (ownerId == null) { + return false; + } + Player owner = game.getPlayer(ownerId); + if (owner != null) { + owner.moveCards(owner.getGraveyard(), null, Zone.LIBRARY, source, game); + owner.shuffleLibrary(game); + return true; + } + return false; + } + + @Override + public ShuffleIntoLibraryGraveOfSourceOwnerEffect copy() { + return new ShuffleIntoLibraryGraveOfSourceOwnerEffect(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java b/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java index 47b4322115a..fa8e72af499 100644 --- a/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java +++ b/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java @@ -1,37 +1,35 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; import mage.abilities.Ability; import mage.abilities.MageSingleton; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; @@ -59,15 +57,15 @@ public class ShuffleSpellEffect extends OneShotEffect implements MageSingleton { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Spell spell = game.getStack().getSpell(source.getSourceId()); + // We have to use the spell id because in case of copied spells, the sourceId can be multiple times on the stack + Spell spell = game.getStack().getSpell(source.getId()); if (spell != null) { - Card spellCard = spell.getCard(); - if (spellCard != null) { - Player owner = game.getPlayer(spellCard.getOwnerId()); + if (controller.moveCards(spell, Zone.LIBRARY, source, game) && !spell.isCopy()) { + Player owner = game.getPlayer(spell.getCard().getOwnerId()); if (owner != null) { - controller.moveCardToLibraryWithInfo(spellCard, source.getSourceId(), game, Zone.STACK, true, true); owner.shuffleLibrary(game); } + } } return true; diff --git a/Mage/src/mage/abilities/effects/common/TapSourceEffect.java b/Mage/src/mage/abilities/effects/common/TapSourceEffect.java index fcbc92c1e4c..e510ae4844c 100644 --- a/Mage/src/mage/abilities/effects/common/TapSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/TapSourceEffect.java @@ -1,36 +1,35 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.Permanent; @@ -39,6 +38,7 @@ import mage.game.permanent.Permanent; * @author BetaSteward_at_googlemail.com */ public class TapSourceEffect extends OneShotEffect { + private boolean withoutTrigger; public TapSourceEffect() { @@ -64,6 +64,9 @@ public class TapSourceEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent == null) { + permanent = game.getPermanentEntering(source.getSourceId()); + } if (permanent != null) { if (withoutTrigger) { permanent.setTapped(true); diff --git a/Mage/src/mage/abilities/effects/common/TapSourceUnlessPaysEffect.java b/Mage/src/mage/abilities/effects/common/TapSourceUnlessPaysEffect.java index 55bc3ad99ed..15fbc93dbff 100644 --- a/Mage/src/mage/abilities/effects/common/TapSourceUnlessPaysEffect.java +++ b/Mage/src/mage/abilities/effects/common/TapSourceUnlessPaysEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,17 +20,17 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common; import mage.abilities.Ability; import mage.abilities.costs.Cost; import mage.abilities.effects.OneShotEffect; +import mage.constants.AbilityType; import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.Permanent; @@ -59,7 +59,10 @@ public class TapSourceUnlessPaysEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { + if (permanent == null && source.getAbilityType().equals(AbilityType.STATIC)) { + permanent = game.getPermanentEntering(source.getSourceId()); + } + if (player != null && permanent != null) { if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game) && player.chooseUse(Outcome.Benefit, cost.getText() + "? (otherwise " + permanent.getName() + " becomes tapped)", source, game)) { cost.clearPaid(); @@ -78,5 +81,4 @@ public class TapSourceUnlessPaysEffect extends OneShotEffect { return new TapSourceUnlessPaysEffect(this); } - } diff --git a/Mage/src/mage/abilities/effects/common/TapTargetEffect.java b/Mage/src/mage/abilities/effects/common/TapTargetEffect.java index e8fa976f4ba..efc2b9321dd 100644 --- a/Mage/src/mage/abilities/effects/common/TapTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/TapTargetEffect.java @@ -28,15 +28,14 @@ package mage.abilities.effects.common; -import mage.constants.Outcome; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.Target; - -import java.util.UUID; import mage.util.CardUtil; /** @@ -49,8 +48,10 @@ public class TapTargetEffect extends OneShotEffect { } public TapTargetEffect(String text) { - this(); - this.staticText = text; + super(Outcome.Tap); + if(text != null) { + this.staticText = text; + } } public TapTargetEffect(final TapTargetEffect effect) { diff --git a/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleAllEffect.java b/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleAllEffect.java index 4cdc3b8317a..2983f348322 100644 --- a/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleAllEffect.java @@ -3,7 +3,6 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ - package mage.abilities.effects.common.combat; import mage.abilities.Ability; @@ -12,6 +11,7 @@ import mage.constants.Duration; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.watchers.common.AttackedThisTurnWatcher; /** * @@ -24,19 +24,28 @@ public class AttacksIfAbleAllEffect extends RequirementEffect { public AttacksIfAbleAllEffect(FilterCreaturePermanent filter) { this(filter, Duration.WhileOnBattlefield); } - + + boolean eachCombat; + public AttacksIfAbleAllEffect(FilterCreaturePermanent filter, Duration duration) { + this(filter, duration, false); + } + + public AttacksIfAbleAllEffect(FilterCreaturePermanent filter, Duration duration, boolean eachCombat) { super(duration); - staticText = new StringBuilder(filter.getMessage()) - .append(" attack ") - .append(duration.equals(Duration.EndOfTurn) ? "this":"each") - .append(" turn if able").toString(); this.filter = filter; + this.eachCombat = eachCombat; + if (this.duration == Duration.EndOfTurn) { + staticText = filter.getMessage() + " attack " + (eachCombat ? "each combat" : "this turn") + " if able"; + } else { + staticText = filter.getMessage() + " attack each " + (eachCombat ? "combat" : "turn") + " if able"; + } } public AttacksIfAbleAllEffect(final AttacksIfAbleAllEffect effect) { super(effect); this.filter = effect.filter; + this.eachCombat = effect.eachCombat; } @Override @@ -46,7 +55,14 @@ public class AttacksIfAbleAllEffect extends RequirementEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return filter.match(permanent, source.getSourceId(), source.getControllerId(), game); + if (filter.match(permanent, source.getSourceId(), source.getControllerId(), game)) { + if (eachCombat) { + return true; + } + AttackedThisTurnWatcher watcher = (AttackedThisTurnWatcher) game.getState().getWatchers().get("AttackedThisTurn"); + return watcher != null && !watcher.getAttackedThisTurnCreatures().contains(permanent.getId()); + } + return false; } @Override diff --git a/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleTargetEffect.java b/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleTargetEffect.java index a3f5889ce3d..cc9600fb9c2 100644 --- a/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleTargetEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,18 +20,17 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.combat; -import mage.constants.Duration; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.RequirementEffect; +import mage.constants.Duration; import mage.game.Game; import mage.game.permanent.Permanent; @@ -56,10 +55,7 @@ public class AttacksIfAbleTargetEffect extends RequirementEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - if (this.getTargetPointer().getTargets(game, source).contains(permanent.getId())) { - return true; - } - return false; + return this.getTargetPointer().getTargets(game, source).contains(permanent.getId()); } @Override @@ -74,12 +70,14 @@ public class AttacksIfAbleTargetEffect extends RequirementEffect { @Override public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } if (this.duration == Duration.EndOfTurn) { return new StringBuilder("Target ").append(mode.getTargets().get(0).getTargetName()).append(" attacks this turn if able").toString(); - } - else { + } else { return new StringBuilder("Target ").append(mode.getTargets().get(0).getTargetName()).append(" attacks each turn if able").toString(); } } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderAllEffect.java b/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderAllEffect.java similarity index 86% rename from Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderAllEffect.java rename to Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderAllEffect.java index 11b4b3b945d..85a4e2eff67 100644 --- a/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderAllEffect.java @@ -42,28 +42,28 @@ import mage.game.permanent.Permanent; * * @author Quercitron */ -public class CanAttackAsThoughtItDidntHaveDefenderAllEffect extends AsThoughEffectImpl { +public class CanAttackAsThoughItDidntHaveDefenderAllEffect extends AsThoughEffectImpl { private final FilterPermanent filter; - public CanAttackAsThoughtItDidntHaveDefenderAllEffect(Duration duration) { + public CanAttackAsThoughItDidntHaveDefenderAllEffect(Duration duration) { this(duration, new FilterCreaturePermanent()); } - public CanAttackAsThoughtItDidntHaveDefenderAllEffect(Duration duration, FilterPermanent filter) { + public CanAttackAsThoughItDidntHaveDefenderAllEffect(Duration duration, FilterPermanent filter) { super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); this.filter = filter; this.staticText = getText(); } - public CanAttackAsThoughtItDidntHaveDefenderAllEffect(final CanAttackAsThoughtItDidntHaveDefenderAllEffect effect) { + public CanAttackAsThoughItDidntHaveDefenderAllEffect(final CanAttackAsThoughItDidntHaveDefenderAllEffect effect) { super(effect); this.filter = effect.filter.copy(); } @Override - public CanAttackAsThoughtItDidntHaveDefenderAllEffect copy() { - return new CanAttackAsThoughtItDidntHaveDefenderAllEffect(this); + public CanAttackAsThoughItDidntHaveDefenderAllEffect copy() { + return new CanAttackAsThoughItDidntHaveDefenderAllEffect(this); } @Override diff --git a/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderSourceEffect.java b/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderSourceEffect.java similarity index 82% rename from Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderSourceEffect.java rename to Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderSourceEffect.java index eb7dcc3c538..955229cae23 100644 --- a/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderSourceEffect.java @@ -1,69 +1,69 @@ -/* - * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.abilities.effects.common.combat; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.AsThoughEffectImpl; -import mage.constants.AsThoughEffectType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.game.Game; - -/** - * - * @author LevelX2 - */ - -public class CanAttackAsThoughtItDidntHaveDefenderSourceEffect extends AsThoughEffectImpl { - - public CanAttackAsThoughtItDidntHaveDefenderSourceEffect(Duration duration) { - super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); - staticText = "{this} can attack as though it didn't have defender"; - } - - public CanAttackAsThoughtItDidntHaveDefenderSourceEffect(final CanAttackAsThoughtItDidntHaveDefenderSourceEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public CanAttackAsThoughtItDidntHaveDefenderSourceEffect copy() { - return new CanAttackAsThoughtItDidntHaveDefenderSourceEffect(this); - } - - @Override - public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return objectId.equals(source.getSourceId()); - } - -} +/* + * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common.combat; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; + +/** + * + * @author LevelX2 + */ + +public class CanAttackAsThoughItDidntHaveDefenderSourceEffect extends AsThoughEffectImpl { + + public CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration duration) { + super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); + staticText = "{this} can attack as though it didn't have defender"; + } + + public CanAttackAsThoughItDidntHaveDefenderSourceEffect(final CanAttackAsThoughItDidntHaveDefenderSourceEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public CanAttackAsThoughItDidntHaveDefenderSourceEffect copy() { + return new CanAttackAsThoughItDidntHaveDefenderSourceEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + return objectId.equals(source.getSourceId()); + } + +} diff --git a/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderTargetEffect.java b/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderTargetEffect.java similarity index 85% rename from Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderTargetEffect.java rename to Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderTargetEffect.java index 604fa931fae..65b2e77b05c 100644 --- a/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughtItDidntHaveDefenderTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/CanAttackAsThoughItDidntHaveDefenderTargetEffect.java @@ -1,84 +1,84 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.abilities.effects.common.combat; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.effects.AsThoughEffectImpl; -import mage.constants.AsThoughEffectType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.game.Game; - -/** - * - * @author LevelX2 - */ - -public class CanAttackAsThoughtItDidntHaveDefenderTargetEffect extends AsThoughEffectImpl { - - public CanAttackAsThoughtItDidntHaveDefenderTargetEffect(Duration duration) { - super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); - } - - public CanAttackAsThoughtItDidntHaveDefenderTargetEffect(final CanAttackAsThoughtItDidntHaveDefenderTargetEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public CanAttackAsThoughtItDidntHaveDefenderTargetEffect copy() { - return new CanAttackAsThoughtItDidntHaveDefenderTargetEffect(this); - } - - @Override - public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - return this.getTargetPointer().getTargets(game, source).contains(objectId); - } - - @Override - public String getText(Mode mode) { - if (staticText != null && !staticText.isEmpty()) { - return staticText; - } - if (!mode.getTargets().isEmpty()) { - if (this.duration == Duration.EndOfTurn) { - return "Target " + mode.getTargets().get(0).getTargetName() + " can attack this turn as though it didn't have defender"; - } else { - return "Target " + mode.getTargets().get(0).getTargetName() + " can attack as though it didn't have defender"; - } - } else { - throw new UnsupportedOperationException("No target defined"); - } - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common.combat; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; + +/** + * + * @author LevelX2 + */ + +public class CanAttackAsThoughItDidntHaveDefenderTargetEffect extends AsThoughEffectImpl { + + public CanAttackAsThoughItDidntHaveDefenderTargetEffect(Duration duration) { + super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); + } + + public CanAttackAsThoughItDidntHaveDefenderTargetEffect(final CanAttackAsThoughItDidntHaveDefenderTargetEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public CanAttackAsThoughItDidntHaveDefenderTargetEffect copy() { + return new CanAttackAsThoughItDidntHaveDefenderTargetEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + return this.getTargetPointer().getTargets(game, source).contains(objectId); + } + + @Override + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + if (!mode.getTargets().isEmpty()) { + if (this.duration == Duration.EndOfTurn) { + return "Target " + mode.getTargets().get(0).getTargetName() + " can attack this turn as though it didn't have defender"; + } else { + return "Target " + mode.getTargets().get(0).getTargetName() + " can attack as though it didn't have defender"; + } + } else { + throw new UnsupportedOperationException("No target defined"); + } + } +} diff --git a/Mage/src/mage/abilities/effects/common/combat/CantAttackControllerAttachedEffect.java b/Mage/src/mage/abilities/effects/common/combat/CantAttackControllerAttachedEffect.java index 693b73307a0..8c6f3c40fea 100644 --- a/Mage/src/mage/abilities/effects/common/combat/CantAttackControllerAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/CantAttackControllerAttachedEffect.java @@ -1,80 +1,80 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ - -package mage.abilities.effects.common.combat; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.RestrictionEffect; -import mage.constants.AttachmentType; -import mage.constants.Duration; -import mage.game.Game; -import mage.game.permanent.Permanent; - - -/** - * - * @author LevelX2 - */ - -public class CantAttackControllerAttachedEffect extends RestrictionEffect { - - public CantAttackControllerAttachedEffect(AttachmentType attachmentType) { - super(Duration.WhileOnBattlefield); - if (attachmentType.equals(AttachmentType.AURA)) { - this.staticText = "Enchanted creature can't attack you or a planeswalker you control"; - } else { - this.staticText = "Equipped creature can't attack you or a planeswalker you control"; - } - } - - public CantAttackControllerAttachedEffect(final CantAttackControllerAttachedEffect effect) { - super(effect); - } - - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.getAttachments().contains(source.getSourceId()); - } - - @Override - public boolean canAttack(UUID defenderId, Ability source, Game game) { - if (defenderId.equals(source.getControllerId())) { - return false; - } - Permanent plainswalker = game.getPermanent(defenderId); - return plainswalker == null || !plainswalker.getControllerId().equals(source.getControllerId()); - } - - - @Override - public CantAttackControllerAttachedEffect copy() { - return new CantAttackControllerAttachedEffect(this); - } - -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.abilities.effects.common.combat; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.RestrictionEffect; +import mage.constants.AttachmentType; +import mage.constants.Duration; +import mage.game.Game; +import mage.game.permanent.Permanent; + + +/** + * + * @author LevelX2 + */ + +public class CantAttackControllerAttachedEffect extends RestrictionEffect { + + public CantAttackControllerAttachedEffect(AttachmentType attachmentType) { + super(Duration.WhileOnBattlefield); + if (attachmentType.equals(AttachmentType.AURA)) { + this.staticText = "Enchanted creature can't attack you or a planeswalker you control"; + } else { + this.staticText = "Equipped creature can't attack you or a planeswalker you control"; + } + } + + public CantAttackControllerAttachedEffect(final CantAttackControllerAttachedEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.getAttachments().contains(source.getSourceId()); + } + + @Override + public boolean canAttack(UUID defenderId, Ability source, Game game) { + if (defenderId.equals(source.getControllerId())) { + return false; + } + Permanent planeswalker = game.getPermanent(defenderId); + return planeswalker == null || !planeswalker.getControllerId().equals(source.getControllerId()); + } + + + @Override + public CantAttackControllerAttachedEffect copy() { + return new CantAttackControllerAttachedEffect(this); + } + +} diff --git a/Mage/src/mage/abilities/effects/common/combat/CantAttackIfDefenderControlsPermanent.java b/Mage/src/mage/abilities/effects/common/combat/CantAttackIfDefenderControlsPermanent.java new file mode 100644 index 00000000000..f0fbf61e2d0 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/combat/CantAttackIfDefenderControlsPermanent.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.abilities.effects.common.combat; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.RestrictionEffect; +import mage.constants.Duration; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author BursegSardaukar + */ + +public class CantAttackIfDefenderControlsPermanent extends RestrictionEffect { + + private final FilterPermanent filter; + + public CantAttackIfDefenderControlsPermanent(FilterPermanent filter) { + super(Duration.WhileOnBattlefield); + this.filter = filter; + staticText = new StringBuilder("{this} can't attack if defending player controls ").append(filter.getMessage()).toString(); + } + + public CantAttackIfDefenderControlsPermanent(final CantAttackIfDefenderControlsPermanent effect) { + super(effect); + this.filter = effect.filter; + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.getId().equals(source.getSourceId()); + } + + @Override + public boolean canAttack(UUID defenderId, Ability source, Game game) { + UUID defendingPlayerId; + Player player = game.getPlayer(defenderId); + if (player == null) { + Permanent permanent = game.getPermanent(defenderId); + if (permanent != null) { + defendingPlayerId = permanent.getControllerId(); + } else { + return true; + } + } else { + defendingPlayerId = defenderId; + } + if (defendingPlayerId != null && game.getBattlefield().countAll(filter, defendingPlayerId, game) > 0) { + return false; + } + return true; + } + + @Override + public CantAttackIfDefenderControlsPermanent copy() { + return new CantAttackIfDefenderControlsPermanent(this); + } + +} \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/combat/CantAttackTargetEffect.java b/Mage/src/mage/abilities/effects/common/combat/CantAttackTargetEffect.java index 887c8f401d5..210b2d609de 100644 --- a/Mage/src/mage/abilities/effects/common/combat/CantAttackTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/CantAttackTargetEffect.java @@ -28,9 +28,10 @@ package mage.abilities.effects.common.combat; -import mage.constants.Duration; import mage.abilities.Ability; +import mage.abilities.Mode; import mage.abilities.effects.RestrictionEffect; +import mage.constants.Duration; import mage.game.Game; import mage.game.permanent.Permanent; @@ -63,4 +64,15 @@ public class CantAttackTargetEffect extends RestrictionEffect { return new CantAttackTargetEffect(this); } + @Override + public String getText(Mode mode) { + if(staticText != null && !staticText.isEmpty()) { + return staticText; + } + String text = "target " + mode.getTargets().get(0).getTargetName() + " can't attack"; + if(this.duration == Duration.EndOfTurn) { + text += " this turn"; + } + return text; + } } diff --git a/Mage/src/mage/abilities/effects/common/combat/CantAttackYouOrPlaneswalkerAllEffect.java b/Mage/src/mage/abilities/effects/common/combat/CantAttackYouOrPlaneswalkerAllEffect.java new file mode 100644 index 00000000000..96aa778fbac --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/combat/CantAttackYouOrPlaneswalkerAllEffect.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common.combat; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.RestrictionEffect; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author fireshoes + */ +public class CantAttackYouOrPlaneswalkerAllEffect extends RestrictionEffect { + + private final FilterCreaturePermanent filterAttacker; + + public CantAttackYouOrPlaneswalkerAllEffect(Duration duration) { + this(duration, new FilterCreaturePermanent()); + } + + public CantAttackYouOrPlaneswalkerAllEffect(Duration duration, FilterCreaturePermanent filter) { + super(duration, Outcome.Benefit); + this.filterAttacker = filter; + staticText = "Creatures can't attack you"; + } + + CantAttackYouOrPlaneswalkerAllEffect(final CantAttackYouOrPlaneswalkerAllEffect effect) { + super(effect); + this.filterAttacker = effect.filterAttacker; + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return filterAttacker.match(permanent, source.getSourceId(), source.getControllerId(), game); + } + + @Override + public boolean canAttack(UUID defenderId, Ability source, Game game) { + if (defenderId.equals(source.getControllerId())) { + return false; + } + Permanent planeswalker = game.getPermanent(defenderId); + return planeswalker == null || !planeswalker.getControllerId().equals(source.getControllerId()); + } + + @Override + public CantAttackYouOrPlaneswalkerAllEffect copy() { + return new CantAttackYouOrPlaneswalkerAllEffect(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/combat/CantBeBlockedByAllTargetEffect.java b/Mage/src/mage/abilities/effects/common/combat/CantBeBlockedByAllTargetEffect.java new file mode 100644 index 00000000000..ec697e3ba89 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/combat/CantBeBlockedByAllTargetEffect.java @@ -0,0 +1,51 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common.combat; + +import mage.abilities.Ability; +import mage.abilities.effects.RestrictionEffect; +import mage.constants.Duration; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class CantBeBlockedByAllTargetEffect extends RestrictionEffect { + + private final FilterCreaturePermanent filterBlockedBy; + + public CantBeBlockedByAllTargetEffect(FilterCreaturePermanent filterBlockedBy, Duration duration) { + super(Duration.WhileOnBattlefield); + this.filterBlockedBy = filterBlockedBy; + staticText = "Target creature" + + " can't be blocked " + + (filterBlockedBy.getMessage().startsWith("except by") ? "" : "by ") + + filterBlockedBy.getMessage(); + } + + public CantBeBlockedByAllTargetEffect(final CantBeBlockedByAllTargetEffect effect) { + super(effect); + this.filterBlockedBy = effect.filterBlockedBy; + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return getTargetPointer().getTargets(game, source).contains(permanent.getId()); + } + + @Override + public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { + return !filterBlockedBy.match(blocker, source.getSourceId(), source.getControllerId(), game); + } + + @Override + public CantBeBlockedByAllTargetEffect copy() { + return new CantBeBlockedByAllTargetEffect(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/combat/CantBeBlockedByOneAllEffect.java b/Mage/src/mage/abilities/effects/common/combat/CantBeBlockedByOneAllEffect.java index f26ba37acd4..36617682c8e 100644 --- a/Mage/src/mage/abilities/effects/common/combat/CantBeBlockedByOneAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/CantBeBlockedByOneAllEffect.java @@ -59,7 +59,7 @@ public class CantBeBlockedByOneAllEffect extends ContinuousEffectImpl { if (duration.equals(Duration.EndOfTurn)) { sb.append("this turn "); } - sb.append("except by ").append(CardUtil.numberToText(amount)).append(" or more creatures").toString(); + sb.append("except by ").append(CardUtil.numberToText(amount)).append(" or more creatures"); staticText = sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/combat/CantBlockAttachedEffect.java b/Mage/src/mage/abilities/effects/common/combat/CantBlockAttachedEffect.java index d58293e927c..b42d9e082b1 100644 --- a/Mage/src/mage/abilities/effects/common/combat/CantBlockAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/CantBlockAttachedEffect.java @@ -27,12 +27,13 @@ */ package mage.abilities.effects.common.combat; -import mage.constants.AttachmentType; -import mage.constants.Duration; import mage.abilities.Ability; import mage.abilities.effects.RestrictionEffect; +import mage.constants.AttachmentType; +import mage.constants.Duration; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; /** * @@ -62,8 +63,22 @@ public class CantBlockAttachedEffect extends RestrictionEffect { super(effect); } + @Override + public void init(Ability source, Game game) { + super.init(source, game); + if (affectedObjectsSet) { + Permanent equipment = game.getPermanent(source.getSourceId()); + if (equipment != null && equipment.getAttachedTo() != null) { + this.setTargetPointer(new FixedTarget(equipment.getAttachedTo(), game.getState().getZoneChangeCounter(equipment.getAttachedTo()))); + } + } + } + @Override public boolean applies(Permanent permanent, Ability source, Game game) { + if (affectedObjectsSet) { + return targetPointer.getFirst(game, source).equals(permanent.getId()); + } return permanent.getAttachments().contains(source.getSourceId()); } diff --git a/Mage/src/mage/abilities/effects/common/continuous/AddCardSubTypeTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/AddCardSubTypeTargetEffect.java index 475a7f8d6b6..e4ed2543d96 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/AddCardSubTypeTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/AddCardSubTypeTargetEffect.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.continuous; import mage.abilities.Ability; @@ -42,7 +41,7 @@ import mage.game.permanent.Permanent; * @author nantuko */ public class AddCardSubTypeTargetEffect extends ContinuousEffectImpl { - + private final String addedSubType; public AddCardSubTypeTargetEffect(String addedSubType, Duration duration) { diff --git a/Mage/src/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java index 2c51a470c00..19ce641041f 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/AddCardTypeTargetEffect.java @@ -25,14 +25,18 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.continuous; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.ContinuousEffectImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.DependencyType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; import mage.game.Game; import mage.game.permanent.Permanent; @@ -40,12 +44,15 @@ import mage.game.permanent.Permanent; * @author nantuko */ public class AddCardTypeTargetEffect extends ContinuousEffectImpl { - + private final CardType addedCardType; public AddCardTypeTargetEffect(CardType addedCardType, Duration duration) { super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); this.addedCardType = addedCardType; + if (addedCardType.equals(CardType.ENCHANTMENT)) { + dependencyTypes.add(DependencyType.EnchantmentAddingRemoving); + } } public AddCardTypeTargetEffect(final AddCardTypeTargetEffect effect) { @@ -56,7 +63,7 @@ public class AddCardTypeTargetEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { boolean result = false; - for (UUID targetId :targetPointer.getTargets(game, source)) { + for (UUID targetId : targetPointer.getTargets(game, source)) { Permanent target = game.getPermanent(targetId); if (target != null) { if (!target.getCardType().contains(addedCardType)) { diff --git a/Mage/src/mage/abilities/effects/common/continuous/AssignNoCombatDamageSourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/AssignNoCombatDamageSourceEffect.java index f7615c0db32..7146608ba73 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/AssignNoCombatDamageSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/AssignNoCombatDamageSourceEffect.java @@ -45,13 +45,21 @@ import static mage.game.events.GameEvent.EventType.DAMAGE_PLAYER; public class AssignNoCombatDamageSourceEffect extends ReplacementEffectImpl { + private boolean partOfOptionalEffect; + public AssignNoCombatDamageSourceEffect(Duration duration) { + this(duration, false); + } + + public AssignNoCombatDamageSourceEffect(Duration duration, boolean partOfOptionalEffect) { super(duration, Outcome.PreventDamage); + this.partOfOptionalEffect = partOfOptionalEffect; staticText = setText(); } public AssignNoCombatDamageSourceEffect(final AssignNoCombatDamageSourceEffect effect) { super(effect); + this.partOfOptionalEffect = effect.partOfOptionalEffect; } @Override @@ -88,19 +96,23 @@ public class AssignNoCombatDamageSourceEffect extends ReplacementEffectImpl { } private String setText() { - StringBuilder sb = new StringBuilder("{this} assigns no combat damage"); + String text = ""; + if(partOfOptionalEffect) { + text = "If you do, "; + } + text += "{this} assigns no combat damage"; switch(duration) { case EndOfTurn: - sb.append("this turn"); + text += " this turn"; break; case EndOfCombat: - sb.append("this combat"); + text += " this combat"; break; default: if (duration.toString().length() > 0) { - sb.append(" ").append(duration.toString()); + text += " " + duration.toString(); } } - return sb.toString(); + return text; } } diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesAuraSourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesAuraSourceEffect.java index e0f07a65544..844447ddd7a 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesAuraSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesAuraSourceEffect.java @@ -31,6 +31,7 @@ import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.keyword.EnchantAbility; +import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.Layer; import static mage.constants.Layer.AbilityAddingRemovingEffects_6; @@ -56,10 +57,10 @@ public class BecomesAuraSourceEffect extends ContinuousEffectImpl implements Sou newAbility = new EnchantAbility(target.getTargetName()); newAbility.setRuleAtTheTop(true); staticText = "it becomes an Aura with enchant " + target.getTargetName(); + dependencyTypes.add(DependencyType.AuraAddingRemoving); } - public BecomesAuraSourceEffect(final BecomesAuraSourceEffect effect) { super(effect); this.target = effect.target; @@ -112,4 +113,4 @@ public class BecomesAuraSourceEffect extends ContinuousEffectImpl implements Sou return Layer.AbilityAddingRemovingEffects_6.equals(layer) || Layer.TypeChangingEffects_4.equals(layer); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandEnchantedEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandEnchantedEffect.java index 068fee171e2..06f4388a583 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandEnchantedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandEnchantedEffect.java @@ -25,12 +25,10 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.continuous; import java.util.ArrayList; import java.util.Arrays; -import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.mana.BlackManaAbility; @@ -38,7 +36,6 @@ import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.abilities.mana.WhiteManaAbility; -import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; @@ -46,14 +43,26 @@ import mage.constants.SubLayer; import mage.game.Game; import mage.game.permanent.Permanent; -/** - * - * @author LevelX2 - */ - - public class BecomesBasicLandEnchantedEffect extends ContinuousEffectImpl { + protected final static ArrayList allLandTypes = new ArrayList<>(); + + static { // 205.3i + allLandTypes.add("Forest"); + allLandTypes.add("Swamp"); + allLandTypes.add("Plains"); + allLandTypes.add("Mountain"); + allLandTypes.add("Island"); + allLandTypes.add("Urza's"); + allLandTypes.add("Mine"); + allLandTypes.add("Power-Plant"); + allLandTypes.add("Tower"); + allLandTypes.add("Desert"); + allLandTypes.add("Gate"); + allLandTypes.add("Lair"); + allLandTypes.add("Locus"); + } + protected ArrayList landTypes = new ArrayList<>(); public BecomesBasicLandEnchantedEffect(String... landNames) { @@ -84,16 +93,9 @@ public class BecomesBasicLandEnchantedEffect extends ContinuousEffectImpl { Permanent permanent = game.getPermanent(enchantment.getAttachedTo()); if (permanent != null) { switch (layer) { - case ColorChangingEffects_5: - permanent.getColor(game).setWhite(false); - permanent.getColor(game).setGreen(false); - permanent.getColor(game).setBlack(false); - permanent.getColor(game).setBlue(false); - permanent.getColor(game).setRed(false); - break; case AbilityAddingRemovingEffects_6: permanent.removeAllAbilities(source.getSourceId(), game); - for (String landType : landTypes) { + for (String landType : landTypes) { switch (landType) { case "Swamp": permanent.addAbility(new BlackManaAbility(), source.getSourceId(), game); @@ -114,9 +116,8 @@ public class BecomesBasicLandEnchantedEffect extends ContinuousEffectImpl { } break; case TypeChangingEffects_4: - permanent.getCardType().clear(); - permanent.getCardType().add(CardType.LAND); - permanent.getSubtype().clear(); + // subtypes are all removed by changing the subtype to a land type. + permanent.getSubtype().removeAll(allLandTypes); permanent.getSubtype().addAll(landTypes); break; } @@ -134,8 +135,8 @@ public class BecomesBasicLandEnchantedEffect extends ContinuousEffectImpl { private String setText() { StringBuilder sb = new StringBuilder("Enchanted land is a "); int i = 1; - for (String landType : landTypes) { - if (i >1) { + for (String landType : landTypes) { + if (i > 1) { if (i == landTypes.size()) { sb.append(" and "); } else { diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java index 31a33d58316..e29c167c5cd 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.continuous; import java.util.ArrayList; @@ -38,9 +37,11 @@ import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.abilities.mana.WhiteManaAbility; +import mage.cards.repository.CardRepository; import mage.choices.Choice; import mage.choices.ChoiceBasicLandType; import mage.constants.CardType; +import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; @@ -53,8 +54,6 @@ import mage.players.Player; * * @author LevelX2 */ - - public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { protected boolean chooseLandType; @@ -76,6 +75,21 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { public BecomesBasicLandTargetEffect(Duration duration, boolean chooseLandType, boolean loseOther, String... landNames) { super(duration, Outcome.Detriment); this.landTypes.addAll(Arrays.asList(landNames)); + if (landTypes.contains("Mountain")) { + dependencyTypes.add(DependencyType.BecomeMountain); + } + if (landTypes.contains("Forest")) { + dependencyTypes.add(DependencyType.BecomeForest); + } + if (landTypes.contains("Swamp")) { + dependencyTypes.add(DependencyType.BecomeSwamp); + } + if (landTypes.contains("Island")) { + dependencyTypes.add(DependencyType.BecomeIsland); + } + if (landTypes.contains("Plains")) { + dependencyTypes.add(DependencyType.BecomePlains); + } this.chooseLandType = chooseLandType; this.staticText = setText(); this.loseOther = loseOther; @@ -98,6 +112,7 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { public BecomesBasicLandTargetEffect copy() { return new BecomesBasicLandTargetEffect(this); } + @Override public void init(Ability source, Game game) { super.init(source, game); @@ -113,12 +128,12 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { } } - if(!loseOther) { + if (!loseOther) { for (UUID targetPermanent : targetPointer.getTargets(game, source)) { Permanent land = game.getPermanent(targetPermanent); if (land != null) { - for(String type : land.getSubtype()) { - if(!landTypes.contains(type)) { + for (String type : land.getSubtype()) { + if (!landTypes.contains(type)) { landTypes.add(type); } } @@ -133,9 +148,20 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { Permanent land = game.getPermanent(targetPermanent); if (land != null) { switch (layer) { - case AbilityAddingRemovingEffects_6: + case TypeChangingEffects_4: + // Attention: Cards like Unstable Frontier that use this class do not give the "Basic" supertype to the target + if (!land.getCardType().contains(CardType.LAND)) { + land.getCardType().add(CardType.LAND); + } + // 305.7 Note that this doesn't remove any abilities that were granted to the land by other effects + // So the ability removing has to be done before Layer 6 land.removeAllAbilities(source.getSourceId(), game); - for (String landType : landTypes) { + // 305.7 + land.getSubtype().removeAll(CardRepository.instance.getLandTypes()); + land.getSubtype().addAll(landTypes); + break; + case AbilityAddingRemovingEffects_6: + for (String landType : landTypes) { switch (landType) { case "Swamp": land.addAbility(new BlackManaAbility(), source.getSourceId(), game); @@ -155,13 +181,6 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { } } break; - case TypeChangingEffects_4: - if (!land.getCardType().contains(CardType.LAND)) { - land.getCardType().add(CardType.LAND); - } - land.getSubtype().clear(); - land.getSubtype().addAll(landTypes); - break; } } } @@ -180,8 +199,8 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { } else { sb.append("Target land becomes a "); int i = 1; - for (String landType : landTypes) { - if (i >1) { + for (String landType : landTypes) { + if (i > 1) { if (i == landTypes.size()) { sb.append(" and "); } else { @@ -193,7 +212,7 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { } } if (!duration.toString().isEmpty() && !duration.equals(Duration.EndOfGame)) { - sb.append(" ").append(duration.toString()); + sb.append(" ").append(duration.toString()); } return sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesChosenCreatureTypeTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesChosenCreatureTypeTargetEffect.java new file mode 100644 index 00000000000..538a4841fbd --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesChosenCreatureTypeTargetEffect.java @@ -0,0 +1,85 @@ +package mage.abilities.effects.common.continuous; + +import java.util.Set; + +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.repository.CardRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +public class BecomesChosenCreatureTypeTargetEffect extends OneShotEffect { + + private final boolean nonWall; + + public BecomesChosenCreatureTypeTargetEffect() { + this(false); + } + + public BecomesChosenCreatureTypeTargetEffect(boolean nonWall) { + super(Outcome.BoostCreature); + this.nonWall = nonWall; + if(nonWall) { + staticText = "choose a creature type other than wall, target creature's type becomes that type until end of turn"; + } + else { + staticText = "target creature becomes the creature type of your choice until end of turn"; + } + + } + + public BecomesChosenCreatureTypeTargetEffect(final BecomesChosenCreatureTypeTargetEffect effect) { + super(effect); + this.nonWall = effect.nonWall; + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Card card = game.getCard(source.getSourceId()); + String chosenType = ""; + if (player != null && card != null) { + Choice typeChoice = new ChoiceImpl(true); + String msg = "Choose a creature type"; + if(nonWall) { + msg += " other than Wall"; + } + typeChoice.setMessage(msg); + Set types = CardRepository.instance.getCreatureTypes(); + if(nonWall) { + types.remove("Wall"); + } + typeChoice.setChoices(types); + while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { + if (!player.canRespond()) { + return false; + } + } + game.informPlayers(card.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice()); + chosenType = typeChoice.getChoice(); + if (chosenType != null && !chosenType.isEmpty()) { + // ADD TYPE TO TARGET + ContinuousEffect effect = new BecomesCreatureTypeTargetEffect(Duration.EndOfTurn, chosenType); + effect.setTargetPointer(new FixedTarget(getTargetPointer().getFirst(game, source))); + game.addEffect(effect, source); + return true; + } + + } + return false; + } + + @Override + public Effect copy() { + return new BecomesChosenCreatureTypeTargetEffect(this); + } + +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesChosenNonWallCreatureTypeTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesChosenNonWallCreatureTypeTargetEffect.java deleted file mode 100644 index 316ef45e413..00000000000 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesChosenNonWallCreatureTypeTargetEffect.java +++ /dev/null @@ -1,66 +0,0 @@ -package mage.abilities.effects.common.continuous; - -import java.util.Set; - -import mage.abilities.Ability; -import mage.abilities.effects.ContinuousEffect; -import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; -import mage.cards.repository.CardRepository; -import mage.choices.Choice; -import mage.choices.ChoiceImpl; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.targetpointer.FixedTarget; - -public class BecomesChosenNonWallCreatureTypeTargetEffect extends OneShotEffect { - - public BecomesChosenNonWallCreatureTypeTargetEffect() { - super(Outcome.BoostCreature); - staticText = "choose a creature type other than wall, target creature's type becomes that type until end of turn"; - - } - - public BecomesChosenNonWallCreatureTypeTargetEffect(final BecomesChosenNonWallCreatureTypeTargetEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - String chosenType = ""; - if (player != null && permanent != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose creature type other than Wall"); - Set types = CardRepository.instance.getCreatureTypes(); - types.remove("Wall"); - typeChoice.setChoices(types); - while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { - if (!player.canRespond()) { - return false; - } - } - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice()); - chosenType = typeChoice.getChoice(); - if (chosenType != null && !chosenType.isEmpty()) { - // ADD TYPE TO TARGET - ContinuousEffect effect = new BecomesSubtypeTargetEffect(Duration.EndOfTurn, chosenType); - effect.setTargetPointer(new FixedTarget(getTargetPointer().getFirst(game, source))); - game.addEffect(effect, source); - return true; - } - - } - return false; - } - - @Override - public Effect copy() { - return new BecomesChosenNonWallCreatureTypeTargetEffect(this); - } - -} diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesColorOrColorsTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesColorOrColorsTargetEffect.java index dcdbe3ef9f2..c8fc6e2e6c2 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesColorOrColorsTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesColorOrColorsTargetEffect.java @@ -44,14 +44,14 @@ import mage.target.targetpointer.FixedTarget; * * @author LevelX2 */ - public class BecomesColorOrColorsTargetEffect extends OneShotEffect { Duration duration; + /** * This effect let the controller choose one or more colors the target will - * become to. - * Use effect.setText() if case you use a targetPointer, otherwise the rule text will be empty. + * become to. Use effect.setText() if case you use a targetPointer, + * otherwise the rule text will be empty. * * @param duration */ @@ -81,8 +81,9 @@ public class BecomesColorOrColorsTargetEffect extends OneShotEffect { if (!controller.canRespond()) { return false; } - if (!game.isSimulation()) + if (!game.isSimulation()) { game.informPlayers(target.getName() + ": " + controller.getLogName() + " has chosen " + choiceColor.getChoice()); + } if (choiceColor.getColor().isBlack()) { sb.append("B"); } else if (choiceColor.getColor().isBlue()) { @@ -119,7 +120,7 @@ public class BecomesColorOrColorsTargetEffect extends OneShotEffect { StringBuilder sb = new StringBuilder(); if (mode.getTargets().size() > 0) { sb.append("target "); - sb.append(mode.getTargets().get(0).getMessage()); + sb.append(mode.getTargets().get(0).getFilter().getMessage()); sb.append(" becomes the color or colors of your choice"); if (duration.toString().length() > 0) { sb.append(" ").append(duration.toString()); diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java index f891657cff5..b01e282fb33 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java @@ -27,14 +27,14 @@ */ package mage.abilities.effects.common.continuous; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.ContinuousEffectImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.effects.ContinuousEffectImpl; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -42,13 +42,13 @@ import mage.game.permanent.token.Token; /** * @author LevelX2 - * + * */ public class BecomesCreatureAllEffect extends ContinuousEffectImpl { protected Token token; protected String type; - private FilterPermanent filter; + private final FilterPermanent filter; public BecomesCreatureAllEffect(Token token, String type, FilterPermanent filter, Duration duration) { super(duration, Outcome.BecomeCreature); @@ -71,7 +71,7 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl { @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { if (permanent != null) { switch (layer) { case TypeChangingEffects_4: @@ -93,8 +93,9 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl { break; case ColorChangingEffects_5: if (sublayer == SubLayer.NA) { - if (token.getColor(game).hasColor()) + if (token.getColor(game).hasColor()) { permanent.getColor(game).setColor(token.getColor(game)); + } } break; case AbilityAddingRemovingEffects_6: diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java index 1658b00fc80..5a0f47fce55 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureAttachedEffect.java @@ -29,6 +29,7 @@ package mage.abilities.effects.common.continuous; import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.repository.CardRepository; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -110,7 +111,7 @@ public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl { switch (loseType) { case ALL: case ALL_BUT_COLOR: - permanent.getSubtype().clear(); + permanent.getSubtype().retainAll(CardRepository.instance.getLandTypes()); break; } if (token.getSubtype().size() > 0) { diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java index 37d0e41ac46..b751dd98092 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java @@ -25,13 +25,13 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.continuous; import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.repository.CardRepository; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -105,8 +105,8 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements } } } - if ("".equals(type) || type == null) { - permanent.getSubtype().clear(); + if ("".equals(type) || type == null && permanent.getCardType().contains(CardType.LAND)) { + permanent.getSubtype().retainAll(CardRepository.instance.getLandTypes()); } if (token.getSubtype().size() > 0) { permanent.getSubtype().addAll(token.getSubtype()); @@ -123,14 +123,14 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements case AbilityAddingRemovingEffects_6: if (sublayer == SubLayer.NA) { if (token.getAbilities().size() > 0) { - for (Ability ability: token.getAbilities()) { - permanent.addAbility(ability, game); + for (Ability ability : token.getAbilities()) { + permanent.addAbility(ability, source.getSourceId(), game); } } } break; case PTChangingEffects_7: - if (sublayer == SubLayer.SetPT_7b) { + if (sublayer == SubLayer.CharacteristicDefining_7a) { MageInt power = token.getPower(); MageInt toughness = token.getToughness(); if (power != null && toughness != null) { @@ -156,8 +156,7 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements private void setText() { if (type != null && type.length() > 0) { staticText = duration.toString() + " {this} becomes a " + token.getDescription() + " that's still a " + this.type; - } - else { + } else { staticText = duration.toString() + " {this} becomes a " + token.getDescription(); } } diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java index 10c22909b9d..87eb0e989e9 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -28,14 +28,15 @@ package mage.abilities.effects.common.continuous; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.repository.CardRepository; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.effects.ContinuousEffectImpl; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; @@ -87,11 +88,11 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { if (loseAllAbilities) { - permanent.getSubtype().clear(); + permanent.getSubtype().retainAll(CardRepository.instance.getLandTypes()); permanent.getSubtype().addAll(token.getSubtype()); } else { if (token.getSubtype().size() > 0) { - for (String subtype :token.getSubtype()) { + for (String subtype : token.getSubtype()) { if (!permanent.getSubtype().contains(subtype)) { permanent.getSubtype().add(subtype); } @@ -143,7 +144,7 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl { result = true; } } - if (!result && this.duration.equals(Duration.Custom) ) { + if (!result && this.duration.equals(Duration.Custom)) { this.discard(); } return result; @@ -166,7 +167,7 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl { } StringBuilder sb = new StringBuilder(); Target target = mode.getTargets().get(0); - if(target.getMaxNumberOfTargets() > 1){ + if (target.getMaxNumberOfTargets() > 1) { if (target.getNumberOfTargets() < target.getMaxNumberOfTargets()) { sb.append("up to "); } diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesSubtypeTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureTypeTargetEffect.java similarity index 76% rename from Mage/src/mage/abilities/effects/common/continuous/BecomesSubtypeTargetEffect.java rename to Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureTypeTargetEffect.java index f056b1ffee2..b675cb48345 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesSubtypeTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureTypeTargetEffect.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.repository.CardRepository; import mage.constants.Duration; import mage.constants.Layer; import static mage.constants.Layer.TypeChangingEffects_4; @@ -21,20 +22,20 @@ import mage.game.permanent.Permanent; * * @author LevelX2 */ -public class BecomesSubtypeTargetEffect extends ContinuousEffectImpl { +public class BecomesCreatureTypeTargetEffect extends ContinuousEffectImpl { protected ArrayList subtypes = new ArrayList(); - protected boolean loseOther; // loses other subtypes + protected boolean loseOther; // loses other creature types - public BecomesSubtypeTargetEffect(Duration duration, String subtype) { + public BecomesCreatureTypeTargetEffect(Duration duration, String subtype) { this(duration, createArrayList(subtype)); } - public BecomesSubtypeTargetEffect(Duration duration, ArrayList subtypes) { + public BecomesCreatureTypeTargetEffect(Duration duration, ArrayList subtypes) { this(duration, subtypes, true); } - public BecomesSubtypeTargetEffect(Duration duration, ArrayList subtypes, boolean loseOther) { + public BecomesCreatureTypeTargetEffect(Duration duration, ArrayList subtypes, boolean loseOther) { super(duration, Outcome.Detriment); this.subtypes = subtypes; this.staticText = setText(); @@ -47,7 +48,7 @@ public class BecomesSubtypeTargetEffect extends ContinuousEffectImpl { return subtypes; } - public BecomesSubtypeTargetEffect(final BecomesSubtypeTargetEffect effect) { + public BecomesCreatureTypeTargetEffect(final BecomesCreatureTypeTargetEffect effect) { super(effect); this.subtypes.addAll(effect.subtypes); this.loseOther = effect.loseOther; @@ -60,8 +61,8 @@ public class BecomesSubtypeTargetEffect extends ContinuousEffectImpl { } @Override - public BecomesSubtypeTargetEffect copy() { - return new BecomesSubtypeTargetEffect(this); + public BecomesCreatureTypeTargetEffect copy() { + return new BecomesCreatureTypeTargetEffect(this); } @Override @@ -72,7 +73,7 @@ public class BecomesSubtypeTargetEffect extends ContinuousEffectImpl { switch (layer) { case TypeChangingEffects_4: if (loseOther) { - permanent.getSubtype().clear(); + permanent.getSubtype().retainAll(CardRepository.instance.getLandTypes()); permanent.getSubtype().addAll(subtypes); } else { for (String subtype : subtypes) { diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesSubtypeAllEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesSubtypeAllEffect.java index 36c62e51adb..5b126ac4b5a 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesSubtypeAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesSubtypeAllEffect.java @@ -6,9 +6,9 @@ package mage.abilities.effects.common.continuous; import java.util.ArrayList; - import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.repository.CardRepository; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; @@ -23,90 +23,90 @@ import mage.game.permanent.Permanent; */ public class BecomesSubtypeAllEffect extends ContinuousEffectImpl { - protected ArrayList subtypes = new ArrayList(); - protected boolean loseOther; // loses other subtypes + protected ArrayList subtypes = new ArrayList(); + protected boolean loseOther; // loses other subtypes + protected FilterCreaturePermanent filter; - public BecomesSubtypeAllEffect(Duration duration, String subtype) { - this(duration, createArrayList(subtype)); - } + public BecomesSubtypeAllEffect(Duration duration, String subtype) { + this(duration, createArrayList(subtype)); + } - public BecomesSubtypeAllEffect(Duration duration, ArrayList subtypes) { - this(duration, subtypes, true); - } + public BecomesSubtypeAllEffect(Duration duration, ArrayList subtypes) { + this(duration, subtypes, new FilterCreaturePermanent("All creatures"), true); + } - public BecomesSubtypeAllEffect(Duration duration, - ArrayList subtypes, boolean loseOther) { - super(duration, Outcome.Detriment); - this.subtypes = subtypes; - this.staticText = setText(); - this.loseOther = loseOther; - } + public BecomesSubtypeAllEffect(Duration duration, + ArrayList subtypes, FilterCreaturePermanent filter, boolean loseOther) { + super(duration, Outcome.Detriment); + this.subtypes = subtypes; + this.staticText = setText(); + this.loseOther = loseOther; + this.filter = filter; + } - private static ArrayList createArrayList(String subtype) { - ArrayList subtypes = new ArrayList<>(); - subtypes.add(subtype); - return subtypes; - } + private static ArrayList createArrayList(String subtype) { + ArrayList subtypes = new ArrayList<>(); + subtypes.add(subtype); + return subtypes; + } - public BecomesSubtypeAllEffect(final BecomesSubtypeAllEffect effect) { - super(effect); - this.subtypes.addAll(effect.subtypes); - this.loseOther = effect.loseOther; - this.loseOther = effect.loseOther; - } + public BecomesSubtypeAllEffect(final BecomesSubtypeAllEffect effect) { + super(effect); + this.subtypes.addAll(effect.subtypes); + this.loseOther = effect.loseOther; + this.filter = effect.filter; + } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public BecomesSubtypeAllEffect copy() { - return new BecomesSubtypeAllEffect(this); - } + @Override + public BecomesSubtypeAllEffect copy() { + return new BecomesSubtypeAllEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, - Game game) { + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, + Game game) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) { + if (permanent != null) { + switch (layer) { + case TypeChangingEffects_4: + if (loseOther) { + permanent.getSubtype().retainAll(CardRepository.instance.getLandTypes()); + permanent.getSubtype().addAll(subtypes); + } else { + for (String subtype : subtypes) { + if (!permanent.getSubtype().contains(subtype)) { + permanent.getSubtype().add(subtype); + } + } + } + break; + } + } else { + if (duration.equals(Duration.Custom)) { + discard(); + } + } + } + return true; + } - for (Permanent permanent : game.getBattlefield() - .getAllActivePermanents(new FilterCreaturePermanent(), game)) { - if (permanent != null) { - switch (layer) { - case TypeChangingEffects_4: - if (loseOther) { - permanent.getSubtype().clear(); - permanent.getSubtype().addAll(subtypes); - } else { - for (String subtype : subtypes) { - if (!permanent.getSubtype().contains(subtype)) { - permanent.getSubtype().add(subtype); - } - } - } - break; - } - } else { - if (duration.equals(Duration.Custom)) { - discard(); - } - } - } - return true; - } + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.TypeChangingEffects_4; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.TypeChangingEffects_4; - } - - private String setText() { - StringBuilder sb = new StringBuilder(); - sb.append("Target creature becomes that type"); - if (!duration.toString().isEmpty() - && !duration.equals(Duration.EndOfGame)) { - sb.append(" ").append(duration.toString()); - } - return sb.toString(); - } + private String setText() { + StringBuilder sb = new StringBuilder(); + sb.append("Target creature becomes that type"); + if (!duration.toString().isEmpty() + && !duration.equals(Duration.EndOfGame)) { + sb.append(" ").append(duration.toString()); + } + return sb.toString(); + } } diff --git a/Mage/src/mage/abilities/effects/common/continuous/BoostControlledEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BoostControlledEffect.java index 197e1b040d0..763e78028b5 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BoostControlledEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BoostControlledEffect.java @@ -54,11 +54,11 @@ public class BoostControlledEffect extends ContinuousEffectImpl { protected boolean lockedIn = false; public BoostControlledEffect(int power, int toughness, Duration duration) { - this(power, toughness, duration, new FilterCreaturePermanent("Creatures"), false); + this(power, toughness, duration, new FilterCreaturePermanent("creatures"), false); } public BoostControlledEffect(DynamicValue power, DynamicValue toughness, Duration duration) { - this(power, toughness, duration, new FilterCreaturePermanent("Creatures"), false); + this(power, toughness, duration, new FilterCreaturePermanent("creatures"), false); } public BoostControlledEffect(int power, int toughness, Duration duration, boolean excludeSource) { @@ -81,7 +81,8 @@ public class BoostControlledEffect extends ContinuousEffectImpl { * @param power * @param toughness * @param duration - * @param filter + * @param filter AnotherPredicate is not working, you need to use the + * excludeSource option * @param lockedIn if true, power and toughness will be calculated only * once, when the ability resolves * @param excludeSource diff --git a/Mage/src/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java index f806ef6541a..461dd0e13dc 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BoostEnchantedEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,24 +20,24 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.continuous; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.ContinuousEffectImpl; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; /** * @@ -79,15 +79,37 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl { } @Override - public boolean apply(Game game, Ability source) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - creature.addPower(power.calculate(game, source, this)); - creature.addToughness(toughness.calculate(game, source, this)); + public void init(Ability source, Game game) { + super.init(source, game); + if (affectedObjectsSet) { + // Added boosts of activated or triggered abilities exist independent from the source they are created by + // so a continuous effect for the permanent itself with the attachment is created + Permanent equipment = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (equipment != null && equipment.getAttachedTo() != null) { + this.setTargetPointer(new FixedTarget(equipment.getAttachedTo(), game.getState().getZoneChangeCounter(equipment.getAttachedTo()))); } } + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = null; + if (affectedObjectsSet) { + permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent == null) { + discard(); + return true; + } + } else { + Permanent equipment = game.getPermanent(source.getSourceId()); + if (equipment != null && equipment.getAttachedTo() != null) { + permanent = game.getPermanent(equipment.getAttachedTo()); + } + } + if (permanent != null) { + permanent.addPower(power.calculate(game, source, this)); + permanent.addToughness(toughness.calculate(game, source, this)); + } return true; } @@ -95,16 +117,15 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl { StringBuilder sb = new StringBuilder(); sb.append("Enchanted creature gets "); String p = power.toString(); - if(!p.startsWith("-")) { + if (!p.startsWith("-")) { sb.append("+"); } sb.append(p).append("/"); String t = toughness.toString(); - if(!t.startsWith("-")){ - if(p.startsWith("-")) { + if (!t.startsWith("-")) { + if (p.startsWith("-")) { sb.append("-"); - } - else { + } else { sb.append("+"); } } diff --git a/Mage/src/mage/abilities/effects/common/continuous/BoostSourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BoostSourceEffect.java index bb671aa3b69..93ab0363ad6 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BoostSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BoostSourceEffect.java @@ -137,14 +137,24 @@ public class BoostSourceEffect extends ContinuousEffectImpl implements SourceEff if (duration != Duration.WhileOnBattlefield) { sb.append(" ").append(duration.toString()); } - String message = power.getMessage(); - if (message.length() == 0) { + String message = null; + String fixedPart = null; + if (t.contains("X")) { message = toughness.getMessage(); + fixedPart = ", where X is "; + } else if (p.contains("X")) { + message = power.getMessage(); + fixedPart = ", where X is "; + } else if (!power.getMessage().isEmpty()) { + message = power.getMessage(); + fixedPart = " for each "; + } else if (!toughness.getMessage().isEmpty()) { + message = toughness.getMessage(); + fixedPart = " for each "; } - if (message.length() > 0) { - sb.append(" for each "); + if (message != null && !message.isEmpty() && fixedPart != null) { + sb.append(fixedPart).append(message); } - sb.append(message); staticText = sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/continuous/BoostTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BoostTargetEffect.java index 1d11baae793..9ced7947bb8 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BoostTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BoostTargetEffect.java @@ -150,10 +150,10 @@ public class BoostTargetEffect extends ContinuousEffectImpl { } String message = null; String fixedPart = null; - if (t.equals("X")) { + if (t.contains("X")) { message = toughness.getMessage(); fixedPart = ", where X is "; - } else if (p.equals("X")) { + } else if (p.contains("X")) { message = power.getMessage(); fixedPart = ", where X is "; } else if (!power.getMessage().isEmpty()) { diff --git a/Mage/src/mage/abilities/effects/common/continuous/CommanderManaReplacementEffect.java b/Mage/src/mage/abilities/effects/common/continuous/CommanderManaReplacementEffect.java index 36ad215d042..b3e4e3de2c1 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/CommanderManaReplacementEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/CommanderManaReplacementEffect.java @@ -81,31 +81,31 @@ public class CommanderManaReplacementEffect extends ReplacementEffectImpl { Mana mana = ((ManaEvent) event).getMana(); if (mana.getBlack() > 0 && !commanderMana.isBlack()) { for (int i = 0; i < mana.getBlack(); i++) { - mana.addColorless(); + mana.increaseColorless(); } mana.setBlack(0); } if (mana.getBlue() > 0 && !commanderMana.isBlue()) { for (int i = 0; i < mana.getBlue(); i++) { - mana.addColorless(); + mana.increaseColorless(); } mana.setBlue(0); } if (mana.getGreen() > 0 && !commanderMana.isGreen()) { for (int i = 0; i < mana.getGreen(); i++) { - mana.addColorless(); + mana.increaseColorless(); } mana.setGreen(0); } if (mana.getRed() > 0 && !commanderMana.isRed()) { for (int i = 0; i < mana.getRed(); i++) { - mana.addColorless(); + mana.increaseColorless(); } mana.setRed(0); } if (mana.getWhite() > 0 && !commanderMana.isWhite()) { for (int i = 0; i < mana.getWhite(); i++) { - mana.addColorless(); + mana.increaseColorless(); } mana.setWhite(0); } diff --git a/Mage/src/mage/abilities/effects/common/continuous/CommanderReplacementEffect.java b/Mage/src/mage/abilities/effects/common/continuous/CommanderReplacementEffect.java index daa86a6abea..cc5e2c0ad7f 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/CommanderReplacementEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/CommanderReplacementEffect.java @@ -45,7 +45,6 @@ import mage.players.Player; * * @author Plopman */ - //20130711 /* * 903.11. If a commander would be put into its owner’s graveyard from anywhere, that player may put it into the command zone instead. @@ -98,18 +97,24 @@ public class CommanderReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - switch(((ZoneChangeEvent)event).getToZone()) { + switch (((ZoneChangeEvent) event).getToZone()) { case HAND: - if (!alsoHand && ((ZoneChangeEvent)event).getToZone() == Zone.HAND) { + if (!alsoHand && ((ZoneChangeEvent) event).getToZone() == Zone.HAND) { return false; } case LIBRARY: - if (!alsoLibrary && ((ZoneChangeEvent)event).getToZone() == Zone.LIBRARY) { + if (!alsoLibrary && ((ZoneChangeEvent) event).getToZone() == Zone.LIBRARY) { return false; } case GRAVEYARD: - case EXILED: - if(commanderId.equals(event.getTargetId())){ + case EXILED: + if (((ZoneChangeEvent) event).getFromZone().equals(Zone.STACK)) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && commanderId.equals(spell.getSourceId())) { + return true; + } + } + if (commanderId.equals(event.getTargetId())) { return true; } break; @@ -125,23 +130,24 @@ public class CommanderReplacementEffect extends ReplacementEffectImpl { } return false; } - + @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - if (((ZoneChangeEvent)event).getFromZone() == Zone.BATTLEFIELD) { - Permanent permanent = ((ZoneChangeEvent)event).getTarget(); + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + if (((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { + Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (permanent != null) { Player player = game.getPlayer(permanent.getOwnerId()); - if (player != null && player.chooseUse(Outcome.Benefit, "Move commander to command zone?", source, game)){ + if (player != null && player.chooseUse(Outcome.Benefit, "Move commander to command zone?", source, game)) { boolean result = permanent.moveToZone(Zone.COMMAND, source.getSourceId(), game, false); - if (!game.isSimulation()) + if (!game.isSimulation()) { game.informPlayers(player.getLogName() + " has moved his or her commander to the command zone"); + } return result; } } } else { Card card = null; - if (((ZoneChangeEvent)event).getFromZone().equals(Zone.STACK)) { + if (((ZoneChangeEvent) event).getFromZone().equals(Zone.STACK)) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null) { card = game.getCard(spell.getSourceId()); @@ -149,13 +155,14 @@ public class CommanderReplacementEffect extends ReplacementEffectImpl { } if (card == null) { card = game.getCard(event.getTargetId()); - } + } if (card != null) { Player player = game.getPlayer(card.getOwnerId()); - if (player != null && player.chooseUse(Outcome.Benefit, "Move commander to command zone?", source, game)){ + if (player != null && player.chooseUse(Outcome.Benefit, "Move commander to command zone?", source, game)) { boolean result = card.moveToZone(Zone.COMMAND, source.getSourceId(), game, false); - if (!game.isSimulation()) + if (!game.isSimulation()) { game.informPlayers(player.getLogName() + " has moved his or her commander to the command zone"); + } return result; } } diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java index 3029a00fc14..d26eaf8ab78 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java @@ -45,35 +45,36 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl { protected Ability ability; protected AttachmentType attachmentType; - protected boolean fixedTarget = false; + protected boolean independentEffect; + + public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType) { + this(ability, attachmentType, Duration.WhileOnBattlefield); + } + + public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType, Duration duration) { + this(ability, attachmentType, duration, null); + } public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType, Duration duration, String rule) { super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); this.ability = ability; this.attachmentType = attachmentType; - this.duration = duration; - if (duration == Duration.EndOfTurn) { - fixedTarget = true; + switch (duration) { + case WhileOnBattlefield: + case WhileInGraveyard: + case WhileOnStack: + independentEffect = false; + break; + default: + // such effects exist independent from the enchantment that created the effect + independentEffect = true; } - this.staticText = rule; - } - public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType, Duration duration) { - super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - this.ability = ability; - this.attachmentType = attachmentType; - this.duration = duration; - if (duration == Duration.EndOfTurn) { - fixedTarget = true; + if (rule == null) { + setText(); + } else { + this.staticText = rule; } - setText(); - } - - public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType) { - super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - this.ability = ability; - this.attachmentType = attachmentType; - setText(); } public GainAbilityAttachedEffect(final GainAbilityAttachedEffect effect) { @@ -81,7 +82,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl { this.ability = effect.ability.copy(); ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents this.attachmentType = effect.attachmentType; - this.fixedTarget = effect.fixedTarget; + this.independentEffect = effect.independentEffect; } @Override @@ -92,27 +93,31 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl { @Override public void init(Ability source, Game game) { super.init(source, game); - if (fixedTarget) { + if (affectedObjectsSet) { Permanent equipment = game.getPermanent(source.getSourceId()); if (equipment != null && equipment.getAttachedTo() != null) { - this.setTargetPointer(new FixedTarget(equipment.getAttachedTo())); + this.setTargetPointer(new FixedTarget(equipment.getAttachedTo(), game.getState().getZoneChangeCounter(equipment.getAttachedTo()))); } } } @Override public boolean apply(Game game, Ability source) { - Permanent creature = null; - if (fixedTarget) { - creature = game.getPermanent(targetPointer.getFirst(game, source)); + Permanent permanent = null; + if (affectedObjectsSet) { + permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent == null) { + discard(); + return true; + } } else { Permanent equipment = game.getPermanent(source.getSourceId()); if (equipment != null && equipment.getAttachedTo() != null) { - creature = game.getPermanent(equipment.getAttachedTo()); + permanent = game.getPermanentOrLKIBattlefield(equipment.getAttachedTo()); } } - if (creature != null) { - creature.addAbility(ability, source.getSourceId(), game, false); + if (permanent != null) { + permanent.addAbility(ability, source.getSourceId(), game, false); } return true; } diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityControllerEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityControllerEffect.java index b0c02b7f1e8..a4842f68bb1 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityControllerEffect.java @@ -61,7 +61,10 @@ public class GainAbilityControllerEffect extends ContinuousEffectImpl { public GainAbilityControllerEffect(Ability ability, Duration duration) { super(duration, Layer.PlayerEffects, SubLayer.NA, Outcome.AddAbility); this.ability = ability; - staticText = "You have " + ability.getRule() + " " + duration.toString(); + staticText = "You have " + ability.getRule(); + if (!duration.toString().isEmpty()) { + staticText += " " + duration.toString(); + } } public GainAbilityControllerEffect(final GainAbilityControllerEffect effect) { diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java index 81fc17c970c..609ad65d290 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -88,12 +88,17 @@ public class GainAbilitySourceEffect extends ContinuousEffectImpl implements Sou public GainAbilitySourceEffect copy() { return new GainAbilitySourceEffect(this); } - + @Override public void init(Ability source, Game game) { super.init(source, game); if (affectedObjectsSet) { - affectedObjectList.add(new MageObjectReference(source.getSourceId(), game)); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); + if (permanent != null) { + affectedObjectList.add(new MageObjectReference(source.getSourceId(), game.getState().getZoneChangeCounter(source.getSourceId()) + 1, game)); + } else { + affectedObjectList.add(new MageObjectReference(source.getSourceId(), game)); + } } } diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java index 097da54a5dc..8117823221a 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java @@ -170,11 +170,11 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl { sb.append(target.getTargetName()).append(" gains "); } + sb.append(ability.getRule()); if (durationPhaseStep != null) { sb.append(" until your next ").append(durationPhaseStep.toString().toLowerCase(Locale.ENGLISH)); - } - if (!duration.toString().isEmpty()) { - sb.append(ability.getRule()).append(" ").append(duration.toString()); + } else if (!duration.toString().isEmpty()) { + sb.append(" ").append(duration.toString()); } return sb.toString(); } diff --git a/Mage/src/mage/abilities/effects/common/continuous/LifeTotalCantChangeControllerEffect.java b/Mage/src/mage/abilities/effects/common/continuous/LifeTotalCantChangeControllerEffect.java index e27955e1b37..b3e1f0386aa 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/LifeTotalCantChangeControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/LifeTotalCantChangeControllerEffect.java @@ -1,39 +1,38 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common.continuous; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffectImpl; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; -import mage.abilities.Ability; -import mage.abilities.effects.ContinuousEffectImpl; import mage.game.Game; import mage.players.Player; @@ -44,7 +43,7 @@ public class LifeTotalCantChangeControllerEffect extends ContinuousEffectImpl { public LifeTotalCantChangeControllerEffect(Duration duration) { super(duration, Layer.PlayerEffects, SubLayer.NA, Outcome.Benefit); - setText(); + staticText = "Your life total can't change. (You can't gain or lose life. You can't pay any amount of life except 0.)"; } public LifeTotalCantChangeControllerEffect(final LifeTotalCantChangeControllerEffect effect) { @@ -66,8 +65,4 @@ public class LifeTotalCantChangeControllerEffect extends ContinuousEffectImpl { return true; } - private void setText() { - staticText = "Your life total can't change. (You can't gain or lose life. You can't pay any amount of life except 0.)"; - } - -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java b/Mage/src/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java new file mode 100644 index 00000000000..0ee881c3773 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java @@ -0,0 +1,57 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common.continuous; + +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class LoseAbilityAllEffect extends ContinuousEffectImpl { + + protected final FilterPermanent filter; + protected final Ability ability; + + public LoseAbilityAllEffect(FilterPermanent filter, Ability ability, Duration duration) { + super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + this.filter = filter; + this.ability = ability; + staticText = filter.getMessage() + " lose " + ability.toString() + (duration.toString().isEmpty() ? "" : " " + duration.toString()); + } + + public LoseAbilityAllEffect(final LoseAbilityAllEffect effect) { + super(effect); + this.filter = effect.filter.copy(); + this.ability = effect.ability; + } + + @Override + public LoseAbilityAllEffect copy() { + return new LoseAbilityAllEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + if (permanent != null) { + while (permanent.getAbilities().contains(ability)) { + permanent.getAbilities().remove(ability); + } + } + } + return true; + } + +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/LoseAbilitySourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/LoseAbilitySourceEffect.java index fcfafd3dca0..785420e329c 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/LoseAbilitySourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/LoseAbilitySourceEffect.java @@ -1,54 +1,54 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package mage.abilities.effects.common.continuous; - -import mage.abilities.Ability; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.game.Game; -import mage.game.permanent.Permanent; -/** - * - * @author Noahsark - */ -public class LoseAbilitySourceEffect extends ContinuousEffectImpl{ - - protected Ability ability; - - public LoseAbilitySourceEffect(Ability ability){ - this(ability, Duration.WhileOnBattlefield); - } - - public LoseAbilitySourceEffect(Ability ability, Duration duration){ - super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.LoseAbility); - this.ability = ability; - staticText = "{this} loses \"" + ability.getRule() + "\"" + duration.toString(); - } - - public LoseAbilitySourceEffect(final LoseAbilitySourceEffect effect){ - super(effect); - this.ability = effect.ability.copy(); - } - - @Override - public LoseAbilitySourceEffect copy(){ - return new LoseAbilitySourceEffect(this); - } - - @Override - public boolean apply(Game game, Ability source){ - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null){ - // 112.10 - while (permanent.getAbilities().remove(ability)) { - - } - } - return true; - } -} +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common.continuous; + +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.game.Game; +import mage.game.permanent.Permanent; +/** + * + * @author Noahsark + */ +public class LoseAbilitySourceEffect extends ContinuousEffectImpl{ + + protected Ability ability; + + public LoseAbilitySourceEffect(Ability ability){ + this(ability, Duration.WhileOnBattlefield); + } + + public LoseAbilitySourceEffect(Ability ability, Duration duration){ + super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.LoseAbility); + this.ability = ability; + staticText = "{this} loses " + ability.getRule() + " " + duration.toString(); + } + + public LoseAbilitySourceEffect(final LoseAbilitySourceEffect effect){ + super(effect); + this.ability = effect.ability.copy(); + } + + @Override + public LoseAbilitySourceEffect copy(){ + return new LoseAbilitySourceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source){ + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null){ + // 112.10 + while (permanent.getAbilities().remove(ability)) { + + } + } + return true; + } +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/LoseAllAbilitiesAllEffect.java b/Mage/src/mage/abilities/effects/common/continuous/LoseAllAbilitiesAllEffect.java index 54115e932f1..2e2020eda6c 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/LoseAllAbilitiesAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/LoseAllAbilitiesAllEffect.java @@ -1,52 +1,50 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common.continuous; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.ContinuousEffectImpl; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.effects.ContinuousEffectImpl; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.permanent.Permanent; - /** * * @author LevelX2 */ public class LoseAllAbilitiesAllEffect extends ContinuousEffectImpl { - private FilterPermanent filter; + private final FilterPermanent filter; public LoseAllAbilitiesAllEffect(FilterPermanent filter, Duration duration) { super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); @@ -65,7 +63,7 @@ public class LoseAllAbilitiesAllEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { if (permanent != null) { permanent.removeAllAbilities(source.getSourceId(), game); } diff --git a/Mage/src/mage/abilities/effects/common/continuous/LoseAllCreatureTypesTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/LoseAllCreatureTypesTargetEffect.java index fdb1d714b8a..de41de7c2b2 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/LoseAllCreatureTypesTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/LoseAllCreatureTypesTargetEffect.java @@ -30,6 +30,7 @@ package mage.abilities.effects.common.continuous; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.repository.CardRepository; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; @@ -42,30 +43,29 @@ import mage.game.permanent.Permanent; * @author emerald000 */ public class LoseAllCreatureTypesTargetEffect extends ContinuousEffectImpl { - + public LoseAllCreatureTypesTargetEffect(Duration duration) { super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Neutral); } - + public LoseAllCreatureTypesTargetEffect(final LoseAllCreatureTypesTargetEffect effect) { super(effect); } - + @Override public LoseAllCreatureTypesTargetEffect copy() { return new LoseAllCreatureTypesTargetEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null) { - permanent.getSubtype().clear(); - return true; + return permanent.getSubtype().retainAll(CardRepository.instance.getLandTypes()); } return false; } - + @Override public String getText(Mode mode) { if (staticText != null && !staticText.isEmpty()) { diff --git a/Mage/src/mage/abilities/effects/common/continuous/LoseCreatureTypeSourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/LoseCreatureTypeSourceEffect.java index 4f64c3fb862..f1f289a535a 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/LoseCreatureTypeSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/LoseCreatureTypeSourceEffect.java @@ -30,6 +30,7 @@ package mage.abilities.effects.common.continuous; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.repository.CardRepository; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -50,10 +51,11 @@ public class LoseCreatureTypeSourceEffect extends ContinuousEffectImpl implement private final int lessThan; /** - * Permanent loses the creature type as long as the dynamic value is less than the value of lessThan. - * + * Permanent loses the creature type as long as the dynamic value is less + * than the value of lessThan. + * * @param dynamicValue - * @param lessThan + * @param lessThan */ public LoseCreatureTypeSourceEffect(DynamicValue dynamicValue, int lessThan) { super(Duration.WhileOnBattlefield, Outcome.Detriment); @@ -84,7 +86,7 @@ public class LoseCreatureTypeSourceEffect extends ContinuousEffectImpl implement case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { permanent.getCardType().remove(CardType.CREATURE); - permanent.getSubtype().clear(); + permanent.getSubtype().retainAll(CardRepository.instance.getLandTypes()); if (permanent.isAttacking() || permanent.getBlocking() > 0) { permanent.removeFromCombat(game); } @@ -102,7 +104,7 @@ public class LoseCreatureTypeSourceEffect extends ContinuousEffectImpl implement } private void setText() { - StringBuilder sb = new StringBuilder("As long as your "); + StringBuilder sb = new StringBuilder("As long as "); sb.append(dynamicValue.getMessage()).append(" is less than "); sb.append(CardUtil.numberToText(lessThan)).append(", {this} isn't a creature"); staticText = sb.toString(); diff --git a/Mage/src/mage/abilities/effects/common/continuous/PlayWithTheTopCardRevealedEffect.java b/Mage/src/mage/abilities/effects/common/continuous/PlayWithTheTopCardRevealedEffect.java index e7a6b7cddc9..c7f6a8a0be7 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/PlayWithTheTopCardRevealedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/PlayWithTheTopCardRevealedEffect.java @@ -41,18 +41,18 @@ import mage.players.Player; * @author nantuko */ public class PlayWithTheTopCardRevealedEffect extends ContinuousEffectImpl { - + protected boolean allPlayers; public PlayWithTheTopCardRevealedEffect() { this(false); } - + public PlayWithTheTopCardRevealedEffect(boolean allPlayers) { super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Detriment); this.allPlayers = allPlayers; if (allPlayers) { - staticText = "Each player plays with the top card of his or her library revealed."; + staticText = "Players play with the top card of their libraries revealed."; } else { staticText = "Play with the top card of your library revealed"; @@ -89,4 +89,4 @@ public class PlayWithTheTopCardRevealedEffect extends ContinuousEffectImpl { return new PlayWithTheTopCardRevealedEffect(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/SetCardSubtypeAttachedEffect.java b/Mage/src/mage/abilities/effects/common/continuous/SetCardSubtypeAttachedEffect.java index 8dc84e142b0..6c008485293 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/SetCardSubtypeAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/SetCardSubtypeAttachedEffect.java @@ -29,10 +29,14 @@ package mage.abilities.effects.common.continuous; import java.util.ArrayList; import java.util.List; - import mage.abilities.Ability; import mage.abilities.effects.ContinuousEffectImpl; -import mage.constants.*; +import mage.cards.repository.CardRepository; +import mage.constants.AttachmentType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; import mage.game.Game; import mage.game.permanent.Permanent; @@ -48,14 +52,14 @@ public class SetCardSubtypeAttachedEffect extends ContinuousEffectImpl { super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); this.setSubtypes.add(setSubtype); this.attachmentType = attachmentType; - setText(); + setText(); } public SetCardSubtypeAttachedEffect(List setSubtypes, Duration duration, AttachmentType attachmentType) { super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); this.setSubtypes.addAll(setSubtypes); this.attachmentType = attachmentType; - setText(); + setText(); } public SetCardSubtypeAttachedEffect(final SetCardSubtypeAttachedEffect effect) { @@ -70,8 +74,8 @@ public class SetCardSubtypeAttachedEffect extends ContinuousEffectImpl { if (equipment != null && equipment.getAttachedTo() != null) { Permanent target = game.getPermanent(equipment.getAttachedTo()); if (target != null) { - target.getSubtype().clear(); - target.getSubtype().addAll(setSubtypes); + target.getSubtype().retainAll(CardRepository.instance.getLandTypes()); + target.getSubtype().addAll(setSubtypes); } } return true; @@ -91,7 +95,7 @@ public class SetCardSubtypeAttachedEffect extends ContinuousEffectImpl { } sb.append(" creature is a"); - for (String subtype: this.setSubtypes) { + for (String subtype : this.setSubtypes) { sb.append(" ").append(subtype); } staticText = sb.toString(); diff --git a/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java index add455f4b14..85333968831 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.continuous; import mage.MageObject; @@ -37,7 +36,6 @@ import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -50,13 +48,21 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl { private int toughness; public SetPowerToughnessSourceEffect(DynamicValue amount, Duration duration) { - super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); + this(amount, duration, SubLayer.CharacteristicDefining_7a); + } + + public SetPowerToughnessSourceEffect(DynamicValue amount, Duration duration, SubLayer subLayer) { + super(duration, Layer.PTChangingEffects_7, subLayer, Outcome.BoostCreature); this.amount = amount; staticText = "{this}'s power and toughness are each equal to the number of " + amount.getMessage(); } public SetPowerToughnessSourceEffect(int power, int toughness, Duration duration) { - super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature); + this(power, toughness, duration, SubLayer.CharacteristicDefining_7a); + } + + public SetPowerToughnessSourceEffect(int power, int toughness, Duration duration, SubLayer subLayer) { + super(duration, Layer.PTChangingEffects_7, subLayer, Outcome.BoostCreature); this.power = power; this.toughness = toughness; staticText = "{this}'s power and toughness is " + power + "/" + toughness + " " + duration.toString(); @@ -76,17 +82,18 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - MageObject mageObject = game.getObject(source.getSourceId()); + MageObject mageObject = game.getPermanentEntering(source.getSourceId()); if (mageObject == null) { - if (duration.equals(Duration.Custom)) { - discard(); - } - return false; - } else if (isTemporary()) { // it's somehow w - if (!(mageObject instanceof Permanent)) { - return false; + if (duration.equals(Duration.Custom) || isTemporary()) { + mageObject = game.getPermanent(source.getSourceId()); + } else { + mageObject = game.getObject(source.getSourceId()); } } + if (mageObject == null) { + discard(); + return true; + } if (amount != null) { int value = amount.calculate(game, source, this); mageObject.getPower().setValue(value); diff --git a/Mage/src/mage/abilities/effects/common/cost/SpellsCostReductionControllerEffect.java b/Mage/src/mage/abilities/effects/common/cost/SpellsCostReductionControllerEffect.java index d8149f33cb1..9fd1453f429 100644 --- a/Mage/src/mage/abilities/effects/common/cost/SpellsCostReductionControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/cost/SpellsCostReductionControllerEffect.java @@ -29,8 +29,10 @@ package mage.abilities.effects.common.cost; import java.util.LinkedHashSet; import java.util.Set; +import mage.MageObject; import mage.Mana; import mage.abilities.Ability; +import mage.abilities.ActivatedAbility; import mage.abilities.SpellAbility; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; @@ -56,17 +58,16 @@ public class SpellsCostReductionControllerEffect extends CostModificationEffectI private final boolean upTo; private ManaCosts manaCostsToReduce = null; - public SpellsCostReductionControllerEffect(FilterCard filter, ManaCosts manaCostsToReduce) { super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); this.filter = filter; this.amount = 0; this.manaCostsToReduce = manaCostsToReduce; this.upTo = false; - + StringBuilder sb = new StringBuilder(); sb.append(filter.getMessage()).append(" you cast cost "); - for (String manaSymbol :manaCostsToReduce.getSymbols()) { + for (String manaSymbol : manaCostsToReduce.getSymbols()) { sb.append(manaSymbol); } sb.append(" less to cast. This effect reduces only the amount of colored mana you pay."); @@ -81,8 +82,8 @@ public class SpellsCostReductionControllerEffect extends CostModificationEffectI super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); this.filter = filter; this.amount = amount; - this.upTo = upTo; - this.staticText = filter.getMessage() + " you cast cost " + (upTo ?"up to " :"") + "{" +amount + "} less to cast"; + this.upTo = upTo; + this.staticText = filter.getMessage() + " you cast cost " + (upTo ? "up to " : "") + "{" + amount + "} less to cast"; } protected SpellsCostReductionControllerEffect(final SpellsCostReductionControllerEffect effect) { @@ -95,29 +96,37 @@ public class SpellsCostReductionControllerEffect extends CostModificationEffectI @Override public boolean apply(Game game, Ability source, Ability abilityToModify) { - if (manaCostsToReduce != null){ + if (manaCostsToReduce != null) { CardUtil.adjustCost((SpellAbility) abilityToModify, manaCostsToReduce, false); } else { if (upTo) { Mana mana = abilityToModify.getManaCostsToPay().getMana(); int reduceMax = mana.getColorless(); - if (reduceMax > 2){ - reduceMax = 2; + if (reduceMax > amount) { + reduceMax = amount; } if (reduceMax > 0) { Player controller = game.getPlayer(abilityToModify.getControllerId()); - if (controller == null){ + if (controller == null) { return false; } - ChoiceImpl choice = new ChoiceImpl(true); - Set set = new LinkedHashSet<>(); - for(int i = 0; i <= reduceMax; i++){ - set.add(String.valueOf(i)); + int reduce = reduceMax; + if (!(abilityToModify instanceof ActivatedAbility) || !((ActivatedAbility) abilityToModify).isCheckPlayableMode()) { + ChoiceImpl choice = new ChoiceImpl(false); + Set set = new LinkedHashSet<>(); + for (int i = 0; i <= amount; i++) { + set.add(String.valueOf(i)); + } + choice.setChoices(set); + MageObject mageObject = game.getObject(abilityToModify.getSourceId()); + choice.setMessage("Reduce cost of " + (mageObject != null ? mageObject.getIdName() : filter.getMessage())); + if (controller.choose(Outcome.Benefit, choice, game)) { + reduce = Integer.parseInt(choice.getChoice()); + } else { + reduce = reduceMax; // cancel will be set to max possible reduce + } } - choice.setChoices(set); - choice.setMessage("Reduce cost of " + filter); - if(controller.choose(Outcome.Benefit, choice, game)){ - int reduce = Integer.parseInt(choice.getChoice()); + if (reduce > 0) { CardUtil.reduceCost(abilityToModify, reduce); } } @@ -134,11 +143,11 @@ public class SpellsCostReductionControllerEffect extends CostModificationEffectI if (abilityToModify.getControllerId().equals(source.getControllerId())) { Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId()); if (spell != null) { - return this.filter.match(spell, game); + return this.filter.match(spell, source.getSourceId(), source.getControllerId(), game); } else { // used at least for flashback ability because Flashback ability doesn't use stack or for getPlayables where spell is not cast yet Card sourceCard = game.getCard(abilityToModify.getSourceId()); - return sourceCard != null && this.filter.match(sourceCard, game); + return sourceCard != null && this.filter.match(sourceCard, source.getSourceId(), source.getControllerId(), game); } } } diff --git a/Mage/src/mage/abilities/effects/common/counter/AddCountersAllEffect.java b/Mage/src/mage/abilities/effects/common/counter/AddCountersAllEffect.java index a818747e8e5..709eb78698a 100644 --- a/Mage/src/mage/abilities/effects/common/counter/AddCountersAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/AddCountersAllEffect.java @@ -27,12 +27,10 @@ */ package mage.abilities.effects.common.counter; -import java.util.List; -import java.util.UUID; import mage.MageObject; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; import mage.counters.Counter; import mage.filter.FilterPermanent; import mage.game.Game; @@ -67,21 +65,16 @@ public class AddCountersAllEffect extends OneShotEffect { MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { if (counter != null) { - UUID controllerId = source.getControllerId(); - List permanents = game.getBattlefield().getAllActivePermanents(); - for (Permanent permanent : permanents) { - if (filter.match(permanent, source.getSourceId(), controllerId, game)) { - permanent.addCounters(counter.copy(), game); - if (!game.isSimulation()) - game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ") - .append(controller.getLogName()).append(" puts ") - .append(counter.getCount()).append(" ").append(counter.getName().toLowerCase()) - .append(" counter on ").append(permanent.getName()).toString()); + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + permanent.addCounters(counter.copy(), game); + if (!game.isSimulation()) { + game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " + counter.getCount() + " " + counter.getName().toLowerCase() + + " counter on " + permanent.getLogName()); } } - } + } return true; - } + } return false; } diff --git a/Mage/src/mage/abilities/effects/common/counter/AddCountersControllerEffect.java b/Mage/src/mage/abilities/effects/common/counter/AddCountersControllerEffect.java index c02550d8940..a2b0e1ae66e 100644 --- a/Mage/src/mage/abilities/effects/common/counter/AddCountersControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/AddCountersControllerEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,19 +20,17 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.counter; import java.util.UUID; - -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; import mage.counters.Counter; import mage.game.Game; import mage.game.permanent.Permanent; @@ -44,13 +42,13 @@ import mage.players.Player; public class AddCountersControllerEffect extends OneShotEffect { private Counter counter; - private boolean enchantedEquipped; + private final boolean enchantedEquipped; /** - * + * * @param counter Counter to add. Includes type and amount. - * @param enchantedEquipped If true, not source controller will get counter, - * but permanent's controller that source enchants or equippes. + * @param enchantedEquipped If true, not source controller will get counter, + * but permanent's controller that source enchants or equippes. */ public AddCountersControllerEffect(Counter counter, boolean enchantedEquipped) { super(Outcome.Benefit); diff --git a/Mage/src/mage/abilities/effects/common/counter/AddCountersSourceEffect.java b/Mage/src/mage/abilities/effects/common/counter/AddCountersSourceEffect.java index 82c14c0cdb9..a39c2b7de8b 100644 --- a/Mage/src/mage/abilities/effects/common/counter/AddCountersSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/AddCountersSourceEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,20 +20,20 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.counter; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; +import mage.constants.AbilityType; +import mage.constants.Outcome; import mage.counters.Counter; import mage.game.Game; import mage.game.permanent.Permanent; @@ -63,11 +63,12 @@ public class AddCountersSourceEffect extends OneShotEffect { } /** - * + * * @param counter * @param amount this amount will be added to the counter instances * @param informPlayers - * @param putOnCard - counters have to be put on a card instead of a permanent + * @param putOnCard - counters have to be put on a card instead of a + * permanent */ public AddCountersSourceEffect(Counter counter, DynamicValue amount, boolean informPlayers, boolean putOnCard) { super(Outcome.Benefit); @@ -106,7 +107,7 @@ public class AddCountersSourceEffect extends OneShotEffect { if (informPlayers && !game.isSimulation()) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - game.informPlayers(new StringBuilder(player.getLogName()).append(" puts ").append(newCounter.getCount()).append(" ").append(newCounter.getName().toLowerCase()).append(" counter on ").append(card.getLogName()).toString()); + game.informPlayers(player.getLogName() + " puts " + newCounter.getCount() + " " + newCounter.getName().toLowerCase() + " counter on " + card.getLogName()); } } } @@ -114,6 +115,9 @@ public class AddCountersSourceEffect extends OneShotEffect { } } else { Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent == null && source.getAbilityType().equals(AbilityType.STATIC)) { + permanent = game.getPermanentEntering(source.getSourceId()); + } if (permanent != null) { if (counter != null) { Counter newCounter = counter.copy(); @@ -129,7 +133,7 @@ public class AddCountersSourceEffect extends OneShotEffect { int amountAdded = permanent.getCounters().getCount(newCounter.getName()) - before; Player player = game.getPlayer(source.getControllerId()); if (player != null) { - game.informPlayers(player.getLogName()+" puts "+amountAdded+" "+newCounter.getName().toLowerCase()+" counter on "+permanent.getLogName()); + game.informPlayers(player.getLogName() + " puts " + amountAdded + " " + newCounter.getName().toLowerCase() + " counter on " + permanent.getLogName()); } } } @@ -165,5 +169,4 @@ public class AddCountersSourceEffect extends OneShotEffect { return new AddCountersSourceEffect(this); } - } diff --git a/Mage/src/mage/abilities/effects/common/counter/AddCountersTargetEffect.java b/Mage/src/mage/abilities/effects/common/counter/AddCountersTargetEffect.java index 25df790451c..9f421323473 100644 --- a/Mage/src/mage/abilities/effects/common/counter/AddCountersTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/AddCountersTargetEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,28 +20,26 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.counter; -import mage.constants.Outcome; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.counters.Counter; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; - import java.util.UUID; import mage.MageObject; +import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.counters.Counter; import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; import mage.util.CardUtil; /** @@ -54,7 +52,7 @@ public class AddCountersTargetEffect extends OneShotEffect { private DynamicValue amount; public AddCountersTargetEffect(Counter counter) { - this(counter, counter.getName().equals(CounterType.M1M1.getName()) ? Outcome.UnboostCreature: Outcome.Benefit); + this(counter, counter.getName().equals(CounterType.M1M1.getName()) ? Outcome.UnboostCreature : Outcome.Benefit); } public AddCountersTargetEffect(Counter counter, DynamicValue amount) { @@ -94,10 +92,10 @@ public class AddCountersTargetEffect extends OneShotEffect { int before = permanent.getCounters().getCount(counter.getName()); permanent.addCounters(newCounter, game); int numberAdded = permanent.getCounters().getCount(counter.getName()) - before; - affectedTargets ++; + affectedTargets++; if (!game.isSimulation()) { - game.informPlayers(sourceObject.getLogName() +": "+ controller.getLogName()+ " puts " + - numberAdded + " " + counter.getName().toLowerCase() + " counter on " + permanent.getLogName()); + game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " + + numberAdded + " " + counter.getName().toLowerCase() + " counter on " + permanent.getLogName()); } } } else { @@ -106,14 +104,14 @@ public class AddCountersTargetEffect extends OneShotEffect { Counter newCounter = counter.copy(); newCounter.add(amount.calculate(game, source, this)); player.addCounters(newCounter, game); - affectedTargets ++; + affectedTargets++; if (!game.isSimulation()) { - game.informPlayers(sourceObject.getLogName() +": " + controller.getLogName() + " puts " + - counter.getCount() + " " + counter.getName().toLowerCase() + " counter on " + player.getLogName()); - } + game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " puts " + + counter.getCount() + " " + counter.getName().toLowerCase() + " counter on " + player.getLogName()); + } } } - } + } return affectedTargets > 0; } return false; @@ -131,8 +129,11 @@ public class AddCountersTargetEffect extends OneShotEffect { } else { sb.append("a "); } - sb.append(counter.getName().toLowerCase()).append(" counter on "); - + sb.append(counter.getName().toLowerCase()).append(" counter"); + if (counter.getCount() > 1) { + sb.append("s"); + } + sb.append(" on "); // TODO: add normal text infrastructure for target pointers if (mode.getTargets().size() > 0) { @@ -155,5 +156,4 @@ public class AddCountersTargetEffect extends OneShotEffect { return new AddCountersTargetEffect(this); } - } diff --git a/Mage/src/mage/abilities/effects/common/counter/AddPoisonCounterTargetEffect.java b/Mage/src/mage/abilities/effects/common/counter/AddPoisonCounterTargetEffect.java index c8a68acd925..420d8dc4490 100644 --- a/Mage/src/mage/abilities/effects/common/counter/AddPoisonCounterTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/AddPoisonCounterTargetEffect.java @@ -74,6 +74,9 @@ public class AddPoisonCounterTargetEffect extends OneShotEffect { @Override public String getText(Mode mode) { + if(staticText != null && !staticText.isEmpty()) { + return staticText; + } return "Target " + mode.getTargets().get(0).getTargetName() + " gets " + Integer.toString(amount) + " poison counter(s)."; } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java b/Mage/src/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java index 6da3bf9cf00..b76c5771bc9 100644 --- a/Mage/src/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.counter; import mage.abilities.Ability; @@ -40,8 +39,8 @@ import mage.game.permanent.Permanent; * * @author Loki */ - public class RemoveCounterSourceEffect extends OneShotEffect { + private final Counter counter; public RemoveCounterSourceEffect(Counter counter) { @@ -57,25 +56,24 @@ public class RemoveCounterSourceEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent p = game.getPermanent(source.getSourceId()); - if (p != null && p.getCounters().getCount(counter.getName()) >= counter.getCount()) { - p.removeCounters(counter.getName(), counter.getCount(), game); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null && permanent.getCounters().getCount(counter.getName()) >= counter.getCount()) { + permanent.removeCounters(counter.getName(), counter.getCount(), game); if (!game.isSimulation()) { - game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(" ").append(counter.getName()) - .append(" counter from ").append(p.getName()).toString()); + game.informPlayers("Removed " + counter.getCount() + " " + counter.getName() + " counter from " + permanent.getLogName()); } return true; } - Card c = game.getCard(source.getSourceId()); - if (c != null && c.getCounters(game).getCount(counter.getName()) >= counter.getCount()) { - c.removeCounters(counter.getName(), counter.getCount(), game); + Card card = game.getCard(source.getSourceId()); + if (card != null && card.getCounters(game).getCount(counter.getName()) >= counter.getCount()) { + card.removeCounters(counter.getName(), counter.getCount(), game); if (!game.isSimulation()) { - game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(" ").append(counter.getName()) - .append(" counter from ").append(c.getName()) - .append(" (").append(c.getCounters(game).getCount(counter.getName())).append(" left)").toString()); + game.informPlayers("Removed " + counter.getCount() + " " + counter.getName() + + " counter from " + card.getLogName() + + " (" + card.getCounters(game).getCount(counter.getName()) + " left)"); } return true; - } + } return false; } @@ -84,7 +82,7 @@ public class RemoveCounterSourceEffect extends OneShotEffect { return new RemoveCounterSourceEffect(this); } - private void setText() { + private void setText() { if (counter.getCount() > 1) { StringBuilder sb = new StringBuilder(); sb.append("remove ").append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters from {this}"); diff --git a/Mage/src/mage/abilities/effects/common/counter/RemoveCounterTargetEffect.java b/Mage/src/mage/abilities/effects/common/counter/RemoveCounterTargetEffect.java index 5b651f6662d..9f636d65b52 100644 --- a/Mage/src/mage/abilities/effects/common/counter/RemoveCounterTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/RemoveCounterTargetEffect.java @@ -28,14 +28,19 @@ package mage.abilities.effects.common.counter; +import java.util.HashSet; +import java.util.Set; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; import mage.constants.Outcome; import mage.counters.Counter; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.players.Player; import mage.util.CardUtil; /** @@ -46,6 +51,11 @@ import mage.util.CardUtil; public class RemoveCounterTargetEffect extends OneShotEffect { private final Counter counter; + public RemoveCounterTargetEffect() { + super(Outcome.UnboostCreature); + counter = null; + } + public RemoveCounterTargetEffect(Counter counter) { super(Outcome.UnboostCreature); this.counter = counter; @@ -53,21 +63,24 @@ public class RemoveCounterTargetEffect extends OneShotEffect { public RemoveCounterTargetEffect(RemoveCounterTargetEffect effect) { super(effect); - this.counter = effect.counter.copy(); + this.counter = effect.counter == null ? null : effect.counter.copy(); } @Override public boolean apply(Game game, Ability source) { Permanent p = game.getPermanent(targetPointer.getFirst(game, source)); - if (p != null && p.getCounters().getCount(counter.getName()) >= counter.getCount()) { - p.removeCounters(counter.getName(), counter.getCount(), game); - if (!game.isSimulation()) - game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(" ").append(counter.getName()) - .append(" counter from ").append(p.getName()).toString()); - return true; + if(p != null) { + Counter toRemove = (counter == null ? selectCounterType(game, source, p) : counter); + if(toRemove != null && p.getCounters().getCount(toRemove.getName()) >= toRemove.getCount()) { + p.removeCounters(toRemove.getName(), toRemove.getCount(), game); + if(!game.isSimulation()) + game.informPlayers("Removed " + toRemove.getCount() + " " + toRemove.getName() + + " counter from " + p.getName()); + return true; + } } Card c = game.getCard(targetPointer.getFirst(game, source)); - if (c != null && c.getCounters(game).getCount(counter.getName()) >= counter.getCount()) { + if (c != null && counter != null && c.getCounters(game).getCount(counter.getName()) >= counter.getCount()) { c.removeCounters(counter.getName(), counter.getCount(), game); if (!game.isSimulation()) game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(" ").append(counter.getName()) @@ -78,21 +91,54 @@ public class RemoveCounterTargetEffect extends OneShotEffect { return false; } + private Counter selectCounterType(Game game, Ability source, Permanent permanent) { + Player controller = game.getPlayer(source.getControllerId()); + if(controller != null && permanent.getCounters().size() > 0) { + String counterName = null; + if(permanent.getCounters().size() > 1) { + Choice choice = new ChoiceImpl(true); + Set choices = new HashSet<>(); + for(Counter counter : permanent.getCounters().values()) { + if (permanent.getCounters().getCount(counter.getName()) > 0) { + choices.add(counter.getName()); + } + } + choice.setChoices(choices); + choice.setMessage("Choose a counter type to remove from " + permanent.getName()); + controller.choose(Outcome.Detriment, choice, game); + counterName = choice.getChoice(); + } else { + for(Counter counter : permanent.getCounters().values()) { + if(counter.getCount() > 0) { + counterName = counter.getName(); + } + } + } + return new Counter(counterName); + } + return null; + } + @Override public RemoveCounterTargetEffect copy() { return new RemoveCounterTargetEffect(this); } @Override - public String getText(Mode mode) { - if (staticText != null && !staticText.isEmpty()) { - return staticText; - } - StringBuilder sb = new StringBuilder("remove "); - sb.append(CardUtil.numberToText(counter.getCount(), "a")); - sb.append(" ").append(counter.getName()); - sb.append(counter.getCount() > 1 ?" counters from ":" counter from "); - sb.append(mode.getTargets().get(0).getTargetName()); - return sb.toString(); + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + + String text = "remove "; + if(counter == null) { + text += "a counter"; + } + else { + text += CardUtil.numberToText(counter.getCount(), "a") + " " + counter.getName(); + text += counter.getCount() > 1 ? " counters" : " counter"; + } + text += " from target " + mode.getTargets().get(0).getTargetName(); + return text; } } diff --git a/Mage/src/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetEffect.java b/Mage/src/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetEffect.java index d77f5ca6a46..4ab5210339c 100644 --- a/Mage/src/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/discard/DiscardCardYouChooseTargetEffect.java @@ -221,7 +221,7 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect { sb.append(" of them."); } - sb.append(" That player discards ").append(discardMultipleCards ? "those cards" : "that card").toString(); + sb.append(" That player discards ").append(discardMultipleCards ? "those cards" : "that card"); return sb.toString(); } } diff --git a/Mage/src/mage/abilities/effects/common/replacement/DealtDamageToCreatureBySourceDies.java b/Mage/src/mage/abilities/effects/common/replacement/DealtDamageToCreatureBySourceDies.java index 7132048114b..ddb8825748e 100644 --- a/Mage/src/mage/abilities/effects/common/replacement/DealtDamageToCreatureBySourceDies.java +++ b/Mage/src/mage/abilities/effects/common/replacement/DealtDamageToCreatureBySourceDies.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.replacement; import mage.abilities.Ability; @@ -47,11 +46,10 @@ import mage.watchers.common.DamagedByWatcher; * * @author LevelX2 */ - public class DealtDamageToCreatureBySourceDies extends ReplacementEffectImpl { public DealtDamageToCreatureBySourceDies(Card card, Duration duration) { - super(Duration.WhileOnBattlefield, Outcome.Exile); + super(duration, Outcome.Exile); if (card.getCardType().contains(CardType.CREATURE)) { staticText = "If a creature dealt damage by {this} this turn would die, exile it instead"; } else { @@ -75,7 +73,7 @@ public class DealtDamageToCreatureBySourceDies extends ReplacementEffectImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent permanent = ((ZoneChangeEvent)event).getTarget(); + Permanent permanent = ((ZoneChangeEvent) event).getTarget(); Player controller = game.getPlayer(source.getControllerId()); if (controller != null && permanent != null) { return controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true); @@ -90,7 +88,7 @@ public class DealtDamageToCreatureBySourceDies extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - ZoneChangeEvent zce = (ZoneChangeEvent) event; + ZoneChangeEvent zce = (ZoneChangeEvent) event; if (zce.isDiesEvent()) { DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); if (watcher != null) { diff --git a/Mage/src/mage/abilities/effects/common/ruleModifying/CastOnlyIfYouHaveCastAnotherSpellEffect.java b/Mage/src/mage/abilities/effects/common/ruleModifying/CastOnlyIfYouHaveCastAnotherSpellEffect.java new file mode 100644 index 00000000000..072e2360ef3 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/ruleModifying/CastOnlyIfYouHaveCastAnotherSpellEffect.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.abilities.effects.common.ruleModifying; + +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.watchers.common.CastSpellLastTurnWatcher; + +/** + * + * @author LoneFox + */ + +public class CastOnlyIfYouHaveCastAnotherSpellEffect extends ContinuousRuleModifyingEffectImpl { + public CastOnlyIfYouHaveCastAnotherSpellEffect() { + super(Duration.EndOfGame, Outcome.Detriment); + staticText = "Cast {this} only if you've cast another spell this turn"; + } + + public CastOnlyIfYouHaveCastAnotherSpellEffect(final CastOnlyIfYouHaveCastAnotherSpellEffect effect) { + super(effect); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.CAST_SPELL; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getSourceId().equals(source.getSourceId())) { + CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher"); + if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(source.getControllerId()) == 0) { + return true; + } + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public CastOnlyIfYouHaveCastAnotherSpellEffect copy() { + return new CastOnlyIfYouHaveCastAnotherSpellEffect(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInHandEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInHandEffect.java index 694e8bf70eb..f47985c9ada 100644 --- a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInHandEffect.java +++ b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInHandEffect.java @@ -122,9 +122,9 @@ public class SearchLibraryPutInHandEffect extends SearchEffect { sb.append(rulePrefix); if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { sb.append("up to ").append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" "); - sb.append(target.getTargetName()).append(revealCards ? ", reveal them, " : "").append(" and put them into your hand"); + sb.append(target.getTargetName()).append(revealCards ? ", reveal them," : "").append(" and put them into your hand"); } else { - sb.append("a ").append(target.getTargetName()).append(revealCards ? ", reveal it, " : "").append(" and put that card into your hand"); + sb.append("a ").append(target.getTargetName()).append(revealCards ? ", reveal it," : "").append(" and put that card into your hand"); } if (forceShuffle) { sb.append(". Then shuffle your library"); diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java index 6776adcc8ea..de9c442f289 100644 --- a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java +++ b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java @@ -1,38 +1,37 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common.search; import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.SearchEffect; -import mage.cards.Card; +import mage.cards.CardsImpl; import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; @@ -90,12 +89,8 @@ public class SearchLibraryPutInPlayEffect extends SearchEffect { } if (player.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { - for (UUID cardId: target.getTargets()) { - Card card = player.getLibrary().getCard(cardId, game); - if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), tapped); - } - } + player.moveCards(new CardsImpl(target.getTargets()).getCards(game), + Zone.BATTLEFIELD, source, game, tapped, false, false, null); } player.shuffleLibrary(game); return true; @@ -110,15 +105,13 @@ public class SearchLibraryPutInPlayEffect extends SearchEffect { StringBuilder sb = new StringBuilder(); sb.append("search your library for "); if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { - if ( target.getMaxNumberOfTargets() == Integer.MAX_VALUE ) { + if (target.getMaxNumberOfTargets() == Integer.MAX_VALUE) { sb.append("any number of ").append(" "); - } - else { + } else { sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" "); } sb.append(target.getTargetName()).append(" and put them onto the battlefield"); - } - else { + } else { sb.append("a ").append(target.getTargetName()).append(" and put it onto the battlefield"); } if (tapped) { @@ -126,8 +119,7 @@ public class SearchLibraryPutInPlayEffect extends SearchEffect { } if (forceShuffle) { sb.append(". Then shuffle your library"); - } - else { + } else { sb.append(". If you do, shuffle your library"); } staticText = sb.toString(); diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java index 74cf05fbe9f..8c68601cb38 100644 --- a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java +++ b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java @@ -9,7 +9,7 @@ import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.SearchEffect; -import mage.cards.Card; +import mage.cards.CardsImpl; import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; @@ -20,11 +20,11 @@ import mage.target.common.TargetCardInLibrary; * * @author LevelX2 */ - public class SearchLibraryPutInPlayTargetPlayerEffect extends SearchEffect { protected boolean tapped; protected boolean forceShuffle; + protected boolean ownerIsController; public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target) { this(target, false, true, Outcome.PutCardInPlay); @@ -43,9 +43,14 @@ public class SearchLibraryPutInPlayTargetPlayerEffect extends SearchEffect { } public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, Outcome outcome) { + this(target, tapped, forceShuffle, outcome, false); + } + + public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, Outcome outcome, boolean ownerIsController) { super(target, outcome); this.tapped = tapped; this.forceShuffle = forceShuffle; + this.ownerIsController = ownerIsController; setText(); } @@ -53,6 +58,7 @@ public class SearchLibraryPutInPlayTargetPlayerEffect extends SearchEffect { super(effect); this.tapped = effect.tapped; this.forceShuffle = effect.forceShuffle; + this.ownerIsController = effect.ownerIsController; } @Override @@ -62,26 +68,22 @@ public class SearchLibraryPutInPlayTargetPlayerEffect extends SearchEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); + Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); if (player != null) { if (player.searchLibrary(target, game)) { if (target.getTargets().size() > 0) { - for (UUID cardId: target.getTargets()) { - Card card = player.getLibrary().getCard(cardId, game); - if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), tapped); - } - } + player.moveCards(new CardsImpl(target.getTargets()).getCards(game), + Zone.BATTLEFIELD, source, game, tapped, false, ownerIsController, null); } player.shuffleLibrary(game); return true; } - + if (forceShuffle) { player.shuffleLibrary(game); } } - + return false; } @@ -89,15 +91,13 @@ public class SearchLibraryPutInPlayTargetPlayerEffect extends SearchEffect { StringBuilder sb = new StringBuilder(); sb.append("target player searches his or her library for "); if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { - if ( target.getMaxNumberOfTargets() == Integer.MAX_VALUE ) { + if (target.getMaxNumberOfTargets() == Integer.MAX_VALUE) { sb.append("any number of ").append(" "); - } - else { + } else { sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" "); } sb.append(target.getTargetName()).append(" and put them onto the battlefield"); - } - else { + } else { sb.append("a ").append(target.getTargetName()).append(" and put it onto the battlefield"); } if (tapped) { @@ -105,8 +105,7 @@ public class SearchLibraryPutInPlayTargetPlayerEffect extends SearchEffect { } if (forceShuffle) { sb.append(". Then that player shuffles his or her library"); - } - else { + } else { sb.append(". If that player does, he or she shuffles his or her library"); } staticText = sb.toString(); diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutOnLibraryEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutOnLibraryEffect.java index 65e05e65846..124b173a5af 100644 --- a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutOnLibraryEffect.java +++ b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutOnLibraryEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,25 +20,19 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.common.search; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; import mage.MageObject; -import mage.constants.Outcome; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.effects.SearchEffect; -import mage.cards.Card; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.Outcome; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; @@ -48,7 +42,7 @@ import mage.target.common.TargetCardInLibrary; * @author BetaSteward_at_googlemail.com */ public class SearchLibraryPutOnLibraryEffect extends SearchEffect { - + private boolean reveal; private boolean forceShuffle; @@ -56,7 +50,7 @@ public class SearchLibraryPutOnLibraryEffect extends SearchEffect { this(target, false, true); setText(); } - + public SearchLibraryPutOnLibraryEffect(TargetCardInLibrary target, boolean reveal, boolean forceShuffle) { super(target, Outcome.DrawCard); this.reveal = reveal; @@ -83,27 +77,14 @@ public class SearchLibraryPutOnLibraryEffect extends SearchEffect { return false; } if (controller.searchLibrary(target, game)) { - List cards = new ArrayList<>(); - for (UUID cardId: target.getTargets()) { - Card card = controller.getLibrary().remove(cardId, game); - if (card != null) { - cards.add(card); - } - } - Cards foundCards = new CardsImpl(); - foundCards.addAll(target.getTargets()); - if (reveal) { + Cards foundCards = new CardsImpl(target.getTargets()); + if (reveal && !foundCards.isEmpty()) { controller.revealCards(sourceObject.getIdName(), foundCards, game); } if (forceShuffle) { controller.shuffleLibrary(game); } - if (cards.size() > 0 && !game.isSimulation()) { - game.informPlayers(controller.getLogName() + " moves " + cards.size() + " card" + (cards.size() == 1 ? " ":"s ") + "on top of his or her library"); - } - for (Card card: cards) { - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } + controller.putCardsOnTopOfLibrary(foundCards, game, source, reveal); return true; } // shuffle @@ -115,7 +96,7 @@ public class SearchLibraryPutOnLibraryEffect extends SearchEffect { private void setText() { StringBuilder sb = new StringBuilder(); - sb.append("Search your library for a ").append(target.getTargetName()); + sb.append("search your library for a ").append(target.getTargetName()); if (reveal) { sb.append(" and reveal that card. Shuffle"); } else { diff --git a/Mage/src/mage/abilities/effects/common/search/SearchTargetGraveyardHandLibraryForCardNameAndExileEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchTargetGraveyardHandLibraryForCardNameAndExileEffect.java index dd9c3c94e60..26a88824f6c 100644 --- a/Mage/src/mage/abilities/effects/common/search/SearchTargetGraveyardHandLibraryForCardNameAndExileEffect.java +++ b/Mage/src/mage/abilities/effects/common/search/SearchTargetGraveyardHandLibraryForCardNameAndExileEffect.java @@ -27,12 +27,10 @@ */ package mage.abilities.effects.common.search; -import java.util.List; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.constants.Outcome; @@ -98,14 +96,7 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect filter.setMessage("card named " + cardName + " in the graveyard of " + targetPlayer.getLogName()); TargetCard target = new TargetCard((graveyardExileOptional ? 0 : cardsCount), cardsCount, Zone.GRAVEYARD, filter); if (controller.choose(Outcome.Exile, targetPlayer.getGraveyard(), target, game)) { - List targets = target.getTargets(); - for (UUID targetId : targets) { - Card targetCard = targetPlayer.getGraveyard().get(targetId, game); - if (targetCard != null) { - targetPlayer.getGraveyard().remove(targetCard); - controller.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.GRAVEYARD, true); - } - } + controller.moveCards(new CardsImpl(target.getTargets()), Zone.EXILED, source, game); } } @@ -114,14 +105,7 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect filter.setMessage("card named " + cardName + " in the hand of " + targetPlayer.getLogName()); TargetCard target = new TargetCard(0, cardsCount, Zone.HAND, filter); if (controller.choose(Outcome.Exile, targetPlayer.getHand(), target, game)) { - List targets = target.getTargets(); - for (UUID targetId : targets) { - Card targetCard = targetPlayer.getHand().get(targetId, game); - if (targetCard != null) { - targetPlayer.getHand().remove(targetCard); - controller.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.HAND, true); - } - } + controller.moveCards(new CardsImpl(target.getTargets()), Zone.EXILED, source, game); } // cards in Library @@ -131,15 +115,8 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect filter.setMessage("card named " + cardName + " in the library of " + targetPlayer.getLogName()); TargetCardInLibrary targetLib = new TargetCardInLibrary(0, cardsCount, filter); if (controller.choose(Outcome.Exile, cardsInLibrary, targetLib, game)) { - List targets = targetLib.getTargets(); - for (UUID targetId : targets) { - Card targetCard = targetPlayer.getLibrary().remove(targetId, game); - if (targetCard != null) { - controller.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.LIBRARY, true); - } - } + controller.moveCards(new CardsImpl(targetLib.getTargets()), Zone.EXILED, source, game); } - targetPlayer.shuffleLibrary(game); } diff --git a/Mage/src/mage/abilities/effects/common/turn/AddExtraTurnControllerEffect.java b/Mage/src/mage/abilities/effects/common/turn/AddExtraTurnControllerEffect.java index a1fcdcf0bf7..82ada6f9893 100644 --- a/Mage/src/mage/abilities/effects/common/turn/AddExtraTurnControllerEffect.java +++ b/Mage/src/mage/abilities/effects/common/turn/AddExtraTurnControllerEffect.java @@ -1,36 +1,42 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common.turn; +import java.util.UUID; import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.LoseGameSourceControllerEffect; +import mage.constants.Duration; import mage.constants.Outcome; import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.turn.TurnMod; import mage.players.Player; @@ -39,13 +45,24 @@ import mage.players.Player; */ public class AddExtraTurnControllerEffect extends OneShotEffect { + private final boolean loseGameAtEnd; + public AddExtraTurnControllerEffect() { - super(Outcome.ExtraTurn); - staticText = "Take an extra turn after this one"; + this(false); + } + + public AddExtraTurnControllerEffect(boolean loseGameAtEnd) { + super(loseGameAtEnd ? Outcome.AIDontUseIt : Outcome.ExtraTurn); + this.loseGameAtEnd = loseGameAtEnd; + staticText = "take an extra turn after this one"; + if (loseGameAtEnd) { + staticText += ". At the beginning of that turn's end step, you lose the game"; + } } public AddExtraTurnControllerEffect(final AddExtraTurnControllerEffect effect) { super(effect); + this.loseGameAtEnd = effect.loseGameAtEnd; } @Override @@ -57,9 +74,55 @@ public class AddExtraTurnControllerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - game.getState().getTurnMods().add(new TurnMod(player.getId(), false)); + TurnMod extraTurn = new TurnMod(player.getId(), false); + game.getState().getTurnMods().add(extraTurn); + if (loseGameAtEnd) { + LoseGameDelayedTriggeredAbility delayedTriggeredAbility = new LoseGameDelayedTriggeredAbility(); + delayedTriggeredAbility.setSourceId(source.getSourceId()); + delayedTriggeredAbility.setControllerId(source.getControllerId()); + delayedTriggeredAbility.setConnectedTurnMod(extraTurn.getId()); + game.addDelayedTriggeredAbility(delayedTriggeredAbility); + } } return true; } -} \ No newline at end of file +} + +class LoseGameDelayedTriggeredAbility extends DelayedTriggeredAbility { + + private UUID connectedTurnMod; + + public LoseGameDelayedTriggeredAbility() { + super(new LoseGameSourceControllerEffect(), Duration.EndOfGame); + } + + public LoseGameDelayedTriggeredAbility(final LoseGameDelayedTriggeredAbility ability) { + super(ability); + this.connectedTurnMod = ability.connectedTurnMod; + } + + @Override + public LoseGameDelayedTriggeredAbility copy() { + return new LoseGameDelayedTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return connectedTurnMod != null && connectedTurnMod.equals(game.getState().getTurnId()); + } + + public void setConnectedTurnMod(UUID connectedTurnMod) { + this.connectedTurnMod = connectedTurnMod; + } + + @Override + public String getRule() { + return "At the beginning of that turn's end step, you lose the game"; + } +} diff --git a/Mage/src/mage/abilities/effects/keyword/ManifestEffect.java b/Mage/src/mage/abilities/effects/keyword/ManifestEffect.java index 71e6293628d..0640fc8ed85 100644 --- a/Mage/src/mage/abilities/effects/keyword/ManifestEffect.java +++ b/Mage/src/mage/abilities/effects/keyword/ManifestEffect.java @@ -86,13 +86,15 @@ public class ManifestEffect extends OneShotEffect { } MageObjectReference objectReference = new MageObjectReference(card.getId(), card.getZoneChangeCounter(game) + 1, game); game.addEffect(new BecomesFaceDownCreatureEffect(manaCosts, objectReference, Duration.Custom, FaceDownType.MANIFESTED), newSource); - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, newSource.getSourceId(), false, true); + + } + controller.moveCards(cards, Zone.BATTLEFIELD, source, game, false, true, false, null); + for (Card card : cards) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { permanent.setManifested(true); } } - game.applyEffects(); // to apply before ETB triggered or replace Effects are executed return true; } return false; diff --git a/Mage/src/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java b/Mage/src/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java index 897ff83f235..2e904878769 100644 --- a/Mage/src/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java +++ b/Mage/src/mage/abilities/effects/keyword/ManifestTargetPlayerEffect.java @@ -89,7 +89,9 @@ public class ManifestTargetPlayerEffect extends OneShotEffect { } MageObjectReference objectReference = new MageObjectReference(card.getId(), card.getZoneChangeCounter(game) + 1, game); game.addEffect(new BecomesFaceDownCreatureEffect(manaCosts, objectReference, Duration.Custom, FaceDownType.MANIFESTED), newSource); - targetPlayer.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, newSource.getSourceId(), false, true); + } + targetPlayer.moveCards(cards, Zone.BATTLEFIELD, source, game, false, true, false, null); + for (Card card : cards) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { permanent.setManifested(true); diff --git a/Mage/src/mage/abilities/effects/keyword/ScryEffect.java b/Mage/src/mage/abilities/effects/keyword/ScryEffect.java index 0fc7e4ad760..ab35b3dfdd0 100644 --- a/Mage/src/mage/abilities/effects/keyword/ScryEffect.java +++ b/Mage/src/mage/abilities/effects/keyword/ScryEffect.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,26 +20,19 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects.keyword; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; -import mage.cards.Cards; -import mage.cards.CardsImpl; import mage.constants.Outcome; -import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; -import mage.game.events.GameEvent; import mage.players.Player; -import mage.target.TargetCard; import mage.util.CardUtil; /** @@ -67,33 +60,7 @@ public class ScryEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - boolean revealed = player.isTopCardRevealed(); // by looking at the cards with scry you have not to reveal the next card - player.setTopCardRevealed(false); - Cards cards = new CardsImpl(); - int count = Math.min(scryNumber, player.getLibrary().size()); - if (count == 0) { - return true; - } - for (int i = 0; i < count; i++) { - Card card = player.getLibrary().removeFromTop(game); - cards.add(card); - } - TargetCard target1 = new TargetCard(Zone.LIBRARY, filter1); - target1.setRequired(false); - // move cards to the bottom of the library - while (player.canRespond() && cards.size() > 0 && player.choose(Outcome.Detriment, cards, target1, game)) { - Card card = cards.get(target1.getFirstTarget(), game); - if (card != null) { - cards.remove(card); - player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, false, false); - } - target1.clearChosen(); - } - // move cards to the top of the library - player.putCardsOnTopOfLibrary(cards, game, source, true); - game.fireEvent(new GameEvent(GameEvent.EventType.SCRY, source.getControllerId(), source.getSourceId(), source.getControllerId())); - player.setTopCardRevealed(revealed); - return true; + return player.scry(scryNumber, source, game); } return false; } @@ -104,7 +71,7 @@ public class ScryEffect extends OneShotEffect { } private void setText() { - StringBuilder sb = new StringBuilder("Scry ").append(scryNumber); + StringBuilder sb = new StringBuilder("scry ").append(scryNumber); if (scryNumber == 1) { sb.append(". (Look at the top card of your library. You may put that card on the bottom of your library.)"); } else { diff --git a/Mage/src/mage/abilities/keyword/AmplifyAbility.java b/Mage/src/mage/abilities/keyword/AmplifyAbility.java index 22a427c8402..a9cc43d60fc 100644 --- a/Mage/src/mage/abilities/keyword/AmplifyAbility.java +++ b/Mage/src/mage/abilities/keyword/AmplifyAbility.java @@ -39,13 +39,13 @@ import mage.constants.Zone; public class AmplifyAbility extends SimpleStaticAbility { public AmplifyAbility(AmplifyFactor amplifyFactor) { - super(Zone.BATTLEFIELD, new AmplifyEffect(amplifyFactor)); + super(Zone.ALL, new AmplifyEffect(amplifyFactor)); } - + public AmplifyAbility(final AmplifyAbility ability) { super(ability); } - + @Override public AmplifyAbility copy() { return new AmplifyAbility(this); diff --git a/Mage/src/mage/abilities/keyword/AuraSwapAbility.java b/Mage/src/mage/abilities/keyword/AuraSwapAbility.java index ea4ddd1a6aa..385703b6691 100644 --- a/Mage/src/mage/abilities/keyword/AuraSwapAbility.java +++ b/Mage/src/mage/abilities/keyword/AuraSwapAbility.java @@ -104,9 +104,9 @@ class AuraSwapEffect extends OneShotEffect { if (controller.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) { Card auraInHand = game.getCard(target.getFirstTarget()); if (auraInHand != null) { - controller.putOntoBattlefieldWithInfo(auraInHand, game, Zone.HAND, source.getSourceId()); + controller.moveCards(auraInHand, Zone.BATTLEFIELD, source, game); enchantedPermanent.addAttachment(auraInHand.getId(), game); - controller.moveCards(auraPermanent, null, Zone.HAND, source, game); + controller.moveCards(auraPermanent, Zone.HAND, source, game); return true; } } diff --git a/Mage/src/mage/abilities/keyword/AwakenAbility.java b/Mage/src/mage/abilities/keyword/AwakenAbility.java new file mode 100644 index 00000000000..0fbd77b142c --- /dev/null +++ b/Mage/src/mage/abilities/keyword/AwakenAbility.java @@ -0,0 +1,155 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.keyword; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.Card; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SpellAbilityType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledLandPermanent; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.target.Target; +import mage.target.common.TargetControlledPermanent; +import mage.target.targetpointer.FixedTarget; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class AwakenAbility extends SpellAbility { + + static private String filterMessage = "a land you control to awake"; + + private String rule; + private int awakenValue; + + public AwakenAbility(Card card, int awakenValue, String awakenCosts) { + super(new ManaCostsImpl<>(awakenCosts), card.getName() + " with awaken", Zone.HAND, SpellAbilityType.BASE_ALTERNATE); + this.getCosts().addAll(card.getSpellAbility().getCosts().copy()); + this.getEffects().addAll(card.getSpellAbility().getEffects().copy()); + this.getTargets().addAll(card.getSpellAbility().getTargets().copy()); + this.getChoices().addAll(card.getSpellAbility().getChoices().copy()); + this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; + this.timing = card.getSpellAbility().getTiming(); + this.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent(filterMessage))); + this.addEffect(new AwakenEffect()); + this.awakenValue = awakenValue; + rule = "Awaken " + awakenValue + "—" + awakenCosts + + " (If you cast this spell for " + awakenCosts + ", also put " + + CardUtil.numberToText(awakenValue, "a") + + " +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)"; + + } + + public AwakenAbility(final AwakenAbility ability) { + super(ability); + this.awakenValue = ability.awakenValue; + } + + @Override + public AwakenAbility copy() { + return new AwakenAbility(this); + } + + @Override + public String getRule(boolean all) { + return getRule(); + } + + @Override + public String getRule() { + return rule; + } + + class AwakenEffect extends OneShotEffect { + + private AwakenEffect() { + super(Outcome.BoostCreature); + this.staticText = "put " + CardUtil.numberToText(awakenValue, "a") + " +1/+1 counters on target land you control"; + } + + public AwakenEffect(final AwakenEffect effect) { + super(effect); + } + + @Override + public AwakenEffect copy() { + return new AwakenEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID targetId = null; + for (Target target : source.getTargets()) { + if (target.getFilter().getMessage().equals(filterMessage)) { + targetId = target.getFirstTarget(); + } + } + if (targetId != null) { + FixedTarget fixedTarget = new FixedTarget(targetId); + ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new AwakenElementalToken(), false, true, Duration.Custom); + continuousEffect.setTargetPointer(fixedTarget); + game.addEffect(continuousEffect, source); + Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(awakenValue)); + effect.setTargetPointer(fixedTarget); + return effect.apply(game, source); + } + return true; + } + } + +} + +class AwakenElementalToken extends Token { + + public AwakenElementalToken() { + super("", "0/0 Elemental creature with haste"); + this.cardType.add(CardType.CREATURE); + + this.subtype.add("Elemental"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + this.addAbility(HasteAbility.getInstance()); + } +} diff --git a/Mage/src/mage/abilities/keyword/BestowAbility.java b/Mage/src/mage/abilities/keyword/BestowAbility.java index dd79c1c121f..93307330d3b 100644 --- a/Mage/src/mage/abilities/keyword/BestowAbility.java +++ b/Mage/src/mage/abilities/keyword/BestowAbility.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.abilities.Ability; @@ -36,7 +35,9 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.SourceEffect; import mage.cards.Card; +import mage.cards.repository.CardRepository; import mage.constants.CardType; +import mage.constants.DependencyType; import mage.constants.Duration; import mage.constants.Layer; import static mage.constants.Layer.TypeChangingEffects_4; @@ -54,57 +55,66 @@ import mage.target.common.TargetCreaturePermanent; * * 702.102. Bestow * - * 702.102a Bestow represents two static abilities, one that functions while the card with bestow is - * on the stack and another that functions both while it’s on stack and while it’s on the battlefield. - * “Bestow [cost]” means “You may cast this card by paying [cost] rather than its mana cost.” and “If - * you chose to pay this spell’s bestow cost, it becomes an Aura enchantment and gains enchant creature. - * These effects last until one of two things happens: this spell has an illegal target as it resolves - * and or the permanent this spell becomes, becomes unattached.” Paying a card’s bestow cost follows the - * rules for paying alternative costs in rules 601.2b and 601.2e–g. + * 702.102a Bestow represents two static abilities, one that functions while the + * card with bestow is on the stack and another that functions both while it’s + * on stack and while it’s on the battlefield. “Bestow [cost]” means “You may + * cast this card by paying [cost] rather than its mana cost.” and “If you chose + * to pay this spell’s bestow cost, it becomes an Aura enchantment and gains + * enchant creature. These effects last until one of two things happens: this + * spell has an illegal target as it resolves and or the permanent this spell + * becomes, becomes unattached.” Paying a card’s bestow cost follows the rules + * for paying alternative costs in rules 601.2b and 601.2e–g. * - * 702.102b If a spell’s controller chooses to pay its bestow cost, that player chooses a legal target - * for that Aura spell as defined by its enchant creature ability and rule 601.2c. See also rule 303.4. + * 702.102b If a spell’s controller chooses to pay its bestow cost, that player + * chooses a legal target for that Aura spell as defined by its enchant creature + * ability and rule 601.2c. See also rule 303.4. * - * 702.102c A spell’s controller can’t choose to pay its bestow cost unless that player can choose a legal - * target for that spell after it becomes an Aura spell. + * 702.102c A spell’s controller can’t choose to pay its bestow cost unless that + * player can choose a legal target for that spell after it becomes an Aura + * spell. * - * 702.102d As an Aura spell with bestow begins resolving, if its target is illegal, the effect making - * it an Aura spell ends. It continues resolving as a creature spell and will be put onto the battlefield - * under the control of the spell’s controller. This is an exception to rule 608.3a. + * 702.102d As an Aura spell with bestow begins resolving, if its target is + * illegal, the effect making it an Aura spell ends. It continues resolving as a + * creature spell and will be put onto the battlefield under the control of the + * spell’s controller. This is an exception to rule 608.3a. * - * 702.102e If an Aura with bestow is attached to an illegal object or player, it becomes unattached. - * This is an exception to rule 704.5n. - * - * You don’t choose whether the spell is going to be an Aura spell or not until the spell is already on - * the stack. Abilities that affect when you can cast a spell, such as flash, will apply to the creature - * card in whatever zone you’re casting it from. For example, an effect that said you can cast creature - * spells as though they have flash will allow you to cast a creature card with bestow as an Aura spell - * anytime you could cast an instant. + * 702.102e If an Aura with bestow is attached to an illegal object or player, + * it becomes unattached. This is an exception to rule 704.5n. * - * On the stack, a spell with bestow is either a creature spell or an Aura spell. It’s never both. + * You don’t choose whether the spell is going to be an Aura spell or not until + * the spell is already on the stack. Abilities that affect when you can cast a + * spell, such as flash, will apply to the creature card in whatever zone you’re + * casting it from. For example, an effect that said you can cast creature + * spells as though they have flash will allow you to cast a creature card with + * bestow as an Aura spell anytime you could cast an instant. * - * Unlike other Aura spells, an Aura spell with bestow isn’t countered if its target is illegal as it - * begins to resolve. Rather, the effect making it an Aura spell ends, it loses enchant creature, it - * returns to being an enchantment creature spell, and it resolves and enters the battlefield as an + * On the stack, a spell with bestow is either a creature spell or an Aura + * spell. It’s never both. + * + * Unlike other Aura spells, an Aura spell with bestow isn’t countered if its + * target is illegal as it begins to resolve. Rather, the effect making it an + * Aura spell ends, it loses enchant creature, it returns to being an + * enchantment creature spell, and it resolves and enters the battlefield as an * enchantment creature. * - * Unlike other Auras, an Aura with bestow isn’t put into its owner’s graveyard if it becomes unattached. - * Rather, the effect making it an Aura ends, it loses enchant creature, and it remains on the - * battlefield as an enchantment creature. It can attack (and its {T} abilities can be activated, - * if it has any) on the turn it becomes unattached if it’s been under your control continuously, - * even as an Aura, since your most recent turn began. + * Unlike other Auras, an Aura with bestow isn’t put into its owner’s graveyard + * if it becomes unattached. Rather, the effect making it an Aura ends, it loses + * enchant creature, and it remains on the battlefield as an enchantment + * creature. It can attack (and its {T} abilities can be activated, if it has + * any) on the turn it becomes unattached if it’s been under your control + * continuously, even as an Aura, since your most recent turn began. * - * If a permanent with bestow enters the battlefield by any method other than being cast, it will be - * an enchantment creature. You can’t choose to pay the bestow cost and have it become an Aura. + * If a permanent with bestow enters the battlefield by any method other than + * being cast, it will be an enchantment creature. You can’t choose to pay the + * bestow cost and have it become an Aura. * - * Auras attached to a creature don’t become tapped when the creature becomes tapped. Except in some - * rare cases, an Aura with bestow remains untapped when it becomes unattached and becomes a creature. + * Auras attached to a creature don’t become tapped when the creature becomes + * tapped. Except in some rare cases, an Aura with bestow remains untapped when + * it becomes unattached and becomes a creature. * * * @author LevelX2 */ - - public class BestowAbility extends SpellAbility { public BestowAbility(Card card, String manaString) { @@ -135,67 +145,67 @@ public class BestowAbility extends SpellAbility { @Override public String getRule() { - return "Bestow " + getManaCostsToPay().getText()+ " (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)"; + return "Bestow " + getManaCostsToPay().getText() + " (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)"; } -} + class BestowTypeChangingEffect extends ContinuousEffectImpl implements SourceEffect { -class BestowTypeChangingEffect extends ContinuousEffectImpl implements SourceEffect { + private boolean wasAttached; - private boolean wasAttached; - - public BestowTypeChangingEffect() { - super(Duration.WhileOnBattlefield, Outcome.BoostCreature); - wasAttached = false; - } - - public BestowTypeChangingEffect(final BestowTypeChangingEffect effect) { - super(effect); - this.wasAttached = effect.wasAttached; - } - - @Override - public BestowTypeChangingEffect copy() { - return new BestowTypeChangingEffect(this); - } - - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - switch (layer) { - case TypeChangingEffects_4: - if (sublayer == SubLayer.NA) { - if (permanent.getAttachedTo() == null) { - if (wasAttached && permanent.getSubtype().contains("Aura")) { - permanent.getSubtype().remove("Aura"); - wasAttached = false; - } - } else { - permanent.getCardType().remove(CardType.CREATURE); - permanent.getSubtype().clear(); - if (!permanent.getSubtype().contains("Aura")) { - permanent.getSubtype().add("Aura"); - } - wasAttached = true; - } - } - break; - } - return true; + public BestowTypeChangingEffect() { + super(Duration.WhileOnBattlefield, Outcome.BoostCreature); + wasAttached = false; + dependencyTypes.add(DependencyType.AuraAddingRemoving); } - return false; - } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + public BestowTypeChangingEffect(final BestowTypeChangingEffect effect) { + super(effect); + this.wasAttached = effect.wasAttached; + } + @Override + public BestowTypeChangingEffect copy() { + return new BestowTypeChangingEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + switch (layer) { + case TypeChangingEffects_4: + if (sublayer == SubLayer.NA) { + if (permanent.getAttachedTo() == null) { + if (wasAttached && permanent.getSubtype().contains("Aura")) { + permanent.getSubtype().remove("Aura"); + wasAttached = false; + } + } else { + permanent.getCardType().remove(CardType.CREATURE); + permanent.getSubtype().retainAll(CardRepository.instance.getLandTypes()); + if (!permanent.getSubtype().contains("Aura")) { + permanent.getSubtype().add("Aura"); + } + wasAttached = true; + } + } + break; + } + return true; + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.TypeChangingEffects_4; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.TypeChangingEffects_4; } } diff --git a/Mage/src/mage/abilities/keyword/BloodthirstAbility.java b/Mage/src/mage/abilities/keyword/BloodthirstAbility.java index f93ca9824d6..0b8f4d29c61 100644 --- a/Mage/src/mage/abilities/keyword/BloodthirstAbility.java +++ b/Mage/src/mage/abilities/keyword/BloodthirstAbility.java @@ -12,10 +12,11 @@ import mage.util.CardUtil; import mage.watchers.common.BloodthirstWatcher; /** - * + * * @author Loki */ public class BloodthirstAbility extends EntersBattlefieldAbility { + private int amount; public BloodthirstAbility(int amount) { @@ -48,12 +49,13 @@ public class BloodthirstAbility extends EntersBattlefieldAbility { } class BloodthirstEffect extends OneShotEffect { + private final int amount; BloodthirstEffect(int amount) { super(Outcome.BoostCreature); this.amount = amount; - staticText = new StringBuilder("this permanent comes into play with ").append(this.amount).append(" +1/+1 counters on it").toString(); + staticText = "this permanent comes into play with " + this.amount + " +1/+1 counters on it"; } BloodthirstEffect(final BloodthirstEffect effect) { @@ -67,10 +69,9 @@ class BloodthirstEffect extends OneShotEffect { if (player != null) { BloodthirstWatcher watcher = (BloodthirstWatcher) game.getState().getWatchers().get("DamagedOpponents", source.getControllerId()); if (watcher != null && watcher.conditionMet()) { - Permanent p = game.getPermanent(source.getSourceId()); - if (p != null) { - p.addCounters(CounterType.P1P1.createInstance(amount), game); - + Permanent permanent = game.getPermanentEntering(source.getSourceId()); + if (permanent != null) { + permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } } return true; @@ -83,4 +84,3 @@ class BloodthirstEffect extends OneShotEffect { return new BloodthirstEffect(this); } } - diff --git a/Mage/src/mage/abilities/keyword/BuybackAbility.java b/Mage/src/mage/abilities/keyword/BuybackAbility.java index 321a7de0a80..f35c32c874f 100644 --- a/Mage/src/mage/abilities/keyword/BuybackAbility.java +++ b/Mage/src/mage/abilities/keyword/BuybackAbility.java @@ -63,8 +63,8 @@ import mage.players.Player; public class BuybackAbility extends StaticAbility implements OptionalAdditionalSourceCosts { private static final String keywordText = "Buyback"; - private static final String reminderTextCost = "(You may {cost} in addition to any other costs as you cast this spell. If you do, put this card into your hand as it resolves.)"; - private static final String reminderTextMana = "(You may pay an additional {cost} as you cast this spell. If you do, put this card into your hand as it resolves.)"; + private static final String reminderTextCost = "You may {cost} in addition to any other costs as you cast this spell. If you do, put this card into your hand as it resolves."; + private static final String reminderTextMana = "You may pay an additional {cost} as you cast this spell. If you do, put this card into your hand as it resolves."; protected OptionalAdditionalCost buybackCost; public BuybackAbility(String manaString) { @@ -96,6 +96,7 @@ public class BuybackAbility extends StaticAbility implements OptionalAdditionalS } } + @Override public boolean isActivated() { if (buybackCost != null) { return buybackCost.isActivated(); @@ -112,11 +113,11 @@ public class BuybackAbility extends StaticAbility implements OptionalAdditionalS @Override public void addOptionalAdditionalCosts(Ability ability, Game game) { if (ability instanceof SpellAbility) { - Player player = game.getPlayer(controllerId); + Player player = game.getPlayer(ability.getControllerId()); if (player != null) { this.resetBuyback(); if (buybackCost != null) { - if (player.chooseUse(Outcome.Benefit, new StringBuilder("Pay ").append(buybackCost.getText(false)).append(" ?").toString(), ability, game)) { + if (player.chooseUse(Outcome.Benefit, "Pay " + buybackCost.getText(false) + " ?", ability, game)) { buybackCost.activate(); for (Iterator it = ((Costs) buybackCost).iterator(); it.hasNext();) { Cost cost = (Cost) it.next(); @@ -185,7 +186,8 @@ class BuybackEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getTargetId().equals(source.getSourceId())) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Zone.STACK) { + if (zEvent.getFromZone() == Zone.STACK + && source.getSourceId().equals(event.getSourceId())) { // if spell fizzled, the sourceId is null return true; } } diff --git a/Mage/src/mage/abilities/keyword/CascadeAbility.java b/Mage/src/mage/abilities/keyword/CascadeAbility.java index c4b6318f83b..68e593baa24 100644 --- a/Mage/src/mage/abilities/keyword/CascadeAbility.java +++ b/Mage/src/mage/abilities/keyword/CascadeAbility.java @@ -1,37 +1,38 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; @@ -74,10 +75,7 @@ public class CascadeAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getSourceId().equals(this.getSourceId())) { - return true; - } - return false; + return spell != null && spell.getSourceId().equals(this.getSourceId()); } @Override @@ -94,46 +92,8 @@ public class CascadeAbility extends TriggeredAbilityImpl { return new CascadeAbility(this); } - // moved to static method because it's called also from class {link} MaelstromNexus - - public static boolean applyCascade(Outcome outcome, Game game, Ability source) { - Card card; - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { - return false; - } - ExileZone exile = game.getExile().createZone(source.getSourceId(), player.getName() + " Cascade"); - int sourceCost = game.getCard(source.getSourceId()).getManaCost().convertedManaCost(); - do { - card = player.getLibrary().getFromTop(game); - if (card == null) { - break; - } - player.moveCardToExileWithInfo(card, exile.getId(), exile.getName(), source.getSourceId(), game, Zone.LIBRARY, true); - } while (player.isInGame() && card.getCardType().contains(CardType.LAND) || card.getManaCost().convertedManaCost() >= sourceCost); - player.getLibrary().reset(); - - if (card != null) { - if (player.chooseUse(outcome, "Use cascade effect on " + card.getName() + "?", source, game)) { - if(player.cast(card.getSpellAbility(), game, true)){ - exile.remove(card.getId()); - } - } - } - - while (exile.size() > 0) { - card = exile.getRandom(game); - exile.remove(card.getId()); - player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.EXILED, false, false); - } - - return true; - } } -// !!! Changes to the cascade effect here have to be copied to the cascadeEffect of Maelstrom Nexus card eventually. -// There is a functional copy of this effect - class CascadeEffect extends OneShotEffect { public CascadeEffect() { @@ -146,37 +106,40 @@ class CascadeEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - return CascadeAbility.applyCascade(outcome, game, source); -// Card card; -// Player player = game.getPlayer(source.getControllerId()); -// if (player == null) { -// return false; -// } -// ExileZone exile = game.getExile().createZone(source.getSourceId(), player.getName() + " Cascade"); -// int sourceCost = game.getCard(source.getSourceId()).getManaCost().convertedManaCost(); -// do { -// card = player.getLibrary().getFromTop(game); -// if (card == null) { -// break; -// } -// player.moveCardToExileWithInfo(card, exile.getId(), exile.getName(), source.getSourceId(), game, Zone.LIBRARY); -// } while (player.isInGame() && card.getCardType().contains(CardType.LAND) || card.getManaCost().convertedManaCost() >= sourceCost); -// -// if (card != null) { -// if (player.chooseUse(outcome, "Use cascade effect on " + card.getName() + "?", game)) { -// if(player.cast(card.getSpellAbility(), game, true)){ -// exile.remove(card.getId()); -// } -// } -// } -// -// while (exile.size() > 0) { -// card = exile.getRandom(game); -// exile.remove(card.getId()); -// player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.EXILED, false, false); -// } -// -// return true; + Card card; + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + ExileZone exile = game.getExile().createZone(source.getSourceId(), player.getName() + " Cascade"); + int sourceCost = game.getCard(source.getSourceId()).getManaCost().convertedManaCost(); + do { + card = player.getLibrary().getFromTop(game); + if (card == null) { + break; + } + player.moveCardsToExile(card, source, game, true, exile.getId(), exile.getName()); + } while (player.isInGame() && card.getCardType().contains(CardType.LAND) || card.getManaCost().convertedManaCost() >= sourceCost); + player.getLibrary().reset(); + + if (card != null) { + if (player.chooseUse(outcome, "Use cascade effect on " + card.getLogName() + "?", source, game)) { + if (player.cast(card.getSpellAbility(), game, true)) { + exile.remove(card.getId()); + } + } + } + // Move the remaining cards to the buttom of the library in a random order + Cards cardsFromExile = new CardsImpl(); + Cards cardsToLibrary = new CardsImpl(); + cardsFromExile.addAll(exile); + while (cardsFromExile.size() > 0) { + card = cardsFromExile.getRandom(game); + cardsFromExile.remove(card.getId()); + cardsToLibrary.add(card); + } + player.putCardsOnBottomOfLibrary(cardsToLibrary, game, source, false); + return true; } @Override @@ -185,5 +148,3 @@ class CascadeEffect extends OneShotEffect { } } - - diff --git a/Mage/src/mage/abilities/keyword/ChangelingAbility.java b/Mage/src/mage/abilities/keyword/ChangelingAbility.java index 94fb1debb65..bc90a8764c9 100644 --- a/Mage/src/mage/abilities/keyword/ChangelingAbility.java +++ b/Mage/src/mage/abilities/keyword/ChangelingAbility.java @@ -61,7 +61,7 @@ public class ChangelingAbility extends StaticAbility implements MageSingleton { @Override public String getRule() { - return "Changeling (This card is every creature type.)"; + return "Changeling (This card is every creature type.)"; } @Override diff --git a/Mage/src/mage/abilities/keyword/ConspireAbility.java b/Mage/src/mage/abilities/keyword/ConspireAbility.java index fe470c425fd..a1321b9e9bc 100644 --- a/Mage/src/mage/abilities/keyword/ConspireAbility.java +++ b/Mage/src/mage/abilities/keyword/ConspireAbility.java @@ -27,14 +27,16 @@ */ package mage.abilities.keyword; +import java.util.HashSet; import java.util.Iterator; +import java.util.Set; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.StaticAbility; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.Cost; import mage.abilities.costs.Costs; -import mage.abilities.costs.OptionalAdditionalCost; import mage.abilities.costs.OptionalAdditionalCostImpl; import mage.abilities.costs.OptionalAdditionalSourceCosts; import mage.abilities.costs.common.TapTargetCost; @@ -50,48 +52,78 @@ import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; -import mage.game.stack.StackObject; import mage.players.Player; import mage.target.common.TargetControlledPermanent; -/** - * 702.77. Conspire 702.77a Conspire is a keyword that represents two abilities. - * The first is a static ability that functions while the spell with conspire is - * on the stack. The second is a triggered ability that functions while the - * spell with conspire is on the stack. "Conspire" means "As an additional cost - * to cast this spell, you may tap two untapped creatures you control that each - * share a color with it" and "When you cast this spell, if its conspire cost - * was paid, copy it. If the spell has any targets, you may choose new targets - * for the copy." Paying a spell’s conspire cost follows the rules for paying - * additional costs in rules 601.2b and 601.2e–g. 702.77b If a spell has - * multiple instances of conspire, each is paid separately and triggers based on - * its own payment, not any other instance of conspire. * +/* + * 702.77. Conspire + * 702.77a Conspire is a keyword that represents two abilities. + * The first is a static ability that functions while the spell with conspire is on the stack. + * The second is a triggered ability that functions while the spell with conspire is on the stack. + * "Conspire" means "As an additional cost to cast this spell, + * you may tap two untapped creatures you control that each share a color with it" + * and "When you cast this spell, if its conspire cost was paid, copy it. + * If the spell has any targets, you may choose new targets for the copy." + * Paying a spell’s conspire cost follows the rules for paying additional costs in rules 601.2b and 601.2e–g. + * 702.77b If a spell has multiple instances of conspire, each is paid separately and triggers + * based on its own payment, not any other instance of conspire. * * - * @author jeffwadsworth heavily based off the replicate keyword by LevelX + * @author LevelX */ public class ConspireAbility extends StaticAbility implements OptionalAdditionalSourceCosts { private static final String keywordText = "Conspire"; - private static final String reminderTextCost = "As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.)"; - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("two untapped creatures you control that share a color with it"); + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creatures you control that share a color with it"); + protected static final String CONSPIRE_ACTIVATION_KEY = "ConspireActivation"; static { filter.add(Predicates.not(new TappedPredicate())); filter.add(new SharesColorWithSourcePredicate()); } - Cost costConspire = new TapTargetCost(new TargetControlledPermanent(2, 2, filter, true)); - OptionalAdditionalCost conspireCost = new OptionalAdditionalCostImpl(keywordText, "-", reminderTextCost, costConspire); + public enum ConspireTargets { - public ConspireAbility(Card card) { + NONE, + ONE, + MORE + } + + private UUID conspireId; + private String reminderText; + private OptionalAdditionalCostImpl conspireCost; + + /** + * Unique Id for a ConspireAbility but may not change while a continuous + * effect gives Conspire + * + * @param conspireId + * @param conspireTargets controls the content of the reminder text + */ + public ConspireAbility(UUID conspireId, ConspireTargets conspireTargets) { super(Zone.STACK, null); - setRuleAtTheTop(false); - addSubAbility(new ConspireTriggeredAbility()); + this.conspireId = conspireId; + switch (conspireTargets) { + case NONE: + reminderText = "As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it."; + break; + case ONE: + reminderText = "As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy."; + break; + case MORE: + reminderText = "As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose new targets for the copy."; + break; + } + Cost cost = new TapTargetCost(new TargetControlledPermanent(2, 2, filter, true)); + cost.setText(""); + conspireCost = new OptionalAdditionalCostImpl(keywordText, " ", reminderText, cost); + addSubAbility(new ConspireTriggeredAbility(conspireId)); } public ConspireAbility(final ConspireAbility ability) { super(ability); - conspireCost = ability.conspireCost; + this.conspireId = ability.conspireId; + this.conspireCost = ability.conspireCost.copy(); + this.reminderText = ability.reminderText; } @Override @@ -106,28 +138,32 @@ public class ConspireAbility extends StaticAbility implements OptionalAdditional } } - @Override - public boolean isActivated() { - if (conspireCost != null) { - return conspireCost.isActivated(); - } - return false; + public UUID getConspireId() { + return conspireId; } - public void resetConspire() { - if (conspireCost != null) { - conspireCost.reset(); + @Override + public boolean isActivated() { + throw new UnsupportedOperationException("Use ConspireAbility.isActivated(Ability ability, Game game) method instead!"); + } + + public boolean isActivated(Ability ability, Game game) { + Set activations = (Set) game.getState().getValue(CONSPIRE_ACTIVATION_KEY + ability.getId()); + if (activations != null) { + return activations.contains(getConspireId()); } + return false; } @Override public void addOptionalAdditionalCosts(Ability ability, Game game) { if (ability instanceof SpellAbility) { - Player player = game.getPlayer(controllerId); + Player player = game.getPlayer(getControllerId()); if (player != null) { - this.resetConspire(); - if (player.chooseUse(Outcome.Benefit, new StringBuilder("Pay ").append(conspireCost.getText(false)).append(" ?").toString(), ability, game)) { - conspireCost.activate(); + resetConspire(ability, game); + if (conspireCost.canPay(ability, getSourceId(), getControllerId(), game) + && player.chooseUse(Outcome.Benefit, "Pay " + conspireCost.getText(false) + " ?", ability, game)) { + activateConspire(ability, game); for (Iterator it = ((Costs) conspireCost).iterator(); it.hasNext();) { Cost cost = (Cost) it.next(); ability.getCosts().add(cost.copy()); @@ -137,6 +173,22 @@ public class ConspireAbility extends StaticAbility implements OptionalAdditional } } + private void activateConspire(Ability ability, Game game) { + Set activations = (Set) game.getState().getValue(CONSPIRE_ACTIVATION_KEY + ability.getId()); + if (activations == null) { + activations = new HashSet<>(); + game.getState().setValue(CONSPIRE_ACTIVATION_KEY + ability.getId(), activations); + } + activations.add(getConspireId()); + } + + private void resetConspire(Ability ability, Game game) { + Set activations = (Set) game.getState().getValue(CONSPIRE_ACTIVATION_KEY + ability.getId()); + if (activations != null) { + activations.remove(getConspireId()); + } + } + @Override public String getRule() { StringBuilder sb = new StringBuilder(); @@ -167,13 +219,17 @@ public class ConspireAbility extends StaticAbility implements OptionalAdditional class ConspireTriggeredAbility extends TriggeredAbilityImpl { - public ConspireTriggeredAbility() { + private UUID conspireId; + + public ConspireTriggeredAbility(UUID conspireId) { super(Zone.STACK, new ConspireEffect()); + this.conspireId = conspireId; this.setRuleVisible(false); } private ConspireTriggeredAbility(final ConspireTriggeredAbility ability) { super(ability); + this.conspireId = ability.conspireId; } @Override @@ -188,20 +244,18 @@ class ConspireTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getSourceId().equals(this.sourceId)) { - StackObject spell = game.getStack().getStackObject(this.sourceId); - if (spell instanceof Spell) { - Card card = game.getCard(spell.getSourceId()); - if (card != null) { - for (Ability ability : card.getAbilities()) { - if (ability instanceof ConspireAbility) { - if (((ConspireAbility) ability).isActivated()) { - for (Effect effect : this.getEffects()) { - effect.setValue("ConspireSpell", spell); - } - return true; + if (event.getSourceId().equals(getSourceId())) { + Spell spell = game.getStack().getSpell(event.getSourceId()); + for (Ability ability : spell.getAbilities(game)) { + if (ability instanceof ConspireAbility + && ((ConspireAbility) ability).getConspireId().equals(getConspireId())) { + if (((ConspireAbility) ability).isActivated(spell.getSpellAbility(), game)) { + for (Effect effect : this.getEffects()) { + if (effect instanceof ConspireEffect) { + ((ConspireEffect) effect).setConspiredSpell(spell); } } + return true; } } } @@ -209,52 +263,53 @@ class ConspireTriggeredAbility extends TriggeredAbilityImpl { return false; } + public UUID getConspireId() { + return conspireId; + } + @Override public String getRule() { - return "Conspire: As you cast this spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose a new target for the copy.)"; + return "When you pay the conspire costs, copy it and you may choose a new target for the copy."; } } class ConspireEffect extends OneShotEffect { + private Spell conspiredSpell; + public ConspireEffect() { super(Outcome.Copy); } public ConspireEffect(final ConspireEffect effect) { super(effect); + this.conspiredSpell = effect.conspiredSpell; } @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - Spell spell = (Spell) this.getValue("ConspireSpell"); - if (spell != null) { - Card card = game.getCard(spell.getSourceId()); - if (card != null) { - for (Ability ability : card.getAbilities()) { - if (ability instanceof ConspireAbility) { - if (((ConspireAbility) ability).isActivated()) { - ((ConspireAbility) ability).resetConspire(); - } - } - } - Spell copy = spell.copySpell(); - copy.setControllerId(source.getControllerId()); - copy.setCopiedSpell(true); - game.getStack().push(copy); - copy.chooseNewTargets(game, source.getControllerId()); - if (!game.isSimulation()) { - game.informPlayers(new StringBuilder(controller.getLogName()).append(copy.getActivatedMessage(game)).toString()); - } - return true; + if (controller != null && conspiredSpell != null) { + Card card = game.getCard(conspiredSpell.getSourceId()); + if (card != null) { + Spell copy = conspiredSpell.copySpell(); + copy.setControllerId(source.getControllerId()); + copy.setCopiedSpell(true); + game.getStack().push(copy); + copy.chooseNewTargets(game, source.getControllerId()); + if (!game.isSimulation()) { + game.informPlayers(controller.getLogName() + copy.getActivatedMessage(game)); } + return true; } } return false; } + public void setConspiredSpell(Spell conspiredSpell) { + this.conspiredSpell = conspiredSpell; + } + @Override public ConspireEffect copy() { return new ConspireEffect(this); diff --git a/Mage/src/mage/abilities/keyword/CumulativeUpkeepAbility.java b/Mage/src/mage/abilities/keyword/CumulativeUpkeepAbility.java index 199c8536108..2e6c6d83fca 100644 --- a/Mage/src/mage/abilities/keyword/CumulativeUpkeepAbility.java +++ b/Mage/src/mage/abilities/keyword/CumulativeUpkeepAbility.java @@ -25,8 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - - package mage.abilities.keyword; import mage.abilities.Ability; @@ -41,6 +39,8 @@ import mage.constants.Outcome; import mage.constants.TargetController; import mage.counters.CounterType; import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -48,12 +48,10 @@ import mage.players.Player; * * @author Plopman */ - - public class CumulativeUpkeepAbility extends BeginningOfUpkeepTriggeredAbility { - + private Cost cumulativeCost; - + public CumulativeUpkeepAbility(Cost cumulativeCost) { super(new AddCountersSourceEffect(CounterType.AGE.createInstance()), TargetController.YOU, false); this.addEffect(new CumulativeUpkeepEffect(cumulativeCost)); @@ -82,9 +80,9 @@ public class CumulativeUpkeepAbility extends BeginningOfUpkeepTriggeredAbility { } class CumulativeUpkeepEffect extends OneShotEffect { - - private Cost cumulativeCost; - + + private final Cost cumulativeCost; + CumulativeUpkeepEffect(Cost cumulativeCost) { super(Outcome.Sacrifice); this.cumulativeCost = cumulativeCost; @@ -95,46 +93,46 @@ class CumulativeUpkeepEffect extends OneShotEffect { this.cumulativeCost = effect.cumulativeCost.copy(); } - @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { + if (player != null && permanent != null) { int ageCounter = permanent.getCounters().getCount(CounterType.AGE); - if(cumulativeCost instanceof ManaCost){ - ManaCostsImpl totalCost = new ManaCostsImpl(); - for(int i = 0 ; i < ageCounter; i++){ + if (cumulativeCost instanceof ManaCost) { + ManaCostsImpl totalCost = new ManaCostsImpl<>(); + for (int i = 0; i < ageCounter; i++) { totalCost.add((ManaCost) cumulativeCost.copy()); } if (player.chooseUse(Outcome.Benefit, "Pay " + totalCost.getText() + "?", source, game)) { totalCost.clearPaid(); - if (totalCost.payOrRollback(source, game, source.getSourceId(), source.getControllerId())){ + if (totalCost.payOrRollback(source, game, source.getSourceId(), source.getControllerId())) { + game.fireEvent(new GameEvent(EventType.PAID_CUMULATIVE_UPKEEP, permanent.getId(), permanent.getId(), player.getId(), ageCounter, false)); return true; } } + game.fireEvent(new GameEvent(EventType.DIDNT_PAY_CUMULATIVE_UPKEEP, permanent.getId(), permanent.getId(), player.getId(), ageCounter, false)); permanent.sacrifice(source.getSourceId(), game); - return true; - } - else{ - CostsImpl totalCost = new CostsImpl(); - for(int i = 0 ; i < ageCounter; i++){ + return true; + } else { + CostsImpl totalCost = new CostsImpl<>(); + for (int i = 0; i < ageCounter; i++) { totalCost.add(cumulativeCost.copy()); } if (player.chooseUse(Outcome.Benefit, totalCost.getText() + "?", source, game)) { totalCost.clearPaid(); int bookmark = game.bookmarkState(); - if (totalCost.pay(source, game, source.getSourceId(), source.getControllerId(), false)){ + if (totalCost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { + game.fireEvent(new GameEvent(EventType.PAID_CUMULATIVE_UPKEEP, permanent.getId(), permanent.getId(), player.getId(), ageCounter, false)); return true; - } - else{ + } else { game.restoreState(bookmark, source.getRule()); } } + game.fireEvent(new GameEvent(EventType.DIDNT_PAY_CUMULATIVE_UPKEEP, permanent.getId(), permanent.getId(), player.getId(), ageCounter, false)); permanent.sacrifice(source.getSourceId(), game); - return true; + return true; } - } return false; } diff --git a/Mage/src/mage/abilities/keyword/DashAbility.java b/Mage/src/mage/abilities/keyword/DashAbility.java index 4a2d96170f0..b6a876053b0 100644 --- a/Mage/src/mage/abilities/keyword/DashAbility.java +++ b/Mage/src/mage/abilities/keyword/DashAbility.java @@ -76,10 +76,10 @@ public class DashAbility extends StaticAbility implements AlternativeSourceCosts this.addDashCost(manaString); Ability ability = new EntersBattlefieldAbility( new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.Custom, false), - DashedCondition.getInstance(), false, "", ""); + DashedCondition.getInstance(), "", ""); ability.addEffect(new DashAddDelayedTriggeredAbilityEffect()); addSubAbility(ability); - + } public DashAbility(final DashAbility ability) { @@ -226,16 +226,18 @@ class DashAddDelayedTriggeredAbilityEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Effect effect = new ReturnToHandTargetEffect(); - effect.setText("return the dashed creature from the battlefield to its owner's hand"); - effect.setTargetPointer(new FixedTarget(source.getSourceId())); - // init target pointer now because the dashed creature will only be returned from current zone - effect.getTargetPointer().init(game, source); - DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - game.addDelayedTriggeredAbility(delayedAbility); + if (game.getPermanentEntering(source.getSourceId()) != null) { + Effect effect = new ReturnToHandTargetEffect(); + effect.setText("return the dashed creature from the battlefield to its owner's hand"); + // init target pointer now because the dashed creature will only be returned from battlefield zone (now in entering state so zone change counter is not raised yet) + effect.setTargetPointer(new FixedTarget(source.getSourceId(), game.getState().getZoneChangeCounter(source.getSourceId()) + 1)); + DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } return false; } } diff --git a/Mage/src/mage/abilities/keyword/DelveAbility.java b/Mage/src/mage/abilities/keyword/DelveAbility.java index c6172cc2427..45d91c5e26e 100644 --- a/Mage/src/mage/abilities/keyword/DelveAbility.java +++ b/Mage/src/mage/abilities/keyword/DelveAbility.java @@ -48,35 +48,32 @@ import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; import mage.util.CardUtil; - /** - * 702.65. Delve - * 702.65a Delve is a static ability that functions while the spell with delve is on the stack. - * “Delve” means “For each generic mana in this spell’s total cost, you may exile a card - * from your graveyard rather than pay that mana.” The delve ability isn’t an additional - * or alternative cost and applies only after the total cost of the spell with delve is - * determined. + * 702.65. Delve 702.65a Delve is a static ability that functions while the + * spell with delve is on the stack. “Delve” means “For each generic mana in + * this spell’s total cost, you may exile a card from your graveyard rather than + * pay that mana.” The delve ability isn’t an additional or alternative cost and + * applies only after the total cost of the spell with delve is determined. * 702.65b Multiple instances of delve on the same spell are redundant. - * - * * The rules for delve have changed slightly since it was last in an expansion. Previously, delve - * reduced the cost to cast a spell. Under the current rules, you exile cards from your graveyard - * at the same time you pay the spell’s cost. Exiling a card this way is simply another way to pay - * that cost. - * * Delve doesn’t change a spell’s mana cost or converted mana cost. For example, Dead Drop’s converted - * mana cost is 10 even if you exiled three cards to cast it. - * * You can’t exile cards to pay for the colored mana requirements of a spell with delve. - * * You can’t exile more cards than the generic mana requirement of a spell with delve. For example, - * you can’t exile more than nine cards from your graveyard to cast Dead Drop. - * * Because delve isn’t an alternative cost, it can be used in conjunction with alternative costs. - * + * + * * The rules for delve have changed slightly since it was last in an + * expansion. Previously, delve reduced the cost to cast a spell. Under the + * current rules, you exile cards from your graveyard at the same time you pay + * the spell’s cost. Exiling a card this way is simply another way to pay that + * cost. * Delve doesn’t change a spell’s mana cost or converted mana cost. For + * example, Dead Drop’s converted mana cost is 10 even if you exiled three cards + * to cast it. * You can’t exile cards to pay for the colored mana requirements + * of a spell with delve. * You can’t exile more cards than the generic mana + * requirement of a spell with delve. For example, you can’t exile more than + * nine cards from your graveyard to cast Dead Drop. * Because delve isn’t an + * alternative cost, it can be used in conjunction with alternative costs. + * * @author LevelX2 * - * TODO: Change card exiling to a way to pay mana costs, now it's maybe not passible to pay costs from effects that - * increase the mana costs. + * TODO: Change card exiling to a way to pay mana costs, now it's maybe not + * passible to pay costs from effects that increase the mana costs. */ - - public class DelveAbility extends SimpleStaticAbility implements AlternateManaPaymentAbility { - +public class DelveAbility extends SimpleStaticAbility implements AlternateManaPaymentAbility { public DelveAbility() { super(Zone.STACK, null); @@ -89,12 +86,12 @@ import mage.util.CardUtil; @Override public DelveAbility copy() { - return new DelveAbility(this); + return new DelveAbility(this); } @Override public String getRule() { - return "Delve (Each card you exile from your graveyard while casting this spell pays for {1})"; + return "Delve (Each card you exile from your graveyard while casting this spell pays for {1})"; } @Override @@ -110,7 +107,7 @@ import mage.util.CardUtil; unpaidAmount = 1; } specialAction.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard( - 0, Math.min(controller.getGraveyard().size(), unpaidAmount), new FilterCard()))); + 0, Math.min(controller.getGraveyard().size(), unpaidAmount), new FilterCard()))); if (specialAction.canActivate(source.getControllerId(), game)) { game.getState().getSpecialActions().add(specialAction); } @@ -160,9 +157,10 @@ class DelveEffect extends OneShotEffect { List exiledCards = exileFromGraveCost.getExiledCards(); if (exiledCards.size() > 0) { ManaPool manaPool = controller.getManaPool(); - manaPool.addMana(new Mana(0,0,0,0,0,exiledCards.size(),0), game, source); + manaPool.addMana(new Mana(0, 0, 0, 0, 0, exiledCards.size(), 0), game, source); manaPool.unlockManaType(ManaType.COLORLESS); String keyString = CardUtil.getCardZoneString("delvedCards", source.getSourceId(), game); + @SuppressWarnings("unchecked") List delvedCards = (List) game.getState().getValue(keyString); if (delvedCards == null) { game.getState().setValue(keyString, exiledCards); diff --git a/Mage/src/mage/abilities/keyword/DevoidAbility.java b/Mage/src/mage/abilities/keyword/DevoidAbility.java new file mode 100644 index 00000000000..7aff3d5e46a --- /dev/null +++ b/Mage/src/mage/abilities/keyword/DevoidAbility.java @@ -0,0 +1,41 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.keyword; + +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class DevoidAbility extends SimpleStaticAbility { + + public DevoidAbility(ObjectColor color) { + super(Zone.ALL, null); + color.setBlack(false); + color.setWhite(false); + color.setGreen(false); + color.setBlue(false); + color.setRed(false); + } + + public DevoidAbility(final DevoidAbility ability) { + super(ability); + } + + @Override + public DevoidAbility copy() { + return new DevoidAbility(this); + } + + @Override + public String getRule() { + return "Devoid (This card has no color.)"; + } + +} diff --git a/Mage/src/mage/abilities/keyword/DevourAbility.java b/Mage/src/mage/abilities/keyword/DevourAbility.java index 1d4cdcfa822..ec3148a990a 100644 --- a/Mage/src/mage/abilities/keyword/DevourAbility.java +++ b/Mage/src/mage/abilities/keyword/DevourAbility.java @@ -27,51 +27,51 @@ */ package mage.abilities.keyword; -import mage.constants.Zone; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.DevourEffect; import mage.abilities.effects.common.DevourEffect.DevourFactor; +import mage.constants.Zone; /** * 502.82. Devour * - * 502.82a Devour is a static ability. "Devour N" means "As this object comes into play, - * you may sacrifice any number of creatures. This permanent comes into play with N +1/+1 - * counters on it for each creature sacrificed this way." + * 502.82a Devour is a static ability. "Devour N" means "As this object comes + * into play, you may sacrifice any number of creatures. This permanent comes + * into play with N +1/+1 counters on it for each creature sacrificed this way." * - * 502.82b Some objects have abilities that refer to the number of creatures the permanent - * devoured. "It devoured" means "sacrificed as a result of its devour ability as it came - * into play." + * 502.82b Some objects have abilities that refer to the number of creatures the + * permanent devoured. "It devoured" means "sacrificed as a result of its devour + * ability as it came into play." * * Devour appears only on creature cards. * - * A creature with devour can devour other creatures no matter how it comes into play. + * A creature with devour can devour other creatures no matter how it comes into + * play. * * You may choose to not sacrifice any creatures. * - * If you play a creature with devour as a spell, you choose how many and which creatures - * to devour as part of the resolution of that spell. (It can't be countered at this point.) - * The same is true of a spell or ability that lets you put a creature with devour into play. + * If you play a creature with devour as a spell, you choose how many and which + * creatures to devour as part of the resolution of that spell. (It can't be + * countered at this point.) The same is true of a spell or ability that lets + * you put a creature with devour into play. * - * You may sacrifice only creatures that are already in play. If a creature with devour and - * another creature are coming into play under your control at the same time, the creature - * with devour can't devour that other creature. The creature with devour also can't devour - * itself. + * You may sacrifice only creatures that are already in play. If a creature with + * devour and another creature are coming into play under your control at the + * same time, the creature with devour can't devour that other creature. The + * creature with devour also can't devour itself. * - * If multiple creatures with devour are coming into play under your control at the same time, - * you may use each one's devour ability. A creature you already control can be devoured by - * only one of them, however. (In other words, you can't sacrifice the same creature to satisfy - * multiple devour abilities.) All creatures devoured this way are sacrificed at the same time. + * If multiple creatures with devour are coming into play under your control at + * the same time, you may use each one's devour ability. A creature you already + * control can be devoured by only one of them, however. (In other words, you + * can't sacrifice the same creature to satisfy multiple devour abilities.) All + * creatures devoured this way are sacrificed at the same time. * * @author LevelX2 */ +public class DevourAbility extends SimpleStaticAbility { - public class DevourAbility extends SimpleStaticAbility { - - - - public DevourAbility(DevourFactor devourFactor) { - super(Zone.BATTLEFIELD, new DevourEffect(devourFactor)); + public DevourAbility(DevourFactor devourFactor) { + super(Zone.ALL, new DevourEffect(devourFactor)); } public DevourAbility(final DevourAbility ability) { @@ -82,4 +82,4 @@ import mage.abilities.effects.common.DevourEffect.DevourFactor; public DevourAbility copy() { return new DevourAbility(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/DoubleStrikeAbility.java b/Mage/src/mage/abilities/keyword/DoubleStrikeAbility.java index f1988843f67..ab99217ac27 100644 --- a/Mage/src/mage/abilities/keyword/DoubleStrikeAbility.java +++ b/Mage/src/mage/abilities/keyword/DoubleStrikeAbility.java @@ -1,38 +1,36 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; -import mage.constants.Zone; +import java.io.ObjectStreamException; import mage.abilities.MageSingleton; import mage.abilities.StaticAbility; - -import java.io.ObjectStreamException; +import mage.constants.Zone; /** * @@ -40,7 +38,7 @@ import java.io.ObjectStreamException; */ public class DoubleStrikeAbility extends StaticAbility implements MageSingleton { - private static final DoubleStrikeAbility fINSTANCE = new DoubleStrikeAbility(); + private static final DoubleStrikeAbility fINSTANCE = new DoubleStrikeAbility(); private Object readResolve() throws ObjectStreamException { return fINSTANCE; @@ -56,7 +54,7 @@ public class DoubleStrikeAbility extends StaticAbility implements MageSingleton @Override public String getRule() { - return "Double Strike"; + return "double strike"; } @Override @@ -64,4 +62,4 @@ public class DoubleStrikeAbility extends StaticAbility implements MageSingleton return fINSTANCE; } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/DredgeAbility.java b/Mage/src/mage/abilities/keyword/DredgeAbility.java index afed19ef46b..44ff99b07ff 100644 --- a/Mage/src/mage/abilities/keyword/DredgeAbility.java +++ b/Mage/src/mage/abilities/keyword/DredgeAbility.java @@ -71,7 +71,7 @@ class DredgeEffect extends ReplacementEffectImpl { super(Duration.WhileInGraveyard, Outcome.ReturnToHand); this.amount = value; this.staticText = new StringBuilder("Dredge ").append(Integer.toString(value)) - .append(" (If you would draw a card, instead you may put exactly three cards from the top of your library into your graveyard. If you do, return this card from your graveyard to your hand. Otherwise, draw a card.)").toString(); + .append(" (If you would draw a card, instead you may put exactly " + value + " card(s) from the top of your library into your graveyard. If you do, return this card from your graveyard to your hand. Otherwise, draw a card.)").toString(); } public DredgeEffect(final DredgeEffect effect) { diff --git a/Mage/src/mage/abilities/keyword/EntwineAbility.java b/Mage/src/mage/abilities/keyword/EntwineAbility.java index 141fd25162b..0604445c2a4 100644 --- a/Mage/src/mage/abilities/keyword/EntwineAbility.java +++ b/Mage/src/mage/abilities/keyword/EntwineAbility.java @@ -59,7 +59,7 @@ import mage.players.Player; public class EntwineAbility extends StaticAbility implements OptionalAdditionalModeSourceCosts { private static final String keywordText = "Entwine"; - private static final String reminderText = " (Choose both if you pay the entwine cost.)"; + private static final String reminderText = "Choose both if you pay the entwine cost."; protected OptionalAdditionalCost additionalCost; public EntwineAbility(String manaString) { @@ -90,6 +90,7 @@ public class EntwineAbility extends StaticAbility implements OptionalAdditionalM } } + @Override public boolean isActivated() { if (additionalCost != null) { return additionalCost.isActivated(); @@ -110,7 +111,7 @@ public class EntwineAbility extends StaticAbility implements OptionalAdditionalM if (player != null) { this.resetCosts(); if (additionalCost != null) { - if (player.chooseUse(Outcome.Benefit, new StringBuilder("Pay ").append(additionalCost.getText(false)).append(" ?").toString(), ability, game)) { + if (player.chooseUse(Outcome.Benefit, "Pay " + additionalCost.getText(false) + " ?", ability, game)) { additionalCost.activate(); for (Iterator it = ((Costs) additionalCost).iterator(); it.hasNext();) { Cost cost = (Cost) it.next(); diff --git a/Mage/src/mage/abilities/keyword/EquipAbility.java b/Mage/src/mage/abilities/keyword/EquipAbility.java index 5316e6ff92c..7e6ff39582f 100644 --- a/Mage/src/mage/abilities/keyword/EquipAbility.java +++ b/Mage/src/mage/abilities/keyword/EquipAbility.java @@ -80,7 +80,7 @@ public class EquipAbility extends ActivatedAbilityImpl { @Override public String getRule() { StringBuilder sb = new StringBuilder("Equip ").append(costs.getText()).append(manaCosts.getText()); - sb.append(" (").append(manaCosts.getText()).append(": Attach to target creature you control. Equip only as a sorcery.)").toString(); + sb.append(" (").append(manaCosts.getText()).append(": Attach to target creature you control. Equip only as a sorcery.)"); return sb.toString(); } diff --git a/Mage/src/mage/abilities/keyword/EvolveAbility.java b/Mage/src/mage/abilities/keyword/EvolveAbility.java index 16c1b316e01..a23e25143b6 100644 --- a/Mage/src/mage/abilities/keyword/EvolveAbility.java +++ b/Mage/src/mage/abilities/keyword/EvolveAbility.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.abilities.Ability; @@ -44,46 +43,53 @@ import mage.target.targetpointer.FixedTarget; * FAQ 2013/01/11 * * 702.98. Evolve - * - * 702.98a Evolve is a triggered ability. "Evolve" means "Whenever a creature enters - * the battlefield under your control, if that creature's power is greater than this - * creature's power and/or that creature's toughness is greater than this creature's - * toughness, put a +1/+1 counter on this creature." * - * 702.98b If a creature has multiple instances of evolve, each triggers separately - * + * 702.98a Evolve is a triggered ability. "Evolve" means "Whenever a creature + * enters the battlefield under your control, if that creature's power is + * greater than this creature's power and/or that creature's toughness is + * greater than this creature's toughness, put a +1/+1 counter on this + * creature." + * + * 702.98b If a creature has multiple instances of evolve, each triggers + * separately + * * Rulings - * - * When comparing the stats of the two creatures, you always compare power to power and toughness to toughness. - * Whenever a creature enters the battlefield under your control, check its power and toughness against - * the power and toughness of the creature with evolve. If neither stat of the new creature is greater, - * evolve won't trigger at all. For example, if you control a 2/3 creature with evolve and a 2/2 creature - * enters the battlefield under your control, you won't have the opportunity to cast a spell like Giant Growth - * to make the 2/2 creature large enough to cause evolve to trigger. - * If evolve triggers, the stat comparison will happen again when the ability tries to resolve. If - * neither stat of the new creature is greater, the ability will do nothing. If the creature that - * entered the battlefield leaves the battlefield before evolve tries to resolve, use its last known - * power and toughness to compare the stats. - * If a creature enters the battlefield with +1/+1 counters on it, consider those counters when determining - * if evolve will trigger. For example, a 1/1 creature that enters the battlefield with two +1/+1 counters - * on it will cause the evolve ability of a 2/2 creature to trigger. - * If multiple creatures enter the battlefield at the same time, evolve may trigger multiple times, although the stat - * comparison will take place each time one of those abilities tries to resolve. For example, if you control a 2/2 - * creature with evolve and two 3/3 creatures enter the battlefield, evolve will trigger twice. The first ability - * will resolve and put a +1/+1 counter on the creature with evolve. When the second ability tries to resolve, - * neither the power nor the toughness of the new creature is greater than that of the creature with evolve, - * so that ability does nothing. - * When comparing the stats as the evolve ability resolves, it's possible that the stat that's greater changes - * from power to toughness or vice versa. If this happens, the ability will still resolve and you'll put a +1/+1 - * counter on the creature with evolve. For example, if you control a 2/2 creature with evolve and a 1/3 creature - * enters the battlefield under your control, it toughness is greater so evolve will trigger. In response, the 1/3 - * creature gets +2/-2. When the evolve trigger tries to resolve, its power is greater. You'll put a +1/+1 - * counter on the creature with evolve. - * + * + * When comparing the stats of the two creatures, you always compare power to + * power and toughness to toughness. Whenever a creature enters the battlefield + * under your control, check its power and toughness against the power and + * toughness of the creature with evolve. If neither stat of the new creature is + * greater, evolve won't trigger at all. For example, if you control a 2/3 + * creature with evolve and a 2/2 creature enters the battlefield under your + * control, you won't have the opportunity to cast a spell like Giant Growth to + * make the 2/2 creature large enough to cause evolve to trigger. If evolve + * triggers, the stat comparison will happen again when the ability tries to + * resolve. If neither stat of the new creature is greater, the ability will do + * nothing. If the creature that entered the battlefield leaves the battlefield + * before evolve tries to resolve, use its last known power and toughness to + * compare the stats. If a creature enters the battlefield with +1/+1 counters + * on it, consider those counters when determining if evolve will trigger. For + * example, a 1/1 creature that enters the battlefield with two +1/+1 counters + * on it will cause the evolve ability of a 2/2 creature to trigger. If multiple + * creatures enter the battlefield at the same time, evolve may trigger multiple + * times, although the stat comparison will take place each time one of those + * abilities tries to resolve. For example, if you control a 2/2 creature with + * evolve and two 3/3 creatures enter the battlefield, evolve will trigger + * twice. The first ability will resolve and put a +1/+1 counter on the creature + * with evolve. When the second ability tries to resolve, neither the power nor + * the toughness of the new creature is greater than that of the creature with + * evolve, so that ability does nothing. When comparing the stats as the evolve + * ability resolves, it's possible that the stat that's greater changes from + * power to toughness or vice versa. If this happens, the ability will still + * resolve and you'll put a +1/+1 counter on the creature with evolve. For + * example, if you control a 2/2 creature with evolve and a 1/3 creature enters + * the battlefield under your control, it toughness is greater so evolve will + * trigger. In response, the 1/3 creature gets +2/-2. When the evolve trigger + * tries to resolve, its power is greater. You'll put a +1/+1 counter on the + * creature with evolve. + * * @author LevelX2 */ - - public class EvolveAbility extends TriggeredAbilityImpl { public EvolveAbility() { @@ -160,13 +166,11 @@ class EvolveEffect extends OneShotEffect { if (triggeringCreature != null) { Permanent sourceCreature = game.getPermanent(source.getSourceId()); if (sourceCreature != null && EvolveAbility.isPowerOrThoughnessGreater(sourceCreature, triggeringCreature)) { - game.getState().setValue("EvolveAddCounterActive", Boolean.TRUE); sourceCreature.addCounters(CounterType.P1P1.createInstance(), game); - game.getState().setValue("EvolveAddCounterActive", Boolean.FALSE); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.EVOLVED_CREATURE, sourceCreature.getId(), source.getSourceId(), source.getControllerId())); } return true; } return false; } } - diff --git a/Mage/src/mage/abilities/keyword/FadingAbility.java b/Mage/src/mage/abilities/keyword/FadingAbility.java index 4a66d7dcda7..e8e45295810 100644 --- a/Mage/src/mage/abilities/keyword/FadingAbility.java +++ b/Mage/src/mage/abilities/keyword/FadingAbility.java @@ -18,25 +18,17 @@ import mage.game.permanent.Permanent; * 702.31a Fading is a keyword that represents two abilities. “Fading N” means “This permanent enters the battlefield with N fade counters on it” and “At the beginning of your upkeep, remove a fade counter from this permanent. If you can’t, sacrifice the permanent.” * */ - public class FadingAbility extends EntersBattlefieldAbility { - - + private String ruleText; - + public FadingAbility(int fadeCounter, Card card) { super(new AddCountersSourceEffect(CounterType.FADE.createInstance(fadeCounter)), "with"); Ability ability = new BeginningOfUpkeepTriggeredAbility(new FadingEffect(), TargetController.YOU, false); ability.setRuleVisible(false); addSubAbility(ability); - StringBuilder sb = new StringBuilder("Fading "); - sb.append(fadeCounter); - sb.append(" (This permanent enters the battlefield with ") - .append(fadeCounter) - .append(" fade counters on it. ") - .append(" At the beginning of your upkeep, remove a fade counter from this permanent. If you can’t, sacrifice the permanent.") - .append(")"); - ruleText = sb.toString(); + ruleText = "Fading " + fadeCounter + " (This permanent enters the battlefield with " + fadeCounter + " fade counters on it." + + " At the beginning of your upkeep, remove a fade counter from this permanent. If you can’t, sacrifice the permanent."; } public FadingAbility(final FadingAbility ability) { @@ -54,7 +46,9 @@ public class FadingAbility extends EntersBattlefieldAbility { return ruleText; } } + class FadingEffect extends OneShotEffect { + FadingEffect() { super(Outcome.Sacrifice); staticText = "remove a fade counter from this permanent. If you can’t, sacrifice the permanent"; @@ -64,18 +58,15 @@ class FadingEffect extends OneShotEffect { super(effect); } - @Override public boolean apply(Game game, Ability source) { - Permanent p = game.getPermanent(source.getSourceId()); - if (p != null) { - int amount = p.getCounters().getCount(CounterType.FADE); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + int amount = permanent.getCounters().getCount(CounterType.FADE); if (amount > 0) { - p.removeCounters(CounterType.FADE.createInstance(), game); - } - else - { - p.sacrifice(source.getSourceId(), game); + permanent.removeCounters(CounterType.FADE.createInstance(), game); + } else { + permanent.sacrifice(source.getSourceId(), game); } return true; } @@ -86,4 +77,4 @@ class FadingEffect extends OneShotEffect { public FadingEffect copy() { return new FadingEffect(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/FirstStrikeAbility.java b/Mage/src/mage/abilities/keyword/FirstStrikeAbility.java index 7ef603879a6..c1485c345d3 100644 --- a/Mage/src/mage/abilities/keyword/FirstStrikeAbility.java +++ b/Mage/src/mage/abilities/keyword/FirstStrikeAbility.java @@ -1,38 +1,36 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; -import mage.constants.Zone; +import java.io.ObjectStreamException; import mage.abilities.MageSingleton; import mage.abilities.StaticAbility; - -import java.io.ObjectStreamException; +import mage.constants.Zone; /** * @@ -40,7 +38,7 @@ import java.io.ObjectStreamException; */ public class FirstStrikeAbility extends StaticAbility implements MageSingleton { - private static final FirstStrikeAbility fINSTANCE = new FirstStrikeAbility(); + private static final FirstStrikeAbility fINSTANCE = new FirstStrikeAbility(); private Object readResolve() throws ObjectStreamException { return fINSTANCE; @@ -56,7 +54,7 @@ public class FirstStrikeAbility extends StaticAbility implements MageSingleton { @Override public String getRule() { - return "First strike"; + return "first strike"; } @Override @@ -64,4 +62,4 @@ public class FirstStrikeAbility extends StaticAbility implements MageSingleton { return fINSTANCE; } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/FlashbackAbility.java b/Mage/src/mage/abilities/keyword/FlashbackAbility.java index d1f23c4dbd1..9b514380393 100644 --- a/Mage/src/mage/abilities/keyword/FlashbackAbility.java +++ b/Mage/src/mage/abilities/keyword/FlashbackAbility.java @@ -29,18 +29,13 @@ package mage.abilities.keyword; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.DelayedTriggeredAbility; import mage.abilities.SpellAbility; import mage.abilities.costs.Cost; import mage.abilities.costs.VariableCost; -import mage.abilities.costs.mana.VariableManaCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.ReplacementEffectImpl; -import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; -import mage.abilities.effects.common.ExileSourceEffect; import mage.cards.Card; import mage.cards.SplitCard; -import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.SpellAbilityType; @@ -54,13 +49,14 @@ import mage.players.Player; /** * 702.32. Flashback * - * 702.32a. Flashback appears on some instants and sorceries. It represents two static abilities: - * one that functions while the card is in a player‘s graveyard and the other that functions - * while the card is on the stack. Flashback [cost] means, "You may cast this card from your - * graveyard by paying [cost] rather than paying its mana cost" and, "If the flashback cost - * was paid, exile this card instead of putting it anywhere else any time it would leave the - * stack." Casting a spell using its flashback ability follows the rules for paying alternative - * costs in rules 601.2b and 601.2e–g. + * 702.32a. Flashback appears on some instants and sorceries. It represents two + * static abilities: one that functions while the card is in a player‘s + * graveyard and the other that functions while the card is on the stack. + * Flashback [cost] means, "You may cast this card from your graveyard by paying + * [cost] rather than paying its mana cost" and, "If the flashback cost was + * paid, exile this card instead of putting it anywhere else any time it would + * leave the stack." Casting a spell using its flashback ability follows the + * rules for paying alternative costs in rules 601.2b and 601.2e–g. * * @author nantuko */ @@ -92,10 +88,10 @@ public class FlashbackAbility extends SpellAbility { if (card != null) { // Flashback can never cast a split card by Fuse, because Fuse only works from hand if (card.isSplitCard()) { - if (((SplitCard)card).getLeftHalfCard().getName().equals(abilityName)) { - return ((SplitCard)card).getLeftHalfCard().getSpellAbility().canActivate(playerId, game); - } else if (((SplitCard)card).getRightHalfCard().getName().equals(abilityName)) { - return ((SplitCard)card).getRightHalfCard().getSpellAbility().canActivate(playerId, game); + if (((SplitCard) card).getLeftHalfCard().getName().equals(abilityName)) { + return ((SplitCard) card).getLeftHalfCard().getSpellAbility().canActivate(playerId, game); + } else if (((SplitCard) card).getRightHalfCard().getName().equals(abilityName)) { + return ((SplitCard) card).getRightHalfCard().getSpellAbility().canActivate(playerId, game); } } return card.getSpellAbility().canActivate(playerId, game); @@ -108,7 +104,7 @@ public class FlashbackAbility extends SpellAbility { public FlashbackAbility copy() { return new FlashbackAbility(this); } - + @Override public String getRule(boolean all) { return this.getRule(); @@ -126,6 +122,9 @@ public class FlashbackAbility extends SpellAbility { sbRule.append(manaCosts.getText()); } if (costs.size() > 0) { + if (manaCosts.size() > 0) { + sbRule.append(", "); + } sbRule.append(costs.getText()); sbRule.append("."); } @@ -176,45 +175,33 @@ class FlashbackEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { SpellAbility spellAbility; - switch(((FlashbackAbility) source).getSpellAbilityType()) { + switch (((FlashbackAbility) source).getSpellAbilityType()) { case SPLIT_LEFT: - spellAbility = ((SplitCard)card).getLeftHalfCard().getSpellAbility(); + spellAbility = ((SplitCard) card).getLeftHalfCard().getSpellAbility().copy(); break; case SPLIT_RIGHT: - spellAbility = ((SplitCard)card).getRightHalfCard().getSpellAbility(); + spellAbility = ((SplitCard) card).getRightHalfCard().getSpellAbility().copy(); break; default: - spellAbility = card.getSpellAbility(); + spellAbility = card.getSpellAbility().copy(); } spellAbility.clear(); - // used if flashbacked spell has a {X} cost - int amount = source.getManaCostsToPay().getX(); - if (amount == 0) { - // add variable cost like Discard X cards to get the X value to the spell - // because there is currently no way to set the x value in anotehr way, it's set for the - // x mana value to be known by the spell - for (Cost cost:source.getCosts()) { - if (cost instanceof VariableCost && cost.isPaid()) { - amount = ((VariableCost) cost).getAmount(); - break; - } - } - } - if (amount > 0) { - // multiplier must be taken into account because if the base spell has {X}{X} the x value would be wrongly halfed - for (VariableCost variableCost: spellAbility.getManaCostsToPay().getVariableCosts()) { - if (variableCost instanceof VariableManaCost) { - amount = amount * ((VariableManaCost)variableCost).getMultiplier(); - break; - } + // set the payed flashback costs to the spell ability so abilities like Converge or calculation of {X} values work + spellAbility.getManaCostsToPay().clear(); + spellAbility.getManaCostsToPay().addAll(source.getManaCostsToPay()); + // needed to get e.g. paid costs from Conflagrate + spellAbility.getCosts().clear(); + for (Cost cost : source.getCosts()) { + if (!(cost instanceof VariableCost)) { + spellAbility.getCosts().add(cost); } - spellAbility.getManaCostsToPay().setX(amount); } - if (!game.isSimulation()) - game.informPlayers(new StringBuilder(controller.getLogName()).append(" flashbacks ").append(card.getName()).toString()); + if (!game.isSimulation()) { + game.informPlayers(controller.getLogName() + " flashbacks " + card.getLogName()); + } spellAbility.setCostModificationActive(false); // prevents to apply cost modification twice for flashbacked spells - if (controller.cast(spellAbility, game, true)) { + if (controller.cast(spellAbility, game, false)) { game.addEffect(new FlashbackReplacementEffect(), source); return true; } @@ -252,7 +239,7 @@ class FlashbackReplacementEffect extends ReplacementEffectImpl { if (controller != null) { Card card = game.getCard(event.getTargetId()); if (card != null) { - return controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, game.getState().getZone(card.getId()), true); + return controller.moveCards(card, Zone.EXILED, source, game); } } return false; @@ -265,8 +252,8 @@ class FlashbackReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return event.getTargetId().equals(source.getSourceId()) - && ((ZoneChangeEvent)event).getFromZone() == Zone.STACK - && ((ZoneChangeEvent)event).getToZone() != Zone.EXILED; + return event.getTargetId().equals(source.getSourceId()) + && ((ZoneChangeEvent) event).getFromZone() == Zone.STACK + && ((ZoneChangeEvent) event).getToZone() != Zone.EXILED; } } diff --git a/Mage/src/mage/abilities/keyword/ForestwalkAbility.java b/Mage/src/mage/abilities/keyword/ForestwalkAbility.java index a6f6d1545b1..7fd376b9188 100644 --- a/Mage/src/mage/abilities/keyword/ForestwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/ForestwalkAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.filter.common.FilterLandPermanent; @@ -37,14 +36,18 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class ForestwalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Forest"); + private static final FilterLandPermanent filter = new FilterLandPermanent("forest"); static { filter.add(new SubtypePredicate("Forest")); } public ForestwalkAbility() { - super(filter); + this(true); + } + + public ForestwalkAbility(boolean withHintText) { + super(filter, withHintText); } public ForestwalkAbility(final ForestwalkAbility ability) { @@ -55,4 +58,4 @@ public class ForestwalkAbility extends LandwalkAbility { public ForestwalkAbility copy() { return new ForestwalkAbility(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/GraftAbility.java b/Mage/src/mage/abilities/keyword/GraftAbility.java index 45eed19b928..14132f4f128 100644 --- a/Mage/src/mage/abilities/keyword/GraftAbility.java +++ b/Mage/src/mage/abilities/keyword/GraftAbility.java @@ -1,30 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; import java.util.Locale; @@ -48,18 +48,19 @@ import mage.target.targetpointer.FixedTarget; import mage.util.CardUtil; /** - * 702.56. Graft - * 702.56a. Graft represents both a static ability and a triggered ability. Graft N means, - * "This permanent enters the battlefield with N +1/+1 counters on it" and, "Whenever - * another creature enters the battlefield, if this permanent has a +1/+1 counter on it, - * you may move a +1/+1 counter from this permanent onto that creature." + * 702.56. Graft 702.56a. Graft represents both a static ability and a triggered + * ability. Graft N means, "This permanent enters the battlefield with N +1/+1 + * counters on it" and, "Whenever another creature enters the battlefield, if + * this permanent has a +1/+1 counter on it, you may move a +1/+1 counter from + * this permanent onto that creature." * - * 702.56b. If a creature has multiple instances of graft, each one works separately. + * 702.56b. If a creature has multiple instances of graft, each one works + * separately. * * @author LevelX2 */ - public class GraftAbility extends TriggeredAbilityImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); private int amount; @@ -112,10 +113,10 @@ public class GraftAbility extends TriggeredAbilityImpl { @Override public String getRule() { StringBuilder sb = new StringBuilder("Graft"); - sb.append(" ").append(amount).append(" (This ").append(cardtype).append(" enters the battlefield with ") - .append(amount == 1 ? "a": CardUtil.numberToText(amount)) - .append(" +1/+1 counter on it. Whenever a creature enters the battlefield, you may move a +1/+1 counter from this ") - .append(cardtype).append(" onto it.)"); + sb.append(" ").append(amount).append(" (This ").append(cardtype).append(" enters the battlefield with ") + .append(amount == 1 ? "a" : CardUtil.numberToText(amount)) + .append(" +1/+1 counter on it. Whenever a creature enters the battlefield, you may move a +1/+1 counter from this ") + .append(cardtype).append(" onto it.)"); return sb.toString(); } @@ -126,7 +127,7 @@ class GraftStaticAbility extends StaticAbility { private String ruleText; public GraftStaticAbility(int amount) { - super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount)))); + super(Zone.ALL, new EntersBattlefieldEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount)))); ruleText = new StringBuilder("This enters the battlefield with ").append(amount).append(" +1/+1 counter on it.").toString(); this.setRuleVisible(false); } @@ -147,7 +148,6 @@ class GraftStaticAbility extends StaticAbility { } } - class GraftDistributeCounterEffect extends OneShotEffect { public GraftDistributeCounterEffect() { diff --git a/Mage/src/mage/abilities/keyword/HasteAbility.java b/Mage/src/mage/abilities/keyword/HasteAbility.java index 5fa8d6e89d0..58f4281ab7b 100644 --- a/Mage/src/mage/abilities/keyword/HasteAbility.java +++ b/Mage/src/mage/abilities/keyword/HasteAbility.java @@ -1,38 +1,36 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; -import mage.constants.Zone; +import java.io.ObjectStreamException; import mage.abilities.MageSingleton; import mage.abilities.StaticAbility; - -import java.io.ObjectStreamException; +import mage.constants.Zone; /** * @@ -40,7 +38,7 @@ import java.io.ObjectStreamException; */ public class HasteAbility extends StaticAbility implements MageSingleton { - private static final HasteAbility fINSTANCE = new HasteAbility(); + private static final HasteAbility fINSTANCE = new HasteAbility(); private Object readResolve() throws ObjectStreamException { return fINSTANCE; @@ -56,7 +54,7 @@ public class HasteAbility extends StaticAbility implements MageSingleton { @Override public String getRule() { - return "Haste"; + return "haste"; } @Override diff --git a/Mage/src/mage/abilities/keyword/HeroicAbility.java b/Mage/src/mage/abilities/keyword/HeroicAbility.java index 5b89f5d65b1..2df1ea081ce 100644 --- a/Mage/src/mage/abilities/keyword/HeroicAbility.java +++ b/Mage/src/mage/abilities/keyword/HeroicAbility.java @@ -1,34 +1,34 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; import java.util.UUID; +import mage.abilities.Mode; import mage.abilities.SpellAbility; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -44,7 +44,6 @@ import mage.target.Target; * * @author LevelX2 */ - public class HeroicAbility extends TriggeredAbilityImpl { public HeroicAbility(Effect effect) { @@ -83,19 +82,19 @@ public class HeroicAbility extends TriggeredAbilityImpl { private boolean checkSpell(Spell spell, Game game) { if (spell != null) { SpellAbility sa = spell.getSpellAbility(); - for(UUID modeId :sa.getModes().getSelectedModes()) { - for (Target target : sa.getModes().get(modeId).getTargets()) { + for (Mode mode : sa.getModes().getSelectedModes()) { + for (Target target : mode.getTargets()) { if (!target.isNotTarget() && target.getTargets().contains(this.getSourceId())) { return true; } } - for (Effect effect : sa.getModes().get(modeId).getEffects()) { + for (Effect effect : mode.getEffects()) { for (UUID targetId : effect.getTargetPointer().getTargets(game, sa)) { if (targetId.equals(this.getSourceId())) { return true; } } - } + } } } return false; diff --git a/Mage/src/mage/abilities/keyword/HexproofAbility.java b/Mage/src/mage/abilities/keyword/HexproofAbility.java index 900f9eba621..255781973c6 100644 --- a/Mage/src/mage/abilities/keyword/HexproofAbility.java +++ b/Mage/src/mage/abilities/keyword/HexproofAbility.java @@ -1,14 +1,13 @@ package mage.abilities.keyword; import java.io.ObjectStreamException; - import mage.abilities.MageSingleton; import mage.abilities.common.SimpleStaticAbility; import mage.constants.Zone; /** - * Hexproof - * (This creature or player can't be the target of spells or abilities your opponents control.) + * Hexproof (This creature or player can't be the target of spells or abilities + * your opponents control.) * * @author loki */ @@ -39,6 +38,6 @@ public class HexproofAbility extends SimpleStaticAbility implements MageSingleto @Override public String getRule() { - return "Hexproof"; + return "hexproof"; } } diff --git a/Mage/src/mage/abilities/keyword/HideawayAbility.java b/Mage/src/mage/abilities/keyword/HideawayAbility.java index 124e7eec056..a3944296a2f 100644 --- a/Mage/src/mage/abilities/keyword/HideawayAbility.java +++ b/Mage/src/mage/abilities/keyword/HideawayAbility.java @@ -65,7 +65,7 @@ import mage.util.CardUtil; public class HideawayAbility extends StaticAbility { public HideawayAbility() { - super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new TapSourceEffect(true))); + super(Zone.ALL, new EntersBattlefieldEffect(new TapSourceEffect(true))); Ability ability = new EntersBattlefieldTriggeredAbility(new HideawayExileEffect(), false); ability.setRuleVisible(false); addSubAbility(ability); @@ -96,7 +96,7 @@ class HideawayExileEffect extends OneShotEffect { public HideawayExileEffect() { super(Outcome.Benefit); - this.staticText = "Look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library"; + this.staticText = "look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library"; } public HideawayExileEffect(final HideawayExileEffect effect) { @@ -115,17 +115,17 @@ class HideawayExileEffect extends OneShotEffect { if (hideawaySource == null || controller == null) { return false; } - + Cards cards = new CardsImpl(Zone.LIBRARY); - cards.addAll(controller.getLibrary().getTopCards(game, 4)); + cards.addAll(controller.getLibrary().getTopCards(game, 4)); if (cards.size() > 0) { TargetCard target1 = new TargetCard(Zone.LIBRARY, filter1); if (controller.choose(Outcome.Detriment, cards, target1, game)) { Card card = cards.get(target1.getFirstTarget(), game); if (card != null) { cards.remove(card); - controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), - "Hideaway (" + hideawaySource.getIdName() +")", source.getSourceId(), game, Zone.LIBRARY, false); + controller.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), + "Hideaway (" + hideawaySource.getIdName() + ")", source.getSourceId(), game, Zone.LIBRARY, false); card.setFaceDown(true, game); } } @@ -139,7 +139,7 @@ class HideawayExileEffect extends OneShotEffect { class HideawayLookAtFaceDownCardEffect extends AsThoughEffectImpl { public HideawayLookAtFaceDownCardEffect() { - super(AsThoughEffectType.REVEAL_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit); + super(AsThoughEffectType.LOOK_AT_FACE_DOWN, Duration.EndOfGame, Outcome.Benefit); staticText = "You may look at cards exiled with {this}"; } @@ -159,7 +159,7 @@ class HideawayLookAtFaceDownCardEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { - if (game.getState().getZone(objectId) != Zone.EXILED + if (game.getState().getZone(objectId) != Zone.EXILED || !game.getState().getCardState(objectId).isFaceDown()) { return false; } @@ -180,4 +180,3 @@ class HideawayLookAtFaceDownCardEffect extends AsThoughEffectImpl { return false; } } - diff --git a/Mage/src/mage/abilities/keyword/IngestAbility.java b/Mage/src/mage/abilities/keyword/IngestAbility.java new file mode 100644 index 00000000000..8bc5c9857e5 --- /dev/null +++ b/Mage/src/mage/abilities/keyword/IngestAbility.java @@ -0,0 +1,71 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.keyword; + +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class IngestAbility extends DealsCombatDamageToAPlayerTriggeredAbility { + + public IngestAbility() { + super(new IngestEffect(), false, true); + + } + + public IngestAbility(IngestAbility ability) { + super(ability); + } + + @Override + public String getRule() { + return "Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)"; + } + + @Override + public IngestAbility copy() { + return new IngestAbility(this); + } +} + +class IngestEffect extends OneShotEffect { + + public IngestEffect() { + super(Outcome.Exile); + this.staticText = "that player exiles the top card of his or her library"; + } + + public IngestEffect(final IngestEffect effect) { + super(effect); + } + + @Override + public IngestEffect copy() { + return new IngestEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (targetPlayer != null) { + Card card = targetPlayer.getLibrary().getFromTop(game); + if (card != null) { + targetPlayer.moveCards(card, Zone.LIBRARY, Zone.EXILED, source, game); + } + return true; + } + return false; + } +} diff --git a/Mage/src/mage/abilities/keyword/IslandwalkAbility.java b/Mage/src/mage/abilities/keyword/IslandwalkAbility.java index cdd8da7a4c2..b3d8e356a9d 100644 --- a/Mage/src/mage/abilities/keyword/IslandwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/IslandwalkAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.filter.common.FilterLandPermanent; @@ -37,14 +36,18 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class IslandwalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Island"); + private static final FilterLandPermanent filter = new FilterLandPermanent("island"); static { filter.add(new SubtypePredicate("Island")); } public IslandwalkAbility() { - super(filter); + this(true); + } + + public IslandwalkAbility(boolean withHintText) { + super(filter, withHintText); } public IslandwalkAbility(final IslandwalkAbility ability) { diff --git a/Mage/src/mage/abilities/keyword/KickerAbility.java b/Mage/src/mage/abilities/keyword/KickerAbility.java index d28edb5307c..138189fc086 100644 --- a/Mage/src/mage/abilities/keyword/KickerAbility.java +++ b/Mage/src/mage/abilities/keyword/KickerAbility.java @@ -85,8 +85,8 @@ import mage.players.Player; public class KickerAbility extends StaticAbility implements OptionalAdditionalSourceCosts { protected static final String KICKER_KEYWORD = "Kicker"; - protected static final String KICKER_REMINDER_MANA = "(You may pay an additional {cost} as you cast this spell.)"; - protected static final String KICKER_REMINDER_COST = "(You may {cost} in addition to any other costs as you cast this spell.)"; + protected static final String KICKER_REMINDER_MANA = "You may pay an additional {cost} as you cast this spell."; + protected static final String KICKER_REMINDER_COST = "You may {cost} in addition to any other costs as you cast this spell."; protected Map activations = new HashMap<>(); // zoneChangeCounter, activations @@ -203,7 +203,7 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo if (zcc == 0) { zcc = game.getState().getZoneChangeCounter(source.getSourceId()); } - if (zcc > 0 && (source.getAbilityType().equals(AbilityType.TRIGGERED) || source.getAbilityType().equals(AbilityType.STATIC))) { + if (zcc > 0 && (source.getAbilityType().equals(AbilityType.TRIGGERED))) { --zcc; } return String.valueOf(zcc) + ((kickerCosts.size() > 1) ? costText : ""); diff --git a/Mage/src/mage/abilities/keyword/LandwalkAbility.java b/Mage/src/mage/abilities/keyword/LandwalkAbility.java index f3870eb7663..2ff19c332b6 100644 --- a/Mage/src/mage/abilities/keyword/LandwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/LandwalkAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,18 +20,17 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; -import mage.constants.Duration; import mage.abilities.Ability; import mage.abilities.EvasionAbility; import mage.abilities.effects.RestrictionEffect; +import mage.constants.Duration; import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -43,7 +42,11 @@ import mage.game.permanent.Permanent; public class LandwalkAbility extends EvasionAbility { public LandwalkAbility(FilterLandPermanent filter) { - this.addEffect(new LandwalkEffect(filter)); + this(filter, true); + } + + public LandwalkAbility(FilterLandPermanent filter, boolean withHintText) { + this.addEffect(new LandwalkEffect(filter, withHintText)); } public LandwalkAbility(final LandwalkAbility ability) { @@ -55,16 +58,25 @@ public class LandwalkAbility extends EvasionAbility { return new LandwalkAbility(this); } + @Override + public String getRule() { + String ruleText = super.getRule(); + if (!ruleText.isEmpty() && ruleText.endsWith(".")) { + return ruleText.substring(0, ruleText.length() - 1); + } + return ruleText; + } + } class LandwalkEffect extends RestrictionEffect { protected FilterLandPermanent filter; - public LandwalkEffect(FilterLandPermanent filter) { + public LandwalkEffect(FilterLandPermanent filter, boolean withHintText) { super(Duration.WhileOnBattlefield); this.filter = filter; - staticText = filter.getMessage() + "walk"; + staticText = setText(withHintText); } public LandwalkEffect(final LandwalkEffect effect) { @@ -79,10 +91,7 @@ class LandwalkEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getSourceId())) { - return true; - } - return false; + return permanent.getId().equals(source.getSourceId()); } @Override @@ -90,4 +99,34 @@ class LandwalkEffect extends RestrictionEffect { return new LandwalkEffect(this); } -} \ No newline at end of file + private String setText(boolean withHintText) { + // Swampwalk (This creature can't be blocked as long as defending player controls a Swamp.) + StringBuilder sb = new StringBuilder(); + sb.append(filter.getMessage()).append("walk"); + if (withHintText) { + sb.append(" (This creature can't be blocked as long as defending player controls a "); + switch (filter.getMessage()) { + case "swamp": + sb.append("Swamp"); + break; + case "plains": + sb.append("Plains"); + break; + case "mountain": + sb.append("Mountain"); + break; + case "forest": + sb.append("Forest"); + break; + case "island": + sb.append("Island"); + break; + default: + sb.append(filter.getMessage()); + + } + sb.append(".)"); + } + return sb.toString(); + } +} diff --git a/Mage/src/mage/abilities/keyword/LevelerCardBuilder.java b/Mage/src/mage/abilities/keyword/LevelerCardBuilder.java index a5691ed3222..950d40d0088 100644 --- a/Mage/src/mage/abilities/keyword/LevelerCardBuilder.java +++ b/Mage/src/mage/abilities/keyword/LevelerCardBuilder.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,15 +20,15 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; -import mage.constants.Zone; +import java.util.ArrayList; +import java.util.List; import mage.abilities.Abilities; import mage.abilities.AbilitiesImpl; import mage.abilities.Ability; @@ -39,18 +39,17 @@ import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; -import mage.cards.Card; -import mage.cards.LevelerCard; import mage.constants.Duration; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.counters.CounterType; -import java.util.ArrayList; -import java.util.List; - /** - * The implementation by BetaSteward was discarded as requires special handling in Mage.Core. + * The implementation by BetaSteward was discarded as requires special handling + * in Mage.Core. * - * Instead it was replaced by conditional continuous effects and builder pattern. + * Instead it was replaced by conditional continuous effects and builder + * pattern. * * @author BetaSteward_at_googlemail.com * @author noxx @@ -82,7 +81,7 @@ public class LevelerCardBuilder { constructed.add(staticAbility); } - ContinuousEffect effect = new SetPowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield); + ContinuousEffect effect = new SetPowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield, SubLayer.SetPT_7b); ConditionalContinuousEffect ptEffect = new ConditionalContinuousEffect(effect, condition, rule); constructed.add(new SimpleStaticAbility(Zone.BATTLEFIELD, ptEffect)); @@ -212,12 +211,11 @@ public class LevelerCardBuilder { sb.append("Level ").append(level1); if (level2 == -1) { sb.append("+"); - } - else { + } else { sb.append("-").append(level2); } sb.append(": ").append(power).append("/").append(toughness).append(" "); - for (String rule: abilities.getRules("{this}")) { + for (String rule : abilities.getRules("{this}")) { sb.append(rule).append(" "); } return sb.toString(); diff --git a/Mage/src/mage/abilities/keyword/LivingWeaponAbility.java b/Mage/src/mage/abilities/keyword/LivingWeaponAbility.java index f97bb511293..96feaae41bc 100644 --- a/Mage/src/mage/abilities/keyword/LivingWeaponAbility.java +++ b/Mage/src/mage/abilities/keyword/LivingWeaponAbility.java @@ -1,11 +1,14 @@ package mage.abilities.keyword; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; import mage.constants.CardType; -import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; @@ -22,7 +25,7 @@ public class LivingWeaponAbility extends EntersBattlefieldTriggeredAbility { @Override public String getRule() { - return "Living weapon (When this Equipment enters the battlefield, put a 0/0 black Germ creature token onto the battlefield, then attach this to it.)"; + return "Living weapon (When this Equipment enters the battlefield, put a 0/0 black Germ creature token onto the battlefield, then attach this to it.)"; } @Override @@ -31,9 +34,9 @@ public class LivingWeaponAbility extends EntersBattlefieldTriggeredAbility { } } -class LivingWeaponEffect extends OneShotEffect { +class LivingWeaponEffect extends CreateTokenEffect { LivingWeaponEffect() { - super(Outcome.PutCreatureInPlay); + super(new GermToken()); } LivingWeaponEffect(final LivingWeaponEffect effect) { @@ -44,13 +47,13 @@ class LivingWeaponEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - GermToken token = new GermToken(); - token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); - Permanent p = game.getPermanent(token.getLastAddedToken()); - if (p != null) { - p.addAttachment(source.getSourceId(), game); - return true; - } + if (super.apply(game, source)) { + Permanent p = game.getPermanent(this.getLastAddedTokenId()); + if (p != null) { + p.addAttachment(source.getSourceId(), game); + return true; + } + } } return false; } @@ -62,9 +65,16 @@ class LivingWeaponEffect extends OneShotEffect { } class GermToken extends Token { + + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("C14", "MBS", "MM2")); + } + public GermToken() { super("Germ", "a 0/0 black Germ creature token"); - this.setOriginalExpansionSetCode("MBS"); + availableImageSetCodes = tokenImageSets; cardType.add(CardType.CREATURE); color.setBlack(true); subtype.add("Germ"); diff --git a/Mage/src/mage/abilities/keyword/MadnessAbility.java b/Mage/src/mage/abilities/keyword/MadnessAbility.java index b7ceb209ca3..7c0ad8e22dd 100644 --- a/Mage/src/mage/abilities/keyword/MadnessAbility.java +++ b/Mage/src/mage/abilities/keyword/MadnessAbility.java @@ -1,8 +1,11 @@ package mage.abilities.keyword; +import java.util.ArrayList; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.StaticAbility; import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.condition.Condition; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; import mage.abilities.effects.OneShotEffect; @@ -13,7 +16,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.players.Player; @@ -22,27 +24,30 @@ import mage.players.Player; * * 702.33a. Madness is a keyword that represents two abilities. * - * The first is a static ability that functions while the card with madness is in a player's hand. - * The second is a triggered ability that functions when the first ability is applied. + * The first is a static ability that functions while the card with madness is + * in a player's hand. The second is a triggered ability that functions when the + * first ability is applied. * - * "Madness [cost]" means "If a player would discard this card, that player discards it, but may exile it instead of putting it into his or her graveyard" and - * "When this card is exiled this way, its owner may cast it by paying [cost] rather than paying its mana cost. - * If that player doesn't, he or she puts this card into his or her graveyard. + * "Madness [cost]" means "If a player would discard this card, that player + * discards it, but may exile it instead of putting it into his or her + * graveyard" and "When this card is exiled this way, its owner may cast it by + * paying [cost] rather than paying its mana cost. If that player doesn't, he or + * she puts this card into his or her graveyard. * - * 702.33b. Casting a spell using its madness ability follows the rules for paying alternative costs in rules 601.2b and 601.2e-g. + * 702.33b. Casting a spell using its madness ability follows the rules for + * paying alternative costs in rules 601.2b and 601.2e-g. * * @author LevelX2 */ - public class MadnessAbility extends StaticAbility { private String rule; - + @SuppressWarnings("unchecked") public MadnessAbility(Card card, ManaCosts madnessCost) { - super(Zone.HAND, new MadnessReplacementEffect((ManaCosts)madnessCost)); - addSubAbility(new MadnessTriggeredAbility((ManaCosts)madnessCost)); - rule = "Madness " + madnessCost.getText() + " (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)"; + super(Zone.HAND, new MadnessReplacementEffect((ManaCosts) madnessCost)); + addSubAbility(new MadnessTriggeredAbility((ManaCosts) madnessCost)); + rule = "Madness " + madnessCost.getText() + " (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)"; } public MadnessAbility(final MadnessAbility ability) { @@ -54,18 +59,21 @@ public class MadnessAbility extends StaticAbility { return new MadnessAbility(this); } + public static Condition GetCondition() { + return MadnessCondition.getInstance(); + } + @Override public String getRule() { return rule; } } - class MadnessReplacementEffect extends ReplacementEffectImpl { - + public MadnessReplacementEffect(ManaCosts madnessCost) { - super(Duration.EndOfGame, Outcome.Benefit); - staticText = "Madness " + madnessCost.getText() + " (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)"; + super(Duration.EndOfGame, Outcome.Benefit); + staticText = "Madness " + madnessCost.getText() + " (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)"; } public MadnessReplacementEffect(final MadnessReplacementEffect effect) { @@ -90,14 +98,14 @@ class MadnessReplacementEffect extends ReplacementEffectImpl { if (card != null) { if (controller.chooseUse(outcome, "Move " + card.getLogName() + " to exile to cast it by Madness?", source, game)) { controller.moveCardToExileWithInfo(card, source.getSourceId(), "Madness", source.getSourceId(), game, ((ZoneChangeEvent) event).getFromZone(), true); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.MADNESS_CARD_EXILED, card.getId(), card.getId(),controller.getId())); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.MADNESS_CARD_EXILED, card.getId(), card.getId(), controller.getId())); return true; } } } return false; } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ZONE_CHANGE; @@ -105,22 +113,24 @@ class MadnessReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return event.getTargetId().equals(source.getSourceId()) && - ((ZoneChangeEvent) event).getFromZone() == Zone.HAND && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD; + return event.getTargetId().equals(source.getSourceId()) + && ((ZoneChangeEvent) event).getFromZone() == Zone.HAND && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD; } } /** - * Checks for the MADNESS_CARD_EXILED event to ask the player - * if he wants to cast the card by it's Madness costs. - * If not, the card goes to the graveyard. + * Checks for the MADNESS_CARD_EXILED event to ask the player if he wants to + * cast the card by it's Madness costs. If not, the card goes to the graveyard. */ class MadnessTriggeredAbility extends TriggeredAbilityImpl { - - MadnessTriggeredAbility(ManaCosts madnessCost ) { + + //This array holds the Id's of all of the cards that activated madness + private static ArrayList activatedIds = new ArrayList<>(); + + MadnessTriggeredAbility(ManaCosts madnessCost) { super(Zone.EXILED, new MadnessCastEffect(madnessCost), true); - this.setRuleVisible(false); + this.setRuleVisible(false); } MadnessTriggeredAbility(final MadnessTriggeredAbility ability) { @@ -147,17 +157,33 @@ class MadnessTriggeredAbility extends TriggeredAbilityImpl { if (!super.resolve(game)) { Card card = game.getCard(getSourceId()); if (card != null) { - Player owner = game.getPlayer(card.getOwnerId()); + Player owner = game.getPlayer(card.getOwnerId()); if (owner != null) { // if cast was not successfull, the card is moved to graveyard owner.moveCards(card, Zone.EXILED, Zone.GRAVEYARD, this, game); } - } + } return false; } + activatedIds.add(getSourceId()); return true; } + @Override + public boolean isActivated() { + //Look through the list of activated Ids and see if the current source's Id is one of them + for (UUID currentId : activatedIds) { + if (currentId.equals(getSourceId())) { + //Remove the current source from the list, so if the card is somehow recast without + //paying the madness cost, this will return false + activatedIds.remove(currentId); + return true; + } + } + //If the current source's Id was not found, return false + return false; + } + @Override public String getRule() { return "When this card is exiled this way, " + super.getRule(); @@ -165,13 +191,13 @@ class MadnessTriggeredAbility extends TriggeredAbilityImpl { } class MadnessCastEffect extends OneShotEffect { - + private final ManaCosts madnessCost; - + public MadnessCastEffect(ManaCosts madnessCost) { super(Outcome.Benefit); this.madnessCost = madnessCost; - staticText = "cast it by paying " + madnessCost.getText() + " rather than paying its mana cost. If that player doesn’t, he or she puts this card into his or her graveyard."; + staticText = "cast it by paying " + madnessCost.getText() + " rather than paying its mana cost. If that player doesn’t, he or she puts this card into his or her graveyard."; } public MadnessCastEffect(final MadnessCastEffect effect) { @@ -185,7 +211,7 @@ class MadnessCastEffect extends OneShotEffect { Card card = game.getCard(source.getSourceId()); if (card != null) { owner = game.getPlayer(card.getOwnerId()); - } + } if (owner != null && card != null) { ManaCosts costRef = card.getSpellAbility().getManaCostsToPay(); // replace with the new cost @@ -209,3 +235,35 @@ class MadnessCastEffect extends OneShotEffect { return new MadnessCastEffect(this); } } + +class MadnessCondition implements Condition { + + private static MadnessCondition fInstance = null; + + private MadnessCondition() { + } + + public static Condition getInstance() { + if (fInstance == null) { + fInstance = new MadnessCondition(); + } + + return fInstance; + } + + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(source.getSourceId()); + if (card != null) { + for (Ability ability : card.getAbilities()) { + if (ability instanceof MadnessTriggeredAbility) { + if (((MadnessTriggeredAbility) ability).isActivated()) { + return true; + } + } + } + } + return false; + } + +} diff --git a/Mage/src/mage/abilities/keyword/MiracleAbility.java b/Mage/src/mage/abilities/keyword/MiracleAbility.java index 2ba71e795d1..20996fb6625 100644 --- a/Mage/src/mage/abilities/keyword/MiracleAbility.java +++ b/Mage/src/mage/abilities/keyword/MiracleAbility.java @@ -92,7 +92,7 @@ import mage.watchers.common.MiracleWatcher; */ public class MiracleAbility extends TriggeredAbilityImpl { - private static final String staticRule = " (You may cast this card for its miracle cost when you draw it if it's the first card you drew this turn.)"; + private static final String staticRule = " (You may cast this card for its miracle cost when you draw it if it's the first card you drew this turn.)"; private String ruleText; @SuppressWarnings("unchecked") diff --git a/Mage/src/mage/abilities/keyword/ModularAbility.java b/Mage/src/mage/abilities/keyword/ModularAbility.java index 19219e21b2d..5efdb7a01a7 100644 --- a/Mage/src/mage/abilities/keyword/ModularAbility.java +++ b/Mage/src/mage/abilities/keyword/ModularAbility.java @@ -22,24 +22,24 @@ import mage.target.Target; import mage.target.common.TargetArtifactPermanent; import mage.util.CardUtil; - /** * * 702.41. Modular * - * 702.41a Modular represents both a static ability and a triggered ability. - * "Modular N" means "This permanent enters the battlefield with N +1/+1 - * counters on it" and "When this permanent is put into a graveyard - * from the battlefield, you may put a +1/+1 counter on target artifact - * creature for each +1/+1 counter on this permanent." - * 702.41b If a creature has multiple instances of modular, each one works separately. + * 702.41a Modular represents both a static ability and a triggered ability. + * "Modular N" means "This permanent enters the battlefield with N +1/+1 + * counters on it" and "When this permanent is put into a graveyard from the + * battlefield, you may put a +1/+1 counter on target artifact creature for each + * +1/+1 counter on this permanent." 702.41b If a creature has multiple + * instances of modular, each one works separately. + * * - * * @author Loki, LevelX2 */ - public class ModularAbility extends DiesTriggeredAbility { + private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact creature"); + static { filter.add(new CardTypePredicate(CardType.CREATURE)); } @@ -74,7 +74,7 @@ public class ModularAbility extends DiesTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { if (super.checkTrigger(event, game)) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getTarget().getCounters().getCount(CounterType.P1P1) > 0) { return true; } @@ -94,9 +94,9 @@ public class ModularAbility extends DiesTriggeredAbility { sb.append("-Sunburst (This enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it. When it dies, you may put its +1/+1 counters on target artifact creature.)"); } else { sb.append(" ").append(amount).append(" (This enters the battlefield with ") - .append(CardUtil.numberToText(amount, "a")) - .append(" +1/+1 counter").append(amount != 1 ? "s":"") - .append(" on it. When it dies, you may put its +1/+1 counters on target artifact creature.)"); + .append(CardUtil.numberToText(amount, "a")) + .append(" +1/+1 counter").append(amount != 1 ? "s" : "") + .append(" on it. When it dies, you may put its +1/+1 counters on target artifact creature.)"); } return sb.toString(); } @@ -108,10 +108,8 @@ class ModularStaticAbility extends StaticAbility { private String ruleText; public ModularStaticAbility(int amount) { - super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount)))); - ruleText = new StringBuilder("This enters the battlefield with ").append(CardUtil.numberToText(amount, "a")) - .append(" +1/+1 counter").append(amount != 1 ? "s":"") - .append(" on it.").toString(); + super(Zone.ALL, new EntersBattlefieldEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount)))); + ruleText = "This enters the battlefield with " + CardUtil.numberToText(amount, "a") + " +1/+1 counter" + (amount != 1 ? "s" : "") + " on it."; this.setRuleVisible(false); } @@ -131,9 +129,10 @@ class ModularStaticAbility extends StaticAbility { } } - class ModularDistributeCounterEffect extends OneShotEffect { + private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact creature"); + static { filter.add(new CardTypePredicate(CardType.CREATURE)); } diff --git a/Mage/src/mage/abilities/keyword/MorphAbility.java b/Mage/src/mage/abilities/keyword/MorphAbility.java index cba284786e6..fbc7a76bcc2 100644 --- a/Mage/src/mage/abilities/keyword/MorphAbility.java +++ b/Mage/src/mage/abilities/keyword/MorphAbility.java @@ -237,7 +237,7 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost if (player != null) { this.resetMorph(); if (alternateCosts.canPay(ability, sourceId, controllerId, game)) { - if (player.chooseUse(Outcome.Benefit, new StringBuilder("Cast this card as a 2/2 face-down creature for ").append(getCosts().getText()).append(" ?").toString(), ability, game)) { + if (player.chooseUse(Outcome.Benefit, "Cast this card as a 2/2 face-down creature for " + getCosts().getText() + " ?", ability, game)) { activateMorph(game); // change mana costs ability.getManaCostsToPay().clear(); diff --git a/Mage/src/mage/abilities/keyword/MountainwalkAbility.java b/Mage/src/mage/abilities/keyword/MountainwalkAbility.java index 4bb1b8c4986..01a48345567 100644 --- a/Mage/src/mage/abilities/keyword/MountainwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/MountainwalkAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.filter.common.FilterLandPermanent; @@ -37,14 +36,18 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class MountainwalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain"); + private static final FilterLandPermanent filter = new FilterLandPermanent("mountain"); static { filter.add(new SubtypePredicate("Mountain")); } public MountainwalkAbility() { - super(filter); + this(true); + } + + public MountainwalkAbility(boolean withHintText) { + super(filter, withHintText); } public MountainwalkAbility(final MountainwalkAbility ability) { @@ -55,4 +58,4 @@ public class MountainwalkAbility extends LandwalkAbility { public MountainwalkAbility copy() { return new MountainwalkAbility(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/MultikickerAbility.java b/Mage/src/mage/abilities/keyword/MultikickerAbility.java index b7bbe62336f..cfa6a791d51 100644 --- a/Mage/src/mage/abilities/keyword/MultikickerAbility.java +++ b/Mage/src/mage/abilities/keyword/MultikickerAbility.java @@ -43,7 +43,7 @@ import mage.abilities.costs.OptionalAdditionalCost; public class MultikickerAbility extends KickerAbility { protected static final String MultikickerKeyword = "Multikicker"; - protected static final String MultikickerReminder = "(You may pay an additional {cost} any number of times as you cast this spell.)"; + protected static final String MultikickerReminder = "You may pay an additional {cost} any number of times as you cast this spell."; public MultikickerAbility(String manaString) { super(MultikickerKeyword, MultikickerReminder); diff --git a/Mage/src/mage/abilities/keyword/MyriadAbility.java b/Mage/src/mage/abilities/keyword/MyriadAbility.java new file mode 100644 index 00000000000..a6da1169771 --- /dev/null +++ b/Mage/src/mage/abilities/keyword/MyriadAbility.java @@ -0,0 +1,90 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.keyword; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; +import mage.constants.Outcome; +import mage.constants.SetTargetPointer; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +public class MyriadAbility extends AttacksTriggeredAbility { + + public MyriadAbility() { + super(new MyriadEffect(), false, + "Myriad (Whenever this creature attacks, for each opponent other than the defending player, put a token that's a copy of this creature onto the battlefield tapped and attacking that player or a planeswalker he or she controls. Exile those tokens at the end of combat.)", + SetTargetPointer.PLAYER + ); + } + + public MyriadAbility(final MyriadAbility ability) { + super(ability); + } + + @Override + public MyriadAbility copy() { + return new MyriadAbility(this); + } + +} + +class MyriadEffect extends OneShotEffect { + + public MyriadEffect() { + super(Outcome.Benefit); + this.staticText = "for each opponent other than the defending player, you may put a token that's a copy of this creature onto the battlefield tapped and attacking that player or a planeswalker he or she controls. Exile the tokens at the end of combat"; + } + + public MyriadEffect(final MyriadEffect effect) { + super(effect); + } + + @Override + public MyriadEffect copy() { + return new MyriadEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (controller != null && sourceObject != null) { + UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(source.getSourceId(), game); + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + if (playerId != defendingPlayerId && controller.hasOpponent(playerId, game)) { + Player opponent = game.getPlayer(playerId); + if (opponent != null && controller.chooseUse(Outcome.PutCreatureInPlay, + "Put a copy of " + sourceObject.getIdName() + " onto battlefield attacking " + opponent.getName() + "?", source, game)) { + PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(controller.getId(), null, false, 1, true, true, playerId); + effect.setTargetPointer(new FixedTarget(sourceObject, game)); + effect.apply(game, source); + for (Permanent tokenPermanent : effect.getAddedPermanent()) { + ExileTargetEffect exileEffect = new ExileTargetEffect(); + exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game)); + DelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + game.addDelayedTriggeredAbility(delayedAbility); + } + } + } + + } + return true; + } + return false; + } +} diff --git a/Mage/src/mage/abilities/keyword/NinjutsuAbility.java b/Mage/src/mage/abilities/keyword/NinjutsuAbility.java index 23d23b2aad4..8fc900bd3d1 100644 --- a/Mage/src/mage/abilities/keyword/NinjutsuAbility.java +++ b/Mage/src/mage/abilities/keyword/NinjutsuAbility.java @@ -1,36 +1,33 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; import java.util.UUID; - -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.ActivatedAbilityImpl; import mage.abilities.costs.Cost; @@ -41,6 +38,7 @@ import mage.cards.Card; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.constants.Outcome; +import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.UnblockedPredicate; import mage.game.Game; @@ -52,9 +50,9 @@ import mage.target.common.TargetControlledPermanent; /** * 702.47. Ninjutsu * - * 702.47a Ninjutsu is an activated ability that functions only while the card - * with ninjutsu is in a player's hand. "Ninjutsu [cost]" means "[Cost], Reveal - * this card from your hand, Return an unblocked attacking creature you control + * 702.47a Ninjutsu is an activated ability that functions only while the card + * with ninjutsu is in a player's hand. "Ninjutsu [cost]" means "[Cost], Reveal + * this card from your hand, Return an unblocked attacking creature you control * to its owner's hand: Put this card onto the battlefield from your hand tapped * and attacking." * @@ -62,8 +60,8 @@ import mage.target.common.TargetControlledPermanent; * announced until the ability leaves the stack. * * 702.47c A ninjutsu ability may be activated only while a creature on the - * battlefield is unblocked (see rule 509.1h). The creature with ninjutsu is - * put onto the battlefield unblocked. It will be attacking the same player or + * battlefield is unblocked (see rule 509.1h). The creature with ninjutsu is put + * onto the battlefield unblocked. It will be attacking the same player or * planeswalker as the creature that was returned to its owner's hand. * * @@ -78,13 +76,13 @@ public class NinjutsuAbility extends ActivatedAbilityImpl { } /** - * + * * @param manaCost ninjutsu mana cost */ public NinjutsuAbility(ManaCost manaCost) { - super(Zone.HAND,new NinjutsuEffect(), manaCost); + super(Zone.HAND, new NinjutsuEffect(), manaCost); this.addCost(new RevealNinjutsuCardCost()); - this.addCost(new ReturnAttackerToHandTargetCost(new TargetControlledCreaturePermanent(1,1,filter,false))); + this.addCost(new ReturnAttackerToHandTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true))); } public NinjutsuAbility(NinjutsuAbility ability) { @@ -128,7 +126,7 @@ class NinjutsuEffect extends OneShotEffect { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { UUID defendingPlayerId = null; - for (Cost cost :source.getCosts()) { + for (Cost cost : source.getCosts()) { if (cost instanceof ReturnAttackerToHandTargetCost) { defendingPlayerId = ((ReturnAttackerToHandTargetCost) cost).getDefendingPlayerId(); } @@ -161,7 +159,7 @@ class ReturnAttackerToHandTargetCost extends CostImpl { @Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { if (targets.choose(Outcome.ReturnToHand, controllerId, sourceId, game)) { - for (UUID targetId: targets.get(0).getTargets()) { + for (UUID targetId : targets.get(0).getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent == null) { return false; diff --git a/Mage/src/mage/abilities/keyword/OutlastAbility.java b/Mage/src/mage/abilities/keyword/OutlastAbility.java index a04377e4060..3cf864db724 100644 --- a/Mage/src/mage/abilities/keyword/OutlastAbility.java +++ b/Mage/src/mage/abilities/keyword/OutlastAbility.java @@ -60,7 +60,7 @@ public class OutlastAbility extends ActivatedAbilityImpl { @Override public String getRule() { StringBuilder sb = new StringBuilder("Outlast ").append(manaCosts.getText()); - sb.append(" (").append(getManaCosts().getText()).append(", ").append(getCosts().getText()).append(": Put a +1/+1 counter on this creature. Outlast only as a sorcery.)").toString(); + sb.append(" (").append(getManaCosts().getText()).append(", ").append(getCosts().getText()).append(": Put a +1/+1 counter on this creature. Outlast only as a sorcery.)"); return sb.toString(); } diff --git a/Mage/src/mage/abilities/keyword/PersistAbility.java b/Mage/src/mage/abilities/keyword/PersistAbility.java index 2577fec20eb..3f4a297c7de 100644 --- a/Mage/src/mage/abilities/keyword/PersistAbility.java +++ b/Mage/src/mage/abilities/keyword/PersistAbility.java @@ -1,50 +1,45 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; import mage.abilities.Ability; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; -import mage.constants.Duration; import mage.constants.Outcome; import mage.counters.CounterType; +import mage.counters.Counters; import mage.game.Game; -import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; - - public class PersistAbility extends DiesTriggeredAbility { public PersistAbility() { @@ -73,7 +68,6 @@ public class PersistAbility extends DiesTriggeredAbility { if (permanent.getCounters().getCount(CounterType.M1M1) == 0) { FixedTarget fixedTarget = new FixedTarget(permanent.getId()); fixedTarget.init(game, this); - game.getState().setValue("persist" + getSourceId().toString(), fixedTarget); return true; } } @@ -104,58 +98,9 @@ class PersistEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - game.addEffect(new PersistReplacementEffect(), source); + Counters countersToAdd = new Counters(); + countersToAdd.addCounter(CounterType.M1M1.createInstance()); + game.setEnterWithCounters(source.getSourceId(), countersToAdd); return true; } } - -class PersistReplacementEffect extends ReplacementEffectImpl { - - PersistReplacementEffect() { - super(Duration.Custom, Outcome.UnboostCreature, false); - selfScope = true; - staticText = "return it to the battlefield under its owner's control with a -1/-1 counter on it"; - } - - PersistReplacementEffect(final PersistReplacementEffect effect) { - super(effect); - } - - @Override - public PersistReplacementEffect copy() { - return new PersistReplacementEffect(this); - } - - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null) { - permanent.addCounters(CounterType.M1M1.createInstance(), game); - } - discard(); - return false; - } - - @Override - public boolean checksEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getTargetId().equals(source.getSourceId())) { - Object fixedTarget = game.getState().getValue("persist" + source.getSourceId().toString()); - if (fixedTarget instanceof FixedTarget && ((FixedTarget) fixedTarget).getTarget().equals(source.getSourceId()) && - ((FixedTarget) fixedTarget).getZoneChangeCounter() + 1 == game.getState().getZoneChangeCounter(source.getSourceId())) { - - return true; - } - } - return false; - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } -} diff --git a/Mage/src/mage/abilities/keyword/PlainswalkAbility.java b/Mage/src/mage/abilities/keyword/PlainswalkAbility.java index bdd8b688d21..f16dfa05ff2 100644 --- a/Mage/src/mage/abilities/keyword/PlainswalkAbility.java +++ b/Mage/src/mage/abilities/keyword/PlainswalkAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.filter.common.FilterLandPermanent; @@ -33,18 +32,22 @@ import mage.filter.predicate.mageobject.SubtypePredicate; /** * - * @author nantuko + * @author BetaSteward_at_googlemail.com */ public class PlainswalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Plains"); + private static final FilterLandPermanent filter = new FilterLandPermanent("plains"); static { filter.add(new SubtypePredicate("Plains")); } public PlainswalkAbility() { - super(filter); + this(true); + } + + public PlainswalkAbility(boolean withHintText) { + super(filter, withHintText); } public PlainswalkAbility(final PlainswalkAbility ability) { @@ -55,4 +58,4 @@ public class PlainswalkAbility extends LandwalkAbility { public PlainswalkAbility copy() { return new PlainswalkAbility(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/ProtectionAbility.java b/Mage/src/mage/abilities/keyword/ProtectionAbility.java index 3cacac49811..ff234e4ae40 100644 --- a/Mage/src/mage/abilities/keyword/ProtectionAbility.java +++ b/Mage/src/mage/abilities/keyword/ProtectionAbility.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.StaticAbility; import mage.cards.Card; +import mage.constants.CardType; import mage.constants.Zone; import mage.filter.Filter; import mage.filter.FilterCard; @@ -40,6 +41,7 @@ import mage.filter.FilterSpell; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; +import mage.game.stack.StackObject; /** * @@ -83,18 +85,25 @@ public class ProtectionAbility extends StaticAbility { } return true; } - if (filter instanceof FilterSpell) { - if (source instanceof Spell) { - return !filter.match(source, game); - } - return true; - } + if (filter instanceof FilterCard) { if (source instanceof Card) { return !filter.match(source, game); } return true; } + if (filter instanceof FilterSpell) { + if (source instanceof Spell) { + return !filter.match(source, game); + } + // Problem here is that for the check if a player can play a Spell, the source + // object is still a card and not a spell yet. So retunr only if the source object can't be a spell + // otherwise the following FilterObject check will be appied + if (source instanceof StackObject + || (!source.getCardType().contains(CardType.INSTANT) && !source.getCardType().contains(CardType.SORCERY))) { + return true; + } + } if (filter instanceof FilterObject) { return !filter.match(source, game); } diff --git a/Mage/src/mage/abilities/keyword/ProvokeAbility.java b/Mage/src/mage/abilities/keyword/ProvokeAbility.java index 94b4c53f65d..d92a4f1642f 100644 --- a/Mage/src/mage/abilities/keyword/ProvokeAbility.java +++ b/Mage/src/mage/abilities/keyword/ProvokeAbility.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import java.util.UUID; @@ -42,26 +41,24 @@ import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; /** - * 702.38. Provoke - * 702.38a Provoke is a triggered ability. “Provoke” means “Whenever this creature attacks, you may - * choose to have target creature defending player controls block this creature this combat - * if able. If you do, untap that creature.” - * 702.38b If a creature has multiple instances of provoke, each triggers separately. + * 702.38. Provoke 702.38a Provoke is a triggered ability. “Provoke” means + * “Whenever this creature attacks, you may choose to have target creature + * defending player controls block this creature this combat if able. If you do, + * untap that creature.” 702.38b If a creature has multiple instances of + * provoke, each triggers separately. * * @author LevelX2 * */ - public class ProvokeAbility extends AttacksTriggeredAbility { - public ProvokeAbility() { + public ProvokeAbility() { super(new UntapTargetEffect(), true, "Provoke (Whenever this attacks, you may have target creature defending player controls untap and block it if able.)"); this.addEffect(new ProvokeRequirementEffect()); } public ProvokeAbility(final ProvokeAbility ability) { super(ability); - this.text = ability.text; } @Override diff --git a/Mage/src/mage/abilities/keyword/RampageAbility.java b/Mage/src/mage/abilities/keyword/RampageAbility.java new file mode 100644 index 00000000000..f399d80f7c3 --- /dev/null +++ b/Mage/src/mage/abilities/keyword/RampageAbility.java @@ -0,0 +1,106 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.keyword; + +import mage.abilities.Ability; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.constants.Duration; +import mage.game.Game; +import mage.game.combat.CombatGroup; +import mage.game.events.GameEvent; + +/** + * + * @author LoneFox + */ + +public class RampageAbility extends BecomesBlockedTriggeredAbility { + + private final String rule; + + public RampageAbility(int amount) { + super(null, false); + rule = "rampage " + amount; + RampageValue rv = new RampageValue(amount); + this.addEffect(new BoostSourceEffect(rv, rv, Duration.EndOfTurn)); + } + + public RampageAbility(final RampageAbility ability) { + super(ability); + this.rule = ability.rule; + } + + @Override + public RampageAbility copy() { + return new RampageAbility(this); + } + + @Override + public String getRule() { + return rule; + } +} + + +class RampageValue implements DynamicValue { + + private final int amount; + + public RampageValue(int amount) { + this.amount = amount; + } + + public RampageValue(final RampageValue value) { + this.amount = value.amount; + } + + @Override + public RampageValue copy() { + return new RampageValue(this); + } + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + int count = 0; + for(CombatGroup combatGroup : game.getCombat().getGroups()) { + if(combatGroup.getAttackers().contains(sourceAbility.getSourceId())) { + int blockers = combatGroup.getBlockers().size(); + return blockers > 1 ? (blockers - 1) * amount : 0; + } + } + return 0; + } + + @Override + public String getMessage() { + return "Rampage " + amount; + } +} diff --git a/Mage/src/mage/abilities/keyword/ReboundAbility.java b/Mage/src/mage/abilities/keyword/ReboundAbility.java index 6bd8c0d6527..7ab46d546e0 100644 --- a/Mage/src/mage/abilities/keyword/ReboundAbility.java +++ b/Mage/src/mage/abilities/keyword/ReboundAbility.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; import java.util.UUID; @@ -48,28 +47,29 @@ import mage.game.stack.Spell; import mage.players.Player; /** - * This ability has no effect by default and will always return false on the call - * to apply. This is because of how the {@link ReboundEffect} works. It will - * install the effect if and only if the spell was cast from the {@link Zone#HAND Hand}. + * This ability has no effect by default and will always return false on the + * call to apply. This is because of how the {@link ReboundEffect} works. It + * will install the effect if and only if the spell was cast from the + * {@link Zone#HAND Hand}. *

* 702.85. Rebound *

- * 702.85a Rebound appears on some instants and sorceries. It represents a static - * ability that functions while the spell is on the stack and may create a delayed - * triggered ability. "Rebound" means "If this spell was cast from your hand, - * instead of putting it into your graveyard as it resolves, exile it and, at - * the beginning of your next upkeep, you may cast this card from exile without - * paying its mana cost." + * 702.85a Rebound appears on some instants and sorceries. It represents a + * static ability that functions while the spell is on the stack and may create + * a delayed triggered ability. "Rebound" means "If this spell was cast from + * your hand, instead of putting it into your graveyard as it resolves, exile it + * and, at the beginning of your next upkeep, you may cast this card from exile + * without paying its mana cost." *

- * 702.85b Casting a card without paying its mana cost as the result of a rebound - * ability follows the rules for paying alternative costs in rules 601.2b and 601.2e-g. + * 702.85b Casting a card without paying its mana cost as the result of a + * rebound ability follows the rules for paying alternative costs in rules + * 601.2b and 601.2e-g. *

* 702.85c Multiple instances of rebound on the same spell are redundant. * * @author maurer.it_at_gmail.com, noxx */ - -public class ReboundAbility extends SimpleStaticAbility { +public class ReboundAbility extends SimpleStaticAbility { public ReboundAbility() { super(Zone.STACK, new ReboundCastFromHandReplacementEffect()); @@ -81,8 +81,8 @@ public class ReboundAbility extends SimpleStaticAbility { @Override public ReboundAbility copy() { - return new ReboundAbility(this); - } + return new ReboundAbility(this); + } } class ReboundCastFromHandReplacementEffect extends ReplacementEffectImpl { @@ -95,7 +95,7 @@ class ReboundCastFromHandReplacementEffect extends ReplacementEffectImpl { ReboundCastFromHandReplacementEffect(ReboundCastFromHandReplacementEffect effect) { super(effect); } - + @Override public boolean checksEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ZONE_CHANGE; @@ -103,16 +103,18 @@ class ReboundCastFromHandReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (((ZoneChangeEvent) event).getFromZone() == Zone.STACK && - ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && - event.getSourceId() == source.getSourceId()) { // if countered the source.sourceId is different or null if it fizzles + if (((ZoneChangeEvent) event).getFromZone() == Zone.STACK + && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD + && event.getSourceId() != null + && event.getSourceId().equals(source.getSourceId())) { // if countered the source.sourceId is different or null if it fizzles Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getFromZone().equals(Zone.HAND)) { return true; - } + } } return false; } + @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Spell sourceSpell = game.getStack().getSpell(source.getSourceId()); @@ -126,9 +128,9 @@ class ReboundCastFromHandReplacementEffect extends ReplacementEffectImpl { // Add the delayed triggered effect ReboundEffectCastFromExileDelayedTrigger trigger = new ReboundEffectCastFromExileDelayedTrigger(source.getSourceId(), source.getSourceId()); trigger.setControllerId(source.getControllerId()); - trigger.setSourceObject(source.getSourceObject(game), game); + trigger.setSourceObject(source.getSourceObject(game), game); game.addDelayedTriggeredAbility(trigger); - + player.moveCardToExileWithInfo(sourceCard, sourceCard.getId(), player.getName() + " Rebound", source.getSourceId(), game, Zone.STACK, true); return true; } @@ -144,7 +146,6 @@ class ReboundCastFromHandReplacementEffect extends ReplacementEffectImpl { } - class ReboundEffectCastFromExileDelayedTrigger extends DelayedTriggeredAbility { ReboundEffectCastFromExileDelayedTrigger(UUID cardId, UUID sourceId) { @@ -171,6 +172,7 @@ class ReboundEffectCastFromExileDelayedTrigger extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { return MyTurnCondition.getInstance().apply(game, this); } + @Override public String getRule() { return "Rebound - You may cast {this} from exile without paying its mana cost."; @@ -178,8 +180,8 @@ class ReboundEffectCastFromExileDelayedTrigger extends DelayedTriggeredAbility { } /** - * Will be triggered by {@link ReboundEffectCastFromExileDelayedTrigger} and will - * simply cast the spell then remove it from its former home in exile. + * Will be triggered by {@link ReboundEffectCastFromExileDelayedTrigger} and + * will simply cast the spell then remove it from its former home in exile. * * @author maurer.it_at_gmail.com */ diff --git a/Mage/src/mage/abilities/keyword/RenownAbility.java b/Mage/src/mage/abilities/keyword/RenownAbility.java index 878a7659768..7a4e2aab391 100644 --- a/Mage/src/mage/abilities/keyword/RenownAbility.java +++ b/Mage/src/mage/abilities/keyword/RenownAbility.java @@ -101,9 +101,9 @@ class BecomesRenownedSourceEffect extends OneShotEffect { // Renown 1 (When this creature deals combat damage to a player, if it isn't renowned, put a +1/+1 counter on it and it becomes renowned.) StringBuilder sb = new StringBuilder("Renown "); sb.append(renownValue == Integer.MAX_VALUE ? "X" : renownValue) - .append(". (When this creature deals combat damage to a player, if it isn't renowned, put ") + .append(" (When this creature deals combat damage to a player, if it isn't renowned, put ") .append(renownValue == Integer.MAX_VALUE ? "X" : CardUtil.numberToText(renownValue, "a")) - .append(" +1/+1 counter on it and it becomes renowned.)").toString(); + .append(" +1/+1 counter on it and it becomes renowned.)"); return sb.toString(); } diff --git a/Mage/src/mage/abilities/keyword/ReplicateAbility.java b/Mage/src/mage/abilities/keyword/ReplicateAbility.java index 8be57a3997e..ed5c34e1a2f 100644 --- a/Mage/src/mage/abilities/keyword/ReplicateAbility.java +++ b/Mage/src/mage/abilities/keyword/ReplicateAbility.java @@ -56,7 +56,7 @@ import mage.players.Player; public class ReplicateAbility extends StaticAbility implements OptionalAdditionalSourceCosts { private static final String keywordText = "Replicate"; - private static final String reminderTextMana = "(When you cast this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies.)"; + private static final String reminderTextMana = "When you cast this spell, copy it for each time you paid its replicate cost. You may choose new targets for the copies."; protected OptionalAdditionalCost additionalCost; public ReplicateAbility(Card card, String manaString) { diff --git a/Mage/src/mage/abilities/keyword/RetraceAbility.java b/Mage/src/mage/abilities/keyword/RetraceAbility.java index 4c26c31b6cd..21e6b84d9ed 100644 --- a/Mage/src/mage/abilities/keyword/RetraceAbility.java +++ b/Mage/src/mage/abilities/keyword/RetraceAbility.java @@ -28,6 +28,7 @@ package mage.abilities.keyword; import mage.abilities.SpellAbility; +import mage.abilities.costs.Cost; import mage.abilities.costs.common.DiscardTargetCost; import mage.cards.Card; import mage.constants.SpellAbilityType; @@ -39,19 +40,20 @@ import mage.target.common.TargetCardInHand; * * @author LevelX2 */ - public class RetraceAbility extends SpellAbility { public RetraceAbility(Card card) { super(card.getManaCost(), card.getName() + " with retrace", Zone.GRAVEYARD, SpellAbilityType.BASE_ALTERNATE); this.getCosts().addAll(card.getSpellAbility().getCosts().copy()); - this.addCost(new DiscardTargetCost(new TargetCardInHand(new FilterLandCard()))); + Cost cost = new DiscardTargetCost(new TargetCardInHand(new FilterLandCard())); + cost.setText(""); + this.addCost(cost); this.getEffects().addAll(card.getSpellAbility().getEffects().copy()); this.getTargets().addAll(card.getSpellAbility().getTargets().copy()); this.getChoices().addAll(card.getSpellAbility().getChoices().copy()); this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; this.timing = card.getSpellAbility().getTiming(); - + } public RetraceAbility(final RetraceAbility ability) { diff --git a/Mage/src/mage/abilities/keyword/RippleAbility.java b/Mage/src/mage/abilities/keyword/RippleAbility.java index ad404d5e871..dde3a57961e 100644 --- a/Mage/src/mage/abilities/keyword/RippleAbility.java +++ b/Mage/src/mage/abilities/keyword/RippleAbility.java @@ -59,7 +59,7 @@ public class RippleAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Ripple ((When you cast this spell, you may reveal the top " + CardUtil.numberToText(rippleNumber) + " cards of your library. You may cast any revealed cards with the same name as this spell without paying their mana costs. Put the rest on the bottom of your library.))"; + return "Ripple " + rippleNumber + " (When you cast this spell, you may reveal the top " + CardUtil.numberToText(rippleNumber) + " cards of your library. You may cast any revealed cards with the same name as this spell without paying their mana costs. Put the rest on the bottom of your library.)"; } diff --git a/Mage/src/mage/abilities/keyword/SoulbondAbility.java b/Mage/src/mage/abilities/keyword/SoulbondAbility.java index eb39830a782..f8150ded958 100644 --- a/Mage/src/mage/abilities/keyword/SoulbondAbility.java +++ b/Mage/src/mage/abilities/keyword/SoulbondAbility.java @@ -54,7 +54,7 @@ public class SoulbondAbility extends StaticAbility implements MageSingleton { @Override public String getRule() { - return "Soulbond (You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.)"; + return "Soulbond (You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.)"; } @Override diff --git a/Mage/src/mage/abilities/keyword/SoulshiftAbility.java b/Mage/src/mage/abilities/keyword/SoulshiftAbility.java index 7927a9fd7d7..96f32a31dc9 100644 --- a/Mage/src/mage/abilities/keyword/SoulshiftAbility.java +++ b/Mage/src/mage/abilities/keyword/SoulshiftAbility.java @@ -89,10 +89,10 @@ public class SoulshiftAbility extends DiesTriggeredAbility { @Override public String getRule() { if (amount instanceof StaticValue) { - return "Soulshift " + amount.toString() + " (When this creature dies, you may return target Spirit card with converted mana cost " + amount.toString() + " or less from your graveyard to your hand.)"; + return "Soulshift " + amount.toString() + " (When this creature dies, you may return target Spirit card with converted mana cost " + amount.toString() + " or less from your graveyard to your hand.)"; } else { return "{this} has soulshift X, where X is the number of " + amount.getMessage() + - ". (When this creature dies, you may return target Spirit card with converted mana cost X or less from your graveyard to your hand.)"; + ". (When this creature dies, you may return target Spirit card with converted mana cost X or less from your graveyard to your hand.)"; } } diff --git a/Mage/src/mage/abilities/keyword/StormAbility.java b/Mage/src/mage/abilities/keyword/StormAbility.java index df0352dece5..9994e218b05 100644 --- a/Mage/src/mage/abilities/keyword/StormAbility.java +++ b/Mage/src/mage/abilities/keyword/StormAbility.java @@ -84,7 +84,7 @@ public class StormAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Storm (When you cast this spell, copy it for each spell cast before it this turn. You may choose new targets for the copies.)" ; + return "Storm (When you cast this spell, copy it for each spell cast before it this turn. You may choose new targets for the copies.)" ; } } diff --git a/Mage/src/mage/abilities/keyword/SunburstAbility.java b/Mage/src/mage/abilities/keyword/SunburstAbility.java index 12b9d7834ae..ba1b59adcee 100644 --- a/Mage/src/mage/abilities/keyword/SunburstAbility.java +++ b/Mage/src/mage/abilities/keyword/SunburstAbility.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.abilities.Ability; @@ -46,25 +45,22 @@ import mage.players.Player; * * @author Plopman */ +public class SunburstAbility extends EntersBattlefieldAbility { - -public class SunburstAbility extends EntersBattlefieldAbility{ - - private final static String ruleCreature ="Sunburst (This enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.)"; - private final static String ruleNonCreature ="Sunburst (This enters the battlefield with a charge counter on it for each color of mana spent to cast it.)"; + private final static String ruleCreature = "Sunburst (This enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.)"; + private final static String ruleNonCreature = "Sunburst (This enters the battlefield with a charge counter on it for each color of mana spent to cast it.)"; private boolean isCreature; - public SunburstAbility(Card card){ - super(new SunburstEffect(),""); + public SunburstAbility(Card card) { + super(new SunburstEffect(), ""); isCreature = card.getCardType().contains(CardType.CREATURE); } - - public SunburstAbility(final SunburstAbility ability){ + + public SunburstAbility(final SunburstAbility ability) { super(ability); this.isCreature = ability.isCreature; } - - + @Override public EntersBattlefieldAbility copy() { return new SunburstAbility(this); @@ -74,15 +70,13 @@ public class SunburstAbility extends EntersBattlefieldAbility{ public String getRule() { return isCreature ? ruleCreature : ruleNonCreature; } - - + } class SunburstEffect extends OneShotEffect { private static final DynamicValue amount = new SunburstCount(); - public SunburstEffect() { super(Outcome.Benefit); staticText = "Sunburst"; @@ -94,22 +88,21 @@ class SunburstEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (permanent != null) { Counter counter; - if(permanent.getCardType().contains(CardType.CREATURE)){ - counter = CounterType.P1P1.createInstance(amount.calculate(game, source, this)); - } - else{ - counter = CounterType.CHARGE.createInstance(amount.calculate(game, source, this)); + if (permanent.getCardType().contains(CardType.CREATURE)) { + counter = CounterType.P1P1.createInstance(amount.calculate(game, source, this)); + } else { + counter = CounterType.CHARGE.createInstance(amount.calculate(game, source, this)); } if (counter != null) { - + permanent.addCounters(counter, game); if (!game.isSimulation()) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - game.informPlayers(player.getLogName()+ " puts " + counter.getCount() + " " + counter.getName() + " counter on " + permanent.getName()); + game.informPlayers(player.getLogName() + " puts " + counter.getCount() + " " + counter.getName() + " counter on " + permanent.getName()); } } } diff --git a/Mage/src/mage/abilities/keyword/SuspendAbility.java b/Mage/src/mage/abilities/keyword/SuspendAbility.java index 03b50951133..fbb97482b8f 100644 --- a/Mage/src/mage/abilities/keyword/SuspendAbility.java +++ b/Mage/src/mage/abilities/keyword/SuspendAbility.java @@ -40,6 +40,7 @@ import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.VariableManaCost; import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.counter.RemoveCounterSourceEffect; @@ -57,6 +58,7 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.players.Player; +import mage.target.targetpointer.FixedTarget; /** * @@ -183,7 +185,7 @@ public class SuspendAbility extends ActivatedAbilityImpl { setRuleAtTheTop(true); } addSubAbility(new SuspendBeginningOfUpkeepTriggeredAbility()); - addSubAbility(new SuspendPlayCardAbility(card.getCardType().contains(CardType.CREATURE))); + addSubAbility(new SuspendPlayCardAbility()); } ruleText = sb.toString(); } @@ -208,7 +210,7 @@ public class SuspendAbility extends ActivatedAbilityImpl { game.getState().addOtherAbility(card, ability1); game.getState().addAbility(ability1, source.getSourceId(), card); - SuspendPlayCardAbility ability2 = new SuspendPlayCardAbility(card.getCardType().contains(CardType.CREATURE)); + SuspendPlayCardAbility ability2 = new SuspendPlayCardAbility(); ability2.setSourceId(card.getId()); ability2.setControllerId(card.getOwnerId()); game.getState().addOtherAbility(card, ability2); @@ -298,11 +300,8 @@ class SuspendExileEffect extends OneShotEffect { class SuspendPlayCardAbility extends TriggeredAbilityImpl { - public SuspendPlayCardAbility(boolean isCreature) { - super(Zone.EXILED, new SuspendPlayCardEffect(isCreature)); - if (isCreature) { - this.addEffect(new GainHasteEffect()); - } + public SuspendPlayCardAbility() { + super(Zone.EXILED, new SuspendPlayCardEffect()); setRuleVisible(false); } @@ -329,7 +328,7 @@ class SuspendPlayCardAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "When the last time counter is removed from this card, if it's removed from the game, " + super.getRule(); + return "When the last time counter is removed from this card ({this}), if it's removed from the game, " + super.getRule(); } @Override @@ -340,7 +339,7 @@ class SuspendPlayCardAbility extends TriggeredAbilityImpl { class SuspendPlayCardEffect extends OneShotEffect { - public SuspendPlayCardEffect(boolean isCreature) { + public SuspendPlayCardEffect() { super(Outcome.PutCardInPlay); this.staticText = "play it without paying its mana cost if able. If you can't, it remains removed from the game"; } @@ -378,7 +377,14 @@ class SuspendPlayCardEffect extends OneShotEffect { card.getAbilities().removeAll(abilitiesToRemove); } // cast the card for free - return player.cast(card.getSpellAbility(), game, true); + if (player.cast(card.getSpellAbility(), game, true)) { + if (card.getCardType().contains(CardType.CREATURE)) { + ContinuousEffect effect = new GainHasteEffect(); + effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game) + 1)); + game.addEffect(effect, source); + } + return true; + } } return false; } @@ -408,14 +414,17 @@ class GainHasteEffect extends ContinuousEffectImpl { if (suspendController == null) { suspendController = source.getControllerId(); } - Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null) { if (suspendController.equals(source.getControllerId())) { permanent.addAbility(HasteAbility.getInstance(), source.getSourceId(), game); - return true; } else { this.discard(); } + return true; + } + if (game.getState().getZoneChangeCounter(((FixedTarget) getTargetPointer()).getTarget()) >= ((FixedTarget) getTargetPointer()).getZoneChangeCounter()) { + this.discard(); } return false; } @@ -427,7 +436,7 @@ class SuspendBeginningOfUpkeepTriggeredAbility extends ConditionalTriggeredAbili public SuspendBeginningOfUpkeepTriggeredAbility() { super(new BeginningOfUpkeepTriggeredAbility(Zone.EXILED, new RemoveCounterSourceEffect(CounterType.TIME.createInstance()), TargetController.YOU, false), SuspendedCondition.getInstance(), - "At the beginning of your upkeep, if this card is suspended, remove a time counter from it."); + "At the beginning of your upkeep, if this card ({this}) is suspended, remove a time counter from it."); this.setRuleVisible(false); } diff --git a/Mage/src/mage/abilities/keyword/SwampwalkAbility.java b/Mage/src/mage/abilities/keyword/SwampwalkAbility.java index 4da62606752..492ff7bb292 100644 --- a/Mage/src/mage/abilities/keyword/SwampwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/SwampwalkAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import mage.filter.common.FilterLandPermanent; @@ -37,14 +36,18 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class SwampwalkAbility extends LandwalkAbility { - private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp"); + private static final FilterLandPermanent filter = new FilterLandPermanent("swamp"); static { filter.add(new SubtypePredicate("Swamp")); } public SwampwalkAbility() { - super(filter); + this(true); + } + + public SwampwalkAbility(boolean withHintText) { + super(filter, withHintText); } public SwampwalkAbility(final SwampwalkAbility ability) { @@ -55,4 +58,4 @@ public class SwampwalkAbility extends LandwalkAbility { public SwampwalkAbility copy() { return new SwampwalkAbility(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/TrampleAbility.java b/Mage/src/mage/abilities/keyword/TrampleAbility.java index ea6d253ff7a..20827ee62f3 100644 --- a/Mage/src/mage/abilities/keyword/TrampleAbility.java +++ b/Mage/src/mage/abilities/keyword/TrampleAbility.java @@ -1,38 +1,36 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.keyword; -import mage.constants.Zone; +import java.io.ObjectStreamException; import mage.abilities.MageSingleton; import mage.abilities.StaticAbility; - -import java.io.ObjectStreamException; +import mage.constants.Zone; /** * @@ -40,7 +38,7 @@ import java.io.ObjectStreamException; */ public class TrampleAbility extends StaticAbility implements MageSingleton { - private static final TrampleAbility fINSTANCE = new TrampleAbility(); + private static final TrampleAbility fINSTANCE = new TrampleAbility(); private Object readResolve() throws ObjectStreamException { return fINSTANCE; @@ -56,7 +54,7 @@ public class TrampleAbility extends StaticAbility implements MageSingleton { @Override public String getRule() { - return "Trample"; + return "trample"; } @Override @@ -64,4 +62,4 @@ public class TrampleAbility extends StaticAbility implements MageSingleton { return fINSTANCE; } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/TransmuteAbility.java b/Mage/src/mage/abilities/keyword/TransmuteAbility.java index f4b095ea41a..c861d23621f 100644 --- a/Mage/src/mage/abilities/keyword/TransmuteAbility.java +++ b/Mage/src/mage/abilities/keyword/TransmuteAbility.java @@ -57,8 +57,8 @@ public class TransmuteAbility extends SimpleActivatedAbility { @Override public String getRule() { return new StringBuilder("Transmute ").append(this.getManaCosts().getText()) - .append(" (").append(this.getManaCosts().getText()) - .append(", Discard this card: Search your library for a card with the same converted mana cost as this card, reveal it, and put it into your hand. Then shuffle your library. Transmute only as a sorcery.)").toString(); + .append(" (").append(this.getManaCosts().getText()) + .append(", Discard this card: Search your library for a card with the same converted mana cost as this card, reveal it, and put it into your hand. Then shuffle your library. Transmute only as a sorcery.)").toString(); } } diff --git a/Mage/src/mage/abilities/keyword/TributeAbility.java b/Mage/src/mage/abilities/keyword/TributeAbility.java index ad5ad5b6b7b..5cf0b1cf8e5 100644 --- a/Mage/src/mage/abilities/keyword/TributeAbility.java +++ b/Mage/src/mage/abilities/keyword/TributeAbility.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.keyword; import java.util.UUID; @@ -46,23 +45,20 @@ import mage.util.CardUtil; * * @author LevelX2 */ - - -public class TributeAbility extends EntersBattlefieldAbility{ +public class TributeAbility extends EntersBattlefieldAbility { private int tributeValue; - public TributeAbility(int tributeValue){ - super(new TributeEffect(tributeValue), false); + public TributeAbility(int tributeValue) { + super(new TributeEffect(tributeValue)); this.tributeValue = tributeValue; } - public TributeAbility(final TributeAbility ability){ + public TributeAbility(final TributeAbility ability) { super(ability); this.tributeValue = ability.tributeValue; } - @Override public EntersBattlefieldAbility copy() { return new TributeAbility(this); @@ -81,7 +77,7 @@ public class TributeAbility extends EntersBattlefieldAbility{ class TributeEffect extends OneShotEffect { - private int tributeValue; + private final int tributeValue; public TributeEffect(int tributeValue) { super(Outcome.Detriment); @@ -101,7 +97,7 @@ class TributeEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + Permanent sourcePermanent = game.getPermanentEntering(source.getSourceId()); if (controller != null && sourcePermanent != null) { UUID opponentId; if (game.getOpponents(controller.getId()).size() == 1) { @@ -117,16 +113,18 @@ class TributeEffect extends OneShotEffect { StringBuilder sb = new StringBuilder("Pay tribute to "); sb.append(sourcePermanent.getName()); sb.append(" (add ").append(CardUtil.numberToText(tributeValue)).append(" +1/+1 counter"); - sb.append(tributeValue > 1 ? "s":"").append(" to it)?"); + sb.append(tributeValue > 1 ? "s" : "").append(" to it)?"); if (opponent.chooseUse(outcome, sb.toString(), source, game)) { - if (!game.isSimulation()) + if (!game.isSimulation()) { game.informPlayers(opponent.getLogName() + " pays tribute to " + sourcePermanent.getLogName()); + } game.getState().setValue("tributeValue" + source.getSourceId(), "yes"); return new AddCountersSourceEffect(CounterType.P1P1.createInstance(tributeValue), true).apply(game, source); } else { - if (!game.isSimulation()) + if (!game.isSimulation()) { game.informPlayers(opponent.getLogName() + " does not pay tribute to " + sourcePermanent.getLogName()); - game.getState().setValue("tributeValue"+ source.getSourceId(), "no"); + } + game.getState().setValue("tributeValue" + source.getSourceId(), "no"); } return true; } diff --git a/Mage/src/mage/abilities/keyword/UndyingAbility.java b/Mage/src/mage/abilities/keyword/UndyingAbility.java index 0f5b2636c67..237989397a2 100644 --- a/Mage/src/mage/abilities/keyword/UndyingAbility.java +++ b/Mage/src/mage/abilities/keyword/UndyingAbility.java @@ -1,16 +1,13 @@ package mage.abilities.keyword; - -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; -import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Zone; import mage.counters.CounterType; +import mage.counters.Counters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -19,7 +16,7 @@ import mage.game.permanent.Permanent; * @author Loki */ public class UndyingAbility extends DiesTriggeredAbility { - + public UndyingAbility() { super(new UndyingEffect()); this.addEffect(new ReturnSourceFromGraveyardToBattlefieldEffect(false, true)); @@ -39,7 +36,6 @@ public class UndyingAbility extends DiesTriggeredAbility { if (super.checkTrigger(event, game)) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (!permanent.getCounters().containsKey(CounterType.P1P1) || permanent.getCounters().getCount(CounterType.P1P1) == 0) { - game.getState().setValue("undying" + getSourceId(),permanent.getId()); return true; } } @@ -70,58 +66,9 @@ class UndyingEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - game.addEffect(new UndyingReplacementEffect(), source); - return false; - } -} - -class UndyingReplacementEffect extends ReplacementEffectImpl { - - UndyingReplacementEffect() { - super(Duration.OneUse, Outcome.BoostCreature, false); - selfScope = true; - staticText = "return it to the battlefield under its owner's control with a +1/+1 counter on it"; - } - - UndyingReplacementEffect(final UndyingReplacementEffect effect) { - super(effect); - } - - @Override - public UndyingReplacementEffect copy() { - return new UndyingReplacementEffect(this); - } - - @Override - public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null) { - game.getState().setValue("undying" + source.getSourceId(), null); - permanent.addCounters(CounterType.P1P1.createInstance(), game); - } - used = true; - return false; - } - - @Override - public boolean checksEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getTargetId().equals(source.getSourceId())) { - // Check if undying condition is true - UUID targetId = (UUID) game.getState().getValue("undying" + source.getSourceId()); - if (targetId != null && targetId.equals(source.getSourceId())) { - return true; - } - } - return false; - } - - @Override - public boolean apply(Game game, Ability source) { - return false; + Counters countersToAdd = new Counters(); + countersToAdd.addCounter(CounterType.P1P1.createInstance()); + game.setEnterWithCounters(source.getSourceId(), countersToAdd); + return true; } } diff --git a/Mage/src/mage/abilities/keyword/UnleashAbility.java b/Mage/src/mage/abilities/keyword/UnleashAbility.java index 45112f075b2..953d482278f 100644 --- a/Mage/src/mage/abilities/keyword/UnleashAbility.java +++ b/Mage/src/mage/abilities/keyword/UnleashAbility.java @@ -26,64 +26,57 @@ * or implied, of BetaSteward_at_googlemail.com. */ package mage.abilities.keyword; - -import mage.constants.Duration; -import mage.constants.Outcome; + import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.RestrictionEffect; +import mage.constants.Duration; +import mage.constants.Outcome; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; - -/** - * - * @author LevelX2 - */ - // // 702.96. Unleash // -// 702.96a Unleash is a keyword that represents two static abilities. +// 702.96a Unleash is a keyword that represents two static abilities. // "Unleash" means "You may have this permanent enter the battlefield with an additional +1/+1 counter on it" // and "This permanent can’t block as long as it has a +1/+1 counter on it." +public class UnleashAbility extends SimpleStaticAbility { - - public class UnleashAbility extends SimpleStaticAbility { - public UnleashAbility() { super(Zone.ALL, new UnleashReplacementEffect()); this.addEffect(new UnleashRestrictionEffect()); } - + public UnleashAbility(final UnleashAbility ability) { super(ability); } - + @Override public UnleashAbility copy() { return new UnleashAbility(this); } - + @Override public String getRule() { return "Unleash (You may have this creature enter the battlefield with a +1/+1 counter on it. It can't block as long as it has a +1/+1 counter on it.)"; } } - + class UnleashReplacementEffect extends ReplacementEffectImpl { - + public UnleashReplacementEffect() { super(Duration.EndOfGame, Outcome.Detriment); } - + public UnleashReplacementEffect(UnleashReplacementEffect effect) { super(effect); } @@ -95,53 +88,51 @@ class UnleashReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getTargetId().equals(source.getSourceId())) { - return true; - } - return false; + return event.getTargetId().equals(source.getSourceId()); } - + @Override public boolean apply(Game game, Ability source) { return false; } - + @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - Permanent creature = game.getPermanent(event.getTargetId()); + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); Player controller = game.getPlayer(source.getControllerId()); if (creature != null && controller != null) { - if (controller.chooseUse(outcome, "Unleash "+ creature.getName() +"?", source, game)) { - if (!game.isSimulation()) + if (controller.chooseUse(outcome, "Unleash " + creature.getLogName() + "?", source, game)) { + if (!game.isSimulation()) { game.informPlayers(controller.getLogName() + " unleashes " + creature.getName()); + } creature.addCounters(CounterType.P1P1.createInstance(), game); } } return false; } - + @Override public String getText(Mode mode) { return staticText; } - + @Override public UnleashReplacementEffect copy() { return new UnleashReplacementEffect(this); } - + } - + class UnleashRestrictionEffect extends RestrictionEffect { - + public UnleashRestrictionEffect() { super(Duration.WhileOnBattlefield); } - + public UnleashRestrictionEffect(final UnleashRestrictionEffect effect) { super(effect); } - + @Override public boolean applies(Permanent permanent, Ability source, Game game) { if (permanent != null && permanent.getId().equals(source.getSourceId())) { @@ -151,14 +142,14 @@ class UnleashRestrictionEffect extends RestrictionEffect { } return false; } - + @Override public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { return false; } - + @Override public UnleashRestrictionEffect copy() { return new UnleashRestrictionEffect(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/keyword/VanishingUpkeepAbility.java b/Mage/src/mage/abilities/keyword/VanishingUpkeepAbility.java index 188ef1bf5a6..211867bbae4 100644 --- a/Mage/src/mage/abilities/keyword/VanishingUpkeepAbility.java +++ b/Mage/src/mage/abilities/keyword/VanishingUpkeepAbility.java @@ -31,9 +31,14 @@ public class VanishingUpkeepAbility extends BeginningOfUpkeepTriggeredAbility { @Override public String getRule() { - return "Vanishing " + vanishingAmount + if(vanishingAmount > 0) { + return "Vanishing " + vanishingAmount + " (This permanent enters the battlefield with " + CardUtil.numberToText(vanishingAmount) - + " time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.)"; + + " time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.)"; + } + else { + return "Vanishing (At the beginning of your upkeep, remove a time counter from this permanent. When the last is removed, sacrifice it.)"; + } } } diff --git a/Mage/src/mage/abilities/mana/ActivateIfConditionManaAbility.java b/Mage/src/mage/abilities/mana/ActivateIfConditionManaAbility.java index e6a5ac7c8e6..33fb10bbef3 100644 --- a/Mage/src/mage/abilities/mana/ActivateIfConditionManaAbility.java +++ b/Mage/src/mage/abilities/mana/ActivateIfConditionManaAbility.java @@ -25,23 +25,16 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.mana; import java.util.UUID; -import mage.Mana; -import mage.constants.Zone; import mage.abilities.condition.Condition; import mage.abilities.costs.Cost; +import mage.abilities.effects.common.AddConditionalColorlessManaEffect; import mage.abilities.effects.common.BasicManaEffect; +import mage.constants.Zone; import mage.game.Game; -/** - * - * @author LevelX2 - */ - - public class ActivateIfConditionManaAbility extends ManaAbility { private final Condition condition; @@ -52,6 +45,12 @@ public class ActivateIfConditionManaAbility extends ManaAbility { this.condition = condition; } + public ActivateIfConditionManaAbility(Zone zone, AddConditionalColorlessManaEffect effect, Cost cost, Condition condition) { + super(zone, effect, cost); + this.netMana.add(effect.getMana()); + this.condition = condition; + } + public ActivateIfConditionManaAbility(ActivateIfConditionManaAbility ability) { super(ability); this.condition = ability.condition; @@ -75,7 +74,7 @@ public class ActivateIfConditionManaAbility extends ManaAbility { @Override public String getRule() { - return new StringBuilder(super.getRule()).append(" Activate this ability only if ").append(condition.toString()).append(".").toString() ; + return new StringBuilder(super.getRule()).append(" Activate this ability only if ").append(condition.toString()).append(".").toString(); } @Override diff --git a/Mage/src/mage/abilities/mana/TriggeredManaAbility.java b/Mage/src/mage/abilities/mana/TriggeredManaAbility.java index 4a2c997d83a..f6f319a5ab3 100644 --- a/Mage/src/mage/abilities/mana/TriggeredManaAbility.java +++ b/Mage/src/mage/abilities/mana/TriggeredManaAbility.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -29,10 +29,12 @@ package mage.abilities.mana; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ManaEffect; +import mage.constants.AbilityType; import mage.constants.Zone; /** * see 20110715 - 605.1b + * * @author BetaSteward_at_googlemail.com */ public abstract class TriggeredManaAbility extends TriggeredAbilityImpl { @@ -44,6 +46,7 @@ public abstract class TriggeredManaAbility extends TriggeredAbilityImpl { public TriggeredManaAbility(Zone zone, ManaEffect effect, boolean optional) { super(zone, effect, optional); this.usesStack = false; + this.abilityType = AbilityType.MANA; } public TriggeredManaAbility(final TriggeredManaAbility ability) { diff --git a/Mage/src/mage/abilities/mana/conditional/ConditionalSpellManaBuilder.java b/Mage/src/mage/abilities/mana/conditional/ConditionalSpellManaBuilder.java new file mode 100644 index 00000000000..5dfe2f7c3ae --- /dev/null +++ b/Mage/src/mage/abilities/mana/conditional/ConditionalSpellManaBuilder.java @@ -0,0 +1,77 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.mana.conditional; + +import java.util.UUID; +import mage.ConditionalMana; +import mage.MageObject; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.condition.Condition; +import mage.abilities.mana.builder.ConditionalManaBuilder; +import mage.filter.FilterSpell; +import mage.game.Game; +import mage.game.stack.StackObject; + +/** + * + * @author LevelX2 + */ +public class ConditionalSpellManaBuilder extends ConditionalManaBuilder { + + private final FilterSpell filter; + + public ConditionalSpellManaBuilder(FilterSpell filter) { + this.filter = filter; + } + + @Override + public ConditionalMana build(Object... options) { + this.mana.setFlag(true); // indicates that the mana is from second ability + return new SpellCastConditionalMana(this.mana, filter); + } + + @Override + public String getRule() { + return "Spend this mana only to cast " + filter.getMessage() + "."; + } +} + +class SpellCastConditionalMana extends ConditionalMana { + + SpellCastConditionalMana(Mana mana, FilterSpell filter) { + super(mana); + staticText = "Spend this mana only to cast " + filter.getMessage() + "."; + addCondition(new SpellCastManaCondition(filter)); + } +} + +class SpellCastManaCondition extends ManaCondition implements Condition { + + private final FilterSpell filter; + + public SpellCastManaCondition(FilterSpell filter) { + this.filter = filter; + } + + @Override + public boolean apply(Game game, Ability source) { + if (source instanceof SpellAbility) { + MageObject object = game.getObject(source.getSourceId()); + if (object != null && (object instanceof StackObject)) { + return filter.match((StackObject) object, source.getSourceId(), source.getControllerId(), game); + } + } + return false; + } + + @Override + public boolean apply(Game game, Ability source, UUID originalId) { + return apply(game, source); + } + +} diff --git a/Mage/src/mage/actions/MageDrawAction.java b/Mage/src/mage/actions/MageDrawAction.java index 60cd6dcbd8b..db2e2f3620c 100644 --- a/Mage/src/mage/actions/MageDrawAction.java +++ b/Mage/src/mage/actions/MageDrawAction.java @@ -1,7 +1,8 @@ package mage.actions; import java.util.ArrayList; - +import java.util.List; +import java.util.UUID; import mage.actions.impl.MageAction; import mage.actions.score.ArtificialScoringSystem; import mage.cards.Card; @@ -9,9 +10,6 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.players.Player; - -import java.util.List; -import java.util.UUID; import mage.util.CardUtil; /** @@ -39,7 +37,7 @@ public class MageDrawAction extends MageAction { * Draw and set action score. * * @param game Game context. - * @return + * @return */ @Override public int doAction(Game game) { @@ -70,8 +68,8 @@ public class MageDrawAction extends MageAction { } /** - * Draw a card if possible (there is no replacement effect that prevent us from drawing). - * Fire event about card drawn. + * Draw a card if possible (there is no replacement effect that prevent us + * from drawing). Fire event about card drawn. * * @param game * @return diff --git a/Mage/src/mage/actions/impl/MageAction.java b/Mage/src/mage/actions/impl/MageAction.java index 4524c5c271a..2c7f74fb0db 100644 --- a/Mage/src/mage/actions/impl/MageAction.java +++ b/Mage/src/mage/actions/impl/MageAction.java @@ -24,7 +24,7 @@ public abstract class MageAction { * Set or change action score. * * @param scorePlayer Set player. - * @param score Set score value. + * @param score Set score value. */ protected void setScore(Player scorePlayer, int score) { this.scorePlayer = scorePlayer; @@ -32,9 +32,8 @@ public abstract class MageAction { } /** - * Get game score for the {@link Player}. - * Value depends on the owner of this action. - * In case player and owner differ, negative value is returned. + * Get game score for the {@link Player}. Value depends on the owner of this + * action. In case player and owner differ, negative value is returned. * * @param player * @return @@ -54,6 +53,7 @@ public abstract class MageAction { * Execute action. * * @param game Game context. + * @return */ public abstract int doAction(final Game game); diff --git a/Mage/src/mage/actions/score/ArtificialScoringSystem.java b/Mage/src/mage/actions/score/ArtificialScoringSystem.java index ebd1ee066d5..cc8688a8490 100644 --- a/Mage/src/mage/actions/score/ArtificialScoringSystem.java +++ b/Mage/src/mage/actions/score/ArtificialScoringSystem.java @@ -11,7 +11,7 @@ public class ArtificialScoringSystem implements ScoringSystem { public static ArtificialScoringSystem inst; - private static final transient Logger log = Logger.getLogger(ArtificialScoringSystem.class); + private static final Logger log = Logger.getLogger(ArtificialScoringSystem.class); static { inst = new ArtificialScoringSystem(); diff --git a/Mage/src/mage/cards/Card.java b/Mage/src/mage/cards/Card.java index 6e5ec8c1d32..5befb3d3a5f 100644 --- a/Mage/src/mage/cards/Card.java +++ b/Mage/src/mage/cards/Card.java @@ -40,6 +40,7 @@ import mage.constants.Zone; import mage.counters.Counter; import mage.counters.Counters; import mage.game.Game; +import mage.game.permanent.Permanent; public interface Card extends MageObject { @@ -65,6 +66,8 @@ public interface Card extends MageObject { String getTokenSetCode(); + void checkForCountersToAdd(Permanent permanent, Game game); + void setFaceDown(boolean value, Game game); boolean isFaceDown(Game game); @@ -125,6 +128,8 @@ public interface Card extends MageObject { boolean cast(Game game, Zone fromZone, SpellAbility ability, UUID controllerId); + boolean removeFromZone(Game game, Zone fromZone, UUID sourceId); + boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId); boolean putOntoBattlefield(Game game, Zone fromZone, UUID sourceId, UUID controllerId, boolean tapped); diff --git a/Mage/src/mage/cards/CardImpl.java b/Mage/src/mage/cards/CardImpl.java index c353c8e8d31..c57a99b9a5d 100644 --- a/Mage/src/mage/cards/CardImpl.java +++ b/Mage/src/mage/cards/CardImpl.java @@ -54,8 +54,6 @@ import static mage.constants.Zone.EXILED; import static mage.constants.Zone.GRAVEYARD; import static mage.constants.Zone.HAND; import static mage.constants.Zone.LIBRARY; -import static mage.constants.Zone.OUTSIDE; -import static mage.constants.Zone.PICK; import static mage.constants.Zone.STACK; import mage.counters.Counter; import mage.counters.Counters; @@ -65,6 +63,7 @@ import mage.game.Game; import mage.game.command.Commander; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; import mage.game.permanent.PermanentCard; import mage.game.stack.Spell; import mage.game.stack.StackObject; @@ -296,11 +295,9 @@ public abstract class CardImpl extends MageObjectImpl implements Card { public SpellAbility getSpellAbility() { if (spellAbility == null) { for (Ability ability : abilities.getActivatedAbilities(Zone.HAND)) { - // name check prevents that alternate casting methods (like "cast [card name] using bestow") are returned here - // BUG #1024: Bestow bug - //if (ability instanceof SpellAbility && ability.toString().endsWith(getName())) { - if (ability instanceof SpellAbility) { - spellAbility = (SpellAbility) ability; + if (ability instanceof SpellAbility + && !((SpellAbility) ability).getSpellAbilityType().equals(SpellAbilityType.BASE_ALTERNATE)) { + return spellAbility = (SpellAbility) ability; } } } @@ -344,52 +341,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card { Zone fromZone = game.getState().getZone(objectId); ZoneChangeEvent event = new ZoneChangeEvent(this.objectId, sourceId, ownerId, fromZone, toZone, appliedEffects); if (!game.replaceEvent(event)) { - if (event.getFromZone() != null) { - switch (event.getFromZone()) { - case GRAVEYARD: - game.getPlayer(ownerId).removeFromGraveyard(this, game); - break; - case HAND: - game.getPlayer(ownerId).removeFromHand(this, game); - break; - case LIBRARY: - game.getPlayer(ownerId).removeFromLibrary(this, game); - break; - case EXILED: - game.getExile().removeCard(this, game); - break; - case OUTSIDE: - game.getPlayer(ownerId).getSideboard().remove(this); - break; - case COMMAND: - game.getState().getCommand().remove((Commander) game.getObject(objectId)); - break; - case STACK: - StackObject stackObject = game.getStack().getSpell(getId()); - if (stackObject == null && (this instanceof SplitCard)) { // handle if half od Split cast is on the stack - stackObject = game.getStack().getSpell(((SplitCard) this).getLeftHalfCard().getId()); - if (stackObject == null) { - stackObject = game.getStack().getSpell(((SplitCard) this).getRightHalfCard().getId()); - } - } - if (stackObject != null) { - game.getStack().remove(stackObject); - } - break; - case PICK: - case BATTLEFIELD: // for sacrificing permanents or putting to library - break; - default: - Card sourceCard = game.getCard(sourceId); - logger.fatal(new StringBuilder("Invalid from zone [").append(fromZone) - .append("] for card [").append(this.getName()) - .append("] to zone [").append(toZone) - .append("] source [").append(sourceCard != null ? sourceCard.getName() : "null").append("]").toString()); - break; - } - game.rememberLKI(objectId, event.getFromZone(), this); - } - + removeFromZone(game, fromZone, sourceId); setFaceDown(false, game); updateZoneChangeCounter(game); switch (event.getToZone()) { @@ -453,32 +405,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card { Card mainCard = getMainCard(); ZoneChangeEvent event = new ZoneChangeEvent(mainCard.getId(), ability.getId(), controllerId, fromZone, Zone.STACK); if (!game.replaceEvent(event)) { - if (event.getFromZone() != null) { - switch (event.getFromZone()) { - case GRAVEYARD: - game.getPlayer(ownerId).removeFromGraveyard(mainCard, game); - break; - case HAND: - game.getPlayer(ownerId).removeFromHand(mainCard, game); - break; - case LIBRARY: - game.getPlayer(ownerId).removeFromLibrary(mainCard, game); - break; - case EXILED: - game.getExile().removeCard(mainCard, game); - break; - case OUTSIDE: - game.getPlayer(ownerId).getSideboard().remove(mainCard); - break; - - case COMMAND: - game.getState().getCommand().remove((Commander) game.getObject(mainCard.getId())); - break; - default: - //logger.warning("moveToZone, not fully implemented: from="+event.getFromZone() + ", to="+event.getToZone()); - } - game.rememberLKI(mainCard.getId(), event.getFromZone(), this); - } + mainCard.removeFromZone(game, fromZone, ability.getSourceId()); game.getStack().push(new Spell(this, ability.copy(), controllerId, event.getFromZone())); updateZoneChangeCounter(game); setZone(event.getToZone(), game); @@ -498,36 +425,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card { Zone fromZone = game.getState().getZone(objectId); ZoneChangeEvent event = new ZoneChangeEvent(this.objectId, sourceId, ownerId, fromZone, Zone.EXILED, appliedEffects); if (!game.replaceEvent(event)) { - if (fromZone != null) { - switch (fromZone) { - case GRAVEYARD: - game.getPlayer(ownerId).removeFromGraveyard(this, game); - break; - case HAND: - game.getPlayer(ownerId).removeFromHand(this, game); - break; - case LIBRARY: - game.getPlayer(ownerId).removeFromLibrary(this, game); - break; - case EXILED: - game.getExile().removeCard(this, game); - break; - case STACK: - StackObject stackObject = game.getStack().getSpell(getId()); - if (stackObject != null) { - game.getStack().remove(stackObject); - } - break; - case PICK: - // nothing to do - break; - default: - MageObject object = game.getObject(sourceId); - logger.warn(new StringBuilder("moveToExile, not fully implemented: from = ").append(fromZone).append(" - ").append(object != null ? object.getName() : "null")); - } - game.rememberLKI(objectId, event.getFromZone(), this); - } - + removeFromZone(game, fromZone, sourceId); if (exileId == null) { game.getExile().getPermanentExile().add(this); } else { @@ -567,43 +465,15 @@ public abstract class CardImpl extends MageObjectImpl implements Card { if (facedown) { this.setFaceDown(false, game); } - if (fromZone != null) { - boolean removed = false; - switch (fromZone) { - case GRAVEYARD: - removed = game.getPlayer(ownerId).removeFromGraveyard(this, game); - break; - case HAND: - removed = game.getPlayer(ownerId).removeFromHand(this, game); - break; - case LIBRARY: - removed = game.getPlayer(ownerId).removeFromLibrary(this, game); - break; - case EXILED: - game.getExile().removeCard(this, game); - removed = true; - break; - case COMMAND: - // command object (commander) is only on the stack, so no removing neccessary here - removed = true; - break; - case PICK: - removed = true; - break; - default: - logger.warn("putOntoBattlefield, not fully implemented: fromZone=" + fromZone); - } - game.rememberLKI(objectId, event.getFromZone(), this); - if (!removed) { - logger.warn("Couldn't find card in fromZone, card=" + getName() + ", fromZone=" + fromZone); - } - } + removeFromZone(game, fromZone, sourceId); updateZoneChangeCounter(game); PermanentCard permanent = new PermanentCard(this, event.getPlayerId(), game); // make sure the controller of all continuous effects of this card are switched to the current controller game.getContinuousEffects().setController(objectId, event.getPlayerId()); game.addPermanent(permanent); setZone(Zone.BATTLEFIELD, game); + // check if there are counters to add to the permanent (e.g. from non replacement effects like Persist) + checkForCountersToAdd(permanent, game); game.setScopeRelevant(true); permanent.setTapped(tapped); permanent.setFaceDown(facedown, game); @@ -621,6 +491,91 @@ public abstract class CardImpl extends MageObjectImpl implements Card { return false; } + @Override + public boolean removeFromZone(Game game, Zone fromZone, UUID sourceId) { + boolean removed = false; + MageObject lkiObject = null; + switch (fromZone) { + case GRAVEYARD: + removed = game.getPlayer(ownerId).removeFromGraveyard(this, game); + break; + case HAND: + removed = game.getPlayer(ownerId).removeFromHand(this, game); + break; + case LIBRARY: + removed = game.getPlayer(ownerId).removeFromLibrary(this, game); + break; + case EXILED: + if (game.getExile().getCard(getId(), game) != null) { + removed = game.getExile().removeCard(this, game); + + } + break; + case STACK: + StackObject stackObject; + if (getSpellAbility() != null) { + stackObject = game.getStack().getSpell(getSpellAbility().getId()); + } else { + stackObject = game.getStack().getSpell(this.getId()); + } + if (stackObject == null && (this instanceof SplitCard)) { // handle if half of Split cast is on the stack + stackObject = game.getStack().getSpell(((SplitCard) this).getLeftHalfCard().getId()); + if (stackObject == null) { + stackObject = game.getStack().getSpell(((SplitCard) this).getRightHalfCard().getId()); + } + } + if (stackObject == null) { + stackObject = game.getStack().getSpell(getId()); + } + if (stackObject != null) { + removed = game.getStack().remove(stackObject); + lkiObject = stackObject; + } + break; + case COMMAND: + lkiObject = (Commander) game.getObject(objectId); + if (lkiObject != null) { + removed = game.getState().getCommand().remove((Commander) game.getObject(objectId)); + } + break; + case OUTSIDE: + if (isCopy()) { // copied cards have no need to be removed from a previous zone + removed = true; + } else if (game.getPlayer(ownerId).getSideboard().contains(this.getId())) { + game.getPlayer(ownerId).getSideboard().remove(this.getId()); + removed = true; + } + break; + + case PICK: // Pick should no longer be used + case BATTLEFIELD: // for sacrificing permanents or putting to library + removed = true; + break; + default: + MageObject sourceObject = game.getObject(sourceId); + logger.fatal("Invalid from zone [" + fromZone + "] for card [" + this.getIdName() + + "] source [" + (sourceObject != null ? sourceObject.getName() : "null") + "]"); + break; + } + if (removed) { + game.rememberLKI(lkiObject != null ? lkiObject.getId() : objectId, fromZone, lkiObject != null ? lkiObject : this); + } else { + logger.warn("Couldn't find card in fromZone, card=" + getIdName() + ", fromZone=" + fromZone); + } + return removed; + } + + @Override + public void checkForCountersToAdd(Permanent permanent, Game game) { + Counters countersToAdd = game.getEnterWithCounters(permanent.getId()); + if (countersToAdd != null) { + for (Counter counter : countersToAdd.values()) { + permanent.addCounters(counter, game); + } + game.setEnterWithCounters(permanent.getId(), null); + } + } + @Override public void setFaceDown(boolean value, Game game) { game.getState().getCardState(objectId).setFaceDown(value); diff --git a/Mage/src/mage/cards/CardsImpl.java b/Mage/src/mage/cards/CardsImpl.java index d7799289e23..a33afd45810 100644 --- a/Mage/src/mage/cards/CardsImpl.java +++ b/Mage/src/mage/cards/CardsImpl.java @@ -49,7 +49,7 @@ import mage.util.ThreadLocalStringBuilder; */ public class CardsImpl extends LinkedHashSet implements Cards, Serializable { - private static final transient ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(200); + private static final ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(200); private static Random rnd = new Random(); private UUID ownerId; @@ -169,10 +169,13 @@ public class CardsImpl extends LinkedHashSet implements Cards, Serializabl @Override public Set getCards(FilterCard filter, UUID sourceId, UUID playerId, Game game) { Set cards = new LinkedHashSet<>(); - for (UUID card : this) { - boolean match = filter.match(game.getCard(card), sourceId, playerId, game); - if (match) { - cards.add(game.getCard(card)); + for (UUID cardId : this) { + Card card = game.getCard(cardId); + if (card != null) { + boolean match = filter.match(card, sourceId, playerId, game); + if (match) { + cards.add(game.getCard(cardId)); + } } } return cards; diff --git a/Mage/src/mage/cards/ExpansionSet.java b/Mage/src/mage/cards/ExpansionSet.java index 23c5649fbe3..99ef9952849 100644 --- a/Mage/src/mage/cards/ExpansionSet.java +++ b/Mage/src/mage/cards/ExpansionSet.java @@ -56,7 +56,10 @@ public abstract class ExpansionSet implements Serializable { protected String blockName; protected boolean hasBoosters = false; protected int numBoosterSpecial; + protected int numBoosterLands; + protected int ratioBoosterSpecialLand = 0; // if > 0 basic lands are replaced with special land in the ratio every X land is replaced by special land + protected int numBoosterCommon; protected int numBoosterUncommon; protected int numBoosterRare; @@ -150,9 +153,14 @@ public abstract class ExpansionSet implements Serializable { } if (numBoosterLands > 0) { + List specialLands = getSpecialLand(); List basicLands = getCardsByRarity(Rarity.LAND); for (int i = 0; i < numBoosterLands; i++) { - addToBooster(booster, basicLands); + if (ratioBoosterSpecialLand > 0 && rnd.nextInt(ratioBoosterSpecialLand) == 1 && specialLands != null) { + addToBooster(booster, specialLands); + } else { + addToBooster(booster, basicLands); + } } } List commons = getCardsByRarity(Rarity.COMMON); @@ -320,6 +328,10 @@ public abstract class ExpansionSet implements Serializable { return null; } + public List getSpecialLand() { + return null; + } + public void removeSavedCards() { savedCards.clear(); } diff --git a/Mage/src/mage/cards/SplitCard.java b/Mage/src/mage/cards/SplitCard.java index 7aef9b2756d..27b093adee1 100644 --- a/Mage/src/mage/cards/SplitCard.java +++ b/Mage/src/mage/cards/SplitCard.java @@ -60,16 +60,32 @@ public abstract class SplitCard extends CardImpl { public SplitCard(SplitCard card) { super(card); - this.leftHalfCard = card.leftHalfCard.copy(); + this.leftHalfCard = card.getLeftHalfCard().copy(); + ((SplitCardHalf) leftHalfCard).setParentCard(this); this.rightHalfCard = card.rightHalfCard.copy(); + ((SplitCardHalf) rightHalfCard).setParentCard(this); } - public Card getLeftHalfCard() { - return leftHalfCard; + public SplitCardHalf getLeftHalfCard() { + return (SplitCardHalf) leftHalfCard; } - public Card getRightHalfCard() { - return rightHalfCard; + public SplitCardHalf getRightHalfCard() { + return (SplitCardHalf) rightHalfCard; + } + + @Override + public void assignNewId() { + super.assignNewId(); + leftHalfCard.assignNewId(); + rightHalfCard.assignNewId(); + } + + @Override + public void setCopy(boolean isCopy) { + super.setCopy(isCopy); + leftHalfCard.setCopy(isCopy); + rightHalfCard.setCopy(isCopy); } @Override diff --git a/Mage/src/mage/cards/SplitCardHalf.java b/Mage/src/mage/cards/SplitCardHalf.java index 52fa1086bb6..f1ec3976601 100644 --- a/Mage/src/mage/cards/SplitCardHalf.java +++ b/Mage/src/mage/cards/SplitCardHalf.java @@ -12,5 +12,7 @@ package mage.cards; public interface SplitCardHalf extends Card { @Override - Card copy(); + SplitCardHalf copy(); + + void setParentCard(SplitCard card); } diff --git a/Mage/src/mage/cards/SplitCardHalfImpl.java b/Mage/src/mage/cards/SplitCardHalfImpl.java index af6cc3f6ab6..818d539c4af 100644 --- a/Mage/src/mage/cards/SplitCardHalfImpl.java +++ b/Mage/src/mage/cards/SplitCardHalfImpl.java @@ -62,7 +62,7 @@ public class SplitCardHalfImpl extends CardImpl implements SplitCardHalf { } @Override - public Card getMainCard() { + public SplitCard getMainCard() { return splitCardParent; } @@ -74,8 +74,13 @@ public class SplitCardHalfImpl extends CardImpl implements SplitCardHalf { } @Override - public SplitCardHalfImpl copy() { + public SplitCardHalf copy() { return new SplitCardHalfImpl(this); } + @Override + public void setParentCard(SplitCard card) { + this.splitCardParent = card; + } + } diff --git a/Mage/src/mage/cards/decks/Deck.java b/Mage/src/mage/cards/decks/Deck.java index 7d2dff0e14a..dd965a4a692 100644 --- a/Mage/src/mage/cards/decks/Deck.java +++ b/Mage/src/mage/cards/decks/Deck.java @@ -130,14 +130,10 @@ public class Deck implements Serializable { public Set getExpansionSetCodes() { Set sets = new LinkedHashSet<>(); for (Card card : getCards()) { - if (!sets.contains(card.getExpansionSetCode())) { - sets.add(card.getExpansionSetCode()); - } + sets.add(card.getExpansionSetCode()); } for (Card card : getSideboard()) { - if (!sets.contains(card.getExpansionSetCode())) { - sets.add(card.getExpansionSetCode()); - } + sets.add(card.getExpansionSetCode()); } return sets; } diff --git a/Mage/src/mage/cards/decks/importer/DecDeckImporter.java b/Mage/src/mage/cards/decks/importer/DecDeckImporter.java index 3dc368d3065..b1b095cf605 100644 --- a/Mage/src/mage/cards/decks/importer/DecDeckImporter.java +++ b/Mage/src/mage/cards/decks/importer/DecDeckImporter.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,16 +20,13 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.decks.importer; -import java.util.List; -import java.util.Random; import mage.cards.decks.DeckCardInfo; import mage.cards.decks.DeckCardLists; import mage.cards.repository.CardInfo; @@ -58,17 +55,15 @@ public class DecDeckImporter extends DeckImporter { String lineName = line.substring(delim).trim(); try { int num = Integer.parseInt(lineNum); - List cards = CardRepository.instance.findCards(lineName); - if (cards.isEmpty()) { + CardInfo cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(lineName, true); + if (cardInfo == null) { sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); } else { - Random random = new Random(); for (int i = 0; i < num; i++) { - CardInfo cardInfo = cards.get(random.nextInt(cards.size())); if (!sideboard) { - deckList.getCards().add(new DeckCardInfo(cardInfo.getName(),cardInfo.getCardNumber(), cardInfo.getSetCode())); + deckList.getCards().add(new DeckCardInfo(cardInfo.getName(), cardInfo.getCardNumber(), cardInfo.getSetCode())); } else { - deckList.getSideboard().add(new DeckCardInfo(cardInfo.getName(),cardInfo.getCardNumber(), cardInfo.getSetCode())); + deckList.getSideboard().add(new DeckCardInfo(cardInfo.getName(), cardInfo.getCardNumber(), cardInfo.getSetCode())); } } } diff --git a/Mage/src/mage/cards/decks/importer/MWSDeckImporter.java b/Mage/src/mage/cards/decks/importer/MWSDeckImporter.java index 09a19efe91c..7ee643ff02a 100644 --- a/Mage/src/mage/cards/decks/importer/MWSDeckImporter.java +++ b/Mage/src/mage/cards/decks/importer/MWSDeckImporter.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -63,27 +63,29 @@ public class MWSDeckImporter extends DeckImporter { String lineName = line.substring(delim + 1).trim(); try { int num = Integer.parseInt(lineNum); - List cards = null; + CardInfo cardInfo = null; if (!setCode.isEmpty()) { CardCriteria criteria = new CardCriteria(); criteria.name(lineName); criteria.setCodes(setCode); + List cards = null; cards = CardRepository.instance.findCards(criteria); - } - if (cards == null || cards.isEmpty()) { - cards = CardRepository.instance.findCards(lineName); + if (!cards.isEmpty()) { + cardInfo = cards.get(new Random().nextInt(cards.size())); + } + } + if (cardInfo == null) { + cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(lineName, true); } - if (cards.isEmpty()) { + if (cardInfo == null) { sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); } else { - Random random = new Random(); for (int i = 0; i < num; i++) { - CardInfo cardInfo = cards.get(random.nextInt(cards.size())); if (!sideboard) { - deckList.getCards().add(new DeckCardInfo(cardInfo.getName(),cardInfo.getCardNumber(), cardInfo.getSetCode())); + deckList.getCards().add(new DeckCardInfo(cardInfo.getName(), cardInfo.getCardNumber(), cardInfo.getSetCode())); } else { - deckList.getSideboard().add(new DeckCardInfo(cardInfo.getName(),cardInfo.getCardNumber(), cardInfo.getSetCode())); + deckList.getSideboard().add(new DeckCardInfo(cardInfo.getName(), cardInfo.getCardNumber(), cardInfo.getSetCode())); } } } diff --git a/Mage/src/mage/cards/decks/importer/TxtDeckImporter.java b/Mage/src/mage/cards/decks/importer/TxtDeckImporter.java index 0c0589baf73..3f5cf742f06 100644 --- a/Mage/src/mage/cards/decks/importer/TxtDeckImporter.java +++ b/Mage/src/mage/cards/decks/importer/TxtDeckImporter.java @@ -28,18 +28,12 @@ package mage.cards.decks.importer; import java.util.Arrays; -import java.util.Date; -import java.util.GregorianCalendar; import java.util.HashSet; -import java.util.List; import java.util.Set; import mage.cards.decks.DeckCardInfo; import mage.cards.decks.DeckCardLists; import mage.cards.repository.CardInfo; import mage.cards.repository.CardRepository; -import mage.cards.repository.ExpansionInfo; -import mage.cards.repository.ExpansionRepository; -import mage.constants.SetType; /** * @@ -56,6 +50,10 @@ public class TxtDeckImporter extends DeckImporter { @Override protected void readLine(String line, DeckCardLists deckList) { + if (line.toLowerCase().contains("sideboard")) { + sideboard = true; + return; + } if (line.startsWith("//")) { return; } @@ -69,11 +67,6 @@ public class TxtDeckImporter extends DeckImporter { emptyLinesInARow = 0; } - if (line.toLowerCase().startsWith("sideboard")) { - sideboard = true; - return; - } - line = line.replace("\t", " "); // changing tabs to blanks as delimiter int delim = line.indexOf(' '); if (delim < 0) { @@ -81,7 +74,7 @@ public class TxtDeckImporter extends DeckImporter { } String lineNum = line.substring(0, delim).trim(); String lineName = line.substring(delim).replace("’", "\'").trim(); - lineName = lineName.replace("&", "//").replace("Æ", "AE").replace("ö", "ö"); + lineName = lineName.replace("&", "//").replace("Æ", "AE").replace("ö", "ö").replace("û", "u").replace("\"", "'"); if (lineName.contains("//") && !lineName.contains(" // ")) { lineName = lineName.replace("//", " // "); } @@ -93,36 +86,15 @@ public class TxtDeckImporter extends DeckImporter { } try { int num = Integer.parseInt(lineNum.replaceAll("\\D+", "")); - List cards = CardRepository.instance.findCards(lineName); - if (cards.isEmpty()) { + CardInfo cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(lineName, true); + if (cardInfo == null) { sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n"); } else { - // search the card released last with this name - Date lastReleaseDate = new GregorianCalendar(1900, 1, 1).getTime(); - Date lastExpansionDate = new GregorianCalendar(1900, 1, 1).getTime(); - CardInfo cardToUse = null; - for (CardInfo cardinfo : cards) { - ExpansionInfo set = ExpansionRepository.instance.getSetByCode(cardinfo.getSetCode()); - if (set != null) { - if ((set.getType().equals(SetType.EXPANSION) || set.getType().equals(SetType.CORE)) - && (lastExpansionDate == null || set.getReleaseDate().after(lastExpansionDate))) { - cardToUse = cardinfo; - lastExpansionDate = set.getReleaseDate(); - } - if (lastExpansionDate == null && (lastReleaseDate == null || set.getReleaseDate().after(lastReleaseDate))) { - cardToUse = cardinfo; - lastReleaseDate = set.getReleaseDate(); - } - } - } - if (cardToUse == null) { - cardToUse = cards.get(0); - } for (int i = 0; i < num; i++) { if (!sideboard) { - deckList.getCards().add(new DeckCardInfo(cardToUse.getName(), cardToUse.getCardNumber(), cardToUse.getSetCode())); + deckList.getCards().add(new DeckCardInfo(cardInfo.getName(), cardInfo.getCardNumber(), cardInfo.getSetCode())); } else { - deckList.getSideboard().add(new DeckCardInfo(cardToUse.getName(), cardToUse.getCardNumber(), cardToUse.getSetCode())); + deckList.getSideboard().add(new DeckCardInfo(cardInfo.getName(), cardInfo.getCardNumber(), cardInfo.getSetCode())); } } } diff --git a/Mage/src/mage/cards/mock/MockSplitCard.java b/Mage/src/mage/cards/mock/MockSplitCard.java index fd9e8a06181..e1c03601f41 100644 --- a/Mage/src/mage/cards/mock/MockSplitCard.java +++ b/Mage/src/mage/cards/mock/MockSplitCard.java @@ -50,13 +50,13 @@ public class MockSplitCard extends SplitCard { } CardInfo leftHalf = CardRepository.instance.findCard(getLeftHalfName(card)); - if(leftHalf != null) { - this.leftHalfCard = new MockCard(leftHalf); + if (leftHalf != null) { + this.leftHalfCard = new MockSplitCardHalf(leftHalf); } CardInfo rightHalf = CardRepository.instance.findCard(getRightHalfName(card)); - if(rightHalf != null) { - this.rightHalfCard = new MockCard(rightHalf); + if (rightHalf != null) { + this.rightHalfCard = new MockSplitCardHalf(rightHalf); } } diff --git a/Mage/src/mage/cards/mock/MockSplitCardHalf.java b/Mage/src/mage/cards/mock/MockSplitCardHalf.java new file mode 100644 index 00000000000..4eefd3d0b1a --- /dev/null +++ b/Mage/src/mage/cards/mock/MockSplitCardHalf.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.mock; + +import mage.cards.SplitCard; +import mage.cards.SplitCardHalf; +import mage.cards.repository.CardInfo; + +/** + * + * @author LevelX2 + */ +public class MockSplitCardHalf extends MockCard implements SplitCardHalf { + + public MockSplitCardHalf(CardInfo card) { + super(card); + } + + public MockSplitCardHalf(final MockSplitCardHalf card) { + super(card); + } + + @Override + public MockSplitCardHalf copy() { + return new MockSplitCardHalf(this); + } + + @Override + public void setParentCard(SplitCard card) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + +} diff --git a/Mage/src/mage/cards/repository/CardCriteria.java b/Mage/src/mage/cards/repository/CardCriteria.java index 3f33e19da69..38e25425db6 100644 --- a/Mage/src/mage/cards/repository/CardCriteria.java +++ b/Mage/src/mage/cards/repository/CardCriteria.java @@ -59,6 +59,7 @@ public class CardCriteria { private boolean red; private boolean white; private boolean colorless; + private Integer convertedManaCost; private String sortBy; private Long start; private Long count; @@ -173,6 +174,11 @@ public class CardCriteria { return this; } + public CardCriteria convertedManaCost(Integer convertedManaCost) { + this.convertedManaCost = convertedManaCost; + return this; + } + public CardCriteria maxCardNumber(int maxCardNumber) { this.maxCardNumber = maxCardNumber; return this; @@ -248,6 +254,11 @@ public class CardCriteria { clausesCount++; } + if (convertedManaCost != null) { + where.eq("convertedManaCost", convertedManaCost); + clausesCount++; + } + if (!black || !blue || !green || !red || !white || !colorless) { int colorClauses = 0; if (black) { diff --git a/Mage/src/mage/cards/repository/CardRepository.java b/Mage/src/mage/cards/repository/CardRepository.java index 1be590287bc..b3c0b68a37e 100644 --- a/Mage/src/mage/cards/repository/CardRepository.java +++ b/Mage/src/mage/cards/repository/CardRepository.java @@ -1,378 +1,427 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.cards.repository; - -import com.j256.ormlite.dao.Dao; -import com.j256.ormlite.dao.DaoManager; -import com.j256.ormlite.jdbc.JdbcConnectionSource; -import com.j256.ormlite.stmt.QueryBuilder; -import com.j256.ormlite.stmt.SelectArg; -import com.j256.ormlite.stmt.Where; -import com.j256.ormlite.support.ConnectionSource; -import com.j256.ormlite.support.DatabaseConnection; -import com.j256.ormlite.table.TableUtils; -import java.io.File; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.Set; -import java.util.TreeSet; -import java.util.concurrent.Callable; -import mage.cards.ExpansionSet; -import mage.cards.Sets; -import mage.constants.CardType; -import mage.constants.SetType; -import org.apache.log4j.Logger; - -/** - * - * @author North - */ -public enum CardRepository { - - instance; - - private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE"; - private static final String VERSION_ENTITY_NAME = "card"; - // raise this if db structure was changed - private static final long CARD_DB_VERSION = 41; - // raise this if new cards were added to the server - private static final long CARD_CONTENT_VERSION = 32; - - private final Random random = new Random(); - private Dao cardDao; - private Set classNames; - - private CardRepository() { - File file = new File("db"); - if (!file.exists()) { - file.mkdirs(); - } - try { - ConnectionSource connectionSource = new JdbcConnectionSource(JDBC_URL); - boolean obsolete = RepositoryUtil.isDatabaseObsolete(connectionSource, VERSION_ENTITY_NAME, CARD_DB_VERSION); - - if (obsolete) { - TableUtils.dropTable(connectionSource, CardInfo.class, true); - } - - TableUtils.createTableIfNotExists(connectionSource, CardInfo.class); - cardDao = DaoManager.createDao(connectionSource, CardInfo.class); - } catch (SQLException ex) { - ex.printStackTrace(); - } - } - - public void addCards(final List cards) { - try { - cardDao.callBatchTasks(new Callable() { - @Override - public Object call() throws Exception { - try { - for (CardInfo card : cards) { - cardDao.create(card); - if (classNames != null) { - classNames.add(card.getClassName()); - } - } - } catch (SQLException ex) { - Logger.getLogger(CardRepository.class).error("Error adding cards to DB: " + ex.getCause()); - } - return null; - } - }); - } catch (Exception ex) { - } - } - - public boolean cardExists(String className) { - try { - if (classNames == null) { - QueryBuilder qb = cardDao.queryBuilder(); - qb.distinct().selectColumns("className").where().isNotNull("className"); - List results = cardDao.query(qb.prepare()); - classNames = new TreeSet<>(); - for (CardInfo card : results) { - classNames.add(card.getClassName()); - } - } - return classNames.contains(className); - } catch (SQLException ex) { - } - return false; - } - - public Set getNames() { - Set names = new TreeSet<>(); - try { - QueryBuilder qb = cardDao.queryBuilder(); - qb.distinct().selectColumns("name"); - List results = cardDao.query(qb.prepare()); - for (CardInfo card : results) { - int result = card.getName().indexOf(" // "); - if (result > 0) { - names.add(card.getName().substring(0, result)); - names.add(card.getName().substring(result + 4)); - } else { - names.add(card.getName()); - } - } - } catch (SQLException ex) { - } - return names; - } - - public Set getNonLandNames() { - Set names = new TreeSet<>(); - try { - QueryBuilder qb = cardDao.queryBuilder(); - qb.distinct().selectColumns("name"); - qb.where().not().like("types", new SelectArg('%' + CardType.LAND.name() + '%')); - List results = cardDao.query(qb.prepare()); - for (CardInfo card : results) { - int result = card.getName().indexOf(" // "); - if (result > 0) { - names.add(card.getName().substring(0, result)); - names.add(card.getName().substring(result + 4)); - } else { - names.add(card.getName()); - } - } - } catch (SQLException ex) { - } - return names; - } - - public Set getCreatureNames() { - Set names = new TreeSet<>(); - try { - QueryBuilder qb = cardDao.queryBuilder(); - qb.distinct().selectColumns("name"); - qb.where().like("types", new SelectArg('%' + CardType.CREATURE.name() + '%')); - List results = cardDao.query(qb.prepare()); - for (CardInfo card : results) { - int result = card.getName().indexOf(" // "); - if (result > 0) { - names.add(card.getName().substring(0, result)); - names.add(card.getName().substring(result + 4)); - } else { - names.add(card.getName()); - } - } - } catch (SQLException ex) { - } - return names; - } - - public Set getNonLandAndNonCreatureNames() { - Set names = new TreeSet<>(); - try { - QueryBuilder qb = cardDao.queryBuilder(); - qb.distinct().selectColumns("name"); - Where where = qb.where(); - where.and(where.not().like("types", '%' + CardType.CREATURE.name() + '%'), where.not().like("types", '%' + CardType.LAND.name() + '%')); - List results = cardDao.query(qb.prepare()); - for (CardInfo card : results) { - int result = card.getName().indexOf(" // "); - if (result > 0) { - names.add(card.getName().substring(0, result)); - names.add(card.getName().substring(result + 4)); - } else { - names.add(card.getName()); - } - } - } catch (SQLException ex) { - } - return names; - } - - public Set getCreatureTypes() { - TreeSet subtypes = new TreeSet<>(); - try { - QueryBuilder qb = cardDao.queryBuilder(); - qb.distinct().selectColumns("subtypes"); - qb.where().like("types", new SelectArg('%' + CardType.CREATURE.name() + '%')); - List results = cardDao.query(qb.prepare()); - for (CardInfo card : results) { - subtypes.addAll(card.getSubTypes()); - } - // Removing Forest because of Dryad Arbor - subtypes.remove("Forest"); - // Some creature types are not directly included in card types and are added here manually - subtypes.add("Blinkmoth"); - subtypes.add("Camarid"); - subtypes.add("Caribou"); - subtypes.add("Citizen"); - subtypes.add("Coward"); - subtypes.add("Deserter"); - subtypes.add("Germ"); - subtypes.add("Graveborn"); - subtypes.add("Orb"); - subtypes.add("Pentavite"); - subtypes.add("Pincher"); - subtypes.add("Prism"); - subtypes.add("Reflection"); - subtypes.add("Sand"); - subtypes.add("Saproling"); - subtypes.add("Serf"); - subtypes.add("Splinter"); - subtypes.add("Survivor"); - subtypes.add("Tetravite"); - subtypes.add("Triskelavite"); - - } catch (SQLException ex) { - } - return subtypes; - } - - public CardInfo findCard(String setCode, int cardNumber) { - try { - QueryBuilder queryBuilder = cardDao.queryBuilder(); - queryBuilder.where().eq("setCode", new SelectArg(setCode)).and().eq("cardNumber", cardNumber).and().eq("nightCard", false); - List result = cardDao.query(queryBuilder.prepare()); - if (!result.isEmpty()) { - return result.get(0); - } - } catch (SQLException ex) { - } - return null; - } - - public List getClassNames() { - List names = new ArrayList<>(); - try { - List results = cardDao.queryForAll(); - for (CardInfo card : results) { - names.add(card.getClassName()); - } - } catch (SQLException ex) { - } - return names; - } - - public List getMissingCards(List classNames) { - try { - QueryBuilder queryBuilder = cardDao.queryBuilder(); - queryBuilder.where().not().in("className", classNames); - - return cardDao.query(queryBuilder.prepare()); - } catch (SQLException ex) { - } - return new ArrayList<>(); - } - - /** - * - * @param name - * @return random card with the provided name or null if none is found - */ - public CardInfo findCard(String name) { - List cards = findCards(name); - if (!cards.isEmpty()) { - return cards.get(random.nextInt(cards.size())); - } - return null; - } - - public CardInfo findPreferedCoreExpansionCard(String name) { - List cards = findCards(name); - if (!cards.isEmpty()) { - CardInfo cardInfo = cards.get(random.nextInt(cards.size())); - ExpansionSet set = Sets.getInstance().get(cardInfo.getSetCode()); - if (set.getSetType().equals(SetType.EXPANSION) || set.getSetType().equals(SetType.CORE)) { - return cardInfo; - } - for (CardInfo cardInfoToCheck : cards) { - set = Sets.getInstance().get(cardInfoToCheck.getSetCode()); - if (set.getSetType().equals(SetType.CORE) || set.getSetType().equals(SetType.EXPANSION)) { - return cardInfoToCheck; - } - } - return cardInfo; - } - return null; - } - - public List findCards(String name) { - try { - QueryBuilder queryBuilder = cardDao.queryBuilder(); - queryBuilder.where().eq("name", new SelectArg(name)); - - return cardDao.query(queryBuilder.prepare()); - } catch (SQLException ex) { - } - return new ArrayList<>(); - } - - public List findCards(CardCriteria criteria) { - try { - QueryBuilder queryBuilder = cardDao.queryBuilder(); - criteria.buildQuery(queryBuilder); - - return cardDao.query(queryBuilder.prepare()); - } catch (SQLException ex) { - } - return new ArrayList<>(); - } - - public long getContentVersionFromDB() { - try { - ConnectionSource connectionSource = new JdbcConnectionSource(JDBC_URL); - return RepositoryUtil.getDatabaseVersion(connectionSource, VERSION_ENTITY_NAME + "Content"); - } catch (SQLException ex) { - ex.printStackTrace(); - } - return 0; - } - - public void setContentVersion(long version) { - try { - ConnectionSource connectionSource = new JdbcConnectionSource(JDBC_URL); - RepositoryUtil.updateVersion(connectionSource, VERSION_ENTITY_NAME + "Content", version); - } catch (SQLException ex) { - ex.printStackTrace(); - } - } - - public long getContentVersionConstant() { - return CARD_CONTENT_VERSION; - } - - public void closeDB() { - try { - if (cardDao != null && cardDao.getConnectionSource() != null) { - DatabaseConnection conn = cardDao.getConnectionSource().getReadWriteConnection(); - conn.executeStatement("shutdown compact", 0); - } - - } catch (SQLException ex) { - - } - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.repository; + +import com.j256.ormlite.dao.Dao; +import com.j256.ormlite.dao.DaoManager; +import com.j256.ormlite.dao.GenericRawResults; +import com.j256.ormlite.jdbc.JdbcConnectionSource; +import com.j256.ormlite.stmt.QueryBuilder; +import com.j256.ormlite.stmt.SelectArg; +import com.j256.ormlite.stmt.Where; +import com.j256.ormlite.support.ConnectionSource; +import com.j256.ormlite.support.DatabaseConnection; +import com.j256.ormlite.table.TableUtils; +import java.io.File; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Random; +import java.util.Set; +import java.util.TreeSet; +import java.util.concurrent.Callable; +import mage.constants.CardType; +import mage.constants.SetType; +import org.apache.log4j.Logger; + +/** + * + * @author North + */ +public enum CardRepository { + + instance; + + private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE"; + private static final String VERSION_ENTITY_NAME = "card"; + // raise this if db structure was changed + private static final long CARD_DB_VERSION = 43; + // raise this if new cards were added to the server + private static final long CARD_CONTENT_VERSION = 43; + + private final Random random = new Random(); + private Dao cardDao; + private Set classNames; + + private final TreeSet landTypes = new TreeSet(); + + private CardRepository() { + File file = new File("db"); + if (!file.exists()) { + file.mkdirs(); + } + try { + ConnectionSource connectionSource = new JdbcConnectionSource(JDBC_URL); + boolean obsolete = RepositoryUtil.isDatabaseObsolete(connectionSource, VERSION_ENTITY_NAME, CARD_DB_VERSION); + + if (obsolete) { + TableUtils.dropTable(connectionSource, CardInfo.class, true); + } + + TableUtils.createTableIfNotExists(connectionSource, CardInfo.class); + cardDao = DaoManager.createDao(connectionSource, CardInfo.class); + } catch (SQLException ex) { + Logger.getLogger(CardRepository.class).error("Error creating card repository - ", ex); + } + } + + public void addCards(final List cards) { + try { + cardDao.callBatchTasks(new Callable() { + @Override + public Object call() throws Exception { + try { + for (CardInfo card : cards) { + cardDao.create(card); + if (classNames != null) { + classNames.add(card.getClassName()); + } + } + } catch (SQLException ex) { + Logger.getLogger(CardRepository.class).error("Error adding cards to DB - ", ex); + } + return null; + } + }); + } catch (Exception ex) { + } + } + + public boolean cardExists(String className) { + try { + if (classNames == null) { + QueryBuilder qb = cardDao.queryBuilder(); + qb.distinct().selectColumns("className").where().isNotNull("className"); + List results = cardDao.query(qb.prepare()); + classNames = new TreeSet<>(); + for (CardInfo card : results) { + classNames.add(card.getClassName()); + } + } + return classNames.contains(className); + } catch (SQLException ex) { + } + return false; + } + + public Set getNames() { + Set names = new TreeSet<>(); + try { + QueryBuilder qb = cardDao.queryBuilder(); + qb.distinct().selectColumns("name"); + List results = cardDao.query(qb.prepare()); + for (CardInfo card : results) { + int result = card.getName().indexOf(" // "); + if (result > 0) { + names.add(card.getName().substring(0, result)); + names.add(card.getName().substring(result + 4)); + } else { + names.add(card.getName()); + } + } + } catch (SQLException ex) { + } + return names; + } + + public Set getNonLandNames() { + Set names = new TreeSet<>(); + try { + QueryBuilder qb = cardDao.queryBuilder(); + qb.distinct().selectColumns("name"); + qb.where().not().like("types", new SelectArg('%' + CardType.LAND.name() + '%')); + List results = cardDao.query(qb.prepare()); + for (CardInfo card : results) { + int result = card.getName().indexOf(" // "); + if (result > 0) { + names.add(card.getName().substring(0, result)); + names.add(card.getName().substring(result + 4)); + } else { + names.add(card.getName()); + } + } + } catch (SQLException ex) { + } + return names; + } + + public Set getCreatureNames() { + Set names = new TreeSet<>(); + try { + QueryBuilder qb = cardDao.queryBuilder(); + qb.distinct().selectColumns("name"); + qb.where().like("types", new SelectArg('%' + CardType.CREATURE.name() + '%')); + List results = cardDao.query(qb.prepare()); + for (CardInfo card : results) { + int result = card.getName().indexOf(" // "); + if (result > 0) { + names.add(card.getName().substring(0, result)); + names.add(card.getName().substring(result + 4)); + } else { + names.add(card.getName()); + } + } + } catch (SQLException ex) { + } + return names; + } + + public Set getNonLandAndNonCreatureNames() { + Set names = new TreeSet<>(); + try { + QueryBuilder qb = cardDao.queryBuilder(); + qb.distinct().selectColumns("name"); + Where where = qb.where(); + where.and(where.not().like("types", '%' + CardType.CREATURE.name() + '%'), where.not().like("types", '%' + CardType.LAND.name() + '%')); + List results = cardDao.query(qb.prepare()); + for (CardInfo card : results) { + int result = card.getName().indexOf(" // "); + if (result > 0) { + names.add(card.getName().substring(0, result)); + names.add(card.getName().substring(result + 4)); + } else { + names.add(card.getName()); + } + } + } catch (SQLException ex) { + } + return names; + } + + public Set getCreatureTypes() { + TreeSet subtypes = new TreeSet<>(); + try { + QueryBuilder qb = cardDao.queryBuilder(); + qb.distinct().selectColumns("subtypes"); + qb.where().like("types", new SelectArg('%' + CardType.CREATURE.name() + '%')); + List results = cardDao.query(qb.prepare()); + for (CardInfo card : results) { + subtypes.addAll(card.getSubTypes()); + } + // Removing Forest because of Dryad Arbor + subtypes.remove("Forest"); + // Some creature types are not directly included in card types and are added here manually + subtypes.add("Blinkmoth"); + subtypes.add("Camarid"); + subtypes.add("Caribou"); + subtypes.add("Citizen"); + subtypes.add("Coward"); + subtypes.add("Deserter"); + subtypes.add("Germ"); + subtypes.add("Graveborn"); + subtypes.add("Orb"); + subtypes.add("Pentavite"); + subtypes.add("Pincher"); + subtypes.add("Prism"); + subtypes.add("Reflection"); + subtypes.add("Sand"); + subtypes.add("Saproling"); + subtypes.add("Scion"); + subtypes.add("Serf"); + subtypes.add("Splinter"); + subtypes.add("Survivor"); + subtypes.add("Tetravite"); + subtypes.add("Triskelavite"); + + } catch (SQLException ex) { + } + return subtypes; + } + + public Set getLandTypes() { + if (landTypes.isEmpty()) { + try { + QueryBuilder qb = cardDao.queryBuilder(); + qb.distinct().selectColumns("subtypes"); + qb.where().like("types", new SelectArg('%' + CardType.LAND.name() + '%')); + List results = cardDao.query(qb.prepare()); + for (CardInfo card : results) { + landTypes.addAll(card.getSubTypes()); + } + // Removing Dryad because of Dryad Arbor + landTypes.remove("Dryad"); + + } catch (SQLException ex) { + } + } + return landTypes; + } + + public CardInfo findCard(String setCode, int cardNumber) { + try { + QueryBuilder queryBuilder = cardDao.queryBuilder(); + queryBuilder.where().eq("setCode", new SelectArg(setCode)).and().eq("cardNumber", cardNumber).and().eq("nightCard", false); + List result = cardDao.query(queryBuilder.prepare()); + if (!result.isEmpty()) { + return result.get(0); + } + } catch (SQLException ex) { + } + return null; + } + + public List getClassNames() { + List names = new ArrayList<>(); + try { + List results = cardDao.queryForAll(); + for (CardInfo card : results) { + names.add(card.getClassName()); + } + } catch (SQLException ex) { + } + return names; + } + + public List getMissingCards(List classNames) { + try { + QueryBuilder queryBuilder = cardDao.queryBuilder(); + queryBuilder.where().not().in("className", classNames); + + return cardDao.query(queryBuilder.prepare()); + } catch (SQLException ex) { + } + return new ArrayList<>(); + } + + /** + * + * @param name + * @return random card with the provided name or null if none is found + */ + public CardInfo findCard(String name) { + List cards = findCards(name); + if (!cards.isEmpty()) { + return cards.get(random.nextInt(cards.size())); + } + return null; + } + + public CardInfo findPreferedCoreExpansionCard(String name, boolean caseInsensitive) { + List cards; + if (caseInsensitive) { + cards = findCardsCaseInsensitive(name); + } else { + cards = findCards(name); + } + if (!cards.isEmpty()) { + Date lastReleaseDate = null; + Date lastExpansionDate = null; + CardInfo cardToUse = null; + for (CardInfo cardinfo : cards) { + ExpansionInfo set = ExpansionRepository.instance.getSetByCode(cardinfo.getSetCode()); + if (set != null) { + if ((set.getType().equals(SetType.EXPANSION) || set.getType().equals(SetType.CORE)) + && (lastExpansionDate == null || set.getReleaseDate().after(lastExpansionDate))) { + cardToUse = cardinfo; + lastExpansionDate = set.getReleaseDate(); + } + if (lastExpansionDate == null && (lastReleaseDate == null || set.getReleaseDate().after(lastReleaseDate))) { + cardToUse = cardinfo; + lastReleaseDate = set.getReleaseDate(); + } + } + } + return cardToUse; + } + return null; + } + + public List findCards(String name) { + try { + QueryBuilder queryBuilder = cardDao.queryBuilder(); + queryBuilder.where().eq("name", new SelectArg(name)); + return cardDao.query(queryBuilder.prepare()); + } catch (SQLException ex) { + } + return new ArrayList<>(); + } + + public List findCardsCaseInsensitive(String name) { + try { + String sqlName = name.toLowerCase().replaceAll("\'", "\'\'"); + GenericRawResults rawResults = cardDao.queryRaw( + "select * from " + CardRepository.VERSION_ENTITY_NAME + " where lower(name) = '" + sqlName + "'", + cardDao.getRawRowMapper()); + List result = new ArrayList<>(); + for (CardInfo cardinfo : rawResults) { + result.add(cardinfo); + } + return result; + } catch (SQLException ex) { + Logger.getLogger(CardRepository.class).error("Error during execution of raw sql statement", ex); + } + return new ArrayList<>(); + } + + public List findCards(CardCriteria criteria) { + try { + QueryBuilder queryBuilder = cardDao.queryBuilder(); + criteria.buildQuery(queryBuilder); + + return cardDao.query(queryBuilder.prepare()); + } catch (SQLException ex) { + } + return new ArrayList<>(); + } + + public long getContentVersionFromDB() { + try { + ConnectionSource connectionSource = new JdbcConnectionSource(JDBC_URL); + return RepositoryUtil.getDatabaseVersion(connectionSource, VERSION_ENTITY_NAME + "Content"); + } catch (SQLException ex) { + Logger.getLogger(CardRepository.class).error("Error getting content version from DB - ", ex); + } + return 0; + } + + public void setContentVersion(long version) { + try { + ConnectionSource connectionSource = new JdbcConnectionSource(JDBC_URL); + RepositoryUtil.updateVersion(connectionSource, VERSION_ENTITY_NAME + "Content", version); + } catch (SQLException ex) { + Logger.getLogger(CardRepository.class).error("Error getting content version - ", ex); + } + } + + public long getContentVersionConstant() { + return CARD_CONTENT_VERSION; + } + + public void closeDB() { + try { + if (cardDao != null && cardDao.getConnectionSource() != null) { + DatabaseConnection conn = cardDao.getConnectionSource().getReadWriteConnection(); + conn.executeStatement("shutdown compact", 0); + } + + } catch (SQLException ex) { + + } + } +} diff --git a/Mage/src/mage/constants/AbilityWord.java b/Mage/src/mage/constants/AbilityWord.java index 1ef899c62fd..f9c33524530 100644 --- a/Mage/src/mage/constants/AbilityWord.java +++ b/Mage/src/mage/constants/AbilityWord.java @@ -33,17 +33,37 @@ package mage.constants; */ public enum AbilityWord { + BATTALION("Battalion"), BLOODRUSH("Bloodrush"), + CHANNEL("Channel"), + CHROMA("Chroma"), CONSTELLATION("Constellation"), + CONVERGE("Converge"), + DOMAIN("Domain"), + FATEFUL_HOUR("Fateful hour"), FEROCIOUS("Ferocious"), FORMIDABLE("Formidable"), GRANDEUR("Grandeur"), HELLBENT("Hellbent"), HEROIC("Heroic"), + IMPRINT("Imprint"), + INSPIRED("Inspired"), + JOIN_FORCES("Join forces"), + KINSHIP("Kinship"), LANDFALL("Landfall"), + LIEUTENANT("Lieutenant"), METALCRAFT("Metalcraft"), + MORBID("Morbid"), PARLEY("Parley"), - RAID("Raid"); + RADIANCE("Radiance"), + RAID("Raid"), + RALLY("Rally"), + SPELL_MASTERY("Spell mastery"), + STRIVE("Strive"), + SWEEP("Sweep"), + TEMPTING_OFFER("Tempting offer"), + THRESHOLD("Threshold"), + WILL_OF_THE_COUNCIL("Will of the council"); private final String text; diff --git a/Mage/src/mage/constants/AsThoughEffectType.java b/Mage/src/mage/constants/AsThoughEffectType.java index 433fbd7c038..546483c9d72 100644 --- a/Mage/src/mage/constants/AsThoughEffectType.java +++ b/Mage/src/mage/constants/AsThoughEffectType.java @@ -5,19 +5,21 @@ package mage.constants; * @author North */ public enum AsThoughEffectType { + ATTACK, ACTIVATE_HASTE, BLOCK_TAPPED, BLOCK_SHADOW, BLOCK_DRAGON, - BE_BLOCKED, + BE_BLOCKED, PLAY_FROM_NOT_OWN_HAND_ZONE, CAST_AS_INSTANT, ACTIVATE_AS_INSTANT, DAMAGE, HEXPROOF, PAY, - REVEAL_FACE_DOWN, - SPEND_ANY_MANA, + LOOK_AT_FACE_DOWN, + SPEND_OTHER_MANA, + SPEND_ONLY_MANA, TARGET } diff --git a/Mage/src/mage/constants/DependencyType.java b/Mage/src/mage/constants/DependencyType.java new file mode 100644 index 00000000000..bae316c5407 --- /dev/null +++ b/Mage/src/mage/constants/DependencyType.java @@ -0,0 +1,50 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.constants; + +/** + * Dependency types are a part of a workaround solution to handle dependencies + * of continuous effects. + * + * http://magiccards.info/rule/613-interaction-of-continuous-effects.html + * + * https://github.com/magefree/mage/issues/1259 + * + * + * @author LevelX2 + */ +public enum DependencyType { + + AuraAddingRemoving, + BecomeForest, + BecomeIsland, + BecomeMountain, + BecomePlains, + BecomeSwamp, + EnchantmentAddingRemoving; +} diff --git a/Mage/src/mage/constants/PlayerAction.java b/Mage/src/mage/constants/PlayerAction.java index 82c18616d72..746db8f13ad 100644 --- a/Mage/src/mage/constants/PlayerAction.java +++ b/Mage/src/mage/constants/PlayerAction.java @@ -29,16 +29,22 @@ package mage.constants; /** * Defines player actions for a game - * + * * @author LevelX2 */ public enum PlayerAction { + PASS_PRIORITY_UNTIL_MY_NEXT_TURN, PASS_PRIORITY_UNTIL_TURN_END_STEP, PASS_PRIORITY_UNTIL_NEXT_MAIN_PHASE, PASS_PRIORITY_UNTIL_NEXT_TURN, PASS_PRIORITY_UNTIL_STACK_RESOLVED, PASS_PRIORITY_CANCEL_ALL_ACTIONS, + TRIGGER_AUTO_ORDER_ABILITY_FIRST, + TRIGGER_AUTO_ORDER_NAME_FIRST, + TRIGGER_AUTO_ORDER_ABILITY_LAST, + TRIGGER_AUTO_ORDER_NAME_LAST, + TRIGGER_AUTO_ORDER_RESET_ALL, ROLLBACK_TURNS, UNDO, CONCEDE, @@ -54,5 +60,11 @@ public enum PlayerAction { ADD_PERMISSION_TO_ROLLBACK_TURN, DENY_PERMISSON_TO_ROLLBACK_TURN, PERMISSION_REQUESTS_ALLOWED_ON, - PERMISSION_REQUESTS_ALLOWED_OFF -} \ No newline at end of file + PERMISSION_REQUESTS_ALLOWED_OFF, + REQUEST_AUTO_ANSWER_ID_YES, + REQUEST_AUTO_ANSWER_ID_NO, + REQUEST_AUTO_ANSWER_TEXT_YES, + REQUEST_AUTO_ANSWER_TEXT_NO, + REQUEST_AUTO_ANSWER_RESET_ALL, + +} diff --git a/Mage/src/mage/constants/SetTargetPointer.java b/Mage/src/mage/constants/SetTargetPointer.java index 6aeca5e026d..9f4acc8876d 100644 --- a/Mage/src/mage/constants/SetTargetPointer.java +++ b/Mage/src/mage/constants/SetTargetPointer.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.constants; /** @@ -33,5 +32,6 @@ package mage.constants; * @author LevelX2 */ public enum SetTargetPointer { - NONE, PLAYER, SPELL, CARD, PERMANENT; + + NONE, PLAYER, SPELL, CARD, PERMANENT, ATTACHED_TO_CONTROLLER; } diff --git a/Mage/src/mage/constants/TargetController.java b/Mage/src/mage/constants/TargetController.java index 8c10feb9591..ed2f4f02e20 100644 --- a/Mage/src/mage/constants/TargetController.java +++ b/Mage/src/mage/constants/TargetController.java @@ -5,5 +5,6 @@ package mage.constants; * @author North */ public enum TargetController { - ANY, YOU, NOT_YOU, OPPONENT, CONTROLLER_ATTACHED_TO + + ANY, YOU, NOT_YOU, OPPONENT, CONTROLLER_ATTACHED_TO, NEXT } diff --git a/Mage/src/mage/constants/Zone.java b/Mage/src/mage/constants/Zone.java index 52e6164223d..b5318c939ac 100644 --- a/Mage/src/mage/constants/Zone.java +++ b/Mage/src/mage/constants/Zone.java @@ -5,9 +5,19 @@ package mage.constants; * @author North */ public enum Zone { + HAND, GRAVEYARD, LIBRARY, BATTLEFIELD, STACK, EXILED, ALL, OUTSIDE, PICK, COMMAND; public boolean match(Zone zone) { return (this == zone || this == ALL || zone == ALL); } + + @Override + public String toString() { + if (this.equals(EXILED)) { + return "exile zone"; + } + return super.toString(); //To change body of generated methods, choose Tools | Templates. + } + } diff --git a/Mage/src/mage/counters/CounterType.java b/Mage/src/mage/counters/CounterType.java index 18177a03392..6b5335c2463 100644 --- a/Mage/src/mage/counters/CounterType.java +++ b/Mage/src/mage/counters/CounterType.java @@ -39,8 +39,12 @@ public enum CounterType { ARROWHEAD("arrowhead"), AWAKENING("awakening"), BLAZE("blaze"), + BOUNTY("bounty"), BRIBERY("bribery"), + CARRION("carrion"), CHARGE("charge"), + CORPSE("corpse"), + CRYSTAL("crystal"), DELAY("delay"), DEPLETION("depletion"), DESPAIR("despair"), @@ -49,13 +53,16 @@ public enum CounterType { DOOM("doom"), ELIXIR("elixir"), EON("eon"), + EXPERIENCE("experience"), EYEBALL("eyeball"), FADE("fade"), FATE("fate"), FEATHER("feather"), FLOOD("flood"), FUSE("fuse"), + GOLD("gold"), HATCHLING("hatchling"), + HEALING("healing"), HOOFPRINT("hoofprint"), ICE("ice"), JAVELIN("javelin"), @@ -66,8 +73,13 @@ public enum CounterType { LOYALTY("loyalty"), MANNEQUIN("mannequin"), M1M1(new BoostCounter(-1, -1).name), + M2M2(new BoostCounter(-2, -2).name), MINING("mining"), + MUSTER("muster"), + P0P1(new BoostCounter(0, 1).name), + P1P0(new BoostCounter(1, 0).name), P1P1(new BoostCounter(1, 1).name), + P1P2(new BoostCounter(1, 2).name), P2P2(new BoostCounter(2, 2).name), PAGE("page"), PAIN("pain"), @@ -76,17 +88,22 @@ public enum CounterType { POISON("poison"), PRESSURE("pressure"), QUEST("quest"), + SCREAM("scream"), + SHELL("shell"), SHIELD("shield"), + SHRED("shred"), SLIME("slime"), SPORE("spore"), STORAGE("storage"), + STRIFE("strife"), STUDY("study"), THEFT("theft"), + TIDE("tide"), TIME("time"), TOWER("tower"), VELOCITY("velocity"), - VILE("vile"), VERSE("verse"), + VITALITY("vitality"), WISH("wish"); private final String name; @@ -122,12 +139,20 @@ public enum CounterType { */ public Counter createInstance(int amount) { switch (this) { + case P0P1: + return new BoostCounter(0, 1, amount); + case P1P0: + return new BoostCounter(1, 0, amount); case P1P1: return new BoostCounter(1, 1, amount); + case P1P2: + return new BoostCounter(1, 2, amount); case P2P2: return new BoostCounter(2, 2, amount); case M1M1: return new BoostCounter(-1, -1, amount); + case M2M2: + return new BoostCounter(-2, -2, amount); default: return new Counter(name, amount); } diff --git a/Mage/src/mage/counters/Counters.java b/Mage/src/mage/counters/Counters.java index 6b1aca15edf..473106f081f 100644 --- a/Mage/src/mage/counters/Counters.java +++ b/Mage/src/mage/counters/Counters.java @@ -96,6 +96,16 @@ public class Counters extends HashMap implements Serializable { } } + public void removeAllCounters(CounterType counterType){ + removeAllCounters(counterType.getName()); + } + + public void removeAllCounters(String name){ + if (this.containsKey(name)){ + this.remove(name); + } + } + public int getCount(String name) { if (this.containsKey(name)) { return this.get(name).getCount(); diff --git a/Mage/src/mage/filter/FilterCard.java b/Mage/src/mage/filter/FilterCard.java index 97cb529a055..2995a693184 100644 --- a/Mage/src/mage/filter/FilterCard.java +++ b/Mage/src/mage/filter/FilterCard.java @@ -64,30 +64,29 @@ public class FilterCard extends FilterObject { } //20130711 708.6c - /* If anything performs a comparison involving multiple characteristics or - * values of one or more split cards in any zone other than the stack or - * involving multiple characteristics or values of one or more fused split - * spells, each characteristic or value is compared separately. If each of - * the individual comparisons would return a “yes” answer, the whole + /* If anything performs a comparison involving multiple characteristics or + * values of one or more split cards in any zone other than the stack or + * involving multiple characteristics or values of one or more fused split + * spells, each characteristic or value is compared separately. If each of + * the individual comparisons would return a “yes” answer, the whole * comparison returns a “yes” answer. The individual comparisons may involve * different halves of the same split card. */ - @Override public boolean match(Card card, Game game) { - if(card.isSplitCard()){ - return super.match(((SplitCard)card).getLeftHalfCard(), game) || - super.match(((SplitCard)card).getRightHalfCard(), game); - } - else{ - return super.match(card, game); + if (card.isSplitCard()) { + return super.match(((SplitCard) card).getLeftHalfCard(), game) + || super.match(((SplitCard) card).getRightHalfCard(), game); + } else { + return super.match(card, game); } } + public boolean match(Card card, UUID playerId, Game game) { if (!this.match(card, game)) { return false; } - + return Predicates.and(extraPredicates).apply(new ObjectPlayer(card, playerId), game); } @@ -111,7 +110,7 @@ public class FilterCard extends FilterObject { } return filtered; } - + public boolean hasPredicates() { return predicates.size() > 0; } diff --git a/Mage/src/mage/filter/FilterImpl.java b/Mage/src/mage/filter/FilterImpl.java index ecb3f9ee923..7def209d6ef 100644 --- a/Mage/src/mage/filter/FilterImpl.java +++ b/Mage/src/mage/filter/FilterImpl.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.filter; import java.util.ArrayList; @@ -52,7 +51,7 @@ public abstract class FilterImpl implements Filter { this.message = name; } - public FilterImpl(FilterImpl filter) { + public FilterImpl(FilterImpl filter) { this.message = filter.message; this.predicates = new ArrayList<>(filter.predicates); } diff --git a/Mage/src/mage/filter/FilterObject.java b/Mage/src/mage/filter/FilterObject.java index 29402389df3..3fc96e9c6b9 100644 --- a/Mage/src/mage/filter/FilterObject.java +++ b/Mage/src/mage/filter/FilterObject.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.filter; import mage.MageObject; @@ -46,7 +45,7 @@ public class FilterObject extends FilterImpl { super(name); } - public FilterObject(FilterObject filter) { + public FilterObject(FilterObject filter) { super(filter); } } diff --git a/Mage/src/mage/filter/FilterPermanent.java b/Mage/src/mage/filter/FilterPermanent.java index 24b5418451a..5e14f969cc1 100644 --- a/Mage/src/mage/filter/FilterPermanent.java +++ b/Mage/src/mage/filter/FilterPermanent.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.filter; import java.util.ArrayList; @@ -44,6 +43,7 @@ import mage.game.permanent.Permanent; * @author North */ public class FilterPermanent extends FilterObject implements FilterInPlay { + protected List>> extraPredicates = new ArrayList<>(); public FilterPermanent() { @@ -58,12 +58,13 @@ public class FilterPermanent extends FilterObject implements FilterIn public FilterPermanent(String name) { super(name); } - + public FilterPermanent(String subtype, String name) { super(name); this.add(new SubtypePredicate(subtype)); } + @Override public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { if (!this.match(permanent, game)) { return false; diff --git a/Mage/src/mage/filter/FilterSpell.java b/Mage/src/mage/filter/FilterSpell.java index 258f2c9083d..9b6342aed7d 100644 --- a/Mage/src/mage/filter/FilterSpell.java +++ b/Mage/src/mage/filter/FilterSpell.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.filter; import java.util.UUID; @@ -50,13 +49,13 @@ public class FilterSpell extends FilterStackObject { public FilterSpell(final FilterSpell filter) { super(filter); } - + @Override - public boolean match(StackObject stackObject, UUID playerId, Game game) { + public boolean match(StackObject stackObject, UUID sourceId, UUID playerId, Game game) { if (!(stackObject instanceof Spell)) { return false; } - return super.match(stackObject, playerId, game); + return super.match(stackObject, sourceId, playerId, game); } @Override diff --git a/Mage/src/mage/filter/FilterStackObject.java b/Mage/src/mage/filter/FilterStackObject.java index 60a10aa913c..a7c478bd78a 100644 --- a/Mage/src/mage/filter/FilterStackObject.java +++ b/Mage/src/mage/filter/FilterStackObject.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.filter; import java.util.ArrayList; @@ -33,6 +32,7 @@ import java.util.List; import java.util.UUID; import mage.filter.predicate.ObjectPlayer; import mage.filter.predicate.ObjectPlayerPredicate; +import mage.filter.predicate.ObjectSourcePlayer; import mage.filter.predicate.Predicates; import mage.game.Game; import mage.game.permanent.Permanent; @@ -59,12 +59,12 @@ public class FilterStackObject extends FilterObject { this.extraPredicates = new ArrayList<>(filter.extraPredicates); } - public boolean match(StackObject stackObject, UUID playerId, Game game) { + public boolean match(StackObject stackObject, UUID sourceId, UUID playerId, Game game) { if (!this.match(stackObject, game)) { return false; } - return Predicates.and(extraPredicates).apply(new ObjectPlayer(stackObject, playerId), game); + return Predicates.and(extraPredicates).apply(new ObjectSourcePlayer(stackObject, sourceId, playerId), game); } public void add(ObjectPlayerPredicate predicate) { diff --git a/Mage/src/mage/filter/common/FilterSpellOrPermanent.java b/Mage/src/mage/filter/common/FilterSpellOrPermanent.java index 96631bbaaff..e0d6a093065 100644 --- a/Mage/src/mage/filter/common/FilterSpellOrPermanent.java +++ b/Mage/src/mage/filter/common/FilterSpellOrPermanent.java @@ -1,5 +1,5 @@ /* - * + * * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are @@ -25,10 +25,11 @@ * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. - * + * */ package mage.filter.common; +import java.util.UUID; import mage.filter.FilterImpl; import mage.filter.FilterInPlay; import mage.filter.FilterPermanent; @@ -37,8 +38,6 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; -import java.util.UUID; - /** * * @author LevelX @@ -77,7 +76,7 @@ public class FilterSpellOrPermanent extends FilterImpl implements Filter @Override public boolean match(Object o, UUID sourceId, UUID playerId, Game game) { if (o instanceof Spell) { - return spellFilter.match((Spell) o, playerId, game); + return spellFilter.match((Spell) o, sourceId, playerId, game); } else if (o instanceof Permanent) { return permanentFilter.match((Permanent) o, sourceId, playerId, game); } @@ -92,6 +91,14 @@ public class FilterSpellOrPermanent extends FilterImpl implements Filter return this.spellFilter; } + public void setPermanentFilter(FilterPermanent permanentFilter) { + this.permanentFilter = permanentFilter; + } + + public void setSpellFilter(FilterSpell spellFilter) { + this.spellFilter = spellFilter; + } + @Override public FilterSpellOrPermanent copy() { return new FilterSpellOrPermanent(this); diff --git a/Mage/src/mage/filter/predicate/mageobject/AnotherTargetPredicate.java b/Mage/src/mage/filter/predicate/mageobject/AnotherTargetPredicate.java new file mode 100644 index 00000000000..cd906f4a2ac --- /dev/null +++ b/Mage/src/mage/filter/predicate/mageobject/AnotherTargetPredicate.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.filter.predicate.mageobject; + +import mage.MageObject; +import mage.filter.predicate.ObjectSourcePlayer; +import mage.filter.predicate.ObjectSourcePlayerPredicate; +import mage.game.Game; +import mage.game.stack.StackObject; +import mage.target.Target; + +/** + * All targets that are already selected in other target definitions of the + * source are omitted To use this predicate you have to set the targetTag of all + * targets involved in the card constructor to a unique value (e.g. using 1,2,3 + * for three targets) + * + * @author LevelX2 + */ +public class AnotherTargetPredicate implements ObjectSourcePlayerPredicate> { + + private final int targetTag; + + public AnotherTargetPredicate(int targetTag) { + this.targetTag = targetTag; + } + + @Override + public boolean apply(ObjectSourcePlayer input, Game game) { + StackObject source = game.getStack().getStackObject(input.getSourceId()); + if (source != null) { + for (Target target : source.getStackAbility().getTargets()) { + if (target.getTargetTag() > 0 // target is included in the target group to check + && target.getTargetTag() != targetTag // it's not the target of this predicate + && target.getTargets().contains(input.getObject().getId())) { // if the uuid already is used for another target in the group it's no allowed here + return false; + } + } + } + return true; + } + + @Override + public String toString() { + return "Another target"; + } +} diff --git a/Mage/src/mage/filter/predicate/mageobject/ColorPredicate.java b/Mage/src/mage/filter/predicate/mageobject/ColorPredicate.java index 74e5164049d..d6f3ad0a97d 100644 --- a/Mage/src/mage/filter/predicate/mageobject/ColorPredicate.java +++ b/Mage/src/mage/filter/predicate/mageobject/ColorPredicate.java @@ -46,7 +46,7 @@ public class ColorPredicate implements Predicate { @Override public boolean apply(MageObject input, Game game) { - return input.getColor(game).contains(color); + return color != null && input.getColor(game).contains(color); } @Override diff --git a/Mage/src/mage/filter/predicate/mageobject/NumberOfTargetsPredicate.java b/Mage/src/mage/filter/predicate/mageobject/NumberOfTargetsPredicate.java index 787a14d2aca..6d405199201 100644 --- a/Mage/src/mage/filter/predicate/mageobject/NumberOfTargetsPredicate.java +++ b/Mage/src/mage/filter/predicate/mageobject/NumberOfTargetsPredicate.java @@ -27,14 +27,12 @@ */ package mage.filter.predicate.mageobject; -import java.util.UUID; import mage.MageObject; import mage.abilities.Mode; import mage.filter.predicate.Predicate; import mage.game.Game; import mage.game.stack.Spell; import mage.target.Target; -import mage.target.Targets; /** * @@ -53,11 +51,10 @@ public class NumberOfTargetsPredicate implements Predicate { Spell spell = game.getStack().getSpell(input.getId()); if (spell != null) { int numberOfTargets = 0; - for (UUID modeId : spell.getSpellAbility().getModes().getSelectedModes()) { - Mode mode = spell.getSpellAbility().getModes().get(modeId); + for (Mode mode : spell.getSpellAbility().getModes().getSelectedModes()) { for (Target target : mode.getTargets()) { numberOfTargets += target.getTargets().size(); - } + } } if (numberOfTargets == targets) { return true; diff --git a/Mage/src/mage/filter/predicate/other/TargetsPermanentPredicate.java b/Mage/src/mage/filter/predicate/other/TargetsPermanentPredicate.java new file mode 100644 index 00000000000..aad5bb551b6 --- /dev/null +++ b/Mage/src/mage/filter/predicate/other/TargetsPermanentPredicate.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.filter.predicate.other; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Mode; +import mage.filter.FilterPermanent; +import mage.filter.predicate.ObjectSourcePlayer; +import mage.filter.predicate.ObjectSourcePlayerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.StackObject; +import mage.target.Target; + +/** + * + * @author LoneFox + */ +public class TargetsPermanentPredicate implements ObjectSourcePlayerPredicate> { + + private final FilterPermanent targetFilter; + + public TargetsPermanentPredicate(FilterPermanent targetFilter) { + this.targetFilter = targetFilter; + } + + @Override + public boolean apply(ObjectSourcePlayer input, Game game) { + StackObject object = game.getStack().getStackObject(input.getObject().getId()); + if (object != null) { + for (Mode mode : object.getStackAbility().getModes().getSelectedModes()) { + for (Target target : mode.getTargets()) { + for (UUID targetId : target.getTargets()) { + Permanent permanent = game.getPermanentOrLKIBattlefield(targetId); + if (permanent != null && targetFilter.match(permanent, input.getSourceId(), input.getPlayerId(), game)) { + return true; + } + } + } + } + } + return false; + } + + @Override + public String toString() { + return "that targets " + targetFilter.getMessage(); + } +} diff --git a/Mage/src/mage/filter/predicate/permanent/AttachedToPredicate.java b/Mage/src/mage/filter/predicate/permanent/AttachedToPredicate.java new file mode 100644 index 00000000000..7d155ffa14e --- /dev/null +++ b/Mage/src/mage/filter/predicate/permanent/AttachedToPredicate.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.filter.predicate.permanent; + +import java.util.UUID; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LoneFox + */ +public class AttachedToPredicate implements Predicate { + + private FilterPermanent filter; + + public AttachedToPredicate(FilterPermanent filter) { + this.filter = filter; + } + + @Override + public boolean apply(Permanent input, Game game) { + UUID attachedTo = input.getAttachedTo(); + return attachedTo != null && filter.match(game.getPermanent(attachedTo), game); + } + + @Override + public String toString() { + return "attached to " + filter.getMessage(); + } + +} diff --git a/Mage/src/mage/filter/predicate/permanent/CommanderPredicate.java b/Mage/src/mage/filter/predicate/permanent/CommanderPredicate.java new file mode 100644 index 00000000000..1e12b9d6acf --- /dev/null +++ b/Mage/src/mage/filter/predicate/permanent/CommanderPredicate.java @@ -0,0 +1,32 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.filter.predicate.permanent; + +import mage.constants.CardType; +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class CommanderPredicate implements Predicate { + + @Override + public boolean apply(Permanent input, Game game) { + Player owner = game.getPlayer(input.getOwnerId()); + return input.getCardType().contains(CardType.CREATURE) + && owner != null + && input.getId().equals(owner.getCommanderId()); + } + + @Override + public String toString() { + return "Commander creature"; + } +} diff --git a/Mage/src/mage/filter/predicate/permanent/SummoningSicknessPredicate.java b/Mage/src/mage/filter/predicate/permanent/SummoningSicknessPredicate.java new file mode 100644 index 00000000000..088e2791af5 --- /dev/null +++ b/Mage/src/mage/filter/predicate/permanent/SummoningSicknessPredicate.java @@ -0,0 +1,27 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.filter.predicate.permanent; + +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class SummoningSicknessPredicate implements Predicate { + + @Override + public boolean apply(Permanent input, Game game) { + return input.hasSummoningSickness(); + } + + @Override + public String toString() { + return "Summoning sickness"; + } +} diff --git a/Mage/src/mage/game/CardState.java b/Mage/src/mage/game/CardState.java index 1f471370f0b..cf63e960bb4 100644 --- a/Mage/src/mage/game/CardState.java +++ b/Mage/src/mage/game/CardState.java @@ -7,24 +7,25 @@ import mage.abilities.Abilities; import mage.abilities.AbilitiesImpl; import mage.abilities.Ability; import mage.counters.Counters; + /** * * @author BetaSteward */ public class CardState implements Serializable { - + protected boolean faceDown; protected Map info; protected Counters counters; protected Abilities abilities; - + private static final Map emptyInfo = new HashMap<>(); private static final Abilities emptyAbilities = new AbilitiesImpl<>(); - + public CardState() { counters = new Counters(); } - + public CardState(final CardState state) { this.faceDown = state.faceDown; if (state.info != null) { @@ -34,7 +35,7 @@ public class CardState implements Serializable { counters = state.counters.copy(); if (state.abilities != null) { abilities = new AbilitiesImpl<>(); - for (Ability ability: state.abilities) { + for (Ability ability : state.abilities) { abilities.add(ability.copy()); } } @@ -43,7 +44,7 @@ public class CardState implements Serializable { public CardState copy() { return new CardState(this); } - + public void setFaceDown(boolean value) { faceDown = value; } @@ -66,45 +67,45 @@ public class CardState implements Serializable { info.put(key, value); } } - + public Map getInfo() { if (info == null) { return emptyInfo; } return info; } - + public Abilities getAbilities() { if (abilities == null) { return emptyAbilities; } return abilities; } - + public void addAbility(Ability ability) { if (abilities == null) { abilities = new AbilitiesImpl<>(); } abilities.add(ability); - for (Ability sub: ability.getSubAbilities()) { + for (Ability sub : ability.getSubAbilities()) { abilities.add(sub); } } - + public void clearAbilities() { if (abilities != null) { - for (Ability ability: abilities) { - ability.setSourceId(null); - ability.setControllerId(null); - } +// for (Ability ability: abilities) { // Causes problems if temporary (gained) continuous effects are removed +// ability.setSourceId(null); +// ability.setControllerId(null); +// } abilities = null; } } - + public void clear() { counters.clear(); info = null; clearAbilities(); } - + } diff --git a/Mage/src/mage/game/Exile.java b/Mage/src/mage/game/Exile.java index 688a2727586..8abb6d4cb59 100644 --- a/Mage/src/mage/game/Exile.java +++ b/Mage/src/mage/game/Exile.java @@ -100,19 +100,20 @@ public class Exile implements Serializable, Copyable { } public List getAllCards(Game game) { - List cards = new ArrayList(); + List cards = new ArrayList<>(); for (ExileZone exile : exileZones.values()) { cards.addAll(exile.getCards(game)); } return cards; } - public void removeCard(Card card, Game game) { + public boolean removeCard(Card card, Game game) { for (ExileZone exile : exileZones.values()) { if (exile.contains(card.getId())) { - exile.remove(card); + return exile.remove(card.getId()); } } + return false; } @Override diff --git a/Mage/src/mage/game/Game.java b/Mage/src/mage/game/Game.java index ff69876d5b6..3e44fb3657d 100644 --- a/Mage/src/mage/game/Game.java +++ b/Mage/src/mage/game/Game.java @@ -54,6 +54,7 @@ import mage.constants.MultiplayerAttackOption; import mage.constants.PlayerAction; import mage.constants.RangeOfInfluence; import mage.constants.Zone; +import mage.counters.Counters; import mage.game.combat.Combat; import mage.game.command.Commander; import mage.game.command.Emblem; @@ -72,6 +73,7 @@ import mage.game.turn.Turn; import mage.players.Player; import mage.players.PlayerList; import mage.players.Players; +import mage.util.MessageToClient; import mage.util.functions.ApplyToPermanent; public interface Game extends MageItem, Serializable { @@ -105,10 +107,18 @@ public interface Game extends MageItem, Serializable { UUID getControllerId(UUID objectId); + UUID getOwnerId(UUID objectId); + + UUID getOwnerId(MageObject object); + Permanent getPermanent(UUID permanentId); Permanent getPermanentOrLKIBattlefield(UUID permanentId); + Permanent getPermanentEntering(UUID permanentId); + + Map getPermanentsEntering(); + Map> getLKI(); Card getCard(UUID cardId); @@ -220,15 +230,15 @@ public interface Game extends MageItem, Serializable { void addPlayerQueryEventListener(Listener listener); - void fireAskPlayerEvent(UUID playerId, String message); + void fireAskPlayerEvent(UUID playerId, MessageToClient message, Ability source); void fireChooseChoiceEvent(UUID playerId, Choice choice); - void fireSelectTargetEvent(UUID playerId, String message, Set targets, boolean required, Map options); + void fireSelectTargetEvent(UUID playerId, MessageToClient message, Set targets, boolean required, Map options); - void fireSelectTargetEvent(UUID playerId, String message, Cards cards, boolean required, Map options); + void fireSelectTargetEvent(UUID playerId, MessageToClient message, Cards cards, boolean required, Map options); - void fireSelectTargetEvent(UUID playerId, String message, List abilities); + void fireSelectTargetTriggeredAbilityEvent(UUID playerId, String message, List abilities); void fireSelectTargetEvent(UUID playerId, String message, List perms, boolean required); @@ -280,6 +290,8 @@ public interface Game extends MageItem, Serializable { boolean replaceEvent(GameEvent event); + boolean replaceEvent(GameEvent event, Ability targetAbility); + /** * Creates and fires an damage prevention event * @@ -352,20 +364,20 @@ public interface Game extends MageItem, Serializable { void addPermanent(Permanent permanent); // priority method - void sendPlayerAction(PlayerAction playerAction, UUID playerId); + void sendPlayerAction(PlayerAction playerAction, UUID playerId, Object data); /** * This version supports copying of copies of any depth. * * @param copyFromPermanent - * @param copyToPermanent + * @param copyToPermanentId * @param source * @param applier * @return */ - Permanent copyPermanent(Permanent copyFromPermanent, Permanent copyToPermanent, Ability source, ApplyToPermanent applier); + Permanent copyPermanent(Permanent copyFromPermanent, UUID copyToPermanentId, Ability source, ApplyToPermanent applier); - Permanent copyPermanent(Duration duration, Permanent copyFromPermanent, Permanent copyToPermanent, Ability source, ApplyToPermanent applier); + Permanent copyPermanent(Duration duration, Permanent copyFromPermanent, UUID copyToPermanentId, Ability source, ApplyToPermanent applier); Card copyCard(Card cardToCopy, Ability source, UUID newController); @@ -373,6 +385,8 @@ public interface Game extends MageItem, Serializable { UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility); + UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility, Ability source); + void applyEffects(); boolean checkStateAndTriggered(); @@ -411,7 +425,7 @@ public interface Game extends MageItem, Serializable { void cheat(UUID ownerId, List library, List hand, List battlefield, List graveyard); - // controlling the behaviour of replacement effects + // controlling the behaviour of replacement effects while permanents entering the battlefield void setScopeRelevant(boolean scopeRelevant); public boolean getScopeRelevant(); @@ -436,4 +450,8 @@ public interface Game extends MageItem, Serializable { void rollbackTurns(int turnsToRollback); boolean executingRollback(); + + void setEnterWithCounters(UUID sourceId, Counters counters); + + Counters getEnterWithCounters(UUID sourceId); } diff --git a/Mage/src/mage/game/GameCommanderImpl.java b/Mage/src/mage/game/GameCommanderImpl.java index f6a47aad006..2d9602d02ac 100644 --- a/Mage/src/mage/game/GameCommanderImpl.java +++ b/Mage/src/mage/game/GameCommanderImpl.java @@ -129,7 +129,9 @@ public abstract class GameCommanderImpl extends GameImpl { if (!mulliganedCards.containsKey(playerId)) { mulliganedCards.put(playerId, new CardsImpl()); } - card.moveToExile(null, "", null, this); + player.getHand().remove(card); + getExile().add(card); + getState().setZone(card.getId(), Zone.EXILED); card.setFaceDown(true, this); mulliganedCards.get(playerId).add(card); } @@ -168,7 +170,9 @@ public abstract class GameCommanderImpl extends GameImpl { if (player != null && mulliganedCards.containsKey(playerId)) { for (Card card : mulliganedCards.get(playerId).getCards(this)) { if (card != null) { - card.moveToZone(Zone.LIBRARY, null, this, false); + getExile().removeCard(card, this); + player.getLibrary().putOnTop(card, this); + getState().setZone(card.getId(), Zone.LIBRARY); card.setFaceDown(false, this); } } @@ -193,7 +197,7 @@ public abstract class GameCommanderImpl extends GameImpl { for (Map.Entry entrySet : damageWatcher.getDamageToPlayer().entrySet()) { if (entrySet.getValue() > 20) { Player opponent = getPlayer(entrySet.getKey()); - if (opponent != null && player.isInGame()) { + if (opponent != null && !opponent.hasLost() && player.isInGame()) { opponent.lost(this); } } diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index e4c858c6d45..54797d22c3e 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -49,6 +49,7 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.ActivatedAbility; import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.SpellAbility; import mage.abilities.TriggeredAbility; import mage.abilities.common.ChancellorAbility; import mage.abilities.common.GemstoneCavernsAbility; @@ -67,6 +68,7 @@ import mage.cards.Card; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.cards.SplitCard; +import mage.cards.SplitCardHalf; import mage.cards.decks.Deck; import mage.choices.Choice; import mage.constants.CardType; @@ -76,8 +78,10 @@ import mage.constants.Outcome; import mage.constants.PhaseStep; import mage.constants.PlayerAction; import mage.constants.RangeOfInfluence; +import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.counters.CounterType; +import mage.counters.Counters; import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; @@ -117,6 +121,7 @@ import mage.target.Target; import mage.target.TargetPermanent; import mage.target.TargetPlayer; import mage.util.GameLog; +import mage.util.MessageToClient; import mage.util.functions.ApplyToPermanent; import mage.watchers.Watchers; import mage.watchers.common.BlockedAttackerWatcher; @@ -133,7 +138,7 @@ public abstract class GameImpl implements Game, Serializable { private static final int ROLLBACK_TURNS_MAX = 4; - private static final transient Logger logger = Logger.getLogger(GameImpl.class); + private static final Logger logger = Logger.getLogger(GameImpl.class); private static final FilterPermanent filterAura = new FilterPermanent(); private static final FilterPermanent filterEquipment = new FilterPermanent(); @@ -171,6 +176,9 @@ public abstract class GameImpl implements Game, Serializable { // Used to check if an object was moved by the current effect in resolution (so Wrath like effect can be handled correctly) protected Map> shortLivingLKI = new EnumMap<>(Zone.class); + // Permanents entering the Battlefield while handling replacement effects before they are added to the battlefield + protected Map permanentsEntering = new HashMap<>(); + protected GameState state; private transient Stack savedStates = new Stack<>(); protected transient GameStates gameStates = new GameStates(); @@ -207,6 +215,9 @@ public abstract class GameImpl implements Game, Serializable { private final int startLife; protected PlayerList playerList; + // used to set the counters a permanent adds the battlefield (if no replacement effect is used e.g. Persist) + protected Map enterWithCounters = new HashMap<>(); + public GameImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, int freeMulligans, int startLife) { this.id = UUID.randomUUID(); this.range = range; @@ -236,6 +247,7 @@ public abstract class GameImpl implements Game, Serializable { this.lki.putAll(game.lki); this.lkiExtended.putAll(game.lkiExtended); this.shortLivingLKI.putAll(game.shortLivingLKI); + this.permanentsEntering.putAll(game.permanentsEntering); if (logger.isDebugEnabled()) { copyCount++; copyTime += (System.currentTimeMillis() - t1); @@ -246,6 +258,7 @@ public abstract class GameImpl implements Game, Serializable { this.priorityTime = game.priorityTime; this.saveGame = game.saveGame; this.startLife = game.startLife; + this.enterWithCounters.putAll(game.enterWithCounters); } @Override @@ -340,12 +353,12 @@ public abstract class GameImpl implements Game, Serializable { MageObject object; if (state.getBattlefield().containsPermanent(objectId)) { object = state.getBattlefield().getPermanent(objectId); - state.setZone(objectId, Zone.BATTLEFIELD); + state.setZone(objectId, Zone.BATTLEFIELD); // why is this neccessary? return object; } for (StackObject item : state.getStack()) { if (item.getId().equals(objectId)) { - state.setZone(objectId, Zone.STACK); + state.setZone(objectId, Zone.STACK); // why is this neccessary? return item; } if (item.getSourceId().equals(objectId) && item instanceof Spell) { @@ -354,7 +367,7 @@ public abstract class GameImpl implements Game, Serializable { } for (CommandObject commandObject : state.getCommand()) { - if (commandObject instanceof Commander && commandObject.getId().equals(objectId)) { + if (commandObject.getId().equals(objectId)) { return commandObject; } } @@ -362,11 +375,11 @@ public abstract class GameImpl implements Game, Serializable { object = getCard(objectId); if (object == null) { - for (CommandObject commandObject : state.getCommand()) { - if (commandObject.getId().equals(objectId)) { - return commandObject; - } - } +// for (CommandObject commandObject : state.getCommand()) { +// if (commandObject.getId().equals(objectId)) { +// return commandObject; +// } +// } // can be an ability of a sacrificed Token trying to get it's source object object = getLastKnownInformation(objectId, Zone.BATTLEFIELD); } @@ -390,6 +403,11 @@ public abstract class GameImpl implements Game, Serializable { object = state.getBattlefield().getPermanent(objectId); return object; } + // can be an ability of a sacrificed Token trying to get it's source object + object = getLastKnownInformation(objectId, Zone.BATTLEFIELD); + if (object != null) { + return object; + } for (CommandObject commandObject : state.getCommand()) { if (commandObject instanceof Commander && commandObject.getId().equals(objectId)) { return commandObject; @@ -402,8 +420,6 @@ public abstract class GameImpl implements Game, Serializable { return commandObject; } } - // can be an ability of a sacrificed Token trying to get it's source object - object = getLastKnownInformation(objectId, Zone.BATTLEFIELD); } return object; } @@ -421,6 +437,29 @@ public abstract class GameImpl implements Game, Serializable { return null; } + @Override + public UUID getOwnerId(UUID objectId) { + return getOwnerId(getObject(objectId)); + } + + @Override + public UUID getOwnerId(MageObject object) { + if (object instanceof Card) { + return ((Card) object).getOwnerId(); + } + if (object instanceof Spell) { + return ((Spell) object).getOwnerId(); + } + if (object instanceof StackObject) { + // maybe this is not correct in all cases? + return ((StackObject) object).getControllerId(); + } + if (object instanceof CommandObject) { + return ((CommandObject) object).getControllerId(); + } + return null; + } + @Override public UUID getControllerId(UUID objectId) { if (objectId == null) { @@ -466,6 +505,16 @@ public abstract class GameImpl implements Game, Serializable { return permanent; } + @Override + public Permanent getPermanentEntering(UUID permanentId) { + return permanentsEntering.get(permanentId); + } + + @Override + public Map getPermanentsEntering() { + return permanentsEntering; + } + @Override public Card getCard(UUID cardId) { if (cardId == null) { @@ -622,7 +671,8 @@ public abstract class GameImpl implements Game, Serializable { } @Override - public void removeBookmark(int bookmark) { + public void removeBookmark(int bookmark + ) { if (!simulation) { if (bookmark != 0) { while (savedStates.size() > bookmark) { @@ -675,7 +725,7 @@ public abstract class GameImpl implements Game, Serializable { boolean wasPaused = state.isPaused(); state.resume(); if (!gameOver(null)) { - fireInformEvent(new StringBuilder("Turn ").append(state.getTurnNum()).toString()); + fireInformEvent("Turn " + state.getTurnNum()); if (checkStopOnTurnOption()) { return; } @@ -841,37 +891,63 @@ public abstract class GameImpl implements Game, Serializable { Player choosingPlayer = null; if (choosingPlayerId != null) { choosingPlayer = this.getPlayer(choosingPlayerId); + if (choosingPlayer != null && !choosingPlayer.isInGame()) { + choosingPlayer = null; + } } if (choosingPlayer == null) { choosingPlayerId = pickChoosingPlayer(); + if (choosingPlayerId == null) { + return; + } choosingPlayer = getPlayer(choosingPlayerId); } - getState().setChoosingPlayerId(choosingPlayerId); // needed to start/stop the timer if active - if (choosingPlayer != null && choosingPlayer.choose(Outcome.Benefit, targetPlayer, null, this)) { - startingPlayerId = targetPlayer.getTargets().get(0); - Player startingPlayer = state.getPlayer(startingPlayerId); - StringBuilder message = new StringBuilder(choosingPlayer.getLogName()).append(" chooses that "); - if (choosingPlayer.getId().equals(startingPlayerId)) { - message.append("he or she"); - } else { - message.append(startingPlayer.getLogName()); - } - message.append(" takes the first turn"); - - this.informPlayers(message.toString()); - } else { - // not possible to choose starting player, stop here + if (choosingPlayer == null) { return; } + getState().setChoosingPlayerId(choosingPlayerId); // needed to start/stop the timer if active + if (choosingPlayer.choose(Outcome.Benefit, targetPlayer, null, this)) { + startingPlayerId = targetPlayer.getTargets().get(0); + } else if (getState().getPlayers().size() < 3) { + // not possible to choose starting player, choosing player has probably conceded, so stop here + return; + } + if (startingPlayerId == null) { + // choose any available player as starting player + for (Player player : state.getPlayers().values()) { + if (player.isInGame()) { + startingPlayerId = player.getId(); + break; + } + } + if (startingPlayerId == null) { + return; + } + } + Player startingPlayer = state.getPlayer(startingPlayerId); + if (startingPlayer == null) { + logger.debug("Starting player not found. playerId:" + startingPlayerId); + return; + } + StringBuilder message = new StringBuilder(choosingPlayer.getLogName()).append(" chooses that "); + if (choosingPlayer.getId().equals(startingPlayerId)) { + message.append("he or she"); + } else { + message.append(startingPlayer.getLogName()); + } + message.append(" takes the first turn"); + + this.informPlayers(message.toString()); //20091005 - 103.3 + int startingHandSize = 7; for (UUID playerId : state.getPlayerList(startingPlayerId)) { Player player = getPlayer(playerId); if (!gameOptions.testMode || player.getLife() == 0) { player.initLife(this.getLife()); } if (!gameOptions.testMode) { - player.drawCards(7, this); + player.drawCards(startingHandSize, this); } } @@ -913,6 +989,15 @@ public abstract class GameImpl implements Game, Serializable { } saveState(false); } while (!mulliganPlayers.isEmpty()); + // new scry rule + for (UUID playerId : state.getPlayerList(startingPlayerId)) { + Player player = getPlayer(playerId); + if (player != null && player.getHand().size() < startingHandSize) { + if (player.chooseUse(Outcome.Benefit, new MessageToClient("Scry 1?", "Look at the top card of your library. You may put that card on the bottom of your library."), null, this)) { + player.scry(1, null, this); + } + } + } getState().setChoosingPlayerId(null); Watchers watchers = state.getWatchers(); // add default watchers @@ -960,6 +1045,7 @@ public abstract class GameImpl implements Game, Serializable { } } } + } protected UUID findWinnersAndLosers() { @@ -994,9 +1080,17 @@ public abstract class GameImpl implements Game, Serializable { protected UUID pickChoosingPlayer() { UUID[] players = getPlayers().keySet().toArray(new UUID[0]); - UUID playerId = players[rnd.nextInt(players.length)]; - fireInformEvent(state.getPlayer(playerId).getLogName() + " won the toss"); - return playerId; + UUID playerId; + while (!hasEnded()) { + playerId = players[rnd.nextInt(players.length)]; + Player player = getPlayer(playerId); + if (player != null && player.isInGame()) { + fireInformEvent(state.getPlayer(playerId).getLogName() + " won the toss"); + return player.getId(); + } + } + logger.debug("Game was not possible to pick a choosing player. GameId:" + getId()); + return null; } @Override @@ -1075,15 +1169,6 @@ public abstract class GameImpl implements Game, Serializable { player.drawCards(numCards - deduction, this); } -// @Override -// public void quit(UUID playerId) { -// if (state != null) { -// Player player = state.getPlayer(playerId); -// if (player != null && player.isInGame()) { -// player.quit(this); -// } -// } -// } @Override public synchronized void timerTimeout(UUID playerId) { Player player = state.getPlayer(playerId); @@ -1108,7 +1193,7 @@ public abstract class GameImpl implements Game, Serializable { public synchronized void concede(UUID playerId) { Player player = state.getPlayer(playerId); if (player != null) { - logger.debug(new StringBuilder("Player ").append(player.getName()).append(" concedes game ").append(this.getId())); + logger.debug("Player " + player.getName() + " concedes game " + this.getId()); fireInformEvent(player.getLogName() + " has conceded."); player.concede(this); } @@ -1128,10 +1213,10 @@ public abstract class GameImpl implements Game, Serializable { } @Override - public void sendPlayerAction(PlayerAction playerAction, UUID playerId) { + public void sendPlayerAction(PlayerAction playerAction, UUID playerId, Object data) { Player player = state.getPlayer(playerId); if (player != null) { - player.sendPlayerAction(playerAction, this); + player.sendPlayerAction(playerAction, this, data); } } @@ -1334,12 +1419,12 @@ public abstract class GameImpl implements Game, Serializable { } @Override - public Permanent copyPermanent(Permanent copyFromPermanent, Permanent copyToPermanent, Ability source, ApplyToPermanent applier) { - return copyPermanent(Duration.Custom, copyFromPermanent, copyToPermanent, source, applier); + public Permanent copyPermanent(Permanent copyFromPermanent, UUID copyToPermanentId, Ability source, ApplyToPermanent applier) { + return copyPermanent(Duration.Custom, copyFromPermanent, copyToPermanentId, source, applier); } @Override - public Permanent copyPermanent(Duration duration, Permanent copyFromPermanent, Permanent copyToPermanent, Ability source, ApplyToPermanent applier) { + public Permanent copyPermanent(Duration duration, Permanent copyFromPermanent, UUID copyToPermanentId, Ability source, ApplyToPermanent applier) { Permanent newBluePrint = null; // handle copies of copies for (Effect effect : getState().getContinuousEffects().getLayeredEffects(this)) { @@ -1372,7 +1457,7 @@ public abstract class GameImpl implements Game, Serializable { applier.apply(this, newBluePrint); } - CopyEffect newEffect = new CopyEffect(duration, newBluePrint, copyToPermanent.getId()); + CopyEffect newEffect = new CopyEffect(duration, newBluePrint, copyToPermanentId); newEffect.newId(); newEffect.setApplier(applier); Ability newAbility = source.copy(); @@ -1397,6 +1482,7 @@ public abstract class GameImpl implements Game, Serializable { } else { TriggeredAbility newAbility = ability.copy(); newAbility.newId(); + // Too early, because no targets set yet !!!!!!!!!!! for (Effect effect : newAbility.getEffects()) { effect.getTargetPointer().init(this, newAbility); } @@ -1404,6 +1490,14 @@ public abstract class GameImpl implements Game, Serializable { } } + @Override + public UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility, Ability source) { + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(this), this); + return addDelayedTriggeredAbility(delayedAbility); + } + @Override public UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility) { DelayedTriggeredAbility newAbility = delayedAbility.copy(); @@ -1453,6 +1547,7 @@ public abstract class GameImpl implements Game, Serializable { */ public boolean checkTriggered() { boolean played = false; + state.getTriggers().checkStateTriggers(this); for (UUID playerId : state.getPlayerList(state.getActivePlayerId())) { Player player = getPlayer(playerId); while (player.isInGame()) { // player can die or win caused by triggered abilities or leave the game @@ -1516,6 +1611,9 @@ public abstract class GameImpl implements Game, Serializable { Iterator copiedCards = this.getState().getCopiedCards().iterator(); while (copiedCards.hasNext()) { Card card = copiedCards.next(); + if (card instanceof SplitCardHalf) { + continue; // only the main card is moves, not the halves + } Zone zone = state.getZone(card.getId()); if (zone != Zone.BATTLEFIELD && zone != Zone.STACK) { switch (zone) { @@ -1613,11 +1711,22 @@ public abstract class GameImpl implements Game, Serializable { } } } else { + SpellAbility spellAbility = perm.getSpellAbility(); if (perm.getSpellAbility().getTargets().isEmpty()) { + for (Ability ability : perm.getAbilities(this)) { + if ((ability instanceof SpellAbility) + && SpellAbilityType.BASE_ALTERNATE.equals(((SpellAbility) ability).getSpellAbilityType()) + && !ability.getTargets().isEmpty()) { + spellAbility = (SpellAbility) ability; + break; + } + } + } + if (spellAbility.getTargets().isEmpty()) { Permanent enchanted = this.getPermanent(perm.getAttachedTo()); logger.error("Aura without target: " + perm.getName() + " attached to " + (enchanted == null ? " null" : enchanted.getName())); } else { - Target target = perm.getSpellAbility().getTargets().get(0); + Target target = spellAbility.getTargets().get(0); if (target instanceof TargetPermanent) { Permanent attachedTo = getPermanent(perm.getAttachedTo()); if (attachedTo == null || !attachedTo.getAttachments().contains(perm.getId())) { @@ -1633,7 +1742,7 @@ public abstract class GameImpl implements Game, Serializable { } } } else { - Filter auraFilter = perm.getSpellAbility().getTargets().get(0).getFilter(); + Filter auraFilter = spellAbility.getTargets().get(0).getFilter(); if (auraFilter instanceof FilterControlledCreaturePermanent) { if (!((FilterControlledCreaturePermanent) auraFilter).match(attachedTo, perm.getId(), perm.getControllerId(), this) || attachedTo.cantBeEnchantedBy(perm, this)) { @@ -1664,7 +1773,7 @@ public abstract class GameImpl implements Game, Serializable { somethingHappened = true; } } else { - Filter auraFilter = perm.getSpellAbility().getTargets().get(0).getFilter(); + Filter auraFilter = spellAbility.getTargets().get(0).getFilter(); if (!auraFilter.match(attachedToPlayer, this) || attachedToPlayer.hasProtectionFrom(perm, this)) { if (movePermanentToGraveyardWithInfo(perm)) { somethingHappened = true; @@ -1776,7 +1885,7 @@ public abstract class GameImpl implements Game, Serializable { Player controller = this.getPlayer(legend.getControllerId()); if (controller != null) { Target targetLegendaryToKeep = new TargetPermanent(filterLegendName); - targetLegendaryToKeep.setTargetName(new StringBuilder(legend.getName()).append(" to keep (Legendary Rule)?").toString()); + targetLegendaryToKeep.setTargetName(legend.getName() + " to keep (Legendary Rule)?"); controller.chooseTarget(Outcome.Benefit, targetLegendaryToKeep, null, this); for (Permanent dupLegend : getBattlefield().getActivePermanents(filterLegendName, legend.getControllerId(), this)) { if (!targetLegendaryToKeep.getTargets().contains(dupLegend.getId())) { @@ -1878,11 +1987,11 @@ public abstract class GameImpl implements Game, Serializable { } @Override - public void fireAskPlayerEvent(UUID playerId, String message) { + public void fireAskPlayerEvent(UUID playerId, MessageToClient message, Ability source) { if (simulation) { return; } - playerQueryEventSource.ask(playerId, message); + playerQueryEventSource.ask(playerId, message.getMessage(), source, addMessageToOptions(message, null)); } @Override @@ -1906,26 +2015,31 @@ public abstract class GameImpl implements Game, Serializable { } @Override - public void fireSelectTargetEvent(UUID playerId, String message, Set targets, boolean required, Map options) { + public void fireSelectTargetEvent(UUID playerId, MessageToClient message, Set targets, boolean required, Map options) { if (simulation) { return; } - playerQueryEventSource.target(playerId, message, targets, required, options); + playerQueryEventSource.target(playerId, message.getMessage(), targets, required, addMessageToOptions(message, options)); } @Override - public void fireSelectTargetEvent(UUID playerId, String message, Cards cards, boolean required, Map options) { + public void fireSelectTargetEvent(UUID playerId, MessageToClient message, Cards cards, boolean required, Map options) { if (simulation) { return; } - playerQueryEventSource.target(playerId, message, cards, required, options); + playerQueryEventSource.target(playerId, message.getMessage(), cards, required, addMessageToOptions(message, options)); } + /** + * Only used from human players to select order triggered abilities go to + * the stack. + * + * @param playerId + * @param message + * @param abilities + */ @Override - public void fireSelectTargetEvent(UUID playerId, String message, List abilities) { - if (simulation) { - return; - } + public void fireSelectTargetTriggeredAbilityEvent(UUID playerId, String message, List abilities) { playerQueryEventSource.target(playerId, message, abilities); } @@ -2185,6 +2299,11 @@ public abstract class GameImpl implements Game, Serializable { return state.replaceEvent(event, this); } + @Override + public boolean replaceEvent(GameEvent event, Ability targetAbility) { + return state.replaceEvent(event, targetAbility, this); + } + @Override public PreventionEffectData preventDamage(GameEvent event, Ability source, Game game, boolean preventAllDamage) { return preventDamage(event, source, game, Integer.MAX_VALUE); @@ -2448,8 +2567,10 @@ public abstract class GameImpl implements Game, Serializable { card.setZone(Zone.BATTLEFIELD, this); card.setOwnerId(ownerId); PermanentCard permanent = new PermanentCard(card.getCard(), ownerId, this); - getBattlefield().addPermanent(permanent); + getPermanentsEntering().put(permanent.getId(), permanent); permanent.entersBattlefield(permanent.getId(), this, Zone.OUTSIDE, false); + getBattlefield().addPermanent(permanent); + getPermanentsEntering().remove(permanent.getId()); ((PermanentImpl) permanent).removeSummoningSickness(); if (card.isTapped()) { permanent.setTapped(true); @@ -2649,6 +2770,7 @@ public abstract class GameImpl implements Game, Serializable { for (Player playerObject : getPlayers().values()) { if (playerObject.isHuman() && playerObject.isInGame()) { playerObject.abort(); + playerObject.resetPlayerPassedActions(); } } fireUpdatePlayersEvent(); @@ -2662,4 +2784,35 @@ public abstract class GameImpl implements Game, Serializable { return executingRollback; } + @Override + public void setEnterWithCounters(UUID sourceId, Counters counters) { + if (counters == null) { + if (enterWithCounters.containsKey(sourceId)) { + enterWithCounters.remove(sourceId); + } + return; + } + enterWithCounters.put(sourceId, counters); + } + + @Override + public Counters getEnterWithCounters(UUID sourceId) { + return enterWithCounters.get(sourceId); + } + + private Map addMessageToOptions(MessageToClient message, Map options) { + if (message.getSecondMessage() != null) { + if (options == null) { + options = new HashMap<>(); + } + options.put("secondMessage", message.getSecondMessage()); + } + if (message.getHintText() != null) { + if (options == null) { + options = new HashMap<>(); + } + options.put("hintText", message.getHintText()); + } + return options; + } } diff --git a/Mage/src/mage/game/GameState.java b/Mage/src/mage/game/GameState.java index 21824f7a41c..748ead016f2 100644 --- a/Mage/src/mage/game/GameState.java +++ b/Mage/src/mage/game/GameState.java @@ -86,7 +86,7 @@ import mage.watchers.Watchers; */ public class GameState implements Serializable, Copyable { - private static final transient ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(1024); + private static final ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(1024); private final Players players; private final PlayerList playerList; @@ -309,7 +309,7 @@ public class GameState implements Serializable, Copyable { for (StackObject spell : stack) { sb.append(spell.getControllerId()).append(spell.getName()); sb.append(spell.getStackAbility().toString()); - for (Mode mode : spell.getStackAbility().getModes().values()) { + for (Mode mode : spell.getStackAbility().getModes().getSelectedModes()) { if (!mode.getTargets().isEmpty()) { sb.append("targets"); for (Target target : mode.getTargets()) { @@ -367,7 +367,7 @@ public class GameState implements Serializable, Copyable { for (StackObject spell : stack) { sb.append(spell.getControllerId()).append(spell.getName()); sb.append(spell.getStackAbility().toString()); - for (Mode mode : spell.getStackAbility().getModes().values()) { + for (Mode mode : spell.getStackAbility().getModes().getSelectedModes()) { if (!mode.getTargets().isEmpty()) { sb.append("targets"); for (Target target : mode.getTargets()) { @@ -624,7 +624,7 @@ public class GameState implements Serializable, Copyable { public Permanent getPermanent(UUID permanentId) { if (permanentId != null && battlefield.containsPermanent(permanentId)) { Permanent permanent = battlefield.getPermanent(permanentId); - setZone(permanent.getId(), Zone.BATTLEFIELD); // shouldn't this be set anyway? (LevelX2) + // setZone(permanent.getId(), Zone.BATTLEFIELD); // shouldn't this be set anyway? (LevelX2) return permanent; } return null; @@ -668,7 +668,11 @@ public class GameState implements Serializable, Copyable { } public boolean replaceEvent(GameEvent event, Game game) { - if (effects.preventedByRuleModification(event, null, game, false)) { + return replaceEvent(event, null, game); + } + + public boolean replaceEvent(GameEvent event, Ability targetAbility, Game game) { + if (effects.preventedByRuleModification(event, targetAbility, game, false)) { return true; } return effects.replaceEvent(event, game); @@ -709,7 +713,7 @@ public class GameState implements Serializable, Copyable { public void addAbility(Ability ability, MageObject attachedTo) { if (ability instanceof StaticAbility) { - for (Mode mode : ability.getModes().values()) { + for (Mode mode : ability.getModes().getSelectedModes()) { for (Effect effect : mode.getEffects()) { if (effect instanceof ContinuousEffect) { addEffect((ContinuousEffect) effect, ability); @@ -731,7 +735,7 @@ public class GameState implements Serializable, Copyable { */ public void addAbility(Ability ability, UUID sourceId, Card attachedTo) { if (ability instanceof StaticAbility) { - for (Mode mode : ability.getModes().values()) { + for (Mode mode : ability.getModes().getSelectedModes()) { for (Effect effect : mode.getEffects()) { if (effect instanceof ContinuousEffect) { addEffect((ContinuousEffect) effect, sourceId, ability); @@ -742,9 +746,11 @@ public class GameState implements Serializable, Copyable { // TODO: add sources for triggers - the same way as in addEffect: sources this.triggers.add((TriggeredAbility) ability, sourceId, attachedTo); } - for (Watcher watcher : ability.getWatchers()) { - watcher.setControllerId(attachedTo.getOwnerId()); - watcher.setSourceId(attachedTo.getId()); + List watcherList = new ArrayList<>(ability.getWatchers()); // Workaround to prevent ConcurrentModificationException, not clear to me why this is happening now + for (Watcher watcher : watcherList) { + // TODO: Check that watcher for commanderAbility (where attachedTo = null) also work correctly + watcher.setControllerId(attachedTo == null ? ability.getControllerId() : attachedTo.getOwnerId()); + watcher.setSourceId(attachedTo == null ? ability.getSourceId() : attachedTo.getId()); watchers.add(watcher); } for (Ability sub : ability.getSubAbilities()) { diff --git a/Mage/src/mage/game/GameStates.java b/Mage/src/mage/game/GameStates.java index e88e45c27d7..b65cbccea3c 100644 --- a/Mage/src/mage/game/GameStates.java +++ b/Mage/src/mage/game/GameStates.java @@ -40,7 +40,7 @@ import java.util.List; */ public class GameStates implements Serializable { - private static final transient Logger logger = Logger.getLogger(GameStates.class); + private static final Logger logger = Logger.getLogger(GameStates.class); // private final List states; private final List states; diff --git a/Mage/src/mage/game/combat/Combat.java b/Mage/src/mage/game/combat/Combat.java index 8474758049c..7b041bdef57 100644 --- a/Mage/src/mage/game/combat/Combat.java +++ b/Mage/src/mage/game/combat/Combat.java @@ -212,12 +212,31 @@ public class Combat implements Serializable, Copyable { * @return */ public boolean addAttackingCreature(UUID creatureId, Game game) { + return this.addAttackingCreature(creatureId, game, null); + } + + public boolean addAttackingCreature(UUID creatureId, Game game, UUID playerToAttack) { + Set possibleDefenders; + if (playerToAttack != null) { + possibleDefenders = new HashSet<>(); + for (UUID objectId : defenders) { + Permanent planeswalker = game.getPermanent(objectId); + if (planeswalker != null && planeswalker.getControllerId().equals(playerToAttack)) { + possibleDefenders.add(objectId); + } else if (playerToAttack.equals(objectId)) { + possibleDefenders.add(objectId); + } + } + } else { + possibleDefenders = new HashSet(defenders); + } Player player = game.getPlayer(attackerId); - if (defenders.size() == 1) { - addAttackerToCombat(creatureId, defenders.iterator().next(), game); + if (possibleDefenders.size() == 1) { + addAttackerToCombat(creatureId, possibleDefenders.iterator().next(), game); return true; } else { - TargetDefender target = new TargetDefender(defenders, creatureId); + TargetDefender target = new TargetDefender(possibleDefenders, creatureId); + target.setNotTarget(true); target.setRequired(true); player.chooseTarget(Outcome.Damage, target, null, game); if (target.getFirstTarget() != null) { @@ -294,9 +313,9 @@ public class Combat implements Serializable, Copyable { } // force attack only if a defender can be attacked without paying a cost if (!defendersCostlessAttackable.isEmpty()) { + creaturesForcedToAttack.put(creature.getId(), defendersForcedToAttack); // No need to attack a special defender if (defendersForcedToAttack.isEmpty()) { - creaturesForcedToAttack.put(creature.getId(), defendersForcedToAttack); if (defendersForcedToAttack.isEmpty()) { if (defendersCostlessAttackable.size() == 1) { player.declareAttacker(creature.getId(), defenders.iterator().next(), game, false); @@ -380,7 +399,7 @@ public class Combat implements Serializable, Copyable { public void selectBlockers(Player blockController, Game game) { Player attacker = game.getPlayer(attackerId); //20101001 - 509.1c - this.retrieveMustBlockAttackerRequirements(attacker, game); + game.getCombat().retrieveMustBlockAttackerRequirements(attacker, game); Player controller; for (UUID defenderId : getPlayerDefenders(game)) { Player defender = game.getPlayer(defenderId); @@ -396,26 +415,26 @@ public class Combat implements Serializable, Copyable { if (game.isPaused() || game.gameOver(null) || game.executingRollback()) { return; } - if (!this.checkBlockRestrictions(defender, game)) { + if (!game.getCombat().checkBlockRestrictions(defender, game)) { if (controller.isHuman()) { // only human player can decide to do the block in another way continue; } } - choose = !this.checkBlockRequirementsAfter(defender, controller, game); + choose = !game.getCombat().checkBlockRequirementsAfter(defender, controller, game); if (!choose) { - choose = !this.checkBlockRestrictionsAfter(defender, controller, game); + choose = !game.getCombat().checkBlockRestrictionsAfter(defender, controller, game); } } game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DECLARED_BLOCKERS, defenderId, defenderId)); // add info about attacker blocked by blocker to the game log if (!game.isSimulation()) { - this.logBlockerInfo(defender, game); + game.getCombat().logBlockerInfo(defender, game); } } } // tool to catch the bug about flyers blocked by non flyers or intimidate blocked by creatures with other colors - TraceUtil.traceCombatIfNeeded(game, this); + TraceUtil.traceCombatIfNeeded(game, game.getCombat()); } /** @@ -424,7 +443,7 @@ public class Combat implements Serializable, Copyable { */ private void logBlockerInfo(Player defender, Game game) { boolean shownDefendingPlayer = game.getPlayers().size() < 3; // only two players no ned to sow the attacked player - for (CombatGroup group : this.getGroups()) { + for (CombatGroup group : game.getCombat().getGroups()) { if (group.defendingPlayerId.equals(defender.getId())) { if (!shownDefendingPlayer) { game.informPlayers("Attacked player: " + defender.getLogName()); @@ -519,12 +538,21 @@ public class Combat implements Serializable, Copyable { UUID attackingCreatureId = requirementEntry.getKey().mustBlockAttacker(ability, game); Player defender = game.getPlayer(possibleBlocker.getControllerId()); if (attackingCreatureId != null && defender != null && possibleBlocker.canBlock(attackingCreatureId, game)) { + Permanent attackingCreature = game.getPermanent(attackingCreatureId); + if (attackingCreature == null || !attackingCreature.isAttacking()) { + // creature that must be blocked is not attacking + continue; + } // check if the possible blocker has to pay cost to block, if so don't force if (game.getContinuousEffects().checkIfThereArePayCostToAttackBlockEffects( GameEvent.getEvent(GameEvent.EventType.DECLARE_BLOCKER, attackingCreatureId, possibleBlocker.getId(), possibleBlocker.getControllerId()), game)) { // has cost to block to pay so remove this attacker continue; } + if (!getDefendingPlayerId(attackingCreatureId, game).equals(possibleBlocker.getControllerId())) { + // Creature can't block if not the controller or a planeswalker of the controller of the possible blocker is attacked + continue; + } if (creatureMustBlockAttackers.containsKey(possibleBlocker.getId())) { creatureMustBlockAttackers.get(possibleBlocker.getId()).add(attackingCreatureId); } else { @@ -659,7 +687,7 @@ public class Combat implements Serializable, Copyable { if (mayBlock) { if (controller.isHuman()) { if (!game.isSimulation()) { - game.informPlayer(controller, "Creature should block this turn: " + creature.getLogName()); + game.informPlayer(controller, "Creature should block this turn: " + creature.getIdName()); } } else { Player defender = game.getPlayer(creature.getControllerId()); @@ -729,6 +757,10 @@ public class Combat implements Serializable, Copyable { if (creatureForcedToBlock == null) { break; } + if (!creatureForcedToBlock.getControllerId().equals(player.getId())) { + // ignore creatures controlled by other players + continue; + } // // check if creature has to pay a cost to block so it's not mandatory to block // boolean removedAttacker = false; @@ -927,15 +959,15 @@ public class Combat implements Serializable, Copyable { } } - public boolean declareAttacker(UUID attackerId, UUID defenderId, UUID playerId, Game game) { - Permanent attacker = game.getPermanent(attackerId); + public boolean declareAttacker(UUID creatureId, UUID defenderId, UUID playerId, Game game) { + Permanent attacker = game.getPermanent(creatureId); if (!attacker.getAbilities().containsKey(VigilanceAbility.getInstance().getId())) { if (!attacker.isTapped()) { attacker.tap(game); } } - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_ATTACKER, defenderId, attackerId, playerId))) { - return addAttackerToCombat(attackerId, defenderId, game); + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_ATTACKER, defenderId, creatureId, playerId))) { + return addAttackerToCombat(creatureId, defenderId, game); } return false; } @@ -1133,10 +1165,10 @@ public class Combat implements Serializable, Copyable { return defenderId; } - public UUID getDefendingPlayerId(UUID attackerId, Game game) { + public UUID getDefendingPlayerId(UUID attackingCreatureId, Game game) { UUID defenderId = null; for (CombatGroup group : groups) { - if (group.getAttackers().contains(attackerId)) { + if (group.getAttackers().contains(attackingCreatureId)) { defenderId = group.getDefenderId(); if (group.defenderIsPlaneswalker) { Permanent permanent = game.getPermanent(defenderId); diff --git a/Mage/src/mage/game/combat/CombatGroup.java b/Mage/src/mage/game/combat/CombatGroup.java index e7cf83c8a75..51c1c196256 100644 --- a/Mage/src/mage/game/combat/CombatGroup.java +++ b/Mage/src/mage/game/combat/CombatGroup.java @@ -411,12 +411,30 @@ public class CombatGroup implements Serializable, Copyable { return true; } + /** + * + * @param blockerId + * @param playerId controller of the blocking creature + * @param game + */ public void addBlocker(UUID blockerId, UUID playerId, Game game) { for (UUID attackerId : attackers) { if (game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_BLOCKER, attackerId, blockerId, playerId))) { return; } } + addBlockerToGroup(blockerId, playerId, game); + } + + /** + * Adds a blocker to a combat group without creating a DECLARE_BLOCKER + * event. + * + * @param blockerId + * @param playerId controller of the blocking creature + * @param game + */ + public void addBlockerToGroup(UUID blockerId, UUID playerId, Game game) { Permanent blocker = game.getPermanent(blockerId); if (blockerId != null && blocker != null) { blocker.setBlocking(blocker.getBlocking() + 1); diff --git a/Mage/src/mage/game/draft/DraftCube.java b/Mage/src/mage/game/draft/DraftCube.java index cb17656cca8..974ca560955 100644 --- a/Mage/src/mage/game/draft/DraftCube.java +++ b/Mage/src/mage/game/draft/DraftCube.java @@ -112,7 +112,7 @@ public abstract class DraftCube { cardInfo = cardList.get(0); } } else { - cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(cardId.getName()); + cardInfo = CardRepository.instance.findPreferedCoreExpansionCard(cardId.getName(), false); } if (cardInfo != null) { diff --git a/Mage/src/mage/game/events/GameEvent.java b/Mage/src/mage/game/events/GameEvent.java index fcabb52c61a..95b1a318e67 100644 --- a/Mage/src/mage/game/events/GameEvent.java +++ b/Mage/src/mage/game/events/GameEvent.java @@ -109,6 +109,10 @@ public class GameEvent implements Serializable { LOSE_LIFE, LOST_LIFE, PLAY_LAND, LAND_PLAYED, CAST_SPELL, + /* SPELL_CAST + x-Costs are already defined + */ + CAST_SPELL_LATE, /* SPELL_CAST targetId id of the spell that's cast sourceId sourceId of the spell that's cast @@ -154,6 +158,12 @@ public class GameEvent implements Serializable { COUNTER, COUNTERED, DECLARING_ATTACKERS, DECLARED_ATTACKERS, + /* DECLARE_ATTACKER + REPLACE EVENT - can be used to replace attack declaration + targetId id of the defending player or planeswalker attacked + sourceId id of the attacking creature + playerId player defining the attacking creatures + */ DECLARE_ATTACKER, /* ATTACKER_DECLARED targetId id of the defending player or planeswalker attacked @@ -179,6 +189,8 @@ public class GameEvent implements Serializable { ENCHANT_PLAYER, ENCHANTED_PLAYER, CAN_TAKE_MULLIGAN, FLIP_COIN, COIN_FLIPPED, SCRY, FATESEAL, + PAID_CUMULATIVE_UPKEEP, + DIDNT_PAY_CUMULATIVE_UPKEEP, //permanent events ENTERS_THE_BATTLEFIELD, TAP, TAPPED, TAPPED_FOR_MANA, @@ -206,6 +218,7 @@ public class GameEvent implements Serializable { SACRIFICE_PERMANENT, SACRIFICED_PERMANENT, FIGHTED_PERMANENT, EXPLOITED_CREATURE, + EVOLVED_CREATURE, ATTACH, ATTACHED, UNATTACH, UNATTACHED, ADD_COUNTER, COUNTER_ADDED, @@ -235,7 +248,6 @@ public class GameEvent implements Serializable { //combat events COMBAT_DAMAGE_APPLIED, SELECTED_ATTACKER, SELECTED_BLOCKER; - } public GameEvent(EventType type, UUID targetId, UUID sourceId, UUID playerId) { diff --git a/Mage/src/mage/game/events/PlayerQueryEvent.java b/Mage/src/mage/game/events/PlayerQueryEvent.java index c6d18ba396a..ea9b9434512 100644 --- a/Mage/src/mage/game/events/PlayerQueryEvent.java +++ b/Mage/src/mage/game/events/PlayerQueryEvent.java @@ -29,6 +29,7 @@ package mage.game.events; import java.io.Serializable; import java.util.EventObject; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -60,8 +61,8 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri private Set targets; private Cards cards; private List booster; - private QueryType queryType; - private UUID playerId; + private final QueryType queryType; + private final UUID playerId; private boolean required; private int min; private int max; @@ -72,11 +73,6 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri private Choice choice; private PlayerQueryEvent(UUID playerId, String message, List abilities, Set choices, Set targets, Cards cards, QueryType queryType, int min, int max, boolean required, Map options) { - this(playerId, message, abilities, choices, targets, cards, queryType, min, max, required); - this.options = options; - } - - private PlayerQueryEvent(UUID playerId, String message, List abilities, Set choices, Set targets, Cards cards, QueryType queryType, int min, int max, boolean required) { super(playerId); this.queryType = queryType; this.message = message; @@ -88,6 +84,12 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri this.required = required; this.min = min; this.max = max; + if (options == null) { + this.options = new HashMap<>(); + } else { + this.options = options; + } + this.options.put("queryType", queryType); } private PlayerQueryEvent(UUID playerId, String message, List booster, QueryType queryType, int time) { @@ -147,8 +149,14 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri this.playerId = playerId; } - public static PlayerQueryEvent askEvent(UUID playerId, String message) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.ASK, 0, 0, false); + public static PlayerQueryEvent askEvent(UUID playerId, String message, Ability source, Map options) { + if (source != null) { + if (options == null) { + options = new HashMap<>(); + } + options.put("originalId", source.getOriginalId()); + } + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.ASK, 0, 0, false, options); } public static PlayerQueryEvent chooseAbilityEvent(UUID playerId, String message, String objectName, List choices) { @@ -157,7 +165,7 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri nameAsSet = new HashSet<>(); nameAsSet.add(objectName); } - return new PlayerQueryEvent(playerId, message, choices, nameAsSet, null, null, QueryType.CHOOSE_ABILITY, 0, 0, false); + return new PlayerQueryEvent(playerId, message, choices, nameAsSet, null, null, QueryType.CHOOSE_ABILITY, 0, 0, false, null); } public static PlayerQueryEvent choosePileEvent(UUID playerId, String message, List pile1, List pile2) { @@ -173,7 +181,7 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri } public static PlayerQueryEvent targetEvent(UUID playerId, String message, Set targets, boolean required) { - return new PlayerQueryEvent(playerId, message, null, null, targets, null, QueryType.PICK_TARGET, 0, 0, required); + return new PlayerQueryEvent(playerId, message, null, null, targets, null, QueryType.PICK_TARGET, 0, 0, required, null); } public static PlayerQueryEvent targetEvent(UUID playerId, String message, Set targets, boolean required, Map options) { @@ -185,7 +193,7 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri } public static PlayerQueryEvent targetEvent(UUID playerId, String message, List abilities) { - return new PlayerQueryEvent(playerId, message, abilities, null, null, null, QueryType.PICK_ABILITY, 0, 0, true); + return new PlayerQueryEvent(playerId, message, abilities, null, null, null, QueryType.PICK_ABILITY, 0, 0, true, null); } public static PlayerQueryEvent targetEvent(UUID playerId, String message, List perms, boolean required) { @@ -193,7 +201,7 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri } public static PlayerQueryEvent selectEvent(UUID playerId, String message) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.SELECT, 0, 0, false); + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.SELECT, 0, 0, false, null); } public static PlayerQueryEvent selectEvent(UUID playerId, String message, Map options) { @@ -205,11 +213,11 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri } public static PlayerQueryEvent playXManaEvent(UUID playerId, String message) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.PLAY_X_MANA, 0, 0, false); + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.PLAY_X_MANA, 0, 0, false, null); } public static PlayerQueryEvent amountEvent(UUID playerId, String message, int min, int max) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.AMOUNT, min, max, false); + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.AMOUNT, min, max, false, null); } public static PlayerQueryEvent pickCard(UUID playerId, String message, List booster, int time) { diff --git a/Mage/src/mage/game/events/PlayerQueryEventSource.java b/Mage/src/mage/game/events/PlayerQueryEventSource.java index 7620ed1657c..ea5f0aed97e 100644 --- a/Mage/src/mage/game/events/PlayerQueryEventSource.java +++ b/Mage/src/mage/game/events/PlayerQueryEventSource.java @@ -32,6 +32,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.UUID; +import mage.abilities.Ability; import mage.abilities.ActivatedAbility; import mage.abilities.TriggeredAbility; import mage.cards.Card; @@ -58,8 +59,8 @@ public class PlayerQueryEventSource implements EventSource, Se dispatcher.removeAllListener(); } - public void ask(UUID playerId, String message) { - dispatcher.fireEvent(PlayerQueryEvent.askEvent(playerId, message)); + public void ask(UUID playerId, String message, Ability source, Map options) { + dispatcher.fireEvent(PlayerQueryEvent.askEvent(playerId, message, source, options)); } public void select(UUID playerId, String message) { diff --git a/Mage/src/mage/game/match/MatchImpl.java b/Mage/src/mage/game/match/MatchImpl.java index 956f32bebd1..9bc0db8ca2f 100644 --- a/Mage/src/mage/game/match/MatchImpl.java +++ b/Mage/src/mage/game/match/MatchImpl.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,15 +20,13 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.game.match; - import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -54,7 +52,7 @@ import org.apache.log4j.Logger; public abstract class MatchImpl implements Match { private static final Logger logger = Logger.getLogger(MatchImpl.class); - + protected UUID id = UUID.randomUUID(); protected List players = new ArrayList<>(); protected List games = new ArrayList<>(); @@ -87,7 +85,7 @@ public abstract class MatchImpl implements Match { @Override public MatchPlayer getPlayer(UUID playerId) { - for (MatchPlayer player: players) { + for (MatchPlayer player : players) { if (player.getPlayer().getId().equals(playerId)) { return player; } @@ -97,7 +95,7 @@ public abstract class MatchImpl implements Match { @Override public void addPlayer(Player player, Deck deck) { - MatchPlayer matchPlayer = new MatchPlayer(player, deck); + MatchPlayer matchPlayer = new MatchPlayer(player, deck, this); player.setMatchPlayer(matchPlayer); players.add(matchPlayer); } @@ -145,10 +143,10 @@ public abstract class MatchImpl implements Match { if (getGame() == null && isDoneSideboarding()) { checkIfMatchEnds(); } - if (getGame() != null && getGame().hasEnded()) { - for (MatchPlayer matchPlayer:players) { + if (getGame() != null && getGame().hasEnded()) { + for (MatchPlayer matchPlayer : players) { if (matchPlayer.getPlayer().hasQuit() && !matchPlayer.hasQuit()) { - logger.warn("MatchPlayer was not set to quit matchId " + this.getId()+ " - " + matchPlayer.getName()); + logger.warn("MatchPlayer was not set to quit matchId " + this.getId() + " - " + matchPlayer.getName()); matchPlayer.setQuit(true); } } @@ -166,7 +164,7 @@ public abstract class MatchImpl implements Match { public boolean checkIfMatchEnds() { int activePlayers = 0; MatchPlayer matchWinner = null; - for (MatchPlayer matchPlayer: players) { + for (MatchPlayer matchPlayer : players) { if (!matchPlayer.hasQuit()) { activePlayers++; matchWinner = matchPlayer; @@ -192,7 +190,7 @@ public abstract class MatchImpl implements Match { if (games.isEmpty()) { return null; } - return games.get(games.size() -1); + return games.get(games.size() - 1); } @Override @@ -222,16 +220,16 @@ public abstract class MatchImpl implements Match { protected void initGame(Game game) throws GameException { addGame(); // raises only the number - shufflePlayers(); - for (MatchPlayer matchPlayer: this.players) { + shufflePlayers(); + for (MatchPlayer matchPlayer : this.players) { if (!matchPlayer.hasQuit()) { matchPlayer.getPlayer().init(game); game.loadCards(matchPlayer.getDeck().getCards(), matchPlayer.getPlayer().getId()); game.loadCards(matchPlayer.getDeck().getSideboard(), matchPlayer.getPlayer().getId()); game.addPlayer(matchPlayer.getPlayer(), matchPlayer.getDeck()); // set the priority time left for the match - if (games.isEmpty()) { // first game full time - matchPlayer.getPlayer().setPriorityTimeLeft(options.getPriorityTime()); + if (games.isEmpty()) { // first game full time + matchPlayer.getPlayer().setPriorityTimeLeft(options.getPriorityTime()); } else { if (matchPlayer.getPriorityTimeLeft() > 0) { matchPlayer.getPlayer().setPriorityTimeLeft(matchPlayer.getPriorityTimeLeft()); @@ -249,7 +247,7 @@ public abstract class MatchImpl implements Match { @Override public void endGame() { Game game = getGame(); - for (MatchPlayer matchPlayer: this.players) { + for (MatchPlayer matchPlayer : this.players) { Player player = game.getPlayer(matchPlayer.getPlayer().getId()); if (player != null) { // get the left time from player priority timer @@ -277,7 +275,7 @@ public abstract class MatchImpl implements Match { StringBuilder playersInfo = new StringBuilder(); int counter = 0; - for (MatchPlayer matchPlayer: getPlayers()) { + for (MatchPlayer matchPlayer : getPlayers()) { if (counter > 0) { playersInfo.append(" - "); } @@ -290,14 +288,13 @@ public abstract class MatchImpl implements Match { String duelingTime = ""; if (game.hasEnded()) { if (game.getEndTime() != null) { - duelingTime = " (" + DateFormat.getDuration((game.getEndTime().getTime() - game.getStartTime().getTime())/1000) + ")"; + duelingTime = " (" + DateFormat.getDuration((game.getEndTime().getTime() - game.getStartTime().getTime()) / 1000) + ")"; } state = "Finished" + duelingTime; result = game.getWinner(); - } - else { + } else { if (game.getStartTime() != null) { - duelingTime = " (" + DateFormat.getDuration((new Date().getTime() - game.getStartTime().getTime())/1000) + ")"; + duelingTime = " (" + DateFormat.getDuration((new Date().getTime() - game.getStartTime().getTime()) / 1000) + ")"; } state = "Dueling" + duelingTime; result = ""; @@ -317,7 +314,7 @@ public abstract class MatchImpl implements Match { @Override public void setTournamentRound(int round) { - for (GameInfo gameInfo: gamesInfo) { + for (GameInfo gameInfo : gamesInfo) { gameInfo.setRoundNum(round); } } @@ -326,7 +323,7 @@ public abstract class MatchImpl implements Match { public UUID getChooser() { UUID loserId = null; Game game = getGame(); - for (MatchPlayer player: this.players) { + for (MatchPlayer player : this.players) { Player p = game.getPlayer(player.getPlayer().getId()); if (p != null && p.hasLost() && !p.hasQuit()) { loserId = p.getId(); @@ -342,7 +339,7 @@ public abstract class MatchImpl implements Match { @Override public void sideboard() { - for (MatchPlayer player: this.players) { + for (MatchPlayer player : this.players) { if (!player.hasQuit()) { if (player.getDeck() != null) { player.setSideboarding(); @@ -352,18 +349,19 @@ public abstract class MatchImpl implements Match { } } } - synchronized(this) { + synchronized (this) { while (!isDoneSideboarding()) { try { this.wait(); - } catch (InterruptedException ex) { } + } catch (InterruptedException ex) { + } } } } @Override public boolean isDoneSideboarding() { - for (MatchPlayer player: this.players) { + for (MatchPlayer player : this.players) { if (!player.hasQuit() && !player.isDoneSideboarding()) { return false; } @@ -375,7 +373,7 @@ public abstract class MatchImpl implements Match { //@Override public boolean areAllDoneSideboarding() { int count = 0; - for (MatchPlayer player: this.players) { + for (MatchPlayer player : this.players) { if (!player.hasQuit() && player.isDoneSideboarding()) { return true; } @@ -419,9 +417,9 @@ public abstract class MatchImpl implements Match { protected String createGameStartMessage() { StringBuilder sb = new StringBuilder(); sb.append("
Match score:
"); - for (MatchPlayer mp :this.getPlayers()) { + for (MatchPlayer mp : this.getPlayers()) { sb.append(" ").append(mp.getPlayer().getLogName()); - sb.append(" - ").append(mp.getWins()).append(mp.getWins()==1?" win":" wins"); + sb.append(" - ").append(mp.getWins()).append(mp.getWins() == 1 ? " win" : " wins"); if (mp.hasQuit()) { sb.append(" QUITTED"); } @@ -431,7 +429,7 @@ public abstract class MatchImpl implements Match { if (getDraws() > 0) { sb.append(" Draws: ").append(getDraws()).append("
"); } - sb.append("
").append("You have to win ").append(this.getWinsNeeded()).append(this.getWinsNeeded() == 1 ? " game":" games").append(" to win the complete match
"); + sb.append("
").append("You have to win ").append(this.getWinsNeeded()).append(this.getWinsNeeded() == 1 ? " game" : " games").append(" to win the complete match
"); sb.append("
Game has started

"); return sb.toString(); } @@ -464,13 +462,13 @@ public abstract class MatchImpl implements Match { @Override public void cleanUpOnMatchEnd(boolean isSaveGameActivated, boolean isTournament) { - for (MatchPlayer matchPlayer: players) { + for (MatchPlayer matchPlayer : players) { matchPlayer.cleanUpOnMatchEnd(); } if ((!isSaveGameActivated && !isTournament) || this.getGame().isSimulation()) { this.getGames().clear(); - } - } + } + } @Override public void addDraw() { @@ -482,10 +480,9 @@ public abstract class MatchImpl implements Match { return draws; } - @Override public void cleanUp() { - for (MatchPlayer matchPlayer: players) { + for (MatchPlayer matchPlayer : players) { matchPlayer.cleanUpOnMatchEnd(); } this.getGames().clear(); diff --git a/Mage/src/mage/game/match/MatchPlayer.java b/Mage/src/mage/game/match/MatchPlayer.java index 6f77ebfe8a5..f2c5d483dd4 100644 --- a/Mage/src/mage/game/match/MatchPlayer.java +++ b/Mage/src/mage/game/match/MatchPlayer.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.game.match; import java.io.Serializable; @@ -38,26 +37,27 @@ import mage.players.Player; * @author BetaSteward_at_googlemail.com */ public class MatchPlayer implements Serializable { - + private static final long serialVersionUID = 42L; - + private int wins; + private int winsNeeded; private boolean matchWinner; private Deck deck; private Player player; private final String name; - + private boolean quit; //private final boolean timerTimeout; private boolean doneSideboarding; private int priorityTimeLeft; - - public MatchPlayer(Player player, Deck deck) { + public MatchPlayer(Player player, Deck deck, Match match) { this.player = player; this.deck = deck; this.wins = 0; + this.winsNeeded = match.getWinsNeeded(); this.doneSideboarding = true; this.quit = false; //this.timerTimeout = false; @@ -77,6 +77,10 @@ public class MatchPlayer implements Serializable { return wins; } + public int getWinsNeeded() { + return winsNeeded; + } + public void addWin() { this.wins++; } @@ -153,5 +157,5 @@ public class MatchPlayer implements Serializable { public String getName() { return name; } - + } diff --git a/Mage/src/mage/game/permanent/Battlefield.java b/Mage/src/mage/game/permanent/Battlefield.java index e44a9c59f74..115e78a3c38 100644 --- a/Mage/src/mage/game/permanent/Battlefield.java +++ b/Mage/src/mage/game/permanent/Battlefield.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.game.permanent; import java.io.Serializable; @@ -51,10 +50,11 @@ public class Battlefield implements Serializable { private final Map field = new LinkedHashMap<>(); - public Battlefield () {} + public Battlefield() { + } public Battlefield(final Battlefield battlefield) { - for (Entry entry: battlefield.field.entrySet()) { + for (Entry entry : battlefield.field.entrySet()) { field.put(entry.getKey(), entry.getValue().copy()); } } @@ -64,7 +64,7 @@ public class Battlefield implements Serializable { } public void reset(Game game) { - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { perm.reset(game); } } @@ -74,11 +74,13 @@ public class Battlefield implements Serializable { } /** - * Returns a count of all {@link Permanent} that match the filter and are controlled by controllerId. - * - * Some filter predicates do not work here (e.g. AnotherPredicate() because filter.match() is called - * without controllerId. To use this predicates you can use count() instead of countAll() - * + * Returns a count of all {@link Permanent} that match the filter and are + * controlled by controllerId. + * + * Some filter predicates do not work here (e.g. AnotherPredicate() because + * filter.match() is called without controllerId. To use this predicates you + * can use count() instead of countAll() + * * @param filter * @param controllerId * @param game @@ -86,7 +88,7 @@ public class Battlefield implements Serializable { */ public int countAll(FilterPermanent filter, UUID controllerId, Game game) { int count = 0; - for (Permanent permanent: field.values()) { + for (Permanent permanent : field.values()) { if (permanent.getControllerId().equals(controllerId) && filter.match(permanent, game) && permanent.isPhasedIn()) { count++; } @@ -95,29 +97,28 @@ public class Battlefield implements Serializable { } /** - * Returns a count of all {@link Permanent} that are within the range of influence of the specified player id - * and that match the supplied filter. + * Returns a count of all {@link Permanent} that are within the range of + * influence of the specified player id and that match the supplied filter. * * @param filter - * @param sourceId - sourceId of the MageObject the calling effect/ability belongs to + * @param sourceId - sourceId of the MageObject the calling effect/ability + * belongs to * @param sourcePlayerId * @param game * @return count */ - public int count(FilterPermanent filter, UUID sourceId, UUID sourcePlayerId, Game game) { int count = 0; if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { - for (Permanent permanent: field.values()) { - if (filter.match(permanent, sourceId, sourcePlayerId, game) && permanent.isPhasedIn()) { + for (Permanent permanent : field.values()) { + if (filter.match(permanent, sourceId, sourcePlayerId, game) && permanent.isPhasedIn()) { count++; } } - } - else { + } else { Set range = game.getPlayer(sourcePlayerId).getInRange(); - for (Permanent permanent: field.values()) { - if (range.contains(permanent.getControllerId()) && filter.match(permanent, sourceId, sourcePlayerId, game) && permanent.isPhasedIn()) { + for (Permanent permanent : field.values()) { + if (range.contains(permanent.getControllerId()) && filter.match(permanent, sourceId, sourcePlayerId, game) && permanent.isPhasedIn()) { count++; } } @@ -127,8 +128,7 @@ public class Battlefield implements Serializable { /** * Returns true if the battlefield contains at least 1 {@link Permanent} - * that matches the filter. - * This method ignores the range of influence. + * that matches the filter. This method ignores the range of influence. * * @param filter * @param num @@ -137,7 +137,7 @@ public class Battlefield implements Serializable { */ public boolean contains(FilterPermanent filter, int num, Game game) { int count = 0; - for (Permanent permanent: field.values()) { + for (Permanent permanent : field.values()) { if (filter.match(permanent, game) && permanent.isPhasedIn()) { count++; if (num == count) { @@ -150,8 +150,8 @@ public class Battlefield implements Serializable { /** * Returns true if the battlefield contains num or more {@link Permanent} - * that matches the filter and is controlled by controllerId. - * This method ignores the range of influence. + * that matches the filter and is controlled by controllerId. This method + * ignores the range of influence. * * @param filter * @param controllerId @@ -161,7 +161,7 @@ public class Battlefield implements Serializable { */ public boolean contains(FilterPermanent filter, UUID controllerId, int num, Game game) { int count = 0; - for (Permanent permanent: field.values()) { + for (Permanent permanent : field.values()) { if (permanent.getControllerId().equals(controllerId) && filter.match(permanent, game) && permanent.isPhasedIn()) { count++; if (num == count) { @@ -174,8 +174,8 @@ public class Battlefield implements Serializable { /** * Returns true if the battlefield contains num or more {@link Permanent} - * that is within the range of influence of the specified player id - * and that matches the supplied filter. + * that is within the range of influence of the specified player id and that + * matches the supplied filter. * * @param filter * @param sourcePlayerId @@ -186,7 +186,7 @@ public class Battlefield implements Serializable { public boolean contains(FilterPermanent filter, UUID sourcePlayerId, Game game, int num) { int count = 0; if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { - for (Permanent permanent: field.values()) { + for (Permanent permanent : field.values()) { if (filter.match(permanent, null, sourcePlayerId, game) && permanent.isPhasedIn()) { count++; if (num == count) { @@ -194,10 +194,9 @@ public class Battlefield implements Serializable { } } } - } - else { + } else { Set range = game.getPlayer(sourcePlayerId).getInRange(); - for (Permanent permanent: field.values()) { + for (Permanent permanent : field.values()) { if (range.contains(permanent.getControllerId()) && filter.match(permanent, null, sourcePlayerId, game) && permanent.isPhasedIn()) { count++; if (num == count) { @@ -226,13 +225,13 @@ public class Battlefield implements Serializable { } public void beginningOfTurn(Game game) { - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { perm.beginningOfTurn(game); } } public void endOfTurn(UUID controllerId, Game game) { - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { perm.endOfTurn(game); } } @@ -247,7 +246,7 @@ public class Battlefield implements Serializable { public List getAllActivePermanents() { List active = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn()) { active.add(perm); } @@ -256,16 +255,16 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} on the battlefield that are controlled by the specified - * player id. The method ignores the range of influence. - * + * Returns all {@link Permanent} on the battlefield that are controlled by + * the specified player id. The method ignores the range of influence. + * * @param controllerId * @return a list of {@link Permanent} * @see Permanent */ public List getAllActivePermanents(UUID controllerId) { List active = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) { active.add(perm); } @@ -274,16 +273,16 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} on the battlefield that match the specified {@link CardType}. - * This method ignores the range of influence. - * + * Returns all {@link Permanent} on the battlefield that match the specified + * {@link CardType}. This method ignores the range of influence. + * * @param type * @return a list of {@link Permanent} * @see Permanent */ public List getAllActivePermanents(CardType type) { List active = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && perm.getCardType().contains(type)) { active.add(perm); } @@ -292,9 +291,9 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} on the battlefield that match the supplied filter. - * This method ignores the range of influence. - * + * Returns all {@link Permanent} on the battlefield that match the supplied + * filter. This method ignores the range of influence. + * * * @param filter * @param game @@ -303,7 +302,7 @@ public class Battlefield implements Serializable { */ public List getAllActivePermanents(FilterPermanent filter, Game game) { List active = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && filter.match(perm, game)) { active.add(perm); } @@ -312,8 +311,8 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} that match the filter and are controlled by controllerId. - * This method ignores the range of influence. + * Returns all {@link Permanent} that match the filter and are controlled by + * controllerId. This method ignores the range of influence. * * @param filter * @param controllerId @@ -323,7 +322,7 @@ public class Battlefield implements Serializable { */ public List getAllActivePermanents(FilterPermanent filter, UUID controllerId, Game game) { List active = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && perm.getControllerId().equals(controllerId) && filter.match(perm, game)) { active.add(perm); } @@ -332,8 +331,8 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} that are within the range of influence of the specified player id - * and that match the supplied filter. + * Returns all {@link Permanent} that are within the range of influence of + * the specified player id and that match the supplied filter. * * @param filter * @param sourcePlayerId @@ -346,9 +345,9 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} that are within the range of influence of the specified player id - * and that match the supplied filter. - * + * Returns all {@link Permanent} that are within the range of influence of + * the specified player id and that match the supplied filter. + * * @param filter * @param sourcePlayerId * @param sourceId @@ -359,15 +358,14 @@ public class Battlefield implements Serializable { public List getActivePermanents(FilterPermanent filter, UUID sourcePlayerId, UUID sourceId, Game game) { List active = new ArrayList<>(); if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && filter.match(perm, sourceId, sourcePlayerId, game)) { active.add(perm); } } - } - else { + } else { Set range = game.getPlayer(sourcePlayerId).getInRange(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && range.contains(perm.getControllerId()) && filter.match(perm, sourceId, sourcePlayerId, game)) { active.add(perm); } @@ -377,8 +375,9 @@ public class Battlefield implements Serializable { } /** - * Returns all {@link Permanent} that are within the range of influence of the specified player id. - * + * Returns all {@link Permanent} that are within the range of influence of + * the specified player id. + * * @param sourcePlayerId * @param game * @return a list of {@link Permanent} @@ -387,11 +386,10 @@ public class Battlefield implements Serializable { public List getActivePermanents(UUID sourcePlayerId, Game game) { if (game.getRangeOfInfluence() == RangeOfInfluence.ALL) { return getAllActivePermanents(); - } - else { + } else { List active = new ArrayList<>(); Set range = game.getPlayer(sourcePlayerId).getInRange(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn() && range.contains(perm.getControllerId())) { active.add(perm); } @@ -402,7 +400,7 @@ public class Battlefield implements Serializable { public List getPhasedIn(UUID controllerId) { List phasedIn = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.getAbilities().containsKey(PhasingAbility.getInstance().getId()) && perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) { phasedIn.add(perm); } @@ -412,7 +410,7 @@ public class Battlefield implements Serializable { public List getPhasedOut(UUID controllerId) { List phasedOut = new ArrayList<>(); - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (!perm.isPhasedIn() && perm.getControllerId().equals(controllerId)) { phasedOut.add(perm); } @@ -421,23 +419,24 @@ public class Battlefield implements Serializable { } public void resetPermanentsControl() { - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn()) { perm.resetControl(); } } } - + /** - * since control could change several times during applyEvents we only want to fire - * control changed events after all control change effects have been applied - * - * @param game + * since control could change several times during applyEvents we only want + * to fire control changed events after all control change effects have been + * applied + * + * @param game * @return */ public boolean fireControlChangeEvents(Game game) { boolean controlChanged = false; - for (Permanent perm: field.values()) { + for (Permanent perm : field.values()) { if (perm.isPhasedIn()) { controlChanged |= perm.checkControlChanged(game); } diff --git a/Mage/src/mage/game/permanent/Permanent.java b/Mage/src/mage/game/permanent/Permanent.java index 9a53acdc2d1..b7e8178a815 100644 --- a/Mage/src/mage/game/permanent/Permanent.java +++ b/Mage/src/mage/game/permanent/Permanent.java @@ -109,6 +109,8 @@ public interface Permanent extends Card, Controllable { UUID getAttachedTo(); + int getAttachedToZoneChangeCounter(); + void attachTo(UUID permanentId, Game game); boolean addAttachment(UUID permanentId, Game game); @@ -347,4 +349,5 @@ public interface Permanent extends Card, Controllable { int getCreateOrder(); void setCreateOrder(int createOrder); + } diff --git a/Mage/src/mage/game/permanent/PermanentCard.java b/Mage/src/mage/game/permanent/PermanentCard.java index af54c92b1dc..795f83501e0 100644 --- a/Mage/src/mage/game/permanent/PermanentCard.java +++ b/Mage/src/mage/game/permanent/PermanentCard.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.game.permanent; import java.util.ArrayList; @@ -49,20 +48,23 @@ public class PermanentCard extends PermanentImpl { protected int maxLevelCounters; protected Card card; + // the number this permanent instance had protected int zoneChangeCounter; public PermanentCard(Card card, UUID controllerId, Game game) { super(card.getId(), card.getOwnerId(), controllerId, card.getName()); - this.card = card.copy(); + // this.card = card.copy(); + this.card = card; + this.zoneChangeCounter = card.getZoneChangeCounter(game); // local value already set to the raised number init(card, game); } private void init(Card card, Game game) { copyFromCard(card); - this.zoneChangeCounter = card.getZoneChangeCounter(game); + /*if (card.getCardType().contains(CardType.PLANESWALKER)) { - this.loyalty = new MageInt(card.getLoyalty().getValue()); - }*/ + this.loyalty = new MageInt(card.getLoyalty().getValue()); + }*/ if (card instanceof LevelerCard) { maxLevelCounters = ((LevelerCard) card).getMaxLevelCounters(); } @@ -90,17 +92,16 @@ public class PermanentCard extends PermanentImpl { super.reset(game); } - protected void copyFromCard(Card card) { + protected void copyFromCard(final Card card) { this.name = card.getName(); this.abilities.clear(); if (this.faceDown) { - for (Ability ability: card.getAbilities()) { + for (Ability ability : card.getAbilities()) { if (ability.getWorksFaceDown()) { this.abilities.add(ability.copy()); } } - } - else { + } else { this.abilities = card.getAbilities().copy(); } this.abilities.setControllerId(this.controllerId); @@ -135,6 +136,7 @@ public class PermanentCard extends PermanentImpl { public Card getCard() { return card; } + @Override public boolean moveToZone(Zone toZone, UUID sourceId, Game game, boolean flag) { return moveToZone(toZone, sourceId, game, flag, null); @@ -255,20 +257,22 @@ public class PermanentCard extends PermanentImpl { } return super.getManaCost(); } - + @Override public int getZoneChangeCounter(Game game) { - return this.zoneChangeCounter; + // permanent value of zone change counter stays always the same without exception of update during the process of putting the permanent onto the battlefield + return zoneChangeCounter; } @Override public void updateZoneChangeCounter(Game game) { - this.zoneChangeCounter++; + card.updateZoneChangeCounter(game); + zoneChangeCounter = card.getZoneChangeCounter(game); } @Override public void setZoneChangeCounter(int value, Game game) { - this.zoneChangeCounter = value; + card.setZoneChangeCounter(value, game); } } diff --git a/Mage/src/mage/game/permanent/PermanentImpl.java b/Mage/src/mage/game/permanent/PermanentImpl.java index 93b2f355be7..b1f15c03398 100644 --- a/Mage/src/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/mage/game/permanent/PermanentImpl.java @@ -84,7 +84,7 @@ import mage.util.ThreadLocalStringBuilder; */ public abstract class PermanentImpl extends CardImpl implements Permanent { - private static final transient ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(300); + private static final ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(300); protected boolean tapped; protected boolean flipped; @@ -115,6 +115,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { protected Map> connectedCards = new HashMap<>(); protected HashSet dealtDamageByThisTurn; protected UUID attachedTo; + protected int attachedToZoneChangeCounter; protected UUID pairedCard; protected Counters counters; protected List markedDamage; @@ -172,6 +173,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { } this.counters = permanent.counters.copy(); this.attachedTo = permanent.attachedTo; + this.attachedToZoneChangeCounter = permanent.attachedToZoneChangeCounter; this.minBlockedBy = permanent.minBlockedBy; this.maxBlockedBy = permanent.maxBlockedBy; this.transformed = permanent.transformed; @@ -645,6 +647,9 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { if (!game.replaceEvent(new GameEvent(GameEvent.EventType.ATTACH, objectId, permanentId, controllerId))) { this.attachments.add(permanentId); Permanent attachment = game.getPermanent(permanentId); + if (attachment == null) { + attachment = game.getPermanentEntering(permanentId); + } if (attachment != null) { attachment.attachTo(objectId, game); game.fireEvent(new GameEvent(GameEvent.EventType.ATTACHED, objectId, permanentId, controllerId)); @@ -676,6 +681,11 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { return attachedTo; } + @Override + public int getAttachedToZoneChangeCounter() { + return attachedToZoneChangeCounter; + } + @Override public void addConnectedCard(String key, UUID connectedCard) { if (this.connectedCards.containsKey(key)) { @@ -712,6 +722,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { } } this.attachedTo = permanentId; + this.attachedToZoneChangeCounter = game.getState().getZoneChangeCounter(permanentId); for (Ability ability : this.getAbilities()) { for (Iterator ite = ability.getEffects(game, EffectType.CONTINUOUS).iterator(); ite.hasNext();) { ContinuousEffect effect = (ContinuousEffect) ite.next(); @@ -908,11 +919,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { EntersTheBattlefieldEvent event = new EntersTheBattlefieldEvent(this, sourceId, getControllerId(), fromZone); if (!game.replaceEvent(event)) { if (fireEvent) { - if (sourceId == null) { // play lands - game.fireEvent(event); - } else { // from effects - game.addSimultaneousEvent(event); - } + game.addSimultaneousEvent(event); } return true; } diff --git a/Mage/src/mage/game/permanent/token/AngelToken.java b/Mage/src/mage/game/permanent/token/AngelToken.java index c21fd10160c..95a43e34646 100644 --- a/Mage/src/mage/game/permanent/token/AngelToken.java +++ b/Mage/src/mage/game/permanent/token/AngelToken.java @@ -1,25 +1,34 @@ package mage.game.permanent.token; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import mage.MageInt; import mage.abilities.keyword.FlyingAbility; import mage.constants.CardType; public class AngelToken extends Token { - + + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("AVR", "C14", "CFX", "GTC", "ISD", "M14", "ORI", "ZEN")); + } + public AngelToken() { - this("M14"); + this(null); } public AngelToken(String setCode) { super("Angel", "4/4 white Angel creature token with flying"); - this.setOriginalExpansionSetCode(setCode); + availableImageSetCodes = tokenImageSets; + setOriginalExpansionSetCode(setCode); + cardType.add(CardType.CREATURE); color.setWhite(true); - subtype.add("Angel"); power = new MageInt(4); toughness = new MageInt(4); addAbility(FlyingAbility.getInstance()); - } } diff --git a/Mage/src/mage/game/permanent/token/BeastToken2.java b/Mage/src/mage/game/permanent/token/BeastToken2.java new file mode 100644 index 00000000000..4304707b4e2 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/BeastToken2.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.game.permanent.token; + +import java.util.Arrays; +import mage.MageInt; +import mage.constants.CardType; + +/** + * + * @author LoneFox + */ +public class BeastToken2 extends Token { + + public BeastToken2() { + super("Beast", "4/4 green Beast creature token"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Beast"); + power = new MageInt(4); + toughness = new MageInt(4); + availableImageSetCodes.addAll(Arrays.asList("ZEN", "C14", "DDD", "C15")); + } + + public BeastToken2(final BeastToken2 token) { + super(token); + } + + @Override + public BeastToken2 copy() { + return new BeastToken2(this); + } + + @Override + public void setExpansionSetCodeForImage(String code) { + super.setExpansionSetCodeForImage(code); + if (getOriginalExpansionSetCode().equals("C14") || getOriginalExpansionSetCode().equals("DDD")) { + this.setTokenType(2); + } + } +} diff --git a/Mage/src/mage/game/permanent/token/BirdToken.java b/Mage/src/mage/game/permanent/token/BirdToken.java new file mode 100644 index 00000000000..9100fd4e314 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/BirdToken.java @@ -0,0 +1,69 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import java.util.Arrays; +import mage.constants.CardType; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; + +/** + * + * @author LoneFox + */ +public class BirdToken extends Token { + + public BirdToken() { + super("Bird", "1/1 white Bird creature token with flying"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Bird"); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(FlyingAbility.getInstance()); + availableImageSetCodes.addAll(Arrays.asList("BNG", "RTR", "ZEN")); + } + + public BirdToken(final BirdToken token) { + super(token); + } + + @Override + public BirdToken copy() { + return new BirdToken(this); + } + + @Override + public void setExpansionSetCodeForImage(String code) { + super.setExpansionSetCodeForImage(code); + if (getOriginalExpansionSetCode().equals("BNG")) { + this.setTokenType(1); + } + } +} diff --git a/Mage/src/mage/game/permanent/token/CatToken.java b/Mage/src/mage/game/permanent/token/CatToken.java new file mode 100644 index 00000000000..486891abbb1 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/CatToken.java @@ -0,0 +1,50 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import java.util.Arrays; +import mage.constants.CardType; +import mage.MageInt; + +/** + * + * @author LoneFox + */ +public class CatToken extends Token { + + public CatToken() { + super("Cat", "2/2 white Cat creature token"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Cat"); + power = new MageInt(2); + toughness = new MageInt(2); + availableImageSetCodes.addAll(Arrays.asList("SOM", "M13", "M14", "C14")); + } +} diff --git a/Mage/src/mage/game/permanent/token/DemonToken.java b/Mage/src/mage/game/permanent/token/DemonToken.java new file mode 100644 index 00000000000..824d6eb0a28 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/DemonToken.java @@ -0,0 +1,69 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import java.util.Arrays; +import mage.constants.CardType; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; + +/** + * + * @author LoneFox + */ +public class DemonToken extends Token { + + public DemonToken() { + super("Demon", "5/5 black Demon creature token with flying"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Demon"); + power = new MageInt(5); + toughness = new MageInt(5); + addAbility(FlyingAbility.getInstance()); + availableImageSetCodes.addAll(Arrays.asList("INN", "AVR", "C14", "ORI")); + } + + public DemonToken(final DemonToken token) { + super(token); + } + + @Override + public DemonToken copy() { + return new DemonToken(this); + } + + @Override + public void setExpansionSetCodeForImage(String code) { + super.setExpansionSetCodeForImage(code); + if (getOriginalExpansionSetCode().equals("C14")) { + this.setTokenType(2); + } + } +} diff --git a/Mage/src/mage/game/permanent/token/DragonToken2.java b/Mage/src/mage/game/permanent/token/DragonToken2.java new file mode 100644 index 00000000000..578178c9a67 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/DragonToken2.java @@ -0,0 +1,52 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import java.util.Arrays; +import mage.constants.CardType; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; + +/** + * + * @author LoneFox + */ +public class DragonToken2 extends Token { + + public DragonToken2() { + super("Dragon", "5/5 red Dragon creature token with flying"); + cardType.add(CardType.CREATURE); + color.setRed(true); + subtype.add("Dragon"); + power = new MageInt(5); + toughness = new MageInt(5); + addAbility(FlyingAbility.getInstance()); + availableImageSetCodes.addAll(Arrays.asList("WWK", "10E")); + } +} diff --git a/Mage/src/mage/game/permanent/token/EldraziScionToken.java b/Mage/src/mage/game/permanent/token/EldraziScionToken.java new file mode 100644 index 00000000000..92d33cadc1f --- /dev/null +++ b/Mage/src/mage/game/permanent/token/EldraziScionToken.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.game.permanent.token; + +import java.util.Random; +import mage.MageInt; +import mage.Mana; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.mana.SimpleManaAbility; +import mage.constants.CardType; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class EldraziScionToken extends Token { + + public EldraziScionToken() { + super("Eldrazi Scion", "1/1 colorless Eldrazi Scion creature token with \"Sacrifice this creature: Add {1} to your mana pool.\""); + cardType.add(CardType.CREATURE); + subtype.add("Eldrazi"); + subtype.add("Scion"); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana, new SacrificeSourceCost())); + setOriginalExpansionSetCode("BFZ"); + + } + + @Override + public void setExpansionSetCodeForImage(String code) { + super.setExpansionSetCodeForImage(code); + if (getOriginalExpansionSetCode().equals("BFZ")) { + this.setTokenType(new Random().nextInt(3) + 1); // 3 different images + } + } + + public EldraziScionToken(final EldraziScionToken token) { + super(token); + } + + @Override + public EldraziScionToken copy() { + return new EldraziScionToken(this); //To change body of generated methods, choose Tools | Templates. + } +} diff --git a/Mage/src/mage/game/permanent/token/EldraziSpawnToken.java b/Mage/src/mage/game/permanent/token/EldraziSpawnToken.java index ec4e3a30a77..c5139001e99 100644 --- a/Mage/src/mage/game/permanent/token/EldraziSpawnToken.java +++ b/Mage/src/mage/game/permanent/token/EldraziSpawnToken.java @@ -28,6 +28,9 @@ package mage.game.permanent.token; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import java.util.Random; import mage.constants.CardType; import mage.constants.Zone; @@ -42,6 +45,12 @@ import mage.abilities.mana.SimpleManaAbility; */ public class EldraziSpawnToken extends Token { + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("ROE", "MM2", "DDP")); + } + public EldraziSpawnToken() { super("Eldrazi Spawn", "0/1 colorless Eldrazi Spawn creature with \"Sacrifice this creature: Add {1} to your mana pool.\""); cardType.add(CardType.CREATURE); @@ -50,7 +59,8 @@ public class EldraziSpawnToken extends Token { power = new MageInt(0); toughness = new MageInt(1); addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana, new SacrificeSourceCost())); - this.setOriginalExpansionSetCode("ROE"); + + availableImageSetCodes = tokenImageSets; // Get one of the three possible token images this.setTokenType(new Random().nextInt(3) + 1); } diff --git a/Mage/src/mage/game/permanent/token/ElephantToken.java b/Mage/src/mage/game/permanent/token/ElephantToken.java index 2b04118862a..a95182b2b1a 100644 --- a/Mage/src/mage/game/permanent/token/ElephantToken.java +++ b/Mage/src/mage/game/permanent/token/ElephantToken.java @@ -28,6 +28,10 @@ package mage.game.permanent.token; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import mage.MageInt; import mage.ObjectColor; import mage.constants.CardType; @@ -38,6 +42,12 @@ import mage.constants.CardType; */ public class ElephantToken extends Token { + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("C14", "CNS", "DDD", "MM2", "WWK")); + } + public ElephantToken() { super("Elephant", "3/3 green Elephant creature token"); cardType.add(CardType.CREATURE); @@ -46,7 +56,7 @@ public class ElephantToken extends Token { power = new MageInt(3); toughness = new MageInt(3); - this.setOriginalExpansionSetCode("DDD"); + availableImageSetCodes = tokenImageSets; } } \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/FaerieRogueToken.java b/Mage/src/mage/game/permanent/token/FaerieRogueToken.java new file mode 100644 index 00000000000..d4c111c3243 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/FaerieRogueToken.java @@ -0,0 +1,63 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import mage.constants.CardType; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; + +/** + * + * @author LoneFox + */ +public class FaerieRogueToken extends Token { + + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("SHM", "MOR", "MMA", "MM2")); + } + + public FaerieRogueToken() { + super("Faerie Rogue", "1/1 black Faerie Rogue creature token with flying"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Faerie"); + subtype.add("Rogue"); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(FlyingAbility.getInstance()); + + availableImageSetCodes = tokenImageSets; + } +} diff --git a/Mage/src/mage/game/permanent/token/GoatToken.java b/Mage/src/mage/game/permanent/token/GoatToken.java new file mode 100644 index 00000000000..82ea1284145 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/GoatToken.java @@ -0,0 +1,50 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import java.util.Arrays; +import mage.constants.CardType; +import mage.MageInt; + +/** + * + * @author LoneFox + */ +public class GoatToken extends Token { + + public GoatToken() { + super("Goat", "0/1 white Goat creature token"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Goat"); + power = new MageInt(0); + toughness = new MageInt(1); + availableImageSetCodes.addAll(Arrays.asList("EVE", "M13", "M14", "C14")); + } +} diff --git a/Mage/src/mage/game/permanent/token/GoblinRogueToken.java b/Mage/src/mage/game/permanent/token/GoblinRogueToken.java new file mode 100644 index 00000000000..b7839593c22 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/GoblinRogueToken.java @@ -0,0 +1,51 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import java.util.Arrays; +import mage.constants.CardType; +import mage.MageInt; + +/** + * + * @author LoneFox + */ +public class GoblinRogueToken extends Token { + + public GoblinRogueToken() { + super("Goblin Rogue", "1/1 black Goblin Rogue creature token"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Goblin"); + subtype.add("Rogue"); + power = new MageInt(1); + toughness = new MageInt(1); + availableImageSetCodes.addAll(Arrays.asList("LRW", "MMA")); + } +} diff --git a/Mage/src/mage/game/permanent/token/GoblinToken.java b/Mage/src/mage/game/permanent/token/GoblinToken.java index 7b2dfd151f0..798fdae0f89 100644 --- a/Mage/src/mage/game/permanent/token/GoblinToken.java +++ b/Mage/src/mage/game/permanent/token/GoblinToken.java @@ -39,7 +39,8 @@ public class GoblinToken extends Token { public GoblinToken() { super("Goblin", "1/1 red Goblin creature token"); - availableImageSetCodes.addAll(Arrays.asList("SOM", "M10", "C14", "KTK", "EVG", "DTK", "ORI", "DDG")); + availableImageSetCodes.addAll(Arrays.asList("10E", "ALA", "SOM", "M10", "NPH", "M13", "RTR", + "MMA", "M15", "C14", "KTK", "EVG", "DTK", "ORI", "DDG", "DDN")); cardType.add(CardType.CREATURE); subtype.add("Goblin"); diff --git a/Mage/src/mage/game/permanent/token/GoblinTokenWithHaste.java b/Mage/src/mage/game/permanent/token/GoblinTokenWithHaste.java new file mode 100644 index 00000000000..2e77c7a3441 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/GoblinTokenWithHaste.java @@ -0,0 +1,45 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import mage.abilities.keyword.HasteAbility; + +/** + * + * @author LoneFox + */ + +// Currently there are no separate images for this, let's use the same ones as the regular Goblin token. +public class GoblinTokenWithHaste extends GoblinToken { + + public GoblinTokenWithHaste() { + super(); + addAbility(HasteAbility.getInstance()); + } +} diff --git a/Mage/src/mage/game/permanent/token/GolemToken.java b/Mage/src/mage/game/permanent/token/GolemToken.java index 273943d7fa1..e17e3754f10 100644 --- a/Mage/src/mage/game/permanent/token/GolemToken.java +++ b/Mage/src/mage/game/permanent/token/GolemToken.java @@ -27,6 +27,10 @@ */ package mage.game.permanent.token; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import mage.constants.CardType; import mage.MageInt; @@ -36,8 +40,14 @@ import mage.MageInt; */ public class GolemToken extends Token { + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("MM2", "NPH", "SOM")); + } + public GolemToken() { - this("SOM"); + this(null); } public GolemToken(String setCode) { @@ -48,5 +58,7 @@ public class GolemToken extends Token { subtype.add("Golem"); power = new MageInt(3); toughness = new MageInt(3); + + availableImageSetCodes = tokenImageSets; } } diff --git a/Mage/src/mage/game/permanent/token/HumanToken.java b/Mage/src/mage/game/permanent/token/HumanToken.java new file mode 100644 index 00000000000..6e580a5642f --- /dev/null +++ b/Mage/src/mage/game/permanent/token/HumanToken.java @@ -0,0 +1,67 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import java.util.Arrays; +import mage.constants.CardType; +import mage.MageInt; + +/** + * + * @author LoneFox + */ +public class HumanToken extends Token { + + public HumanToken() { + super("Human", "1/1 white Human creature token"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Human"); + power = new MageInt(1); + toughness = new MageInt(1); + availableImageSetCodes.addAll(Arrays.asList("DKA", "AVR", "FNMP")); + } + + public HumanToken(final HumanToken token) { + super(token); + } + + @Override + public HumanToken copy() { + return new HumanToken(this); + } + + @Override + public void setExpansionSetCodeForImage(String code) { + super.setExpansionSetCodeForImage(code); + if (getOriginalExpansionSetCode().equals("AVR")) { + this.setTokenType(1); + } + } +} diff --git a/Mage/src/mage/game/permanent/token/InsectToken.java b/Mage/src/mage/game/permanent/token/InsectToken.java index 4fe7f8533ba..cd1e1be1686 100644 --- a/Mage/src/mage/game/permanent/token/InsectToken.java +++ b/Mage/src/mage/game/permanent/token/InsectToken.java @@ -28,6 +28,10 @@ package mage.game.permanent.token; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import mage.MageInt; import mage.constants.CardType; @@ -37,8 +41,14 @@ import mage.constants.CardType; */ public class InsectToken extends Token { + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("M10", "MM2")); + } + public InsectToken() { - this("M10"); + this(null); } public InsectToken(String setCode) { @@ -49,5 +59,7 @@ public class InsectToken extends Token { subtype.add("Insect"); power = new MageInt(1); toughness = new MageInt(1); + + availableImageSetCodes = tokenImageSets; } } \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/KithkinToken.java b/Mage/src/mage/game/permanent/token/KithkinToken.java index 3f3167c6dd8..ba45e435253 100644 --- a/Mage/src/mage/game/permanent/token/KithkinToken.java +++ b/Mage/src/mage/game/permanent/token/KithkinToken.java @@ -1,5 +1,6 @@ package mage.game.permanent.token; +import java.util.Arrays; import mage.MageInt; import mage.constants.CardType; @@ -7,20 +8,16 @@ import mage.constants.CardType; * * @author Loki */ -public class KithkinToken extends Token{ +public class KithkinToken extends Token { public KithkinToken() { - this("LRW"); - } - - public KithkinToken(String expansionSetCode) { - super("Kithkin", "1/1 white Kithkin Soldier creature token"); - setOriginalExpansionSetCode(expansionSetCode); + super("Kithkin Soldier", "1/1 white Kithkin Soldier creature token"); cardType.add(CardType.CREATURE); color.setWhite(true); subtype.add("Kithkin"); subtype.add("Soldier"); power = new MageInt(1); toughness = new MageInt(1); + availableImageSetCodes.addAll(Arrays.asList("LRW", "SHM", "MMA")); } } diff --git a/Mage/src/mage/game/permanent/token/KnightToken.java b/Mage/src/mage/game/permanent/token/KnightToken.java index 3ffd6de9350..909b39ab182 100644 --- a/Mage/src/mage/game/permanent/token/KnightToken.java +++ b/Mage/src/mage/game/permanent/token/KnightToken.java @@ -1,5 +1,8 @@ package mage.game.permanent.token; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import mage.constants.CardType; import mage.MageInt; import mage.abilities.keyword.VigilanceAbility; @@ -10,15 +13,21 @@ import mage.abilities.keyword.VigilanceAbility; */ public class KnightToken extends Token { + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("ORI", "RTR")); + } + public KnightToken() { super("Knight", "2/2 white Knight creature token with vigilance"); cardType.add(CardType.CREATURE); color.setWhite(true); - subtype.add("Knight"); power = new MageInt(2); toughness = new MageInt(2); this.addAbility(VigilanceAbility.getInstance()); - setOriginalExpansionSetCode("RTR"); + + availableImageSetCodes = tokenImageSets; } } diff --git a/Mage/src/mage/game/permanent/token/KorSoldierToken.java b/Mage/src/mage/game/permanent/token/KorSoldierToken.java new file mode 100644 index 00000000000..8f6b41c93bd --- /dev/null +++ b/Mage/src/mage/game/permanent/token/KorSoldierToken.java @@ -0,0 +1,51 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com O +R +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import java.util.Arrays; +import mage.constants.CardType; +import mage.MageInt; + +/** + * + * @author LoneFox + */ +public class KorSoldierToken extends Token { + + public KorSoldierToken() { + super("Kor Soldier", "1/1 white Kor Soldier creature token"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Kor"); + subtype.add("Soldier"); + power = new MageInt(1); + toughness = new MageInt(1); + availableImageSetCodes.addAll(Arrays.asList("C14", "ZEN")); } +} diff --git a/Mage/src/mage/game/permanent/token/MyrToken.java b/Mage/src/mage/game/permanent/token/MyrToken.java index 0d26eb7c3ba..63d68661769 100644 --- a/Mage/src/mage/game/permanent/token/MyrToken.java +++ b/Mage/src/mage/game/permanent/token/MyrToken.java @@ -1,12 +1,22 @@ package mage.game.permanent.token; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import mage.MageInt; import mage.constants.CardType; public class MyrToken extends Token { + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("C14", "MM2", "NPH", "SOM")); + } + public MyrToken() { - this("SOM"); + this(null); } public MyrToken(String expansionSetCode) { @@ -17,5 +27,7 @@ public class MyrToken extends Token { subtype.add("Myr"); power = new MageInt(1); toughness = new MageInt(1); + + availableImageSetCodes = tokenImageSets; } } \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/PegasusToken.java b/Mage/src/mage/game/permanent/token/PegasusToken.java new file mode 100644 index 00000000000..12e90966ac0 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/PegasusToken.java @@ -0,0 +1,52 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com O +R +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import mage.constants.CardType; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; + +/** + * + * @author LoneFox + */ +public class PegasusToken extends Token { + + public PegasusToken() { + super("Pegasus", "1/1 white Pegasus creature token with flying"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Pegasus"); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(FlyingAbility.getInstance()); + setOriginalExpansionSetCode("C14"); + } +} diff --git a/Mage/src/mage/game/permanent/token/PlantToken.java b/Mage/src/mage/game/permanent/token/PlantToken.java index f44a3f854a9..054a798df25 100644 --- a/Mage/src/mage/game/permanent/token/PlantToken.java +++ b/Mage/src/mage/game/permanent/token/PlantToken.java @@ -28,10 +28,21 @@ package mage.game.permanent.token; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import mage.MageInt; import mage.constants.CardType; public class PlantToken extends Token { + + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("WWK", "DDP")); + } + public PlantToken() { super("Plant", "0/1 green Plant creature"); cardType.add(CardType.CREATURE); @@ -39,6 +50,7 @@ public class PlantToken extends Token { subtype.add("Plant"); power = new MageInt(0); toughness = new MageInt(1); - this.setOriginalExpansionSetCode("WWK"); + + availableImageSetCodes = tokenImageSets; } } diff --git a/Mage/src/mage/game/permanent/token/SaprolingToken.java b/Mage/src/mage/game/permanent/token/SaprolingToken.java index b6c0fc5c5a3..b6e79eb952f 100644 --- a/Mage/src/mage/game/permanent/token/SaprolingToken.java +++ b/Mage/src/mage/game/permanent/token/SaprolingToken.java @@ -28,6 +28,10 @@ package mage.game.permanent.token; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import mage.MageInt; import mage.constants.CardType; @@ -37,6 +41,12 @@ import mage.constants.CardType; */ public class SaprolingToken extends Token { + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("10E", "ALA", "DDE", "DDH", "DDJ", "M12", "M13", "M14", "MM2", "MMA", "RTR")); + } + public SaprolingToken() { super("Saproling", "1/1 green Saproling creature token"); this.setOriginalExpansionSetCode("MMA"); @@ -45,5 +55,7 @@ public class SaprolingToken extends Token { subtype.add("Saproling"); power = new MageInt(1); toughness = new MageInt(1); + + availableImageSetCodes = tokenImageSets; } } \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/SliverToken.java b/Mage/src/mage/game/permanent/token/SliverToken.java new file mode 100644 index 00000000000..1c95852bfe0 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/SliverToken.java @@ -0,0 +1,49 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import java.util.Arrays; +import mage.constants.CardType; +import mage.MageInt; + +/** + * + * @author LoneFox + */ +public class SliverToken extends Token { + + public SliverToken() { + super("Sliver", "1/1 colorless Sliver creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Sliver"); + power = new MageInt(1); + toughness = new MageInt(1); + availableImageSetCodes.addAll(Arrays.asList("M14", "M15")); + } +} diff --git a/Mage/src/mage/game/permanent/token/SnakeToken.java b/Mage/src/mage/game/permanent/token/SnakeToken.java index 47d6700aa9c..19e778a015a 100644 --- a/Mage/src/mage/game/permanent/token/SnakeToken.java +++ b/Mage/src/mage/game/permanent/token/SnakeToken.java @@ -28,6 +28,10 @@ package mage.game.permanent.token; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import mage.MageInt; import mage.constants.CardType; @@ -37,18 +41,26 @@ import mage.constants.CardType; */ public class SnakeToken extends Token { + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("ZEN", "KTK", "MM2")); + } + public SnakeToken() { - this("ZEN"); + this(null); } public SnakeToken(String setCode) { super("Snake", "1/1 green Snake creature token"); - setOriginalExpansionSetCode(setCode); cardType.add(CardType.CREATURE); color.setGreen(true); subtype.add("Snake"); power = new MageInt(1); toughness = new MageInt(1); + + availableImageSetCodes = tokenImageSets; + setOriginalExpansionSetCode(setCode); } } diff --git a/Mage/src/mage/game/permanent/token/SoldierToken.java b/Mage/src/mage/game/permanent/token/SoldierToken.java index 956f808b5b7..6264190b018 100644 --- a/Mage/src/mage/game/permanent/token/SoldierToken.java +++ b/Mage/src/mage/game/permanent/token/SoldierToken.java @@ -43,7 +43,7 @@ public class SoldierToken extends Token { final static private List tokenImageSets = new ArrayList<>(); static { - tokenImageSets.addAll(Arrays.asList("10E", "M15", "C14", "ORI", "ALA", "DDF", "THS", "M12", "M13", "MM2", "MMA", "RTR", "SOM")); + tokenImageSets.addAll(Arrays.asList("10E", "M15", "C14", "ORI", "ALA", "DDF", "THS", "M12", "M13", "MM2", "MMA", "RTR", "SOM", "DDF", "M10")); } public SoldierToken() { diff --git a/Mage/src/mage/game/permanent/token/SoldierTokenWithHaste.java b/Mage/src/mage/game/permanent/token/SoldierTokenWithHaste.java new file mode 100644 index 00000000000..458310b2ef8 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/SoldierTokenWithHaste.java @@ -0,0 +1,52 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import mage.constants.CardType; +import mage.MageInt; +import mage.abilities.keyword.HasteAbility; + +/** + * + * @author LoneFox + */ +public class SoldierTokenWithHaste extends Token { + + public SoldierTokenWithHaste() { + super("Soldier", "1/1 red and white Soldier creature token with haste"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + color.setRed(true); + subtype.add("Soldier"); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(HasteAbility.getInstance()); + setOriginalExpansionSetCode("GTC"); + } +} diff --git a/Mage/src/mage/game/permanent/token/SpiderToken.java b/Mage/src/mage/game/permanent/token/SpiderToken.java new file mode 100644 index 00000000000..98333d8fc9a --- /dev/null +++ b/Mage/src/mage/game/permanent/token/SpiderToken.java @@ -0,0 +1,27 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.keyword.ReachAbility; +import mage.constants.CardType; + +/** + * + * @author fireshoes + */ +public class SpiderToken extends Token { + + public SpiderToken() { + super("Spider", "1/2 green Spider creature token with reach"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Spider"); + power = new MageInt(1); + toughness = new MageInt(2); + addAbility(ReachAbility.getInstance()); + } +} diff --git a/Mage/src/mage/game/permanent/token/SpiritWhiteToken.java b/Mage/src/mage/game/permanent/token/SpiritWhiteToken.java index ad7532b5d69..75ef08c1855 100644 --- a/Mage/src/mage/game/permanent/token/SpiritWhiteToken.java +++ b/Mage/src/mage/game/permanent/token/SpiritWhiteToken.java @@ -27,6 +27,9 @@ */ package mage.game.permanent.token; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import mage.MageInt; import mage.abilities.keyword.FlyingAbility; import mage.constants.CardType; @@ -36,15 +39,23 @@ import mage.constants.CardType; */ public class SpiritWhiteToken extends Token { + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("AVR", "C14", "CNS", "DDC", "DDK", "FRF", "ISD", "KTK", "M15", "MM2", "SHM")); + } + public SpiritWhiteToken() { - this("SHM", 0); + this(null, 0); } public SpiritWhiteToken(String setCode) { this(setCode, 0); } + public SpiritWhiteToken(String setCode, int tokenType) { super("Spirit", "1/1 white Spirit creature token with flying"); + availableImageSetCodes = tokenImageSets; setOriginalExpansionSetCode(setCode); if (tokenType > 0) { setTokenType(tokenType); @@ -57,4 +68,21 @@ public class SpiritWhiteToken extends Token { addAbility(FlyingAbility.getInstance()); } + + @Override + public void setExpansionSetCodeForImage(String code) { + super.setExpansionSetCodeForImage(code); + if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("AVR")) { + setTokenType(1); + } + } + + public SpiritWhiteToken(final SpiritWhiteToken token) { + super(token); + } + + @Override + public SpiritWhiteToken copy() { + return new SpiritWhiteToken(this); + } } diff --git a/Mage/src/mage/game/permanent/token/ThopterColorlessToken.java b/Mage/src/mage/game/permanent/token/ThopterColorlessToken.java index 840f15504be..695be8d1115 100644 --- a/Mage/src/mage/game/permanent/token/ThopterColorlessToken.java +++ b/Mage/src/mage/game/permanent/token/ThopterColorlessToken.java @@ -44,7 +44,7 @@ public class ThopterColorlessToken extends Token { final static private List tokenImageSets = new ArrayList<>(); static { - tokenImageSets.addAll(Arrays.asList("EXO", "ORI")); + tokenImageSets.addAll(Arrays.asList("MBS", "ORI")); } public ThopterColorlessToken() { diff --git a/Mage/src/mage/game/permanent/token/ThrullToken.java b/Mage/src/mage/game/permanent/token/ThrullToken.java new file mode 100644 index 00000000000..3ce76ac9e26 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/ThrullToken.java @@ -0,0 +1,59 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import mage.MageInt; +import mage.constants.CardType; + +/** + * + * @author Quercitron + */ +public class ThrullToken extends Token { + + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("MM2")); + } + + public ThrullToken() { + super("Thrull", "1/1 black Thrull creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Thrull"); + color.setBlack(true); + power = new MageInt(1); + toughness = new MageInt(1); + + availableImageSetCodes = tokenImageSets; + } +} diff --git a/Mage/src/mage/game/permanent/token/Token.java b/Mage/src/mage/game/permanent/token/Token.java index 59d4727dbed..5db9c045be6 100644 --- a/Mage/src/mage/game/permanent/token/Token.java +++ b/Mage/src/mage/game/permanent/token/Token.java @@ -31,6 +31,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.UUID; +import mage.MageObject; import mage.MageObjectImpl; import mage.ObjectColor; import mage.abilities.Abilities; @@ -42,6 +43,7 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; import mage.players.Player; @@ -53,6 +55,7 @@ public class Token extends MageObjectImpl { private int tokenType; private int originalCardNumber; private String originalExpansionSetCode; + private boolean expansionSetCodeChecked; private Card copySourceCard; // the card the Token is a copy from // list of set codes tokene images are available for @@ -89,6 +92,7 @@ public class Token extends MageObjectImpl { if (abilities != null) { this.abilities = abilities.copy(); } + this.expansionSetCodeChecked = false; } public Token(final Token token) { @@ -99,6 +103,7 @@ public class Token extends MageObjectImpl { this.lastAddedTokenIds.addAll(token.lastAddedTokenIds); this.originalCardNumber = token.originalCardNumber; this.originalExpansionSetCode = token.originalExpansionSetCode; + this.expansionSetCodeChecked = token.expansionSetCodeChecked; this.copySourceCard = token.copySourceCard; // will never be changed this.availableImageSetCodes = token.availableImageSetCodes; } @@ -132,13 +137,24 @@ public class Token extends MageObjectImpl { } public boolean putOntoBattlefield(int amount, Game game, UUID sourceId, UUID controllerId, boolean tapped, boolean attacking) { + return putOntoBattlefield(amount, game, sourceId, controllerId, tapped, attacking, null); + } + + public boolean putOntoBattlefield(int amount, Game game, UUID sourceId, UUID controllerId, boolean tapped, boolean attacking, UUID attackedPlayer) { Player controller = game.getPlayer(controllerId); if (controller == null) { return false; } lastAddedTokenIds.clear(); - // TODO: Check this setCode handling because it makes no sens if token put into play with e.g. "Feldon of the third Path" + + // moved here from CreateTokenEffect because not all cards that create tokens use CreateTokenEffect + // they use putOntoBattlefield directly Card source = game.getCard(sourceId); + if (!expansionSetCodeChecked) { + expansionSetCodeChecked = this.updateExpansionSetCode(source); + } + + // TODO: Check this setCode handling because it makes no sense if token put into play with e.g. "Feldon of the third Path" String setCode; if (this.getOriginalExpansionSetCode() != null && !this.getOriginalExpansionSetCode().isEmpty()) { setCode = this.getOriginalExpansionSetCode(); @@ -148,31 +164,43 @@ public class Token extends MageObjectImpl { GameEvent event = new GameEvent(EventType.CREATE_TOKEN, null, sourceId, controllerId, amount, this.getCardType().contains(CardType.CREATURE)); if (!game.replaceEvent(event)) { amount = event.getAmount(); + + List permanents = new ArrayList<>(); + List permanentsEntered = new ArrayList<>(); + for (int i = 0; i < amount; i++) { PermanentToken newToken = new PermanentToken(this, event.getPlayerId(), setCode, game); // use event.getPlayerId() because it can be replaced by replacement effect game.getState().addCard(newToken); - game.addPermanent(newToken); - if (tapped) { - newToken.setTapped(true); - } - this.lastAddedTokenIds.add(newToken.getId()); - this.lastAddedTokenId = newToken.getId(); - game.setScopeRelevant(true); - game.applyEffects(); - boolean entered = newToken.entersBattlefield(sourceId, game, Zone.OUTSIDE, true); - game.setScopeRelevant(false); - game.applyEffects(); - if (entered) { - game.fireEvent(new ZoneChangeEvent(newToken, event.getPlayerId(), Zone.OUTSIDE, Zone.BATTLEFIELD)); - if (attacking && game.getCombat() != null) { - game.getCombat().addAttackingCreature(newToken.getId(), game); - } - if (!game.isSimulation()) { - game.informPlayers(controller.getLogName() + " puts a " + newToken.getLogName() + " token onto the battlefield"); - } + permanents.add(newToken); + game.getPermanentsEntering().put(newToken.getId(), newToken); + newToken.setTapped(tapped); + } + game.setScopeRelevant(true); + for (Permanent permanent : permanents) { + if (permanent.entersBattlefield(sourceId, game, Zone.OUTSIDE, true)) { + permanentsEntered.add(permanent); + } else { + game.getPermanentsEntering().remove(permanent.getId()); } } + game.setScopeRelevant(false); + for (Permanent permanent : permanentsEntered) { + game.addPermanent(permanent); + permanent.setZone(Zone.BATTLEFIELD, game); + game.getPermanentsEntering().remove(permanent.getId()); + this.lastAddedTokenIds.add(permanent.getId()); + this.lastAddedTokenId = permanent.getId(); + game.addSimultaneousEvent(new ZoneChangeEvent(permanent, permanent.getControllerId(), Zone.OUTSIDE, Zone.BATTLEFIELD)); + if (attacking && game.getCombat() != null) { + game.getCombat().addAttackingCreature(permanent.getId(), game, attackedPlayer); + } + if (!game.isSimulation()) { + game.informPlayers(controller.getLogName() + " puts a " + permanent.getLogName() + " token onto the battlefield"); + } + + } + game.applyEffects(); return true; } return false; @@ -217,7 +245,11 @@ public class Token extends MageObjectImpl { if (availableImageSetCodes.contains(code)) { setOriginalExpansionSetCode(code); } else { - setOriginalExpansionSetCode(availableImageSetCodes.get(new Random().nextInt(availableImageSetCodes.size()))); + // we should not set random set if appropriate set is already used + if (getOriginalExpansionSetCode() == null || getOriginalExpansionSetCode().isEmpty() + || !availableImageSetCodes.contains(getOriginalExpansionSetCode())) { + setOriginalExpansionSetCode(availableImageSetCodes.get(new Random().nextInt(availableImageSetCodes.size()))); + } } } else { if (getOriginalExpansionSetCode() == null || getOriginalExpansionSetCode().isEmpty()) { @@ -225,4 +257,12 @@ public class Token extends MageObjectImpl { } } } + + public boolean updateExpansionSetCode(Card source) { + if (source == null) { + return false; + } + this.setExpansionSetCodeForImage(source.getExpansionSetCode()); + return true; + } } diff --git a/Mage/src/mage/game/permanent/token/WarriorToken.java b/Mage/src/mage/game/permanent/token/WarriorToken.java new file mode 100644 index 00000000000..5ddc1c3aa21 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/WarriorToken.java @@ -0,0 +1,68 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import java.util.Arrays; +import java.util.Random; +import mage.MageInt; +import mage.constants.CardType; + +/** + * + * @author LoneFox + */ +public class WarriorToken extends Token { + + public WarriorToken() { + super("Warrior", "1/1 white Warrior creature token"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Warrior"); + power = new MageInt(1); + toughness = new MageInt(1); + availableImageSetCodes.addAll(Arrays.asList("KTK", "DTK")); + } + + public WarriorToken(final WarriorToken token) { + super(token); + } + + @Override + public WarriorToken copy() { + return new WarriorToken(this); + } + + @Override + public void setExpansionSetCodeForImage(String code) { + super.setExpansionSetCodeForImage(code); + if (getOriginalExpansionSetCode().equals("KTK")) { + this.setTokenType(new Random().nextInt(2) + 1); + } + } +} diff --git a/Mage/src/mage/game/permanent/token/WolfToken.java b/Mage/src/mage/game/permanent/token/WolfToken.java index 77cf16ad898..bae31220032 100644 --- a/Mage/src/mage/game/permanent/token/WolfToken.java +++ b/Mage/src/mage/game/permanent/token/WolfToken.java @@ -28,9 +28,12 @@ package mage.game.permanent.token; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import mage.constants.CardType; import mage.MageInt; -import mage.ObjectColor; /** * @@ -38,16 +41,21 @@ import mage.ObjectColor; */ public class WolfToken extends Token { - public WolfToken() { - this("ISD"); + final static private List tokenImageSets = new ArrayList<>(); + + static { + tokenImageSets.addAll(Arrays.asList("BNG", "C14", "CNS", "FNMP", "ISD", "LRW", "M10", "M14", "MM2", "SHM", "SOM", "ZEN")); } - + + public WolfToken() { + this((String) null); + } + public WolfToken(String setCode) { super("Wolf", "2/2 green Wolf creature token"); - this.setOriginalExpansionSetCode(setCode); - if (setCode.equals("ISD")) { - setTokenType(Type.SECOND.code); - } + availableImageSetCodes = tokenImageSets; + setOriginalExpansionSetCode(setCode); + cardType.add(CardType.CREATURE); color.setGreen(true); subtype.add("Wolf"); @@ -55,9 +63,20 @@ public class WolfToken extends Token { toughness = new MageInt(2); } - public WolfToken(Token.Type type) { - this(); - setTokenType(type.getCode()); + @Override + public void setExpansionSetCodeForImage(String code) { + super.setExpansionSetCodeForImage(code); + if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("ISD")) { + this.setTokenType(2); + } } + public WolfToken(final WolfToken token) { + super(token); + } + + @Override + public Token copy() { + return new WolfToken(this); + } } diff --git a/Mage/src/mage/game/permanent/token/WurmToken2.java b/Mage/src/mage/game/permanent/token/WurmToken2.java new file mode 100644 index 00000000000..e4b27e261dc --- /dev/null +++ b/Mage/src/mage/game/permanent/token/WurmToken2.java @@ -0,0 +1,51 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import mage.constants.CardType; +import mage.MageInt; +import mage.abilities.keyword.TrampleAbility; + +/** + * + * @author LoneFox + */ +public class WurmToken2 extends Token { + + public WurmToken2() { + super("Wurm", "5/5 green Wurm creature token with trample"); + cardType.add(CardType.CREATURE); + color.setGreen(true); + subtype.add("Wurm"); + power = new MageInt(5); + toughness = new MageInt(5); + addAbility(TrampleAbility.getInstance()); + setOriginalExpansionSetCode("RTR"); + } +} diff --git a/Mage/src/mage/game/permanent/token/ZombieToken.java b/Mage/src/mage/game/permanent/token/ZombieToken.java index ab636da61fe..28d1e5b4ce7 100644 --- a/Mage/src/mage/game/permanent/token/ZombieToken.java +++ b/Mage/src/mage/game/permanent/token/ZombieToken.java @@ -43,7 +43,7 @@ public class ZombieToken extends Token { final static private List tokenImageSets = new ArrayList<>(); static { - tokenImageSets.addAll(Arrays.asList("10E", "M10", "M11", "M12", "M13", "M14", "M15", "MBS", "ALA", "ISD", "C14", "CNS", "MMA", "BNG", "KTK", "DTK", "ORI")); + tokenImageSets.addAll(Arrays.asList("10E", "M10", "M11", "M12", "M13", "M14", "M15", "MBS", "ALA", "ISD", "C14", "C15", "CNS", "MMA", "BNG", "KTK", "DTK", "ORI")); } public ZombieToken() { @@ -62,6 +62,9 @@ public class ZombieToken extends Token { if (getOriginalExpansionSetCode().equals("ISD")) { this.setTokenType(new Random().nextInt(3) + 1); } + if (getOriginalExpansionSetCode().equals("C14")) { + this.setTokenType(2); + } } public ZombieToken(final ZombieToken token) { diff --git a/Mage/src/mage/game/stack/Spell.java b/Mage/src/mage/game/stack/Spell.java index 2adc38b5e2c..5e23cf1f1d1 100644 --- a/Mage/src/mage/game/stack/Spell.java +++ b/Mage/src/mage/game/stack/Spell.java @@ -36,6 +36,7 @@ import mage.Mana; import mage.ObjectColor; import mage.abilities.Abilities; import mage.abilities.Ability; +import mage.abilities.Mode; import mage.abilities.SpellAbility; import mage.abilities.costs.AlternativeSourceCosts; import mage.abilities.costs.Cost; @@ -44,6 +45,7 @@ import mage.abilities.costs.mana.ManaCosts; import mage.abilities.keyword.BestowAbility; import mage.abilities.keyword.MorphAbility; import mage.cards.Card; +import mage.cards.CardsImpl; import mage.cards.SplitCard; import mage.constants.CardType; import mage.constants.Rarity; @@ -167,10 +169,15 @@ public class Spell extends StackObjImpl implements Card { @Override public boolean resolve(Game game) { boolean result; + Player controller = game.getPlayer(getControllerId()); + if (controller == null) { + return false; + } if (this.getCardType().contains(CardType.INSTANT) || this.getCardType().contains(CardType.SORCERY)) { int index = 0; result = false; boolean legalParts = false; + boolean notTargeted = true; // check for legal parts for (SpellAbility spellAbility : this.spellAbilities) { // if muliple modes are selected, and there are modes with targets, then at least one mode has to have a legal target or @@ -178,15 +185,20 @@ public class Spell extends StackObjImpl implements Card { // If all targets are illegal when the spell tries to resolve, the spell is countered and none of its effects happen. // If at least one target is still legal at that time, the spell resolves, but an illegal target can't perform any actions // or have any actions performed on it. - legalParts |= spellAbilityHasLegalParts(spellAbility, game); + // if only a spliced spell has targets and all targets ar illegal, the complete spell is countered + if (hasTargets(spellAbility, game)) { + notTargeted = false; + legalParts |= spellAbilityHasLegalParts(spellAbility, game); + } + } // resolve if legal parts - if (legalParts) { + if (notTargeted || legalParts) { for (SpellAbility spellAbility : this.spellAbilities) { if (spellAbilityHasLegalParts(spellAbility, game)) { - for (UUID modeId : spellAbility.getModes().getSelectedModes()) { - spellAbility.getModes().setActiveMode(modeId); - if (spellAbility.getTargets().stillLegal(spellAbility, game)) { + for (Mode mode : spellAbility.getModes().getSelectedModes()) { + spellAbility.getModes().setActiveMode(mode); + if (mode.getTargets().stillLegal(spellAbility, game)) { if (!spellAbility.getSpellAbilityType().equals(SpellAbilityType.SPLICE)) { updateOptionalCosts(index); } @@ -197,9 +209,8 @@ public class Spell extends StackObjImpl implements Card { } } if (game.getState().getZone(card.getMainCard().getId()) == Zone.STACK) { - Player player = game.getPlayer(getControllerId()); - if (player != null) { - player.moveCards(card, Zone.STACK, Zone.GRAVEYARD, ability, game); + if (!isCopy()) { + controller.moveCards(card, Zone.GRAVEYARD, ability, game); } } return result; @@ -213,14 +224,14 @@ public class Spell extends StackObjImpl implements Card { } else if (this.getCardType().contains(CardType.ENCHANTMENT) && this.getSubtype().contains("Aura")) { if (ability.getTargets().stillLegal(ability, game)) { updateOptionalCosts(0); - boolean bestow = this.getSpellAbility() instanceof BestowAbility; + boolean bestow = ability instanceof BestowAbility; if (bestow) { // Must be removed first time, after that will be removed by continous effect // Otherwise effects like evolve trigger from creature comes into play event card.getCardType().remove(CardType.CREATURE); card.getSubtype().add("Aura"); } - if (card.putOntoBattlefield(game, fromZone, ability.getSourceId(), controllerId)) { + if (controller.moveCards(card, Zone.BATTLEFIELD, ability, game, false, faceDown, false, null)) { if (bestow) { // card will be copied during putOntoBattlefield, so the card of CardPermanent has to be changed // TODO: Find a better way to prevent bestow creatures from being effected by creature affecting abilities @@ -230,8 +241,6 @@ public class Spell extends StackObjImpl implements Card { ((PermanentCard) permanent).getCard().getCardType().add(CardType.CREATURE); ((PermanentCard) permanent).getCard().getSubtype().remove("Aura"); } - card.getCardType().add(CardType.CREATURE); - card.getSubtype().remove("Aura"); } return ability.resolve(game); } @@ -243,8 +252,7 @@ public class Spell extends StackObjImpl implements Card { // Aura has no legal target and its a bestow enchantment -> Add it to battlefield as creature if (this.getSpellAbility() instanceof BestowAbility) { updateOptionalCosts(0); - result = card.putOntoBattlefield(game, fromZone, ability.getSourceId(), controllerId); - return result; + return controller.moveCards(card, Zone.BATTLEFIELD, ability, game, false, faceDown, false, null); } else { //20091005 - 608.2b if (!game.isSimulation()) { @@ -255,8 +263,21 @@ public class Spell extends StackObjImpl implements Card { } } else { updateOptionalCosts(0); - result = card.putOntoBattlefield(game, fromZone, ability.getSourceId(), controllerId, false, faceDown); - return result; + return controller.moveCards(card, Zone.BATTLEFIELD, ability, game, false, faceDown, false, null); + } + } + + private boolean hasTargets(SpellAbility spellAbility, Game game) { + if (spellAbility.getModes().getSelectedModes().size() > 1) { + for (Mode mode : spellAbility.getModes().getSelectedModes()) { + if (!mode.getTargets().isEmpty()) { + return true; + } + + } + return false; + } else { + return !spellAbility.getTargets().isEmpty(); } } @@ -264,11 +285,10 @@ public class Spell extends StackObjImpl implements Card { if (spellAbility.getModes().getSelectedModes().size() > 1) { boolean targetedMode = false; boolean legalTargetedMode = false; - for (UUID modeId : spellAbility.getModes().getSelectedModes()) { - spellAbility.getModes().setActiveMode(modeId); - if (spellAbility.getTargets().size() > 0) { + for (Mode mode : spellAbility.getModes().getSelectedModes()) { + if (mode.getTargets().size() > 0) { targetedMode = true; - if (spellAbility.getTargets().stillLegal(spellAbility, game)) { + if (mode.getTargets().stillLegal(spellAbility, game)) { legalTargetedMode = true; } } @@ -308,16 +328,32 @@ public class Spell extends StackObjImpl implements Card { @Override public void counter(UUID sourceId, Game game) { + this.counter(sourceId, game, Zone.GRAVEYARD, false, true); + } + + @Override + public void counter(UUID sourceId, Game game, Zone zone, boolean owner, boolean top) { this.countered = true; if (!isCopiedSpell()) { - Player player = game.getPlayer(getControllerId()); + Player player = game.getPlayer(game.getControllerId(sourceId)); + if (player == null) { + player = game.getPlayer(getControllerId()); + } if (player != null) { Ability counteringAbility = null; MageObject counteringObject = game.getObject(sourceId); if (counteringObject instanceof StackObject) { counteringAbility = ((StackObject) counteringObject).getStackAbility(); } - player.moveCards(card, Zone.STACK, Zone.GRAVEYARD, counteringAbility, game); + if (zone.equals(Zone.LIBRARY)) { + if (top) { + player.putCardsOnTopOfLibrary(new CardsImpl(card), game, counteringAbility, false); + } else { + player.putCardsOnBottomOfLibrary(new CardsImpl(card), game, counteringAbility, false); + } + } else { + player.moveCards(card, zone, counteringAbility, game, false, false, owner, null); + } } } } @@ -455,21 +491,8 @@ public class Spell extends StackObjImpl implements Card { if (faceDown) { return 0; } - for (Ability spellAbility : spellAbilities) { - int xMultiplier = 0; - for (String symbolString : spellAbility.getManaCosts().getSymbols()) { - int index = symbolString.indexOf("{X}"); - while (index != -1) { - xMultiplier++; - symbolString = symbolString.substring(index + 3); - index = symbolString.indexOf("{X}"); - } - } - if (this.getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.BASE_ALTERNATE)) { - cmc += spellAbility.getManaCostsToPay().getX() * xMultiplier; - } else { - cmc += spellAbility.getManaCosts().convertedManaCost() + spellAbility.getManaCostsToPay().getX() * xMultiplier; - } + for (SpellAbility spellAbility : spellAbilities) { + cmc += spellAbility.getConvertedManaCost(); } if (this.getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.BASE_ALTERNATE)) { cmc += getCard().getManaCost().convertedManaCost(); @@ -599,7 +622,8 @@ public class Spell extends StackObjImpl implements Card { } public Spell copySpell() { - return new Spell(this.card.copy(), this.ability.copySpell(), this.controllerId, this.fromZone); + // replaced card.copy by copy (card content should no longer be changed) + return new Spell(this.card, this.ability.copySpell(), this.controllerId, this.fromZone); } @Override @@ -623,6 +647,11 @@ public class Spell extends StackObjImpl implements Card { } } + @Override + public boolean removeFromZone(Game game, Zone fromZone, UUID sourceId) { + return card.removeFromZone(game, fromZone, sourceId); + } + @Override public boolean moveToZone(Zone zone, UUID sourceId, Game game, boolean flag) { return moveToZone(zone, sourceId, game, flag, null); @@ -636,7 +665,7 @@ public class Spell extends StackObjImpl implements Card { if (this.isCopiedSpell() && !zone.equals(Zone.STACK)) { return true; } - throw new UnsupportedOperationException("Unsupported operation"); + return card.moveToZone(zone, sourceId, game, flag, appliedEffects); } @Override @@ -820,4 +849,9 @@ public class Spell extends StackObjImpl implements Card { return countered; } + @Override + public void checkForCountersToAdd(Permanent permanent, Game game) { + throw new UnsupportedOperationException("Not supported for Spell"); + } + } diff --git a/Mage/src/mage/game/stack/SpellStack.java b/Mage/src/mage/game/stack/SpellStack.java index 62ea3bb72ca..cf261770e87 100644 --- a/Mage/src/mage/game/stack/SpellStack.java +++ b/Mage/src/mage/game/stack/SpellStack.java @@ -34,6 +34,7 @@ import mage.MageObject; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import org.apache.log4j.Logger; /** * @@ -41,6 +42,8 @@ import mage.game.events.GameEvent; */ public class SpellStack extends ArrayDeque { + private static final Logger logger = Logger.getLogger(SpellStack.class); + protected Date dateLastAdded; public SpellStack() { @@ -61,21 +64,28 @@ public class SpellStack extends ArrayDeque { top.resolve(game); } finally { if (top != null) { - this.remove(top); + if (contains(top)) { + logger.warn("StackObject was still on the stack after resoving" + top.getName()); + this.remove(top); + } } } } - public void remove(StackObject object) { + public boolean remove(StackObject object) { for (StackObject spell : this) { if (spell.getId().equals(object.getId())) { - super.remove(spell); - return; + return super.remove(spell); } } + return false; } public boolean counter(UUID objectId, UUID sourceId, Game game) { + return counter(objectId, sourceId, game, Zone.GRAVEYARD, false, true); + } + + public boolean counter(UUID objectId, UUID sourceId, Game game, Zone zone, boolean owner, boolean onTop) { // the counter logic is copied by some spells to handle replacement effects of the countered spell // so if logic is changed here check those spells for needed changes too // Concerned cards to check: Hinder, Spell Crumple @@ -95,12 +105,10 @@ public class SpellStack extends ArrayDeque { counteredObjectName = "Ability (" + stackObject.getStackAbility().getRule(targetSourceName) + ") of " + targetSourceName; } if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) { - if (stackObject instanceof Spell) { - game.rememberLKI(objectId, Zone.STACK, (Spell) stackObject); - } else { + if (!(stackObject instanceof Spell)) { // spells are removed from stack by the card movement this.remove(stackObject); } - stackObject.counter(sourceId, game); + stackObject.counter(sourceId, game, zone, owner, onTop); if (!game.isSimulation()) { game.informPlayers(counteredObjectName + " is countered by " + sourceObject.getLogName()); } diff --git a/Mage/src/mage/game/stack/StackAbility.java b/Mage/src/mage/game/stack/StackAbility.java index 0ab2eeb7bae..7215000ee43 100644 --- a/Mage/src/mage/game/stack/StackAbility.java +++ b/Mage/src/mage/game/stack/StackAbility.java @@ -1,41 +1,45 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.game.stack; -import mage.constants.AbilityType; -import mage.constants.CardType; -import mage.constants.EffectType; -import mage.constants.Zone; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.ObjectColor; -import mage.abilities.*; +import mage.abilities.Abilities; +import mage.abilities.AbilitiesImpl; +import mage.abilities.Ability; +import mage.abilities.MageSingleton; +import mage.abilities.Mode; +import mage.abilities.Modes; +import mage.abilities.StateTriggeredAbility; import mage.abilities.costs.AlternativeCost; import mage.abilities.costs.Cost; import mage.abilities.costs.Costs; @@ -45,19 +49,19 @@ import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.Effects; +import mage.cards.Card; import mage.choices.Choice; import mage.choices.Choices; -import mage.game.Game; -import mage.target.Target; -import mage.target.Targets; - -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; -import mage.cards.Card; +import mage.constants.AbilityType; import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.EffectType; +import mage.constants.Zone; +import mage.game.Game; import mage.game.events.GameEvent; import mage.players.Player; +import mage.target.Target; +import mage.target.Targets; import mage.util.GameLog; import mage.watchers.Watcher; @@ -82,41 +86,51 @@ public class StackAbility extends StackObjImpl implements Ability { public StackAbility(Ability ability, UUID controllerId) { this.ability = ability; this.controllerId = controllerId; - this.name = new StringBuilder("stack ability (").append(ability.getRule()).append(")").toString(); + this.name = "stack ability (" + ability.getRule() + ")"; } - public StackAbility(final StackAbility spell) { - this.ability = spell.ability.copy(); - this.controllerId = spell.controllerId; - this.name = spell.name; - this.expansionSetCode = spell.expansionSetCode; + public StackAbility(final StackAbility stackAbility) { + this.ability = stackAbility.ability.copy(); + this.controllerId = stackAbility.controllerId; + this.name = stackAbility.name; + this.expansionSetCode = stackAbility.expansionSetCode; } @Override public boolean isActivated() { return ability.isActivated(); } - + @Override public boolean resolve(Game game) { if (ability.getTargets().stillLegal(ability, game)) { - return ability.resolve(game); + boolean result = ability.resolve(game); + game.getStack().remove(this); + return result; } if (!game.isSimulation()) { game.informPlayers("Ability has been fizzled: " + getRule()); } counter(null, game); + game.getStack().remove(this); return false; } @Override - public void reset(Game game) { } + public void reset(Game game) { + } @Override public void counter(UUID sourceId, Game game) { + // zone, owner, top ignored + this.counter(sourceId, game, Zone.GRAVEYARD, true, true); + } + + @Override + public void counter(UUID sourceId, Game game, Zone zone, boolean owner, boolean top) { //20100716 - 603.8 if (ability instanceof StateTriggeredAbility) { - ((StateTriggeredAbility)ability).counter(game); + ((StateTriggeredAbility) ability).counter(game); } } @@ -127,14 +141,14 @@ public class StackAbility extends StackObjImpl implements Ability { @Override public String getIdName() { - return getName() + " ["+getId().toString().substring(0,3) +"]"; + return getName() + " [" + getId().toString().substring(0, 3) + "]"; } - + @Override public String getLogName() { return GameLog.getColoredObjectIdName(this); } - + @Override public String getImageName() { return name; @@ -221,9 +235,9 @@ public class StackAbility extends StackObjImpl implements Ability { @Override public int getConvertedManaCost() { - // Activated abilities have an "activation cost" but they don't have a characteristic related to that while on the stack. + // Activated abilities have an "activation cost" but they don't have a characteristic related to that while on the stack. // There are certain effects that interact with the cost to activate an ability (e.g., Training Grounds, Power Artifact) - // but nothing that looks for that quality of an ability once it's on the stack. + // but nothing that looks for that quality of an ability once it's on the stack. return 0; } @@ -232,6 +246,11 @@ public class StackAbility extends StackObjImpl implements Ability { return ability.getEffects(); } + @Override + public Effects getAllEffects() { + return ability.getAllEffects(); + } + @Override public Effects getEffects(Game game, EffectType effectType) { return ability.getEffects(game, effectType); @@ -258,13 +277,16 @@ public class StackAbility extends StackObjImpl implements Ability { } @Override - public void setSourceId(UUID sourceID) {} + public void setSourceId(UUID sourceID) { + } @Override - public void addCost(Cost cost) {} + public void addCost(Cost cost) { + } @Override - public void addEffect(Effect effect) {} + public void addEffect(Effect effect) { + } @Override public boolean activate(Game game, boolean noMana) { @@ -277,7 +299,8 @@ public class StackAbility extends StackObjImpl implements Ability { } @Override - public void addTarget(Target target) {} + public void addTarget(Target target) { + } @Override public UUID getFirstTarget() { @@ -290,7 +313,8 @@ public class StackAbility extends StackObjImpl implements Ability { } @Override - public void addChoice(Choice choice) {} + public void addChoice(Choice choice) { + } @Override public List getAlternativeCosts() { @@ -298,7 +322,8 @@ public class StackAbility extends StackObjImpl implements Ability { } @Override - public void addAlternativeCost(AlternativeCost cost) { } + public void addAlternativeCost(AlternativeCost cost) { + } @Override public ManaCosts getManaCosts() { @@ -306,12 +331,13 @@ public class StackAbility extends StackObjImpl implements Ability { } @Override - public ManaCosts getManaCostsToPay ( ) { + public ManaCosts getManaCostsToPay() { return ability.getManaCostsToPay(); } @Override - public void addManaCost(ManaCost cost) { } + public void addManaCost(ManaCost cost) { + } @Override public AbilityType getAbilityType() { @@ -329,7 +355,7 @@ public class StackAbility extends StackObjImpl implements Ability { } @Override - public void setName(String name) { + public void setName(String name) { this.name = name; } @@ -344,7 +370,7 @@ public class StackAbility extends StackObjImpl implements Ability { card.adjustChoices(ability, game); } } - + @Override public void adjustCosts(Ability ability, Game game) { Card card = game.getCard(ability.getSourceId()); @@ -367,7 +393,8 @@ public class StackAbility extends StackObjImpl implements Ability { } @Override - public void addOptionalCost(Cost cost) {} + public void addOptionalCost(Cost cost) { + } @Override public boolean checkIfClause(Game game) { @@ -382,7 +409,8 @@ public class StackAbility extends StackObjImpl implements Ability { } @Override - public void newOriginalId() {} + public void newOriginalId() { + } @Override public Ability getStackAbility() { @@ -395,7 +423,8 @@ public class StackAbility extends StackObjImpl implements Ability { } @Override - public void addMode(Mode mode) {} + public void addMode(Mode mode) { + } @Override public Modes getModes() { @@ -455,7 +484,7 @@ public class StackAbility extends StackObjImpl implements Ability { public void setAdditionalCostsRuleVisible(boolean ruleAdditionalCostsVisible) { this.ability.setAdditionalCostsRuleVisible(ruleAdditionalCostsVisible); } - + @Override public UUID getOriginalId() { return this.ability.getOriginalId(); @@ -478,7 +507,7 @@ public class StackAbility extends StackObjImpl implements Ability { @Override public void setCostModificationActive(boolean active) { - throw new UnsupportedOperationException("Not supported. Only neede for flashbacked spells"); + throw new UnsupportedOperationException("Not supported. Only neede for flashbacked spells"); } @Override @@ -500,7 +529,7 @@ public class StackAbility extends StackObjImpl implements Ability { public void addWatcher(Watcher watcher) { throw new UnsupportedOperationException("Not supported."); } - + @Override public List getSubAbilities() { return this.ability.getSubAbilities(); @@ -513,7 +542,7 @@ public class StackAbility extends StackObjImpl implements Ability { @Override public MageObject getSourceObject(Game game) { - throw new UnsupportedOperationException("Not supported."); + return game.getBaseObject(getSourceId()); } @Override @@ -529,7 +558,7 @@ public class StackAbility extends StackObjImpl implements Ability { @Override public void setSourceObject(MageObject sourceObject, Game game) { throw new UnsupportedOperationException("Not supported."); - } + } @Override public int getZoneChangeCounter(Game game) { diff --git a/Mage/src/mage/game/stack/StackObjImpl.java b/Mage/src/mage/game/stack/StackObjImpl.java index 8ca3c7a6be5..447b1a00c5e 100644 --- a/Mage/src/mage/game/stack/StackObjImpl.java +++ b/Mage/src/mage/game/stack/StackObjImpl.java @@ -106,6 +106,7 @@ public abstract class StackObjImpl implements StackObject { public boolean chooseNewTargets(Game game, UUID targetControllerId, boolean forceChange, boolean onlyOneTarget, FilterPermanent filterNewTarget) { Player targetController = game.getPlayer(targetControllerId); if (targetController != null) { + StringBuilder oldTargetDescription = new StringBuilder(); StringBuilder newTargetDescription = new StringBuilder(); // Fused split spells or spells where "Splice on Arcane" was used can have more than one ability Abilities objectAbilities = new AbilitiesImpl<>(); @@ -116,8 +117,9 @@ public abstract class StackObjImpl implements StackObject { } for (Ability ability : objectAbilities) { // Some spells can have more than one mode - for (UUID modeId : ability.getModes().getSelectedModes()) { - Mode mode = ability.getModes().get(modeId); + for (Mode mode : ability.getModes().getSelectedModes()) { + ability.getModes().setActiveMode(mode); + oldTargetDescription.append(ability.getTargetDescription(mode.getTargets(), game)); for (Target target : mode.getTargets()) { Target newTarget = chooseNewTarget(targetController, ability, mode, target, forceChange, filterNewTarget, game); // clear the old target and copy all targets from new target @@ -131,7 +133,7 @@ public abstract class StackObjImpl implements StackObject { } } - if (newTargetDescription.length() > 0 && !game.isSimulation()) { + if (!newTargetDescription.toString().equals(oldTargetDescription.toString()) && !game.isSimulation()) { game.informPlayers(this.getLogName() + " is now " + newTargetDescription.toString()); } return true; diff --git a/Mage/src/mage/game/stack/StackObject.java b/Mage/src/mage/game/stack/StackObject.java index ce408387aa5..c1540d9138f 100644 --- a/Mage/src/mage/game/stack/StackObject.java +++ b/Mage/src/mage/game/stack/StackObject.java @@ -1,36 +1,36 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.game.stack; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.game.Controllable; import mage.game.Game; @@ -38,11 +38,19 @@ import mage.game.Game; public interface StackObject extends MageObject, Controllable { boolean resolve(Game game); + UUID getSourceId(); + void counter(UUID sourceId, Game game); + + void counter(UUID sourceId, Game game, Zone zone, boolean owner, boolean top); + Ability getStackAbility(); + int getConvertedManaCost(); + boolean chooseNewTargets(Game game, UUID playerId, boolean forceChange, boolean onlyOneTarget, FilterPermanent filterNewTarget); + @Override StackObject copy(); } diff --git a/Mage/src/mage/game/tournament/TournamentImpl.java b/Mage/src/mage/game/tournament/TournamentImpl.java index 2719c4a277d..a578a681107 100644 --- a/Mage/src/mage/game/tournament/TournamentImpl.java +++ b/Mage/src/mage/game/tournament/TournamentImpl.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.game.tournament; import java.util.ArrayList; @@ -33,6 +32,7 @@ import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Random; @@ -114,7 +114,7 @@ public abstract class TournamentImpl implements Tournament { } synchronized (this) { this.notifyAll(); - } + } } @Override @@ -188,15 +188,16 @@ public abstract class TournamentImpl implements Tournament { Round round = new Round(rounds.size() + 1, this); rounds.add(round); List roundPlayers = getActivePlayers(); + + // search the player with a bye last round + List playerWithByes = getTournamentPlayersWithBye(roundPlayers); + while (roundPlayers.size() > 1) { - int i = rnd.nextInt(roundPlayers.size()); - TournamentPlayer player1 = roundPlayers.get(i); - roundPlayers.remove(i); - i = rnd.nextInt(roundPlayers.size()); - TournamentPlayer player2 = roundPlayers.get(i); - roundPlayers.remove(i); + TournamentPlayer player1 = getNextAvailablePlayer(roundPlayers, playerWithByes); + TournamentPlayer player2 = getNextAvailablePlayer(roundPlayers, playerWithByes); round.addPairing(new TournamentPairing(player1, player2)); } + if (roundPlayers.size() > 0) { // player free round - add to bye players of this round TournamentPlayer player1 = roundPlayers.get(0); @@ -208,8 +209,39 @@ public abstract class TournamentImpl implements Tournament { return round; } + private TournamentPlayer getNextAvailablePlayer(List roundPlayers, List playerWithByes) { + TournamentPlayer nextPlayer; + if (playerWithByes.isEmpty()) { + int i = rnd.nextInt(roundPlayers.size()); + nextPlayer = roundPlayers.get(i); + roundPlayers.remove(i); + } else { // prefer players with byes to pair + Iterator iterator = playerWithByes.iterator(); + nextPlayer = iterator.next(); + iterator.remove(); + roundPlayers.remove(nextPlayer); + } + return nextPlayer; + } + + private List getTournamentPlayersWithBye(List roundPlayers) { + List playersWithBye = new ArrayList<>(); + if (rounds.size() > 1) { + for (int i = rounds.size() - 2; i >= 0; i--) { + Round oldRound = rounds.get(i); + if (oldRound != null && !oldRound.getPlayerByes().isEmpty()) { + TournamentPlayer tournamentPlayerWithBye = oldRound.getPlayerByes().iterator().next(); + if (roundPlayers.contains(tournamentPlayerWithBye)) { + playersWithBye.add(tournamentPlayerWithBye); + } + } + } + } + return playersWithBye; + } + protected void playRound(Round round) { - for (TournamentPairing pair: round.getPairs()) { + for (TournamentPairing pair : round.getPairs()) { playMatch(pair); } updateResults(); // show points from byes @@ -227,7 +259,7 @@ public abstract class TournamentImpl implements Tournament { protected List getActivePlayers() { List activePlayers = new ArrayList<>(); - for (TournamentPlayer player: players.values()) { + for (TournamentPlayer player : players.values()) { if (!player.isEliminated()) { activePlayers.add(player); } @@ -240,13 +272,13 @@ public abstract class TournamentImpl implements Tournament { */ @Override public void updateResults() { - for (TournamentPlayer player: players.values()) { + for (TournamentPlayer player : players.values()) { player.setResults(""); player.setPoints(0); player.setStateInfo(""); } - for (Round round: rounds) { - for (TournamentPairing pair: round.getPairs()) { + for (Round round : rounds) { + for (TournamentPairing pair : round.getPairs()) { Match match = pair.getMatch(); if (match != null && match.hasEnded()) { TournamentPlayer tp1 = pair.getPlayer1(); @@ -276,9 +308,9 @@ public abstract class TournamentImpl implements Tournament { tp2.setResults(addRoundResult(round.getRoundNumber(), pair, tp2, tp1)); // Add points - if (mp2.hasQuit() || mp1.getWins() > mp2.getWins()) { + if ((!mp1.hasQuit() && mp1.getWins() > mp2.getWins()) || mp2.hasQuit()) { tp1.setPoints(tp1.getPoints() + 3); - } else if (mp1.hasQuit() || mp1.getWins() < mp2.getWins()) { + } else if ((!mp2.hasQuit() && mp1.getWins() < mp2.getWins()) || mp1.hasQuit()) { tp2.setPoints(tp2.getPoints() + 3); } else { tp1.setPoints(tp1.getPoints() + 1); @@ -299,7 +331,7 @@ public abstract class TournamentImpl implements Tournament { playerResult.append(getMatchResultString(tournamentPlayer, opponentPlayer, pair.getMatch())); return playerResult.toString(); } - + private static String getMatchResultString(TournamentPlayer p1, TournamentPlayer p2, Match match) { MatchPlayer mp1 = match.getPlayer(p1.getPlayer().getId()); MatchPlayer mp2 = match.getPlayer(p2.getPlayer().getId()); @@ -307,22 +339,22 @@ public abstract class TournamentImpl implements Tournament { matchResult.append(p2.getPlayer().getName()); matchResult.append(" [").append(mp1.getWins()); if (mp1.hasQuit()) { - matchResult.append(mp1.getPlayer().hasIdleTimeout()? "I" :(mp1.getPlayer().hasTimerTimeout()?"T":"Q")); + matchResult.append(mp1.getPlayer().hasIdleTimeout() ? "I" : (mp1.getPlayer().hasTimerTimeout() ? "T" : "Q")); } if (match.getDraws() > 0) { matchResult.append("-").append(match.getDraws()); } matchResult.append("-").append(mp2.getWins()); if (mp2.hasQuit()) { - matchResult.append(mp2.getPlayer().hasIdleTimeout()? "I" :(mp2.getPlayer().hasTimerTimeout()?"T":"Q")); - } + matchResult.append(mp2.getPlayer().hasIdleTimeout() ? "I" : (mp2.getPlayer().hasTimerTimeout() ? "T" : "Q")); + } matchResult.append("] "); return matchResult.toString(); } - + @Override public boolean isDoneConstructing() { - for (TournamentPlayer player: this.players.values()) { + for (TournamentPlayer player : this.players.values()) { if (!player.isDoneConstructing()) { return false; } @@ -332,7 +364,7 @@ public abstract class TournamentImpl implements Tournament { @Override public boolean allJoined() { - for (TournamentPlayer player: this.players.values()) { + for (TournamentPlayer player : this.players.values()) { if (!player.isJoined()) { return false; } @@ -358,27 +390,26 @@ public abstract class TournamentImpl implements Tournament { public void construct() { tableEventSource.fireTableEvent(EventType.CONSTRUCT); if (!isAbort()) { - for (final TournamentPlayer player: players.values()) { + for (final TournamentPlayer player : players.values()) { player.setConstructing(); new Thread( - new Runnable() { - @Override - public void run() { - player.getPlayer().construct(TournamentImpl.this, player.getDeck()); + new Runnable() { + @Override + public void run() { + player.getPlayer().construct(TournamentImpl.this, player.getDeck()); + } } - } ).start(); } // add autosubmit trigger - - - synchronized(this) { + + synchronized (this) { while (!isDoneConstructing()) { try { this.wait(); } catch (InterruptedException ex) { - + } } } @@ -387,7 +418,7 @@ public abstract class TournamentImpl implements Tournament { } protected void openBoosters() { - for (TournamentPlayer player: this.players.values()) { + for (TournamentPlayer player : this.players.values()) { player.setDeck(new Deck()); if (options.getLimitedOptions().getDraftCube() != null) { DraftCube cube = options.getLimitedOptions().getDraftCube(); @@ -395,7 +426,7 @@ public abstract class TournamentImpl implements Tournament { player.getDeck().getSideboard().addAll(cube.createBooster()); } } else { - for (ExpansionSet set: sets) { + for (ExpansionSet set : sets) { player.getDeck().getSideboard().addAll(set.createBooster()); } } @@ -406,7 +437,7 @@ public abstract class TournamentImpl implements Tournament { public void resetBufferedCards() { HashSet setsDone = new HashSet<>(); - for(ExpansionSet set: sets) { + for (ExpansionSet set : sets) { if (!setsDone.contains(set)) { set.removeSavedCards(); setsDone.add(set); @@ -454,7 +485,7 @@ public abstract class TournamentImpl implements Tournament { protected void winners() { List winners = new ArrayList<>(); int pointsWinner = 1; // with less than 1 point you can't win - for(TournamentPlayer tournamentPlayer: this.getPlayers()) { + for (TournamentPlayer tournamentPlayer : this.getPlayers()) { if (pointsWinner < tournamentPlayer.getPoints()) { winners.clear(); winners.add(tournamentPlayer); @@ -464,14 +495,14 @@ public abstract class TournamentImpl implements Tournament { } } // set winner state for the players with the most points > 0 - for (TournamentPlayer tournamentPlayer: winners) { + for (TournamentPlayer tournamentPlayer : winners) { tournamentPlayer.setStateInfo("Winner"); } } @Override public void cleanUpOnTournamentEnd() { - for(TournamentPlayer tournamentPlayer: players.values()) { + for (TournamentPlayer tournamentPlayer : players.values()) { tournamentPlayer.CleanUpOnTournamentEnd(); } } @@ -509,7 +540,6 @@ public abstract class TournamentImpl implements Tournament { this.startTime = new Date(); } - @Override public void setStepStartTime(Date stepStartTime) { this.stepStartTime = stepStartTime; diff --git a/Mage/src/mage/game/tournament/TournamentSwiss.java b/Mage/src/mage/game/tournament/TournamentSwiss.java index 9f6c970bd4a..e755d47a6f0 100644 --- a/Mage/src/mage/game/tournament/TournamentSwiss.java +++ b/Mage/src/mage/game/tournament/TournamentSwiss.java @@ -27,13 +27,15 @@ */ package mage.game.tournament; -import java.util.Collections; -import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.UUID; + import mage.constants.TournamentPlayerState; import mage.game.events.TableEvent; +import mage.game.tournament.pairing.RoundPairings; +import mage.game.tournament.pairing.SwissPairingMinimalWeightMatching; +import mage.game.tournament.pairing.SwissPairingSimple; /** * @@ -46,8 +48,8 @@ public abstract class TournamentSwiss extends TournamentImpl { } @Override - protected void runTournament() { - for (Map.Entry entry: players.entrySet()) { + protected void runTournament() { + for (Map.Entry entry : players.entrySet()) { if (entry.getValue().getPlayer().autoLoseGame()) { entry.getValue().setEliminated(); entry.getValue().setResults("Auto Eliminated"); @@ -57,7 +59,7 @@ public abstract class TournamentSwiss extends TournamentImpl { while (this.getActivePlayers().size() > 1 && this.getNumberRounds() > this.getRounds().size()) { // check if some player got killed / disconnected meanwhile and update their state tableEventSource.fireTableEvent(TableEvent.EventType.CHECK_STATE_PLAYERS); - // Swiss pairing + // Swiss pairing Round round = createRoundSwiss(); playRound(round); } @@ -65,75 +67,36 @@ public abstract class TournamentSwiss extends TournamentImpl { } protected Round createRoundSwiss() { + List roundPlayers = getActivePlayers(); + boolean isLastRound = (rounds.size() + 1 == getNumberRounds()); + + RoundPairings roundPairings; + if (roundPlayers.size() <= 16) { + SwissPairingMinimalWeightMatching swissPairing = new SwissPairingMinimalWeightMatching(roundPlayers, rounds, isLastRound); + roundPairings = swissPairing.getRoundPairings(); + } else { + SwissPairingSimple swissPairing = new SwissPairingSimple(roundPlayers, rounds); + roundPairings = swissPairing.getRoundPairings(); + } + Round round = new Round(rounds.size() + 1, this); rounds.add(round); - List roundPlayers = getActivePlayers(); - // sort players by tournament points - Collections.sort(roundPlayers, new Comparator() { - @Override public int compare(TournamentPlayer p1, TournamentPlayer p2) { - return p2.getPoints() - p1.getPoints(); - } - - }); - // create pairings - while (roundPlayers.size() > 0) { - TournamentPlayer player1 = roundPlayers.get(0); - roundPlayers.remove(0); - TournamentPlayer playerForPossibleSecondPairing = null; - for (TournamentPlayer player2: roundPlayers) { - if (alreadyPaired(player1, player2)) { - // if laready paired but equal ponts -> remember if second pairing is needed - if (playerForPossibleSecondPairing == null) { - playerForPossibleSecondPairing = player2; - } - } else { - if (player2.getPoints() < player1.getPoints() && playerForPossibleSecondPairing != null) { - // pair again with a player - round.addPairing(new TournamentPairing(player1, playerForPossibleSecondPairing)); - roundPlayers.remove(playerForPossibleSecondPairing); - player1 = null; - break; - } else { - // pair agains the next not paired before - round.addPairing(new TournamentPairing(player1, player2)); - roundPlayers.remove(player2); - player1 = null; - break; - } - } - } - if (player1 != null) { - // no pairing done yet - if (playerForPossibleSecondPairing != null) { - // pair again with a player - round.addPairing(new TournamentPairing(player1, playerForPossibleSecondPairing)); - roundPlayers.remove(playerForPossibleSecondPairing); - } else { - // player free round - add to bye players of this round - round.getPlayerByes().add(player1); - if (round.getRoundNumber() == getNumberRounds()) { - player1.setState(TournamentPlayerState.FINISHED); - } else { - player1.setState(TournamentPlayerState.WAITING); - } - player1.setStateInfo("Round Bye"); - updateResults(); - } - } + for (TournamentPairing pairing : roundPairings.getPairings()) { + round.addPairing(pairing); } + for (TournamentPlayer playerBye : roundPairings.getPlayerByes()) { + // player free round - add to bye players of this round + round.getPlayerByes().add(playerBye); + if (isLastRound) { + playerBye.setState(TournamentPlayerState.FINISHED); + } else { + playerBye.setState(TournamentPlayerState.WAITING); + } + playerBye.setStateInfo("Round Bye"); + updateResults(); + } + return round; } - protected boolean alreadyPaired(TournamentPlayer player1, TournamentPlayer player2) { - for (Round round : rounds) { - for (TournamentPairing pairing: round.getPairs()) { - if (pairing.getPlayer1().equals(player1) || pairing.getPlayer2().equals(player1)) { - if (pairing.getPlayer1().equals(player2) || pairing.getPlayer2().equals(player2)) { - return true; - } - } - } - } - return false; - } } diff --git a/Mage/src/mage/game/tournament/pairing/RoundPairings.java b/Mage/src/mage/game/tournament/pairing/RoundPairings.java new file mode 100644 index 00000000000..b6c77874e18 --- /dev/null +++ b/Mage/src/mage/game/tournament/pairing/RoundPairings.java @@ -0,0 +1,64 @@ +/* + * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.game.tournament.pairing; + +import mage.game.tournament.TournamentPairing; +import mage.game.tournament.TournamentPlayer; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Quercitron + */ +public class RoundPairings { + + public RoundPairings() { + this(new ArrayList(), new ArrayList()); + } + + public RoundPairings(List pairings, List playerByes) { + this.pairings = pairings; + this.playerByes = playerByes; + } + + private final List pairings; + + private final List playerByes; + + public List getPairings() { + return pairings; + } + + public List getPlayerByes() { + return playerByes; + } + +} diff --git a/Mage/src/mage/game/tournament/pairing/SwissPairingMinimalWeightMatching.java b/Mage/src/mage/game/tournament/pairing/SwissPairingMinimalWeightMatching.java new file mode 100644 index 00000000000..22040ac3a17 --- /dev/null +++ b/Mage/src/mage/game/tournament/pairing/SwissPairingMinimalWeightMatching.java @@ -0,0 +1,303 @@ +/* + * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.game.tournament.pairing; + +import mage.game.tournament.Round; +import mage.game.tournament.TournamentPairing; +import mage.game.tournament.TournamentPlayer; + +import java.util.*; + +/** + * + * @author Quercitron + */ + +// SwissPairingMinimalWeightMatching creates round pairings for swiss tournament. +// It assigns weight to each possible pair and searches perfect matching with minimal weight +// for more details see https://www.leaguevine.com/blog/18/swiss-tournament-scheduling-leaguevines-new-algorithm/ +// This implementation don't use fast minimum weight maximum matching algorithm, +// it uses brute-force search, so it works reasonably fast only up to 16 players. + +public class SwissPairingMinimalWeightMatching { + + private final int playersCount; + + List swissPlayers; + + // number of vertexes in graph + private final int n; + + // weight of pairings + private final int[][] w; + + public SwissPairingMinimalWeightMatching(List players, List rounds, boolean isLastRound) { + playersCount = players.size(); + + swissPlayers = new ArrayList(); + for (TournamentPlayer tournamentPlayer : players) { + PlayerInfo swissPlayer = new PlayerInfo(); + swissPlayer.tournamentPlayer = tournamentPlayer; + swissPlayer.points = tournamentPlayer.getPoints(); + swissPlayers.add(swissPlayer); + } + + // shuffle players first to add some randomness + Collections.shuffle(swissPlayers); + Map map = new HashMap<>(); + for (int i = 0; i < playersCount; i++) { + swissPlayers.get(i).id = i; + map.put(swissPlayers.get(i).tournamentPlayer, i); + } + + // calculate Tie Breaker points -- Sum of Opponents' Scores (SOS) + // see http://senseis.xmp.net/?SOS + for (Round round : rounds) { + for (TournamentPairing pairing : round.getPairs()) { + TournamentPlayer player1 = pairing.getPlayer1(); + TournamentPlayer player2 = pairing.getPlayer2(); + + Integer id1 = map.get(player1); + Integer id2 = map.get(player2); + + // a player could have left the tournament, so we should check if id is not null + if (id1 != null) { + swissPlayers.get(id1).sosPoints += player2.getPoints(); + } + if (id2 != null) { + swissPlayers.get(id2).sosPoints += player1.getPoints(); + } + // todo: sos points for byes? maybe add player points? + } + } + + // sort by points and then by sos points + Collections.sort(swissPlayers, new Comparator() { + @Override + public int compare(PlayerInfo p1, PlayerInfo p2) { + int result = p2.points - p1.points; + if (result != 0) { + return result; + } + return p2.sosPoints - p1.sosPoints; + } + }); + + // order could be changed, update ids and mapping + map.clear(); + for (int i = 0; i < playersCount; i++) { + swissPlayers.get(i).id = i; + map.put(swissPlayers.get(i).tournamentPlayer, i); + } + + // count ties and matches between players + int[][] duels = new int[playersCount][playersCount]; + int[] byes = new int[playersCount]; + for (Round round : rounds) { + for (TournamentPairing pairing : round.getPairs()) { + TournamentPlayer player1 = pairing.getPlayer1(); + TournamentPlayer player2 = pairing.getPlayer2(); + + Integer id1 = map.get(player1); + Integer id2 = map.get(player2); + + if (id1 != null && id2 != null) { + duels[id1][id2]++; + duels[id2][id1]++; + } + } + for (TournamentPlayer playerBye : round.getPlayerByes()) { + Integer id = map.get(playerBye); + if (id != null) { + byes[id]++; + } + } + } + + // set vertex count + // add vertex for bye if we have odd number of players + n = (playersCount % 2 == 1 ? playersCount + 1 : playersCount); + + // calculate weight + // try to pair players with equal scores + w = new int[n][n]; + int pointsDiffMultiplier = 10; + if (isLastRound) { + // for the last round, for each unpaired player starting with the first place, pair + // against the highest ranked player they haven't played against + for (int i = 0; i < playersCount; i++) { + for (int j = 0; j < i; j++) { + w[i][j] = Math.abs(i - j) + + pointsDiffMultiplier * Math.abs(swissPlayers.get(i).points - swissPlayers.get(j).points); + w[j][i] = w[i][j]; + } + } + } else { + for (int i = 0; i < playersCount; i++) { + PlayerInfo player = swissPlayers.get(i); + for (int p = player.points; p >= 0; p--) { + int first = -1; + int last = -1; + for (int j = 0; j < playersCount; j++) { + if (swissPlayers.get(j).points == p) { + if (first < 0) { + first = j; + } + last = j; + } + } + if (first < 0) { + continue; + } + int self = (p == player.points ? i : first - 1); + int diff = pointsDiffMultiplier * (player.points - p); + for (int j = Math.max(first, i); j <= last; j++) { + w[i][j] = Math.abs(j - (last + first - self)) + diff; + w[j][i] = w[i][j]; + } + } + } + } + + // avoid pairing players that have played each other already + for (int i = 0; i < playersCount; i++) { + for (int j = 0; j < i; j++) { + w[i][j] += duels[i][j] * 500; + w[j][i] = w[i][j]; + } + } + + // try to give bye to a player with a low score + // try to avoid giving the same person multiple byes + if (n > playersCount) { + for (int i = 0; i < playersCount; i++) { + w[i][n - 1] = 10 * (swissPlayers.get(i).points - swissPlayers.get(playersCount - 1).points) + (playersCount - i - 1); + w[i][n - 1] += byes[i] * 2000; + w[n - 1][i] = w[i][n - 1]; + } + } + + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + w[i][j] *= w[i][j]; + } + } + + // initialize variables for backtrack + used = new boolean[n]; + pairs = new int[n]; + Arrays.fill(pairs, -1); + result = new int[n]; + weight = 0; + minCost = -1; + makePairings(0); + } + + public RoundPairings getRoundPairings() { + // return round pairings with minimal weight + List pairings = new ArrayList<>(); + List playerByes = new ArrayList<>(); + + Map map = new HashMap<>(); + for (PlayerInfo player : swissPlayers) { + map.put(player.id, player.tournamentPlayer); + } + + if (n > playersCount) { + // last vertex -- bye + playerByes.add(map.get(result[n - 1])); + result[result[n - 1]] = -1; + result[n - 1] = -1; + } + + for (int i = 0; i < playersCount; i++) { + if (result[i] >= 0) { + pairings.add(new TournamentPairing(map.get(i), map.get(result[i]))); + result[result[i]] = -1; + result[i] = -1; + } + } + + return new RoundPairings(pairings, playerByes); + } + + boolean[] used; + + // current pairs + int[] pairs; + // current weight + int weight; + + int[] result; + int minCost; + + // backtrack all possible pairings and choose one with minimal weight + private void makePairings(int t) { + if (t >= n) { + if (minCost < 0 || minCost > weight) { + minCost = weight; + System.arraycopy(pairs, 0, result, 0, n); + } + return; + } + + if (!used[t]) { + for (int i = t + 1; i < n; i++) { + if (!used[i]) { + pairs[t] = i; + pairs[i] = t; + used[t] = true; + used[i] = true; + weight += w[t][i]; + + makePairings(t + 1); + + pairs[t] = -1; + pairs[i] = -1; + used[t] = false; + used[i] = false; + weight -= w[t][i]; + } + } + } else { + makePairings(t + 1); + } + } + + class PlayerInfo { + public int id; + + public TournamentPlayer tournamentPlayer; + + public int points; + + public int sosPoints; + } +} + diff --git a/Mage/src/mage/game/tournament/pairing/SwissPairingSimple.java b/Mage/src/mage/game/tournament/pairing/SwissPairingSimple.java new file mode 100644 index 00000000000..0af702e22c2 --- /dev/null +++ b/Mage/src/mage/game/tournament/pairing/SwissPairingSimple.java @@ -0,0 +1,124 @@ +/* + * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.game.tournament.pairing; + +import mage.game.tournament.Round; +import mage.game.tournament.TournamentPairing; +import mage.game.tournament.TournamentPlayer; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +/** + * + * @author BetaSteward_at_googlemail.com + * @author Quercitron + */ +public class SwissPairingSimple { + + private final RoundPairings roundPairings; + + public SwissPairingSimple(List players, List rounds) { + roundPairings = getPairingsSimple(players, rounds); + } + + public RoundPairings getRoundPairings() { + return roundPairings; + } + + private RoundPairings getPairingsSimple(List players, List rounds) { + List pairings = new ArrayList<>(); + List playerByes = new ArrayList<>(); + + // sort players by tournament points + Collections.sort(players, new Comparator() { + @Override + public int compare(TournamentPlayer p1, TournamentPlayer p2) { + return p2.getPoints() - p1.getPoints(); + } + + }); + // create pairings + while (players.size() > 0) { + TournamentPlayer player1 = players.get(0); + players.remove(0); + TournamentPlayer playerForPossibleSecondPairing = null; + for (TournamentPlayer player2 : players) { + if (alreadyPaired(rounds, player1, player2)) { + // if already paired but equal points -> remember if second pairing is needed + if (playerForPossibleSecondPairing == null) { + playerForPossibleSecondPairing = player2; + } + } else { + if (player2.getPoints() < player1.getPoints() && playerForPossibleSecondPairing != null) { + // pair again with a player + pairings.add(new TournamentPairing(player1, playerForPossibleSecondPairing)); + players.remove(playerForPossibleSecondPairing); + player1 = null; + break; + } else { + // pair agains the next not paired before + pairings.add(new TournamentPairing(player1, player2)); + players.remove(player2); + player1 = null; + break; + } + } + } + if (player1 != null) { + // no pairing done yet + if (playerForPossibleSecondPairing != null) { + // pair again with a player + pairings.add(new TournamentPairing(player1, playerForPossibleSecondPairing)); + players.remove(playerForPossibleSecondPairing); + } else { + // player free round - add to bye players of this round + playerByes.add(player1); + } + } + } + + return new RoundPairings(pairings, playerByes); + } + + private boolean alreadyPaired(List rounds, TournamentPlayer player1, TournamentPlayer player2) { + for (Round round : rounds) { + for (TournamentPairing pairing : round.getPairs()) { + if (pairing.getPlayer1().equals(player1) || pairing.getPlayer2().equals(player1)) { + if (pairing.getPlayer1().equals(player2) || pairing.getPlayer2().equals(player2)) { + return true; + } + } + } + } + return false; + } +} diff --git a/Mage/src/mage/game/turn/Turn.java b/Mage/src/mage/game/turn/Turn.java index 30a367814ca..9239e55e8b6 100644 --- a/Mage/src/mage/game/turn/Turn.java +++ b/Mage/src/mage/game/turn/Turn.java @@ -49,7 +49,7 @@ import mage.util.ThreadLocalStringBuilder; */ public class Turn implements Serializable { - private static final transient ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(50); + private static final ThreadLocalStringBuilder threadLocalBuilder = new ThreadLocalStringBuilder(50); private Phase currentPhase; private UUID activePlayerId; diff --git a/Mage/src/mage/players/Library.java b/Mage/src/mage/players/Library.java index ec7cfc1942a..1b72dd544a3 100644 --- a/Mage/src/mage/players/Library.java +++ b/Mage/src/mage/players/Library.java @@ -128,6 +128,17 @@ public class Library implements Serializable { return game.getCard(library.peekFirst()); } + /** + * Returns the bottommost card of the Library without removing it + * + * @param game + * @return Card + * @see Card + */ + public Card getFromBottom(Game game) { + return game.getCard(library.pollLast()); + } + public void putOnTop(Card card, Game game) { if (card.getOwnerId().equals(playerId)) { card.setZone(Zone.LIBRARY, game); diff --git a/Mage/src/mage/players/ManaPool.java b/Mage/src/mage/players/ManaPool.java index f4745ac20ca..04aec4fa846 100644 --- a/Mage/src/mage/players/ManaPool.java +++ b/Mage/src/mage/players/ManaPool.java @@ -38,7 +38,6 @@ import mage.ConditionalMana; import mage.MageObject; import mage.Mana; import mage.abilities.Ability; -import mage.constants.AsThoughEffectType; import mage.constants.Duration; import mage.constants.ManaType; import mage.constants.TurnPhase; @@ -138,16 +137,15 @@ public class ManaPool implements Serializable { // no mana added beyond the stock so don't auto pay this continue; } - boolean spendAnyMana = spendAnyMana(ability, game); - if (mana.get(manaType) > 0 || (spendAnyMana && mana.count() > 0)) { + ManaType usableManaType = game.getContinuousEffects().asThoughMana(manaType, mana, ability.getSourceId(), ability, ability.getControllerId(), game); + if (usableManaType == null) { + continue; + } + if (mana.get(usableManaType) > 0) { GameEvent event = new GameEvent(GameEvent.EventType.MANA_PAYED, ability.getId(), mana.getSourceId(), ability.getControllerId(), 0, mana.getFlag()); event.setData(mana.getOriginalId().toString()); game.fireEvent(event); - if (spendAnyMana) { - mana.removeAny(); - } else { - mana.remove(manaType); - } + mana.remove(usableManaType); if (mana.count() == 0) { // so no items with count 0 stay in list manaItems.remove(mana); } @@ -158,11 +156,6 @@ public class ManaPool implements Serializable { return false; } - // check if any mana can be spend to cast the mana cost of an ability - private boolean spendAnyMana(Ability ability, Game game) { - return game.getContinuousEffects().asThough(ability.getSourceId(), AsThoughEffectType.SPEND_ANY_MANA, ability, ability.getControllerId(), game); - } - public int get(ManaType manaType) { return getMana().get(manaType); } diff --git a/Mage/src/mage/players/ManaPoolItem.java b/Mage/src/mage/players/ManaPoolItem.java index b6a8f796b9a..9c380389a3d 100644 --- a/Mage/src/mage/players/ManaPoolItem.java +++ b/Mage/src/mage/players/ManaPoolItem.java @@ -1,30 +1,30 @@ /* -* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.players; import java.io.Serializable; @@ -53,7 +53,8 @@ public class ManaPoolItem implements Serializable { private Duration duration; private int stock; // amount the item had at the start of casting something - public ManaPoolItem() {} + public ManaPoolItem() { + } public ManaPoolItem(int red, int green, int blue, int white, int black, int colorless, UUID sourceId, UUID originalId, boolean flag) { this.red = red; @@ -75,7 +76,7 @@ public class ManaPoolItem implements Serializable { this.conditionalMana.setManaProducerId(sourceId); this.conditionalMana.setManaProducerOriginalId(originalId); this.flag = conditionalMana.getFlag(); - this.duration = Duration.EndOfStep; + this.duration = Duration.EndOfStep; } public ManaPoolItem(final ManaPoolItem item) { @@ -191,7 +192,7 @@ public class ManaPoolItem implements Serializable { } public int get(ManaType manaType) { - switch(manaType) { + switch (manaType) { case BLACK: return black; case BLUE: @@ -208,29 +209,26 @@ public class ManaPoolItem implements Serializable { return 0; } - public void removeAny() { - int oldCount = count(); + public ManaType getFirstAvailable() { if (black > 0) { - black--; + return ManaType.BLACK; } else if (blue > 0) { - blue--; + return ManaType.BLUE; } else if (green > 0) { - green--; + return ManaType.GREEN; } else if (red > 0) { - red--; + return ManaType.RED; } else if (white > 0) { - white--; + return ManaType.WHITE; } else if (colorless > 0) { - colorless--; - } - if (stock == oldCount && oldCount > count()) { - stock--; - } + return ManaType.COLORLESS; + } + return null; } - + public void remove(ManaType manaType) { int oldCount = count(); - switch(manaType) { + switch (manaType) { case BLACK: if (black > 0) { black--; @@ -264,11 +262,11 @@ public class ManaPoolItem implements Serializable { } if (stock == oldCount && oldCount > count()) { stock--; - } + } } - + public void clear(ManaType manaType) { - switch(manaType) { + switch (manaType) { case BLACK: black = 0; break; @@ -287,31 +285,36 @@ public class ManaPoolItem implements Serializable { case COLORLESS: colorless = 0; break; - } + } } - + public void add(ManaType manaType, int amount) { - switch(manaType) { + switch (manaType) { case BLACK: black += amount; break; case BLUE: - blue += amount;; + blue += amount; + ; break; case GREEN: - green += amount;; + green += amount; + ; break; case RED: - red += amount;; + red += amount; + ; break; case WHITE: - white += amount;; + white += amount; + ; break; case COLORLESS: - colorless += amount;; + colorless += amount; + ; break; - } - } + } + } public Duration getDuration() { return duration; @@ -328,5 +331,5 @@ public class ManaPoolItem implements Serializable { public void setStock(int stock) { this.stock = stock; } - + } diff --git a/Mage/src/mage/players/Player.java b/Mage/src/mage/players/Player.java index 88aa373b59c..d2565bd84a1 100644 --- a/Mage/src/mage/players/Player.java +++ b/Mage/src/mage/players/Player.java @@ -44,6 +44,8 @@ import mage.abilities.Modes; import mage.abilities.SpellAbility; import mage.abilities.TriggeredAbility; import mage.abilities.costs.AlternativeSourceCosts; +import mage.abilities.costs.Cost; +import mage.abilities.costs.Costs; import mage.abilities.costs.VariableCost; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; @@ -52,6 +54,7 @@ import mage.cards.Card; import mage.cards.Cards; import mage.cards.decks.Deck; import mage.choices.Choice; +import mage.constants.AbilityType; import mage.constants.ManaType; import mage.constants.Outcome; import mage.constants.PlayerAction; @@ -74,6 +77,7 @@ import mage.target.TargetAmount; import mage.target.TargetCard; import mage.target.common.TargetCardInLibrary; import mage.util.Copyable; +import mage.util.MessageToClient; /** * @@ -179,6 +183,8 @@ public interface Player extends MageItem, Copyable { void resetPassed(); + void resetPlayerPassedActions(); + boolean getPassedTurn(); boolean getPassedUntilEndOfTurn(); @@ -189,6 +195,10 @@ public interface Player extends MageItem, Copyable { boolean getPassedAllTurns(); + AbilityType getJustActivatedType(); + + void setJustActivatedType(AbilityType abilityType); + boolean hasLost(); boolean hasWon(); @@ -358,7 +368,29 @@ public interface Player extends MageItem, Copyable { boolean canPlayLand(); - boolean playLand(Card card, Game game); + /** + * Plays a card if possible + * + * @param card the card that can be cast + * @param game + * @param noMana if it's a spell i can be cast without paying mana + * @param ignoreTiming if it's cast during the resolution of another spell + * no sorcery or play land timing restriction are checked. For a land it has + * to be the turn of the player playing that card. + * @return + */ + boolean playCard(Card card, Game game, boolean noMana, boolean ignoreTiming); + + /** + * + * @param card the land card to play + * @param game + * @param ignoreTiming false - it won't be checked if the stack is empty and + * you are able to play a Sorcery. It's still checked, if you are able to + * play a land concerning the numner of lands you already played. + * @return + */ + boolean playLand(Card card, Game game, boolean ignoreTiming); boolean activateAbility(ActivatedAbility ability, Game game); @@ -400,7 +432,7 @@ public interface Player extends MageItem, Copyable { void skip(); // priority, undo, ... - void sendPlayerAction(PlayerAction passPriorityAction, Game game); + void sendPlayerAction(PlayerAction passPriorityAction, Game game, Object data); int getStoredBookmark(); @@ -449,6 +481,8 @@ public interface Player extends MageItem, Copyable { boolean chooseUse(Outcome outcome, String message, Ability source, Game game); + boolean chooseUse(Outcome outcome, MessageToClient message, Ability source, Game game); + boolean choose(Outcome outcome, Choice choice, Game game); boolean choosePile(Outcome outcome, String message, List pile1, List pile2, Game game); @@ -564,8 +598,9 @@ public interface Player extends MageItem, Copyable { * * @param card * @param game + * @return player looked at the card */ - void revealFaceDownCard(Card card, Game game); + boolean lookAtFaceDownCard(Card card, Game game); /** * Set seconds left to play the game. @@ -618,17 +653,42 @@ public interface Player extends MageItem, Copyable { * @param game * @return */ + @Deprecated boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game); - boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game, boolean withName); - + @Deprecated boolean moveCards(Card card, Zone fromZone, Zone toZone, Ability source, Game game); - boolean moveCards(Card card, Zone fromZone, Zone toZone, Ability source, Game game, boolean withName); - + @Deprecated boolean moveCards(Set cards, Zone fromZone, Zone toZone, Ability source, Game game); - boolean moveCards(Set cards, Zone fromZone, Zone toZone, Ability source, Game game, boolean withName); + boolean moveCards(Card card, Zone toZone, Ability source, Game game); + + boolean moveCards(Card card, Zone toZone, Ability source, Game game, boolean tapped, boolean faceDown, boolean byOwner, ArrayList appliedEffects); + + boolean moveCards(Cards cards, Zone toZone, Ability source, Game game); + + boolean moveCards(Set cards, Zone toZone, Ability source, Game game); + + /** + * Universal method to move cards from one zone to another. Do not mix + * objects from different from zones to move. + * + * @param cards + * @param toZone + * @param source + * @param game + * @param tapped tha cards are tapped on the battlefield + * @param faceDown the cards are face down in the to zone + * @param byOwner the card is moved (or put onto battlefield) by the owner + * of the card and if target zone is battlefield controls the permanent + * (instead of the controller of the source) + * @param appliedEffects + * @return + */ + boolean moveCards(Set cards, Zone toZone, Ability source, Game game, boolean tapped, boolean faceDown, boolean byOwner, ArrayList appliedEffects); + + boolean moveCardsToExile(Card card, Ability source, Game game, boolean withName, UUID exileId, String exileZoneName); boolean moveCardsToExile(Set cards, Ability source, Game game, boolean withName, UUID exileId, String exileZoneName); @@ -662,6 +722,7 @@ public interface Player extends MageItem, Copyable { * @param exileName name of exile zone (optional) * @param sourceId * @param game + * @param fromZone * @param withName * @return */ @@ -686,9 +747,9 @@ public interface Player extends MageItem, Copyable { * @param source * @param game * @param fromZone if null, this info isn't postet - * @return + * @return Set that were successful moved to graveyard */ - boolean moveCardsToGraveyardWithInfo(Set cards, Ability source, Game game, Zone fromZone); + Set moveCardsToGraveyardWithInfo(Set cards, Ability source, Game game, Zone fromZone); /** * Uses card.moveToZone and posts a inform message about moving the card to @@ -704,45 +765,6 @@ public interface Player extends MageItem, Copyable { */ boolean moveCardToLibraryWithInfo(Card card, UUID sourceId, Game game, Zone fromZone, boolean toTop, boolean withName); - /** - * Uses putOntoBattlefield and posts also a info message about in the game - * log - * - * @param card - * @param game - * @param fromZone - * @param sourceId - * @return - */ - boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId); - - /** - * Uses putOntoBattlefield and posts also a info message about in the game - * log - * - * @param card - * @param game - * @param fromZone - * @param sourceId - * @param tapped the card enters the battlefield tapped - * @return - */ - boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId, boolean tapped); - - /** - * Uses putOntoBattlefield and posts also a info message about in the game - * log - * - * @param card - * @param game - * @param fromZone - * @param sourceId - * @param tapped the card enters the battlefield tapped - * @param facedown the card enters the battlefield facedown - * @return - */ - boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId, boolean tapped, boolean facedown); - /** * Checks if the playerToCheckId is from an opponent in range * @@ -758,19 +780,23 @@ public interface Player extends MageItem, Copyable { void cleanUpOnMatchEnd(); /** - * If the next cast spell has the set sourceId, the spell will be cast - * without mana. + * If the next spell cast has the set sourceId, the spell will be cast + * without mana (null) or the mana set to manaCosts instead of its normal + * mana costs. * * @param sourceId the source that can be cast without mana * @param manaCosts alternate ManaCost, null if it can be cast without mana * cost + * @param costs alternate other costs you need to pay */ - void setCastSourceIdWithAlternateMana(UUID sourceId, ManaCosts manaCosts); + void setCastSourceIdWithAlternateMana(UUID sourceId, ManaCosts manaCosts, mage.abilities.costs.Costs costs); UUID getCastSourceIdWithAlternateMana(); ManaCosts getCastSourceIdManaCosts(); + Costs getCastSourceIdCosts(); + // permission handling to show hand cards void addPermissionToShowHandCards(UUID watcherUserId); @@ -787,4 +813,15 @@ public interface Player extends MageItem, Copyable { void setMatchPlayer(MatchPlayer matchPlayer); MatchPlayer getMatchPlayer(); + + boolean scry(int value, Ability source, Game game); + + /** + * Only used for test player for pre-setting targets + * + * @param ability + * @param game + * @return + */ + boolean addTargets(Ability ability, Game game); } diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index b5b2029a92e..8c180e2fec5 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -34,6 +34,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Locale; import java.util.Map; @@ -60,6 +61,7 @@ import mage.abilities.costs.AlternativeCost; import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeSourceCosts; import mage.abilities.costs.Cost; +import mage.abilities.costs.Costs; import mage.abilities.costs.OptionalAdditionalSourceCosts; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; @@ -112,6 +114,7 @@ import mage.game.events.DamagePlayerEvent; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; +import mage.game.events.ZoneChangeEvent; import mage.game.events.ZoneChangeGroupEvent; import mage.game.match.MatchPlayer; import mage.game.permanent.Permanent; @@ -133,7 +136,7 @@ import org.apache.log4j.Logger; public abstract class PlayerImpl implements Player, Serializable { - private static final transient Logger logger = Logger.getLogger(PlayerImpl.class); + private static final Logger logger = Logger.getLogger(PlayerImpl.class); private static Random rnd = new Random(); @@ -175,6 +178,7 @@ public abstract class PlayerImpl implements Player, Serializable { * and abilities in the stack and will pass them as well. */ protected boolean passedAllTurns; // F9 + protected AbilityType justActivatedType; // used to check if priority can be passed automatically protected int turns; protected int storedBookmark = -1; @@ -219,7 +223,8 @@ public abstract class PlayerImpl implements Player, Serializable { // indicates that the spell with the set sourceId can be cast with an alternate mana costs (can also be no mana costs) protected UUID castSourceIdWithAlternateMana; - protected ManaCosts castSourceIdManaCosts; + protected ManaCosts castSourceIdManaCosts; + protected Costs castSourceIdCosts; // indicates that the player is in mana payment phase protected boolean payManaMode = false; @@ -316,12 +321,14 @@ public abstract class PlayerImpl implements Player, Serializable { this.passedUntilStackResolved = player.passedUntilStackResolved; this.dateLastAddedToStack = player.dateLastAddedToStack; this.passedAllTurns = player.passedAllTurns; + this.justActivatedType = player.justActivatedType; this.priorityTimeLeft = player.getPriorityTimeLeft(); this.reachedNextTurnAfterLeaving = player.reachedNextTurnAfterLeaving; this.castSourceIdWithAlternateMana = player.castSourceIdWithAlternateMana; this.castSourceIdManaCosts = player.castSourceIdManaCosts; + this.castSourceIdCosts = player.castSourceIdCosts; this.payManaMode = player.payManaMode; } @@ -330,9 +337,21 @@ public abstract class PlayerImpl implements Player, Serializable { this.name = player.getName(); this.human = player.isHuman(); this.life = player.getLife(); - this.wins = player.hasWon(); - this.loses = player.hasLost(); + // Don't restore more global states. If restored they are probably cause for unintended draws (https://github.com/magefree/mage/issues/1205). +// this.wins = player.hasWon(); +// this.loses = player.hasLost(); +// this.left = player.hasLeft(); +// this.quit = player.hasQuit(); + // Makes no sense to restore +// this.passed = player.isPassed(); +// this.priorityTimeLeft = player.getPriorityTimeLeft(); +// this.idleTimeout = player.hasIdleTimeout(); +// this.timerTimeout = player.hasTimerTimeout(); + // can't change so no need to restore +// this.isTestMode = player.isTestMode(); + // This is meta data and should'nt be restored by rollback +// this.userData = player.getUserData(); this.library = player.getLibrary().copy(); this.sideboard = player.getSideboard().copy(); this.hand = player.getHand().copy(); @@ -349,10 +368,6 @@ public abstract class PlayerImpl implements Player, Serializable { this.manaPool = player.getManaPool().copy(); this.turns = player.getTurns(); - this.left = player.hasLeft(); - this.quit = player.hasQuit(); - this.timerTimeout = player.hasTimerTimeout(); - this.idleTimeout = player.hasIdleTimeout(); this.range = player.getRange(); this.canGainLife = player.isCanGainLife(); this.canLoseLife = player.isCanLoseLife(); @@ -361,7 +376,6 @@ public abstract class PlayerImpl implements Player, Serializable { this.inRange.clear(); this.inRange.addAll(player.getInRange()); - this.userData = player.getUserData(); this.canPayLifeCost = player.canPayLifeCost(); this.canPaySacrificeCost = player.canPaySacrificeCost(); this.loseByZeroOrLessLife = player.canLoseByZeroOrLessLife(); @@ -371,15 +385,13 @@ public abstract class PlayerImpl implements Player, Serializable { this.topCardRevealed = player.isTopCardRevealed(); this.playersUnderYourControl.clear(); this.playersUnderYourControl.addAll(player.getPlayersUnderYourControl()); - this.isTestMode = player.isTestMode(); this.isGameUnderControl = player.isGameUnderControl(); this.turnController = player.getTurnControlledBy(); - this.passed = player.isPassed(); - this.priorityTimeLeft = player.getPriorityTimeLeft(); this.reachedNextTurnAfterLeaving = player.hasReachedNextTurnAfterLeaving(); this.castSourceIdWithAlternateMana = player.getCastSourceIdWithAlternateMana(); this.castSourceIdManaCosts = player.getCastSourceIdManaCosts(); + this.castSourceIdCosts = player.getCastSourceIdCosts(); // Don't restore! // this.storedBookmark @@ -435,6 +447,7 @@ public abstract class PlayerImpl implements Player, Serializable { this.skippedAtLeastOnce = false; this.passedUntilStackResolved = false; this.passedAllTurns = false; + this.justActivatedType = null; this.canGainLife = true; this.canLoseLife = true; this.topCardRevealed = false; @@ -444,6 +457,7 @@ public abstract class PlayerImpl implements Player, Serializable { this.castSourceIdWithAlternateMana = null; this.castSourceIdManaCosts = null; + this.castSourceIdCosts = null; } /** @@ -467,6 +481,7 @@ public abstract class PlayerImpl implements Player, Serializable { this.alternativeSourceCosts.clear(); this.castSourceIdWithAlternateMana = null; this.castSourceIdManaCosts = null; + this.castSourceIdCosts = null; this.getManaPool().clearEmptyManaPoolRules(); } @@ -663,8 +678,7 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean removeFromHand(Card card, Game game) { - hand.remove(card); - return true; + return hand.remove(card.getId()); } @Override @@ -676,6 +690,12 @@ public abstract class PlayerImpl implements Player, Serializable { return true; } + /** + * + * @param amount + * @param source + * @param game + */ @Override public void discard(int amount, Ability source, Game game) { discard(amount, false, source, game); @@ -765,6 +785,9 @@ public abstract class PlayerImpl implements Player, Serializable { public boolean addAttachment(UUID permanentId, Game game) { if (!this.attachments.contains(permanentId)) { Permanent aura = game.getPermanent(permanentId); + if (aura == null) { + aura = game.getPermanentEntering(permanentId); + } if (aura != null) { if (!game.replaceEvent(new GameEvent(GameEvent.EventType.ENCHANT_PLAYER, playerId, permanentId, aura.getControllerId()))) { this.attachments.add(permanentId); @@ -836,7 +859,7 @@ public abstract class PlayerImpl implements Player, Serializable { if (cards.size() != 0) { if (!anyOrder) { for (UUID objectId : cards) { - moveObjectToLibrary(objectId, source.getSourceId(), game, false, false); + moveObjectToLibrary(objectId, source == null ? null : source.getSourceId(), game, false, false); } } else { TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library (last one chosen will be bottommost)")); @@ -845,11 +868,11 @@ public abstract class PlayerImpl implements Player, Serializable { this.choose(Outcome.Neutral, cards, target, game); UUID targetObjectId = target.getFirstTarget(); cards.remove(targetObjectId); - moveObjectToLibrary(targetObjectId, source.getSourceId(), game, false, false); + moveObjectToLibrary(targetObjectId, source == null ? null : source.getSourceId(), game, false, false); target.clearChosen(); } if (cards.size() == 1) { - moveObjectToLibrary(cards.iterator().next(), source.getSourceId(), game, false, false); + moveObjectToLibrary(cards.iterator().next(), source == null ? null : source.getSourceId(), game, false, false); } } } @@ -867,25 +890,25 @@ public abstract class PlayerImpl implements Player, Serializable { */ @Override public boolean putCardsOnTopOfLibrary(Cards cardsToLibrary, Game game, Ability source, boolean anyOrder) { - Cards cards = new CardsImpl(cardsToLibrary); // prevent possible ConcurrentModificationException - cards.addAll(cardsToLibrary); - if (cards.size() != 0) { + if (!cardsToLibrary.isEmpty()) { + Cards cards = new CardsImpl(cardsToLibrary); // prevent possible ConcurrentModificationException + UUID sourceId = (source == null ? null : source.getSourceId()); if (!anyOrder) { for (UUID cardId : cards) { - moveObjectToLibrary(cardId, source.getSourceId(), game, true, false); + moveObjectToLibrary(cardId, sourceId, game, true, false); } } else { - TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the top of your library (last one chosen will be topmost)")); + TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put on the top of your library (last one chosen will be topmost)")); target.setRequired(true); while (isInGame() && cards.size() > 1) { this.choose(Outcome.Neutral, cards, target, game); UUID targetObjectId = target.getFirstTarget(); cards.remove(targetObjectId); - moveObjectToLibrary(targetObjectId, source.getSourceId(), game, true, false); + moveObjectToLibrary(targetObjectId, sourceId, game, true, false); target.clearChosen(); } if (cards.size() == 1) { - moveObjectToLibrary(cards.iterator().next(), source.getSourceId(), game, true, false); + moveObjectToLibrary(cards.iterator().next(), sourceId, game, true, false); } } } @@ -906,9 +929,10 @@ public abstract class PlayerImpl implements Player, Serializable { } @Override - public void setCastSourceIdWithAlternateMana(UUID sourceId, ManaCosts manaCosts) { + public void setCastSourceIdWithAlternateMana(UUID sourceId, ManaCosts manaCosts, mage.abilities.costs.Costs costs) { castSourceIdWithAlternateMana = sourceId; castSourceIdManaCosts = manaCosts; + castSourceIdCosts = costs; } @Override @@ -916,6 +940,11 @@ public abstract class PlayerImpl implements Player, Serializable { return castSourceIdWithAlternateMana; } + @Override + public Costs getCastSourceIdCosts() { + return castSourceIdCosts; + } + @Override public ManaCosts getCastSourceIdManaCosts() { return castSourceIdManaCosts; @@ -926,6 +955,23 @@ public abstract class PlayerImpl implements Player, Serializable { return payManaMode; } + @Override + public boolean playCard(Card card, Game game, boolean noMana, boolean ignoreTiming) { + if (card == null) { + return false; + } + boolean result; + if (card.getCardType().contains(CardType.LAND)) { + result = playLand(card, game, ignoreTiming); + } else { + result = cast(card.getSpellAbility(), game, noMana); + } + if (result == false) { + game.informPlayer(this, "You can't play " + card.getIdName() + "."); + } + return result; + } + @Override public boolean cast(SpellAbility ability, Game game, boolean noMana) { if (!ability.getSpellAbilityType().equals(SpellAbilityType.BASE)) { @@ -934,27 +980,34 @@ public abstract class PlayerImpl implements Player, Serializable { //20091005 - 601.2a Card card = game.getCard(ability.getSourceId()); if (card != null) { - if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, ability.getId(), ability.getSourceId(), playerId))) { + if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, ability.getId(), ability.getSourceId(), playerId), ability)) { int bookmark = game.bookmarkState(); Zone fromZone = game.getState().getZone(card.getMainCard().getId()); card.cast(game, fromZone, ability, playerId); Spell spell = game.getStack().getSpell(ability.getId()); - // some effects set sourceId to cast without paying mana costs + // some effects set sourceId to cast without paying mana costs or other costs if (ability.getSourceId().equals(getCastSourceIdWithAlternateMana())) { - ManaCosts alternateCosts = getCastSourceIdManaCosts(); Ability spellAbility = spell.getSpellAbility(); + ManaCosts alternateCosts = getCastSourceIdManaCosts(); + Costs costs = getCastSourceIdCosts(); if (alternateCosts == null) { noMana = true; } else { spellAbility.getManaCosts().clear(); - spellAbility.getManaCosts().add(alternateCosts.copy()); spellAbility.getManaCostsToPay().clear(); + spellAbility.getManaCosts().add(alternateCosts.copy()); spellAbility.getManaCostsToPay().add(alternateCosts.copy()); } + spellAbility.getCosts().clear(); + if (costs != null) { + spellAbility.getCosts().addAll(costs); + } } - setCastSourceIdWithAlternateMana(null, null); + setCastSourceIdWithAlternateMana(null, null, null); + GameEvent event = GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, spell.getSpellAbility().getId(), spell.getSpellAbility().getSourceId(), playerId); + game.fireEvent(event); if (spell.activate(game, noMana)) { - GameEvent event = GameEvent.getEvent(GameEvent.EventType.SPELL_CAST, spell.getSpellAbility().getId(), spell.getSpellAbility().getSourceId(), playerId); + event = GameEvent.getEvent(GameEvent.EventType.SPELL_CAST, spell.getSpellAbility().getId(), spell.getSpellAbility().getSourceId(), playerId); event.setZone(fromZone); game.fireEvent(event); if (!game.isSimulation()) { @@ -964,7 +1017,7 @@ public abstract class PlayerImpl implements Player, Serializable { resetStoredBookmark(game); return true; } - game.restoreState(bookmark, ability.getRule()); + restoreState(bookmark, ability.getRule(), game); } } return false; @@ -976,7 +1029,7 @@ public abstract class PlayerImpl implements Player, Serializable { } @Override - public boolean playLand(Card card, Game game) { + public boolean playLand(Card card, Game game, boolean ignoreTiming) { // Check for alternate casting possibilities: e.g. land with Morph ActivatedAbility playLandAbility = null; boolean found = false; @@ -1000,27 +1053,31 @@ public abstract class PlayerImpl implements Player, Serializable { if (playLandAbility == null) { return false; } + //20091005 - 114.2a if (!playLandAbility.canActivate(this.playerId, game)) { return false; } + if (!ignoreTiming && !game.canPlaySorcery(playerId)) { + return false; + } //20091005 - 305.1 if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.PLAY_LAND, card.getId(), card.getId(), playerId))) { // int bookmark = game.bookmarkState(); - Zone zone = game.getState().getZone(card.getId()); - if (card.putOntoBattlefield(game, zone, null, playerId)) { + if (moveCards(card, Zone.BATTLEFIELD, playLandAbility, game, false, false, false, null)) { landsPlayed++; game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LAND_PLAYED, card.getId(), card.getId(), playerId)); game.fireInformEvent(getLogName() + " plays " + card.getLogName()); // game.removeBookmark(bookmark); - resetStoredBookmark(game); + resetStoredBookmark(game); // prevent undo after playing a land return true; } // putOntoBattlefield retured false if putOntoBattlefield was replaced by replacement effect (e.g. Kjeldorian Outpost). // But that would undo the effect completely, // what makes no real sense. So it makes no sense to generally do a restorState here. - // game.restoreState(bookmark); + // restoreState(bookmark, card.getName(), game); } - return false; + // if the to play the land is replaced (e.g. Kjeldoran Outpos and don't sacrificing a Plains) it's a valid satte so returning true here + return true; } protected boolean playManaAbility(ManaAbility ability, Game game) { @@ -1028,13 +1085,17 @@ public abstract class PlayerImpl implements Player, Serializable { int bookmark = game.bookmarkState(); if (ability.activate(game, false)) { if (ability.resolve(game)) { - if (ability.isUndoPossible() && storedBookmark == -1 || storedBookmark > bookmark) { // e.g. usefull for undo Nykthos, Shrine to Nyx - setStoredBookmark(bookmark); + if (ability.isUndoPossible()) { + if (storedBookmark == -1 || storedBookmark > bookmark) { // e.g. usefull for undo Nykthos, Shrine to Nyx + setStoredBookmark(bookmark); + } + } else { + resetStoredBookmark(game); } return true; } } - game.restoreState(bookmark, ability.getRule()); + restoreState(bookmark, ability.getRule(), game); } return false; } @@ -1055,7 +1116,7 @@ public abstract class PlayerImpl implements Player, Serializable { resetStoredBookmark(game); return true; } - game.restoreState(bookmark, ability.getRule()); + restoreState(bookmark, ability.getRule(), game); } } else { int bookmark = game.bookmarkState(); @@ -1065,7 +1126,7 @@ public abstract class PlayerImpl implements Player, Serializable { resetStoredBookmark(game); return true; } - game.restoreState(bookmark, ability.getRule()); + restoreState(bookmark, ability.getRule(), game); } return false; } @@ -1085,11 +1146,18 @@ public abstract class PlayerImpl implements Player, Serializable { return true; } } - game.restoreState(bookmark, action.getRule()); + restoreState(bookmark, action.getRule(), game); } return false; } + protected void restoreState(int bookmark, String text, Game game) { + game.restoreState(bookmark, text); + if (storedBookmark >= bookmark) { + resetStoredBookmark(game); + } + } + @Override public boolean activateAbility(ActivatedAbility ability, Game game) { boolean result; @@ -1098,9 +1166,8 @@ public abstract class PlayerImpl implements Player, Serializable { return true; } if (ability instanceof PlayLandAbility) { - Card card = game.getCard(ability.getSourceId()); - result = playLand(card, game); + result = playLand(card, game, false); } else { if (!ability.canActivate(this.playerId, game)) { return false; @@ -1122,7 +1189,13 @@ public abstract class PlayerImpl implements Player, Serializable { } //if player has taken an action then reset all player passed flags + justActivatedType = null; if (result) { + if (isHuman() && (ability.getAbilityType().equals(AbilityType.SPELL) || ability.getAbilityType().equals(AbilityType.ACTIVATED))) { + if (ability.isUsesStack()) { // if the ability does not use the stack (e.g. Suspend) auto pass would go to next phase unintended + setJustActivatedType(ability.getAbilityType()); + } + } game.getPlayers().resetPassed(); } return result; @@ -1156,7 +1229,7 @@ public abstract class PlayerImpl implements Player, Serializable { return true; } } - game.restoreState(bookmark, source.getRule()); // why restore is needed here? + restoreState(bookmark, source.getRule(), game); // why restore is needed here? (to remove the triggered ability from the stack) return false; } @@ -1187,11 +1260,19 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public LinkedHashMap getUseableActivatedAbilities(MageObject object, Zone zone, Game game) { LinkedHashMap useable = new LinkedHashMap<>(); - if (!(object instanceof Permanent) || ((Permanent) object).canUseActivatedAbilities(game)) { - for (Ability ability : object.getAbilities()) { + boolean canUse = !(object instanceof Permanent) || ((Permanent) object).canUseActivatedAbilities(game); + ManaOptions availableMana = null; +// ManaOptions availableMana = getManaAvailable(game); // can only be activated if mana calculation works flawless otherwise player can't play spells they could play if calculation would work correctly +// availableMana.addMana(manaPool.getMana()); + for (Ability ability : object.getAbilities()) { + if (canUse || ability.getAbilityType().equals(AbilityType.SPECIAL_ACTION)) { if (ability.getZone().match(zone)) { if (ability instanceof ActivatedAbility) { - if (((ActivatedAbility) ability).canActivate(playerId, game)) { + if (ability instanceof ManaAbility) { + if (((ActivatedAbility) ability).canActivate(playerId, game)) { + useable.put(ability.getId(), (ActivatedAbility) ability); + } + } else if (canPlay(((ActivatedAbility) ability), availableMana, object, game)) { useable.put(ability.getId(), (ActivatedAbility) ability); } } else if (ability instanceof AlternativeSourceCosts) { @@ -1205,16 +1286,20 @@ public abstract class PlayerImpl implements Player, Serializable { } } } - if (zone != Zone.HAND) { - if (Zone.GRAVEYARD.equals(zone) && canPlayCardsFromGraveyard()) { - for (ActivatedAbility ability : object.getAbilities().getPlayableAbilities(Zone.HAND)) { + } + if (zone != Zone.HAND) { + if (Zone.GRAVEYARD.equals(zone) && canPlayCardsFromGraveyard()) { + for (ActivatedAbility ability : object.getAbilities().getPlayableAbilities(Zone.HAND)) { + if (canUse || ability.getAbilityType().equals(AbilityType.SPECIAL_ACTION)) { if (ability.canActivate(playerId, game)) { useable.put(ability.getId(), ability); } } } - if (zone != Zone.BATTLEFIELD && game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, this.getId(), game)) { - for (Ability ability : object.getAbilities()) { + } + if (zone != Zone.BATTLEFIELD && game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, this.getId(), game)) { + for (Ability ability : object.getAbilities()) { + if (canUse || ability.getAbilityType().equals(AbilityType.SPECIAL_ACTION)) { ability.setControllerId(this.getId()); if (ability instanceof ActivatedAbility && ability.getZone().match(Zone.HAND) && ((ActivatedAbility) ability).canActivate(playerId, game)) { @@ -1223,8 +1308,9 @@ public abstract class PlayerImpl implements Player, Serializable { } } } - getOtherUseableActivatedAbilities(object, zone, game, useable); } + getOtherUseableActivatedAbilities(object, zone, game, useable); + return useable; } @@ -1232,49 +1318,52 @@ public abstract class PlayerImpl implements Player, Serializable { private void getOtherUseableActivatedAbilities(MageObject object, Zone zone, Game game, Map useable) { Abilities otherAbilities = game.getState().getActivatedOtherAbilities(object.getId(), zone); if (otherAbilities != null) { + boolean canUse = !(object instanceof Permanent) || ((Permanent) object).canUseActivatedAbilities(game); for (ActivatedAbility ability : otherAbilities) { - Card card = game.getCard(ability.getSourceId()); - if (card.isSplitCard() && ability instanceof FlashbackAbility) { - FlashbackAbility flashbackAbility; - // Left Half - if (card.getCardType().contains(CardType.INSTANT)) { - flashbackAbility = new FlashbackAbility(((SplitCard) card).getLeftHalfCard().getManaCost(), TimingRule.INSTANT); - } else { - flashbackAbility = new FlashbackAbility(((SplitCard) card).getLeftHalfCard().getManaCost(), TimingRule.SORCERY); - } - flashbackAbility.setSourceId(card.getId()); - flashbackAbility.setControllerId(card.getOwnerId()); - flashbackAbility.setSpellAbilityType(SpellAbilityType.SPLIT_LEFT); - flashbackAbility.setAbilityName(((SplitCard) card).getLeftHalfCard().getName()); - if (flashbackAbility.canActivate(playerId, game)) { - useable.put(flashbackAbility.getId(), flashbackAbility); - } - // Right Half - if (card.getCardType().contains(CardType.INSTANT)) { - flashbackAbility = new FlashbackAbility(((SplitCard) card).getRightHalfCard().getManaCost(), TimingRule.INSTANT); - } else { - flashbackAbility = new FlashbackAbility(((SplitCard) card).getRightHalfCard().getManaCost(), TimingRule.SORCERY); - } - flashbackAbility.setSourceId(card.getId()); - flashbackAbility.setControllerId(card.getOwnerId()); - flashbackAbility.setSpellAbilityType(SpellAbilityType.SPLIT_RIGHT); - flashbackAbility.setAbilityName(((SplitCard) card).getRightHalfCard().getName()); - if (flashbackAbility.canActivate(playerId, game)) { - useable.put(flashbackAbility.getId(), flashbackAbility); - } + if (canUse || ability.getAbilityType().equals(AbilityType.SPECIAL_ACTION)) { + Card card = game.getCard(ability.getSourceId()); + if (card.isSplitCard() && ability instanceof FlashbackAbility) { + FlashbackAbility flashbackAbility; + // Left Half + if (card.getCardType().contains(CardType.INSTANT)) { + flashbackAbility = new FlashbackAbility(((SplitCard) card).getLeftHalfCard().getManaCost(), TimingRule.INSTANT); + } else { + flashbackAbility = new FlashbackAbility(((SplitCard) card).getLeftHalfCard().getManaCost(), TimingRule.SORCERY); + } + flashbackAbility.setSourceId(card.getId()); + flashbackAbility.setControllerId(card.getOwnerId()); + flashbackAbility.setSpellAbilityType(SpellAbilityType.SPLIT_LEFT); + flashbackAbility.setAbilityName(((SplitCard) card).getLeftHalfCard().getName()); + if (flashbackAbility.canActivate(playerId, game)) { + useable.put(flashbackAbility.getId(), flashbackAbility); + } + // Right Half + if (card.getCardType().contains(CardType.INSTANT)) { + flashbackAbility = new FlashbackAbility(((SplitCard) card).getRightHalfCard().getManaCost(), TimingRule.INSTANT); + } else { + flashbackAbility = new FlashbackAbility(((SplitCard) card).getRightHalfCard().getManaCost(), TimingRule.SORCERY); + } + flashbackAbility.setSourceId(card.getId()); + flashbackAbility.setControllerId(card.getOwnerId()); + flashbackAbility.setSpellAbilityType(SpellAbilityType.SPLIT_RIGHT); + flashbackAbility.setAbilityName(((SplitCard) card).getRightHalfCard().getName()); + if (flashbackAbility.canActivate(playerId, game)) { + useable.put(flashbackAbility.getId(), flashbackAbility); + } - } else { - useable.put(ability.getId(), ability); + } else { + useable.put(ability.getId(), ability); + } } - } } } protected LinkedHashMap getUseableManaAbilities(MageObject object, Zone zone, Game game) { LinkedHashMap useable = new LinkedHashMap<>(); - if (!(object instanceof Permanent) || ((Permanent) object).canUseActivatedAbilities(game)) { - for (ManaAbility ability : object.getAbilities().getManaAbilities(zone)) { + boolean canUse = !(object instanceof Permanent) || ((Permanent) object).canUseActivatedAbilities(game); + for (ManaAbility ability : object.getAbilities().getManaAbilities(zone)) { + if (canUse || ability.getAbilityType().equals(AbilityType.SPECIAL_ACTION)) { if (ability.canActivate(playerId, game)) { useable.put(ability.getId(), ability); } @@ -1352,6 +1441,17 @@ public abstract class PlayerImpl implements Player, Serializable { //20091005 - 502.1 List phasedOut = game.getBattlefield().getPhasedOut(playerId); for (Permanent permanent : game.getBattlefield().getPhasedIn(playerId)) { + // 502.15i When a permanent phases out, any local enchantments or Equipment + // attached to that permanent phase out at the same time. This alternate way of + // phasing out is known as phasing out "indirectly." An enchantment or Equipment + // that phased out indirectly won't phase in by itself, but instead phases in + // along with the card it's attached to. + for (UUID attachmentId : permanent.getAttachments()) { + Permanent attachment = game.getPermanent(attachmentId); + if (attachment != null) { + attachment.phaseOut(game); + } + } permanent.phaseOut(game); } for (Permanent permanent : phasedOut) { @@ -1408,7 +1508,7 @@ public abstract class PlayerImpl implements Player, Serializable { StringBuilder sb = new StringBuilder(message).append(" to untap").append(" (").append(Math.min(leftForUntap.size(), numberToUntap)).append(" in total"); MageObject effectSource = game.getObject(ability.getSourceId()); if (effectSource != null) { - sb.append(" from ").append(effectSource.getLogName()).toString(); + sb.append(" from ").append(effectSource.getLogName()); } sb.append(")"); filter.setMessage(sb.toString()); @@ -1823,6 +1923,15 @@ public abstract class PlayerImpl implements Player, Serializable { this.passed = this.loses || this.hasLeft(); } + @Override + public void resetPlayerPassedActions() { + this.passedAllTurns = false; + this.passedTurn = false; + this.passedUntilEndOfTurn = false; + this.passedUntilNextMain = false; + this.passedUntilStackResolved = false; + } + @Override public void quit(Game game) { quit = true; @@ -1855,7 +1964,7 @@ public abstract class PlayerImpl implements Player, Serializable { } @Override - public void sendPlayerAction(PlayerAction playerAction, Game game) { + public void sendPlayerAction(PlayerAction playerAction, Game game, Object data) { switch (playerAction) { case PASS_PRIORITY_UNTIL_MY_NEXT_TURN: // F9 passedUntilNextMain = false; @@ -2239,6 +2348,14 @@ public abstract class PlayerImpl implements Player, Serializable { return result; } + /** + * + * @param ability + * @param available if null, it won't be checked if enough mana is available + * @param sourceObject + * @param game + * @return + */ protected boolean canPlay(ActivatedAbility ability, ManaOptions available, MageObject sourceObject, Game game) { if (!(ability instanceof ManaAbility)) { ActivatedAbility copy = ability.copy(); @@ -2259,15 +2376,26 @@ public abstract class PlayerImpl implements Player, Serializable { } } } - - ManaOptions abilityOptions = copy.getManaCostsToPay().getOptions(); - if (abilityOptions.size() == 0) { - return true; - } else { - for (Mana mana : abilityOptions) { - for (Mana avail : available) { - if (mana.enough(avail)) { - return true; + boolean canBeCastRegularly = true; + if (copy instanceof SpellAbility && copy.getManaCosts().isEmpty() && copy.getCosts().isEmpty()) { + // 117.6. Some mana costs contain no mana symbols. This represents an unpayable cost... + // 117.6a (...) If an alternative cost is applied to an unpayable cost, + // including an effect that allows a player to cast a spell without paying its mana cost, the alternative cost may be paid. + canBeCastRegularly = false; + } + if (canBeCastRegularly) { + ManaOptions abilityOptions = copy.getManaCostsToPay().getOptions(); + if (abilityOptions.size() == 0) { + return true; + } else { + if (available == null) { + return true; + } + for (Mana mana : abilityOptions) { + for (Mana avail : available) { + if (mana.enough(avail)) { + return true; + } } } } @@ -2311,6 +2439,9 @@ public abstract class PlayerImpl implements Player, Serializable { if (manaCosts.size() == 0) { return true; } else { + if (available == null) { + return true; + } for (Mana mana : manaCosts.getOptions()) { for (Mana avail : available) { if (mana.enough(avail)) { @@ -2619,7 +2750,8 @@ public abstract class PlayerImpl implements Player, Serializable { for (Mode mode : option.getModes().values()) { Ability newOption = option.copy(); newOption.getModes().getSelectedModes().clear(); - newOption.getModes().setMode(mode); + newOption.getModes().getSelectedModes().add(mode); + newOption.getModes().setActiveMode(mode); if (newOption.getTargets().getUnchosen().size() > 0) { if (newOption.getManaCosts().getVariableCosts().size() > 0) { addVariableXOptions(options, newOption, 0, game); @@ -2817,11 +2949,15 @@ public abstract class PlayerImpl implements Player, Serializable { } @Override - public void revealFaceDownCard(Card card, Game game) { - if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.REVEAL_FACE_DOWN, this.getId(), game)) { - Cards cards = new CardsImpl(card); - this.revealCards(getName(), cards, game); + public boolean lookAtFaceDownCard(Card card, Game game) { + if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.LOOK_AT_FACE_DOWN, this.getId(), game)) { + if (chooseUse(Outcome.Benefit, "Look at that card?", null, game)) { + Cards cards = new CardsImpl(card); + this.lookAtCards(getName(), cards, game); + return true; + } } + return false; } @Override @@ -2876,90 +3012,191 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game) { - return moveCards(cards, fromZone, toZone, source, game, true); - } - - @Override - public boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game, boolean withName) { + if (cards.isEmpty()) { + return true; + } Set cardList = new HashSet<>(); for (UUID cardId : cards) { - if (fromZone == null) { - fromZone = game.getState().getZone(cardId); - } - if (fromZone.equals(Zone.BATTLEFIELD)) { + fromZone = game.getState().getZone(cardId); + if (Zone.BATTLEFIELD.equals(fromZone)) { Permanent permanent = game.getPermanent(cardId); if (permanent != null) { cardList.add(permanent); } } else { Card card = game.getCard(cardId); + if (card == null) { + Spell spell = game.getState().getStack().getSpell(cardId); + if (spell != null) { + if (!spell.isCopy()) { + card = spell.getCard(); + } else { + // If a spell is returned to its owner's hand, it's removed from the stack and thus will not resolve + game.getStack().remove(spell); + game.informPlayers(spell.getLogName() + " was removed from the stack"); + } + } + } if (card != null) { cardList.add(card); } } } - return moveCards(cardList, fromZone, toZone, source, game, withName); + return moveCards(cardList, fromZone, toZone, source, game); } @Override public boolean moveCards(Card card, Zone fromZone, Zone toZone, Ability source, Game game) { - return moveCards(card, fromZone, toZone, source, game, true); - } - - @Override - public boolean moveCards(Card card, Zone fromZone, Zone toZone, Ability source, Game game, boolean withName) { Set cardList = new HashSet<>(); if (card != null) { cardList.add(card); } - return moveCards(cardList, fromZone, toZone, source, game, withName); + return moveCards(cardList, fromZone, toZone, source, game); } @Override public boolean moveCards(Set cards, Zone fromZone, Zone toZone, Ability source, Game game) { - return moveCards(cards, fromZone, toZone, source, game, true); + return moveCards(cards, toZone, source, game, false, false, false, null); } @Override - public boolean moveCards(Set cards, Zone fromZone, Zone toZone, Ability source, Game game, boolean withName) { + public boolean moveCards(Card card, Zone toZone, Ability source, Game game) { + return moveCards(card, toZone, source, game, false, false, false, null); + } + + @Override + public boolean moveCards(Card card, Zone toZone, Ability source, Game game, boolean tapped, boolean faceDown, boolean byOwner, ArrayList appliedEffects) { + Set cardList = new HashSet<>(); + if (card != null) { + cardList.add(card); + } + return moveCards(cardList, toZone, source, game, tapped, faceDown, byOwner, appliedEffects); + } + + @Override + public boolean moveCards(Cards cards, Zone toZone, Ability source, Game game) { + return moveCards(cards.getCards(game), toZone, source, game); + } + + @Override + public boolean moveCards(Set cards, Zone toZone, Ability source, Game game) { + return moveCards(cards, toZone, source, game, false, false, false, null); + } + + @Override + public boolean moveCards(Set cards, Zone toZone, Ability source, Game game, boolean tapped, boolean faceDown, boolean byOwner, ArrayList appliedEffects) { if (cards.isEmpty()) { return true; } - game.fireEvent(new ZoneChangeGroupEvent(cards, source == null ? null : source.getSourceId(), this.getId(), fromZone, toZone)); + Set successfulMovedCards = new LinkedHashSet<>(); + Zone fromZone = null; switch (toZone) { - case EXILED: - boolean result = false; - for (Card card : cards) { - fromZone = game.getState().getZone(card.getId()); - result |= moveCardToExileWithInfo(card, null, "", source == null ? null : source.getSourceId(), game, fromZone, withName); - } - return result; case GRAVEYARD: - return moveCardsToGraveyardWithInfo(cards, source, game, fromZone); + fromZone = game.getState().getZone(cards.iterator().next().getId()); + successfulMovedCards = moveCardsToGraveyardWithInfo(cards, source, game, fromZone); + return successfulMovedCards.size() > 0; + case BATTLEFIELD: // new logic that does not yet add the permanents to battlefield while replacement effects are handled + List permanents = new ArrayList<>(); + List permanentsEntered = new ArrayList<>(); + for (Card card : cards) { + UUID controllingPlayerId = byOwner ? card.getOwnerId() : getId(); + fromZone = game.getState().getZone(card.getId()); + if (faceDown) { + card.setFaceDown(true, game); + } + ZoneChangeEvent event = new ZoneChangeEvent(card.getId(), source.getSourceId(), controllingPlayerId, fromZone, Zone.BATTLEFIELD, appliedEffects, tapped); + if (!game.replaceEvent(event)) { + // get permanent + Permanent permanent = new PermanentCard(card, event.getPlayerId(), game);// controlling player can be replaced so use event player now + permanents.add(permanent); + game.getPermanentsEntering().put(permanent.getId(), permanent); + card.checkForCountersToAdd(permanent, game); + permanent.setTapped(tapped); + permanent.setFaceDown(faceDown, game); + } + if (faceDown) { + card.setFaceDown(false, game); + } + } + game.setScopeRelevant(true); + for (Permanent permanent : permanents) { + fromZone = game.getState().getZone(permanent.getId()); + // make sure the controller of all continuous effects of this card are switched to the current controller + game.getContinuousEffects().setController(permanent.getId(), permanent.getControllerId()); + if (permanent.entersBattlefield(source.getSourceId(), game, fromZone, true)) { + permanentsEntered.add(permanent); + } else { + // revert controller to owner if permanent does not enter + game.getContinuousEffects().setController(permanent.getId(), permanent.getOwnerId()); + game.getPermanentsEntering().remove(permanent.getId()); + } + } + game.setScopeRelevant(false); + for (Permanent permanent : permanentsEntered) { + fromZone = game.getState().getZone(permanent.getId()); + if (((Card) permanent).removeFromZone(game, fromZone, source.getSourceId())) { + permanent.updateZoneChangeCounter(game); + game.addPermanent(permanent); + permanent.setZone(Zone.BATTLEFIELD, game); + game.getPermanentsEntering().remove(permanent.getId()); + successfulMovedCards.add(permanent); + game.addSimultaneousEvent(new ZoneChangeEvent(permanent, permanent.getControllerId(), fromZone, Zone.BATTLEFIELD)); + if (!game.isSimulation()) { + game.informPlayers(this.getLogName() + " puts " + (faceDown ? "a card face down " : permanent.getLogName()) + + " from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + " onto the Battlefield"); + } + } else { + game.getPermanentsEntering().remove(permanent.getId()); + } + } + game.applyEffects(); + break; case HAND: - result = false; for (Card card : cards) { fromZone = game.getState().getZone(card.getId()); - result |= moveCardToHandWithInfo(card, source == null ? null : source.getSourceId(), game, withName); + boolean hideCard = fromZone.equals(Zone.LIBRARY) + || (card.isFaceDown(game) && !fromZone.equals(Zone.STACK) && !fromZone.equals(Zone.BATTLEFIELD)); + if (moveCardToHandWithInfo(card, source == null ? null : source.getSourceId(), game, !hideCard)) { + successfulMovedCards.add(card); + } } - return result; - case BATTLEFIELD: - result = false; + break; + case EXILED: for (Card card : cards) { fromZone = game.getState().getZone(card.getId()); - result |= putOntoBattlefieldWithInfo(card, game, fromZone, source == null ? null : source.getSourceId(), false, !withName); + boolean withName = (fromZone.equals(Zone.BATTLEFIELD) || fromZone.equals(Zone.STACK)) || !card.isFaceDown(game); + if (moveCardToExileWithInfo(card, null, "", source == null ? null : source.getSourceId(), game, fromZone, withName)) { + successfulMovedCards.add(card); + } } - return result; + break; case LIBRARY: - result = false; for (Card card : cards) { - fromZone = game.getState().getZone(card.getId()); - result |= moveCardToLibraryWithInfo(card, source == null ? null : source.getSourceId(), game, fromZone, true, withName); + if (card instanceof Spell) { + fromZone = game.getState().getZone(((Spell) card).getSourceId()); + } else { + fromZone = game.getState().getZone(card.getId()); + } + boolean hideCard = fromZone.equals(Zone.HAND) || fromZone.equals(Zone.LIBRARY); + if (moveCardToLibraryWithInfo(card, source == null ? null : source.getSourceId(), game, fromZone, true, !hideCard)) { + successfulMovedCards.add(card); + } } - return result; + break; default: - throw new UnsupportedOperationException("to Zone not supported yet"); + throw new UnsupportedOperationException("to Zone" + toZone.toString() + " not supported yet"); } + if (!successfulMovedCards.isEmpty()) { + game.fireEvent(new ZoneChangeGroupEvent(successfulMovedCards, source == null ? null : source.getSourceId(), this.getId(), fromZone, toZone)); + } + return successfulMovedCards.size() > 0; + } + + @Override + public boolean moveCardsToExile(Card card, Ability source, Game game, boolean withName, UUID exileId, String exileZoneName) { + Set cards = new HashSet<>(); + cards.add(card); + return moveCardsToExile(cards, source, game, withName, exileId, exileZoneName); } @Override @@ -2985,22 +3222,19 @@ public abstract class PlayerImpl implements Player, Serializable { public boolean moveCardToHandWithInfo(Card card, UUID sourceId, Game game, boolean withName) { boolean result = false; Zone fromZone = game.getState().getZone(card.getId()); + if (fromZone.equals(Zone.BATTLEFIELD) && !(card instanceof Permanent)) { + card = game.getPermanent(card.getId()); + } if (card.moveToZone(Zone.HAND, sourceId, game, false)) { if (card instanceof PermanentCard) { card = game.getCard(card.getId()); } if (!game.isSimulation()) { - StringBuilder sb = new StringBuilder(this.getLogName()).append(" puts ").append(withName ? card.getLogName() : (card.isFaceDown(game) ? "a face down card" : "a card")); - switch (fromZone) { - case EXILED: - sb.append(" from exile zone "); - break; - default: - sb.append(fromZone != null ? new StringBuilder(" from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" ") : ""); - break; - } - sb.append(card.getOwnerId().equals(this.getId()) ? "into his or her hand" : "into its owner's hand"); - game.informPlayers(sb.toString()); + game.informPlayers(this.getLogName() + " puts " + + (withName ? card.getLogName() : (card.isFaceDown(game) ? "a face down card" : "a card")) + + " from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + " " + + (card.getOwnerId().equals(this.getId()) ? "into his or her hand" : "into its owner's hand") + ); } result = true; } @@ -3008,9 +3242,9 @@ public abstract class PlayerImpl implements Player, Serializable { } @Override - public boolean moveCardsToGraveyardWithInfo(Set allCards, Ability source, Game game, Zone fromZone) { - boolean result = true; + public Set moveCardsToGraveyardWithInfo(Set allCards, Ability source, Game game, Zone fromZone) { UUID sourceId = source == null ? null : source.getSourceId(); + Set movedCards = new LinkedHashSet<>(); while (!allCards.isEmpty()) { // identify cards from one owner Cards cards = new CardsImpl(); @@ -3050,21 +3284,29 @@ public abstract class PlayerImpl implements Player, Serializable { cards.remove(targetObjectId); if (card != null) { fromZone = game.getState().getZone(card.getId()); - result &= choosingPlayer.moveCardToGraveyardWithInfo(card, sourceId, game, fromZone); + if (choosingPlayer.moveCardToGraveyardWithInfo(card, sourceId, game, fromZone)) { + movedCards.add(card); + } } target.clearChosen(); } if (cards.size() == 1) { - result &= choosingPlayer.moveCardToGraveyardWithInfo(cards.getCards(game).iterator().next(), sourceId, game, fromZone); + Card card = cards.getCards(game).iterator().next(); + if (card != null && choosingPlayer.moveCardToGraveyardWithInfo(card, sourceId, game, fromZone)) { + movedCards.add(card); + } } } else { for (Card card : cards.getCards(game)) { - result &= choosingPlayer.moveCardToGraveyardWithInfo(card, sourceId, game, fromZone); + if (choosingPlayer.moveCardToGraveyardWithInfo(card, sourceId, game, fromZone)) { + movedCards.add(card); + } } } } } - return result; + game.fireEvent(new ZoneChangeGroupEvent(movedCards, source == null ? null : source.getSourceId(), this.getId(), fromZone, Zone.GRAVEYARD)); + return movedCards; } @Override @@ -3077,7 +3319,7 @@ public abstract class PlayerImpl implements Player, Serializable { card = game.getCard(card.getId()); } StringBuilder sb = new StringBuilder(this.getLogName()) - .append(" puts ").append(card.getLogName()).append(" ") + .append(" puts ").append(card.getLogName()).append(" ").append(card.isCopy() ? "(Copy) " : "") .append(fromZone != null ? "from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + " " : ""); if (card.getOwnerId().equals(getId())) { sb.append("into his or her graveyard"); @@ -3130,7 +3372,13 @@ public abstract class PlayerImpl implements Player, Serializable { if (card.moveToExile(exileId, exileName, sourceId, game)) { if (!game.isSimulation()) { if (card instanceof PermanentCard) { - card = game.getCard(card.getId()); + // in case it's face down or name was changed by copying from other permanent + Card basicCard = game.getCard(card.getId()); + if (basicCard != null) { + card = basicCard; + } else { + logger.error("Couldn't get the card object for the PermanenCard named " + card.getName()); + } } game.informPlayers(this.getLogName() + " moves " + (withName ? card.getLogName() : "a card face down") + " " + (fromZone != null ? "from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + " " : "") + "to the exile zone"); @@ -3140,31 +3388,6 @@ public abstract class PlayerImpl implements Player, Serializable { return result; } - @Override - public boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId) { - return this.putOntoBattlefieldWithInfo(card, game, fromZone, sourceId, false, false); - } - - @Override - public boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId, boolean tapped) { - return this.putOntoBattlefieldWithInfo(card, game, fromZone, sourceId, tapped, false); - } - - @Override - public boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId, boolean tapped, boolean facedown) { - boolean result = false; - if (card.putOntoBattlefield(game, fromZone, sourceId, this.getId(), tapped, facedown)) { - if (!game.isSimulation()) { - game.informPlayers(new StringBuilder(this.getLogName()) - .append(" puts ").append(facedown ? "a card face down " : card.getLogName()) - .append(" from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" ") - .append("onto the Battlefield").toString()); - } - result = true; - } - return result; - } - @Override public boolean hasOpponent(UUID playerToCheckId, Game game) { return !this.getId().equals(playerToCheckId) && game.isOpponent(this, playerToCheckId); @@ -3200,6 +3423,16 @@ public abstract class PlayerImpl implements Player, Serializable { return passedUntilStackResolved; } + @Override + public AbilityType getJustActivatedType() { + return justActivatedType; + } + + @Override + public void setJustActivatedType(AbilityType justActivatedType) { + this.justActivatedType = justActivatedType; + } + @Override public void revokePermissionToSeeHandCards() { usersAllowedToSeeHandCards.clear(); @@ -3239,4 +3472,33 @@ public abstract class PlayerImpl implements Player, Serializable { public void abortReset() { abort = false; } + + @Override + public boolean scry(int value, Ability source, Game game) { + game.informPlayers(getLogName() + " scries " + value); + Cards cards = new CardsImpl(); + cards.addAll(getLibrary().getTopCards(game, value)); + if (!cards.isEmpty()) { + String text; + if (cards.size() == 1) { + text = "card if you want to put it to the bottom of your library (Scry)"; + } else { + text = "cards you want to put on the bottom of your library (Scry)"; + } + TargetCard target = new TargetCard(0, cards.size(), Zone.LIBRARY, new FilterCard(text)); + chooseTarget(Outcome.Benefit, cards, target, source, game); + putCardsOnBottomOfLibrary(new CardsImpl(target.getTargets()), game, source, true); + cards.removeAll(target.getTargets()); + putCardsOnTopOfLibrary(cards, game, source, true); + } + game.fireEvent(new GameEvent(GameEvent.EventType.SCRY, getId(), source == null ? null : source.getSourceId(), getId(), value, true)); + return true; + } + + @Override + public boolean addTargets(Ability ability, Game game) { + // only used for TestPlayer to preSet Targets + return true; + } + } diff --git a/Mage/src/mage/players/net/UserData.java b/Mage/src/mage/players/net/UserData.java index cb405e34dff..c2c3b2a3bb4 100644 --- a/Mage/src/mage/players/net/UserData.java +++ b/Mage/src/mage/players/net/UserData.java @@ -19,10 +19,14 @@ public class UserData implements Serializable { protected boolean askMoveToGraveOrder; protected boolean manaPoolAutomatic; protected boolean manaPoolAutomaticRestricted; + protected boolean passPriorityCast; + protected boolean passPriorityActivation; + protected boolean autoOrderTrigger; public UserData(UserGroup userGroup, int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, - String flagName, boolean askMoveToGraveOrder, boolean manaPoolAutomatic, boolean manaPoolAutomaticRestricted) { + String flagName, boolean askMoveToGraveOrder, boolean manaPoolAutomatic, boolean manaPoolAutomaticRestricted, + boolean passPriorityCast, boolean passPriorityActivation, boolean autoOrderTrigger) { this.groupId = userGroup.getGroupId(); this.avatarId = avatarId; this.showAbilityPickerForced = showAbilityPickerForced; @@ -33,6 +37,9 @@ public class UserData implements Serializable { this.askMoveToGraveOrder = askMoveToGraveOrder; this.manaPoolAutomatic = manaPoolAutomatic; this.manaPoolAutomaticRestricted = manaPoolAutomaticRestricted; + this.passPriorityCast = passPriorityCast; + this.passPriorityActivation = passPriorityActivation; + this.autoOrderTrigger = autoOrderTrigger; } public void update(UserData userData) { @@ -46,10 +53,13 @@ public class UserData implements Serializable { this.askMoveToGraveOrder = userData.askMoveToGraveOrder; this.manaPoolAutomatic = userData.manaPoolAutomatic; this.manaPoolAutomaticRestricted = userData.manaPoolAutomaticRestricted; + this.passPriorityCast = userData.passPriorityCast; + this.passPriorityActivation = userData.passPriorityActivation; + this.autoOrderTrigger = userData.autoOrderTrigger; } public static UserData getDefaultUserDataView() { - return new UserData(UserGroup.DEFAULT, 0, false, false, true, null, "world.png", false, true, true); + return new UserData(UserGroup.DEFAULT, 0, false, false, true, null, getDefaultFlagName(), false, true, true, false, false, false); } public void setGroupId(int groupId) { @@ -132,4 +142,31 @@ public class UserData implements Serializable { this.manaPoolAutomaticRestricted = manaPoolAutomaticRestricted; } + public boolean isPassPriorityCast() { + return passPriorityCast; + } + + public void setPassPriorityCast(boolean passPriorityCast) { + this.passPriorityCast = passPriorityCast; + } + + public boolean isPassPriorityActivation() { + return passPriorityActivation; + } + + public void setPassPriorityActivation(boolean passPriorityActivation) { + this.passPriorityActivation = passPriorityActivation; + } + + public boolean isAutoOrderTrigger() { + return autoOrderTrigger; + } + + public void setAutoOrderTrigger(boolean autoOrderTrigger) { + this.autoOrderTrigger = autoOrderTrigger; + } + + public static String getDefaultFlagName() { + return "world.png"; + } } diff --git a/Mage/src/mage/target/Target.java b/Mage/src/mage/target/Target.java index 0ac5a3c43ba..80b977f4eed 100644 --- a/Mage/src/mage/target/Target.java +++ b/Mage/src/mage/target/Target.java @@ -1,43 +1,41 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.target; -import mage.constants.Outcome; -import mage.constants.Zone; -import mage.abilities.Ability; -import mage.filter.Filter; -import mage.game.Game; - import java.io.Serializable; import java.util.List; import java.util.Set; import java.util.UUID; +import mage.abilities.Ability; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.game.Game; import mage.players.Player; /** @@ -47,69 +45,114 @@ import mage.players.Player; public interface Target extends Serializable { boolean isChosen(); + boolean doneChosing(); + void clearChosen(); + boolean isNotTarget(); /** - * controlls if it will be checked, if the target can be targeted from source - * @param notTarget true = do not check for protection, false = check for protection + * controlls if it will be checked, if the target can be targeted from + * source + * + * @param notTarget true = do not check for protection, false = check for + * protection */ void setNotTarget(boolean notTarget); // methods for targets boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game); + Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game); + boolean chooseTarget(Outcome outcome, UUID playerId, Ability source, Game game); + void addTarget(UUID id, Ability source, Game game); + void addTarget(UUID id, int amount, Ability source, Game game); + void addTarget(UUID id, Ability source, Game game, boolean skipEvent); + void addTarget(UUID id, int amount, Ability source, Game game, boolean skipEvent); + boolean canTarget(UUID id, Game game); + boolean canTarget(UUID id, Ability source, Game game); - boolean canTarget(UUID playerId, UUID id, Ability source, Game game); + + boolean canTarget(UUID playerId, UUID id, Ability source, Game game); + boolean isLegal(Ability source, Game game); + List getTargetOptions(Ability source, Game game); //methods for non-targets boolean canChoose(UUID sourceControllerId, Game game); + Set possibleTargets(UUID sourceControllerId, Game game); + boolean choose(Outcome outcome, UUID playerId, UUID sourceId, Game game); + void add(UUID id, Game game); + void remove(UUID targetId); + void updateTarget(UUID targetId, Game game); String getMessage(); + String getTargetName(); + void setTargetName(String name); + String getTargetedName(Game game); + Zone getZone(); int getTargetAmount(UUID targetId); + int getNumberOfTargets(); + int getMaxNumberOfTargets(); + void setMinNumberOfTargets(int minNumberofTargets); + void setMaxNumberOfTargets(int maxNumberofTargets); - + List getTargets(); + Filter getFilter(); boolean isRequired(); + boolean isRequired(UUID sourceId, Game game); + boolean isRequired(Ability ability); + void setRequired(boolean required); + boolean isRequiredExplicitlySet(); + boolean isRandom(); + void setRandom(boolean atRandom); UUID getFirstTarget(); Target copy(); - + // some targets are choosen from players that are not the controller of the ability (e.g. Pandemonium) void setTargetController(UUID playerId); + UUID getTargetController(); + void setAbilityController(UUID playerId); + UUID getAbilityController(); + Player getTargetController(Game game, UUID playerId); -} + + int getTargetTag(); + + void setTargetTag(int tag); +} diff --git a/Mage/src/mage/target/TargetImpl.java b/Mage/src/mage/target/TargetImpl.java index aa4b2a27047..df09789ca13 100644 --- a/Mage/src/mage/target/TargetImpl.java +++ b/Mage/src/mage/target/TargetImpl.java @@ -70,6 +70,8 @@ public abstract class TargetImpl implements Target { protected UUID targetController = null; // if null the ability controller is the targetController protected UUID abilityController = null; // only used if target controller != ability controller + protected int targetTag; // can be set if other target check is needed (AnotherTargetPredicate) + @Override public abstract TargetImpl copy(); @@ -95,6 +97,7 @@ public abstract class TargetImpl implements Target { this.notTarget = target.notTarget; this.targetController = target.targetController; this.abilityController = target.abilityController; + this.targetTag = target.targetTag; } @Override @@ -345,7 +348,6 @@ public abstract class TargetImpl implements Target { public boolean isLegal(Ability source, Game game) { //20101001 - 608.2b Set illegalTargets = new HashSet<>(); -// int replacedTargets = 0; for (UUID targetId : targets.keySet()) { Card card = game.getCard(targetId); if (card != null) { @@ -367,12 +369,17 @@ public abstract class TargetImpl implements Target { for (UUID targetId : illegalTargets) { targets.remove(targetId); } -// if (replacedTargets > 0 && replacedTargets == targets.size()) { -// return false; -// } - if (getNumberOfTargets() == 0 && targets.isEmpty()) { - return true; + if (targets.isEmpty()) { + // If all targets that were set before are illegal now, the target is no longer legal + if (!illegalTargets.isEmpty()) { + return false; + } + // if no targets have to be set and no targets are set, that's legal + if (getNumberOfTargets() == 0) { + return true; + } } + return targets.size() > 0; } @@ -536,4 +543,25 @@ public abstract class TargetImpl implements Target { } } + @Override + public boolean isRequiredExplicitlySet() { + return requiredExplicitlySet; + } + + @Override + public int getTargetTag() { + return targetTag; + } + + /** + * Is used to be able to check, that another target is slected within the + * group of targets of the ability with a target tag > 0. + * + * @param targetTag + */ + @Override + public void setTargetTag(int targetTag) { + this.targetTag = targetTag; + } + } diff --git a/Mage/src/mage/target/TargetPermanent.java b/Mage/src/mage/target/TargetPermanent.java index 222e08d0586..068bac9f0cb 100644 --- a/Mage/src/mage/target/TargetPermanent.java +++ b/Mage/src/mage/target/TargetPermanent.java @@ -1,44 +1,42 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.target; import java.util.HashSet; import java.util.Set; import java.util.UUID; -import mage.constants.Zone; import mage.MageObject; import mage.abilities.Ability; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.permanent.Permanent; - /** * * @author BetaSteward_at_googlemail.com @@ -50,7 +48,7 @@ public class TargetPermanent extends TargetObject { public TargetPermanent() { this(1, 1, new FilterPermanent(), false); } - + public TargetPermanent(FilterPermanent filter) { this(1, 1, filter, false); } @@ -88,8 +86,8 @@ public class TargetPermanent extends TargetObject { // first for protection from spells or abilities (e.g. protection from colored spells, r1753) // second for protection from sources (e.g. protection from artifacts + equip ability) if (!isNotTarget()) { - if (!permanent.canBeTargetedBy(game.getObject(source.getId()), controllerId, game) || - !permanent.canBeTargetedBy(game.getObject(source.getSourceId()), controllerId, game)) { + if (!permanent.canBeTargetedBy(game.getObject(source.getId()), controllerId, game) + || !permanent.canBeTargetedBy(game.getObject(source.getSourceId()), controllerId, game)) { return false; } } @@ -117,7 +115,8 @@ public class TargetPermanent extends TargetObject { /** * Checks if there are enough {@link Permanent} that can be chosen. * - * Takes into account notTarget parameter, in case it's true doesn't check for protection, shroud etc. + * Takes into account notTarget parameter, in case it's true doesn't check + * for protection, shroud etc. * * @param sourceId the target event source * @param sourceControllerId controller of the target event source @@ -132,7 +131,7 @@ public class TargetPermanent extends TargetObject { } int count = 0; MageObject targetSource = game.getObject(sourceId); - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { if (!targets.containsKey(permanent.getId())) { if (notTarget || permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { count++; @@ -146,9 +145,10 @@ public class TargetPermanent extends TargetObject { } /** - * Checks if there are enough {@link Permanent} that can be selected. Should not be used - * for Ability targets since this does not check for protection, shroud etc. - * + * Checks if there are enough {@link Permanent} that can be selected. Should + * not be used for Ability targets since this does not check for protection, + * shroud etc. + * * @param sourceControllerId - controller of the select event * @param game * @return - true if enough valid {@link Permanent} exist @@ -162,7 +162,7 @@ public class TargetPermanent extends TargetObject { return true; } int count = 0; - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, game)) { if (!targets.containsKey(permanent.getId())) { count++; if (count >= remainingTargets) { @@ -177,7 +177,7 @@ public class TargetPermanent extends TargetObject { public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); MageObject targetSource = game.getObject(sourceId); - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, sourceId, game)) { if (!targets.containsKey(permanent.getId())) { if (notTarget || permanent.canBeTargetedBy(targetSource, sourceControllerId, game)) { possibleTargets.add(permanent.getId()); @@ -190,7 +190,7 @@ public class TargetPermanent extends TargetObject { @Override public Set possibleTargets(UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, sourceControllerId, game)) { if (!targets.containsKey(permanent.getId())) { possibleTargets.add(permanent.getId()); } diff --git a/Mage/src/mage/target/TargetSpell.java b/Mage/src/mage/target/TargetSpell.java index ec8dd9c6435..a070bbc3b7c 100644 --- a/Mage/src/mage/target/TargetSpell.java +++ b/Mage/src/mage/target/TargetSpell.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.target; import java.util.HashSet; @@ -84,7 +83,7 @@ public class TargetSpell extends TargetObject { } Spell spell = game.getStack().getSpell(id); if (spell != null) { - return filter.match(spell, source.getControllerId(), game); + return filter.match(spell, source.getSourceId(), source.getControllerId(), game); } return false; } @@ -92,12 +91,12 @@ public class TargetSpell extends TargetObject { @Override public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { int count = 0; - for (StackObject stackObject: game.getStack()) { + for (StackObject stackObject : game.getStack()) { // rule 114.4. A spell or ability on the stack is an illegal target for itself. if (sourceId != null && sourceId.equals(stackObject.getSourceId())) { continue; } - if (canBeChosen(stackObject, sourceControllerId, game)) { + if (canBeChosen(stackObject, sourceId, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { return true; @@ -114,28 +113,28 @@ public class TargetSpell extends TargetObject { @Override public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - return possibleTargets(sourceControllerId, game); - } - - @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); - for (StackObject stackObject: game.getStack()) { - if (canBeChosen(stackObject, sourceControllerId, game)) { + for (StackObject stackObject : game.getStack()) { + if (canBeChosen(stackObject, sourceId, sourceControllerId, game)) { possibleTargets.add(stackObject.getId()); } } return possibleTargets; } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + return this.possibleTargets(null, sourceControllerId, game); + } + @Override public TargetSpell copy() { return new TargetSpell(this); } - private boolean canBeChosen(StackObject stackObject, UUID sourceControllerId, Game game) { + private boolean canBeChosen(StackObject stackObject, UUID sourceID, UUID sourceControllerId, Game game) { return stackObject instanceof Spell && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) - && filter.match((Spell) stackObject, sourceControllerId, game); + && filter.match((Spell) stackObject, sourceID, sourceControllerId, game); } } diff --git a/Mage/src/mage/target/TargetStackObject.java b/Mage/src/mage/target/TargetStackObject.java index 0a8e91a4e9a..467565ee72d 100644 --- a/Mage/src/mage/target/TargetStackObject.java +++ b/Mage/src/mage/target/TargetStackObject.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -80,21 +80,16 @@ public class TargetStackObject extends TargetObject { public boolean canTarget(UUID id, Ability source, Game game) { StackObject stackObject = game.getStack().getStackObject(id); if (stackObject != null) { - return filter.match(stackObject, game); + return filter.match(stackObject, source.getSourceId(), source.getControllerId(), game); } return false; } @Override public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - return canChoose(sourceControllerId, game); - } - - @Override - public boolean canChoose(UUID sourceControllerId, Game game) { int count = 0; for (StackObject stackObject: game.getStack()) { - if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, game)) { + if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, sourceId, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { return true; @@ -105,21 +100,26 @@ public class TargetStackObject extends TargetObject { } @Override - public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { - return possibleTargets(sourceControllerId, game); + public boolean canChoose(UUID sourceControllerId, Game game) { + return canChoose(null, sourceControllerId, game); } @Override - public Set possibleTargets(UUID sourceControllerId, Game game) { + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); for (StackObject stackObject: game.getStack()) { - if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, game)) { + if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, sourceId, sourceControllerId, game)) { possibleTargets.add(stackObject.getId()); } } return possibleTargets; } + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + return this.possibleTargets(null, sourceControllerId, game); + } + @Override public TargetStackObject copy() { return new TargetStackObject(this); diff --git a/Mage/src/mage/target/Targets.java b/Mage/src/mage/target/Targets.java index ad1f1c37fb5..c29f1932d90 100644 --- a/Mage/src/mage/target/Targets.java +++ b/Mage/src/mage/target/Targets.java @@ -1,58 +1,57 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.target; import java.util.ArrayList; import java.util.List; import java.util.UUID; -import mage.constants.Outcome; import mage.abilities.Ability; +import mage.constants.Outcome; import mage.game.Game; - /** * * @author BetaSteward_at_googlemail.com */ public class Targets extends ArrayList { - public Targets() {} + public Targets() { + } public Targets(final Targets targets) { - for (Target target: targets) { + for (Target target : targets) { this.add(target.copy()); } } public List getUnchosen() { List unchosen = new ArrayList<>(); - for (Target target: this) { + for (Target target : this) { if (!target.isChosen()) { unchosen.add(target); } @@ -61,13 +60,13 @@ public class Targets extends ArrayList { } public void clearChosen() { - for (Target target: this) { + for (Target target : this) { target.clearChosen(); } } public boolean isChosen() { - for (Target target: this) { + for (Target target : this) { if (!target.isChosen()) { return false; } @@ -90,7 +89,7 @@ public class Targets extends ArrayList { return true; } - public boolean chooseTargets(Outcome outcome, UUID playerId, Ability source, Game game) { + public boolean chooseTargets(Outcome outcome, UUID playerId, Ability source, boolean noMana, Game game) { if (this.size() > 0) { if (!canChoose(source.getSourceId(), playerId, game)) { return false; @@ -101,6 +100,9 @@ public class Targets extends ArrayList { if (target.getTargetController() != null) { // some targets can have controller different than ability controller targetController = target.getTargetController(); } + if (noMana) { // if cast without mana (e.g. by supend you may notr be able to cancel the casting if you are able to cast it + target.setRequired(true); + } if (!target.chooseTarget(outcome, targetController, source, game)) { return false; } @@ -113,7 +115,7 @@ public class Targets extends ArrayList { // 608.2 // The spell or ability is countered if all its targets, for every instance of the word "target," are now illegal int illegalCount = 0; - for (Target target: this) { + for (Target target : this) { if (!target.isLegal(source, game)) { illegalCount++; } @@ -123,8 +125,8 @@ public class Targets extends ArrayList { } /** - * Checks if there are enough targets that can be chosen. Should only be used - * for Ability targets since this checks for protection, shroud etc. + * Checks if there are enough targets that can be chosen. Should only be + * used for Ability targets since this checks for protection, shroud etc. * * @param sourceId - the target event source * @param sourceControllerId - controller of the target event source @@ -132,7 +134,7 @@ public class Targets extends ArrayList { * @return - true if enough valid targets exist */ public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { - for (Target target: this) { + for (Target target : this) { if (!target.canChoose(sourceId, sourceControllerId, game)) { return false; } @@ -141,15 +143,16 @@ public class Targets extends ArrayList { } /** - * Checks if there are enough objects that can be selected. Should not be used - * for Ability targets since this does not check for protection, shroud etc. + * Checks if there are enough objects that can be selected. Should not be + * used for Ability targets since this does not check for protection, shroud + * etc. * * @param sourceControllerId - controller of the select event * @param game * @return - true if enough valid objects exist */ public boolean canChoose(UUID sourceControllerId, Game game) { - for (Target target: this) { + for (Target target : this) { if (!target.canChoose(sourceControllerId, game)) { return false; } diff --git a/Mage/src/mage/target/common/TargetCardInLibrary.java b/Mage/src/mage/target/common/TargetCardInLibrary.java index 5d6205e80d3..49d3eca2430 100644 --- a/Mage/src/mage/target/common/TargetCardInLibrary.java +++ b/Mage/src/mage/target/common/TargetCardInLibrary.java @@ -64,6 +64,9 @@ public class TargetCardInLibrary extends TargetCard { public TargetCardInLibrary(int minNumTargets, int maxNumTargets, FilterCard filter) { super(minNumTargets, maxNumTargets, Zone.LIBRARY, filter); + // 701.15b If a player is searching a hidden zone for cards with a stated quality, such as a card + // with a certain card type or color, that player isn’t required to find some or all of those cards + // even if they’re present in that zone. this.setRequired(!filter.hasPredicates()); this.librarySearchLimit = Integer.MAX_VALUE; } diff --git a/Mage/src/mage/target/common/TargetCardInYourGraveyard.java b/Mage/src/mage/target/common/TargetCardInYourGraveyard.java index a6e26451369..eba50fb268d 100644 --- a/Mage/src/mage/target/common/TargetCardInYourGraveyard.java +++ b/Mage/src/mage/target/common/TargetCardInYourGraveyard.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.target.common; import java.util.HashSet; @@ -106,13 +105,14 @@ public class TargetCardInYourGraveyard extends TargetCard { public Set possibleTargets(UUID sourceControllerId, Cards cards, Game game) { Set possibleTargets = new HashSet<>(); Player player = game.getPlayer(sourceControllerId); - for (Card card: cards.getCards(filter, game)) { + for (Card card : cards.getCards(filter, game)) { if (player.getGraveyard().getCards(game).contains(card)) { possibleTargets.add(card.getId()); } } return possibleTargets; } + /** * Checks if there are enough {@link Card} that can be selected. * @@ -127,6 +127,7 @@ public class TargetCardInYourGraveyard extends TargetCard { } return false; } + @Override public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { Player player = game.getPlayer(sourceControllerId); diff --git a/Mage/src/mage/target/common/TargetCreatureOrPlayerAmount.java b/Mage/src/mage/target/common/TargetCreatureOrPlayerAmount.java index c8f9eb2258c..33ea4c44808 100644 --- a/Mage/src/mage/target/common/TargetCreatureOrPlayerAmount.java +++ b/Mage/src/mage/target/common/TargetCreatureOrPlayerAmount.java @@ -1,41 +1,40 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.target.common; import java.util.HashSet; import java.util.Set; import java.util.UUID; -import mage.constants.Zone; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; +import mage.constants.Zone; import mage.filter.Filter; import mage.filter.common.FilterCreatureOrPlayer; import mage.filter.common.FilterCreaturePermanent; @@ -64,7 +63,7 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { public TargetCreatureOrPlayerAmount(DynamicValue amount) { super(amount); this.zone = Zone.ALL; - this.filter = new FilterCreatureOrPlayer(); + this.filter = new FilterCreatureOrPlayer("creatures and/or players"); this.targetName = filter.getMessage(); } @@ -124,7 +123,7 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { int count = 0; MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + for (UUID playerId : game.getPlayer(sourceControllerId).getInRange()) { Player player = game.getPlayer(playerId); if (player != null && player.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(player, game)) { count++; @@ -133,7 +132,7 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { } } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { @@ -147,7 +146,7 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { @Override public boolean canChoose(UUID sourceControllerId, Game game) { int count = 0; - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + for (UUID playerId : game.getPlayer(sourceControllerId).getInRange()) { Player player = game.getPlayer(playerId); if (player != null && filter.match(player, game)) { count++; @@ -156,7 +155,7 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { } } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { if (filter.match(permanent, null, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { @@ -171,13 +170,13 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); MageObject targetSource = game.getObject(sourceId); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + for (UUID playerId : game.getPlayer(sourceControllerId).getInRange()) { Player player = game.getPlayer(playerId); if (player != null && player.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(player, game)) { possibleTargets.add(playerId); } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { possibleTargets.add(permanent.getId()); } @@ -188,13 +187,13 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { @Override public Set possibleTargets(UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); - for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + for (UUID playerId : game.getPlayer(sourceControllerId).getInRange()) { Player player = game.getPlayer(playerId); if (player != null && filter.match(player, game)) { possibleTargets.add(playerId); } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { if (filter.match(permanent, null, sourceControllerId, game)) { possibleTargets.add(permanent.getId()); } @@ -205,12 +204,11 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { @Override public String getTargetedName(Game game) { StringBuilder sb = new StringBuilder(); - for (UUID targetId: getTargets()) { + for (UUID targetId : getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { sb.append(permanent.getLogName()).append("(").append(getTargetAmount(targetId)).append(") "); - } - else { + } else { Player player = game.getPlayer(targetId); sb.append(player.getLogName()).append("(").append(getTargetAmount(targetId)).append(") "); } diff --git a/Mage/src/mage/target/common/TargetSpellOrPermanent.java b/Mage/src/mage/target/common/TargetSpellOrPermanent.java index 0e338680926..a52afb47ca7 100644 --- a/Mage/src/mage/target/common/TargetSpellOrPermanent.java +++ b/Mage/src/mage/target/common/TargetSpellOrPermanent.java @@ -1,5 +1,5 @@ /* - * + * * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are @@ -25,7 +25,7 @@ * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. - * + * */ package mage.target.common; @@ -51,7 +51,6 @@ import mage.target.TargetImpl; public class TargetSpellOrPermanent extends TargetImpl { protected FilterSpellOrPermanent filter; - protected FilterPermanent filterPermanent; public TargetSpellOrPermanent() { this(1, 1); @@ -62,28 +61,28 @@ public class TargetSpellOrPermanent extends TargetImpl { } public TargetSpellOrPermanent(int minNumTargets, int maxNumTargets) { - this.minNumberOfTargets = minNumTargets; - this.maxNumberOfTargets = maxNumTargets; - this.zone = Zone.ALL; - this.filter = new FilterSpellOrPermanent(); - this.targetName = filter.getMessage(); - this.filterPermanent = new FilterPermanent(); + this(minNumTargets, maxNumTargets, false); } public TargetSpellOrPermanent(int minNumTargets, int maxNumTargets, boolean notTarget) { - this(minNumTargets, maxNumTargets); + this(minNumTargets, maxNumTargets, new FilterSpellOrPermanent(), notTarget); this.notTarget = notTarget; } - public TargetSpellOrPermanent(int minNumTargets, int maxNumTargets, FilterSpellOrPermanent filter,boolean notTarget) { - this(minNumTargets, maxNumTargets); + public TargetSpellOrPermanent(int minNumTargets, int maxNumTargets, FilterSpellOrPermanent filter, boolean notTarget) { + super(notTarget); + this.minNumberOfTargets = minNumTargets; + this.maxNumberOfTargets = maxNumTargets; + this.zone = Zone.ALL; + this.targetName = filter.getMessage(); this.notTarget = notTarget; this.filter = filter; + this.targetName = filter.getMessage(); } + public TargetSpellOrPermanent(final TargetSpellOrPermanent target) { super(target); this.filter = target.filter.copy(); - this.filterPermanent = target.filterPermanent.copy(); } @Override @@ -92,7 +91,7 @@ public class TargetSpellOrPermanent extends TargetImpl { } public FilterPermanent getPermanentFilter() { - return this.filterPermanent; + return this.filter.getPermanentFilter(); } public void setFilter(FilterSpellOrPermanent filter) { @@ -118,13 +117,15 @@ public class TargetSpellOrPermanent extends TargetImpl { if (permanent != null) { if (source != null) { MageObject targetSource = game.getObject(source.getSourceId()); - return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game); + return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) + && filter.match(permanent, source.getSourceId(), source.getControllerId(), game); } else { return filter.match(permanent, game); } } Spell spell = game.getStack().getSpell(id); - if (spell != null) { + if (spell != null + && !source.getSourceId().equals(id)) { // 114.4. A spell or ability on the stack is an illegal target for itself. return filter.match(spell, game); } return false; @@ -136,28 +137,32 @@ public class TargetSpellOrPermanent extends TargetImpl { } /** - * Checks if there are enough {@link mage.game.permanent.Permanent} or {@link mage.game.stack.Spell} that can be chosen. Should only be used - * for Ability targets since this checks for protection, shroud etc. + * Checks if there are enough {@link mage.game.permanent.Permanent} or + * {@link mage.game.stack.Spell} that can be chosen. Should only be used for + * Ability targets since this checks for protection, shroud etc. * * @param sourceId - the target event source * @param sourceControllerId - controller of the target event source * @param game - * @return - true if enough valid {@link mage.game.permanent.Permanent} or {@link mage.game.stack.Spell} exist + * @return - true if enough valid {@link mage.game.permanent.Permanent} or + * {@link mage.game.stack.Spell} exist */ @Override public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { int count = 0; MageObject targetSource = game.getObject(sourceId); - for (StackObject stackObject: game.getStack()) { + for (StackObject stackObject : game.getStack()) { Spell spell = game.getStack().getSpell(stackObject.getId()); - if (spell != null && filter.match(spell, sourceId, sourceControllerId, game)) { + if (spell != null + && !sourceId.equals(spell.getSourceId()) + && filter.match(spell, sourceId, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { return true; } } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(filterPermanent, sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter.getPermanentFilter(), sourceControllerId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { @@ -169,26 +174,29 @@ public class TargetSpellOrPermanent extends TargetImpl { } /** - * Checks if there are enough {@link mage.game.permanent.Permanent} or {@link mage.game.stack.Spell} that can be selected. Should not be used + * Checks if there are enough {@link mage.game.permanent.Permanent} or + * {@link mage.game.stack.Spell} that can be selected. Should not be used * for Ability targets since this does not check for protection, shroud etc. * * @param sourceControllerId - controller of the select event * @param game - * @return - true if enough valid {@link mage.game.permanent.Permanent} or {@link mage.game.stack.Spell} exist + * @return - true if enough valid {@link mage.game.permanent.Permanent} or + * {@link mage.game.stack.Spell} exist */ @Override public boolean canChoose(UUID sourceControllerId, Game game) { int count = 0; - for (StackObject stackObject: game.getStack()) { + for (StackObject stackObject : game.getStack()) { Spell spell = game.getStack().getSpell(stackObject.getId()); - if (spell != null && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) { + if (spell != null + && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) { count++; if (count >= this.minNumberOfTargets) { return true; } } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(filterPermanent, sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter.getPermanentFilter(), sourceControllerId, game)) { if (filter.match(permanent, null, sourceControllerId, game) && filter.match(permanent, game)) { count++; if (count >= this.minNumberOfTargets) { @@ -203,13 +211,15 @@ public class TargetSpellOrPermanent extends TargetImpl { public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); MageObject targetSource = game.getObject(sourceId); - for (StackObject stackObject: game.getStack()) { + for (StackObject stackObject : game.getStack()) { Spell spell = game.getStack().getSpell(stackObject.getId()); - if (spell != null && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) { + if (spell != null + && !sourceId.equals(spell.getSourceId()) + && filter.match(spell, sourceId, sourceControllerId, game)) { possibleTargets.add(spell.getId()); } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(filterPermanent, sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter.getPermanentFilter(), sourceControllerId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { possibleTargets.add(permanent.getId()); } @@ -220,13 +230,14 @@ public class TargetSpellOrPermanent extends TargetImpl { @Override public Set possibleTargets(UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); - for (StackObject stackObject: game.getStack()) { + for (StackObject stackObject : game.getStack()) { Spell spell = game.getStack().getSpell(stackObject.getId()); - if (spell != null && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) { + if (spell != null + && filter.match(spell, null, sourceControllerId, game)) { possibleTargets.add(spell.getId()); } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(filterPermanent, sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter.getPermanentFilter(), sourceControllerId, game)) { if (filter.match(permanent, null, sourceControllerId, game)) { possibleTargets.add(permanent.getId()); } @@ -237,12 +248,11 @@ public class TargetSpellOrPermanent extends TargetImpl { @Override public String getTargetedName(Game game) { StringBuilder sb = new StringBuilder(); - for (UUID targetId: getTargets()) { + for (UUID targetId : getTargets()) { Permanent permanent = game.getPermanent(targetId); if (permanent != null) { sb.append(permanent.getLogName()).append(" "); - } - else { + } else { Spell spell = game.getStack().getSpell(targetId); sb.append(spell.getLogName()).append(" "); } diff --git a/Mage/src/mage/target/targetpointer/FixedTarget.java b/Mage/src/mage/target/targetpointer/FixedTarget.java index 5a8f3c68d4d..f513ca21ba9 100644 --- a/Mage/src/mage/target/targetpointer/FixedTarget.java +++ b/Mage/src/mage/target/targetpointer/FixedTarget.java @@ -6,6 +6,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.cards.Card; import mage.game.Game; +import mage.game.permanent.Permanent; public class FixedTarget implements TargetPointer { @@ -18,6 +19,12 @@ public class FixedTarget implements TargetPointer { this.initialized = false; } + public FixedTarget(Permanent permanent, Game game) { + this.targetId = permanent.getId(); + this.zoneChangeCounter = permanent.getZoneChangeCounter(game); + this.initialized = true; + } + /** * Use this if you already want to fix the target object to the known zone * now (otherwise the zone will be set if the ability triggers or not at diff --git a/Mage/src/mage/util/CardUtil.java b/Mage/src/mage/util/CardUtil.java index 475c3a2c107..807c515c911 100644 --- a/Mage/src/mage/util/CardUtil.java +++ b/Mage/src/mage/util/CardUtil.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.util; import java.util.Arrays; @@ -58,7 +57,6 @@ import mage.game.permanent.token.Token; import mage.game.stack.Spell; import mage.util.functions.CopyTokenFunction; - /** * @author nantuko */ @@ -71,16 +69,16 @@ public class CardUtil { private static final String regexWhite = ".*\\x7b.{0,2}W.{0,2}\\x7d.*"; private static final String SOURCE_EXILE_ZONE_TEXT = "SourceExileZone"; - - static String numberStrings[] = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", - "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "ninteen", "twenty"}; - public static final String[] NON_CHANGELING_SUBTYPES_VALUES = new String[] { "Mountain", "Forest", "Plains", "Swamp", "Island", - "Aura", "Curse", "Shrine", - "Equipment", "Fortification", "Contraption", - "Trap", "Arcane"}; - public static final Set NON_CREATURE_SUBTYPES = new HashSet<>(Arrays.asList(NON_CHANGELING_SUBTYPES_VALUES)); - + static String numberStrings[] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", + "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "ninteen", "twenty"}; + + public static final String[] NON_CHANGELING_SUBTYPES_VALUES = new String[]{"Mountain", "Forest", "Plains", "Swamp", "Island", + "Aura", "Curse", "Shrine", + "Equipment", "Fortification", "Contraption", + "Trap", "Arcane"}; + public static final Set NON_CREATURE_SUBTYPES = new HashSet<>(Arrays.asList(NON_CHANGELING_SUBTYPES_VALUES)); + /** * Checks whether two cards share card types. * @@ -102,6 +100,7 @@ public class CardUtil { return false; } + /** * Checks whether two cards share card subtypes. * @@ -116,10 +115,10 @@ public class CardUtil { } if (card1.getCardType().contains(CardType.CREATURE) && card2.getCardType().contains(CardType.CREATURE)) { - if (card1.getAbilities().contains(ChangelingAbility.getInstance()) || - card1.getSubtype().contains(ChangelingAbility.ALL_CREATURE_TYPE) || - card2.getAbilities().contains(ChangelingAbility.getInstance()) || - card2.getSubtype().contains(ChangelingAbility.ALL_CREATURE_TYPE)) { + if (card1.getAbilities().contains(ChangelingAbility.getInstance()) + || card1.getSubtype().contains(ChangelingAbility.ALL_CREATURE_TYPE) + || card2.getAbilities().contains(ChangelingAbility.getInstance()) + || card2.getSubtype().contains(ChangelingAbility.ALL_CREATURE_TYPE)) { return true; } } @@ -164,7 +163,7 @@ public class CardUtil { CardUtil.adjustAbilityCost((Ability) spellAbility, reduceCount); adjustAlternativeCosts(spellAbility, reduceCount); } - + public static ManaCosts increaseCost(ManaCosts manaCosts, int increaseCount) { return adjustCost(manaCosts, -increaseCount); } @@ -207,8 +206,6 @@ public class CardUtil { } } - - /** * Adjusts ability cost to be paid. * @@ -220,18 +217,19 @@ public class CardUtil { ability.getManaCostsToPay().clear(); ability.getManaCostsToPay().addAll(adjustedCost); } - + private static ManaCosts adjustCost(ManaCosts manaCosts, int reduceCount) { int restToReduce = reduceCount; - ManaCosts adjustedCost = new ManaCostsImpl<>(); + ManaCosts adjustedCost = new ManaCostsImpl<>(); boolean updated = false; for (ManaCost manaCost : manaCosts) { Mana mana = manaCost.getOptions().get(0); int colorless = mana != null ? mana.getColorless() : 0; - if (!updated && restToReduce != 0 && colorless > 0) { + if (restToReduce != 0 && colorless > 0) { if ((colorless - restToReduce) > 0) { int newColorless = colorless - restToReduce; adjustedCost.add(new GenericManaCost(newColorless)); + restToReduce = 0; } else { restToReduce -= colorless; } @@ -251,18 +249,18 @@ public class CardUtil { public static ManaCosts removeVariableManaCost(ManaCosts manaCosts) { ManaCosts adjustedCost = new ManaCostsImpl<>(); - for (ManaCost manaCost: manaCosts) { + for (ManaCost manaCost : manaCosts) { if (!(manaCost instanceof VariableManaCost)) { adjustedCost.add(manaCost); } } return adjustedCost; } - + public static void reduceCost(SpellAbility spellAbility, ManaCosts manaCostsToReduce) { adjustCost(spellAbility, manaCostsToReduce, true); } - + public static void increaseCost(SpellAbility spellAbility, ManaCosts manaCostsToIncrease) { ManaCosts increasedCost = spellAbility.getManaCostsToPay().copy(); @@ -279,19 +277,19 @@ public class CardUtil { * * @param spellAbility * @param manaCostsToReduce costs to reduce - * @param convertToGeneric colored mana does reduce generic mana if no appropriate colored mana is in the costs included + * @param convertToGeneric colored mana does reduce generic mana if no + * appropriate colored mana is in the costs included */ public static void adjustCost(SpellAbility spellAbility, ManaCosts manaCostsToReduce, boolean convertToGeneric) { ManaCosts previousCost = spellAbility.getManaCostsToPay(); - ManaCosts adjustedCost = new ManaCostsImpl<>(); + ManaCosts adjustedCost = new ManaCostsImpl<>(); // save X value (e.g. convoke ability) - for (VariableCost vCost: previousCost.getVariableCosts()) { + for (VariableCost vCost : previousCost.getVariableCosts()) { if (vCost instanceof VariableManaCost) { adjustedCost.add((VariableManaCost) vCost); } } - Mana reduceMana = new Mana(); for (ManaCost manaCost : manaCostsToReduce) { reduceMana.add(manaCost.getMana()); @@ -304,46 +302,46 @@ public class CardUtil { } if (mana.getBlack() > 0 && reduceMana.getBlack() > 0) { if (reduceMana.getBlack() > mana.getBlack()) { - reduceMana.setBlack(reduceMana.getBlack()-mana.getBlack()); + reduceMana.setBlack(reduceMana.getBlack() - mana.getBlack()); mana.setBlack(0); } else { - mana.setBlack(mana.getBlack()-reduceMana.getBlack()); + mana.setBlack(mana.getBlack() - reduceMana.getBlack()); reduceMana.setBlack(0); } } if (mana.getRed() > 0 && reduceMana.getRed() > 0) { if (reduceMana.getRed() > mana.getRed()) { - reduceMana.setRed(reduceMana.getRed()-mana.getRed()); + reduceMana.setRed(reduceMana.getRed() - mana.getRed()); mana.setRed(0); } else { - mana.setRed(mana.getRed()-reduceMana.getRed()); + mana.setRed(mana.getRed() - reduceMana.getRed()); reduceMana.setRed(0); } } if (mana.getBlue() > 0 && reduceMana.getBlue() > 0) { if (reduceMana.getBlue() > mana.getBlue()) { - reduceMana.setBlue(reduceMana.getBlue()-mana.getBlue()); + reduceMana.setBlue(reduceMana.getBlue() - mana.getBlue()); mana.setBlue(0); } else { - mana.setBlue(mana.getBlue()-reduceMana.getBlue()); + mana.setBlue(mana.getBlue() - reduceMana.getBlue()); reduceMana.setBlue(0); } } if (mana.getGreen() > 0 && reduceMana.getGreen() > 0) { if (reduceMana.getGreen() > mana.getGreen()) { - reduceMana.setGreen(reduceMana.getGreen()-mana.getGreen()); + reduceMana.setGreen(reduceMana.getGreen() - mana.getGreen()); mana.setGreen(0); } else { - mana.setGreen(mana.getGreen()-reduceMana.getGreen()); + mana.setGreen(mana.getGreen() - reduceMana.getGreen()); reduceMana.setGreen(0); } } if (mana.getWhite() > 0 && reduceMana.getWhite() > 0) { if (reduceMana.getWhite() > mana.getWhite()) { - reduceMana.setWhite(reduceMana.getWhite()-mana.getWhite()); + reduceMana.setWhite(reduceMana.getWhite() - mana.getWhite()); mana.setWhite(0); } else { - mana.setWhite(mana.getWhite()-reduceMana.getWhite()); + mana.setWhite(mana.getWhite() - reduceMana.getWhite()); reduceMana.setWhite(0); } } @@ -384,10 +382,10 @@ public class CardUtil { spellAbility.getManaCostsToPay().clear(); spellAbility.getManaCostsToPay().addAll(adjustedCost); } - /** - * Returns function that copies params\abilities from one card to {@link Token}. + * Returns function that copies params\abilities from one card to + * {@link Token}. * * @param target * @return @@ -396,7 +394,7 @@ public class CardUtil { return new CopyTokenFunction(target); } - public static boolean isPermanentCard ( Card card ) { + public static boolean isPermanentCard(Card card) { boolean permanent = false; permanent |= card.getCardType().contains(CardType.ARTIFACT); @@ -409,23 +407,24 @@ public class CardUtil { } /** - * Converts an integer number to string - * Numbers > 20 will be returned as digits + * Converts an integer number to string Numbers > 20 will be returned as + * digits * * @param number - * @return + * @return */ public static String numberToText(int number) { return numberToText(number, "one"); } - + /** * Converts an integer number to string like "one", "two", "three", ... * Numbers > 20 will be returned as digits - * + * * @param number number to convert to text - * @param forOne if the number is 1, this string will be returnedinstead of "one". - * @return + * @param forOne if the number is 1, this string will be returnedinstead of + * "one". + * @return */ public static String numberToText(int number, String forOne) { if (number == 1 && forOne != null) { @@ -458,8 +457,8 @@ public class CardUtil { } public static boolean checkNumeric(String s) { - for(int i = 0; i < s.length(); i++) { - if(!Character.isDigit(s.charAt(i))) { + for (int i = 0; i < s.length(); i++) { + if (!Character.isDigit(s.charAt(i))) { return false; } } @@ -476,7 +475,7 @@ public class CardUtil { public static UUID getCardExileZoneId(Game game, Ability source) { return getCardExileZoneId(game, source.getSourceId()); } - + public static UUID getCardExileZoneId(Game game, UUID sourceId) { return getCardExileZoneId(game, sourceId, false); } @@ -484,41 +483,25 @@ public class CardUtil { public static UUID getCardExileZoneId(Game game, UUID sourceId, boolean previous) { return getExileZoneId(getCardZoneString(SOURCE_EXILE_ZONE_TEXT, sourceId, game, previous), game); } - - public static UUID getObjectExileZoneId(Game game, MageObject mageObject) { - return getObjectExileZoneId(game, mageObject, false); + + public static UUID getExileZoneId(Game game, UUID objectId, int zoneChangeCounter) { + return getExileZoneId(getObjectZoneString(SOURCE_EXILE_ZONE_TEXT, objectId, game, zoneChangeCounter, false), game); } - public static UUID getObjectExileZoneId(Game game, MageObject mageObject, boolean previous) { - int zoneChangeCounter = 0; - if (mageObject instanceof Permanent) { - zoneChangeCounter = ((Permanent) mageObject).getZoneChangeCounter(game); - } else if (mageObject instanceof Card) { - zoneChangeCounter = ((Card) mageObject).getZoneChangeCounter(game); - } - if (zoneChangeCounter > 0 && previous) { - zoneChangeCounter--; - } - return getExileZoneId(getObjectZoneString(SOURCE_EXILE_ZONE_TEXT,mageObject.getId(), game, zoneChangeCounter, false), game); - } - - public static UUID getExileZoneId(Game game, UUID objectId, int zoneChangeCounter) { - return getExileZoneId(getObjectZoneString(SOURCE_EXILE_ZONE_TEXT,objectId, game, zoneChangeCounter, false), game); - } - public static UUID getExileZoneId(String key, Game game) { UUID exileId = (UUID) game.getState().getValue(key); if (exileId == null) { exileId = UUID.randomUUID(); game.getState().setValue(key, exileId); } - return exileId; + return exileId; } /** - * Creates a string from text + cardId and the zoneChangeCounter of the card (from cardId). - * This string can be used to save and get values that must be specific to a permanent instance. - * So they won't match, if a permanent was e.g. exiled and came back immediately. + * Creates a string from text + cardId and the zoneChangeCounter of the card + * (from cardId). This string can be used to save and get values that must + * be specific to a permanent instance. So they won't match, if a permanent + * was e.g. exiled and came back immediately. * * @param text short value to describe the value * @param cardId id of the card @@ -529,15 +512,15 @@ public class CardUtil { return getCardZoneString(text, cardId, game, false); } - public static String getCardZoneString(String text, UUID cardId, Game game, boolean previous) { - int zoneChangeCounter= 0; + public static String getCardZoneString(String text, UUID cardId, Game game, boolean previous) { + int zoneChangeCounter = 0; Card card = game.getCard(cardId); // if called for a token, the id is enough if (card != null) { zoneChangeCounter = card.getZoneChangeCounter(game); } - return getObjectZoneString(text,cardId, game, zoneChangeCounter, previous); + return getObjectZoneString(text, cardId, game, zoneChangeCounter, previous); } - + public static String getObjectZoneString(String text, MageObject mageObject, Game game) { int zoneChangeCounter = 0; if (mageObject instanceof Permanent) { @@ -547,22 +530,23 @@ public class CardUtil { } return getObjectZoneString(text, mageObject.getId(), game, zoneChangeCounter, false); } - + public static String getObjectZoneString(String text, UUID objectId, Game game, int zoneChangeCounter, boolean previous) { StringBuilder uniqueString = new StringBuilder(); if (text != null) { uniqueString.append(text); } uniqueString.append(objectId); - uniqueString.append(previous ? zoneChangeCounter - 1: zoneChangeCounter); - return uniqueString.toString(); + uniqueString.append(previous ? zoneChangeCounter - 1 : zoneChangeCounter); + return uniqueString.toString(); } - + /** - * Returns if the ability is used to check which cards - * are playable on hand. (Issue #457) + * Returns if the ability is used to check which cards are playable on hand. + * (Issue #457) + * * @param ability - ability to check - * @return + * @return */ public static boolean isCheckPlayableMode(Ability ability) { if (ability instanceof ActivatedAbility) { @@ -572,8 +556,8 @@ public class CardUtil { } /** - * Adds tags to mark the additional info of a card - * (e.g. blue font color) + * Adds tags to mark the additional info of a card (e.g. blue font color) + * * @param text text body * @return */ @@ -584,7 +568,7 @@ public class CardUtil { public static boolean convertedManaCostsIsEqual(MageObject object1, MageObject object2) { Set cmcObject1 = getCMC(object1); Set cmcObject2 = getCMC(object2); - for (Integer integer :cmcObject1) { + for (Integer integer : cmcObject1) { if (cmcObject2.contains(integer)) { return true; } @@ -595,7 +579,7 @@ public class CardUtil { public static Set getCMC(MageObject object) { Set cmcObject = new HashSet<>(); if (object instanceof Spell) { - cmcObject.add(((Spell)object).getConvertedManaCost()); + cmcObject.add(((Spell) object).getConvertedManaCost()); } else if (object instanceof Card) { Card card = (Card) object; if (card instanceof SplitCard) { @@ -605,16 +589,16 @@ public class CardUtil { } else { cmcObject.add(card.getManaCost().convertedManaCost()); } - } + } return cmcObject; } - + /** - * Gets the colors that are in the casting cost but also in the rules text + * Gets the colors that are in the casting cost but also in the rules text * as far as not included in reminder text. - * + * * @param card - * @return + * @return */ public static FilterMana getColorIdentity(Card card) { FilterMana mana = new FilterMana(); @@ -644,8 +628,17 @@ public class CardUtil { } return mana; } - + public static boolean isNonCreatureSubtype(String subtype) { return NON_CREATURE_SUBTYPES.contains(subtype); } + + public static boolean cardCanBePlayedNow(Card card, UUID playerId, Game game) { + if (card.getCardType().contains(CardType.LAND)) { + return game.canPlaySorcery(playerId) && game.getPlayer(playerId).canPlayLand(); + } else { + return card.getSpellAbility() != null && card.getSpellAbility().spellCanBeActivatedRegularlyNow(playerId, game); + } + } + } diff --git a/Mage/src/mage/util/Logging.java b/Mage/src/mage/util/Logging.java deleted file mode 100644 index 96441fce6e9..00000000000 --- a/Mage/src/mage/util/Logging.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ - -package mage.util; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.logging.ConsoleHandler; -import java.util.logging.Formatter; -import java.util.logging.Handler; -import java.util.logging.Level; -import java.util.logging.LogRecord; -import java.util.logging.Logger; - -/** - * - * @author BetaSteward_at_googlemail.com - */ -public class Logging { - - public static Logger getLogger(String name) { - Logger logger = Logger.getLogger(name); - ConsoleHandler handler = new ConsoleHandler(); - handler.setFormatter(new LogFormatter()); - logger.addHandler(handler); - logger.setUseParentHandlers(false); - return logger; - } - - public static Level getLevel(Logger logger) { - Level level = logger.getLevel(); - while (level == null && logger.getParent() != null) { - logger = logger.getParent(); - level = logger.getLevel(); - } - return level; - } -} - -class LogFormatter extends Formatter { - - private static final DateFormat df = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS"); - - @Override - public String format(LogRecord record) { - StringBuilder builder = new StringBuilder(1000); - builder.append(df.format(new Date(record.getMillis()))).append(" - "); - builder.append("[").append(record.getSourceClassName()).append("."); - builder.append(record.getSourceMethodName()).append("] - "); - builder.append("[").append(record.getLevel()).append("] - "); - builder.append(formatMessage(record)); - if (record.getThrown() != null) { - try { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - record.getThrown().printStackTrace(pw); - pw.close(); - builder.append(sw.toString()); - } catch (Exception ex) { - } - } - builder.append("\n"); - return builder.toString(); - } - - @Override - public String getHead(Handler h) { - return super.getHead(h); - } - - @Override - public String getTail(Handler h) { - return super.getTail(h); - } - -} \ No newline at end of file diff --git a/Mage/src/mage/util/MessageToClient.java b/Mage/src/mage/util/MessageToClient.java new file mode 100644 index 00000000000..556bac450d4 --- /dev/null +++ b/Mage/src/mage/util/MessageToClient.java @@ -0,0 +1,56 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.util; + +/** + * + * @author LevelX2 + */ +public class MessageToClient { + + private String message; + private String secondMessage; + private String hintText; + + public MessageToClient(String message) { + this(message, null); + } + + public MessageToClient(String message, String secondMessage) { + this(message, secondMessage, null); + } + + public MessageToClient(String message, String secondMessage, String hintText) { + this.message = message; + this.secondMessage = secondMessage; + this.hintText = hintText; + } + + public String getMessage() { + return message; + } + + public String getSecondMessage() { + return secondMessage; + } + + public String getHintText() { + return hintText; + } + + public void setMessage(String message) { + this.message = message; + } + + public void setSecondMessage(String secondMessage) { + this.secondMessage = secondMessage; + } + + public void setHintText(String hintText) { + this.hintText = hintText; + } + +} diff --git a/Mage/src/mage/util/TargetAddress.java b/Mage/src/mage/util/TargetAddress.java index 4774fe21e1b..e4e89d18325 100644 --- a/Mage/src/mage/util/TargetAddress.java +++ b/Mage/src/mage/util/TargetAddress.java @@ -36,11 +36,11 @@ import mage.cards.Card; import mage.game.stack.Spell; import mage.target.Target; - /** * @author duncant */ public class TargetAddress { + protected int spellAbilityIndex; protected UUID mode; protected int targetIndex; @@ -52,8 +52,9 @@ public class TargetAddress { } protected static class TargetAddressIterable implements Iterable { + protected final Card card; - + public TargetAddressIterable(Card card) { this.card = card; } @@ -64,9 +65,10 @@ public class TargetAddress { } protected static class TargetAddressIterator implements Iterator { + protected Iterator spellAbilityIterator; protected Integer lastSpellAbilityIndex = null; - protected Iterator modeIterator = null; + protected Iterator modeIterator = null; protected Modes modes = null; protected UUID lastMode = null; protected Iterator targetIterator = null; @@ -88,14 +90,14 @@ public class TargetAddress { public boolean hasNext() { return lastTargetIndex != null; } - + public TargetAddress next() { TargetAddress ret = new TargetAddress(lastSpellAbilityIndex, - lastMode, - lastTargetIndex); + lastMode, + lastTargetIndex); calcNext(); return ret; - + } public void remove() { @@ -118,9 +120,9 @@ public class TargetAddress { return; } } - + if (modeIterator != null && modeIterator.hasNext()) { - lastMode = modeIterator.next(); + lastMode = modeIterator.next().getId(); targetIterator = modes.get(lastMode).getTargets().iterator(); } else { lastMode = null; @@ -145,7 +147,6 @@ public class TargetAddress { } } - public static Iterable walk(Card card) { return new TargetAddressIterable(card); } @@ -179,8 +180,8 @@ public class TargetAddress { public boolean equals(TargetAddress other) { return spellAbilityIndex == other.spellAbilityIndex - && mode.equals(other.mode) - && targetIndex == other.targetIndex; + && mode.equals(other.mode) + && targetIndex == other.targetIndex; } @Override diff --git a/Mage/src/mage/util/TournamentUtil.java b/Mage/src/mage/util/TournamentUtil.java index 8d3ae3aaca9..09497b410ff 100644 --- a/Mage/src/mage/util/TournamentUtil.java +++ b/Mage/src/mage/util/TournamentUtil.java @@ -7,10 +7,12 @@ package mage.util; import java.util.ArrayList; +import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Random; import java.util.Set; + import mage.cards.Card; import mage.cards.repository.CardCriteria; import mage.cards.repository.CardInfo; @@ -32,44 +34,44 @@ public class TournamentUtil { * @return setCode for lands */ - public static Set getLandSetCodeForDeckSets(Set setCodesDeck) { + public static Set getLandSetCodeForDeckSets(Collection setCodesDeck) { - Set setCodesland = new HashSet<>(); + Set landSetCodes = new HashSet<>(); // decide from which sets basic lands are taken from for (String setCode :setCodesDeck) { ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode); if (expansionInfo.hasBasicLands()) { - setCodesland.add(expansionInfo.getCode()); + landSetCodes.add(expansionInfo.getCode()); } } // if sets have no basic land, take land from block - if (setCodesland.isEmpty()) { + if (landSetCodes.isEmpty()) { for (String setCode :setCodesDeck) { ExpansionInfo expansionInfo = ExpansionRepository.instance.getSetByCode(setCode); List blockSets = ExpansionRepository.instance.getSetsFromBlock(expansionInfo.getBlockName()); for (ExpansionInfo blockSet: blockSets) { if (blockSet.hasBasicLands()) { - setCodesland.add(blockSet.getCode()); + landSetCodes.add(blockSet.getCode()); } } } } // if still no set with lands found, take one by random - if (setCodesland.isEmpty()) { + if (landSetCodes.isEmpty()) { // if sets have no basic lands and also it has no parent or parent has no lands get last set with lands // select a set with basic lands by random Random generator = new Random(); List basicLandSets = ExpansionRepository.instance.getSetsWithBasicLandsByReleaseDate(); if (basicLandSets.size() > 0) { - setCodesland.add(basicLandSets.get(generator.nextInt(basicLandSets.size())).getCode()); + landSetCodes.add(basicLandSets.get(generator.nextInt(basicLandSets.size())).getCode()); } } - if (setCodesland.isEmpty()) { + if (landSetCodes.isEmpty()) { throw new IllegalArgumentException("No set with basic land was found"); } - return setCodesland; + return landSetCodes; } public static List getLands(String landName, int number, Set landSets) { diff --git a/Mage/src/mage/util/TreeNode.java b/Mage/src/mage/util/TreeNode.java index 7463b7addc6..b9d4620629a 100644 --- a/Mage/src/mage/util/TreeNode.java +++ b/Mage/src/mage/util/TreeNode.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.util; import java.util.ArrayList; @@ -34,14 +33,16 @@ import java.util.List; /** * * @author BetaSteward_at_googlemail.com + * @param */ public class TreeNode { + protected T data; protected List> children; public TreeNode() { super(); - children = new ArrayList>(); + children = new ArrayList<>(); } public TreeNode(T data) { @@ -70,7 +71,7 @@ public class TreeNode { } public void addChild(T child) { - children.add(new TreeNode(child)); + children.add(new TreeNode<>(child)); } public void addChildAt(int index, TreeNode child) throws IndexOutOfBoundsException { @@ -93,7 +94,7 @@ public class TreeNode { return this.data; } - public void setData(T data) { + private void setData(T data) { this.data = data; } @@ -116,10 +117,7 @@ public class TreeNode { return false; } final TreeNode other = (TreeNode) obj; - if (this.data != other.data && (this.data == null || !this.data.equals(other.data))) { - return false; - } - return true; + return !(this.data != other.data && (this.data == null || !this.data.equals(other.data))); } } diff --git a/Mage/src/mage/util/functions/AbilityApplier.java b/Mage/src/mage/util/functions/AbilityApplier.java new file mode 100644 index 00000000000..9697b3d644f --- /dev/null +++ b/Mage/src/mage/util/functions/AbilityApplier.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.util.functions; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class AbilityApplier extends ApplyToPermanent { + + private final Ability ability; + + public AbilityApplier(Ability ability) { + this.ability = ability; + } + + @Override + public Boolean apply(Game game, Permanent permanent) { + permanent.addAbility(ability, game); + return true; + } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + mageObject.getAbilities().add(ability); + return true; + } + +} diff --git a/Mage/src/mage/util/functions/AddSubtypeApplier.java b/Mage/src/mage/util/functions/AddSubtypeApplier.java new file mode 100644 index 00000000000..a007b6a9f31 --- /dev/null +++ b/Mage/src/mage/util/functions/AddSubtypeApplier.java @@ -0,0 +1,40 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.util.functions; + +import mage.MageObject; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class AddSubtypeApplier extends ApplyToPermanent { + + private final String subtype; + + public AddSubtypeApplier(String subtype) { + this.subtype = subtype; + } + + @Override + public Boolean apply(Game game, Permanent permanent) { + if (!permanent.getSubtype().contains(subtype)) { + permanent.getSubtype().add(subtype); + } + return true; + } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + if (!mageObject.getSubtype().contains(subtype)) { + mageObject.getSubtype().add(subtype); + } + return true; + } + +} diff --git a/Mage/src/mage/util/functions/ApplyToMageObject.java b/Mage/src/mage/util/functions/ApplyToMageObject.java new file mode 100644 index 00000000000..0fc968079cb --- /dev/null +++ b/Mage/src/mage/util/functions/ApplyToMageObject.java @@ -0,0 +1,40 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.util.functions; + +import mage.MageObject; +import mage.game.Game; + +/** + * + * @author LevelX2 + */ +public abstract class ApplyToMageObject { + + public abstract Boolean apply(Game game, MageObject mageObject); +} diff --git a/Mage/src/mage/util/functions/ApplyToPermanent.java b/Mage/src/mage/util/functions/ApplyToPermanent.java index bd926f7a58f..6178a63f364 100644 --- a/Mage/src/mage/util/functions/ApplyToPermanent.java +++ b/Mage/src/mage/util/functions/ApplyToPermanent.java @@ -7,7 +7,7 @@ import mage.game.permanent.Permanent; /** * @author noxx */ -public abstract class ApplyToPermanent implements Serializable { +public abstract class ApplyToPermanent extends ApplyToMageObject implements Serializable { public abstract Boolean apply(Game game, Permanent permanent); } diff --git a/Mage/src/mage/util/functions/CardTypeApplier.java b/Mage/src/mage/util/functions/CardTypeApplier.java new file mode 100644 index 00000000000..48a3eb54130 --- /dev/null +++ b/Mage/src/mage/util/functions/CardTypeApplier.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.util.functions; + +import mage.MageObject; +import mage.constants.CardType; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class CardTypeApplier extends ApplyToPermanent { + + private final CardType cardType; + + public CardTypeApplier(CardType cardType) { + this.cardType = cardType; + } + + @Override + public Boolean apply(Game game, Permanent permanent) { + if (!permanent.getCardType().contains(cardType)) { + permanent.getCardType().add(cardType); + } + return true; + } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + if (!mageObject.getCardType().contains(cardType)) { + mageObject.getCardType().add(cardType); + } + return true; + } +} diff --git a/Mage/src/mage/util/functions/CopyTokenFunction.java b/Mage/src/mage/util/functions/CopyTokenFunction.java index 001c8188202..9344d7d0bfc 100644 --- a/Mage/src/mage/util/functions/CopyTokenFunction.java +++ b/Mage/src/mage/util/functions/CopyTokenFunction.java @@ -57,28 +57,29 @@ public class CopyTokenFunction implements Function { } // A copy contains only the attributes of the basic card or basic Token that's the base of the permanent // else gained abililies would be copied too. + MageObject sourceObj = source; if (source instanceof PermanentToken) { sourceObj = ((PermanentToken) source).getToken(); // to show the source image, the original values have to be used - target.setOriginalExpansionSetCode(((Token)sourceObj).getOriginalExpansionSetCode()); - target.setOriginalCardNumber(((Token)sourceObj).getOriginalCardNumber()); - target.setCopySourceCard(((PermanentToken)source).getToken().getCopySourceCard()); + target.setOriginalExpansionSetCode(((Token) sourceObj).getOriginalExpansionSetCode()); + target.setOriginalCardNumber(((Token) sourceObj).getOriginalCardNumber()); + target.setCopySourceCard(((PermanentToken) source).getToken().getCopySourceCard()); } else if (source instanceof PermanentCard) { - if (((PermanentCard)source).isMorphed() || ((PermanentCard)source).isManifested()) { + if (((PermanentCard) source).isMorphed() || ((PermanentCard) source).isManifested()) { MorphAbility.setPermanentToFaceDownCreature(target); return target; } else { - sourceObj = ((PermanentCard) source).getCard(); - target.setOriginalExpansionSetCode(source.getExpansionSetCode()); - target.setOriginalCardNumber(source.getCardNumber()); - target.setCopySourceCard((Card)sourceObj); + sourceObj = ((PermanentCard) source).getCard(); + target.setOriginalExpansionSetCode(source.getExpansionSetCode()); + target.setOriginalCardNumber(source.getCardNumber()); + target.setCopySourceCard((Card) sourceObj); } } else { target.setOriginalExpansionSetCode(source.getExpansionSetCode()); target.setOriginalCardNumber(source.getCardNumber()); if (source instanceof Card) { - target.setCopySourceCard((Card)source); + target.setCopySourceCard(source); } } diff --git a/Mage/src/mage/util/functions/EmptyApplyToPermanent.java b/Mage/src/mage/util/functions/EmptyApplyToPermanent.java index 08ef79f6292..6deffcc5601 100644 --- a/Mage/src/mage/util/functions/EmptyApplyToPermanent.java +++ b/Mage/src/mage/util/functions/EmptyApplyToPermanent.java @@ -1,5 +1,6 @@ package mage.util.functions; +import mage.MageObject; import mage.game.Game; import mage.game.permanent.Permanent; @@ -8,8 +9,15 @@ import mage.game.permanent.Permanent; */ public class EmptyApplyToPermanent extends ApplyToPermanent { + @Override public Boolean apply(Game game, Permanent permanent) { // do nothing return true; } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + return true; + } + } diff --git a/Mage/src/mage/watchers/common/CommanderInfoWatcher.java b/Mage/src/mage/watchers/common/CommanderInfoWatcher.java index 963fcaf374e..6a81f5505e1 100644 --- a/Mage/src/mage/watchers/common/CommanderInfoWatcher.java +++ b/Mage/src/mage/watchers/common/CommanderInfoWatcher.java @@ -113,13 +113,12 @@ public class CommanderInfoWatcher extends Watcher { sb.append(" ").append(castCount).append(castCount == 1 ? " time" : " times").append(" casted from the command zone."); } this.addInfo(object, "Commander", sb.toString(), game); - if (checkCommanderDamage) { for (Map.Entry entry : damageToPlayer.entrySet()) { Player damagedPlayer = game.getPlayer(entry.getKey()); - sb.setLength(0); sb.append("Commander did ").append(entry.getValue()).append(" combat damage to player ").append(damagedPlayer.getLogName()).append("."); - this.addInfo(object, new StringBuilder("Commander").append(entry.getKey()).toString(), sb.toString(), game); + this.addInfo(object, "Commander" + entry.getKey(), + "Commander did " + entry.getValue() + " combat damage to player " + damagedPlayer.getLogName() + ".", game); } } } diff --git a/Mage/src/mage/watchers/common/FirstTimeStepWatcher.java b/Mage/src/mage/watchers/common/FirstTimeStepWatcher.java new file mode 100644 index 00000000000..028e77e1209 --- /dev/null +++ b/Mage/src/mage/watchers/common/FirstTimeStepWatcher.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.watchers.common; + +import mage.constants.WatcherScope; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.watchers.Watcher; + +/** + * The watcher checks if a specific phase event has already happened during the + * current turn. If not it returns false, otherwise true. + * + * @author LevelX2 + */ +public class FirstTimeStepWatcher extends Watcher { + + private final EventType eventType; + + public FirstTimeStepWatcher(EventType eventType) { + super(eventType.toString() + FirstTimeStepWatcher.class.getName(), WatcherScope.GAME); + this.eventType = eventType; + } + + public FirstTimeStepWatcher(final FirstTimeStepWatcher watcher) { + super(watcher); + this.eventType = watcher.eventType; + } + + @Override + public FirstTimeStepWatcher copy() { + return new FirstTimeStepWatcher(this); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == eventType) { + condition = true; + } + } + + @Override + public void reset() { + super.reset(); + } +} diff --git a/Mage/src/mage/watchers/common/LandfallWatcher.java b/Mage/src/mage/watchers/common/LandfallWatcher.java index f75d4c0d625..d4d14ba0bb1 100644 --- a/Mage/src/mage/watchers/common/LandfallWatcher.java +++ b/Mage/src/mage/watchers/common/LandfallWatcher.java @@ -17,14 +17,14 @@ import mage.watchers.Watcher; public class LandfallWatcher extends Watcher { Set playerPlayedLand = new HashSet<>(); - + public LandfallWatcher() { super("LandPlayed", WatcherScope.GAME); } public LandfallWatcher(final LandfallWatcher watcher) { super(watcher); - playerPlayedLand.addAll(playerPlayedLand); + playerPlayedLand.addAll(watcher.playerPlayedLand); } @Override @@ -35,8 +35,8 @@ public class LandfallWatcher extends Watcher { @Override public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.LAND) && !playerPlayedLand.contains(event.getPlayerId())) { + Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); + if (permanent != null && permanent.getCardType().contains(CardType.LAND) && !playerPlayedLand.contains(event.getPlayerId())) { playerPlayedLand.add(event.getPlayerId()); } } @@ -45,9 +45,9 @@ public class LandfallWatcher extends Watcher { @Override public void reset() { playerPlayedLand.clear(); - super.reset(); + super.reset(); } - + public boolean landPlayed(UUID playerId) { return playerPlayedLand.contains(playerId); } diff --git a/Mage/src/mage/watchers/common/ManaSpentToCastWatcher.java b/Mage/src/mage/watchers/common/ManaSpentToCastWatcher.java index 608e809d930..197932e2daf 100644 --- a/Mage/src/mage/watchers/common/ManaSpentToCastWatcher.java +++ b/Mage/src/mage/watchers/common/ManaSpentToCastWatcher.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.watchers.common; import mage.Mana; @@ -58,16 +57,16 @@ public class ManaSpentToCastWatcher extends Watcher { @Override public void watch(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone() == Zone.HAND) { + if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone() == Zone.HAND) { Spell spell = (Spell) game.getObject(event.getTargetId()); - if (this.getSourceId().equals(spell.getSourceId())) { - payment = spell.getSpellAbility().getManaCostsToPay().getPayment(); + if (spell != null && this.getSourceId().equals(spell.getSourceId())) { + payment = spell.getSpellAbility().getManaCostsToPay().getPayment(); } } if (event.getType() == GameEvent.EventType.ZONE_CHANGE && this.getSourceId().equals(event.getSourceId())) { - if (((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)) { - payment = null; - } + if (((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)) { + payment = null; + } } } diff --git a/Mage/src/mage/watchers/common/SoulbondWatcher.java b/Mage/src/mage/watchers/common/SoulbondWatcher.java index 4806133c740..ffe63d93f6b 100644 --- a/Mage/src/mage/watchers/common/SoulbondWatcher.java +++ b/Mage/src/mage/watchers/common/SoulbondWatcher.java @@ -109,7 +109,7 @@ public class SoulbondWatcher extends Watcher { Cards cards = new CardsImpl(); cards.add(chosen); controller.lookAtCards("Soulbond", cards, game); - if (controller.chooseUse(Outcome.Benefit, "Use Soulbond for recent " + permanent.getLogName() + "?", null, game)) { + if (controller.chooseUse(Outcome.Benefit, "Use Soulbond for recent " + permanent.getLogName() + "?", SoulbondAbility.getInstance(), game)) { chosen.setPairedCard(permanent.getId()); permanent.setPairedCard(chosen.getId()); if (!game.isSimulation()) { diff --git a/Utils/gen-card.pl b/Utils/gen-card.pl index d18b670427a..880b8d13ab2 100755 --- a/Utils/gen-card.pl +++ b/Utils/gen-card.pl @@ -1,245 +1,247 @@ -#!/usr/bin/perl -w - -#author: North - -use Text::Template; -use strict; - - -my $authorFile = 'author.txt'; -my $dataFile = 'mtg-cards-data.txt'; -my $setsFile = 'mtg-sets-data.txt'; -my $knownSetsFile = 'known-sets.txt'; -my $keywordsFile = 'keywords.txt'; - - -my %cards; -my %sets; -my %knownSets; -my %keywords; - -sub toCamelCase { - my $string = $_[0]; - $string =~ s/\b([\w']+)\b/ucfirst($1)/ge; - $string =~ s/[-,\s\']//g; - $string; -} - -sub fixCost { - my $string = $_[0]; - $string =~ s/{([2BUGRW])([2BUGRW])}/{$1\/$2}/g; - $string; -} - -my $author; -if (-e $authorFile) { - open (DATA, $authorFile); - $author = ; - chomp $author; - close(DATA); -} else { - $author = 'anonymous'; -} - -open (DATA, $dataFile) || die "can't open $dataFile"; -while(my $line = ) { - my @data = split('\\|', $line); - $cards{$data[0]}{$data[1]} = \@data; -} -close(DATA); - -open (DATA, $setsFile) || die "can't open $setsFile"; -while(my $line = ) { - my @data = split('\\|', $line); - $sets{$data[0]}= $data[1]; - #print "$data[0]--$data[1]\n" -} -close(DATA); - -open (DATA, $knownSetsFile) || die "can't open $knownSetsFile"; -while(my $line = ) { - my @data = split('\\|', $line); - $knownSets{$data[0]}= $data[1]; -} -close(DATA); - -open (DATA, $keywordsFile) || die "can't open $keywordsFile"; -while(my $line = ) { - my @data = split('\\|', $line); - $keywords{toCamelCase($data[0])}= $data[1]; -} -close(DATA); - -my %cardTypes; -$cardTypes{'Artifact'} = 'CardType.ARTIFACT'; -$cardTypes{'Conspiracy'} = 'CardType.CONSPIRACY'; -$cardTypes{'Creature'} = 'CardType.CREATURE'; -$cardTypes{'Enchantment'} = 'CardType.ENCHANTMENT'; -$cardTypes{'Instant'} = 'CardType.INSTANT'; -$cardTypes{'Land'} = 'CardType.LAND'; -$cardTypes{'Sorcery'} = 'CardType.SORCERY'; -$cardTypes{'Planeswalker'} = 'CardType.PLANESWALKER'; -$cardTypes{'Tribal'} = 'CardType.TRIBAL'; - -my %raritiesConversion; -$raritiesConversion{'C'} = 'COMMON'; -$raritiesConversion{'U'} = 'UNCOMMON'; -$raritiesConversion{'R'} = 'RARE'; -$raritiesConversion{'M'} = 'MYTHIC'; -$raritiesConversion{'Special'} = 'SPECIAL'; -$raritiesConversion{'Bonus'} = 'BONUS'; - -# Get card name -my $cardName = $ARGV[0]; -if(!$cardName) { - print 'Enter a card name: '; - $cardName = ; - chomp $cardName; -} - -if (!exists $cards{$cardName}) { - die "Card name doesn't exist: $cardName\n"; -} - -# Check if card is already implemented -foreach my $setName (keys %{$cards{$cardName}}) { - if (exists $knownSets{$setName}) { - my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; - if(-e $fileName) { - die "$cardName is already implemented (set found in: $setName).\n"; - } - } -} - -# Generate the cards -my $simpleOnly = $ARGV[1] || 'false'; -my $template = Text::Template->new(TYPE => 'FILE', SOURCE => 'cardClass.tmpl', DELIMITERS => [ '[=', '=]' ]); -my $templateExtended = Text::Template->new(TYPE => 'FILE', SOURCE => 'cardExtendedClass.tmpl', DELIMITERS => [ '[=', '=]' ]); -my %vars; - -$vars{'author'} = $author; -$vars{'name'} = $cardName; -$vars{'className'} = toCamelCase($cardName); - -if ($simpleOnly ne 'true') { - print "Files generated:\n"; -} -my $baseRarity = ''; -foreach my $setName (keys %{$cards{$cardName}}) { - if (exists $knownSets{$setName}) { - my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; - my $result; - - $vars{'set'} = $knownSets{$setName}; - $vars{'expansionSetCode'} = $sets{$setName}; - $vars{'cardNumber'} = $cards{$cardName}{$setName}[2]; - $vars{'rarity'} = $raritiesConversion{$cards{$cardName}{$setName}[3]}; - - if (!$baseRarity) { - $baseRarity = $cards{$cardName}{$setName}[3]; - - $vars{'manaCost'} = fixCost($cards{$cardName}{$setName}[4]); - $vars{'power'} = $cards{$cardName}{$setName}[6]; - $vars{'toughness'} = $cards{$cardName}{$setName}[7]; - - my @types; - $vars{'subType'} = ''; - my $type = $cards{$cardName}{$setName}[5]; - while ($type =~ m/([a-zA-Z]+)( )*/g) { - if (exists($cardTypes{$1})) { - push(@types, $cardTypes{$1}); - } else { - if (@types) { - $vars{'subType'} .= "\n this.subtype.add(\"$1\");"; - } else { - $vars{'subType'} .= "\n this.supertype.add(\"$1\");"; - } - } - } - $vars{'type'} = join(', ', @types); - - $vars{'abilitiesImports'} = ''; - $vars{'abilities'} = ''; - - my @abilities = split('\$', $cards{$cardName}{$setName}[8]); - foreach my $ability (@abilities) { - $ability =~ s/ .+?<\/i>//g; - - my $notKeyWord; - foreach my $keyword (keys %keywords) { - if (toCamelCase($ability) =~ m/^$keyword(?=[A-Z{\d]|$)/g) { - $notKeyWord = 'false'; - my @ka = split(', ', $ability); - foreach my $kw (@ka) { - my $kwUnchanged = $kw; - foreach my $kk (keys %keywords) { - if (toCamelCase($kw) =~ m/^$kk(?=[A-Z{\d]|$)/g) { - $kw = $kk; - } - } - if ($keywords{$kw}) { - $vars{'abilities'} .= "\n // " . ucfirst($kwUnchanged); - if ($keywords{$kw} eq 'instance') { - $vars{'abilities'} .= "\n this.addAbility(" . $kw . "Ability.getInstance());"; - } elsif ($keywords{$kw} eq 'new') { - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . "Ability());"; - } elsif ($keywords{$kw} eq 'number') { - $ability =~ m/(\b\d+?\b)/g; - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(' . $1 . '));'; - } elsif ($keywords{$kw} eq 'cost') { - $ability =~ m/({.*})/g; - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(new ManaCostsImpl("' . fixCost($1) . '")));'; - $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; - } elsif ($keywords{$kw} eq 'card, manaString') { - $ability =~ m/({.*})/g; - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, "' . fixCost($1) . '"));'; - } elsif ($keywords{$kw} eq 'card, cost') { - $ability =~ m/({.*})/g; - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, new ManaCostsImpl("' . fixCost($1) . '")));'; - $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; - } - - - $vars{'abilitiesImports'} .= "\nimport mage.abilities.keyword." . $kw . "Ability;"; - } else { - $vars{'abilities'} .= "\n // $kwUnchanged"; - if ($simpleOnly eq 'true') { - exit 0; - } - } - } - } - } - - if (!$notKeyWord) { - $vars{'abilities'} .= "\n // $ability"; - if ($simpleOnly eq 'true') { - exit 0; - } - } - } - if ($vars{'abilities'}) { - $vars{'abilities'} = "\n" . $vars{'abilities'}; - } - - $vars{'baseSet'} = $vars{'set'}; - $vars{'baseClassName'} = $vars{'className'}; - - $result = $template->fill_in(HASH => \%vars); - } else { - $vars{'rarityExtended'} = ''; - if ($baseRarity ne $cards{$cardName}{$setName}[3]) { - $vars{'rarityExtended'} = "\n this.rarity = Rarity.$raritiesConversion{$cards{$cardName}{$setName}[3]};"; - } - $result = $templateExtended->fill_in(HASH => \%vars); - } - - open CARD, "> $fileName"; - print CARD $result; - close CARD; - - print "$vars{'set'}.$vars{'className'}\n"; - } else { - print "Set not found in known sets: $setName\n"; - } -} +#!/usr/bin/perl -w + +#author: North + +use Text::Template; +use strict; + + +my $authorFile = 'author.txt'; +my $dataFile = 'mtg-cards-data.txt'; +my $setsFile = 'mtg-sets-data.txt'; +my $knownSetsFile = 'known-sets.txt'; +my $keywordsFile = 'keywords.txt'; + + +my %cards; +my %sets; +my %knownSets; +my %keywords; + +sub toCamelCase { + my $string = $_[0]; + $string =~ s/\b([\w']+)\b/ucfirst($1)/ge; + $string =~ s/[-,\s\']//g; + $string; +} + +sub fixCost { + my $string = $_[0]; + $string =~ s/{([2BUGRW])([2BUGRW])}/{$1\/$2}/g; + $string; +} + +my $author; +if (-e $authorFile) { + open (DATA, $authorFile); + $author = ; + chomp $author; + close(DATA); +} else { + $author = 'anonymous'; +} + +open (DATA, $dataFile) || die "can't open $dataFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $cards{$data[0]}{$data[1]} = \@data; +} +close(DATA); + +open (DATA, $setsFile) || die "can't open $setsFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $sets{$data[0]}= $data[1]; + #print "$data[0]--$data[1]\n" +} +close(DATA); + +open (DATA, $knownSetsFile) || die "can't open $knownSetsFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $knownSets{$data[0]}= $data[1]; +} +close(DATA); + +open (DATA, $keywordsFile) || die "can't open $keywordsFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $keywords{toCamelCase($data[0])}= $data[1]; +} +close(DATA); + +my %cardTypes; +$cardTypes{'Artifact'} = 'CardType.ARTIFACT'; +$cardTypes{'Conspiracy'} = 'CardType.CONSPIRACY'; +$cardTypes{'Creature'} = 'CardType.CREATURE'; +$cardTypes{'Enchantment'} = 'CardType.ENCHANTMENT'; +$cardTypes{'Instant'} = 'CardType.INSTANT'; +$cardTypes{'Land'} = 'CardType.LAND'; +$cardTypes{'Sorcery'} = 'CardType.SORCERY'; +$cardTypes{'Planeswalker'} = 'CardType.PLANESWALKER'; +$cardTypes{'Tribal'} = 'CardType.TRIBAL'; + +my %raritiesConversion; +$raritiesConversion{'C'} = 'COMMON'; +$raritiesConversion{'U'} = 'UNCOMMON'; +$raritiesConversion{'R'} = 'RARE'; +$raritiesConversion{'M'} = 'MYTHIC'; +$raritiesConversion{'Special'} = 'SPECIAL'; +$raritiesConversion{'Bonus'} = 'BONUS'; + +# Get card name +my $cardName = $ARGV[0]; +if(!$cardName) { + print 'Enter a card name: '; + $cardName = ; + chomp $cardName; +} + +if (!exists $cards{$cardName}) { + die "Card name doesn't exist: $cardName\n"; +} + +# Check if card is already implemented +foreach my $setName (keys %{$cards{$cardName}}) { + if (exists $knownSets{$setName}) { + my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; + if(-e $fileName) { + die "$cardName is already implemented (set found in: $setName).\n"; + } + } +} + +# Generate the cards +my $simpleOnly = $ARGV[1] || 'false'; +my $template = Text::Template->new(TYPE => 'FILE', SOURCE => 'cardClass.tmpl', DELIMITERS => [ '[=', '=]' ]); +my $templateExtended = Text::Template->new(TYPE => 'FILE', SOURCE => 'cardExtendedClass.tmpl', DELIMITERS => [ '[=', '=]' ]); +my %vars; + +$vars{'author'} = $author; +$vars{'name'} = $cardName; +$vars{'className'} = toCamelCase($cardName); + +if ($simpleOnly ne 'true') { + print "Files generated:\n"; +} +my $baseRarity = ''; +foreach my $setName (keys %{$cards{$cardName}}) { + if (exists $knownSets{$setName}) { + my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; + my $result; + + $vars{'set'} = $knownSets{$setName}; + $vars{'expansionSetCode'} = $sets{$setName}; + $vars{'cardNumber'} = $cards{$cardName}{$setName}[2]; + $vars{'rarity'} = $raritiesConversion{$cards{$cardName}{$setName}[3]}; + + if (!$baseRarity) { + $baseRarity = $cards{$cardName}{$setName}[3]; + + $vars{'manaCost'} = fixCost($cards{$cardName}{$setName}[4]); + $vars{'power'} = $cards{$cardName}{$setName}[6]; + $vars{'toughness'} = $cards{$cardName}{$setName}[7]; + + my @types; + $vars{'subType'} = ''; + my $type = $cards{$cardName}{$setName}[5]; + while ($type =~ m/([a-zA-Z]+)( )*/g) { + if (exists($cardTypes{$1})) { + push(@types, $cardTypes{$1}); + } else { + if (@types) { + $vars{'subType'} .= "\n this.subtype.add(\"$1\");"; + } else { + $vars{'subType'} .= "\n this.supertype.add(\"$1\");"; + } + } + } + $vars{'type'} = join(', ', @types); + + $vars{'abilitiesImports'} = ''; + $vars{'abilities'} = ''; + + my @abilities = split('\$', $cards{$cardName}{$setName}[8]); + foreach my $ability (@abilities) { + $ability =~ s/ .+?<\/i>//g; + + my $notKeyWord; + foreach my $keyword (keys %keywords) { + if (toCamelCase($ability) =~ m/^$keyword(?=[A-Z{\d]|$)/g) { + $notKeyWord = 'false'; + my @ka = split(', ', $ability); + foreach my $kw (@ka) { + my $kwUnchanged = $kw; + foreach my $kk (keys %keywords) { + if (toCamelCase($kw) =~ m/^$kk(?=[A-Z{\d]|$)/g) { + $kw = $kk; + } + } + if ($keywords{$kw}) { + $vars{'abilities'} .= "\n // " . ucfirst($kwUnchanged); + if ($keywords{$kw} eq 'instance') { + $vars{'abilities'} .= "\n this.addAbility(" . $kw . "Ability.getInstance());"; + } elsif ($keywords{$kw} eq 'new') { + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . "Ability());"; + } elsif ($keywords{$kw} eq 'color') { + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . "Ability(this.color));"; + } elsif ($keywords{$kw} eq 'number') { + $ability =~ m/(\b\d+?\b)/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(' . $1 . '));'; + } elsif ($keywords{$kw} eq 'cost') { + $ability =~ m/({.*})/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(new ManaCostsImpl("' . fixCost($1) . '")));'; + $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; + } elsif ($keywords{$kw} eq 'card, manaString') { + $ability =~ m/({.*})/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, "' . fixCost($1) . '"));'; + } elsif ($keywords{$kw} eq 'card, cost') { + $ability =~ m/({.*})/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, new ManaCostsImpl("' . fixCost($1) . '")));'; + $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; + } + + + $vars{'abilitiesImports'} .= "\nimport mage.abilities.keyword." . $kw . "Ability;"; + } else { + $vars{'abilities'} .= "\n // $kwUnchanged"; + if ($simpleOnly eq 'true') { + exit 0; + } + } + } + } + } + + if (!$notKeyWord) { + $vars{'abilities'} .= "\n // $ability"; + if ($simpleOnly eq 'true') { + exit 0; + } + } + } + if ($vars{'abilities'}) { + $vars{'abilities'} = "\n" . $vars{'abilities'}; + } + + $vars{'baseSet'} = $vars{'set'}; + $vars{'baseClassName'} = $vars{'className'}; + + $result = $template->fill_in(HASH => \%vars); + } else { + $vars{'rarityExtended'} = ''; + if ($baseRarity ne $cards{$cardName}{$setName}[3]) { + $vars{'rarityExtended'} = "\n this.rarity = Rarity.$raritiesConversion{$cards{$cardName}{$setName}[3]};"; + } + $result = $templateExtended->fill_in(HASH => \%vars); + } + + open CARD, "> $fileName"; + print CARD $result; + close CARD; + + print "$vars{'set'}.$vars{'className'}\n"; + } else { + print "Set not found in known sets: $setName\n"; + } +} diff --git a/Utils/keywords.txt b/Utils/keywords.txt index 0e7ad4bea2d..72f53816774 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -11,6 +11,7 @@ Dash|card, manaString| Deathtouch|instance| Delve|new| Dethrone|new| +Devoid|color| Defender|instance| Double Strike|instance| Dredge|number| @@ -32,6 +33,7 @@ Hexproof|instance| Indestructible|instance| Infect|instance| Intimidate|instance| +Ingest|new| Islandcycling|cost| Islandwalk|new| Level up|cost| @@ -42,6 +44,7 @@ Miracle|cost| Mountaincycling|cost| Mountainwalk|new| Morph|card, cost| +Myriad|new| Outlast|cost| Persist|new| Phasing|instance| diff --git a/Utils/known-sets.txt b/Utils/known-sets.txt index 37bea9d00ae..898921ec91f 100644 --- a/Utils/known-sets.txt +++ b/Utils/known-sets.txt @@ -9,11 +9,13 @@ Battle for Zendikar|battleforzendikar| Betrayers of Kamigawa|betrayersofkamigawa| Born of the Gods|bornofthegods| Champions of Kamigawa|championsofkamigawa| +Chronicles|chronicles| Clash Pack|clashpack| Classic Sixth Edition|classicsixthedition| Coldsnap|coldsnap| Commander 2013 Edition|commander2013| Commander 2014 Edition|commander2014| +Commander 2015|commander2015| Conflux|conflux| Dark Ascension|darkascension| Darksteel|darksteel| @@ -39,6 +41,7 @@ Duel Decks: Phyrexia vs. the Coalition|phyrexiavsthecoalition| Duel Decks: Sorin vs. Tibalt|sorinvstibalt| Duel Decks: Speed vs. Cunning|speedvscunning| Duel Decks: Venser vs. Koth|venservskoth| +Duel Decks: Zendikar vs. Eldrazi|zendikarvseldrazi| Eighth Edition|eighthedition| Eventide|eventide| Exodus|exodus| @@ -100,6 +103,7 @@ Morningtide|morningtide| Nemesis|nemesis| New Phyrexia|newphyrexia| Ninth Edition|ninthedition| +Oath of the Gatewatch|oathofthegatewatch| Odyssey|odyssey| Onslaught|onslaught| Planar Chaos|planarchaos| @@ -146,3 +150,4 @@ World Magic Cup Qualifier|worldmagiccupqualifier| Worldwake|worldwake| WPN Gateway|wpngateway| Zendikar|zendikar| +Zendikar Expeditions|zendikarexpeditions| \ No newline at end of file diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index e6fcd5d3cb4..c090ff1661d 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -4892,15 +4892,15 @@ Phantasmal Terrain|Fifth Edition|107|C|{U}{U}|Enchantment - Aura|||Enchant land$ Phantom Monster|Fifth Edition|108|U|{3}{U}|Creature - Illusion|3|3|Flying| Pirate Ship|Fifth Edition|109|R|{4}{U}|Creature - Human Pirate|4|3|Pirate Ship can't attack unless defending player controls an Island.${tap}: Pirate Ship deals 1 damage to target creature or player.$When you control no Islands, sacrifice Pirate Ship.| Broken Visage|Fifth Edition|11|R|{4}{B}|Instant|||Destroy target nonartifact attacking creature. It can't be regenerated. Put a black Spirit creature token with that creature's power and toughness onto the battlefield. Sacrifice the token at the beginning of the next end step.| -Flare|Fifth Edition|11|C|{2}{R}|Instant|||Flare deals 1 damage to target creature or player.$$Draw a card at the beginning of the next turn's upkeep.| Portent|Fifth Edition|110|C|{U}|Sorcery|||Look at the top three cards of target player's library, then put them back in any order. You may have that player shuffle his or her library.$Draw a card at the beginning of the next turn's upkeep.| Power Sink|Fifth Edition|111|U|{X}{U}|Instant|||Counter target spell unless its controller pays {X}. If he or she doesn't, that player taps all lands with mana abilities he or she controls and empties his or her mana pool.| Prodigal Sorcerer|Fifth Edition|112|C|{2}{U}|Creature - Human Wizard|1|1|{tap}: Prodigal Sorcerer deals 1 damage to target creature or player.| Psychic Venom|Fifth Edition|113|C|{1}{U}|Enchantment - Aura|||Enchant land$Whenever enchanted land becomes tapped, Psychic Venom deals 2 damage to that land's controller.| -Venom|Fifth Edition|113|C|{1}{G}{G}|Enchantment - Aura|||Enchant creature$Whenever enchanted creature blocks or becomes blocked by a non-Wall creature, destroy the other creature at end of combat.| Ray of Command|Fifth Edition|114|C|{3}{U}|Instant|||Untap target creature an opponent controls and gain control of it until end of turn. That creature gains haste until end of turn. When you lose control of the creature, tap it.| +Recall|Fifth Edition|115|R|{X}{X}{U}|Sorcery|||Discard X cards, then return a card from your graveyard to your hand for each card discarded this way. Exile Recall.| Reef Pirates|Fifth Edition|116|C|{1}{U}{U}|Creature - Zombie Pirate|2|2|Whenever Reef Pirates deals damage to an opponent, that player puts the top card of his or her library into his or her graveyard.| Remove Soul|Fifth Edition|117|C|{1}{U}|Instant|||Counter target creature spell.| +Sea Serpent|Fifth Edition|118|C|{5}{U}|Creature - Serpent|5|5|Sea Serpent can't attack unless defending player controls an Island.$$When you control no Islands, sacrifice Sea Serpent.| Sea Spirit|Fifth Edition|119|U|{4}{U}|Creature - Elemental Spirit|2|3|{U}: Sea Spirit gets +1/+0 until end of turn.| Carrion Ants|Fifth Edition|12|U|{2}{B}{B}|Creature - Insect|0|1|{1}: Carrion Ants gets +1/+1 until end of turn.| Sea Sprite|Fifth Edition|120|U|{1}{U}|Creature - Faerie|1|1|Flying, protection from red| @@ -4910,6 +4910,7 @@ Sibilant Spirit|Fifth Edition|123|R|{5}{U}|Creature - Spirit|5|6|Flying$Whenever Sleight of Mind|Fifth Edition|124|R|{U}|Instant|||Change the text of target spell or permanent by replacing all instances of one color word with another. (For example, you may change "target black spell" to "target blue spell." This effect lasts indefinitely.)| Soul Barrier|Fifth Edition|125|C|{2}{U}|Enchantment|||Whenever an opponent casts a creature spell, Soul Barrier deals 2 damage to that player unless he or she pays {2}.| Spell Blast|Fifth Edition|126|C|{X}{U}|Instant|||Counter target spell with converted mana cost X.| +Stasis|Fifth Edition|127|R|{1}{U}|Enchantment|||Players skip their untap steps.$$At the beginning of your upkeep, sacrifice Stasis unless you pay {U}.| Steal Artifact|Fifth Edition|128|U|{2}{U}{U}|Enchantment - Aura|||Enchant artifact$You control enchanted artifact.| Time Elemental|Fifth Edition|129|R|{2}{U}|Creature - Elemental|0|2|When Time Elemental attacks or blocks, at end of combat, sacrifice it and it deals 5 damage to you.${2}{U}{U}, {tap}: Return target permanent that isn't enchanted to its owner's hand.| Cloak of Confusion|Fifth Edition|13|C|{1}{B}|Enchantment - Aura|||Enchant creature you control$Whenever enchanted creature attacks and isn't blocked, you may have it assign no combat damage this turn. If you do, defending player discards a card at random.| @@ -4924,7 +4925,6 @@ Zephyr Falcon|Fifth Edition|137|C|{1}{U}|Creature - Bird|1|1|Flying, vigilance| Zur's Weirding|Fifth Edition|138|R|{3}{U}|Enchantment|||Players play with their hands revealed.$If a player would draw a card, he or she reveals it instead. Then any other player may pay 2 life. If a player does, put that card into its owner's graveyard. Otherwise, that player draws a card.| An-Havva Constable|Fifth Edition|139|R|{1}{G}{G}|Creature - Human|2|1+*|An-Havva Constable's toughness is equal to 1 plus the number of green creatures on the battlefield.| Cursed Land|Fifth Edition|14|U|{2}{B}{B}|Enchantment - Aura|||Enchant land$At the beginning of the upkeep of enchanted land's controller, Cursed Land deals 1 damage to that player.| -Mind Warp|Fifth Edition|14|U|{X}{3}{B}|Sorcery|||Look at target player's hand and choose X cards from it. That player discards those cards.| Aspect of Wolf|Fifth Edition|140|R|{1}{G}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +X/+Y, where X is half the number of Forests you control, rounded down, and Y is half the number of Forests you control, rounded up.| Aurochs|Fifth Edition|141|C|{3}{G}|Creature - Aurochs|2|3|Trample$Whenever Aurochs attacks, it gets +1/+0 until end of turn for each other attacking Aurochs.| Birds of Paradise|Fifth Edition|142|R|{G}|Creature - Bird|0|1|Flying${tap}: Add one mana of any color to your mana pool.| @@ -4960,6 +4960,7 @@ Killer Bees|Fifth Edition|169|U|{1}{G}{G}|Creature - Insect|0|1|Flying${G}: Kill Derelor|Fifth Edition|17|R|{3}{B}|Creature - Thrull|4|4|Black spells you cast cost {B} more to cast.| Ley Druid|Fifth Edition|170|C|{2}{G}|Creature - Human Druid|1|1|{tap}: Untap target land.| Lhurgoyf|Fifth Edition|171|R|{2}{G}{G}|Creature - Lhurgoyf|*|1+*|Lhurgoyf's power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1.| +Lifeforce|Fifth Edition|172|U|{G}{G}|Enchantment|||{G}{G}: Counter target black spell.| Living Artifact|Fifth Edition|173|R|{G}|Enchantment - Aura|||Enchant artifact$Whenever you're dealt damage, put that many vitality counters on Living Artifact.$At the beginning of your upkeep, you may remove a vitality counter from Living Artifact. If you do, you gain 1 life.| Living Lands|Fifth Edition|174|R|{3}{G}|Enchantment|||All Forests are 1/1 creatures that are still lands.| Llanowar Elves|Fifth Edition|175|C|{G}|Creature - Elf Druid|1|1|{tap}: Add {G} to your mana pool.| @@ -4978,6 +4979,7 @@ Scavenger Folk|Fifth Edition|185|C|{G}|Creature - Human|1|1|{G}, {tap}, Sacrific Scryb Sprites|Fifth Edition|186|C|{G}|Creature - Faerie|1|1|Flying| Shanodin Dryads|Fifth Edition|187|C|{G}|Creature - Nymph Dryad|1|1|Forestwalk| Shrink|Fifth Edition|188|C|{G}|Instant|||Target creature gets -5/-0 until end of turn.| +Stampede|Fifth Edition|189|R|{1}{G}{G}|Instant|||Attacking creatures get +1/+0 and gain trample until end of turn.| Drudge Skeletons|Fifth Edition|19|C|{1}{B}|Creature - Skeleton|1|1|{B}: Regenerate Drudge Skeletons. (The next time this creature would be destroyed this turn, it isn't. Instead tap it, remove all damage from it, and remove it from combat.)| Stream of Life|Fifth Edition|190|C|{X}{G}|Sorcery|||Target player gains X life.| Sylvan Library|Fifth Edition|191|R|{1}{G}|Enchantment|||At the beginning of your draw step, you may draw two additional cards. If you do, choose two cards in your hand drawn this turn. For each of those cards, pay 4 life or put the card on top of your library.| @@ -4985,8 +4987,9 @@ Tarpan|Fifth Edition|192|C|{G}|Creature - Horse|1|1|When Tarpan dies, you gain 1 Thicket Basilisk|Fifth Edition|193|U|{3}{G}{G}|Creature - Basilisk|2|4|Whenever Thicket Basilisk blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat.| Titania's Song|Fifth Edition|194|R|{3}{G}|Enchantment|||Each noncreature artifact loses all abilities and becomes an artifact creature with power and toughness each equal to its converted mana cost. If Titania's Song leaves the battlefield, this effect continues until end of turn.| Tranquility|Fifth Edition|195|C|{2}{G}|Sorcery|||Destroy all enchantments.| -Truce|Fifth Edition|195|R|{2}{W}|Instant|||Each player may draw up to two cards. For each card less than two a player draws this way, that player gains 2 life.| +Tsunami|Fifth Edition|196|U|{3}{G}|Sorcery|||Destroy all Islands.| Untamed Wilds|Fifth Edition|197|U|{2}{G}|Sorcery|||Search your library for a basic land card and put that card onto the battlefield. Then shuffle your library.| +Venom|Fifth Edition|198|C|{1}{G}{G}|Enchantment - Aura|||Enchant creature$Whenever enchanted creature blocks or becomes blocked by a non-Wall creature, destroy the other creature at end of combat.| Verduran Enchantress|Fifth Edition|199|R|{1}{G}{G}|Creature - Human Druid|0|2|Whenever you cast an enchantment spell, you may draw a card.| Animate Dead|Fifth Edition|2|U|{1}{B}|Enchantment - Aura|||Enchant creature card in a graveyard$When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it.$Enchanted creature gets -1/-0.| Erg Raiders|Fifth Edition|20|C|{1}{B}|Creature - Human Warrior|2|3|At the beginning of your end step, if Erg Raiders didn't attack this turn, Erg Raiders deals 2 damage to you unless it came under your control this turn.| @@ -5023,6 +5026,7 @@ Fireball|Fifth Edition|227|C|{X}{R}|Sorcery|||Fireball deals X damage divided ev Firebreathing|Fifth Edition|228|C|{R}|Enchantment - Aura|||Enchant creature${R}: Enchanted creature gets +1/+0 until end of turn.| Flame Spirit|Fifth Edition|229|U|{4}{R}|Creature - Elemental Spirit|2|3|{R}: Flame Spirit gets +1/+0 until end of turn.| Fallen Angel|Fifth Edition|23|U|{3}{B}{B}|Creature - Angel|3|3|Flying$Sacrifice a creature: Fallen Angel gets +2/+1 until end of turn.| +Flare|Fifth Edition|230|C|{2}{R}|Instant|||Flare deals 1 damage to target creature or player.$$Draw a card at the beginning of the next turn's upkeep.| Flashfires|Fifth Edition|231|U|{3}{R}|Sorcery|||Destroy all Plains.| Game of Chaos|Fifth Edition|232|R|{R}{R}{R}|Sorcery|||Flip a coin. If you win the flip, you gain 1 life and target opponent loses 1 life, and you decide whether to flip again. If you lose the flip, you lose 1 life and that opponent gains 1 life, and that player decides whether to flip again. Double the life stakes with each flip.| Giant Strength|Fifth Edition|233|C|{R}{R}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +2/+2.| @@ -5034,7 +5038,6 @@ Goblin Warrens|Fifth Edition|238|R|{2}{R}|Enchantment|||{2}{R}, Sacrifice two Go The Wretched|Fifth Edition|239|R|{3}{B}{B}|Creature - Demon|2|5|At end of combat, gain control of all creatures blocking The Wretched for as long as you control The Wretched.| Hill Giant|Fifth Edition|239|C|{3}{R}|Creature - Giant|3|3|| Fear|Fifth Edition|24|C|{B}{B}|Enchantment - Aura|||Enchant creature (Target a creature as you cast this. This card enters the battlefield attached to that creature.)$Enchanted creature has fear. (It can't be blocked except by artifact creatures and/or black creatures.)| -Stampede|Fifth Edition|24|R|{1}{G}{G}|Instant|||Attacking creatures get +1/+0 and gain trample until end of turn.| Hurloon Minotaur|Fifth Edition|240|C|{1}{R}{R}|Creature - Minotaur|2|3|| Imposing Visage|Fifth Edition|241|C|{R}|Enchantment - Aura|||Enchant creature$Enchanted creature can't be blocked except by two or more creatures.| Incinerate|Fifth Edition|242|C|{1}{R}|Instant|||Incinerate deals 3 damage to target creature or player. A creature dealt damage this way can't be regenerated this turn.| @@ -5065,8 +5068,11 @@ Sabretooth Tiger|Fifth Edition|264|C|{2}{R}|Creature - Cat|2|1|First strike| Shatter|Fifth Edition|265|C|{1}{R}|Instant|||Destroy target artifact.| Shatterstorm|Fifth Edition|266|U|{2}{R}{R}|Sorcery|||Destroy all artifacts. They can't be regenerated.| Shivan Dragon|Fifth Edition|267|R|{4}{R}{R}|Creature - Dragon|5|5|Flying${R}: Shivan Dragon gets +1/+0 until end of turn.| +Smoke|Fifth Edition|268|R|{R}{R}|Enchantment|||Players can't untap more than one creature during their untap steps.| Stone Giant|Fifth Edition|269|U|{2}{R}{R}|Creature - Giant|3|4|{tap}: Target creature you control with toughness less than Stone Giant's power gains flying until end of turn. Destroy that creature at the beginning of the next end step.| +Gloom|Fifth Edition|27|U|{2}{B}|Enchantment|||White spells cost {3} more to cast.$Activated abilities of white enchantments cost {3} more to activate.| Stone Rain|Fifth Edition|270|C|{2}{R}|Sorcery|||Destroy target land.| +Stone Spirit|Fifth Edition|271|U|{4}{R}|Creature - Elemental Spirit|4|3|Stone Spirit can't be blocked by creatures with flying.| The Brute|Fifth Edition|272|C|{1}{R}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +1/+0.${R}{R}{R}: Regenerate enchanted creature.| Wall of Fire|Fifth Edition|273|U|{1}{R}{R}|Creature - Wall|0|5|Defender (This creature can't attack.)${R}: Wall of Fire gets +1/+0 until end of turn.| Wall of Stone|Fifth Edition|274|U|{1}{R}{R}|Creature - Wall|0|8|Defender (This creature can't attack.)| @@ -5076,7 +5082,6 @@ Abbey Gargoyles|Fifth Edition|277|U|{2}{W}{W}{W}|Creature - Gargoyle|3|4|Flying, Akron Legionnaire|Fifth Edition|278|R|{6}{W}{W}|Creature - Giant Soldier|8|4|Except for creatures named Akron Legionnaire and artifact creatures, creatures you control can't attack.| Alabaster Potion|Fifth Edition|279|C|{X}{W}{W}|Instant|||Choose one - Target player gains X life; or prevent the next X damage that would be dealt to target creature or player this turn.| Greater Werewolf|Fifth Edition|28|U|{4}{B}|Creature - Werewolf|2|4|At end of combat, put a -0/-2 counter on each creature blocking or blocked by Greater Werewolf.| -Stasis|Fifth Edition|28|R|{1}{U}|Enchantment|||Players skip their untap steps.$$At the beginning of your upkeep, sacrifice Stasis unless you pay {U}.| Angry Mob|Fifth Edition|280|U|{2}{W}{W}|Creature - Human|2+*|2+*|Trample$As long as it's your turn, Angry Mob's power and toughness are each equal to 2 plus the number of Swamps your opponents control. As long as it's not your turn, Angry Mob's power and toughness are each 2.| Animate Wall|Fifth Edition|281|R|{W}|Enchantment - Aura|||Enchant Wall$Enchanted Wall can attack as though it didn't have defender.| Arenson's Aura|Fifth Edition|282|U|{2}{W}|Enchantment|||{W}, Sacrifice an enchantment: Destroy target enchantment.$${3}{U}{U}: Counter target enchantment spell.| @@ -5086,7 +5091,6 @@ Aysen Bureaucrats|Fifth Edition|285|C|{1}{W}|Creature - Human Advisor|1|1|{tap}: Benalish Hero|Fifth Edition|286|C|{W}|Creature - Human Soldier|1|1|Banding (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding you control are blocking or being blocked by a creature, you divide that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)| Blessed Wine|Fifth Edition|287|C|{1}{W}|Instant|||You gain 1 life.$Draw a card at the beginning of the next turn's upkeep.| Blinking Spirit|Fifth Edition|288|R|{3}{W}|Creature - Spirit|2|2|{0}: Return Blinking Spirit to its owner's hand.| -Spirit Link|Fifth Edition|288|U|{W}|Enchantment - Aura|||Enchant creature (Target a creature as you cast this. This card enters the battlefield attached to that creature.)$Whenever enchanted creature deals damage, you gain that much life.| Brainwash|Fifth Edition|289|C|{W}|Enchantment - Aura|||Enchant creature$Enchanted creature can't attack unless its controller pays {3}.| Hecatomb|Fifth Edition|29|R|{1}{B}{B}|Enchantment|||When Hecatomb enters the battlefield, sacrifice Hecatomb unless you sacrifice four creatures.$Tap an untapped Swamp you control: Hecatomb deals 1 damage to target creature or player.| Caribou Range|Fifth Edition|290|R|{2}{W}{W}|Enchantment - Aura|||Enchant land you control$Enchanted land has "{W}{W}, {tap}: Put a 0/1 white Caribou creature token onto the battlefield."$Sacrifice a Caribou token: You gain 1 life.| @@ -5142,6 +5146,8 @@ Serra Bestiary|Fifth Edition|336|U|{W}{W}|Enchantment - Aura|||Enchant creature$ Serra Paladin|Fifth Edition|337|U|{2}{W}{W}|Creature - Human Knight|2|2|{tap}: Prevent the next 1 damage that would be dealt to target creature or player this turn.${1}{W}{W}, {tap}: Target creature gains vigilance until end of turn.| Shield Wall|Fifth Edition|339|C|{1}{W}|Instant|||Creatures you control get +0/+2 until end of turn.| Krovikan Fetish|Fifth Edition|34|C|{2}{B}|Enchantment - Aura|||Enchant creature$When Krovikan Fetish enters the battlefield, draw a card at the beginning of the next turn's upkeep.$Enchanted creature gets +1/+1.| +Spirit Link|Fifth Edition|340|U|{W}|Enchantment - Aura|||Enchant creature (Target a creature as you cast this. This card enters the battlefield attached to that creature.)$Whenever enchanted creature deals damage, you gain that much life.| +Truce|Fifth Edition|341|R|{2}{W}|Instant|||Each player may draw up to two cards. For each card less than two a player draws this way, that player gains 2 life.| Tundra Wolves|Fifth Edition|342|C|{W}|Creature - Wolf|1|1|First strike (This creature deals combat damage before creatures without first strike.)| Wall of Swords|Fifth Edition|343|U|{3}{W}|Creature - Wall|3|5|Defender, flying (This creature can't attack, and it can block creatures with flying.)| White Knight|Fifth Edition|344|U|{W}{W}|Creature - Human Knight|2|2|First strike (This creature deals combat damage before creatures without first strike.)$Protection from black (This creature can't be blocked, targeted, dealt damage, or enchanted by anything black.)| @@ -5194,6 +5200,7 @@ Joven's Tools|Fifth Edition|386|U|{6}|Artifact|||{4}, {tap}: Target creature can Library of Leng|Fifth Edition|387|U|{1}|Artifact|||You have no maximum hand size.$If an effect causes you to discard a card, discard it, but you may put it on top of your library instead of into your graveyard.| Mana Vault|Fifth Edition|388|R|{1}|Artifact|||Mana Vault doesn't untap during your untap step.$At the beginning of your upkeep, you may pay {4}. If you do, untap Mana Vault.$At the beginning of your draw step, if Mana Vault is tapped, it deals 1 damage to you.${tap}: Add {3} to your mana pool.| Meekstone|Fifth Edition|389|R|{1}|Artifact|||Creatures with power 3 or greater don't untap during their controllers' untap steps.| +Mind Warp|Fifth Edition|39|U|{X}{3}{B}|Sorcery|||Look at target player's hand and choose X cards from it. That player discards those cards.| Millstone|Fifth Edition|390|R|{2}|Artifact|||{2}, {tap}: Target player puts the top two cards of his or her library into his or her graveyard.| Nevinyrral's Disk|Fifth Edition|391|R|{4}|Artifact|||Nevinyrral's Disk enters the battlefield tapped.${1}, {tap}: Destroy all artifacts, creatures, and enchantments.| Obelisk of Undoing|Fifth Edition|392|R|{1}|Artifact|||{6}, {tap}: Return target permanent you both own and control to your hand.| @@ -5202,6 +5209,7 @@ Pentagram of the Ages|Fifth Edition|394|R|{4}|Artifact|||{4}, {tap}: The next ti Primal Clay|Fifth Edition|395|R|{4}|Artifact Creature - Shapeshifter|*|*|As Primal Clay enters the battlefield, it becomes your choice of a 3/3 artifact creature, a 2/2 artifact creature with flying, or a 1/6 Wall artifact creature with defender in addition to its other types. (A creature with defender can't attack.)| Rod of Ruin|Fifth Edition|396|U|{4}|Artifact|||{3}, {tap}: Rod of Ruin deals 1 damage to target creature or player.| Serpent Generator|Fifth Edition|397|R|{6}|Artifact|||{4}, {tap}: Put a 1/1 colorless Snake artifact creature token onto the battlefield. It has "Whenever this creature deals damage to a player, that player gets a poison counter." (A player with ten or more poison counters loses the game.)| +Shapeshifter|Fifth Edition|398|U|{6}|Artifact Creature - Shapeshifter|*|7-*|As Shapeshifter enters the battlefield, choose a number between 0 and 7.$At the beginning of your upkeep, you may choose a number between 0 and 7.$Shapeshifter's power is equal to the last chosen number and its toughness is equal to 7 minus that number.| Skull Catapult|Fifth Edition|399|U|{4}|Artifact|||{1}, {tap}, Sacrifice a creature: Skull Catapult deals 2 damage to target creature or player.| Bad Moon|Fifth Edition|4|R|{1}{B}|Enchantment|||Black creatures get +1/+1.| Shield Bearer|Fifth Edition|4|C|{1}{W}|Creature - Human Soldier|0|3|Banding (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding you control are blocking or being blocked by a creature, you divide that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)| @@ -5264,14 +5272,11 @@ Nether Shadow|Fifth Edition|45|R|{B}{B}|Creature - Spirit|1|1|Haste$At the begin Nightmare|Fifth Edition|46|R|{5}{B}|Creature - Nightmare Horse|*|*|Flying$Nightmare's power and toughness are each equal to the number of Swamps you control.| Paralyze|Fifth Edition|47|C|{B}|Enchantment - Aura|||Enchant creature$When Paralyze enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.$At the beginning of the upkeep of enchanted creature's controller, that player may pay {4}. If he or she does, untap the creature.| Pestilence|Fifth Edition|48|C|{2}{B}{B}|Enchantment|||At the beginning of the end step, if no creatures are on the battlefield, sacrifice Pestilence.${B}: Pestilence deals 1 damage to each creature and each player.| -Gloom|Fifth Edition|49|U|{2}{B}|Enchantment|||White spells cost {3} more to cast.$Activated abilities of white enchantments cost {3} more to activate.| Pit Scorpion|Fifth Edition|49|C|{2}{B}|Creature - Scorpion|1|1|Whenever Pit Scorpion deals damage to a player, that player gets a poison counter. (A player with ten or more poison counters loses the game.)| Black Knight|Fifth Edition|5|U|{B}{B}|Creature - Human Knight|2|2|First strike (This creature deals combat damage before creatures without first strike.)$Protection from white (This creature can't be blocked, targeted, dealt damage, or enchanted by anything white.)| Plague Rats|Fifth Edition|50|C|{2}{B}|Creature - Rat|*|*|Plague Rats's power and toughness are each equal to the number of creatures named Plague Rats on the battlefield.| Pox|Fifth Edition|51|R|{B}{B}{B}|Sorcery|||Each player loses a third of his or her life, then discards a third of the cards in his or her hand, then sacrifices a third of the creatures he or she controls, then sacrifices a third of the lands he or she controls. Round up each time.| Rag Man|Fifth Edition|52|R|{2}{B}{B}|Creature - Human Minion|2|1|{B}{B}{B}, {tap}: Target opponent reveals his or her hand and discards a creature card at random. Activate this ability only during your turn.| -Sea Serpent|Fifth Edition|52|C|{5}{U}|Creature - Serpent|5|5|Sea Serpent can't attack unless defending player controls an Island.$$When you control no Islands, sacrifice Sea Serpent.| -Tsunami|Fifth Edition|52|U|{3}{G}|Sorcery|||Destroy all Islands.| Raise Dead|Fifth Edition|53|C|{B}|Sorcery|||Return target creature card from your graveyard to your hand.| Scathe Zombies|Fifth Edition|54|C|{2}{B}|Creature - Zombie|2|2|| Sengir Autocrat|Fifth Edition|55|R|{3}{B}|Creature - Human|2|2|When Sengir Autocrat enters the battlefield, put three 0/1 black Serf creature tokens onto the battlefield.$When Sengir Autocrat leaves the battlefield, exile all Serf tokens.| @@ -5282,12 +5287,9 @@ Blight|Fifth Edition|6|U|{B}{B}|Enchantment - Aura|||Enchant land$When enchanted Justice|Fifth Edition|6|U|{2}{W}{W}|Enchantment|||At the beginning of your upkeep, sacrifice Justice unless you pay {W}{W}.$$Whenever a red creature or spell deals damage, Justice deals that much damage to that creature's or spell's controller.| Thrull Retainer|Fifth Edition|60|U|{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +1/+1.$Sacrifice Thrull Retainer: Regenerate enchanted creature.| Torture|Fifth Edition|61|C|{B}|Enchantment - Aura|||Enchant creature${1}{B}: Put a -1/-1 counter on enchanted creature.| -Stone Spirit|Fifth Edition|61|U|{4}{R}|Creature - Elemental Spirit|4|3|Stone Spirit can't be blocked by creatures with flying.| -Shapeshifter|Fifth Edition|62|U|{6}|Artifact Creature - Shapeshifter|*|7-*|As Shapeshifter enters the battlefield, choose a number between 0 and 7.$At the beginning of your upkeep, you may choose a number between 0 and 7.$Shapeshifter's power is equal to the last chosen number and its toughness is equal to 7 minus that number.| Touch of Death|Fifth Edition|62|C|{2}{B}|Sorcery|||Touch of Death deals 1 damage to target player. You gain 1 life.$$Draw a card at the beginning of the next turn's upkeep.| Unholy Strength|Fifth Edition|63|C|{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +2/+1.| Vampire Bats|Fifth Edition|64|C|{B}|Creature - Bat|0|1|Flying (This creature can't be blocked except by creatures with flying or reach.)${B}: Vampire Bats gets +1/+0 until end of turn. Activate this ability no more than twice each turn.| -Smoke|Fifth Edition|64|R|{R}{R}|Enchantment|||Players can't untap more than one creature during their untap steps.| Wall of Bone|Fifth Edition|65|U|{2}{B}|Creature - Skeleton Wall|1|4|Defender (This creature can't attack.)${B}: Regenerate Wall of Bone. (The next time this creature would be destroyed this turn, it isn't. Instead tap it, remove all damage from it, and remove it from combat.)| Warp Artifact|Fifth Edition|66|R|{B}{B}|Enchantment - Aura|||Enchant artifact$At the beginning of the upkeep of enchanted artifact's controller, Warp Artifact deals 1 damage to that player.| Weakness|Fifth Edition|67|C|{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets -2/-1.| @@ -5317,11 +5319,9 @@ Force Spike|Fifth Edition|88|C|{U}|Instant|||Counter target spell unless its con Forget|Fifth Edition|89|R|{U}{U}|Sorcery|||Target player discards two cards, then draws as many cards as he or she discarded this way.| Bog Wraith|Fifth Edition|9|U|{3}{B}|Creature - Wraith|3|3|Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)| Gaseous Form|Fifth Edition|90|C|{2}{U}|Enchantment - Aura|||Enchant creature$Prevent all combat damage that would be dealt to and dealt by enchanted creature.| -Lifeforce|Fifth Edition|90|U|{G}{G}|Enchantment|||{G}{G}: Counter target black spell.| Glacial Wall|Fifth Edition|91|U|{2}{U}|Creature - Wall|0|7|Defender (This creature can't attack.)| Homarid Warrior|Fifth Edition|92|C|{4}{U}|Creature - Homarid Warrior|3|3|{U}: Homarid Warrior gains shroud until end of turn and doesn't untap during your next untap step. Tap Homarid Warrior. (A permanent with shroud can't be the target of spells or abilities.)| Hurkyl's Recall|Fifth Edition|93|R|{1}{U}|Instant|||Return all artifacts target player owns to his or her hand.| -Recall|Fifth Edition|93|R|{X}{X}{U}|Sorcery|||Discard X cards, then return a card from your graveyard to your hand for each card discarded this way. Exile Recall.| Hydroblast|Fifth Edition|94|U|{U}|Instant|||Choose one - Counter target spell if it's red; or destroy target permanent if it's red.| Juxtapose|Fifth Edition|95|R|{3}{U}|Sorcery|||You and target player exchange control of the creature you each control with the highest converted mana cost. Then exchange control of artifacts the same way. If two or more permanents a player controls are tied for highest cost, their controller chooses one of them.| Krovikan Sorcerer|Fifth Edition|96|C|{2}{U}|Creature - Human Wizard|1|1|{tap}, Discard a nonblack card: Draw a card.${tap}, Discard a black card: Draw two cards, then discard one of them.| @@ -5893,6 +5893,8 @@ Path to Exile|Friday Night Magic|182|U|{W}|Instant|||Exile target creature. Its Serum Visions|Friday Night Magic|183|C|{U}|Sorcery|||Draw a card.$Scry 2. (To scry 2, look at the top two cards of your library, then put any number of them on the bottom of your library and the rest on top in any order.)| Orator of Ojutai|Friday Night Magic|184|U|{1}{W}|Creature - Bird Monk|0|4|Defneder, flying$As an additional cost to cast Orator of Ojutai, you may reveal a Dragon card from your hand.$When Orator of Ojutai enters the battlefield, if you revealed a Dragon card or controlled a Dragon as you cast Orator of Ojutai, draw a card.| Ultimate Price|Friday Night Magic|185|U|{1}{B}|Instant|||Destroy target monocolored creature.| +Roast|Friday Night Magic|186|U|{1}{R}|Sorcery|||Roast deals 5 damage to target creature without flying.| +Anticipate|Friday Night Magic|186|C|{1}{U}|Instant|||Look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.| Angel of Salvation|Future Sight|1|R|{6}{W}{W}|Creature - Angel|5|5|Flash; convoke (Each creature you tap while casting this spell reduces its cost by {1} or by one mana of that creature's color.)$Flying$When Angel of Salvation enters the battlefield, prevent the next 5 damage that would be dealt this turn to any number of target creatures and/or players, divided as you choose.| Knight of Sursi|Future Sight|10|C|{3}{W}|Creature - Human Knight|2|2|Flying; flanking (Whenever a creature without flanking blocks this creature, the blocking creature gets -1/-1 until end of turn.)$Suspend 3-{W} (Rather than cast this card from your hand, you may pay {W} and exile it with three time counters on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost. It has haste.)| Haze of Rage|Future Sight|100|U|{1}{R}|Sorcery|||Buyback {2} (You may pay an additional {2} as you cast this spell. If you do, put this card into your hand as it resolves.)$Creatures you control get +1/+0 until end of turn.$Storm (When you cast this spell, copy it for each spell cast before it this turn.)| @@ -6119,6 +6121,8 @@ Scaleguard Sentinels|Game Day|43|U|{G}{G}|Creature - Human Soldier|2|3|As an add Thunderbreak Regent|Game Day|44|R|{2}{R}{R}|Creature - Dragon|4|4|Flying$Whenever a Dragon you control becomes the target of a spell or ability your opponent controls, Thunderbreak Regent deals 3 damage to that player.| Conclave Naturalists|Game Day|45|U|{4}{G}|Creature - Dryad|4|4|When Conclave Naturalists enters the battlefield, you may destroy target artifact or enchantment.| Languish|Game Day|46|R|{2}{B}{B}|Sorcery|||All creatures get -4/-4 until end of turn.| +Stasis Snare|Game Day|47|U|{1}{W}{W}|Enchantment|||Flash$When Stasis Snare enters the battlefield, exile target creature an opponent controls until Stasis Snare leaves the battlefield.| +Radiant Flames|Game Day|48|R|{2}{R}|Sorcery||Converge - Radiant Flames deals X damage to each creature, where X is the number of colors of mana spent to cast Radiant Flames.| Aerial Maneuver|Gatecrash|1|C|{1}{W}|Instant|||Target creature gets +1/+1 and gains flying and first strike until end of turn.| Debtor's Pulpit|Gatecrash|10|U|{4}{W}|Enchantment - Aura|||Enchant land$Enchanted land has "{tap}: Tap target creature."| Massive Raid|Gatecrash|100|C|{1}{R}{R}|Instant|||Massive Raid deals damage to target creature or player equal to the number of creatures you control.| @@ -6708,10 +6712,10 @@ Dire Wolves|Ice Age|118|C|{2}{G}|Creature - Wolf|2|2|Dire Wolves has banding as Earthlore|Ice Age|119|C|{G}|Enchantment - Aura|||Enchant land you control$Tap enchanted land: Target blocking creature gets +1/+2 until end of turn. Activate this ability only if enchanted land is untapped.| Fear|Ice Age|12|C|{B}{B}|Enchantment - Aura|||Enchant creature (Target a creature as you cast this. This card enters the battlefield attached to that creature.)$Enchanted creature has fear. (It can't be blocked except by artifact creatures and/or black creatures.)| Elder Druid|Ice Age|120|R|{3}{G}|Creature - Elf Cleric Druid|2|2|{3}{G}, {tap}: You may tap or untap target artifact, creature, or land.| -Wiitigo|Ice Age|120|R|{3}{G}{G}{G}|Creature - Yeti|0|0|Wiitigo enters the battlefield with six +1/+1 counters on it.$At the beginning of your upkeep, put a +1/+1 counter on Wiitigo if it has blocked or been blocked since your last upkeep. Otherwise, remove a +1/+1 counter from it.| +Wiitigo|Ice Age|164|R|{3}{G}{G}{G}|Creature - Yeti|0|0|Wiitigo enters the battlefield with six +1/+1 counters on it.$At the beginning of your upkeep, put a +1/+1 counter on Wiitigo if it has blocked or been blocked since your last upkeep. Otherwise, remove a +1/+1 counter from it.| Essence Filter|Ice Age|121|C|{1}{G}{G}|Sorcery|||Destroy all enchantments or all nonwhite enchantments.| Fanatical Fever|Ice Age|122|U|{2}{G}{G}|Instant|||Target creature gets +3/+0 and gains trample until end of turn.| -Reclamation|Ice Age|122|R|{2}{G}{W}|Enchantment|||Black creatures can't attack unless their controller sacrifices a land for each black creature he or she controls that's attacking.| +Reclamation|Ice Age|378|R|{2}{G}{W}|Enchantment|||Black creatures can't attack unless their controller sacrifices a land for each black creature he or she controls that's attacking.| Folk of the Pines|Ice Age|123|C|{4}{G}|Creature - Dryad|2|5|{1}{G}: Folk of the Pines gets +1/+0 until end of turn.| Forbidden Lore|Ice Age|124|R|{2}{G}|Enchantment - Aura|||Enchant land$Enchanted land has "{tap}: Target creature gets +2/+1 until end of turn."| Forgotten Lore|Ice Age|125|U|{G}|Sorcery|||Target opponent chooses a card in your graveyard. You may pay {G}. If you do, repeat this process except that opponent can't choose a card already chosen for Forgotten Lore. Then put the last chosen card into your hand.| @@ -6731,7 +6735,7 @@ Hurricane|Ice Age|137|U|{X}{G}|Sorcery|||Hurricane deals X damage to each creatu Johtull Wurm|Ice Age|138|U|{5}{G}|Creature - Wurm|6|6|Whenever Johtull Wurm becomes blocked, it gets -2/-1 until end of turn for each creature blocking it beyond the first.| Juniper Order Druid|Ice Age|139|C|{2}{G}|Creature - Human Cleric Druid|1|1|{tap}: Untap target land.| Foul Familiar|Ice Age|14|C|{2}{B}|Creature - Spirit|3|1|Foul Familiar can't block.${B}, Pay 1 life: Return Foul Familiar to its owner's hand.| -Mind Warp|Ice Age|14|U|{X}{3}{B}|Sorcery|||Look at target player's hand and choose X cards from it. That player discards those cards.| +Mind Warp|Ice Age|36|U|{X}{3}{B}|Sorcery|||Look at target player's hand and choose X cards from it. That player discards those cards.| Lhurgoyf|Ice Age|140|R|{2}{G}{G}|Creature - Lhurgoyf|*|1+*|Lhurgoyf's power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1.| Lure|Ice Age|141|U|{1}{G}{G}|Enchantment - Aura|||Enchant creature$All creatures able to block enchanted creature do so.| Maddening Wind|Ice Age|142|U|{2}{G}|Enchantment - Aura|||Enchant creature$Cumulative upkeep {G} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)$At the beginning of the upkeep of enchanted creature's controller, Maddening Wind deals 2 damage to that player.| @@ -6745,7 +6749,7 @@ Ritual of Subdual|Ice Age|149|R|{4}{G}{G}|Enchantment|||Cumulative upkeep {2} (This creature can't attack.)$Sacrifice Tinder Wall: Add {R}{R} to your mana pool.${R}, Sacrifice Tinder Wall: Tinder Wall deals 2 damage to target creature it's blocking.| Touch of Vitae|Ice Age|159|U|{2}{G}|Instant|||Until end of turn, target creature gains haste and "{0}: Untap this creature. Activate this ability only once."$Draw a card at the beginning of the next turn's upkeep.| Gaze of Pain|Ice Age|16|C|{1}{B}|Sorcery|||Until end of turn, whenever a creature you control attacks and isn't blocked, you may choose to have it deal damage equal to its power to a target creature. If you do, it assigns no combat damage this turn.| -Warning|Ice Age|16|C|{W}|Instant|||Prevent all combat damage that would be dealt by target attacking creature this turn.| +Warning|Ice Age|279|C|{W}|Instant|||Prevent all combat damage that would be dealt by target attacking creature this turn.| Venomous Breath|Ice Age|161|U|{3}{G}|Instant|||Choose target creature. At end of combat, destroy all creatures that blocked or were blocked by it this turn.| Wall of Pine Needles|Ice Age|162|U|{3}{G}|Creature - Plant Wall|3|3|Defender (This creature can't attack.)${G}: Regenerate Wall of Pine Needles.| Whiteout|Ice Age|163|U|{1}{G}|Instant|||All creatures lose flying until end of turn.$Sacrifice a snow land: Return Whiteout from your graveyard to your hand.| @@ -6856,7 +6860,7 @@ Heal|Ice Age|254|C|{W}|Instant|||Prevent the next 1 damage that would be dealt t Hipparion|Ice Age|255|U|{1}{W}|Creature - Horse|1|3|Hipparion can't block creatures with power 3 or greater unless you pay {1}.| Kelsinko Ranger|Ice Age|257|C|{W}|Creature - Human|1|1|{1}{W}: Target green creature gains first strike until end of turn.| Kjeldoran Elite Guard|Ice Age|258|U|{3}{W}|Creature - Human Soldier|2|2|{tap}: Target creature gets +2/+2 until end of turn. When that creature leaves the battlefield this turn, sacrifice Kjeldoran Elite Guard. Activate this ability only during combat.| -Kjeldoran Guard|Ice Age|258|C|{1}{W}|Creature - Human Soldier|1|1|{tap}: Target creature gets +1/+1 until end of turn. When that creature leaves the battlefield this turn, sacrifice Kjeldoran Guard. Activate this ability only during combat and only if defending player controls no snow lands.| +Kjeldoran Guard|Ice Age|259|C|{1}{W}|Creature - Human Soldier|1|1|{tap}: Target creature gets +1/+1 until end of turn. When that creature leaves the battlefield this turn, sacrifice Kjeldoran Guard. Activate this ability only during combat and only if defending player controls no snow lands.| Knight of Stromgald|Ice Age|26|U|{B}{B}|Creature - Human Knight|2|1|Protection from white${B}: Knight of Stromgald gains first strike until end of turn.${B}{B}: Knight of Stromgald gets +1/+0 until end of turn.| Kjeldoran Knight|Ice Age|260|R|{W}{W}|Creature - Human Knight|1|1|Banding (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding you control are blocking or being blocked by a creature, you divide that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)${1}{W}: Kjeldoran Knight gets +1/+0 until end of turn.${W}{W}: Kjeldoran Knight gets +0/+2 until end of turn.| Kjeldoran Phalanx|Ice Age|261|R|{5}{W}|Creature - Human Soldier|2|5|First strike; banding (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding you control are blocking or being blocked by a creature, you divide that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)| @@ -6922,7 +6926,7 @@ Sunstone|Ice Age|316|U|{3}|Artifact|||{2}, Sacrifice a snow land: Prevent all co Time Bomb|Ice Age|317|R|{4}|Artifact|||At the beginning of your upkeep, put a time counter on Time Bomb.${1}, {tap}, Sacrifice Time Bomb: Time Bomb deals damage equal to the number of time counters on it to each creature and each player.| Urza's Bauble|Ice Age|318|U|{0}|Artifact|||{tap}, Sacrifice Urza's Bauble: Look at a card at random in target player's hand. You draw a card at the beginning of the next turn's upkeep.| Vexing Arcanix|Ice Age|319|R|{4}|Artifact|||{3}, {tap}: Target player names a card, then reveals the top card of his or her library. If it's the named card, the player puts it into his or her hand. Otherwise, the player puts it into his or her graveyard and Vexing Arcanix deals 2 damage to him or her.| -Land Cap|Ice Age|319|R||Land|||Land Cap doesn't untap during your untap step if it has a depletion counter on it.$At the beginning of your upkeep, remove a depletion counter from Land Cap.${tap}: Add {W} or {U} to your mana pool. Put a depletion counter on Land Cap.| +Land Cap|Ice Age|338|R||Land|||Land Cap doesn't untap during your untap step if it has a depletion counter on it.$At the beginning of your upkeep, remove a depletion counter from Land Cap.${tap}: Add {W} or {U} to your mana pool. Put a depletion counter on Land Cap.| Leshrac's Sigil|Ice Age|32|U|{B}{B}|Enchantment|||Whenever an opponent casts a green spell, you may pay {B}{B}. If you do, look at that player's hand and choose a card from it. The player discards that card.${B}{B}: Return Leshrac's Sigil to its owner's hand.| Vibrating Sphere|Ice Age|320|R|{4}|Artifact|||As long as it's your turn, creatures you control get +2/+0.$As long as it's not your turn, creatures you control get -0/-2.| Walking Wall|Ice Age|321|U|{4}|Artifact Creature - Wall|0|6|Defender${3}: Walking Wall gets +3/-1 until end of turn and can attack this turn as though it didn't have defender. Activate this ability only once each turn.| @@ -6933,24 +6937,24 @@ Zuran Orb|Ice Age|325|U|{0}|Artifact|||Sacrifice a land: You gain 2 life.| Adarkar Wastes|Ice Age|326|R||Land|||{tap}: Add {1} to your mana pool.${tap}: Add {W} or {U} to your mana pool. Adarkar Wastes deals 1 damage to you.| Brushland|Ice Age|327|R||Land|||{tap}: Add {1} to your mana pool.${tap}: Add {G} or {W} to your mana pool. Brushland deals 1 damage to you.| Forest|Ice Age|328|L||Basic Land - Forest|||G| -Forest|Ice Age|328|L||Basic Land - Forest|||G| -Forest|Ice Age|328|L||Basic Land - Forest|||G| +Forest|Ice Age|329|L||Basic Land - Forest|||G| +Forest|Ice Age|330|L||Basic Land - Forest|||G| Lim-Dul's Cohort|Ice Age|33|C|{1}{B}{B}|Creature - Zombie|2|3|Whenever Lim-Dûl's Cohort blocks or becomes blocked by a creature, that creature can't be regenerated this turn.| Glacial Chasm|Ice Age|331|U||Land|||Cumulative upkeep-Pay 2 life. (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)$When Glacial Chasm enters the battlefield, sacrifice a land.$Creatures you control can't attack.$Prevent all damage that would be dealt to you.| Halls of Mist|Ice Age|332|R||Land|||Cumulative upkeep {1} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)$Creatures that attacked during their controller's last turn can't attack.| Ice Floe|Ice Age|333|U||Land|||You may choose not to untap Ice Floe during your untap step.${tap}: Tap target creature without flying that's attacking you. It doesn't untap during its controller's untap step for as long as Ice Floe remains tapped.| Island|Ice Age|334|L||Basic Land - Island|||U| -Island|Ice Age|334|L||Basic Land - Island|||U| -Island|Ice Age|334|L||Basic Land - Island|||U| +Island|Ice Age|335|L||Basic Land - Island|||U| +Island|Ice Age|336|L||Basic Land - Island|||U| Karplusan Forest|Ice Age|337|R||Land|||{tap}: Add {1} to your mana pool.${tap}: Add {R} or {G} to your mana pool. Karplusan Forest deals 1 damage to you.| Lava Tubes|Ice Age|339|R||Land|||Lava Tubes doesn't untap during your untap step if it has a depletion counter on it.$At the beginning of your upkeep, remove a depletion counter from Lava Tubes.${tap}: Add {B} or {R} to your mana pool. Put a depletion counter on Lava Tubes.| Lim-Dul's Hex|Ice Age|34|U|{1}{B}|Enchantment|||At the beginning of your upkeep, for each player, Lim-Dûl's Hex deals 1 damage to that player unless he or she pays {B} or {3}.| Mountain|Ice Age|340|L||Basic Land - Mountain|||R| -Mountain|Ice Age|340|L||Basic Land - Mountain|||R| -Mountain|Ice Age|340|L||Basic Land - Mountain|||R| -Plains|Ice Age|343|L||Basic Land - Plains|||W| -Plains|Ice Age|343|L||Basic Land - Plains|||W| +Mountain|Ice Age|341|L||Basic Land - Mountain|||R| +Mountain|Ice Age|342|L||Basic Land - Mountain|||R| Plains|Ice Age|343|L||Basic Land - Plains|||W| +Plains|Ice Age|344|L||Basic Land - Plains|||W| +Plains|Ice Age|345|L||Basic Land - Plains|||W| River Delta|Ice Age|346|R||Land|||River Delta doesn't untap during your untap step if it has a depletion counter on it.$At the beginning of your upkeep, remove a depletion counter from River Delta.${tap}: Add {U} or {B} to your mana pool. Put a depletion counter on River Delta.| Snow-Covered Forest|Ice Age|347|L||Basic Snow Land - Forest|||G| Snow-Covered Island|Ice Age|348|L||Basic Snow Land - Island|||U| @@ -6958,9 +6962,9 @@ Snow-Covered Mountain|Ice Age|349|L||Basic Snow Land - Mountain|||R| Mind Ravel|Ice Age|35|C|{2}{B}|Sorcery|||Target player discards a card.$Draw a card at the beginning of the next turn's upkeep.| Snow-Covered Plains|Ice Age|350|L||Basic Snow Land - Plains|||W| Snow-Covered Swamp|Ice Age|351|L||Basic Snow Land - Swamp|||B| -Swamp|Ice Age|351|L||Basic Land - Swamp|||B| -Swamp|Ice Age|351|L||Basic Land - Swamp|||B| -Swamp|Ice Age|351|L||Basic Land - Swamp|||B| +Swamp|Ice Age|353|L||Basic Land - Swamp|||B| +Swamp|Ice Age|354|L||Basic Land - Swamp|||B| +Swamp|Ice Age|355|L||Basic Land - Swamp|||B| Sulfurous Springs|Ice Age|352|R||Land|||{tap}: Add {1} to your mana pool.${tap}: Add {B} or {R} to your mana pool. Sulfurous Springs deals 1 damage to you.| Timberline Ridge|Ice Age|356|R||Land|||Timberline Ridge doesn't untap during your untap step if it has a depletion counter on it.$At the beginning of your upkeep, remove a depletion counter from Timberline Ridge.${tap}: Add {R} or {G} to your mana pool. Put a depletion counter on Timberline Ridge.| Underground River|Ice Age|357|R||Land|||{tap}: Add {1} to your mana pool.${tap}: Add {U} or {B} to your mana pool. Underground River deals 1 damage to you.| @@ -6972,7 +6976,7 @@ Diabolic Vision|Ice Age|362|U|{U}{B}|Sorcery|||Look at the top five cards of you Earthlink|Ice Age|363|R|{3}{B}{R}{G}|Enchantment|||At the beginning of your upkeep, sacrifice Earthlink unless you pay {2}.$Whenever a creature dies, that creature's controller sacrifices a land.| Elemental Augury|Ice Age|364|R|{U}{B}{R}|Enchantment|||{3}: Look at the top three cards of target player's library, then put them back in any order.| Essence Vortex|Ice Age|365|U|{1}{U}{B}|Instant|||Destroy target creature unless its controller pays life equal to its toughness. A creature destroyed this way can't be regenerated.| -Justice|Ice Age|366|U|{2}{W}{W}|Enchantment|||At the beginning of your upkeep, sacrifice Justice unless you pay {W}{W}.$$Whenever a red creature or spell deals damage, Justice deals that much damage to that creature's or spell's controller.| +Justice|Ice Age|256|U|{2}{W}{W}|Enchantment|||At the beginning of your upkeep, sacrifice Justice unless you pay {W}{W}.$$Whenever a red creature or spell deals damage, Justice deals that much damage to that creature's or spell's controller.| Fiery Justice|Ice Age|366|R|{R}{G}{W}|Sorcery|||Fiery Justice deals 5 damage divided as you choose among any number of target creatures and/or players. Target opponent gains 5 life.| Fire Covenant|Ice Age|367|U|{1}{B}{R}|Instant|||As an additional cost to cast Fire Covenant, pay X life.$Fire Covenant deals X damage divided as you choose among any number of target creatures.| Flooded Woodlands|Ice Age|368|R|{2}{U}{B}|Enchantment|||Green creatures can't attack unless their controller sacrifices a land for each green creature he or she controls that's attacking.| @@ -6994,13 +6998,13 @@ Stormbind|Ice Age|382|R|{1}{R}{G}|Enchantment|||{2}, Discard a card at random: S Wings of Aesthir|Ice Age|383|U|{W}{U}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +1/+0 and has flying and first strike.| Minion of Tevesh Szat|Ice Age|39|R|{4}{B}{B}{B}|Creature - Demon Minion|4|4|At the beginning of your upkeep, Minion of Tevesh Szat deals 2 damage to you unless you pay {B}{B}.${tap}: Target creature gets +3/-2 until end of turn.| Burnt Offering|Ice Age|4|C|{B}|Instant|||As an additional cost to cast Burnt Offering, sacrifice a creature.$Add X mana in any combination of {B} and/or {R} to your mana pool, where X is the sacrificed creature's converted mana cost.| -Trailblazer|Ice Age|4|R|{2}{G}{G}|Instant|||Target creature is unblockable this turn.| +Trailblazer|Ice Age|160|R|{2}{G}{G}|Instant|||Target creature is unblockable this turn.| Mole Worms|Ice Age|40|U|{2}{B}|Creature - Worm|1|1|You may choose not to untap Mole Worms during your untap step.${tap}: Tap target land. It doesn't untap during its controller's untap step for as long as Mole Worms remains tapped.| Moor Fiend|Ice Age|41|C|{3}{B}|Creature - Horror|3|3|Swampwalk| Necropotence|Ice Age|42|R|{B}{B}{B}|Enchantment|||Skip your draw step.$Whenever you discard a card, exile that card from your graveyard.$Pay 1 life: Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step.| Norritt|Ice Age|43|C|{3}{B}|Creature - Imp|1|1|{tap}: Untap target blue creature.${tap}: Choose target non-Wall creature the active player has controlled continuously since the beginning of the turn. That creature attacks this turn if able. If it doesn't, destroy it at the beginning of the next end step. Activate this ability only before attackers are declared.| Oath of Lim-Dul|Ice Age|44|R|{3}{B}|Enchantment|||Whenever you lose life, for each 1 life you lost, sacrifice a permanent other than Oath of Lim-Dûl unless you discard a card. (Damage dealt to you causes you to lose life.)${B}{B}: Draw a card.| -Melee|Ice Age|44|U|{4}{R}|Instant|||Cast Melee only during your turn and only during combat before blockers are declared.$You choose which creatures block this combat and how those creatures block.$Whenever a creature attacks and isn't blocked this combat, untap it and remove it from combat.| +Melee|Ice Age|200|U|{4}{R}|Instant|||Cast Melee only during your turn and only during combat before blockers are declared.$You choose which creatures block this combat and how those creatures block.$Whenever a creature attacks and isn't blocked this combat, untap it and remove it from combat.| Pestilence Rats|Ice Age|45|C|{2}{B}|Creature - Rat|*|3|Pestilence Rats's power is equal to the number of other Rats on the battlefield. (For example, as long as there are two other Rats on the battlefield, Pestilence Rats's power and toughness are 2/3.)| Pox|Ice Age|46|R|{B}{B}{B}|Sorcery|||Each player loses a third of his or her life, then discards a third of the cards in his or her hand, then sacrifices a third of the creatures he or she controls, then sacrifices a third of the lands he or she controls. Round up each time.| Seizures|Ice Age|47|C|{1}{B}|Enchantment - Aura|||Enchant creature$Whenever enchanted creature becomes tapped, Seizures deals 3 damage to that creature's controller unless that player pays {3}.| @@ -7028,7 +7032,7 @@ Dreams of the Dead|Ice Age|66|U|{3}{U}|Enchantment|||{1}{U}: Return target white Enervate|Ice Age|67|C|{1}{U}|Instant|||Tap target artifact, creature, or land.$$Draw a card at the beginning of the next turn's upkeep.| Errant Minion|Ice Age|68|C|{2}{U}|Enchantment - Aura|||Enchant creature$At the beginning of the upkeep of enchanted creature's controller, that player may pay any amount of mana. Errant Minion deals 2 damage to that player. Prevent X of that damage, where X is the amount of mana that player paid this way.| Essence Flare|Ice Age|69|C|{U}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +2/+0.$At the beginning of the upkeep of enchanted creature's controller, put a -0/-1 counter on that creature.| -Flare|Ice Age|69|C|{2}{R}|Instant|||Flare deals 1 damage to target creature or player.$$Draw a card at the beginning of the next turn's upkeep.| +Flare|Ice Age|185|C|{2}{R}|Instant|||Flare deals 1 damage to target creature or player.$$Draw a card at the beginning of the next turn's upkeep.| Dark Banishing|Ice Age|7|C|{2}{B}|Instant|||Destroy target nonblack creature. It can't be regenerated.| Force Void|Ice Age|70|U|{2}{U}|Instant|||Counter target spell unless its controller pays {1}.$$Draw a card at the beginning of the next turn's upkeep.| Glacial Wall|Ice Age|71|U|{2}{U}|Creature - Wall|0|7|Defender (This creature can't attack.)| @@ -7040,7 +7044,7 @@ Illusionary Presence|Ice Age|76|R|{1}{U}{U}|Creature - Illusion|2|2|Cumulative u Tor Giant|Ice Age|76|C|{3}{R}|Creature - Giant|3|3|| Illusionary Terrain|Ice Age|77|U|{U}{U}|Enchantment|||Cumulative upkeep {2} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)$As Illusionary Terrain enters the battlefield, choose two basic land types.$Basic lands of the first chosen type are the second chosen type.| Illusionary Wall|Ice Age|78|C|{4}{U}|Creature - Illusion Wall|7|4|Defender, flying, first strike$Cumulative upkeep {U} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)| -Aggression|Ice Age|78|U|{2}{R}|Enchantment - Aura|||Enchant non-Wall creature$Enchanted creature has first strike and trample.$At the beginning of the end step of enchanted creature's controller, destroy that creature if it didn't attack this turn.| +Aggression|Ice Age|169|U|{2}{R}|Enchantment - Aura|||Enchant non-Wall creature$Enchanted creature has first strike and trample.$At the beginning of the end step of enchanted creature's controller, destroy that creature if it didn't attack this turn.| Illusions of Grandeur|Ice Age|79|R|{3}{U}|Enchantment|||Cumulative upkeep {2} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)$When Illusions of Grandeur enters the battlefield, you gain 20 life.$When Illusions of Grandeur leaves the battlefield, you lose 20 life.| Dark Ritual|Ice Age|8|C|{B}|Instant|||Add {B}{B}{B} to your mana pool.| Infuse|Ice Age|80|C|{2}{U}|Instant|||Untap target artifact, creature, or land.$$Draw a card at the beginning of the next turn's upkeep.| @@ -7054,15 +7058,15 @@ Mystic Remora|Ice Age|87|C|{U}|Enchantment|||Cumulative upkeep {1} (At the be Phantasmal Mount|Ice Age|88|U|{1}{U}|Creature - Illusion Horse|1|1|Flying${tap}: Target creature you control with toughness 2 or less gets +1/+1 and gains flying until end of turn. When Phantasmal Mount leaves the battlefield this turn, sacrifice that creature. When the creature leaves the battlefield this turn, sacrifice Phantasmal Mount.| Polar Kraken|Ice Age|89|R|{8}{U}{U}{U}|Creature - Kraken|11|11|Trample$Polar Kraken enters the battlefield tapped.$Cumulative upkeep-Sacrifice a land. (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)| Demonic Consultation|Ice Age|9|U|{B}|Instant|||Name a card. Exile the top six cards of your library, then reveal cards from the top of your library until you reveal the named card. Put that card into your hand and exile all other cards revealed this way.| -Formation|Ice Age|9|R|{1}{W}|Instant|||Target creature gains banding until end of turn. (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding a player controls are blocking or being blocked by a creature, that player divides that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)$Draw a card at the beginning of the next turn's upkeep.| +Formation|Ice Age|249|R|{1}{W}|Instant|||Target creature gains banding until end of turn. (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding a player controls are blocking or being blocked by a creature, that player divides that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)$Draw a card at the beginning of the next turn's upkeep.| Portent|Ice Age|90|C|{U}|Sorcery|||Look at the top three cards of target player's library, then put them back in any order. You may have that player shuffle his or her library.$Draw a card at the beginning of the next turn's upkeep.| Power Sink|Ice Age|91|C|{X}{U}|Instant|||Counter target spell unless its controller pays {X}. If he or she doesn't, that player taps all lands with mana abilities he or she controls and empties his or her mana pool.| -Blizzard|Ice Age|91|R|{G}{G}|Enchantment|||Cast Blizzard only if you control a snow land.$Cumulative upkeep {2} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)$Creatures with flying don't untap during their controllers' untap steps.| +Blizzard|Ice Age|115|R|{G}{G}|Enchantment|||Cast Blizzard only if you control a snow land.$Cumulative upkeep {2} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)$Creatures with flying don't untap during their controllers' untap steps.| Ray of Command|Ice Age|92|C|{3}{U}|Instant|||Untap target creature an opponent controls and gain control of it until end of turn. That creature gains haste until end of turn. When you lose control of the creature, tap it.| Ray of Erasure|Ice Age|93|C|{U}|Instant|||Target player puts the top card of his or her library into his or her graveyard.$Draw a card at the beginning of the next turn's upkeep.| Reality Twist|Ice Age|94|R|{U}{U}{U}|Enchantment|||Cumulative upkeep {1}{U}{U} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.)$If tapped for mana, Plains produce {R}, Swamps produce {G}, Mountains produce {W}, and Forests produce {B} instead of any other type.| Sea Spirit|Ice Age|95|U|{4}{U}|Creature - Elemental Spirit|2|3|{U}: Sea Spirit gets +1/+0 until end of turn.| -Rally|Ice Age|95|C|{W}{W}|Instant|||Blocking creatures get +1/+1 until end of turn.| +Rally|Ice Age|272|C|{W}{W}|Instant|||Blocking creatures get +1/+1 until end of turn.| Shyft|Ice Age|96|R|{4}{U}|Creature - Shapeshifter|4|2|At the beginning of your upkeep, you may have Shyft become the color or colors of your choice. (This effect lasts indefinitely.)| Sibilant Spirit|Ice Age|97|R|{5}{U}|Creature - Spirit|5|6|Flying$Whenever Sibilant Spirit attacks, defending player may draw a card.| Silver Erne|Ice Age|98|U|{3}{U}|Creature - Bird|2|2|Flying, trample| @@ -7813,6 +7817,7 @@ Damnation|Judge Promo|94|R|{2}{B}{B}|Sorcery|||Destroy all creatures. They can't Dualcaster Mage|Judge Promo|95|R|{1}{R}{R}|Creature - Human Wizard|2|2|Flash$When Dualcaster Mage enters the battlefield, copy target instant or sorcery spell. You may choose new targets for the copy.| Feldon of the Third Path|Judge Promo|96|M|{1}{R}{R}|Legendary Creature - Human Artificer|2|3|{2}{R}, {tap}: Put a token onto the battlefield that's a copy of target creature card in your graveyard, except it's an artifact in addition to its other types. It gains haste. Sacrifice it at the beginning of the next end step.| Ravages of War|Judge Promo|97|R|{3}{W}|Sorcery|||Destroy all lands.| +Rishadan Port|Judge Promo|98|R||Land|||{tap}: Add {1} to your mana pool.$${1}, {tap}: Tap target land.| Ancestor's Chosen|Judgment|1|U|{5}{W}{W}|Creature - Human Cleric|4|4|First strike (This creature deals combat damage before creatures without first strike.)$When Ancestor's Chosen enters the battlefield, you gain 1 life for each card in your graveyard.| Funeral Pyre|Judgment|10|C|{W}|Instant|||Exile target card from a graveyard. Its owner puts a 1/1 white Spirit creature token with flying onto the battlefield.| Spellgorger Barbarian|Judgment|100|C|{3}{R}|Creature - Human Nightmare Barbarian|3|1|When Spellgorger Barbarian enters the battlefield, discard a card at random.$When Spellgorger Barbarian leaves the battlefield, draw a card.| @@ -8387,7 +8392,7 @@ Havoc Demon|Legions|74|R|{5}{B}{B}|Creature - Demon|5|5|Flying$When Havoc Demon Hollow Specter|Legions|75|R|{1}{B}{B}|Creature - Specter|2|2|Flying$Whenever Hollow Specter deals combat damage to a player, you may pay {X}. If you do, that player reveals X cards from his or her hand and you choose one of them. That player discards that card.| Infernal Caretaker|Legions|76|C|{3}{B}|Creature - Human Cleric|2|2|Morph {3}{B} You may cast this card face downn as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)$When Infernal Caretaker is turned face up, return all Zombie cards from all graveyards to their owners' hands.| Noxious Ghoul|Legions|77|U|{3}{B}{B}|Creature - Zombie|3|3|Whenever Noxious Ghoul or another Zombie enters the battlefield, all non-Zombie creatures get -1/-1 until end of turn.| -Phage the Untouchable|Legions|78|R|{3}{B}{B}{B}{B}|Legendary Creature - Zombie Minion|4|4|When Phage the Untouchable enters the battlefield, if you didn't cast it from your hand, you lose the game.$Whenever Phage deals combat damage to a creature, destroy that creature. It can't be regenerated.$Whenever Phage deals combat damage to a player, that player loses the game.| +Phage the Untouchable|Legions|78|R|{3}{B}{B}{B}{B}|Legendary Creature - Avatar Minion|4|4|When Phage the Untouchable enters the battlefield, if you didn't cast it from your hand, you lose the game.$Whenever Phage deals combat damage to a creature, destroy that creature. It can't be regenerated.$Whenever Phage deals combat damage to a player, that player loses the game.| Scion of Darkness|Legions|79|R|{5}{B}{B}{B}|Creature - Avatar|6|6|Trample$Whenever Scion of Darkness deals combat damage to a player, you may put target creature card from that player's graveyard onto the battlefield under your control.$Cycling {3} ({3}, Discard this card: Draw a card.)| Daru Mender|Legions|8|U|{W}|Creature - Human Cleric|1|1|Morph {W} You may cast this card face downn as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)$When Daru Mender is turned face up, regenerate target creature.| Skinthinner|Legions|80|C|{1}{B}|Creature - Zombie|2|1|Morph {3}{B}{B} You may cast this card face downn as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)$When Skinthinner is turned face up, destroy target nonblack creature. It can't be regenerated.| @@ -11920,7 +11925,7 @@ Tidal Wave|Mirage|100|U|{2}{U}|Instant|||Put a 5/5 blue Wall creature token with Vaporous Djinn|Mirage|101|U|{2}{U}{U}|Creature - Djinn|3|4|Flying$At the beginning of your upkeep, Vaporous Djinn phases out unless you pay {U}{U}. (While it's phased out, it's treated as though it doesn't exist. It phases in before you untap during your next untap step.)| Wave Elemental|Mirage|102|U|{2}{U}{U}|Creature - Elemental|2|3|{U}, {tap}, Sacrifice Wave Elemental: Tap up to three target creatures without flying.| Afiya Grove|Mirage|103|R|{1}{G}|Enchantment|||Afiya Grove enters the battlefield with three +1/+1 counters on it.$At the beginning of your upkeep, move a +1/+1 counter from Afiya Grove onto target creature.$When Afiya Grove has no +1/+1 counters on it, sacrifice it.| -Thirst|Mirage|104|C|{2}{U}|Enchantment - Aura|||Enchant creature$When Thirst enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.$At the beginning of your upkeep, sacrifice Thirst unless you pay {U}.| +Thirst|Mirage|99|C|{2}{U}|Enchantment - Aura|||Enchant creature$When Thirst enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.$At the beginning of your upkeep, sacrifice Thirst unless you pay {U}.| Armor of Thorns|Mirage|104|C|{1}{G}|Enchantment - Aura|||You may cast Armor of Thorns as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step.$Enchant nonblack creature$Enchanted creature gets +2/+2.| Barbed Foliage|Mirage|105|U|{2}{G}{G}|Enchantment|||Whenever a creature attacks you, it loses flanking until end of turn.$$Whenever a creature without flying attacks you, Barbed Foliage deals 1 damage to it.| Brushwagg|Mirage|106|R|{1}{G}{G}|Creature - Brushwagg|3|2|Whenever Brushwagg blocks or becomes blocked, it gets -2/+2 until end of turn.| @@ -11929,7 +11934,7 @@ Crash of Rhinos|Mirage|108|C|{6}{G}{G}|Creature - Rhino|8|4|Trample| Cycle of Life|Mirage|109|R|{1}{G}{G}|Enchantment|||Return Cycle of Life to its owner's hand: Target creature you cast this turn becomes 0/1 until your next upkeep. At the beginning of your next upkeep, put a +1/+1 counter on that creature.| Choking Sands|Mirage|11|C|{1}{B}{B}|Sorcery|||Destroy target non-Swamp land. If that land was nonbasic, Choking Sands deals 2 damage to the land's controller.| Decomposition|Mirage|110|U|{1}{G}|Enchantment - Aura|||Enchant black creature$Enchanted creature has "Cumulative upkeep-Pay 1 life." (At the beginning of its controller's upkeep, that player puts an age counter on it, then sacrifices it unless he or she pays its upkeep cost for each age counter on it.)$When enchanted creature dies, its controller loses 2 life.| -Wellspring|Mirage|110|R|{1}{G}{W}|Enchantment - Aura|||Enchant land$When Wellspring enters the battlefield, gain control of enchanted land until end of turn.$At the beginning of your upkeep, untap enchanted land. You gain control of that land until end of turn.| +Wellspring|Mirage|348|R|{1}{G}{W}|Enchantment - Aura|||Enchant land$When Wellspring enters the battlefield, gain control of enchanted land until end of turn.$At the beginning of your upkeep, untap enchanted land. You gain control of that land until end of turn.| Early Harvest|Mirage|111|R|{1}{G}{G}|Instant|||Target player untaps all basic lands he or she controls.| Fallow Earth|Mirage|112|U|{2}{G}|Sorcery|||Put target land on top of its owner's library.| Femeref Archers|Mirage|113|U|{2}{G}|Creature - Human Archer|2|2|{tap}: Femeref Archers deals 4 damage to target attacking creature with flying.| @@ -12025,7 +12030,7 @@ Subterranean Spirit|Mirage|195|R|{3}{R}{R}|Creature - Elemental Spirit|3|3|Prote Talruum Minotaur|Mirage|196|C|{2}{R}{R}|Creature - Minotaur Berserker|3|3|Haste| Telim'Tor|Mirage|197|R|{4}{R}|Legendary Creature - Human Knight|2|2|Flanking (Whenever a creature without flanking blocks this creature, the blocking creature gets -1/-1 until end of turn.)$Whenever Telim'Tor attacks, all attacking creatures with flanking get +1/+1 until end of turn.| Telim'Tor's Edict|Mirage|198|R|{R}|Instant|||Exile target permanent you own or control.$Draw a card at the beginning of the next turn's upkeep.| -Dwarven Miner|Mirage|199|U|{1}{R}|Creature - Dwarf|1|2|{2}{R}, {tap}: Destroy target nonbasic land.| +Dwarven Miner|Mirage|169|U|{1}{R}|Creature - Dwarf|1|2|{2}{R}, {tap}: Destroy target nonbasic land.| Torrent of Lava|Mirage|199|R|{X}{R}{R}|Sorcery|||Torrent of Lava deals X damage to each creature without flying.$As long as Torrent of Lava is on the stack, each creature has "{tap}: Prevent the next 1 damage that would be dealt to this creature by Torrent of Lava this turn."| Ashen Powder|Mirage|2|R|{2}{B}{B}|Sorcery|||Put target creature card from an opponent's graveyard onto the battlefield under your control.| Feral Shadow|Mirage|20|C|{2}{B}|Creature - Nightstalker|2|1|Flying| @@ -12131,32 +12136,32 @@ Mire Shade|Mirage|29|U|{1}{B}|Creature - Shade|1|1|{B}, Sacrifice a Swamp: Put a Crystal Vein|Mirage|290|U||Land|||{tap}: Add {1} to your mana pool.${tap}, Sacrifice Crystal Vein: Add {2} to your mana pool.| Flood Plain|Mirage|291|U||Land|||Flood Plain enters the battlefield tapped.${tap}, Sacrifice Flood Plain: Search your library for a Plains or Island card and put it onto the battlefield. Then shuffle your library.| Forest|Mirage|292|L||Basic Land - Forest|||G| -Forest|Mirage|292|L||Basic Land - Forest|||G| -Forest|Mirage|292|L||Basic Land - Forest|||G| -Forest|Mirage|292|L||Basic Land - Forest|||G| +Forest|Mirage|293|L||Basic Land - Forest|||G| +Forest|Mirage|294|L||Basic Land - Forest|||G| +Forest|Mirage|295|L||Basic Land - Forest|||G| Grasslands|Mirage|296|U||Land|||Grasslands enters the battlefield tapped.${tap}, Sacrifice Grasslands: Search your library for a Forest or Plains card and put it onto the battlefield. Then shuffle your library.| Island|Mirage|297|L||Basic Land - Island|||U| -Island|Mirage|297|L||Basic Land - Island|||U| -Island|Mirage|297|L||Basic Land - Island|||U| -Island|Mirage|297|L||Basic Land - Island|||U| +Island|Mirage|298|L||Basic Land - Island|||U| +Island|Mirage|299|L||Basic Land - Island|||U| +Island|Mirage|300|L||Basic Land - Island|||U| Barbed-Back Wurm|Mirage|3|U|{4}{B}|Creature - Wurm|4|3|{B}: Target green creature blocking Barbed-Back Wurm gets -1/-1 until end of turn.| Nocturnal Raid|Mirage|30|U|{2}{B}{B}|Instant|||Black creatures get +2/+0 until end of turn.| -Shimmer|Mirage|30|R|{2}{U}{U}|Enchantment|||As Shimmer enters the battlefield, choose a land type.$Each land of the chosen type has phasing. (It phases in or out before its controller untaps during each of his or her untap steps. While it's phased out, it's treated as though it doesn't exist.)| -Mountain|Mirage|301|L||Basic Land - Mountain|||R| -Mountain|Mirage|301|L||Basic Land - Mountain|||R| -Mountain|Mirage|301|L||Basic Land - Mountain|||R| +Shimmer|Mirage|92|R|{2}{U}{U}|Enchantment|||As Shimmer enters the battlefield, choose a land type.$Each land of the chosen type has phasing. (It phases in or out before its controller untaps during each of his or her untap steps. While it's phased out, it's treated as though it doesn't exist.)| Mountain|Mirage|301|L||Basic Land - Mountain|||R| +Mountain|Mirage|302|L||Basic Land - Mountain|||R| +Mountain|Mirage|303|L||Basic Land - Mountain|||R| +Mountain|Mirage|304|L||Basic Land - Mountain|||R| Mountain Valley|Mirage|305|U||Land|||Mountain Valley enters the battlefield tapped.${tap}, Sacrifice Mountain Valley: Search your library for a Mountain or Forest card and put it onto the battlefield. Then shuffle your library.| Plains|Mirage|306|L||Basic Land - Plains|||W| -Plains|Mirage|306|L||Basic Land - Plains|||W| -Plains|Mirage|306|L||Basic Land - Plains|||W| -Plains|Mirage|306|L||Basic Land - Plains|||W| +Plains|Mirage|307|L||Basic Land - Plains|||W| +Plains|Mirage|308|L||Basic Land - Plains|||W| +Plains|Mirage|309|L||Basic Land - Plains|||W| Painful Memories|Mirage|31|U|{1}{B}|Sorcery|||Look at target opponent's hand and choose a card from it. Put that card on top of that player's library.| Rocky Tar Pit|Mirage|310|U||Land|||Rocky Tar Pit enters the battlefield tapped.${tap}, Sacrifice Rocky Tar Pit: Search your library for a Swamp or Mountain card and put it onto the battlefield. Then shuffle your library.| Swamp|Mirage|311|L||Basic Land - Swamp|||B| -Swamp|Mirage|311|L||Basic Land - Swamp|||B| -Swamp|Mirage|311|L||Basic Land - Swamp|||B| -Swamp|Mirage|311|L||Basic Land - Swamp|||B| +Swamp|Mirage|312|L||Basic Land - Swamp|||B| +Swamp|Mirage|313|L||Basic Land - Swamp|||B| +Swamp|Mirage|314|L||Basic Land - Swamp|||B| Teferi's Isle|Mirage|315|R||Legendary Land|||Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.)$Teferi's Isle enters the battlefield tapped.${tap}: Add {U}{U} to your mana pool.| Asmira, Holy Avenger|Mirage|316|R|{2}{G}{W}|Legendary Creature - Human Cleric|2|3|Flying$At the beginning of each end step, put a +1/+1 counter on Asmira, Holy Avenger for each creature put into your graveyard from the battlefield this turn.| Benthic Djinn|Mirage|317|R|{2}{U}{B}|Creature - Djinn|5|3|Islandwalk$$At the beginning of your upkeep, you lose 2 life.| @@ -12260,7 +12265,7 @@ Sea Scryer|Mirage|90|C|{1}{U}|Creature - Merfolk Wizard|1|1|{tap}: Add {1} to yo Shaper Guildmage|Mirage|91|C|{U}|Creature - Human Wizard|1|1|{W}, {tap}: Target creature gains first strike until end of turn.${B}, {tap}: Target creature gets +1/+0 until end of turn.| Soar|Mirage|93|C|{1}{U}|Enchantment - Aura|||You may cast Soar as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step.$Enchant creature$Enchanted creature gets +0/+1 and has flying.| Suq'Ata Firewalker|Mirage|94|U|{1}{U}{U}|Creature - Human Wizard|0|1|Suq'Ata Firewalker can't be the target of red spells or abilities from red sources.${tap}: Suq'Ata Firewalker deals 1 damage to target creature or player.| -Taniwha|Mirage|95|R|{3}{U}|Legendary Creature - Serpent|7|7|Trample$Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.)$At the beginning of your upkeep, all lands you control phase out. (They phase in before you untap during your next untap step.)| +Taniwha|Mirage|95|R|{3}{U}{U}|Legendary Creature - Serpent|7|7|Trample$Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.)$At the beginning of your upkeep, all lands you control phase out. (They phase in before you untap during your next untap step.)| Teferi's Curse|Mirage|96|C|{1}{U}|Enchantment - Aura|||Enchant artifact or creature$Enchanted permanent has phasing. (It phases in or out before its controller untaps during each of his or her untap steps. While it's phased out, it's treated as though it doesn't exist.)| Teferi's Drake|Mirage|97|C|{2}{U}|Creature - Drake|3|2|Flying$Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.)| Teferi's Imp|Mirage|98|R|{2}{U}|Creature - Imp|1|1|Flying$Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.)$Whenever Teferi's Imp phases out, discard a card.$Whenever Teferi's Imp phases in, draw a card.| @@ -14894,117 +14899,188 @@ Cavern Harpy|Planeshift|97|C|{U}{B}|Creature - Harpy Beast|2|1|Flying$When Caver Cloud Cover|Planeshift|98|R|{2}{W}{U}|Enchantment|||Whenever another permanent you control becomes the target of a spell or ability an opponent controls, you may return that permanent to its owner's hand.| Crosis's Charm|Planeshift|99|U|{U}{B}{R}|Instant|||Choose one - Return target permanent to its owner's hand; or destroy target nonblack creature, and it can't be regenerated; or destroy target artifact.| Arrogant Vampire|Portal|1|U|{3}{B}{B}|Creature - Vampire|4|3|Flying| +Assassin's Blade|Portal|2|U|{1}{B}|Instant|||Cast Assassin's Blade only during the declare attackers step and only if you've been attacked this step.$Destroy target nonblack attacking creature.| +Bog Imp|Portal|3|C|{1}{B}|Creature - Imp|1|1|Flying (This creature can't be blocked except by creatures with flying or reach.)| +Bog Raiders|Portal|4|C|{2}{B}|Creature - Zombie|2|2|Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)| +Bog Wraith|Portal|5|U|{3}{B}|Creature - Wraith|3|3|Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)| +Charging Bandits|Portal|6|U|{4}{B}|Creature - Human Rogue|3|3|Whenever Charging Bandits attacks, it gets +2/+0 until end of turn.| +Craven Knight|Portal|7|C|{1}{B}|Creature - Human Knight|2|2|Craven Knight can't block.| +Cruel Bargain|Portal|8|R|{B}{B}{B}|Sorcery|||Draw four cards. You lose half your life, rounded up.| +Cruel Tutor|Portal|9|R|{2}{B}|Sorcery|||Search your library for a card, then shuffle your library and put that card on top of it. You lose 2 life.| Dread Charge|Portal|10|R|{3}{B}|Sorcery|||Until end of turn, black creatures you control can be blocked only by black creatures.| +Dread Reaper|Portal|11|R|{3}{B}{B}{B}|Creature - Horror|6|5|Flying$When Dread Reaper enters the battlefield, you lose 5 life.| +Dry Spell|Portal|12|U|{1}{B}|Sorcery|||Dry Spell deals 1 damage to each creature and each player.| +Ebon Dragon|Portal|13|R|{5}{B}{B}|Creature - Dragon|5|4|Flying$When Ebon Dragon enters the battlefield, you may have target opponent discard a card.| +Endless Cockroaches|Portal|14|R|{1}{B}{B}|Creature - Insect|1|1|When Endless Cockroaches dies, return it to its owner's hand.| +Feral Shadow|Portal|15|C|{2}{B}|Creature - Nightstalker|2|1|Flying| +Final Strike|Portal|16|R|{2}{B}{B}|Sorcery|||As an additional cost to cast Final Strike, sacrifice a creature.$Final Strike deals damage to target opponent equal to the sacrificed creature's power.| +Gravedigger|Portal|17|U|{3}{B}|Creature - Zombie|2|2|When Gravedigger enters the battlefield, you may return target creature card from your graveyard to your hand.| +Hand of Death|Portal|18|C|{2}{B}|Sorcery|||Destroy target nonblack creature.| +Hand of Death|Portal|19|C|{2}{B}|Sorcery|||Destroy target nonblack creature.| +Howling Fury|Portal|20|C|{2}{B}|Sorcery|||Target creature gets +4/+0 until end of turn.| +King's Assassin|Portal|21|R|{1}{B}{B}|Creature - Human Assassin|1|1|{tap}: Destroy target tapped creature. Activate this ability only during your turn, before attackers are declared.| +Mercenary Knight|Portal|22|R|{2}{B}|Creature - Human Mercenary Knight|4|4|When Mercenary Knight enters the battlefield, sacrifice it unless you discard a creature card.| +Mind Knives|Portal|23|C|{1}{B}|Sorcery|||Target opponent discards a card at random.| +Mind Rot|Portal|24|C|{2}{B}|Sorcery|||Target player discards two cards.| +Muck Rats|Portal|25|C|{B}|Creature - Rat|1|1|| +Nature's Ruin|Portal|26|U|{2}{B}|Sorcery|||Destroy all green creatures.| +Noxious Toad|Portal|27|U|{2}{B}|Creature - Frog|1|1|When Noxious Toad dies, each opponent discards a card.| +Python|Portal|28|C|{1}{B}{B}|Creature - Snake|3|2|| +Rain of Tears|Portal|29|U|{1}{B}{B}|Sorcery|||Destroy target land.| +Raise Dead|Portal|30|C|{B}|Sorcery|||Return target creature card from your graveyard to your hand.| +Serpent Assassin|Portal|31|R|{3}{B}{B}|Creature - Snake Assassin|2|2|When Serpent Assassin enters the battlefield, you may destroy target nonblack creature.| +Serpent Warrior|Portal|32|C|{2}{B}|Creature - Snake Warrior|3|3|When Serpent Warrior enters the battlefield, you lose 3 life.| +Skeletal Crocodile|Portal|33|C|{3}{B}|Creature - Crocodile Skeleton|5|1|| +Skeletal Snake|Portal|34|C|{1}{B}|Creature - Snake Skeleton|2|1|| +Soul Shred|Portal|35|C|{3}{B}{B}|Sorcery|||Soul Shred deals 3 damage to target nonblack creature. You gain 3 life.| +Undying Beast|Portal|36|C|{3}{B}|Creature - Beast|3|2|When Undying Beast dies, put it on top of its owner's library.| +Vampiric Feast|Portal|37|U|{5}{B}{B}|Sorcery|||Vampiric Feast deals 4 damage to target creature or player and you gain 4 life.| +Vampiric Touch|Portal|38|C|{2}{B}|Sorcery|||Vampiric Touch deals 2 damage to target opponent and you gain 2 life.| +Virtue's Ruin|Portal|39|U|{2}{B}|Sorcery|||Destroy all white creatures.| +Wicked Pact|Portal|40|R|{1}{B}{B}|Sorcery|||Destroy two target nonblack creatures. You lose 5 life.| +Ancestral Memories|Portal|41|R|{2}{U}{U}{U}|Sorcery|||Look at the top seven cards of your library. Put two of them into your hand and the rest into your graveyard.| +Balance of Power|Portal|42|R|{3}{U}{U}|Sorcery|||If target opponent has more cards in hand than you, draw cards equal to the difference.| +Baleful Stare|Portal|43|U|{2}{U}|Sorcery|||Target opponent reveals his or her hand. You draw a card for each Mountain and red card in it.| +Capricious Sorcerer|Portal|44|R|{2}{U}|Creature - Human Wizard|1|1|{tap}: Capricious Sorcerer deals 1 damage to target creature or player. Activate this ability only during your turn, before attackers are declared.| +Cloak of Feathers|Portal|45|C|{U}|Sorcery|||Target creature gains flying until end of turn.$$Draw a card.| +Cloud Dragon|Portal|46|R|{5}{U}|Creature - Illusion Dragon|5|4|Flying$Cloud Dragon can block only creatures with flying.| +Cloud Pirates|Portal|47|C|{U}|Creature - Human Pirate|1|1|Flying$Cloud Pirates can block only creatures with flying.| +Cloud Spirit|Portal|48|U|{2}{U}|Creature - Spirit|3|1|Flying$Cloud Spirit can block only creatures with flying.| +Command of Unsummoning|Portal|49|U|{2}{U}|Instant|||Cast Command of Unsummoning only during the declare attackers step and only if you've been attacked this step.$Return one or two target attacking creatures to their owner's hand.| +Coral Eel|Portal|50|C|{1}{U}|Creature - Fish|2|1|| +Cruel Fate|Portal|51|R|{4}{U}|Sorcery|||Look at the top five cards of target opponent's library. Put one of those cards into that player's graveyard and the rest on top of his or her library in any order.| +Deep-Sea Serpent|Portal|52|U|{4}{U}{U}|Creature - Serpent|5|5|Deep-Sea Serpent can't attack unless defending player controls an Island.| +Deja Vu|Portal|53|C|{2}{U}|Sorcery|||Return target sorcery card from your graveyard to your hand.| +Djinn of the Lamp|Portal|54|R|{5}{U}{U}|Creature - Djinn|5|6|Flying| +Exhaustion|Portal|55|R|{2}{U}|Sorcery|||Creatures and lands target opponent controls don't untap during his or her next untap step.| +Flux|Portal|56|U|{2}{U}|Sorcery|||Each player discards any number of cards, then draws that many cards.$Draw a card.| +Giant Octopus|Portal|57|C|{3}{U}|Creature - Octopus|3|3|| +Horned Turtle|Portal|58|C|{2}{U}|Creature - Turtle|1|4|| +Ingenious Thief|Portal|59|U|{1}{U}|Creature - Human Rogue|1|1|Flying$When Ingenious Thief enters the battlefield, look at target player's hand.| +Man-o'-War|Portal|60|U|{2}{U}|Creature - Jellyfish|2|2|When Man-o'-War enters the battlefield, return target creature to its owner's hand.| +Merfolk of the Pearl Trident|Portal|61|C|{U}|Creature - Merfolk|1|1|| +Mystic Denial|Portal|62|U|{1}{U}{U}|Instant|||Counter target creature or sorcery spell.| +Omen|Portal|63|C|{1}{U}|Sorcery|||Look at the top three cards of your library, then put them back in any order. You may shuffle your library.$Draw a card.| +Owl Familiar|Portal|64|C|{1}{U}|Creature - Bird|1|1|Flying$When Owl Familiar enters the battlefield, draw a card, then discard a card.| +Personal Tutor|Portal|65|U|{U}|Sorcery|||Search your library for a sorcery card and reveal that card. Shuffle your library, then put the card on top of it.| +Phantom Warrior|Portal|66|R|{1}{U}{U}|Creature - Illusion Warrior|2|2|Phantom Warrior is unblockable.| +Prosperity|Portal|67|R|{X}{U}|Sorcery|||Each player draws X cards.| +Snapping Drake|Portal|68|C|{3}{U}|Creature - Drake|3|2|Flying| +Sorcerous Sight|Portal|69|C|{U}|Sorcery|||Look at target opponent's hand.$$Draw a card.| +Storm Crow|Portal|70|C|{1}{U}|Creature - Bird|1|2|Flying (This creature can't be blocked except by creatures with flying or reach.)| +Symbol of Unsummoning|Portal|71|C|{2}{U}|Sorcery|||Return target creature to its owner's hand.$$Draw a card.| +Taunt|Portal|72|R|{U}|Sorcery|||During target player's next turn, creatures that player controls attack you if able.| +Theft of Dreams|Portal|73|U|{2}{U}|Sorcery|||Draw a card for each tapped creature target opponent controls.| +Thing from the Deep|Portal|74|R|{6}{U}{U}{U}|Creature - Leviathan|9|9|Whenever Thing from the Deep attacks, sacrifice it unless you sacrifice an Island.| +Tidal Surge|Portal|75|C|{1}{U}|Sorcery|||Tap up to three target creatures without flying.| +Time Ebb|Portal|76|C|{2}{U}|Sorcery|||Put target creature on top of its owner's library.| +Touch of Brilliance|Portal|77|C|{3}{U}|Sorcery|||Draw two cards.| +Wind Drake|Portal|78|C|{2}{U}|Creature - Drake|2|2|Flying| +Withering Gaze|Portal|79|U|{2}{U}|Sorcery|||Target opponent reveals his or her hand. You draw a card for each Forest and green card in it.| +Alluring Scent|Portal|80|R|{1}{G}{G}|Sorcery|||All creatures able to block target creature this turn do so.| +Anaconda|Portal|81|U|{3}{G}|Creature - Snake|3|3|Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)| +Anaconda|Portal|82|U|{3}{G}|Creature - Snake|3|3|Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)| +Bee Sting|Portal|83|U|{3}{G}|Sorcery|||Bee Sting deals 2 damage to target creature or player.| +Bull Hippo|Portal|84|U|{3}{G}|Creature - Hippo|3|3|Islandwalk| +Charging Rhino|Portal|85|R|{3}{G}{G}|Creature - Rhino|4|4|Charging Rhino can't be blocked by more than one creature.| +Deep Wood|Portal|86|U|{1}{G}|Instant|||Cast Deep Wood 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.| +Elite Cat Warrior|Portal|87|C|{2}{G}|Creature - Cat Warrior|2|3|Forestwalk| +Elite Cat Warrior|Portal|88|C|{2}{G}|Creature - Cat Warrior|2|3|Forestwalk| +Elven Cache|Portal|89|C|{2}{G}{G}|Sorcery|||Return target card from your graveyard to your hand.| +Elvish Ranger|Portal|90|C|{2}{G}|Creature - Elf|4|1|| +Fruition|Portal|91|C|{G}|Sorcery|||You gain 1 life for each Forest on the battlefield.| +Giant Spider|Portal|92|C|{3}{G}|Creature - Spider|2|4|Reach (This creature can block creatures with flying.)| +Gorilla Warrior|Portal|93|C|{2}{G}|Creature - Ape Warrior|3|2|| +Grizzly Bears|Portal|94|C|{1}{G}|Creature - Bear|2|2|| +Hurricane|Portal|95|R|{X}{G}|Sorcery|||Hurricane deals X damage to each creature with flying and each player.| +Jungle Lion|Portal|96|C|{G}|Creature - Cat|2|1|Jungle Lion can't block.| +Mobilize|Portal|97|C|{G}|Sorcery|||Untap all creatures you control.| +Monstrous Growth|Portal|98|C|{1}{G}|Sorcery|||Target creature gets +4/+4 until end of turn.| +Monstrous Growth|Portal|99|C|{1}{G}|Sorcery|||Target creature gets +4/+4 until end of turn.| Moon Sprite|Portal|100|U|{1}{G}|Creature - Faerie|1|1|Flying| Natural Order|Portal|101|R|{2}{G}{G}|Sorcery|||As an additional cost to cast Natural Order, sacrifice a green creature.$Search your library for a green creature card and put it onto the battlefield. Then shuffle your library.| -Mountain|Portal|101|L||Basic Land - Mountain|||R| -Mountain|Portal|101|L||Basic Land - Mountain|||R| -Mountain|Portal|101|L||Basic Land - Mountain|||R| -Mountain|Portal|101|L||Basic Land - Mountain|||R| -Blaze|Portal|102|U|{X}{R}|Sorcery|||Blaze deals X damage to target creature or player.| -Blaze|Portal|102|U|{X}{R}|Sorcery|||Blaze deals X damage to target creature or player.| +Natural Spring|Portal|102|U|{3}{G}{G}|Sorcery|||Target player gains 8 life.| Nature's Cloak|Portal|103|R|{2}{G}|Sorcery|||Green creatures you control gain forestwalk until end of turn.| +Nature's Lore|Portal|104|C|{1}{G}|Sorcery|||Search your library for a Forest card and put that card onto the battlefield. Then shuffle your library.| Needle Storm|Portal|105|U|{2}{G}|Sorcery|||Needle Storm deals 4 damage to each creature with flying.| Panther Warriors|Portal|106|C|{4}{G}|Creature - Cat Warrior|6|3|| Plant Elemental|Portal|107|U|{1}{G}|Creature - Plant Elemental|3|4|When Plant Elemental enters the battlefield, sacrifice it unless you sacrifice a Forest.| -Lava Axe|Portal|107|C|{4}{R}|Sorcery|||Lava Axe deals 5 damage to target player.| Primeval Force|Portal|108|R|{2}{G}{G}{G}|Creature - Elemental|8|8|When Primeval Force enters the battlefield, sacrifice it unless you sacrifice three Forests.| Redwood Treefolk|Portal|109|C|{4}{G}|Creature - Treefolk|3|6|| -Dread Reaper|Portal|11|R|{3}{B}{B}{B}|Creature - Horror|6|5|Flying$When Dread Reaper enters the battlefield, you lose 5 life.| Rowan Treefolk|Portal|110|C|{3}{G}|Creature - Treefolk|3|4|| Spined Wurm|Portal|111|C|{4}{G}|Creature - Wurm|5|4|| +Stalking Tiger|Portal|112|C|{3}{G}|Creature - Cat|3|3|Stalking Tiger can't be blocked by more than one creature.| Summer Bloom|Portal|113|R|{1}{G}|Sorcery|||You may play up to three additional lands this turn.| Sylvan Tutor|Portal|114|R|{G}|Sorcery|||Search your library for a creature card and reveal that card. Shuffle your library, then put the card on top of it.| -Raging Goblin|Portal|114|C|{R}|Creature - Goblin Berserker|1|1|Haste (This creature can attack and {tap} as soon as it comes under your control.)| -Raging Goblin|Portal|114|C|{R}|Creature - Goblin Berserker|1|1|Haste (This creature can attack and {tap} as soon as it comes under your control.)| Thundering Wurm|Portal|115|R|{2}{G}|Creature - Wurm|4|4|When Thundering Wurm enters the battlefield, sacrifice it unless you discard a land card.| Treetop Defense|Portal|116|R|{1}{G}|Instant|||Cast Treetop Defense only during the declare attackers step and only if you've been attacked this step.$Creatures you control gain reach until end of turn. (They can block creatures with flying.)| -Spitting Earth|Portal|116|C|{1}{R}|Sorcery|||Spitting Earth deals damage to target creature equal to the number of Mountains you control.| +Untamed Wilds|Portal|117|U|{2}{G}|Sorcery|||Search your library for a basic land card and put that card onto the battlefield. Then shuffle your library.| Whiptail Wurm|Portal|118|U|{6}{G}|Creature - Wurm|8|5|| Willow Dryad|Portal|119|C|{G}|Creature - Dryad|1|1|Forestwalk| -Volcanic Hammer|Portal|119|C|{1}{R}|Sorcery|||Volcanic Hammer deals 3 damage to target creature or player.| -Dry Spell|Portal|12|U|{1}{B}|Sorcery|||Dry Spell deals 1 damage to each creature and each player.| Winter's Grasp|Portal|120|U|{1}{G}{G}|Sorcery|||Destroy target land.| Wood Elves|Portal|121|R|{2}{G}|Creature - Elf Scout|1|1|When Wood Elves enters the battlefield, search your library for a Forest card and put that card onto the battlefield. Then shuffle your library.| -Stone Rain|Portal|123|C|{2}{R}|Sorcery|||Destroy target land.| +Blaze|Portal|122|U|{X}{R}|Sorcery|||Blaze deals X damage to target creature or player.| +Blaze|Portal|123|U|{X}{R}|Sorcery|||Blaze deals X damage to target creature or player.| Boiling Seas|Portal|124|U|{3}{R}|Sorcery|||Destroy all Islands.| Burning Cloak|Portal|125|C|{R}|Sorcery|||Target creature gets +2/+0 until end of turn. Burning Cloak deals 2 damage to that creature.| Craven Giant|Portal|126|C|{2}{R}|Creature - Giant|4|1|Craven Giant can't block.| Desert Drake|Portal|127|U|{3}{R}|Creature - Drake|2|2|Flying| Devastation|Portal|128|R|{5}{R}{R}|Sorcery|||Destroy all creatures and lands.| -Fire Dragon|Portal|129|R|{6}{R}{R}{R}|Creature - Dragon|6|6|Flying$When Fire Dragon enters the battlefield, it deals damage equal to the number of Mountains you control to target creature.| -Angelic Blessing|Portal|129|C|{2}{W}|Sorcery|||Target creature gets +3/+3 and gains flying until end of turn. (It can't be blocked except by creatures with flying or reach.)| -Ebon Dragon|Portal|13|R|{5}{B}{B}|Creature - Dragon|5|4|Flying$When Ebon Dragon enters the battlefield, you may have target opponent discard a card.| +Earthquake|Portal|129|R|{X}{R}|Sorcery|||Earthquake deals X damage to each creature without flying and each player.| +Fire Dragon|Portal|130|R|{6}{R}{R}{R}|Creature - Dragon|6|6|Flying$When Fire Dragon enters the battlefield, it deals damage equal to the number of Mountains you control to target creature.| Fire Imp|Portal|131|U|{2}{R}|Creature - Imp|2|1|When Fire Imp enters the battlefield, it deals 2 damage to target creature.| -Archangel|Portal|131|R|{5}{W}{W}|Creature - Angel|5|5|Flying, vigilance| Fire Snake|Portal|132|C|{4}{R}|Creature - Snake|3|1|When Fire Snake dies, destroy target land.| -Armageddon|Portal|132|R|{3}{W}|Sorcery|||Destroy all lands.| Fire Tempest|Portal|133|R|{5}{R}{R}|Sorcery|||Fire Tempest deals 6 damage to each creature and each player.| Flashfires|Portal|134|U|{3}{R}|Sorcery|||Destroy all Plains.| Forked Lightning|Portal|135|R|{3}{R}|Sorcery|||Forked Lightning deals 4 damage divided as you choose among one, two, or three target creatures.| -Breath of Life|Portal|135|C|{3}{W}|Sorcery|||Return target creature card from your graveyard to the battlefield.| Goblin Bully|Portal|136|C|{1}{R}|Creature - Goblin|2|1|| Highland Giant|Portal|137|C|{2}{R}{R}|Creature - Giant|3|4|| Hill Giant|Portal|138|C|{3}{R}|Creature - Giant|3|3|| -Path of Peace|Portal|138|C|{3}{W}|Sorcery|||Destroy target creature. Its owner gains 4 life.| Hulking Cyclops|Portal|139|U|{3}{R}{R}|Creature - Cyclops|5|5|Hulking Cyclops can't block.| -Endless Cockroaches|Portal|14|R|{1}{B}{B}|Creature - Insect|1|1|When Endless Cockroaches dies, return it to its owner's hand.| -Hand of Death|Portal|14|C|{2}{B}|Sorcery|||Destroy target nonblack creature.| -Hand of Death|Portal|14|C|{2}{B}|Sorcery|||Destroy target nonblack creature.| Hulking Goblin|Portal|140|C|{1}{R}|Creature - Goblin|2|2|Hulking Goblin can't block.| Last Chance|Portal|141|R|{R}{R}|Sorcery|||Take an extra turn after this one. At the beginning of that turn's end step, you lose the game.| +Lava Axe|Portal|142|C|{4}{R}|Sorcery|||Lava Axe deals 5 damage to target player.| Lava Flow|Portal|143|U|{3}{R}{R}|Sorcery|||Destroy target creature or land.| Lizard Warrior|Portal|144|C|{3}{R}|Creature - Lizard Warrior|4|2|| Minotaur Warrior|Portal|145|C|{2}{R}|Creature - Minotaur Warrior|2|3|| Mountain Goat|Portal|146|U|{R}|Creature - Goat|1|1|Mountainwalk| Pillaging Horde|Portal|147|R|{2}{R}{R}|Creature - Human Barbarian|5|5|When Pillaging Horde enters the battlefield, sacrifice it unless you discard a card at random.| Pyroclasm|Portal|148|R|{1}{R}|Sorcery|||Pyroclasm deals 2 damage to each creature.| -Stalking Tiger|Portal|149|C|{3}{G}|Creature - Cat|3|3|Stalking Tiger can't be blocked by more than one creature.| Raging Cougar|Portal|149|C|{2}{R}|Creature - Cat|2|2|Haste| -Feral Shadow|Portal|15|C|{2}{B}|Creature - Nightstalker|2|1|Flying| +Raging Goblin|Portal|150|C|{R}|Creature - Goblin Berserker|1|1|Haste (This creature can attack and {tap} as soon as it comes under your control.)| +Raging Goblin|Portal|151|C|{R}|Creature - Goblin Berserker|1|1|Haste (This creature can attack and {tap} as soon as it comes under your control.)| Raging Minotaur|Portal|152|C|{2}{R}{R}|Creature - Minotaur Berserker|3|3|Haste| Rain of Salt|Portal|153|U|{4}{R}{R}|Sorcery|||Destroy two target lands.| Scorching Spear|Portal|154|C|{R}|Sorcery|||Scorching Spear deals 1 damage to target creature or player.| Scorching Winds|Portal|155|U|{R}|Instant|||Cast Scorching Winds only during the declare attackers step and only if you've been attacked this step.$Scorching Winds deals 1 damage to each attacking creature.| +Spitting Earth|Portal|156|C|{1}{R}|Sorcery|||Spitting Earth deals damage to target creature equal to the number of Mountains you control.| +Stone Rain|Portal|157|C|{2}{R}|Sorcery|||Destroy target land.| Thundermare|Portal|158|R|{5}{R}|Creature - Elemental Horse|5|5|Haste (This creature can attack the turn it comes under your control.)$When Thundermare enters the battlefield, tap all other creatures.| Volcanic Dragon|Portal|159|R|{4}{R}{R}|Creature - Dragon|4|4|Flying$Haste (This creature can attack and {tap} as soon as it comes under your control.)| -Final Strike|Portal|16|R|{2}{B}{B}|Sorcery|||As an additional cost to cast Final Strike, sacrifice a creature.$Final Strike deals damage to target opponent equal to the sacrificed creature's power.| +Volcanic Hammer|Portal|160|C|{1}{R}|Sorcery|||Volcanic Hammer deals 3 damage to target creature or player.| Wall of Granite|Portal|161|U|{2}{R}|Creature - Wall|0|7|Defender (This creature can't attack.)| Winds of Change|Portal|162|R|{R}|Sorcery|||Each player shuffles the cards from his or her hand into his or her library, then draws that many cards.| Alabaster Dragon|Portal|163|R|{4}{W}{W}|Creature - Dragon|4|4|Flying$When Alabaster Dragon dies, shuffle it into its owner's library.| +Angelic Blessing|Portal|164|C|{2}{W}|Sorcery|||Target creature gets +3/+3 and gains flying until end of turn. (It can't be blocked except by creatures with flying or reach.)| +Archangel|Portal|165|R|{5}{W}{W}|Creature - Angel|5|5|Flying, vigilance| Ardent Militia|Portal|166|U|{4}{W}|Creature - Human Soldier|2|5|Vigilance| -Plains|Portal|166|L||Basic Land - Plains|||W| -Plains|Portal|166|L||Basic Land - Plains|||W| -Plains|Portal|166|L||Basic Land - Plains|||W| -Plains|Portal|166|L||Basic Land - Plains|||W| +Armageddon|Portal|167|R|{3}{W}|Sorcery|||Destroy all lands.| Armored Pegasus|Portal|168|C|{1}{W}|Creature - Pegasus|1|2|Flying| Blessed Reversal|Portal|169|R|{1}{W}|Instant|||You gain 3 life for each creature attacking you.| -Island|Portal|169|L||Basic Land - Island|||U| -Island|Portal|169|L||Basic Land - Island|||U| -Island|Portal|169|L||Basic Land - Island|||U| -Island|Portal|169|L||Basic Land - Island|||U| -Gravedigger|Portal|17|U|{3}{B}|Creature - Zombie|2|2|When Gravedigger enters the battlefield, you may return target creature card from your graveyard to your hand.| Blinding Light|Portal|170|R|{2}{W}|Sorcery|||Tap all nonwhite creatures.| Border Guard|Portal|171|C|{2}{W}|Creature - Human Soldier|1|4|| -Swamp|Portal|172|L||Basic Land - Swamp|||B| -Swamp|Portal|172|L||Basic Land - Swamp|||B| -Swamp|Portal|172|L||Basic Land - Swamp|||B| -Swamp|Portal|172|L||Basic Land - Swamp|||B| +Breath of Life|Portal|172|C|{3}{W}|Sorcery|||Return target creature card from your graveyard to the battlefield.| Charging Paladin|Portal|173|U|{2}{W}|Creature - Human Knight|2|2|Whenever Charging Paladin attacks, it gets +0/+3 until end of turn.| Defiant Stand|Portal|174|U|{1}{W}|Instant|||Cast Defiant Stand only during the declare attackers step and only if you've been attacked this step.$Target creature gets +1/+3 until end of turn. Untap that creature.| Devoted Hero|Portal|175|C|{W}|Creature - Elf Soldier|1|2|| False Peace|Portal|176|C|{W}|Sorcery|||Target player skips all combat phases of his or her next turn.| Fleet-Footed Monk|Portal|177|C|{1}{W}|Creature - Human Monk|1|1|Fleet-Footed Monk can't be blocked by creatures with power 2 or greater.| Foot Soldiers|Portal|178|C|{3}{W}|Creature - Human Soldier|2|4|| -Forest|Portal|178|L||Basic Land - Forest|||G| -Forest|Portal|178|L||Basic Land - Forest|||G| -Forest|Portal|178|L||Basic Land - Forest|||G| -Forest|Portal|178|L||Basic Land - Forest|||G| Gift of Estates|Portal|179|R|{1}{W}|Sorcery|||If an opponent controls more lands than you, search your library for up to three Plains cards, reveal them, and put them into your hand. Then shuffle your library.| -Mind Rot|Portal|18|C|{2}{B}|Sorcery|||Target player discards two cards.| Harsh Justice|Portal|180|R|{2}{W}|Instant|||Cast Harsh Justice only during the declare attackers step and only if you've been attacked this step.$This turn, whenever an attacking creature deals combat damage to you, it deals that much damage to its controller.| Keen-Eyed Archers|Portal|181|C|{2}{W}|Creature - Elf Archer|2|2|Reach (This creature can block creatures with flying.)| Knight Errant|Portal|182|C|{1}{W}|Creature - Human Knight|2|2|| +Path of Peace|Portal|183|C|{3}{W}|Sorcery|||Destroy target creature. Its owner gains 4 life.| Regal Unicorn|Portal|184|C|{2}{W}|Creature - Unicorn|2|3|| Renewing Dawn|Portal|185|U|{1}{W}|Sorcery|||You gain 2 life for each Mountain target opponent controls.| Sacred Knight|Portal|186|C|{3}{W}|Creature - Human Knight|3|2|Sacred Knight can't be blocked by black and/or red creatures.| @@ -15019,102 +15095,31 @@ Stern Marshal|Portal|194|R|{2}{W}|Creature - Human Soldier|2|2|{tap}: Target cre Temporary Truce|Portal|195|R|{1}{W}|Sorcery|||Each player may draw up to two cards. For each card less than two a player draws this way, that player gains 2 life.| Valorous Charge|Portal|196|U|{1}{W}{W}|Sorcery|||White creatures get +2/+0 until end of turn.| Venerable Monk|Portal|197|U|{2}{W}|Creature - Human Monk Cleric|2|2|When Venerable Monk enters the battlefield, you gain 2 life.| +Vengeance|Portal|198|U|{3}{W}|Sorcery|||Destroy target tapped creature.| Wall of Swords|Portal|199|U|{3}{W}|Creature - Wall|3|5|Defender, flying (This creature can't attack, and it can block creatures with flying.)| -Assassin's Blade|Portal|2|U|{1}{B}|Instant|||Cast Assassin's Blade only during the declare attackers step and only if you've been attacked this step.$Destroy target nonblack attacking creature.| -Howling Fury|Portal|20|C|{2}{B}|Sorcery|||Target creature gets +4/+0 until end of turn.| -Muck Rats|Portal|20|C|{B}|Creature - Rat|1|1|| -Warrior's Charge|Portal|200|C|{2}{W}|Sorcery|||Creatures you control get +1/+1 until end of turn.| Warrior's Charge|Portal|200|C|{2}{W}|Sorcery|||Creatures you control get +1/+1 until end of turn.| +Warrior's Charge|Portal|201|C|{2}{W}|Sorcery|||Creatures you control get +1/+1 until end of turn.| Wrath of God|Portal|202|R|{2}{W}{W}|Sorcery|||Destroy all creatures. They can't be regenerated.| -King's Assassin|Portal|21|R|{1}{B}{B}|Creature - Human Assassin|1|1|{tap}: Destroy target tapped creature. Activate this ability only during your turn, before attackers are declared.| -Mercenary Knight|Portal|22|R|{2}{B}|Creature - Human Mercenary Knight|4|4|When Mercenary Knight enters the battlefield, sacrifice it unless you discard a creature card.| -Mind Knives|Portal|23|C|{1}{B}|Sorcery|||Target opponent discards a card at random.| -Nature's Ruin|Portal|26|U|{2}{B}|Sorcery|||Destroy all green creatures.| -Raise Dead|Portal|26|C|{B}|Sorcery|||Return target creature card from your graveyard to your hand.| -Noxious Toad|Portal|27|U|{2}{B}|Creature - Frog|1|1|When Noxious Toad dies, each opponent discards a card.| -Python|Portal|28|C|{1}{B}{B}|Creature - Snake|3|2|| -Vengeance|Portal|28|U|{3}{W}|Sorcery|||Destroy target tapped creature.| -Rain of Tears|Portal|29|U|{1}{B}{B}|Sorcery|||Destroy target land.| -Bog Imp|Portal|3|C|{1}{B}|Creature - Imp|1|1|Flying (This creature can't be blocked except by creatures with flying or reach.)| -Cloud Pirates|Portal|3|C|{U}|Creature - Human Pirate|1|1|Flying$Cloud Pirates can block only creatures with flying.| -Serpent Assassin|Portal|31|R|{3}{B}{B}|Creature - Snake Assassin|2|2|When Serpent Assassin enters the battlefield, you may destroy target nonblack creature.| -Serpent Warrior|Portal|32|C|{2}{B}|Creature - Snake Warrior|3|3|When Serpent Warrior enters the battlefield, you lose 3 life.| -Skeletal Crocodile|Portal|33|C|{3}{B}|Creature - Crocodile Skeleton|5|1|| -Skeletal Snake|Portal|34|C|{1}{B}|Creature - Snake Skeleton|2|1|| -Balance of Power|Portal|34|R|{3}{U}{U}|Sorcery|||If target opponent has more cards in hand than you, draw cards equal to the difference.| -Soul Shred|Portal|35|C|{3}{B}{B}|Sorcery|||Soul Shred deals 3 damage to target nonblack creature. You gain 3 life.| -Undying Beast|Portal|36|C|{3}{B}|Creature - Beast|3|2|When Undying Beast dies, put it on top of its owner's library.| -Vampiric Feast|Portal|37|U|{5}{B}{B}|Sorcery|||Vampiric Feast deals 4 damage to target creature or player and you gain 4 life.| -Vampiric Touch|Portal|38|C|{2}{B}|Sorcery|||Vampiric Touch deals 2 damage to target opponent and you gain 2 life.| -Virtue's Ruin|Portal|39|U|{2}{B}|Sorcery|||Destroy all white creatures.| -Bog Raiders|Portal|4|C|{2}{B}|Creature - Zombie|2|2|Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)| -Wicked Pact|Portal|40|R|{1}{B}{B}|Sorcery|||Destroy two target nonblack creatures. You lose 5 life.| -Ancestral Memories|Portal|41|R|{2}{U}{U}{U}|Sorcery|||Look at the top seven cards of your library. Put two of them into your hand and the rest into your graveyard.| -Mystic Denial|Portal|41|U|{1}{U}{U}|Instant|||Counter target creature or sorcery spell.| -Exhaustion|Portal|42|R|{2}{U}|Sorcery|||Creatures and lands target opponent controls don't untap during his or her next untap step.| -Baleful Stare|Portal|43|U|{2}{U}|Sorcery|||Target opponent reveals his or her hand. You draw a card for each Mountain and red card in it.| -Capricious Sorcerer|Portal|44|R|{2}{U}|Creature - Human Wizard|1|1|{tap}: Capricious Sorcerer deals 1 damage to target creature or player. Activate this ability only during your turn, before attackers are declared.| -Cloak of Feathers|Portal|45|C|{U}|Sorcery|||Target creature gains flying until end of turn.$$Draw a card.| -Cloud Dragon|Portal|46|R|{5}{U}|Creature - Illusion Dragon|5|4|Flying$Cloud Dragon can block only creatures with flying.| -Cloud Spirit|Portal|48|U|{2}{U}|Creature - Spirit|3|1|Flying$Cloud Spirit can block only creatures with flying.| -Command of Unsummoning|Portal|49|U|{2}{U}|Instant|||Cast Command of Unsummoning only during the declare attackers step and only if you've been attacked this step.$Return one or two target attacking creatures to their owner's hand.| -Bog Wraith|Portal|5|U|{3}{B}|Creature - Wraith|3|3|Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)| -Coral Eel|Portal|50|C|{1}{U}|Creature - Fish|2|1|| -Cruel Fate|Portal|51|R|{4}{U}|Sorcery|||Look at the top five cards of target opponent's library. Put one of those cards into that player's graveyard and the rest on top of his or her library in any order.| -Deep-Sea Serpent|Portal|52|U|{4}{U}{U}|Creature - Serpent|5|5|Deep-Sea Serpent can't attack unless defending player controls an Island.| -Dej Vu|Portal|53|C|{2}{U}|Sorcery|||Return target sorcery card from your graveyard to your hand.| -Djinn of the Lamp|Portal|54|R|{5}{U}{U}|Creature - Djinn|5|6|Flying| -Flux|Portal|56|U|{2}{U}|Sorcery|||Each player discards any number of cards, then draws that many cards.$Draw a card.| -Tidal Surge|Portal|56|C|{1}{U}|Sorcery|||Tap up to three target creatures without flying.| -Giant Octopus|Portal|57|C|{3}{U}|Creature - Octopus|3|3|| -Time Ebb|Portal|57|C|{2}{U}|Sorcery|||Put target creature on top of its owner's library.| -Horned Turtle|Portal|58|C|{2}{U}|Creature - Turtle|1|4|| -Touch of Brilliance|Portal|58|C|{3}{U}|Sorcery|||Draw two cards.| -Ingenious Thief|Portal|59|U|{1}{U}|Creature - Human Rogue|1|1|Flying$When Ingenious Thief enters the battlefield, look at target player's hand.| -Charging Bandits|Portal|6|U|{4}{B}|Creature - Human Rogue|3|3|Whenever Charging Bandits attacks, it gets +2/+0 until end of turn.| -Man-o'-War|Portal|60|U|{2}{U}|Creature - Jellyfish|2|2|When Man-o'-War enters the battlefield, return target creature to its owner's hand.| -Merfolk of the Pearl Trident|Portal|61|C|{U}|Creature - Merfolk|1|1|| -Alluring Scent|Portal|61|R|{1}{G}{G}|Sorcery|||All creatures able to block target creature this turn do so.| -Owl Familiar|Portal|64|C|{1}{U}|Creature - Bird|1|1|Flying$When Owl Familiar enters the battlefield, draw a card, then discard a card.| -Personal Tutor|Portal|65|U|{U}|Sorcery|||Search your library for a sorcery card and reveal that card. Shuffle your library, then put the card on top of it.| -Phantom Warrior|Portal|66|R|{1}{U}{U}|Creature - Illusion Warrior|2|2|Phantom Warrior is unblockable.| -Fruition|Portal|66|C|{G}|Sorcery|||You gain 1 life for each Forest on the battlefield.| -Prosperity|Portal|67|R|{X}{U}|Sorcery|||Each player draws X cards.| -Snapping Drake|Portal|68|C|{3}{U}|Creature - Drake|3|2|Flying| -Sorcerous Sight|Portal|69|C|{U}|Sorcery|||Look at target opponent's hand.$$Draw a card.| -Hurricane|Portal|69|R|{X}{G}|Sorcery|||Hurricane deals X damage to each creature with flying and each player.| -Craven Knight|Portal|7|C|{1}{B}|Creature - Human Knight|2|2|Craven Knight can't block.| -Storm Crow|Portal|70|C|{1}{U}|Creature - Bird|1|2|Flying (This creature can't be blocked except by creatures with flying or reach.)| -Symbol of Unsummoning|Portal|71|C|{2}{U}|Sorcery|||Return target creature to its owner's hand.$$Draw a card.| -Theft of Dreams|Portal|73|U|{2}{U}|Sorcery|||Draw a card for each tapped creature target opponent controls.| -Monstrous Growth|Portal|73|C|{1}{G}|Sorcery|||Target creature gets +4/+4 until end of turn.| -Monstrous Growth|Portal|73|C|{1}{G}|Sorcery|||Target creature gets +4/+4 until end of turn.| -Thing from the Deep|Portal|74|R|{6}{U}{U}{U}|Creature - Leviathan|9|9|Whenever Thing from the Deep attacks, sacrifice it unless you sacrifice an Island.| -Natural Spring|Portal|74|U|{3}{G}{G}|Sorcery|||Target player gains 8 life.| -Nature's Lore|Portal|75|C|{1}{G}|Sorcery|||Search your library for a Forest card and put that card onto the battlefield. Then shuffle your library.| -Wind Drake|Portal|78|C|{2}{U}|Creature - Drake|2|2|Flying| -Withering Gaze|Portal|79|U|{2}{U}|Sorcery|||Target opponent reveals his or her hand. You draw a card for each Forest and green card in it.| -Cruel Bargain|Portal|8|R|{B}{B}{B}|Sorcery|||Draw four cards. You lose half your life, rounded up.| -Anaconda|Portal|81|U|{3}{G}|Creature - Snake|3|3|Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)| -Anaconda|Portal|81|U|{3}{G}|Creature - Snake|3|3|Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)| -Bee Sting|Portal|83|U|{3}{G}|Sorcery|||Bee Sting deals 2 damage to target creature or player.| -Bull Hippo|Portal|84|U|{3}{G}|Creature - Hippo|3|3|Islandwalk| -Charging Rhino|Portal|85|R|{3}{G}{G}|Creature - Rhino|4|4|Charging Rhino can't be blocked by more than one creature.| -Deep Wood|Portal|86|U|{1}{G}|Instant|||Cast Deep Wood 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.| -Elite Cat Warrior|Portal|87|C|{2}{G}|Creature - Cat Warrior|2|3|Forestwalk| -Elite Cat Warrior|Portal|87|C|{2}{G}|Creature - Cat Warrior|2|3|Forestwalk| -Elven Cache|Portal|89|C|{2}{G}{G}|Sorcery|||Return target card from your graveyard to your hand.| -Untamed Wilds|Portal|89|U|{2}{G}|Sorcery|||Search your library for a basic land card and put that card onto the battlefield. Then shuffle your library.| -Cruel Tutor|Portal|9|R|{2}{B}|Sorcery|||Search your library for a card, then shuffle your library and put that card on top of it. You lose 2 life.| -Elvish Ranger|Portal|90|C|{2}{G}|Creature - Elf|4|1|| -Giant Spider|Portal|92|C|{3}{G}|Creature - Spider|2|4|Reach (This creature can block creatures with flying.)| -Gorilla Warrior|Portal|93|C|{2}{G}|Creature - Ape Warrior|3|2|| -Taunt|Portal|94|R|{U}|Sorcery|||During target player's next turn, creatures that player controls attack you if able.| -Grizzly Bears|Portal|94|C|{1}{G}|Creature - Bear|2|2|| -Earthquake|Portal|94|R|{X}{R}|Sorcery|||Earthquake deals X damage to each creature without flying and each player.| -Omen|Portal|96|C|{1}{U}|Sorcery|||Look at the top three cards of your library, then put them back in any order. You may shuffle your library.$Draw a card.| -Jungle Lion|Portal|96|C|{G}|Creature - Cat|2|1|Jungle Lion can't block.| -Mobilize|Portal|97|C|{G}|Sorcery|||Untap all creatures you control.| +Forest|Portal|203|L||Basic Land - Forest|||G| +Forest|Portal|204|L||Basic Land - Forest|||G| +Forest|Portal|205|L||Basic Land - Forest|||G| +Forest|Portal|206|L||Basic Land - Forest|||G| +Island|Portal|207|L||Basic Land - Island|||U| +Island|Portal|208|L||Basic Land - Island|||U| +Island|Portal|209|L||Basic Land - Island|||U| +Island|Portal|210|L||Basic Land - Island|||U| +Mountain|Portal|211|L||Basic Land - Mountain|||R| +Mountain|Portal|212|L||Basic Land - Mountain|||R| +Mountain|Portal|213|L||Basic Land - Mountain|||R| +Mountain|Portal|214|L||Basic Land - Mountain|||R| +Plains|Portal|215|L||Basic Land - Plains|||W| +Plains|Portal|216|L||Basic Land - Plains|||W| +Plains|Portal|217|L||Basic Land - Plains|||W| +Plains|Portal|218|L||Basic Land - Plains|||W| +Swamp|Portal|219|L||Basic Land - Swamp|||B| +Swamp|Portal|220|L||Basic Land - Swamp|||B| +Swamp|Portal|221|L||Basic Land - Swamp|||B| +Swamp|Portal|222|L||Basic Land - Swamp|||B| Abyssal Nightstalker|Portal Second Age|1|U|{3}{B}|Creature - Nightstalker|2|2|Whenever Abyssal Nightstalker attacks and isn't blocked, defending player discards a card.| Dakmor Scorpion|Portal Second Age|10|C|{1}{B}|Creature - Scorpion|2|1|| Goblin Matron|Portal Second Age|100|U|{2}{R}|Creature - Goblin|1|1|When Goblin Matron enters the battlefield, you may search your library for a Goblin card, reveal that card, and put it into your hand. If you do, shuffle your library.| @@ -18843,7 +18848,7 @@ Nantuko Husk|Tenth Edition|162|U|{2}{B}|Creature - Zombie Insect|2|2|Sacrifice a Nekrataal|Tenth Edition|163|U|{2}{B}{B}|Creature - Human Assassin|2|1|First strike (This creature deals combat damage before creatures without first strike.)$When Nekrataal enters the battlefield, destroy target nonartifact, nonblack creature. That creature can't be regenerated.| Nightmare|Tenth Edition|164|R|{5}{B}|Creature - Nightmare Horse|*|*|Flying$Nightmare's power and toughness are each equal to the number of Swamps you control.| No Rest for the Wicked|Tenth Edition|165|U|{1}{B}|Enchantment|||Sacrifice No Rest for the Wicked: Return to your hand all creature cards in your graveyard that were put there from the battlefield this turn.| -Phage the Untouchable|Tenth Edition|166|R|{3}{B}{B}{B}{B}|Legendary Creature - Zombie Minion|4|4|When Phage the Untouchable enters the battlefield, if you didn't cast it from your hand, you lose the game.$Whenever Phage deals combat damage to a creature, destroy that creature. It can't be regenerated.$Whenever Phage deals combat damage to a player, that player loses the game.| +Phage the Untouchable|Tenth Edition|166|R|{3}{B}{B}{B}{B}|Legendary Creature - Avatar Minion|4|4|When Phage the Untouchable enters the battlefield, if you didn't cast it from your hand, you lose the game.$Whenever Phage deals combat damage to a creature, destroy that creature. It can't be regenerated.$Whenever Phage deals combat damage to a player, that player loses the game.| Phyrexian Rager|Tenth Edition|167|C|{2}{B}|Creature - Horror|2|2|When Phyrexian Rager enters the battlefield, you draw a card and you lose 1 life.| Plague Beetle|Tenth Edition|168|C|{B}|Creature - Insect|1|1|Swampwalk (This creature is unblockable as long as defending player controls a Swamp.)| Plague Wind|Tenth Edition|169|R|{7}{B}{B}|Sorcery|||Destroy all creatures you don't control. They can't be regenerated.| @@ -23279,7 +23284,7 @@ Fated Return|Born of the Gods|69|R|{4}{B}{B}{B}|Instant|||Put target creature ca Felhide Brawler|Born of the Gods|70|C|{1}{B}|Creature Minotaur|2|2|Felhide Brawler can't block unless you control another Minotaur.| Forlorn Pseudamma|Born of the Gods|71|U|{3}{B}|Creature Zombie|2|1|Intimidate$Inspired - Whenever Forlorn Pseudamma becomes untapped, you may pay {2}{B}. If you do, put a 2/2 black Zombie enchantment creature token onto the battlefield.| Forsaken Drifters|Born of the Gods|72|C|{3}{B}|Creature - Zombie|4|2|When Forsaken Drifters dies, put the top four cards of your library into your graveyard.| -Gild|Born of the Gods|73|R|{3}{B}|Sorcery|||Exile target creature. Put a colorless artifact token named Gold onto the battlefield. It has "Sacrifice this artifact: Add one mana of any color to your mana pool."| +Gild|Born of the Gods|73|R|{3}{B}|Enchantment Creature Hag|3|4|Whenever an opponent draws a card, Fate Unraveler deals 1 damage to that player.| Grisly Transformation|Born of the Gods|74|C|{2}{B}|Enchantment - Aura|||Enchant creature$When Grisly Transformation enters the battlefield, draw a card.$Enchanted creature has intimidate.| Herald of Torment|Born of the Gods|75|R|{1}{B}{B}|Enchantment Creature Demon|3|3|Bestow {3}{B}{B}$Flying$At the beginning of your upkeep, you lose 1 life.$Enchanted creature gets +3/+3 and has flying.| Marshmist Titan|Born of the Gods|76|C|{6}{B}|Creature Giant|4|5|Marshmist Titan costs {X} less to cast, where X is your devotion to black.| @@ -24036,7 +24041,7 @@ Ludevic's Abomination|Launch Party|16b|R||Creature - Lizard Horror|13|13|Trample Mondronen Shaman|Launch Party|17a|R|{3}{R}|Creature - Human Werewolf Shaman|3|2|At the beginning of each upkeep, if no spells were cast last turn, transform Mondronen Shaman.| Tovolar's Magehunter|Launch Party|17b|R||Creature - Werewolf|5|5|Whenever an opponent casts a spell, Tovolar's Magehunter deals 2 damage to that player.$At the beginning of each upkeep, if a player cast two or more spells last turn, transform Tovolar's Magehunter.| Restoration Angel|Launch Party|18|R|{3}{W}|Creature - Angel|3|4|Flash$Flying$When Restoration Angel enters the battlefield, you may exile target non-Angel creature you control, then return that card to the battlefield under your control.| -Staff of Nin|Launch Party|19|R|{6}|{6}|Artifact|||At the beginning of your upkeep, draw a card.${T}: Staff of Nin deals 1 damage to target creature or player.| +Staff of Nin|Launch Party|19|R|{6}|Artifact|||At the beginning of your upkeep, draw a card.${T}: Staff of Nin deals 1 damage to target creature or player.| Deadbridge Goliath|Launch Party|20|R|{2}{G}{G}|Creature - Insect|5|5|Scavenge {4}{G}{G} ({4}{G}{G}, Exile this card from your graveyard: Put a number of +1/+1 counters equal to this card's power on target creature. Scavenge only as a sorcery.)| Skarrg Goliath|Launch Party|21|R|{6}{G}{G}|Creature - Beast|9|9|Trample$Bloodrush {5}{G}{G}, Discard Skarrg Goliath: Target attacking creature gets +9/+9 and gains trample until end of turn.| Breaking|Launch Party|22a|R|{U}{B}|Sorcery|||Target player puts the top eight cards of his or her library into his or her graveyard.$Fuse (You may cast one or both halves of this card from your hand.)| @@ -24050,6 +24055,7 @@ In Garruk's Wake|Launch Party|28|R|{7}{B}{B}|Sorcery|||Destroy all creatures you Sandsteppe Mastodon|Launch Party|29|R|{5}{G}{G}|Creature - Elephant|5|5|Reach$When Sandsteppe Mastodon enters the battlefield, bolster 5. (Choose a creature with the least toughness among creatures you control and put five +1/+1 counters on it.)| Deathbringer Regent|Launch Party|30|R|{5}{B}{B}|Creature - Dragon|5|6|Flying$When Deathbringer Regent enters the battlefield, if you cast it from your hand and there are five or more other creatures on the battlefield, destroy all other creatures.| Mizzium Meddler|Launch Party|31|R|{2}{U}|Creature - Vedalken Wizard|1|4|Flash (You may cast this spell any time you could cast an instant.)$When Mizzium Meddler enters the battlefield, you may change a target of target spell or ability to Mizzium Meddler.| +Blight Herder|Launch Party|32|R|{5}|Creature - Eldrazi Processor|4|5|When you cast Blight Herder, you may put two cards your opponents own from exile into their owners' graveyards. If you do, put three 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."| Ancestral Recall|Vintage Masters|1|Bonus|{U}|Instant|||Target player draws three cards.| Afterlife|Vintage Masters|10|C|{2}{W}|Instant|||Destroy target creature. It can't be regenerated. Its controller puts a 1/1 white Spirit creature token with flying onto the battlefield.| Upheaval|Vintage Masters|100|M|{4}{U}{U}|Sorcery|||Return all permanents to their owners' hands.| @@ -25379,7 +25385,35 @@ Nissa, Worldwaker|Media Inserts|103|Special|{3}{G}{G}|Planeswalker - Nissa||3|+1 Garruk, Apex Predator|Media Inserts|104|Special|{5}{B}{G}|Planeswalker - Garruk||5|+1: Destroy another target planeswalker.$+1: Put a 3/3 black Beast creature token with deathtouch onto the battlefield.$-3: Destroy target creature. You gain life equal to its toughness.$-8: Target opponent gets an emblem with "Whenever a creature attacks you, it gets +5/+5 and gains trample until end of turn."| Shamanic Revelation|Media Inserts|105|Special|{2}{G}{G}|Sorcery|||Draw a card for each creature you control.$Ferocious - You gain 4 life for each creature you control with power 4 or greater.| Ojutai's Command|Media Inserts|106|Special|{2}{W}{U}|Instant|||Choose two - Return target creature card with converted mana cost 2 or less from your graveyard to the battlefield; or You gain 4 life; or Counter target creature spell; or Draw a card.| -Relic Seeker|Media Inserts|107|Special|{1}{W}|Creature - Human Soldier|2|2|Renown 1 (When this creature deals combat damage to a player, if it isn't renowned, put a +1/+1 counter on it and it becomes renowned.)$When Relic Seeker becomes renowned, you may search your library for an Equipment card, reveal it, put it into your hand, then shuffle your library.| +Dragonscale General|Media Inserts|107|Special|{3}{W}|Creature - Human Warrior|2|3|At the beginning of your end step, bolster X, where X is the number of tapped creatures you control. (Choose a creature with the least toughness among creatures you control and put X +1/+1 counters on it.)| +Sage-Eye Avengers|Media Inserts|108|Special|{4}{U}{U}|Creature - Djinn Monk|4|5|Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)$Whenever Sage-Eye Avengers attacks, you may return target creature to its owner's hand if its power is less than Sage-Eye Avengers's power.| +Archfiend of Depravity|Media Inserts|109|Special|{3}{B}{B}|Creature - Demon|5|4|Flying$At the beginning of each opponent's end step, that player chooses up to two creatures he or she controls, then sacrifices the rest.| +Flamerush Rider|Media Inserts|110|Special|{4}{R}|Creature - Human Warrior|3|3|Whenever Flamerush Rider attacks, put a token onto the battlefield tapped and attacking that's a copy of another target attacking creature. Exile the token at end of combat.$Dash {2}{R}{R} (You may cast this spell for its dash cost. If you do, it gains haste, and it's returned from the battlefield to its owner's hand at the beginning of the next end step.)| +Temur War Shaman|Media Inserts|111|Special|{4}{G}{G}|Creature - Human Shaman|4|5|When Temur War Shaman enters the battlefield, manifest the top card of your library. (Put that card onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)$Whenever a permanent you control is turned face up, if it's a creature, you may have it fight target creature you don't control.| +Arashin Sovereign|Media Inserts|112|Special|{5}{G}{W}|Creature - Dragon|6|6|Flying$When Arashin Sovereign dies, you may put it on the top or bottom of its owner's library.| +Pristine Skywise|Media Inserts|113|Special|{4}{W}{U}|Creature - Dragon|6|4|Flying$Whenever you cast a noncreature spell, untap Pristine Skywise. It gains protection from the color of your choice until the end of turn.| +Necromaster Dragon|Media Inserts|114|Special|{3}{U}{B}|Creature - Dragon|4|4|Flying$Whenever Necromaster Dragon deals combat damage to a player, you may pay {2}. If you do, put a 2/2 black Zombie creature token onto the battlefield and each opponent puts the top two cards of his or her library into his or her graveyard.| +Boltwing Marauder|Media Inserts|115|Special|{3}{B}{R}|Creature - Dragon|5|4|Flying$Whenever another creature enters the battlefield under your control, target creature gets +2/+0 until end of turn.| +Harbinger of the Hunt|Media Inserts|116|Special|{3}{R}{G}|Creature - Dragon|5|3|Flying${2}{R}: Harbinger of the Hunt deals 1 damage to each creature without flying.${2}{G}: Harbinger of the Hunt deals 1 damage to each other creature with flying.| +Sultai Charm|Media Inserts|117|Special|{B}{G}{U}|Instant|||Choose one -$ Destroy target monocolored creature.$ Destroy target artifact or enchantment.$ Draw two cards, then discard a card.| +Aeronaut Tinkerer|Media Inserts|118|C|{2}{U}|Creature - Human Artificer|2|3|Aeronaut Tinkerer has flying as long as you control an artifact.| +Dragon Fodder|Media Inserts|119|C|{1}{R}|Sorcery|||Put two 1/1 red Goblin creature tokens onto the battlefield.| +Dragonlord's Servant|Media Inserts|120|Special|{1}{R}|Creature - Goblin Shaman|1|3|Dragon spells you cast cost {1} less to cast.| +Evolving Wilds|Media Inserts|121|C||Land|||{tap}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| +Foe-Razer Regent|Media Inserts|122|Special|{5}{G}{G}|Creature - Dragon|4|5|Flying$When Foe-Razer Regent enters the battlefield, you may have it fight target creature you don't control.$Whenever a creature you control fights, put two +1/+1 counters on it at the beginning of the next end step.| +Relic Seeker|Media Inserts|123|Special|{1}{W}|Creature - Human Soldier|2|2|Renown 1 (When this creature deals combat damage to a player, if it isn't renowned, put a +1/+1 counter on it and it becomes renowned.)$When Relic Seeker becomes renowned, you may search your library for an Equipment card, reveal it, put it into your hand, then shuffle your library.| +Kytheon, Hero of Akros|Media Inserts|124|Special|{W}|Legendary Creature - Human Soldier|2|1|At end of combat, if Kytheon, Hero of Akros and at least two other creatures attacked this combat, exile Kytheon, then return him to the battlefield transformed under his owner's control.${2}{W}: Kytheon gains indestructible until end of turn.| +Gideon, Battle-Forged|Media Inserts|124|Special||Planeswalker - Gideon|3|+2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able.$+1: Until your next turn, target creature gains indestructible. Untap that creature.$0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.| +Jace, Vryn's Prodigy|Media Inserts|125|Special|{1}{U}|Legendary Creature - Human Wizard|0|2|{T}: Draw a card, then discard a card. If there are five or more cards in your graveyard, exile Jace, Vryn''s Prodigy, then return him to the battefield transformed under his owner's control. | +Jace, Telepath Unbound|Media Inserts|125|Special||Planeswalker - Jace|5|+1: Up to one target creature gets -2/-0 until your next turn.$-3: You may cast target instant or sorcery card from your graveyard this turn. If that card would be put into your graveyard this turn, exile it instead.$-9: You get an emblem with "Whenever you cast a spell, target opponent puts the top five cards of his or her library into his or her graveyard". | +Liliana, Heretical Healer|Media Inserts|126|Special|{1}{B}{B}|Legendary Creature - Human Cleric|2|3|Lifelink$Whenever another nontoken creature you control dies, exile Liliana Heretical Healer, then return her to the battlefield transformed under her owner's control. If you do, put a 2/2 black Zombie creature token onto the battlefield.| +Liliana, Defiant Necromancer|Media Inserts|126|Special||Planeswalker - Liliana|3|+2: Each player discards a card.$-X: Return target nonlegendary creature with converted mana cost X from your graveyard to the battlefield.$-8: You get an emblem with "Whenever a creature you control dies, return it to the battlefield under your control at the beginning of the next end step."| +Chandra, Fire of Kaladesh|Media Inserts|127|Special|{1}{R}{R}|Legendary Creature - Human Shaman|2|2|Whenever you cast a red spell, untap Chandra, Fire of Kaladesh.${T}: Chandra, Fire of Kaladesh deals 1 damage to target player. If Chandra has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.| +Chandra, Roaring Flame|Media Inserts|127|Special||Planeswalker - Chandra|4|+1: Chandra, Roaring Flame deals 2 damage to target player.$-2: Chandra, Roaring Flame deals 2 damage to target creature.$-7: Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you."| +Nissa, Vastwood Seer|Media Inserts|128|Special|{2}{G}|Legendary Creature - Elf Scout|2|2|When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library.$Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.| +Nissa, Sage Animist|Media Inserts|128|Special||Planeswalker - Nissa|3|+1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.$-2: Put a legendary 4/4 green Elemental creature token named Ashaya, the Awoken World onto the battlefield.$-7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands.| +Ruinous Path|Media Inserts|129|Special|{1}{B}{B}|Sorcery|||Destroy target creature or planeswalker.$Awaken 4-{5}{B}{B} (If you cast this spell for {5}{B}{B}, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Scythe Leopard|Media Inserts|130|Special|{G}|Creature - Cat|1|1|Landfall-Whenever a land enters the battlefield under your control, Scythe Leopard gets +1/+1 until end of turn.| Sultai|Media Inserts|999|Special|{{U}{B}{G}|Legendary Creature - Placeholder|2|2|| Wood Elves|WPN Gateway|1|Special|{2}{G}|Creature — Elf Scout|1|1|When Wood Elves enters the battlefield, search your library for a Forest card and put that card onto the battlefield. Then shuffle your library.| Icatian Javelineers|WPN Gateway|2|Special|{W}|Creature — Human Soldier|1|1|Icatian Javelineers enters the battlefield with a javelin counter on it.${T}, Remove a javelin counter from Icatian Javelineers: Icatian Javelineers deals 1 damage to target creature or player.| @@ -26647,7 +26681,7 @@ Standing Troops|Duel Decks: Elspeth vs. Kiora|25|C|{2}{W}|Creature - Human Soldi Sunlance|Duel Decks: Elspeth vs. Kiora|26|C|{W}|Sorcery|||Sunlance deals 3 damage to target nonwhite creature.| Veteran Armorsmith|Duel Decks: Elspeth vs. Kiora|27|C|{W}{W}|Creature - Human Soldier|2|3|Other Soldier creatures you control get +0/+1.| Veteran Swordsmith|Duel Decks: Elspeth vs. Kiora|28|C|{2}{W}|Creature - Human Soldier|3|2|Other Soldier creatures you control get +1/+0.| -Secluded Steppe|Duel Decks: Elspeth vs. Kiora|29|C|Land|||Secluded Steppe enters the battlefield tapped.${T}: Add {W} to your mana pool.$Cycling {W} ({W}, Discard this card: Draw a card.)| +Secluded Steppe|Duel Decks: Elspeth vs. Kiora|29|C||Land|||Secluded Steppe enters the battlefield tapped.${T}: Add {W} to your mana pool.$Cycling {W} ({W}, Discard this card: Draw a card.)| Plains|Duel Decks: Elspeth vs. Kiora|30|L||Basic Land - Plains|||({T}: Add {W} to your mana pool.)| Plains|Duel Decks: Elspeth vs. Kiora|31|L||Basic Land - Plains|||({T}: Add {W} to your mana pool.)| Plains|Duel Decks: Elspeth vs. Kiora|32|L||Basic Land - Plains|||({T}: Add {W} to your mana pool.)| @@ -27235,7 +27269,710 @@ Mountain|Premium Deck Series: Slivers|40|L||Basic Land - Mountain|||R| Forest|Premium Deck Series: Slivers|41|L||Basic Land - Forest|||G| Akroma, Angel of Fury|From the Vault: Angels|1|M|{5}{R}{R}{R}|Legendary Creature - Angel|6|6|Akroma, Angel of Fury can't be countered.$Flying, trample, protection from white and from blue${R}: Akroma, Angel of Fury gets +1/+0 until end of turn.$Morph {3}{R}{R}{R} You may cast this card face downn as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)| Akroma, Angel of Wrath|From the Vault: Angels|2|M|{5}{W}{W}{W}|Legendary Creature - Angel|6|6|Flying, first strike, vigilance, trample, haste, protection from black and from red| +Archangel of Strife|From the Vault: Angels|3|M|{5}{W}{W}|Creature - Angel|6|6|Flying$As Archangel of Strife enters the battlefield, each player chooses war or peace.$Creatures controlled by players who chose war get +3/+0.$Creatures controlled by players who chose peace get +0/+3.| +Aurelia, the Warleader|From the Vault: Angels|4|M|{2}{R}{R}{W}{W}|Legendary Creature - Angel|3|4|Flying, vigilance, haste$Whenever Aurelia, the Warleader attacks for the first time each turn, untap all creatures you control. After this phase, there is an additional combat phase.| Avacyn, Angel of Hope|From the Vault: Angels|5|M|{5}{W}{W}{W}|Legendary Creature - Angel|8|8|Flying, vigilance$Avacyn, Angel of Hope and other permanents you control are indestructible.| +Baneslayer Angel|From the Vault: Angels|6|M|{3}{W}{W}|Creature - Angel|5|5|Flying, first strike, lifelink, protection from Demons and from Dragons| +Entreat the Angels|From the Vault: Angels|7|M|{X}{X}{W}{W}{W}|Sorcery|||Put X 4/4 white Angel creature tokens with flying onto the battlefield.$Miracle {X}{W}{W} (You may cast this card for its miracle cost when you draw it if it's the first card you drew this turn.)| +Exalted Angel|From the Vault: Angels|8|M|{4}{W}{W}|Creature - Angel|4|5|Flying$Whenever Exalted Angel deals damage, you gain that much life.$Morph {2}{W}{W} You may cast this card face downn as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)| Iona, Shield of Emeria|From the Vault: Angels|9|M|{6}{W}{W}{W}|Legendary Creature - Angel|7|7|Flying$As Iona, Shield of Emeria enters the battlefield, choose a color.$Your opponents can't cast spells of the chosen color.| -Oblivion Sower|Battle for Zendikar|999|M|{6}|Creature - Eldrazi|5|8|When you cast Oblivion Sower, target opponent exiles the top four cards of his or her library, then you may put any number of land cards that player owns from exile onto the battlefield under your control.| -Evolving Wilds|Battle for Zendikar|236|C||Land|||{T}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| \ No newline at end of file +Iridescent Angel|From the Vault: Angels|10|M|{5}{W}{U}|Creature - Angel|4|4|Flying, protection from all colors| +Jenara, Asura of War|From the Vault: Angels|11|M|{G}{W}{U}|Legendary Creature - Angel|3|3|Flying${1}{W}: Put a +1/+1 counter on Jenara, Asura of War.| +Lightning Angel|From the Vault: Angels|12|M|{1}{R}{W}{U}|Creature - Angel|3|4|Flying, vigilance, haste| +Platinum Angel|From the Vault: Angels|13|M|{7}|Artifact Creature - Angel|4|4|Flying$You can't lose the game and your opponents can't win the game.| +Serra Angel|From the Vault: Angels|14|M|{3}{W}{W}|Creature - Angel|4|4|Flying$Vigilance (Attacking doesn't cause this creature to tap.)| +Tariel, Reckoner of Souls|From the Vault: Angels|15|M|{4}{W}{B}{R}|Legendary Creature - Angel|4|7|Flying, vigilance${tap}: Choose a creature card at random from target opponent's graveyard. Put that card onto the battlefield under your control.| +Avenger of Zendikar|Duel Decks: Zendikar vs. Eldrazi|1|M|{5}{G}{G}|Creature - Elemental|5|5|When Avenger of Zendikar enters the battlefield, put a 0/1 green Plant creature token onto the battlefield for each land you control.$Landfall - Whenever a land enters the battlefield under your control, you may put a +1/+1 counter on each Plant creature you control.| +Affa Guard Hound|Duel Decks: Zendikar vs. Eldrazi|2|U|{2}{W}|Creature - Hound|2|2|Flash$When Affa Guard Hound enters the battlefield, target creature gets +0/+3 until end of turn.| +Caravan Escort|Duel Decks: Zendikar vs. Eldrazi|3|C|{W}|Creature - Human Knight|1|1|Level up {2} ({2}: Put a level counter on this. Level up only as a sorcery.)$LEVEL 1-4$2/2$$LEVEL 5+$5/5$First strike| +Kabira Vindicator|Duel Decks: Zendikar vs. Eldrazi|4|U|{3}{W}|Creature - Human Knight|2|4|Level up {2}{W} ({2}{W}: Put a level counter on this. Level up only as a sorcery.)$LEVEL 2-4$3/6$Other creatures you control get +1/+1.$LEVEL 5+$4/8$Other creatures you control get +2/+2.| +Knight of Cliffhaven|Duel Decks: Zendikar vs. Eldrazi|5|C|{1}{W}|Creature - Kor Knight|2|2|Level up {3} ({3}: Put a level counter on this. Level up only as a sorcery.)$LEVEL 1-3$2/3$Flying$LEVEL 4+$4/4$Flying, vigilance| +Makindi Griffin|Duel Decks: Zendikar vs. Eldrazi|6|C|{3}{W}|Creature - Griffin|2|4|Flying| +Oust|Duel Decks: Zendikar vs. Eldrazi|7|U|{W}|Sorcery|||Put target creature into its owner's library second from the top. Its controller gains 3 life.| +Repel the Darkness|Duel Decks: Zendikar vs. Eldrazi|8|C|{2}{W}|Instant|||Tap up to two target creatures.$Draw a card.| +Sheer Drop|Duel Decks: Zendikar vs. Eldrazi|9|C|{2}{W}|Sorcery|||Destroy target tapped creature.$Awaken 3-{5}{W} (If you cast this spell for {5}{W}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Beastbreaker of Bala Ged|Duel Decks: Zendikar vs. Eldrazi|10|U|{1}{G}|Creature - Human Warrior|2|2|Level up {2}{G} ({2}{G}: Put a level counter on this. Level up only as a sorcery.)$LEVEL 1-3$4/4$$LEVEL 4+$6/6$Trample| +Daggerback Basilisk|Duel Decks: Zendikar vs. Eldrazi|11|C|{2}{G}|Creature - Basilisk|2|2|Deathtouch| +Frontier Guide|Duel Decks: Zendikar vs. Eldrazi|12|U|{1}{G}|Creature - Elf Scout|1|1|{3}{G}, {tap}: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| +Graypelt Hunter|Duel Decks: Zendikar vs. Eldrazi|13|C|{3}{G}|Creature - Human Warrior Ally|2|2|Trample$Whenever Graypelt Hunter or another Ally enters the battlefield under your control, you may put a +1/+1 counter on Graypelt Hunter.| +Grazing Gladehart|Duel Decks: Zendikar vs. Eldrazi|14|C|{2}{G}|Creature - Antelope|2|2|Landfall — Whenever a land enters the battlefield under your control, you may gain 2 life.| +Groundswell|Duel Decks: Zendikar vs. Eldrazi|15|C|{G}|Instant|||Target creature gets +2/+2 until end of turn.$Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead.| +Harrow|Duel Decks: Zendikar vs. Eldrazi|16|C|{2}{G}|Instant|||As an additional cost to cast Harrow, sacrifice a land.$Search your library for up to two basic land cards and put them onto the battlefield. Then shuffle your library.| +Joraga Bard|Duel Decks: Zendikar vs. Eldrazi|17|C|{3}{G}|Creature - Elf Rogue Ally|1|4|Whenever Joraga Bard or another Ally enters the battlefield under your control, you may have Ally creatures you control gain vigilance until end of turn.| +Khalni Heart Expedition|Duel Decks: Zendikar vs. Eldrazi|18|C|{1}{G}|Enchantment|||Landfall - Whenever a land enters the battlefield under your control, you may put a quest counter on Khalni Heart Expedition.$Remove three quest counters from Khalni Heart Expedition and sacrifice it: Search your library for up to two basic land cards, put them onto the battlefield tapped, then shuffle your library.| +Ondu Giant|Duel Decks: Zendikar vs. Eldrazi|19|C|{3}{G}|Creature - Giant Druid|2|4|When Ondu Giant enters the battlefield, you may search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library.| +Primal Command|Duel Decks: Zendikar vs. Eldrazi|20|R|{3}{G}{G}|Sorcery|||Choose two - Target player gains 7 life; or put target noncreature permanent on top of its owner's library; or target player shuffles his or her graveyard into his or her library; or search your library for a creature card, reveal it, put it into your hand, then shuffle your library.| +Retreat to Kazandu|Duel Decks: Zendikar vs. Eldrazi|21|U|{2}{G}|Enchantment|||Landfall-Whenever a land enters the battlefield under your control, choose one - Put a +1/+1 counter on target creature; or You gain 2 life.| +Scute Mob|Duel Decks: Zendikar vs. Eldrazi|22|R|{G}|Creature - Insect|1|1|At the beginning of your upkeep, if you control five or more lands, put four +1/+1 counters on Scute Mob.| +Tajuru Archer|Duel Decks: Zendikar vs. Eldrazi|23|U|{2}{G}|Creature - Elf Archer Ally|1|2|Whenever Tajuru Archer or another Ally enters the battlefield under your control, you may have Tajuru Archer deal damage to target creature with flying equal to the number of Allies you control.| +Territorial Baloth|Duel Decks: Zendikar vs. Eldrazi|24|C|{4}{G}|Creature - Beast|4|4|Landfall - Whenever a land enters the battlefield under your control, Territorial Baloth gets +2/+2 until end of turn.| +Turntimber Basilisk|Duel Decks: Zendikar vs. Eldrazi|25|U|{1}{G}{G}|Creature - Basilisk|2|1|Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)$Landfall - Whenever a land enters the battlefield under your control, you may have target creature block Turntimber Basilisk this turn if able.| +Wildheart Invoker|Duel Decks: Zendikar vs. Eldrazi|26|C|{2}{G}{G}|Creature - Elf Shaman|4|3|{8}: Target creature gets +5/+5 and gains trample until end of turn.| +Veteran Warleader|Duel Decks: Zendikar vs. Eldrazi|27|R|{1}{G}{W}|Creature - Human Soldier Ally|0|0|Veteran Warleader's power and toughness are each equal to the number of creatures you control.$Tap another untapped Ally you control: Veteran Warleader gains your choice of first strike, vigilance, or trample until end of turn.| +Explorer's Scope|Duel Decks: Zendikar vs. Eldrazi|28|U|{1}|Artifact - Equipment|||Whenever equipped creature attacks, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped.$Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)| +Seer's Sundial|Duel Decks: Zendikar vs. Eldrazi|29|R|{4}|Artifact|||Landfall - Whenever a land enters the battlefield under your control, you may pay {2}. If you do, draw a card.| +Stonework Puma|Duel Decks: Zendikar vs. Eldrazi|30|C|{3}|Artifact Creature - Cat Ally|2|2|| +Evolving Wilds|Duel Decks: Zendikar vs. Eldrazi|31|C||Land|||{T}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| +Graypelt Refuge|Duel Decks: Zendikar vs. Eldrazi|32|U||Land|||Graypelt Refuge enters the battlefield tapped.$When Graypelt Refuge enters the battlefield, you gain 1 life.${tap}: Add {G} or {W} to your mana pool.| +Stirring Wildwood|Duel Decks: Zendikar vs. Eldrazi|33|R||Land|||Stirring Wildwood enters the battlefield tapped.${tap}: Add {G} or {W} to your mana pool.${1}{G}{W}: Until end of turn, Stirring Wildwood becomes a 3/4 green and white Elemental creature with reach. It's still a land.| +Turntimber Grove|Duel Decks: Zendikar vs. Eldrazi|34|C||Land|||Turntimber Grove enters the battlefield tapped.$When Turntimber Grove enters the battlefield, target creature gets +1/+1 until end of turn.${tap}: Add {G} to your mana pool.| +Plains|Duel Decks: Zendikar vs. Eldrazi|35|L||Basic Land - Plains|||W| +Plains|Duel Decks: Zendikar vs. Eldrazi|36|L||Basic Land - Plains|||W| +Plains|Duel Decks: Zendikar vs. Eldrazi|37|L||Basic Land - Plains|||W| +Forest|Duel Decks: Zendikar vs. Eldrazi|38|L||Basic Land - Forest|||G| +Forest|Duel Decks: Zendikar vs. Eldrazi|39|L||Basic Land - Forest|||G| +Forest|Duel Decks: Zendikar vs. Eldrazi|40|L||Basic Land - Forest|||G| +Oblivion Sower|Duel Decks: Zendikar vs. Eldrazi|41|M|{6}|Creature - Eldrazi|5|8|When you cast Oblivion Sower, target opponent exiles the top four cards of his or her library, then you may put any number of land cards that player owns from exile onto the battlefield under your control.| +Artisan of Kozilek|Duel Decks: Zendikar vs. Eldrazi|42|U|{9}|Creature - Eldrazi|10|9|When you cast Artisan of Kozilek, you may return target creature card from your graveyard to the battlefield.$Annihilator 2 (Whenever this creature attacks, defending player sacrifices two permanents.)| +It That Betrays|Duel Decks: Zendikar vs. Eldrazi|43|R|{12}|Creature - Eldrazi|11|11|Annihilator 2 (Whenever this creature attacks, defending player sacrifices two permanents.)$Whenever an opponent sacrifices a nontoken permanent, put that card onto the battlefield under your control.| +Ulamog's Crusher|Duel Decks: Zendikar vs. Eldrazi|44|C|{8}|Creature - Eldrazi|8|8|Annihilator 2 (Whenever this creature attacks, defending player sacrifices two permanents.)$Ulamog's Crusher attacks each turn if able.| +Bloodrite Invoker|Duel Decks: Zendikar vs. Eldrazi|45|C|{2}{B}|Creature - Vampire Shaman|3|1|{8}: Target player loses 3 life and you gain 3 life.| +Bloodthrone Vampire|Duel Decks: Zendikar vs. Eldrazi|46|C|{1}{B}|Creature - Vampire|1|1|Sacrifice a creature: Bloodthrone Vampire gets +2/+2 until end of turn.| +Butcher of Malakir|Duel Decks: Zendikar vs. Eldrazi|47|R|{5}{B}{B}|Creature - Vampire Warrior|5|4|Flying$Whenever Butcher of Malakir or another creature you control dies, each opponent sacrifices a creature.| +Cadaver Imp|Duel Decks: Zendikar vs. Eldrazi|48|C|{1}{B}{B}|Creature - Imp|1|1|Flying$When Cadaver Imp enters the battlefield, you may return target creature card from your graveyard to your hand.| +Consume the Meek|Duel Decks: Zendikar vs. Eldrazi|49|R|{3}{B}{B}|Instant|||Destroy each creature with converted mana cost 3 or less. They can't be regenerated.| +Corpsehatch|Duel Decks: Zendikar vs. Eldrazi|50|U|{3}{B}{B}|Sorcery|||Destroy target nonblack creature. Put two 0/1 colorless Eldrazi Spawn creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."| +Dominator Drone|Duel Decks: Zendikar vs. Eldrazi|51|C|{2}{B}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)$When Dominator Drone enters the battlefield, if you control another colorless creature, each opponent loses 2 life.| +Heartstabber Mosquito|Duel Decks: Zendikar vs. Eldrazi|52|C|{3}{B}|Creature - Insect|2|2|Kicker {2}{B} (You may pay an additional {2}{B} as you cast this spell.)$Flying$When Heartstabber Mosquito enters the battlefield, if it was kicked, destroy target creature.| +Induce Despair|Duel Decks: Zendikar vs. Eldrazi|53|C|{2}{B}|Instant|||As an additional cost to cast Induce Despair, reveal a creature card from your hand.$Target creature gets -X/-X until end of turn, where X is the revealed card's converted mana cost.| +Marsh Casualties|Duel Decks: Zendikar vs. Eldrazi|54|U|{B}{B}|Sorcery|||Kicker {3} (You may pay an additional {3} as you cast this spell.)$Creatures target player controls get -1/-1 until end of turn. If Marsh Casualties was kicked, those creatures get -2/-2 until end of turn instead.| +Pawn of Ulamog|Duel Decks: Zendikar vs. Eldrazi|55|U|{1}{B}{B}|Creature - Vampire Shaman|2|2|Whenever Pawn of Ulamog or another nontoken creature you control dies, you may put a 0/1 colorless Eldrazi Spawn creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."| +Read the Bones|Duel Decks: Zendikar vs. Eldrazi|56|C|{2}{B}|Sorcery|||Scry 2, then draw 2 cards. You lose 2 life. (To scry 2, look at the top 2 cards of your library, then put any number of them on the bottom of your library and the rest on top in any order.)| +Smother|Duel Decks: Zendikar vs. Eldrazi|57|U|{1}{B}|Instant|||Destroy target creature with converted mana cost 3 or less. It can't be regenerated.| +Vampire Nighthawk|Duel Decks: Zendikar vs. Eldrazi|58|U|{1}{B}{B}|Creature - Vampire Shaman|2|3|Flying$Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)$Lifelink (Damage dealt by this creature also causes you to gain that much life.)| +Emrakul's Hatcher|Duel Decks: Zendikar vs. Eldrazi|59|C|{4}{R}|Creature - Eldrazi Drone|3|3|When Emrakul's Hatcher enters the battlefield, put three 0/1 colorless Eldrazi Spawn creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."| +Forked Bolt|Duel Decks: Zendikar vs. Eldrazi|60|U|{R}|Sorcery|||Forked Bolt deals 2 damage divided as you choose among one or two target creatures and/or players.| +Hellion Eruption|Duel Decks: Zendikar vs. Eldrazi|61|R|{5}{R}|Sorcery|||Sacrifice all creatures you control, then put that many 4/4 red Hellion creature tokens onto the battlefield.| +Magmaw|Duel Decks: Zendikar vs. Eldrazi|62|R|{3}{R}{R}|Creature - Elemental|4|4|{1}, Sacrifice a nonland permanent: Magmaw deals 1 damage to target creature or player.| +Torch Slinger|Duel Decks: Zendikar vs. Eldrazi|63|C|{2}{R}|Creature - Goblin Shaman|2|2|Kicker {1}{R} (You may pay an additional {1}{R} as you cast this spell.)$When Torch Slinger enters the battlefield, if it was kicked, it deals 2 damage to target creature.| +Forerunner of Slaughter|Duel Decks: Zendikar vs. Eldrazi|64|U|{B}{R}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)${1}: Target colorless creature gains haste until end of turn.| +Mind Stone|Duel Decks: Zendikar vs. Eldrazi|65|U|{2}|Artifact|||{tap}: Add {1} to your mana pool.${1}, {tap}, Sacrifice Mind Stone: Draw a card.| +Runed Servitor|Duel Decks: Zendikar vs. Eldrazi|66|U|{2}|Artifact Creature - Construct|2|2|When Runed Servitor dies, each player draws a card.| +Akoum Refuge|Duel Decks: Zendikar vs. Eldrazi|67|U||Land|||Akoum Refuge enters the battlefield tapped.$When Akoum Refuge enters the battlefield, you gain 1 life.${tap}: Add {B} or {R} to your mana pool.| +Eldrazi Temple|Duel Decks: Zendikar vs. Eldrazi|68|U||Land|||{tap}: Add {1} to your mana pool.${tap}: Add {2} to your mana pool. Spend this mana only to cast colorless Eldrazi spells or activate abilities of colorless Eldrazi.| +Rocky Tar Pit|Duel Decks: Zendikar vs. Eldrazi|69|U||Land|||Rocky Tar Pit enters the battlefield tapped.${tap}, Sacrifice Rocky Tar Pit: Search your library for a Swamp or Mountain card and put it onto the battlefield. Then shuffle your library.| +Swamp|Duel Decks: Zendikar vs. Eldrazi|70|L||Basic Land - Swamp|||B| +Swamp|Duel Decks: Zendikar vs. Eldrazi|71|L||Basic Land - Swamp|||B| +Swamp|Duel Decks: Zendikar vs. Eldrazi|72|L||Basic Land - Swamp|||B| +Mountain|Duel Decks: Zendikar vs. Eldrazi|73|L||Basic Land - Mountain|||M| +Mountain|Duel Decks: Zendikar vs. Eldrazi|74|L||Basic Land - Mountain|||M| +Mountain|Duel Decks: Zendikar vs. Eldrazi|75|L||Basic Land - Mountain|||M| +Blight Herder|Battle for Zendikar|002|R|{5}|Creature - Eldrazi Processor|4|5|When you cast Blight Herder, you may put two cards your opponents own from exile into their owners' graveyards. If you do, put three 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."| +Kozilek's Channeler|Battle for Zendikar|010|C|{5}|Creature - Eldrazi|4|4|{T}: Add {2} to your mana pool.| +Eldrazi Devastator|Battle for Zendikar|007|C|{8}|Creature - Eldrazi|8|9|Trample| +Titan's Presence|Battle for Zendikar|014|U|{3}|Instant|||As an additional cost to cast Titan's Presence, reveal a colorless creature card from your hand.$Exile target creature if its power is less than or equal to the revealed card's power.| +Ulamog, the Ceaseless Hunger|Battle for Zendikar|015|M|{1}{0}|Legendary Creature - Eldrazi|10|10|When you cast Ulamog, the Ceaseless Hunger, exile two target permanents.$Indestructible$Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.| +Breaker of Armies|Battle for Zendikar|003|U|{8}|Creature - Eldrazi|10|8|All creatures able to block Breaker of Armies do so.| +Desolation Twin|Battle for Zendikar|006|R|{1}{0}|Creature - Eldrazi|10|10|When you cast Desolation Twin, put a 10/10 colorless Eldrazi creature token onto the battlefield.| +Conduit of Ruin|Battle for Zendikar|004|R|{6}|Creature - Eldrazi|5|5|When you cast Conduit of Ruin, you may search your library for a colorless creature card with converted mana cost 7 or greater, reveal it, then shuffle your library and put that card on top of it.$The first creature spell you cast each turn costs {2} less to cast.| +Deathless Behemoth|Battle for Zendikar|005|U|{6}|Creature - Eldrazi|6|6|Vigilance$Sacrifice two Eldrazi Scions: Return Deathless Behemoth from your graveyard to your hand. Activate this ability only any time you could cast a sorcery.| +Void Winnower|Battle for Zendikar|017|M|{9}|Creature - Eldrazi|11|9|Your opponent can't cast spells with even converted mana costs. (Zero is even.)$Your opponents can't block with creatures with even converted mana costs.| +Endless One|Battle for Zendikar|008|R|{X}|Creature - Eldrazi|0|0|Endless One enters the battlefield with X +1/+1 counters on it.| +Scour from Existence|Battle for Zendikar|013|C|{7}|Instant|||Exile target permanent.| +Gruesome Slaughter|Battle for Zendikar|009|R|{6}|Sorcery|||Until end of turn, colorless creatures you control gain "{T}: This creature deals damage equal to its power to target creature."| +Bane of Bala Ged|Battle for Zendikar|001|U|{7}|Creature - Eldrazi|7|5|Whenever Bane of Bala Ged attacks, defending player exiles two permanents he or she controls.| +Ruin Processor|Battle for Zendikar|012|U|{7}|Creature - Eldrazi Processor|7|8|When you cast Ruin Processor, you may put a card an opponent owns from exile into that player's graveyard. If you do, you gain 5 life.| +Ulamog's Despoiler|Battle for Zendikar|016|U|{6}|Creature - Eldrazi Processor|5|5|As Ulamog's Despoiler enters the battlefield, you may put two cards your opponents own from exile into their owners' graveyards. If you do, Ulamog's Despoiler enters the battlefield with four +1/+1 counters on it.| +Oblivion Sower|Battle for Zendikar|011|M|{6}|Creature - Eldrazi|5|8|When you cast Oblivion Sower, target opponent exiles the top four cards of his or her library, then you may put any number of land cards that player owns from exile onto the battlefield under your control.| +Angel of Renewal|Battle for Zendikar|018|U|{5}{W}|Creature - Angel Ally|4|4|Flying$When Angel of Renewal enters the battlefield, you gain 1 life for each creature you control.| +Angelic Gift|Battle for Zendikar|019|C|{1}{W}|Enchantment - Aura|||Enchant creature$When Angelic Gift enters the battlefield, draw a card.$Enchanted creature has flying.| +Cliffside Lookout|Battle for Zendikar|020|C|{W}|Creature - Kor Scout Ally|1|1|{4}{W}: Creatures you control get +1/+1 until end of turn.| +Courier Griffin|Battle for Zendikar|020|C|{3}{W}|Creature - Griffin|2|3|Flying$When Courier Griffin enters the battlefield, you gain 2 life.| +Emeria Shepherd|Battle for Zendikar|22|R|{5}{W}{W}|Creature - Angel|4|4|Flying$Landfall — Whenever a land enters the battlefield under your control, you may return target nonland permanent card from your graveyard to your hand. If that land is a Plains, you may return that nonland permanent card to the battlefield instead.| +Encircling Fissure|Battle for Zendikar|023|U|{2}{W}|Instant|||Prevent all combat damage that would be dealt this turn by creatures target opponent controls.$Awaken 2 —{4}{W} (If you cast this spell for 5U, also put two +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Expedition Envoy|Battle for Zendikar|024|U|{W}|Creature - Human Scout Ally|2|1|| +Felidar Cub|Battle for Zendikar|25|C|{1}{W}|Creature - Cat Beast|2|2|Sacrifice Felidar Cub: Destroy target enchantment.| +Felidar Sovereign|Battle for Zendikar|26|R|{4}{W}{W}|Creature - Cat Beast|4|6|Vigilance, lifelink$At the beginning of your upkeep, if you have 40 or more life, you win the game.| +Fortified Rampart|Battle for Zendikar|027|C|{1}{W}|Creature - Wall|0|6|Defender| +Ghostly Sentinel|Battle for Zendikar|028|C|{4}{W}|Creature - Kor Spirit|3|3|Flying, vigilance| +Gideon, Ally of Zendikar|Battle for Zendikar|29|M|{2}{W}{W}|Planeswalker - Gideon|4|+1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.$0: Put a 2/2 white Knight Ally creature token onto the battlefield.$-4: You get an emblem with "Creatures you control get +1/+1."| +Gideon's Reproach|Battle for Zendikar|30|C|{1}{W}|Instant|||Gideon's Reproach deals 4 damage to target attacking or blocking creature.| +Hero of Goma Fada|Battle for Zendikar|31|R|{4}{W}|Creature - Human Knight Ally|4|3|Rally — Whenever Hero of Goma Fada or another Ally enters the battlefield under your control, creatures you control gain indestructible until end of turn.| +Inspired Charge|Battle for Zendikar|032|C|{2}{W}{W}|Instant|||Creatures you control get +2/+1 until end of turn.| +Kitesail Scout|Battle for Zendikar|033|C|{W}|Creature - Kor Scout|1|1|Flying| +Kor Bladewhirl|Battle for Zendikar|034|U|{1}{W}|Creature - Kor Soldier Ally|2|2|Rally — Whenever Kor Bladewhirl or another Ally enters the battlefield under your control, creatures you control gain first strike until end of turn.| +Kor Castigator|Battle for Zendikar|035|C|{1}{W}|Creature - Kor Wizard Ally|3|1|Kor Castigator can't be blocked by Eldrazi Scions.| +Kor Entanglers|Battle for Zendikar|036|U|{4}{W}|Creature - Kor Soldier Ally|3|4|Rally — Whenever Kor Entanglers or another Ally enters the battlefield under your control, tap target creature an opponent controls.| +Lantern Scout|Battle for Zendikar|37|R|{2}{W}|Creature - Human Scout Ally|3|2|Rally — Whenever Lantern Scout or another Ally enters the battlefield under your control, creatures you control gain lifelink until end of turn.| +Lithomancer's Focus|Battle for Zendikar|038|C|{W}|Instant|||Target creature gets +2/+2 until end of turn. Prevent all damage that would be dealt to that creature this turn by colorless sources.| +Makindi Patrol|Battle for Zendikar|039|C|{2}{W}|Creature - Human Knight Ally|2|3|Rally — Whenever Makindi Patrol or another Ally enters the battlefield under your control, creatures you control gain vigilance until end of turn.| +Ondu Greathorn|Battle for Zendikar|040|C|{3}{W}|Creature - Beast|2|3|First strike$Landfall — Whenever a land enters the battlefield under your control, Ondu Greathorn gets +2/+2 until end of turn.| +Ondu Rising|Battle for Zendikar|041|U|{1}{W}|Sorcery|||Whenever a creature attacks this turn, it gains lifelink until end of turn.$Awaken 4—{4}{W} (If you cast this spell for 5U, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Planar Outburst|Battle for Zendikar|42|R|{3}{W}{W}|Sorcery|||Destroy all nonland creatures.$Awaken 4—{5}{W}{W}{W} (If you cast this spell for {5}{W}{W}{W}, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Quarantine Field|Battle for Zendikar|43|M|{X}{X}{W}{W}|Enchantment|||Quarantine Field enters the battlefield with X isolation counters on it.$When Quarantine Field enters the battlefield, for each isolation counter on it, exile up to one target nonland permanent an opponent controls until Quarantine Field leaves the battlefield.| +Retreat to Emeria|Battle for Zendikar|44|U|{3}{W}|Enchantment|||Landfall — Whenever a land enters the battlefield under your control, choose one —$• Put a 1/1 white Kor Ally creature token onto the battlefield.$• Creatures you control get +1/+1 until end of turn.| +Roil's Retribution|Battle for Zendikar|045|U|{3}{W}{W}|Instant|||Roil's Retribution deals 5 damage divided as you choose among any number of target attacking or blocking creatures.| +Serene Steward|Battle for Zendikar|046|U|{1}{W}|Creature - Human Cleric Ally|2|2|Whenever you gain life, you may pay {W}. If you do, put a +1/+1 counter on target creature.| +Shadow Glider|Battle for Zendikar|047|C|{2}{W}|Creature - Kor Soldier|2|2|Flying| +Sheer Drop|Battle for Zendikar|48|C|{2}{W}|Sorcery|||Destroy target tapped creature.$Awaken 3—{5}{W} (If you cast this spell for {5}{W}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Smite the Monstrous|Battle for Zendikar|049|C|{3}{W}|Instant|||Destroy target creature with power 4 or greater.| +Stasis Snare|Battle for Zendikar|50|U|{1}{W}{W}|Enchantment|||Flash$When Stasis Snare enters the battlefield, exile target creature an opponent controls until Stasis Snare leaves the battlefield. (That creature returns under its owner's control.)| +Stone Haven Medic|Battle for Zendikar|051|C|{1}{W}|Creature - Kor Cleric|1|3|{W}, {t}: You gain 1 life.| +Tandem Tactics|Battle for Zendikar|52|C|{1}{W}|Instant|||Up to two target creatures each get +1/+2 until end of turn. You gain 2 life.| +Unified Front|Battle for Zendikar|053|U|{3}{W}|Sorcery|||Converge — Put a 1/1 white Kor Ally creature token onto the battlefield for each color of mana spent to cast Unified Front.| +Adverse Conditions|Battle for Zendikar|54|U|{3}{U}|Instant|||Devoid (This card has no color.)$Tap up to two target creatures. Those creatures don't untap during their controller's next untap step. Put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."| +Anticipate|Battle for Zendikar|69|C|{1}{U}|Instant|||Look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.| +Benthic Infiltrator|Battle for Zendikar|55|C|{2}{U}|Creature - Eldrazi Drone|1|4|Devoid (This card has no color.)$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)$Benthic Infiltrator can't be blocked.| +Brilliant Spectrum|Battle for Zendikar|70|C|{3}{U}|Sorcery|||Converge — Draw X cards, where X is the number of colors of mana spent to cast Brilliant Spectrum. Then discard two cards.| +Cloud Manta|Battle for Zendikar|71|C|{3}{U}|Creature - Fish|3|2|Flying| +Clutch of Currents|Battle for Zendikar|72|C|{U}|Sorcery|||Return target creature to its owner's hand.$Awaken 3—{4}{U} (If you cast this spell for {4}{U}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Coastal Discovery|Battle for Zendikar|073|U|{3}{U}|Sorcery|||Draw two cards.$Awaken 4—{5}{U} (If you cast this spell for {5}{U}, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Coralhelm Guide|Battle for Zendikar|74|C|{1}{U}|Creature - Merfolk Scout Ally|2|1|{4}{U}: Target creature can't be blocked this turn.| +Cryptic Cruiser|Battle for Zendikar|56|U|{3}{U}|Creature - Eldrazi Processor|3|3|Devoid (This card has no color.)${2}{U}, Put a card an opponent owns from exile into that player's graveyard: Tap target creature.| +Dampening Pulse|Battle for Zendikar|75|U|{3}{U}|Enchantment|||Creatures your opponents control get -1/-0.| +Dispel|Battle for Zendikar|76|C|{U}|Instant|||Counter target instant spell.| +Drowner of Hope|Battle for Zendikar|057|R|{5}{U}|Creature - Eldrazi|5|5|Devoid (This card has no color.)$When Drowner of Hope enters the battlefield, put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."$Sacrifice an Eldrazi Scion: Tap Target creature.| +Eldrazi Skyspawner|Battle for Zendikar|58|C|{2}{U}|Creature - Eldrazi Drone|2|1|Devoid (This card has no color.)$Flying$When Eldrazi Skyspawner enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."| +Exert Influence|Battle for Zendikar|077|R|{4}{U}|Sorcery|||Converge — Gain control of target creature if its power is less than or equal to the number of colors of mana spent to cast Exert Influence.| +Guardian of Tazeem|Battle for Zendikar|078|R|{3}{U}{U}|Creature - Sphinx|4|5|Flying$Landfall — Whenever a land enters the battlefield under your control, tap target creature an opponent controls. If that land is an Island, that creature doesn't untap during its controller's next untap step. | +Halimar Tidecaller|Battle for Zendikar|79|U|{2}{U}|Creature - Human Wizard Ally|2|3|When Halimar Tidecaller enters the battlefield, you may return target card with awaken from your graveyard to your hand.$Land creatures you control have flying.| +Horribly Awry|Battle for Zendikar|059|U|{1}{U}|Instant|||Devoid (This card has no color.)$Counter target creature spell with converted mana cost 4 or less. If that spell is countered this way, exile it instead of putting it into its owner's graveyard.| +Incubator Drone|Battle for Zendikar|060|C|{3}{U}|Creature - Eldrazi Drone|2|3|Devoid (This card has no color.)$When Incubator Drone enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."| +Mist Intruder|Battle for Zendikar|061|C|{1}{U}|Creature - Eldrazi Drone|1|2|Devoid (This card has no color.)$Flying$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)| +Murk Strider|Battle for Zendikar|62|C|{3}{U}|Creature - Eldrazi Processor|3|2|When Murk Strider enters the battlefield, you may put a card an opponent owns from exile into that player's graveyard. If you do, return target creature to its owner's hand.| +Oracle of Dust|Battle for Zendikar|63|C|{4}{U}|Creature - Eldrazi Processor|3|5|Devoid (This card has no color.)${2}, Put a card an opponent owns from exile into that player's graveyard: Draw a card, then discard a card.| +Part the Waterveil|Battle for Zendikar|80|M|{4}{U}{U}|Sorcery|||Take an extra turn after this one. Exile Part the Waterveil.$Awaken 6—{6}{U}{U}{U} (If you cast this spell for {6}{U}{U}{U}, also put six +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Prism Array|Battle for Zendikar|081|R|{4}{U}|Enchantment|||Converge — Prism Array enters the battlfield with a crystal counter on it for each color of mana spent to cast it.$Remove a crystal counter from Prism Array: Tap target creature.${W}{U}{B}{R}{G}: Scry 3. | +Retreat to Coralhelm|Battle for Zendikar|082|U|{2}{U}|Enchantment|||Landfall — Whenever a land enters the battlefield under your control, choose one —$• You may tap or untap target creature.$• Scry 1.| +Roilmage's Trick|Battle for Zendikar|83|C|{3}{U}|Instant|||Converge — Creatures your opponents control get -X/-0 until end of turn, where X is the number of colors of mana spent to cast Roilmage's Trick.$Draw a card.| +Ruination Guide|Battle for Zendikar|64|U|{2}{U}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)$Other colorless creatures you control get +1/+0.| +Rush of Ice|Battle for Zendikar|84|C|{U}|Sorcery|||Tap target creature. It doesn't untap during its controller's next untap step.$Awaken 3—{4}{U} (If you cast this spell for {4}{U}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Salvage Drone|Battle for Zendikar|65|C|{U}|Creature - Eldrazi Drone|1|1|Devoid (This card has no color.)$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)$When Salvage Drone dies, you may draw a card. If you do, discard a card.| +Scatter to the Winds|Battle for Zendikar|85|R|{1}{U}{U}|Instant|||Counter target spell.$Awaken 3—{4}{U}{U} (If you cast this spell for {4}{U}{U}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Spell Shrivel|Battle for Zendikar|66|C|{2}{U}|Instant|||Devoid (This card has no color.)$Counter target spell unless its controller pays {4}. If that spell is countered this way, exile it instead of putting it into its owner's graveyard.| +Tide Drifter|Battle for Zendikar|67|U|{1}{U}|Creature - Eldrazi Drone|0|5|Devoid (This card has no color.)$Other colorless creatures you control get +0/+1.| +Tightening Coils|Battle for Zendikar|86|C|{1}{U}|Enchantment - Aura|||Enchant creature$Enchanted creature gets -6/-0 and loses flying.| +Ugin's Insight|Battle for Zendikar|087|R|{3}{U}{U}|Sorcery|||Scry X, where X is the highest converted mana cost among permanents you control, then draw three cards.| +Ulamog's Reclaimer|Battle for Zendikar|68|U|{4}{U}|Creature - Eldrazi Processor|2|5|Devoid (This card has no color.)$When Ulamog's Reclaimer enters the battlefield, you may put a card an opponent owns from exile into that player's graveyard. If you do, return target instant or sorcery card from your graveyard to your hand.| +Wave-Wing Elemental|Battle for Zendikar|088|C|{5}{U}|Creature - Elemental|3|4|Flying$Landfall — Whenver a land enters the battlefield under your control, Wave-Wing Elemental gets +2/+2 until end of turn.| +Windrider Patrol|Battle for Zendikar|089|U|{3}{U}{U}|Creature - Merfolk Wizard|4|3|Flying$Whenever Windrider Patrol deals combat damage to a player, scry 2.| +Altar's Reap|Battle for Zendikar|103|C|{1}{B}|Instant|||As an additional cost to cast Altar's Reap, sacrifice a creature.$Draw two cards.| +Bloodbond Vampire|Battle for Zendikar|104|U|{2}{B}{B}|Creature - Vampire Shaman Ally|3|3|Whenever you gain life, put a +1/+1 counter on Bloodbond Vampire.| +Bone Splinters|Battle for Zendikar|105|C|{B}|Sorcery|||As an additional cost to cast Bone Splinters, sacrifice a creature.$Destroy target creature.| +Carrier Thrall|Battle for Zendikar|106|U|{1}{B}|Creature - Vampire|2|1|When Carrier Thrall dies, put a 1/1 colorless Eldrazi Scion token onto the battlefield. It has "Sacrifice this creature. Add {1} to your mana pool."| +Complete Disregard|Battle for Zendikar|90|C|{2}{B}|Instant|||Devoid (This card has no color.)$Exile target creature with power 3 or less.| +Culling Drone|Battle for Zendikar|91|C|{1}{B}|Creature - Eldrazi Drone|2|2|Devoid (This card has no color.)$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)| +Defiant Bloodlord|Battle for Zendikar|107|R|{5}{B}{B}|Creature - Vampire|4|5|Flying$Whenever you gain life, target opponent loses that much life.| +Demon's Grasp|Battle for Zendikar|108|C|{4}{B}|Sorcery|||Target creature gets -5/-5 until end of turn.| +Dominator Drone|Battle for Zendikar|92|C|{2}{B}|Creature - Eldrazi Drone|3|2|Devoid (This creature has no color.)$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)$When Dominator Drone enters the battlefield, if you control another colorless creature, each opponent loses 2 life.| +Drana, Liberator of Malakir|Battle for Zendikar|109|M|{1}{B}{B}|Legendary Creature - Vampire Ally|2|3|Flying, first strike$Whenever Drana, Liberator of Malakir deals combat damage to a player, put a +1/+1 counter on each attacking creature you control.| +Dutiful Return|Battle for Zendikar|110|C|{3}{B}|Sorcery|||Return up to two target creature cards from your graveyard to your hand.| +Geyserfield Stalker|Battle for Zendikar|111|C|{4}{B}|Creature - Elemental|3|2|Menace$Landfall - Whenever a land enters the battlefield under your control, Geyserfield Stalker gets +2/+2 until end of turn.| +Grave Birthing|Battle for Zendikar|93|C|{2}{B}|Instant|||Devoid (This card has no color.)$Target opponent exiles a card from his or her graveyard. You put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."$Draw a card.| +Grip of Desolation|Battle for Zendikar|94|U|{4}{B}{B}|Intant|||Devoid (This card has no color.)$Exile target creature and target land.| +Guul Draz Overseer|Battle for Zendikar|112|R|{4}{B}{B}|Creature - Vampire|3|4|Flying$Landfall — Whenever a land enters the battlefield under your control, other creatures you control get +1/+0 until end of turn. If that land is a Swamp, those creatures get +2/+0 until end of turn instead.| +Hagra Sharpshooter|Battle for Zendikar|113|U|{2}{B}|Creature - Human Assassin Ally|2|2|{4}{B}: Target creature gets -1/-1 until end of turn.| +Kalastria Healer|Battle for Zendikar|114|C|{1}{B}|Creature - Vampire Cleric Ally|1|2|Rally - Whenever Kalastria Healer or another Ally enters the battlefield under your control, each opponent loses 1 life and you gain 1 life.| +Kalastria Nightwatch|Battle for Zendikar|115|C|{4}{B}|Creature - Vampire Warrior Ally|4|5|Whenever you gain life, Kalastria Nightwatch gains flying until end of turn.| +Malakir Familiar|Battle for Zendikar|116|U|{2}{B}|Creature - Bat|2|1|Flying, deahtouch$Whenever you gain life, Malakir Familiar gets +1/+1 until end of turn.| +Mind Raker|Battle for Zendikar|95|C|{3}{B}|Creature - Eldrazi Processor|3|3|Devoid (This card has no color.)$When Mind Raker enters the battlefield, you may put a card an opponent owns from exile into that player's graveyard. If you do, each opponent discards a card.| +Mire's Malice|Battle for Zendikar|117|C|{3}{B}|Sorcery|||Target opponent discards two cards.$Awaken 3 - {5}{B} (If you cast this spell for {5}{B}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Nirkana Assassin|Battle for Zendikar|118|C|{2}{B}|Creature - Vampire Assassin Ally|2|3|Whenever you gain life, Nirkana Assassin gains deathtouch until end of turn.| +Ob Nixilis Reignited|Battle for Zendikar|119|M|{3}{B}{B}|Planeswalker - Nixilis|5|+1: You draw a card and you lose 1 life.$-3: Destroy target creature.$-8: Target opponent gets an emblem with "Whenever a player draws a card, you lose 2 life."| +Painful Truths|Battle for Zendikar|120|R|{2}{B}|Sorcery|||Converge — You draw X cards and you lose X life, where X is the number of colors of mana spent to cast Painful Truths.| +Retreat to Hagra|Battle for Zendikar|121|U|{2}{B}|Enchantment|||Landfall — Whenever a land enters the battlefield under your control, choose one —$• Target creature gets +1/+0 and gains deathtouch until end of turn.$• Each opponent loses 1 life and you gain 1 life.| +Rising Miasma|Battle for Zendikar|122|U|{3}{B}|Sorcery|||All creatures get -2/-2 until end of turn. $Awaken 3 - {5}{B}{B} (If you cast this spell for {5}{B}{B}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Ruinous Path|Battle for Zendikar|123|R|{1}{B}{B}|Sorcery|||Destroy target creature or planeswalker.$Awaken 4—{5}{B}{B} (If you cast this spell for {5}{B}{B}, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Silent Skimmer|Battle for Zendikar|96|C|{3}{B}|Creature - Eldrazi Drone|0|4|Devoid (This card has no color.)$Flying$Whenever Silent Skimmer attacks, defending player loses 2 life.| +Skitterskin|Battle for Zendikar|97|U|{3}{B}|Creature - Eldrazi Drone|4|3|Devoid (This card has no color.)$Skitterskin can't block.${1}{B}: Regenerate Skitterskin. Activate this ability only if you control another colorless creature.| +Sludge Crawler|Battle for Zendikar|98|C|{B}|Creature - Eldrazi Drone|1|1|Devoid (This card has no color.)$Ingest (Whenever this creature deals combat damage to a player, exile the top card of his or her library)${2}: Sludge Crawler gets +1/+1 until end of turn.| +Smothering Abomination|Battle for Zendikar|99|R|{2}{B}{B}|Creature - Eldrazi|4|3|Devoid (This card has no color.)$Flying$At the beginning of your upkeep, sacrifice a creature.$Whenever you sacrifice a creature, draw a card.| +Swarm Surge|Battle for Zendikar|100|C|{2}{B}|Sorcery|||Devoid (This card has no color.)$Creatures you control get +2/+0 until end of turn. Colorless creatures you control also gain first strike until end of turn.| +Transgress the Mind|Battle for Zendikar|101|U|{1}{B}|Sorcery|||Devoid (This card has no color.)$Target player reveals his or her hand. You choose a card with converted mana cost 3 or greater and exile that card.| +Vampiric Rites|Battle for Zendikar|124|U|{B}|Enchantment|||{1}{B}, Sacrifice a creature: You gain 1 life and draw a card.| +Voracious Null|Battle for Zendikar|125|C|{2}{B}|Creature - Zombie|2|2|{1}{B}, Sacrifice another creature: Put two +1/+1 counters on Voracious Null. Activate this ability only any time you could cast a sorcery.| +Wasteland Strangler|Battle for Zendikar|102|R|{2}{B}|Creature - Eldrazi Processor|3|2|Devoid (This card has no color.)$When Wasteland Strangler enters the battlefield, you may put a card an opponent owns from exile into that player's graveyard. If you do, target creature gets -3/-3 until end of turn.| +Zulaport Cutthroat|Battle for Zendikar|126|U|{1}{B}|Creature - Human Rogue Ally|1|1|Whenever Zulaport Cutthroat or another creature you control dies, each opponent loses 1 life and you gain 1 life.| +Akoum Firebird|Battle for Zendikar|138|M|{2}{R}{R}|Creature - Phoenix|3|3|Flying, haste$Akoum Firebird attacks each turn if able.$Landfall — Whenever a land enters the battlefield under your control, you may pay {4}{R}{R}. If you do, return Akoum Firebird from your graveyard to the battlefield.| +Akoum Hellkite|Battle for Zendikar|139|R|{4}{R}{R}|Creature - Dragon|4|4|Flying$Landfall — Whenever a land enters the battlefield under your control, Akoum Hellkite deals 1 damage to target creature or player. If that land was a Mountain, Akoum Hellkite deals 2 damage to that creature or player instead.| +Akoum Stonewaker|Battle for Zendikar|140|U|{1}{R}|Creature - Human Shaman|2|1|Landfall — Whenever a land enters the battlefield under your control, you may pay {2}{R}. If you do, put a 3/1 red Elemental creature token with trample and haste onto the battlefield. Exile that token at the beginning of the next end step.| +Barrage Tyrant|Battle for Zendikar|127|R|{4}{R}|Creature - Eldrazi|5|3|Devoid (This card has no color.)${2}{R}, Sacrifice another colorless creature: Barrage Tyrant deals damage equal to the sacrificed creature's power to target creature or player.| +Belligerent Whiptail|Battle for Zendikar|141|C|{3}{R}|Creature - Wurm|4|2|Landfall — Whenever a land enters the battlefield under your control, Belligerent Whiptail gains first strike until end of turn.| +Boiling Earth|Battle for Zendikar|142|C|{1}{R}|Sorcery|||Boiling Earth deals 1 damage to each creature your opponents control.$Awaken 4—{6}{R} (If you cast this spell for 5U, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Chasm Guide|Battle for Zendikar|143|U|{3}{R}|Creature - Goblin Scout Ally|3|2|Rally — Whenever Chasm Guide or another Ally enters the battlefield under your control, creatures you control gain haste until end of turn.| +Crumble to Dust|Battle for Zendikar|128|U|{3}{R}|Sorcery|||Devoid (This card has no color.)$Exile target nonbasic land. Search it's controller's graveyard, hand and library for any number of cards with the same name as that land and exile them. Then that player shuffles his or her library.| +Dragonmaster Outcast|Battle for Zendikar|144|M|{R}|Creature - Human Shaman|1|1|At the beginning of your upkeep, if you control six or more lands, put a 5/5 red Dragon creature token with flying onto the battlefield.| +Firemantle Mage|Battle for Zendikar|145|U|{2}{R}|Creature - Human Shaman Ally|2|2|Rally — Whenver Firemantle Mage or another Ally enters the battlefield under your control, creatures you control gain menace until end of turn.| +Goblin War Paint|Battle for Zendikar|146|C|{1}{R}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +2/+2 and has haste.| +Kozilek's Sentinel|Battle for Zendikar|129|C|{1}{R}|Creature - Eldrazi Drone|1|4|Devoid (This card has no color.)$Whenever you cast a colorless spell, Kozilek's Sentinel gets +1/+0 until end of turn.| +Lavastep Raider|Battle for Zendikar|147|C|{R}|Creature - Goblin Warrior|1|1|{2}{R}: Lavastep Raider gets +2/+0 until end of turn.| +Makindi Sliderunner|Battle for Zendikar|148|C|{1}{R}|Creature - Beast|2|1|Trample$Landfall — Whenever a land enters the battlefield under your control, Makindi Sliderunner gets +1/+1 until end of turn.| +Molten Nursery|Battle for Zendikar|130|U|{2}{R}|Enchantment|||Devoid (This card has no color.)$Whenever you cast a colorless spell, Molten Nursery deals 1 damage to target creature or player.| +Nettle Drone|Battle for Zendikar|131|C|{2}{R}|Creature - Eldrazi Drone|3|1|Devoid (This card has no color.)${t}: Nettle Drone deals 1 damage to each opponent.$Whenever you cast a colorless spell, untap Nettle Drone.| +Ondu Champion|Battle for Zendikar|149|C|{2}{R}{R}|Creature - Minotaur Warrior Ally|4|3|Rally — Whenever Ondu Champion or another Ally enters the battlefield under your control, creatures you control gain trample until end of turn.| +Outnumber|Battle for Zendikar|150|C|{R}|Instant|||Outnumber deals damage to target creature equal to the number of creatures you control.| +Processor Assault|Battle for Zendikar|132|U|{1}{R}|Sorcery|||Devoid (This card has no color.)$As an additional cost to cast Processor Assault, put a card an opponent owns from exile into its owner's graveyard.$Processor Assault deals 5 damage to target creature.| +Radiant Flames|Battle for Zendikar|151|R|{2}{R}|Sorcery|||Converge — Radiant Flames deals X damage to each creature, where X is the number of colors of mana spent to cast Radiant Flames.| +Reckless Cohort|Battle for Zendikar|152|C|{1}{R}|Creature - Human Warrior Ally|2|2|Reckless Cohort attacks each combat if able unless you control another Ally.| +Retreat to Valakut|Battle for Zendikar|153|U|{2}{R}|Enchantment|||Landfall — Whenever a land enters the battlefield under your control, choose one —$• Target creature gets +2/+0 until end of turn.$• Target creature can't block this turn.| +Rolling Thunder|Battle for Zendikar|154|U|{X}{R}{R}|Sorcery|||Rolling Thunder deals X damage divided as you choose among any number of target creatures and/or players.| +Serpentine Spike|Battle for Zendikar|133|R|{5}{R}{R}|Sorcery|||Devoid (This card has no color.)$Serpentine Spike deals 2 damage to target creature, 3 damage to another target creature, and 4 damage to a third target creature. If a creature dealt damage this way would die this turn, exile it instead.| +Shatterskull Recruit|Battle for Zendikar|155|C|{3}{R}{R}|Creature - Giant Warrior Ally|4|4|Menace| +Stonefury|Battle for Zendikar|156|C|{3}{R}{R}|Instant|||Stonefury deals damage to target creature equal to the number of lands you control.| +Sure Strike|Battle for Zendikar|157|C|{1}{R}|Instant|||Target creature gets +3/+0 and gains first strike until end of turn.| +Touch of the Void|Battle for Zendikar|134|C|{2}{R}|Sorcery|||Devoid (This card has no color.)$Touch of the Void deals 3 damage to target creature or player. If a creature dealt damage this way would die this turn, exile it instead.| +Tunneling Geopede|Battle for Zendikar|158|U|{2}{R}|Creature - Insect|3|2|Landfall - Whenever a land enters the battlefield under your control, Tunneling Geopede deals 1 damage to each opponent.| +Turn Against|Battle for Zendikar|135|U|{4}{R}|Instant|||Devoid (This card has no color.)$Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.| +Valakut Invoker|Battle for Zendikar|159|C|{2}{R}|Creature - Human Shaman|2|3|{8}: Valakut Invoker deals 3 damage to target creature or player.| +Valakut Predator|Battle for Zendikar|160|C|{2}{R}|Creature - Elemental|2|2|Landfall - Whenever a land enters the battlefield under your control, Valakut Predator gets +2/+2 until end of turn.| +Vestige of Emrakul|Battle for Zendikar|136|C|{3}{R}|Creature - Eldrazi Drone|3|4|Devoid (This card has no color.)$Trample| +Vile Aggregate|Battle for Zendikar|137|U|{2}{R}|Creature - Eldrazi Drone|0|5|Devoid (This card has no color.)$Vile Aggregate's power is equal to the number of colorless creatures you control.$Trample$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)| +Volcanic Upheaval|Battle for Zendikar|161|C|{3}{R}|Instant|||Destroy target land.| +Zada, Hedron Grinder|Battle for Zendikar|162|R|{3}{R}|Legendary Creature - Goblin Ally|3|3|Whenever you cast an instant or sorcery spell that targets only Zada, Hedron Grinder, copy that spell for each other creature you control that the spell could target. Each copy targets a different one of those creatures.| +Beastcaller Savant|Battle for Zendikar|170|R|{1}{G}|Creature - Elf Shaman Ally|1|1|Haste${T}: Add one mana of any color to your mana pool. Spend this mana only to cast a creature spell.| +Blisterpod|Battle for Zendikar|163|C|{G}|Creature - Eldrazi Drone|1|1|Devoid (This card has no color.)$When Blisterpod dies, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."| +Brood Monitor|Battle for Zendikar|164|U|{4}{G}{G}|Creature - Eldrazi Drone|3|3|Devoid (This card has no color.)$When Brood Monitor enters the battlefield, put three 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."| +Broodhunter Wurm|Battle for Zendikar|171|C|{3}{G}|Creature - Wurm|4|3|| +Call the Scions|Battle for Zendikar|165|C|{2}{G}|Sorcery|||Devoid (This card has no color.)$Put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: add {1} to your mana pool."| +Earthen Arms|Battle for Zendikar|172|C|{1}{G}|Sorcery|||Put two +1/+1 counters on target permanent.$Awaken 4 - {6}{G} (If you cast this spell for {6}{G}, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Eyeless Watcher|Battle for Zendikar|166|C|{3}{G}|Creature - Eldrazi Drone|1|1|Devoid (This card has no color.)$When Eyeless Watcher enters the battlefield, put two 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."| +From Beyond|Battle for Zendikar|167|R|{3}{G}|Enchantment|||Devoid (This card has no color.)$At the beginning of your upkeep, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."${1}{G}, Sacrifice From Beyond: Search your library for an Eldrazi card, reveal it, put it into your hand, then shuffle your library.| +Giant Mantis|Battle for Zendikar|173|C|{3}{G}|Creature - Insect|2|4|Reach (This creature can block creatures with flying.)| +Greenwarden of Murasa|Battle for Zendikar|174|M|{4}{G}{G}|Creature - Elemental|5|4|When Greenwarden of Murasa enters the battlefield, you may return target card from your graveyard to your hand.$When Greenwarden of Murasa dies, you may exile it. If you do, you may return target card from your graveyard to your hand.| +Infuse with the Elements|Battle for Zendikar|175|U|{3}{G}|Instant|||Converge - Put X +1/+1 counters on target creature, where X is the number of colors of mana spent to cast Infuse with the Elements. That creature gains trample until end of turn.| +Jaddi Offshoot|Battle for Zendikar|176|U|{G}|Creature - Plant|0|3|Defender$Landfall - Whenever a land enters the battlefield under your control, you gain 1 life.| +Lifespring Druid|Battle for Zendikar|177|C|{2}{G}|Creature - Elf Druid|2|1|{T}: Add one mana of any color to your mana pool.| +Murasa Ranger|Battle for Zendikar|178|U|{3}{G}|Creature - Human Warrior|3|3|Landfall - Whenever a land enters the battlefield under your control, you may pay {3}{G}. IF you do, put two +1/+1 counters on Murasa Ranger.| +Natural Connection|Battle for Zendikar|179|C|{2}{G}|Instant|||Search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library.| +Nissa's Renewal|Battle for Zendikar|180|R|{5}{G}|Sorcery|||Search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library. You gain 7 life.| +Oran-Rief Hydra|Battle for Zendikar|181|R|{4}{G}{G}|Creature - Hydra|5|5|Trample$Landfall — Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra. If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead.| +Oran-Rief Invoker|Battle for Zendikar|182|C|{1}{G}|Creature - Human Shaman|2|2|{8}: Oran-Rief Invoker gets +5/+5 and gains trample until end of turn.| +Plated Crusher|Battle for Zendikar|183|U|{4}{G}{G}{G}|Creature - Beast|7|6|Trample, hexproof| +Plummet|Battle for Zendikar|184|C|{1}{G}|Instant|||Destroy target creature with flying.| +Reclaiming Vines|Battle for Zendikar|185|C|{2}{G}{G}|Sorcery|||Destroy target artifact, enchantment, or land.| +Retreat to Kazandu|Battle for Zendikar|186|U|{2}{G}|Enchantment|||Landfall — Whenever a land enters the battlefield under your control, choose one —$• Put a +1/+1 counter on target creature.$• You gain 2 life.| +Rot Shambler|Battle for Zendikar|187|U|{1}{G}|Creature - Fungus|1|1|Whenever another creature you control dies, put a +1/+1 counter on Rot Shambler.| +Scythe Leopard|Battle for Zendikar|188|U|{G}|Creature - Cat|1|1|Landfall — Whenever a land enters the battlefield under your control, Scythe Leopard gets +1/+1 until end of turn.| +Seek the Wilds|Battle for Zendikar|189|C|{1}{G}|Sorcery|||Look at the top four cards of your library. You may reveal a creature or land card from among them and put it into your hand. Put the rest on the bottom of your library in any order.| +Snapping Gnarlid|Battle for Zendikar|190|C|{1}{G}|Creature - Beast|2|2|Landfall — Whenever a land enters the battlefield under your control, Snapping Gnarlid gets +1/+1 until end of turn.| +Swell of Growth|Battle for Zendikar|191|C|{1}{G}|Instant|||Target creature gets +2/+2 until end of turn. You may put a land card from your hand onto the battlefield.| +Sylvan Scrying|Battle for Zendikar|192|U|{1}{G}|Sorcery|||Search your library for a land card, reveal it, and put it into your hand. Then shuffle your library.| +Tajuru Beastmaster|Battle for Zendikar|193|C|{5}{G}|Creature - Elf Warrior Ally|5|5|Rally - Whenever Tajuru Beastmaster or another Ally creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.| +Tajuru Stalwart|Battle for Zendikar|194|C|{2}{G}|Creature - Elf Scout Ally|0|1|Converge - Tajuru Stalwart enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.| +Tajuru Warcaller|Battle for Zendikar|195|U|{3}{G}{G}|Creature - Elf Warrior Ally|2|1|Rally — Whenever Tajuru Warcaller or another Ally enters the battlefield under your control, creatures you control get +2/+2 until end of turn.| +Territorial Baloth|Battle for Zendikar|196|C|{4}{G}|Creature - Beast|4|4|Landfall - Whenever a land enters the battlefield under your control, Territorial Baloth gets +2/+2 until end of turn.| +Undergrowth Champion|Battle for Zendikar|197|M|{1}{G}{G}|Creature - Elemental|2|2|If damage would be dealt to Undergrowth Champion while it has a +1/+1 counter on it, prevent that damage and remove a +1/+1 counter from Undergrowth Champion.$Landfall — Whenever a land enters the battlefield under your control, put a +1/+1 counter on Undergrowth Champion.| +Unnatural Aggression|Battle for Zendikar|168|C|{2}{G}|Instant|||Devoid (This card has no color.)$Target creature you control fights target creature an opponent controls. If the creature an opponent controls would die this turn, exile it instead.| +Void Attendant|Battle for Zendikar|169|U|{2}{G}|Creature - Eldrazi Processor|2|3|Devoid (This card has no color.)${1}{G}, Put a card an opponent owns from exile into that player's graveyard: Put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."| +Woodland Wanderer|Battle for Zendikar|198|R|{3}{G}|Creature - Elemental|2|2|Vigilance, trample$Converge — Woodland Wanderer enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.| +Angelic Captain|Battle for Zendikar|208|R|{3}{R}{W}|Creature - Angel Ally|4|3|Flying$Whenever Angelic Captain attacks, it gets +1/+1 until end of turn for each other attacking Ally.| +Bring to Light|Battle for Zendikar|209|R|{3}{G}{U}|Sorcery|||Converge — Search your library for a creature, instant, or sorcery card with converted mana cost less than or equal to the number of colors of mana spent to cast Bring to Light, exile that card, then shuffle your library. You may cast that card without paying its mana cost.| +Brood Butcher|Battle for Zendikar|199|R|{3}{B}{G}|Creature - Eldrazi Drone|3|3|Devoid (This card has no color.)$When Brood Butcher enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."${B}{G}, Sacrifice a creature: Target creature gets -2/-2 until end of turn.| +Brutal Expulsion|Battle for Zendikar|200|R|{2}{U}{R}|Instant|||Devoid (This card has no color.)$Choose one or both —$• Return target spell or creature to its owner's hand.$• Brutal Expulsion deals 2 damage to target creature or planeswalker. If that permanent would be put into a graveyard this turn, exile it instead.| +Catacomb Sifter|Battle for Zendikar|201|U|{1}{B}{G}|Creature - Eldrazi Drone|2|3|Devoid (This card has no color.)$When Catacomb Sifter enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: add {1} to your mana pool."$Whenever another creature you control dies, scry 1. (Look at the top card of your library. You may put that card on the bottom of your library.)| +Drana's Emissary|Battle for Zendikar|210|U|{1}{W}{B}|Creature - Vampire Cleric Ally|2|2|Flying$At the beginning of your upkeep, each opponent loses 1 life and you gain 1 life.| +Dust Stalker|Battle for Zendikar|202|R|{2}{B}{R}|Creature - Eldrazi|5|3|Devoid (This card has no color.)$Haste$At the beginning of each end step, if you control no other colorless creatures, return Dust Stalker to its owner's hand.| +Fathom Feeder|Battle for Zendikar|203|R|{U}{B}|Creature - Eldrazi Drone|1|1|Devoid (This creature has no color.)$Deathtouch$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)${3}{U}{B}: Draw a card. Each opponent exiles the top card of his or her library.| +Forerunner of Slaughter|Battle for Zendikar|204|U|{B}{R}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)${1}: Target colorless creature gains haste until end of turn.| +Grove Rumbler|Battle for Zendikar|211|U|{2}{R}{G}|Creature - Elemental|3|3|Trample$Landfall — Whenever a land enters the battlefield under your control, Grove Rumbler gets +2/+2 until end of turn.| +Grovetender Druids|Battle for Zendikar|212|U|{2}{G}{W}|Creature - Elf Druid Ally|3|3|Rally — Whenever Grovetender Druids or another Ally enters the battlefield under your control, you may pay {1}. If you do, put a 1/1 green Plant creature token onto the battlefield.| +Herald of Kozilek|Battle for Zendikar|205|U|{1}{U}{R}|Creature - Eldrazi Drone|2|4|Devoid (This card has no color.)$Colorless spells you cast cost {1} less.| +Kiora, Master of the Depths|Battle for Zendikar|213|M|{2}{G}{U}|Planeswalker - Kiora|4|+1: Untap up to one target creature and up to one target land.$-2: Reveal the top four cards of your library. You may put a creature card and/or a land card from among them into your hand. Put the rest into your graveyard.$-8: You get an emblem with "Whenever a creature enters the battlefield under your control, you may have it fight target creature." Then put three 8/8 blue Octopus creature tokens onto the battlefield under your control.| +March from the Tomb|Battle for Zendikar|214|R|{3}{W}{B}|Sorcery|||Return any number of target Ally creature cards with total converted mana cost 8 or less from your graveyard to the battlefield.| +Munda, Ambush Leader|Battle for Zendikar|215|R|{2}{R}{W}|Legendary Creature - Kor Ally|3|4|Haste$Rally — Whenever Munda, Ambush Leader or another Ally enters the battlefield under you control, you may look at the top four cards of your library. If you do, reveal any number of Ally cards from among them, then put those cards on top of your library in any order and the rest on the bottom in any order.| +Noyan Dar, Roil Shaper|Battle for Zendikar|216|R|{3}{W}{U}|Legendary Creature - Merfolk Ally|4|4|Whenever you cast an instant or sorcery spell, you may put three +1/+1 counters on target land you control. If you do, that land becomes a 0/0 Elemental creature with haste that's still a land.| +Omnath, Locus of Rage|Battle for Zendikar|217|M|{3}{R}{R}{G}{G}|Legendary Creature - Elemental|5|5|Landfall — Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield.$Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player.| +Resolute Blademaster|Battle for Zendikar|218|U|{3}{R}{W}|Creature - Human Soldier Ally|2|2|Rally — Whenever Resolute Blademaster or another Ally enters the battlefield under your control, creatures you control gain double strike until end of turn.| +Roil Spout|Battle for Zendikar|219|U|{1}{W}{U}|Sorcery|||Put target creature on top of its owner's library.$Awaken 4—{4}{W}{U} (If you cast this spell for {4}{W}{U}, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Sire of Stagnation|Battle for Zendikar|206|M|{4}{U}{B}|Creature - Eldrazi|5|7|Devoid (This card has no color.)$Whenever a land enters the battlefield under an opponent's control, that player exiles the top two cards of his or her library and you draw two cards.| +Skyrider Elf|Battle for Zendikar|220|U|{X}{G}{U}|Creature - Elf Warrior Ally|0|0|Flying$Converge — Skyrider Elf enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.| +Ulamog's Nullifier|Battle for Zendikar|207|U|{2}{U}{B}|Creature - Eldrazi Processor|2|3|Devoid (This card has no color.)$Flash$Flying$When Ulamog's Nullifier enters the battlefield, you may put two cards your opponents own from exile into their owners' graveyards. If you do, counter target spell.| +Veteran Warleader|Battle for Zendikar|221|R|{1}{G}{W}|Creature - Human Soldier Ally|0|0|Veteran Warleader's power and toughness are each equal to the number of creatures you control.$Tap another untapped Ally you control: Veteran Warleader gains your choice of first strike, vigilance, or trample until end of turn.| +Aligned Hedron Network|Battle for Zendikar|222|R|{4}|Artifact|||When Aligned Hedron Network enters the battlefield, exile all creatures with power 5 or greater until Aligned Hedron Network leaves the battlefield. (Those creatures return under their owners' control.)| +Hedron Archive|Battle for Zendikar|223|U|{4}|Artifact|||{t}: Add {2} to your mana pool.${2}, {t}, Sacrifice Hedron Archive: Draw two cards.| +Hedron Blade|Battle for Zendikar|224|C|{1}|Artifact - Equipment|||Equipped creature gets +1/+1.$Whenever equipped creature becomes blocked by one or more colorless creatures, it gains deathtouch until end of turn. (Any amount of damage it deals to a creature is enough to destroy it.)$Equip {2} ({2}: Attach to target creature you control. Equip only as a sorcery.)| +Pathway Arrows|Battle for Zendikar|225|U|{1}|Artifact - Equipment|||Equipped creature has "{2}, {T}: This creature deals 1 damage to target creature. If a colorless creature is dealt damage this way, tap it."$Equip {2}| +Pilgrim's Eye|Battle for Zendikar|226|U|{3}|Artifact Creature - Thopter|1|1|Flying$When Pilgrim's Eye enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.| +Slab Hammer|Battle for Zendikar|227|U|{2}|Artifact - Equipment|||Whenever equipped creature attacks, you may return a land you control to its owner's hand. If you do, the creature gets +2/+2 until end of turn.$Equip {2}| +Ally Encampment|Battle for Zendikar|228|R||Land|||{t}: Add {1} to your mana pool.${t}: Add one mana of any color to your mana pool. Spend this mana only to cast an Ally spell.${1}, {t}, Sacrifice Ally Encampment: Return an Ally you control to its owner's hand.| +Blighted Cataract|Battle for Zendikar|229|U||Land|||{T}: Add {1} to your mana pool.${5}{U}, {T}, Sacrifice Blighted Cataract: Draw 2 cards.| +Blighted Fen|Battle for Zendikar|230|U||Land|||{T}: Add {1} to your mana pool.${4}{B}, {T}, Sacrifice Blighted Fen: Target opponent sacrifices a creature.| +Blighted Gorge|Battle for Zendikar|231|U||Land|||{T}: Add {1} to your mana pool.${4}{R}, {T}, Sacrifice Blighted Gorge: Blighted Gorge deals 2 damage to target creature or player.| +Blighted Steppe|Battle for Zendikar|232|U||Land|||{T}: Add {1} to your mana pool.${3}{W}, {T}, Sacrifice Blighted Steppe: You gain 2 life for each creature you control.| +Blighted Woodland|Battle for Zendikar|233|U||Land|||{T}: Add {1} to your mana pool.${3}{G}, {T}, Sacrifice Blighted Woodland: Search your library for up to two basic land cards and put them onto the battlefield tapped. Then shuffle your library.| +Canopy Vista|Battle for Zendikar|234|R||Land - Forest Plains|||({T}: Add {G} or {W} to your mana pool.)$Canopy Vista enters the battlefield tapped unless you control two or more basic lands.| +Cinder Glade|Battle for Zendikar|235|R||Land - Mountain Forest|||({T}: Add {R} or {G} to your mana pool.)$Cinder Glade enters the battlefield tapped unless you control two or more basic lands.| +Evolving Wilds|Battle for Zendikar|236|C||Land|||{T}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| +Fertile Thicket|Battle for Zendikar|237|C||Land|||Fertile Thicket enters the battlefield tapped.$When Fertile Thicket enters the battlefield, you may look at the top five cards of your library. If you do, reveal up to one basic land card from among them, then put that card on top of your library and the rest on the bottom in any order.${T}: Add {G} to your mana pool.| +Forest|Battle for Zendikar|273|L||Basic Land - Forest|||| +Forest|Battle for Zendikar|274|L||Basic Land - Forest|||| +Forest|Battle for Zendikar|272|L||Basic Land - Forest|||| +Forest|Battle for Zendikar|271|L||Basic Land - Forest|||| +Forest|Battle for Zendikar|270|L||Basic Land - Forest|||| +Island|Battle for Zendikar|258|L||Basic Land - Island|||({t}: Add {U} to yoru mana pool.)| +Island|Battle for Zendikar|259|L||Basic Land - Island|||({t}: Add {U} to your mana pool.)| +Island|Battle for Zendikar|256|L||Basic Land - Island|||({t}: Add {U} to your mana pool.)| +Island|Battle for Zendikar|257|L||Basic Land - Island|||({t}: Add {U} to your mana pool.)| +Island|Battle for Zendikar|255|L||Basic Land - Island|||({t}: Add {U} to your mana pool.)| +Looming Spires|Battle for Zendikar|238|C||Land|||Looming Spires enters the battlefield tapped.$When Looming Spires enters the battlefield, target creature gets +1/+1 and gains first strike until end of turn.${T}: Add {R} to your mana pool.| +Lumbering Falls|Battle for Zendikar|239|R||Land|||Lumbering falls enters the battlefield tapped.${t}: Add {G} or {U} to your mana pool.${2}{G}{U}: Lumbering Falls becomes a 3/3 green and blue Elemental creature with hexproof until end of turn. It's still a land.| +Mortuary Mire|Battle for Zendikar|240|C||Land|||Mortuary Mire enters the battlefield tapped.$When Mortuary Mire enters the battlefield, you may put target creature card from your graveyard on top of your library.${T}: Add {B} to your mana pool.| +Mountain|Battle for Zendikar|265|L||Basic Land - Mountain|||| +Mountain|Battle for Zendikar|266|L||Basic Land - Mountain|||| +Mountain|Battle for Zendikar|267|L||Basic Land - Mountain|||| +Mountain|Battle for Zendikar|269|L||Basic Land - Mountain|||| +Mountain|Battle for Zendikar|268|L||Basic Land - Mountain|||| +Plains|Battle for Zendikar|250|L||Basic Land - Plains|||({T}: Add {W} to your mana pool.)| +Plains|Battle for Zendikar|252|L||Basic Land - Plains|||({T}: Add {W} to your mana pool.)| +Plains|Battle for Zendikar|253|L||Basic Land - Plains|||({T}: Add {W} to your mana pool.)| +Plains|Battle for Zendikar|254|L||Basic Land - Plains|||({T}: Add {W} to your mana pool.)| +Plains|Battle for Zendikar|251|L||Basic Land - Plains|||({T}: Add {W} to your mana pool.)| +Prairie Stream|Battle for Zendikar|241|R||Land - Plains Island|||({T}: Add {W} or {U} to your mana pool.)$Prairie Stream enters the battlefield tapped unless you control two or more basic lands.| +Sanctum of Ugin|Battle for Zendikar|242|R||Land|||{T}: Add {1} to your mana pool.$Whenever you cast a colorless spell with converted mana cost 7 or greater, you may sacrifice Sanctum of Ugin. If you do, search your library for a colorless creature card, reveal it, put it into your hand, then shuffle your library.| +Sandstone Bridge|Battle for Zendikar|243|C||Land|||Sandstone Bridge enters the battlefield tapped.$When Sandstone Bridge enters the battlefield, target creature gets +1/+1 and gains vigilance until end of turn.${T}: Add {W} to your mana pool.| +Shambling Vent|Battle for Zendikar|244|R||Land|||Shambling Vent enters the battlefield tapped.${T}: Add {W} or {B} to your mana pool.${1}{W}{B}: Shambling Vent becomes a 2/3 white and black elemental creature with lifelink until end of turn. It's still a land.| +Shrine of the Forsaken Gods|Battle for Zendikar|245|R||Land|||{t}: Add {1} to your mana pool.${t}: Add {2} to your mana pool. Spend this mana only to cast colorless spells. Activate this ability only if you control seven or more lands.| +Skyline Cascade|Battle for Zendikar|246|C||Land|||Skyline Cascade enters the battlefield tapped.$When Skyline Cascade enters the battlefield, target creature an opponent controls doesn't untap during its controller's next untap step.${T}: Add {U} to your mana pool.| +Smoldering Marsh|Battle for Zendikar|247|R||Land - Swamp Mountain|||({T}: Add {B} or {R} to your mana pool.)$Smoldering Marsh enters the battlefield tapped unless you control two or more basic lands.| +Spawning Bed|Battle for Zendikar|248|U||Land|||{T}: Add {1} to your mana pool.${6}, {T}, Sacrifice Spawning Bed: Put three 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."| +Sunken Hollow|Battle for Zendikar|249|R||Land - Island Swamp|||({T}: Add {U} or {B} to your mana pool.)$Sunken Hollow enters the battlefield tapped unless you control two or more basic lands.| +Swamp|Battle for Zendikar|263|L||Basic Land - Swamp|||({t}: Add {B} to your mana pool.)| +Swamp|Battle for Zendikar|262|L||Basic Land - Swamp|||({t}: Add {B} to your mana pool.)| +Swamp|Battle for Zendikar|264|L||Basic Land - Swamp|||({t}: Add {B} to your mana pool.)| +Swamp|Battle for Zendikar|260|L||Basic Land - Swamp|||({t}: Add {B} to your mana pool.)| +Swamp|Battle for Zendikar|261|L||Basic Land - Swamp|||({t}: Add {B} to your mana pool.)| +Bastion Protector|Commander 2015|1|R|{2}{W}|Creature - Human Soldier|3|3|Commander creatures you control get +2/+2 and have indestructible.| +Broodbirth Viper|Commander 2015|10|U|{4}{U}|Creature - Snake|3|3|Myriad (Whenever this creature attacks, for each opponent other than defending player, you may put a token that's a copy of this creature onto the battlefield tapped and attacking that player or a planeswalker he or she controls. Exile the tokens at end of combat.)$Whenever Broodbirth Viper deals combat damage to a player, you may draw a card.| +Plaxmanta|Commander 2015|100|U|{1}{U}|Creature - Beast|2|2|Flash$When Plaxmanta enters the battlefield, creatures you control gain shroud until end of turn. (They can't be the targets of spells or abilities.)$When Plaxmanta enters the battlefield, sacrifice it unless {G} was spent to cast it.| +Preordain|Commander 2015|101|C|{U}|Sorcery|||Scry 2, then draw a card. (To scry 2, look at the top two cards of your library, then put any number of them on the bottom of your library and the rest on top in any order.)| +Rapid Hybridization|Commander 2015|102|U|{U}|Instant|||Destroy target creature. It can't be regenerated. That creature's controller puts a 3/3 green Frog Lizard creature token onto the battlefield.| +Reins of Power|Commander 2015|103|R|{2}{U}{U}|Instant|||Untap all creatures you control and all creatures target opponent controls. You and that opponent each gain control of all creatures the other controls until end of turn. Those creatures gain haste until end of turn.| +Repeal|Commander 2015|104|C|{X}{U}|Instant|||Return target nonland permanent with converted mana cost X to its owner's hand.$Draw a card.| +Rite of Replication|Commander 2015|105|R|{2}{U}{U}|Sorcery|||Kicker {5} (You may pay an additional {5} as you cast this spell.)$Put a token onto the battlefield that's a copy of target creature. If Rite of Replication was kicked, put five of those tokens onto the battlefield instead.| +Sleep|Commander 2015|106|U|{2}{U}{U}|Sorcery|||Tap all creatures target player controls. Those creatures don't untap during that player's next untap step.| +Stolen Goods|Commander 2015|107|R|{3}{U}|Sorcery|||Target opponent exiles cards from the top of his or her library until he or she exiles a nonland card. Until end of turn, you may cast that card without paying its mana cost.| +Stroke of Genius|Commander 2015|108|R|{X}{2}{U}|Instant|||Target player draws X cards.| +Talrand, Sky Summoner|Commander 2015|109|R|{2}{U}{U}|Legendary Creature - Merfolk Wizard|2|2|Whenever you cast an instant or sorcery spell, put a 2/2 blue Drake creature token with flying onto the battlefield.| +Gigantoplasm|Commander 2015|11|R|{3}{U}|Creature - Shapeshifter|0|0|You may have Gigantoplasm enter the battlefield as a copy of any creature on the battlefield except it gains "{X}: This creature has base power and toughness X/X."| +Thought Reflection|Commander 2015|110|R|{4}{U}{U}{U}|Enchantment|||If you would draw a card, draw two cards instead.| +Windfall|Commander 2015|111|U|{2}{U}|Sorcery|||Each player discards his or her hand, then draws cards equal to the greatest number of cards a player discarded this way.| +Altar's Reap|Commander 2015|112|C|{1}{B}|Instant|||As an additional cost to cast Altar's Reap, sacrifice a creature.$Draw two cards.| +Ambition's Cost|Commander 2015|113|U|{3}{B}|Sorcery|||You draw three cards and you lose 3 life.| +Ancient Craving|Commander 2015|114|R|{3}{B}|Sorcery|||You draw three cards and you lose 3 life.| +Barter in Blood|Commander 2015|115|U|{2}{B}{B}|Sorcery|||Each player sacrifices two creatures.| +Black Market|Commander 2015|116|R|{3}{B}{B}|Enchantment|||Whenever a creature dies, put a charge counter on Black Market.$At the beginning of your precombat main phase, add {B} to your mana pool for each charge counter on Black Market.| +Blood Bairn|Commander 2015|117|C|{2}{B}|Creature - Vampire|2|2|Sacrifice another creature: Blood Bairn gets +2/+2 until end of turn.| +Butcher of Malakir|Commander 2015|118|R|{5}{B}{B}|Creature - Vampire Warrior|5|4|Flying$Whenever Butcher of Malakir or another creature you control dies, each opponent sacrifices a creature.| +Champion of Stray Souls|Commander 2015|119|M|{4}{B}{B}|Creature - Skeleton Warrior|4|4|{3}{B}{B}, {tap}, Sacrifice X other creatures: Return X target creature cards from your graveyard to the battlefield.${5}{B}{B}: Put Champion of Stray Souls on top of your library from your graveyard.| +Illusory Ambusher|Commander 2015|12|U|{4}{U}|Creature - Cat Illusion|4|1|Flash (You may cast this spell any time you could cast an instant.)$Whenever Illusory Ambusher is dealt damage, draw that many cards.| +Diabolic Servitude|Commander 2015|120|U|{3}{B}|Enchantment|||When Diabolic Servitude enters the battlefield, return target creature card from your graveyard to the battlefield.$When the creature put onto the battlefield with Diabolic Servitude dies, exile it and return Diabolic Servitude to its owner's hand.$When Diabolic Servitude leaves the battlefield, exile the creature put onto the battlefield with Diabolic Servitude.| +Doomwake Giant|Commander 2015|121|R|{4}{B}|Enchantment Creature - Giant|4|6|Constellation - Whenever Doomwake Giant or another enchantment enters the battlefield under your control, creatures your opponents control get -1/-1 until end of turn.| +Dreadbringer Lampads|Commander 2015|122|C|{4}{B}|Enchantment Creature - Nymph|4|2|Constellation - Whenever Dreadbringer Lampads or another enchantment enters the battlefield under your control, target creature gains intimidate until end of turn. (It can't be blocked except by artifact creatures and/or creatures that share a color with it.)| +Eater of Hope|Commander 2015|123|R|{5}{B}{B}|Creature - Demon|6|4|Flying${B}, Sacrifice another creature: Regenerate Eater of Hope.${2}{B}, Sacrifice two other creatures: Destroy target creature.| +Extractor Demon|Commander 2015|124|R|{4}{B}{B}|Creature - Demon|5|5|Flying$Whenever another creature leaves the battlefield, you may have target player put the top two cards of his or her library into his or her graveyard.$Unearth {2}{B} ({2}{B}: Return this card from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)| +Fallen Ideal|Commander 2015|125|U|{2}{B}|Enchantment - Aura|||Enchant creature$Enchanted creature has flying and "Sacrifice a creature: This creature gets +2/+1 until end of turn."$When Fallen Ideal is put into a graveyard from the battlefield, return Fallen Ideal to its owner's hand.| +Fate Unraveler|Commander 2015|126|R|{3}{B}|Enchantment Creature - Hag|3|4|Whenever an opponent draws a card, Fate Unraveler deals 1 damage to that player.| +Gild|Commander 2015|127|R|{3}{B}|Sorcery|||Exile target creature. Put a colorless artifact token named Gold onto the battlefield. It has "Sacrifice this artifact: Add one mana of any color to your mana pool."| +Grave Peril|Commander 2015|128|C|{1}{B}|Enchantment|||When a nonblack creature enters the battlefield, sacrifice Grave Peril. If you do, destroy that creature.| +Nighthowler|Commander 2015|129|R|{1}{B}{B}|Enchantment Creature - Horror|0|0|Bestow {2}{B}{B} (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)$Nighthowler and enchanted creature each get +X/+X, where X is the number of creature cards in all graveyards.| +Mirror Match|Commander 2015|13|U|{4}{U}{U}|Instant|||Cast Mirror Match only during the declare blockers step.$For each creature attacking you or a planeswalker you control, put a token that's a copy of that creature onto the battlefield blocking that creature. Exile those tokens at end of combat.| +Phyrexian Arena|Commander 2015|130|R|{1}{B}{B}|Enchantment|||At the beginning of your upkeep, you draw a card and you lose 1 life.| +Phyrexian Plaguelord|Commander 2015|131|R|{3}{B}{B}|Creature - Carrier|4|4|{tap}, Sacrifice Phyrexian Plaguelord: Target creature gets -4/-4 until end of turn.$Sacrifice a creature: Target creature gets -1/-1 until end of turn.| +Phyrexian Rager|Commander 2015|132|C|{2}{B}|Creature - Horror|2|2|When Phyrexian Rager enters the battlefield, you draw a card and you lose 1 life.| +Phyrexian Reclamation|Commander 2015|133|U|{B}|Enchantment|||{1}{B}, Pay 2 life: Return target creature card from your graveyard to your hand.| +Rise from the Grave|Commander 2015|134|U|{4}{B}|Sorcery|||Put target creature card from a graveyard onto the battlefield under your control. That creature is a black Zombie in addition to its other colors and types.| +Seal of Doom|Commander 2015|135|C|{2}{B}|Enchantment|||Sacrifice Seal of Doom: Destroy target nonblack creature. It can't be regenerated.| +Sever the Bloodline|Commander 2015|136|R|{3}{B}|Sorcery|||Exile target creature and all other creatures with the same name as that creature.$Flashback {5}{B}{B} (You may cast this card from your graveyard for its flashback cost. Then exile it.)| +Shriekmaw|Commander 2015|137|U|{4}{B}|Creature - Elemental|3|2|Fear (This creature can't be blocked except by artifact creatures and/or black creatures.)$When Shriekmaw enters the battlefield, destroy target nonartifact, nonblack creature.$Evoke {1}{B} (You may cast this spell for its evoke cost. If you do, it's sacrificed when it enters the battlefield.)| +Underworld Connections|Commander 2015|138|R|{1}{B}{B}|Enchantment - Aura|||Enchant land$Enchanted land has "{tap}, Pay 1 life: Draw a card."| +Victimize|Commander 2015|139|U|{2}{B}|Sorcery|||Choose two target creature cards in your graveyard. Sacrifice a creature. If you do, return the chosen cards to the battlefield tapped.| +Mystic Confluence|Commander 2015|14|R|{3}{U}{U}|Instant|||Choose three. You may choose the same mode more than once.$• Counter target spell unless its controller pays {3}.$• Return target creature to its owner's hand.$• Draw a card.| +Vow of Malice|Commander 2015|140|U|{2}{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +2/+2, has intimidate, and can't attack you or a planeswalker you control. (A creature with intimidate can't be blocked except by artifact creatures and/or creatures that share a color with it.)| +Act of Aggression|Commander 2015|141|U|{3}{RP}{RP}|Instant|||({RP} can be paid with either {R} or 2 life.)$Gain control of target creature an opponent controls until end of turn. Untap that creature. It gains haste until end of turn.| +Borderland Behemoth|Commander 2015|142|R|{5}{R}{R}|Creature - Giant Warrior|4|4|Trample$Borderland Behemoth gets +4/+4 for each other Giant you control.| +Breath of Darigaaz|Commander 2015|143|U|{1}{R}|Sorcery|||Kicker {2} (You may pay an additional {2} as you cast this spell.)$Breath of Darigaaz deals 1 damage to each creature without flying and each player. If Breath of Darigaaz was kicked, it deals 4 damage to each creature without flying and each player instead.| +Chain Reaction|Commander 2015|144|R|{2}{R}{R}|Sorcery|||Chain Reaction deals X damage to each creature, where X is the number of creatures on the battlefield.| +Charmbreaker Devils|Commander 2015|145|R|{5}{R}|Creature - Devil|4|4|At the beginning of your upkeep, return an instant or sorcery card at random from your graveyard to your hand.$Whenever you cast an instant or sorcery spell, Charmbreaker Devils gets +4/+0 until end of turn.| +Comet Storm|Commander 2015|146|M|{X}{R}{R}|Instant|||Multikicker {1} (You may pay an additional {1} any number of times as you cast this spell.)$Choose target creature or player, then choose another target creature or player for each time Comet Storm was kicked. Comet Storm deals X damage to each of them.| +Curse of the Nightly Hunt|Commander 2015|147|U|{2}{R}|Enchantment - Aura Curse|||Enchant player$Creatures enchanted player controls attack each turn if able.| +Desolation Giant|Commander 2015|148|R|{2}{R}{R}|Creature - Giant|3|3|Kicker {W}{W} (You may pay an additional {W}{W} as you cast this spell.)$When Desolation Giant enters the battlefield, destroy all other creatures you control. If it was kicked, destroy all other creatures instead.| +Desperate Ravings|Commander 2015|149|U|{1}{R}|Instant|||Draw two cards, then discard a card at random.$Flashback {2}{U} (You may cast this card from your graveyard for its flashback cost. Then exile it.)| +Synthetic Destiny|Commander 2015|15|R|{4}{U}{U}|Instant|||Exile all creatures you control. At the beginning of the next end step, reveal cards from the top of your library until you reveal that many creature cards, put all creature cards revealed this way onto the battlefield, then shuffle the rest of the revealed cards into your library.| +Disaster Radius|Commander 2015|150|R|{5}{R}{R}|Sorcery|||As an additional cost to cast Disaster Radius, reveal a creature card from your hand.$Disaster Radius deals X damage to each creature your opponents control, where X is the revealed card's converted mana cost.| +Dragon Mage|Commander 2015|151|R|{5}{R}{R}|Creature - Dragon Wizard|5|5|Flying$Whenever Dragon Mage deals combat damage to a player, each player discards his or her hand, then draws seven cards.| +Earthquake|Commander 2015|152|R|{X}{R}|Sorcery|||Earthquake deals X damage to each creature without flying and each player.| +Faithless Looting|Commander 2015|153|C|{R}|Sorcery|||Draw two cards, then discard two cards.$Flashback {2}{R} (You may cast this card from your graveyard for its flashback cost. Then exile it.)| +Fall of the Hammer|Commander 2015|154|C|{1}{R}|Instant|||Target creature you control deals damage equal to its power to another target creature.| +Fumiko the Lowblood|Commander 2015|155|R|{2}{R}{R}|Legendary Creature - Human Samurai|3|2|Fumiko the Lowblood has bushido X, where X is the number of attacking creatures. (Whenever this creature blocks or becomes blocked, it gets +X/+X until end of turn.)$Creatures your opponents control attack each turn if able.| +Hamletback Goliath|Commander 2015|156|R|{6}{R}|Creature - Giant Warrior|6|6|Whenever another creature enters the battlefield, you may put X +1/+1 counters on Hamletback Goliath, where X is that creature's power.| +Hammerfist Giant|Commander 2015|157|R|{4}{R}{R}|Creature - Giant Warrior|5|4|{tap}: Hammerfist Giant deals 4 damage to each creature without flying and each player.| +Hostility|Commander 2015|158|R|{3}{R}{R}{R}|Creature - Elemental Incarnation|6|6|Haste$If a spell you control would deal damage to an opponent, prevent that damage. Put a 3/1 red Elemental Shaman creature token with haste onto the battlefield for each 1 damage prevented this way.$When Hostility is put into a graveyard from anywhere, shuffle it into its owner's library.| +Hunted Dragon|Commander 2015|159|R|{3}{R}{R}|Creature - Dragon|6|6|Flying, haste$When Hunted Dragon enters the battlefield, target opponent puts three 2/2 white Knight creature tokens with first strike onto the battlefield.| +Banshee of the Dread Choir|Commander 2015|16|U|{3}{B}{B}|Creature - Spirit|4|4|Myriad (Whenever this creature attacks, for each opponent other than defending player, you may put a token that's a copy of this creature onto the battlefield tapped and attacking that player or a planeswalker he or she controls. Exile the tokens at end of combat.)$Whenever Banshee of the Dread Choir deals combat damage to a player, that player discards a card.| +Inferno Titan|Commander 2015|160|M|{4}{R}{R}|Creature - Giant|6|6|{R}: Inferno Titan gets +1/+0 until end of turn.$Whenever Inferno Titan enters the battlefield or attacks, it deals 3 damage divided as you choose among one, two, or three target creatures and/or players.| +Magma Giant|Commander 2015|161|R|{5}{R}{R}|Creature - Giant|5|5|When Magma Giant enters the battlefield, it deals 2 damage to each creature and each player.| +Magmaquake|Commander 2015|162|R|{X}{R}{R}|Instant|||Magmaquake deals X damage to each creature without flying and each planeswalker.| +Mizzium Mortars|Commander 2015|163|R|{1}{R}|Sorcery|||Mizzium Mortars deals 4 damage to target creature you don't control.$Overload {3}{R}{R}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")| +Stinkdrinker Daredevil|Commander 2015|164|C|{2}{R}|Creature - Goblin Rogue|1|3|Giant spells you cast cost {2} less to cast.| +Stoneshock Giant|Commander 2015|165|U|{3}{R}{R}|Creature - Giant|5|4|{6}{R}{R}: Monstrosity 3. (If this creature isn't monstrous, put three +1/+1 counters on it and it becomes monstrous.)$When Stoneshock Giant becomes monstrous, creatures without flying your opponents control can't block this turn.| +Sunrise Sovereign|Commander 2015|166|R|{5}{R}|Creature - Giant Warrior|5|5|Other Giant creatures you control get +2/+2 and have trample.| +Taurean Mauler|Commander 2015|167|R|{2}{R}|Creature - Shapeshifter|2|2|Changeling (This card is every creature type at all times.)$Whenever an opponent casts a spell, you may put a +1/+1 counter on Taurean Mauler.| +Thundercloud Shaman|Commander 2015|168|U|{3}{R}{R}|Creature - Giant Shaman|4|4|When Thundercloud Shaman enters the battlefield, it deals damage equal to the number of Giants you control to each non-Giant creature.| +Urza's Rage|Commander 2015|169|R|{2}{R}|Instant|||Kicker {8}{R} (You may pay an additional {8}{R} as you cast this spell.)$Urza's Rage can't be countered by spells or abilities.$Urza's Rage deals 3 damage to target creature or player. If Urza's Rage was kicked, instead it deals 10 damage to that creature or player and the damage can't be prevented.| +Corpse Augur|Commander 2015|17|U|{3}{B}|Creature - Zombie Wizard|4|2|When Corpse Augur dies, you draw X cards and you lose X life, where X is the number of creature cards in target player's graveyard.| +Vandalblast|Commander 2015|170|U|{R}|Sorcery|||Destroy target artifact you don't control.$Overload {4}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")| +Warstorm Surge|Commander 2015|171|R|{5}{R}|Enchantment|||Whenever a creature enters the battlefield under your control, it deals damage equal to its power to target creature or player.| +Word of Seizing|Commander 2015|172|R|{3}{R}{R}|Instant|||Split second (As long as this spell is on the stack, players can't cast spells or activate abilities that aren't mana abilities.)$Untap target permanent and gain control of it until end of turn. It gains haste until end of turn.| +Acidic Slime|Commander 2015|173|U|{3}{G}{G}|Creature - Ooze|2|2|Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)$When Acidic Slime enters the battlefield, destroy target artifact, enchantment, or land.| +Arbor Colossus|Commander 2015|174|R|{2}{G}{G}{G}|Creature - Giant|6|6|Reach${3}{G}{G}{G}: Monstrosity 3. (If this creature isn't monstrous, put three +1/+1 counters on it and it becomes monstrous.)$When Arbor Colossus becomes monstrous, destroy target creature with flying an opponent controls.| +Bane of Progress|Commander 2015|175|R|{4}{G}{G}|Creature - Elemental|2|2|When Bane of Progress enters the battlefield, destroy all artifacts and enchantments. Put a +1/+1 counter on Bane of Progress for each permanent destroyed this way.| +Beastmaster Ascension|Commander 2015|176|R|{2}{G}|Enchantment|||Whenever a creature you control attacks, you may put a quest counter on Beastmaster Ascension.$As long as Beastmaster Ascension has seven or more quest counters on it, creatures you control get +5/+5.| +Caller of the Claw|Commander 2015|177|R|{2}{G}|Creature - Elf|2|2|Flash$When Caller of the Claw enters the battlefield, put a 2/2 green Bear creature token onto the battlefield for each nontoken creature put into your graveyard from the battlefield this turn.| +Chameleon Colossus|Commander 2015|178|R|{2}{G}{G}|Creature - Shapeshifter|4|4|Changeling (This card is every creature type at all times.)$Protection from black${2}{G}{G}: Chameleon Colossus gets +X/+X until end of turn, where X is its power.| +Cloudthresher|Commander 2015|179|R|{2}{G}{G}{G}{G}|Creature - Elemental|7|7|Flash$Reach$When Cloudthresher enters the battlefield, it deals 2 damage to each creature with flying and each player.$Evoke {2}{G}{G} (You may cast this spell for its evoke cost. If you do, it's sacrificed when it enters the battlefield.)| +Daxos's Torment|Commander 2015|18|R|{3}{B}|Enchantment|||Constellation - Whenever Daxos's Torment or another enchantment enters the battlefield under your control, Daxos's Torment becomes a 5/5 Demon creature with flying and haste in addition to its other types until end of turn.| +Cobra Trap|Commander 2015|180|U|{4}{G}{G}|Instant - Trap|||If a noncreature permanent under your control was destroyed this turn by a spell or ability an opponent controlled, you may pay {G} rather than pay Cobra Trap's mana cost.$Put four 1/1 green Snake creature tokens onto the battlefield.| +Desert Twister|Commander 2015|181|U|{4}{G}{G}|Sorcery|||Destroy target permanent.| +Elvish Visionary|Commander 2015|182|C|{1}{G}|Creature - Elf Shaman|1|1|When Elvish Visionary enters the battlefield, draw a card.| +Eternal Witness|Commander 2015|183|U|{1}{G}{G}|Creature - Human Shaman|2|1|When Eternal Witness enters the battlefield, you may return target card from your graveyard to your hand.| +Experiment One|Commander 2015|184|U|{G}|Creature - Human Ooze|1|1|Evolve (Whenever a creature enters the battlefield under your control, if that creature has greater power or toughness than this creature, put a +1/+1 counter on this creature.)$Remove two +1/+1 counters from Experiment One: Regenerate Experiment One.| +Forgotten Ancient|Commander 2015|185|R|{3}{G}|Creature - Elemental|0|3|Whenever a player casts a spell, you may put a +1/+1 counter on Forgotten Ancient.$At the beginning of your upkeep, you may move any number of +1/+1 counters from Forgotten Ancient onto other creatures.| +Indrik Stomphowler|Commander 2015|186|U|{4}{G}|Creature - Beast|4|4|When Indrik Stomphowler enters the battlefield, destroy target artifact or enchantment.| +Kessig Cagebreakers|Commander 2015|187|R|{4}{G}|Creature - Human Rogue|3|4|Whenever Kessig Cagebreakers attacks, put a 2/2 green Wolf creature token onto the battlefield tapped and attacking for each creature card in your graveyard.| +Kodama's Reach|Commander 2015|188|C|{2}{G}|Sorcery - Arcane|||Search your library for up to two basic land cards, reveal those cards, and put one onto the battlefield tapped and the other into your hand. Then shuffle your library.| +Krosan Grip|Commander 2015|189|U|{2}{G}|Instant|||Split second (As long as this spell is on the stack, players can't cast spells or activate abilities that aren't mana abilities.)$Destroy target artifact or enchantment.| +Deadly Tempest|Commander 2015|19|R|{4}{B}{B}|Sorcery|||Destroy all creatures. Each player loses life equal to the number of creatures he or she controlled that were destroyed this way.| +Loaming Shaman|Commander 2015|190|R|{2}{G}|Creature - Centaur Shaman|3|2|When Loaming Shaman enters the battlefield, target player shuffles any number of target cards from his or her graveyard into his or her library.| +Mulch|Commander 2015|191|C|{1}{G}|Sorcery|||Reveal the top four cards of your library. Put all land cards revealed this way into your hand and the rest into your graveyard.| +Mycoloth|Commander 2015|192|R|{3}{G}{G}|Creature - Fungus|4|4|Devour 2 (As this enters the battlefield, you may sacrifice any number of creatures. This creature enters the battlefield with twice that many +1/+1 counters on it.)$At the beginning of your upkeep, put a 1/1 green Saproling creature token onto the battlefield for each +1/+1 counter on Mycoloth.| +Noble Quarry|Commander 2015|193|U|{2}{G}|Enchantment Creature - Unicorn|1|1|Bestow {5}{G} (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)$All creatures able to block Noble Quarry or enchanted creature do so.$Enchanted creature gets +1/+1.| +Ohran Viper|Commander 2015|194|R|{1}{G}{G}|Snow Creature - Snake|1|3|Whenever Ohran Viper deals combat damage to a creature, destroy that creature at end of combat.$Whenever Ohran Viper deals combat damage to a player, you may draw a card.| +Overrun|Commander 2015|195|U|{2}{G}{G}{G}|Sorcery|||Creatures you control get +3/+3 and gain trample until end of turn.| +Overwhelming Stampede|Commander 2015|196|R|{3}{G}{G}|Sorcery|||Until end of turn, creatures you control gain trample and get +X/+X, where X is the greatest power among creatures you control.| +Patagia Viper|Commander 2015|197|U|{3}{G}|Creature - Snake|2|1|Flying$When Patagia Viper enters the battlefield, put two 1/1 green and blue Snake creature tokens onto the battlefield.$When Patagia Viper enters the battlefield, sacrifice it unless {U} was spent to cast it.| +Primal Growth|Commander 2015|198|C|{2}{G}|Sorcery|||Kicker-Sacrifice a creature. (You may sacrifice a creature in addition to any other costs as you cast this spell.)$Search your library for a basic land card, put that card onto the battlefield, then shuffle your library. If Primal Growth was kicked, instead search your library for up to two basic land cards, put them onto the battlefield, then shuffle your library.| +Rampant Growth|Commander 2015|199|C|{1}{G}|Sorcery|||Search your library for a basic land card and put that card onto the battlefield tapped. Then shuffle your library.| +Dawnbreak Reclaimer|Commander 2015|2|R|{4}{W}{W}|Creature - Angel|5|5|Flying$At the beginning of your end step, choose a creature card in an opponent's graveyard, then that player chooses a creature card in your graveyard. You may return those cards to the battlefield under their owners' control.| +Dread Summons|Commander 2015|20|R|{X}{B}{B}|Sorcery|||Each player puts the top X cards of his or her library into his or her graveyard. For each creature card put into a graveyard this way, you put a 2/2 black Zombie creature token onto the battlefield tapped.| +Sakura-Tribe Elder|Commander 2015|200|C|{1}{G}|Creature - Snake Shaman|1|1|Sacrifice Sakura-Tribe Elder: Search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library.| +Satyr Wayfinder|Commander 2015|201|C|{1}{G}|Creature - Satyr|1|1|When Satyr Wayfinder enters the battlefield, reveal the top four cards of your library. You may put a land card from among them into your hand. Put the rest into your graveyard.| +Spider Spawning|Commander 2015|202|U|{4}{G}|Sorcery|||Put a 1/2 green Spider creature token with reach onto the battlefield for each creature card in your graveyard.$Flashback {6}{B} (You may cast this card from your graveyard for its flashback cost. Then exile it.)| +Stingerfling Spider|Commander 2015|203|U|{4}{G}|Creature - Spider|2|5|Reach$When Stingerfling Spider enters the battlefield, you may destroy target creature with flying.| +Terastodon|Commander 2015|204|R|{6}{G}{G}|Creature - Elephant|9|9|When Terastodon enters the battlefield, you may destroy up to three target noncreature permanents. For each permanent put into a graveyard this way, its controller puts a 3/3 green Elephant creature token onto the battlefield.| +Thelonite Hermit|Commander 2015|205|R|{3}{G}|Creature - Elf Shaman|1|1|Saproling creatures get +1/+1.$Morph {3}{G}{G} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)$When Thelonite Hermit is turned face up, put four 1/1 green Saproling creature tokens onto the battlefield.| +Tribute to the Wild|Commander 2015|206|U|{1}{G}|Instant|||Each opponent sacrifices an artifact or enchantment.| +Verdant Force|Commander 2015|207|R|{5}{G}{G}{G}|Creature - Elemental|7|7|At the beginning of each upkeep, put a 1/1 green Saproling creature token onto the battlefield.| +Viridian Emissary|Commander 2015|208|C|{1}{G}|Creature - Elf Scout|2|1|When Viridian Emissary dies, you may search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library.| +Viridian Shaman|Commander 2015|209|U|{2}{G}|Creature - Elf Shaman|2|2|When Viridian Shaman enters the battlefield, destroy target artifact.| +Scourge of Nel Toth|Commander 2015|21|R|{5}{B}{B}|Creature - Zombie Dragon|6|6|Flying$You may cast Scourge of Nel Toth from your graveyard by paying {B}{B} and sacrificing two creatures rather than paying its mana cost.| +Viridian Zealot|Commander 2015|210|R|{G}{G}|Creature - Elf Warrior|2|1|{1}{G}, Sacrifice Viridian Zealot: Destroy target artifact or enchantment.| +Wall of Blossoms|Commander 2015|211|U|{1}{G}|Creature - Plant Wall|0|4|Defender$When Wall of Blossoms enters the battlefield, draw a card.| +Wood Elves|Commander 2015|212|C|{2}{G}|Creature - Elf Scout|1|1|When Wood Elves enters the battlefield, search your library for a Forest card and put that card onto the battlefield. Then shuffle your library.| +Coiling Oracle|Commander 2015|213|C|{G}{U}|Creature - Snake Elf Druid|1|1|When Coiling Oracle enters the battlefield, reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put that card into your hand.| +Counterflux|Commander 2015|214|R|{U}{U}{R}|Instant|||Counterflux can't be countered by spells or abilities.$Counter target spell you don't control.$Overload {1}{U}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")| +Death Grasp|Commander 2015|215|R|{X}{W}{B}|Sorcery|||Death Grasp deals X damage to target creature or player. You gain X life.| +Epic Experiment|Commander 2015|216|M|{X}{U}{R}|Sorcery|||Exile the top X cards of your library. For each instant and sorcery card with converted mana cost X or less among them, you may cast that card without paying its mana cost. Then put all cards exiled this way that weren't cast into your graveyard.| +Etherium-Horn Sorcerer|Commander 2015|217|R|{4}{U}{R}|Artifact Creature - Minotaur Wizard|3|6|{1}{U}{R}: Return Etherium-Horn Sorcerer to its owner's hand.$Cascade (When you cast this spell, exile cards from the top of your library until you exile a nonland card that costs less. You may cast it without paying its mana cost. Put the exiled cards on the bottom in a random order.)| +Firemind's Foresight|Commander 2015|218|R|{5}{U}{R}|Instant|||Search your library for an instant card with converted mana cost 3, reveal it, and put it into your hand. Then repeat this process for instant cards with converted mana costs 2 and 1. Then shuffle your library.| +Gisela, Blade of Goldnight|Commander 2015|219|M|{4}{R}{W}{W}|Legendary Creature - Angel|5|5|Flying, first strike$If a source would deal damage to an opponent or a permanent an opponent controls, that source deals double that damage to that player or permanent instead.$If a source would deal damage to you or a permanent you control, prevent half that damage, rounded up.| +Thief of Blood|Commander 2015|22|U|{4}{B}{B}|Creature - Vampire|1|1|Flying$As Thief of Blood enters the battlefield, remove all counters from all permanents. Thief of Blood enters the battlefield with a +1/+1 counter on it for each counter removed this way.| +Goblin Electromancer|Commander 2015|220|C|{U}{R}|Creature - Goblin Wizard|2|2|Instant and sorcery spells you cast cost {1} less to cast.| +Golgari Charm|Commander 2015|221|U|{B}{G}|Instant|||Choose one -$• All creatures get -1/-1 until end of turn.$• Destroy target enchantment.$• Regenerate each creature you control.| +Grisly Salvage|Commander 2015|222|C|{B}{G}|Instant|||Reveal the top five cards of your library. You may put a creature or land card from among them into your hand. Put the rest into your graveyard.| +Jarad, Golgari Lich Lord|Commander 2015|223|M|{B}{B}{G}{G}|Legendary Creature - Zombie Elf|2|2|Jarad, Golgari Lich Lord gets +1/+1 for each creature card in your graveyard.${1}{B}{G}, Sacrifice another creature: Each opponent loses life equal to the sacrificed creature's power.$Sacrifice a Swamp and a Forest: Return Jarad from your graveyard to your hand.| +Korozda Guildmage|Commander 2015|224|U|{B}{G}|Creature - Elf Shaman|2|2|{1}{B}{G}: Target creature gets +1/+1 and gains intimidate until end of turn. (It can't be blocked except by artifact creatures and/or creatures that share a color with it.)${2}{B}{G}, Sacrifice a nontoken creature: Put X 1/1 green Saproling creature tokens onto the battlefield, where X is the sacrificed creature's toughness.| +Lorescale Coatl|Commander 2015|225|U|{1}{G}{U}|Creature - Snake|2|2|Whenever you draw a card, you may put a +1/+1 counter on Lorescale Coatl.| +Lotleth Troll|Commander 2015|226|R|{B}{G}|Creature - Zombie Troll|2|1|Trample$Discard a creature card: Put a +1/+1 counter on Lotleth Troll.${B}: Regenerate Lotleth Troll.| +Melek, Izzet Paragon|Commander 2015|227|R|{4}{U}{R}|Legendary Creature - Weird Wizard|2|4|Play with the top card of your library revealed.$You may cast the top card of your library if it's an instant or sorcery card.$Whenever you cast an instant or sorcery spell from your library, copy it. You may choose new targets for the copy.| +Mystic Snake|Commander 2015|228|R|{1}{G}{U}{U}|Creature - Snake|2|2|Flash$When Mystic Snake enters the battlefield, counter target spell.| +Necromancer's Covenant|Commander 2015|229|R|{3}{W}{B}{B}|Enchantment|||When Necromancer's Covenant enters the battlefield, exile all creature cards from target player's graveyard, then put a 2/2 black Zombie creature token onto the battlefield for each card exiled this way.$Zombies you control have lifelink.| +Wretched Confluence|Commander 2015|23|R|{3}{B}{B}|Instant|||Choose three. You may choose the same mode more than once.$• Target player draws a card and loses 1 life.$• Target creature gets -2/-2 until end of turn.$• Return target creature card from your graveyard to your hand.| +Prime Speaker Zegana|Commander 2015|230|M|{2}{G}{G}{U}{U}|Legendary Creature - Merfolk Wizard|1|1|Prime Speaker Zegana enters the battlefield with X +1/+1 counters on it, where X is the greatest power among other creatures you control.$When Prime Speaker Zegana enters the battlefield, draw cards equal to its power.| +Prophetic Bolt|Commander 2015|231|R|{3}{U}{R}|Instant|||Prophetic Bolt deals 4 damage to target creature or player. Look at the top four cards of your library. Put one of those cards into your hand and the rest on the bottom of your library in any order.| +Putrefy|Commander 2015|232|U|{1}{B}{G}|Instant|||Destroy target artifact or creature. It can't be regenerated.| +Steam Augury|Commander 2015|233|R|{2}{U}{R}|Instant|||Reveal the top five cards of your library and separate them into two piles. An opponent chooses one of those piles. Put that pile into your hand and the other into your graveyard.| +Teysa, Envoy of Ghosts|Commander 2015|234|R|{5}{W}{B}|Legendary Creature - Human Advisor|4|4|Vigilance, protection from creatures$Whenever a creature deals combat damage to you, destroy that creature. Put a 1/1 white and black Spirit creature token with flying onto the battlefield.| +Treasury Thrull|Commander 2015|235|R|{4}{W}{B}|Creature - Thrull|4|4|Extort (Whenever you cast a spell, you may pay {WB}. If you do, each opponent loses 1 life and you gain that much life.)$Whenever Treasury Thrull attacks, you may return target artifact, creature, or enchantment card from your graveyard to your hand.| +Trygon Predator|Commander 2015|236|U|{1}{G}{U}|Creature - Beast|2|3|Flying$Whenever Trygon Predator deals combat damage to a player, you may destroy target artifact or enchantment that player controls.| +Underworld Coinsmith|Commander 2015|237|U|{W}{B}|Enchantment Creature - Human Cleric|2|2|Constellation - Whenever Underworld Coinsmith or another enchantment enters the battlefield under your control, you gain 1 life.${W}{B}, Pay 1 life: Each opponent loses 1 life.| +Vulturous Zombie|Commander 2015|238|R|{3}{B}{G}|Creature - Plant Zombie|3|3|Flying$Whenever a card is put into an opponent's graveyard from anywhere, put a +1/+1 counter on Vulturous Zombie.| +Biomantic Mastery|Commander 2015|239|R|{4}{GU}{GU}{GU}|Sorcery|||Draw a card for each creature target player controls, then draw a card for each creature another target player controls.| +Awaken the Sky Tyrant|Commander 2015|24|R|{3}{R}|Enchantment|||When a source an opponent controls deals damage to you, sacrifice Awaken the Sky Tyrant. If you do, put a 5/5 red Dragon creature token with flying onto the battlefield.| +Call the Skybreaker|Commander 2015|240|R|{5}{UR}{UR}|Sorcery|||Put a 5/5 blue and red Elemental creature token with flying onto the battlefield.$Retrace (You may cast this card from your graveyard by discarding a land card in addition to paying its other costs.)| +Cold-Eyed Selkie|Commander 2015|241|R|{1}{GU}{GU}|Creature - Merfolk Rogue|1|1|Islandwalk (This creature can't be blocked as long as defending player controls an Island.)$Whenever Cold-Eyed Selkie deals combat damage to a player, you may draw that many cards.| +Snakeform|Commander 2015|242|C|{2}{GU}|Instant|||Until end of turn, target creature loses all abilities and becomes a green Snake with base power and toughness 1/1.$Draw a card.| +Wistful Selkie|Commander 2015|243|U|{GU}{GU}{GU}|Creature - Merfolk Wizard|2|2|When Wistful Selkie enters the battlefield, draw a card.| +Basalt Monolith|Commander 2015|244|U|{3}|Artifact|||Basalt Monolith doesn't untap during your untap step.${tap}: Add {3} to your mana pool.${3}: Untap Basalt Monolith.| +Bonehoard|Commander 2015|245|R|{4}|Artifact - Equipment|||Living weapon (When this Equipment enters the battlefield, put a 0/0 black Germ creature token onto the battlefield, then attach this to it.)$Equipped creature gets +X/+X, where X is the number of creature cards in all graveyards.$Equip {2}| +Boros Cluestone|Commander 2015|246|C|{3}|Artifact|||{tap}: Add {R} or {W} to your mana pool.${R}{W}, {tap}, Sacrifice Boros Cluestone: Draw a card.| +Boros Signet|Commander 2015|247|C|{2}|Artifact|||{1}, {tap}: Add {R}{W} to your mana pool.| +Burnished Hart|Commander 2015|248|U|{3}|Artifact Creature - Elk|2|2|{3}, Sacrifice Burnished Hart: Search your library for up to two basic land cards, put them onto the battlefield tapped, then shuffle your library.| +Coldsteel Heart|Commander 2015|249|U|{2}|Snow Artifact|||Coldsteel Heart enters the battlefield tapped.$As Coldsteel Heart enters the battlefield, choose a color.${tap}: Add one mana of the chosen color to your mana pool.| +Dream Pillager|Commander 2015|25|R|{5}{R}{R}|Creature - Dragon|4|4|Flying$Whenever Dream Pillager deals combat damage to a player, exile that many cards from the top of your library. Until end of turn, you may cast nonland cards exiled this way.| +Crystal Chimes|Commander 2015|250|U|{3}|Artifact|||{3}, {tap}, Sacrifice Crystal Chimes: Return all enchantment cards from your graveyard to your hand.| +Darksteel Ingot|Commander 2015|251|U|{3}|Artifact|||Indestructible${tap}: Add one mana of any color to your mana pool.| +Dreamstone Hedron|Commander 2015|252|U|{6}|Artifact|||{tap}: Add {3} to your mana pool.${3}, {tap}, Sacrifice Dreamstone Hedron: Draw three cards.| +Eldrazi Monument|Commander 2015|253|M|{5}|Artifact|||Creatures you control get +1/+1 and have flying and indestructible.$At the beginning of your upkeep, sacrifice a creature. If you can't, sacrifice Eldrazi Monument.| +Fellwar Stone|Commander 2015|254|U|{2}|Artifact|||{tap}: Add to your mana pool one mana of any color that a land an opponent controls could produce.| +Golgari Signet|Commander 2015|255|C|{2}|Artifact|||{1}, {tap}: Add {B}{G} to your mana pool.| +Izzet Signet|Commander 2015|256|C|{2}|Artifact|||{1}, {tap}: Add {U}{R} to your mana pool.| +Lightning Greaves|Commander 2015|257|U|{2}|Artifact - Equipment|||Equipped creature has haste and shroud. (It can't be the target of spells or abilities.)$Equip {0}| +Loxodon Warhammer|Commander 2015|258|R|{3}|Artifact - Equipment|||Equipped creature gets +3/+0 and has trample and lifelink.$Equip {3}| +Mind Stone|Commander 2015|259|U|{2}|Artifact|||{tap}: Add {1} to your mana pool.${1}, {tap}, Sacrifice Mind Stone: Draw a card.| +Fiery Confluence|Commander 2015|26|R|{2}{R}{R}|Sorcery|||Choose three. You may choose the same mode more than once.$• Fiery Confluence deals 1 damage to each creature.$• Fiery Confluence deals 2 damage to each opponent.$• Destroy target artifact.| +Orochi Hatchery|Commander 2015|260|R|{X}{X}|Artifact|||Orochi Hatchery enters the battlefield with X charge counters on it.${5}, {tap}: Put a 1/1 green Snake creature token onto the battlefield for each charge counter on Orochi Hatchery.| +Orzhov Cluestone|Commander 2015|261|C|{3}|Artifact|||{tap}: Add {W} or {B} to your mana pool.${W}{B}, {tap}, Sacrifice Orzhov Cluestone: Draw a card.| +Orzhov Signet|Commander 2015|262|C|{2}|Artifact|||{1}, {tap}: Add {W}{B} to your mana pool.| +Psychosis Crawler|Commander 2015|263|R|{5}|Artifact Creature - Horror|*|*|Psychosis Crawler's power and toughness are each equal to the number of cards in your hand.$Whenever you draw a card, each opponent loses 1 life.| +Seer's Sundial|Commander 2015|264|R|{4}|Artifact|||Landfall - Whenever a land enters the battlefield under your control, you may pay {2}. If you do, draw a card.| +Simic Keyrune|Commander 2015|265|U|{3}|Artifact|||{tap}: Add {G} or {U} to your mana pool.${G}{U}: Simic Keyrune becomes a 2/3 green and blue Crab artifact creature with hexproof until end of turn. (It can't be the target of spells or abilities your opponents control.)| +Simic Signet|Commander 2015|266|C|{2}|Artifact|||{1}, {tap}: Add {G}{U} to your mana pool.| +Skullclamp|Commander 2015|267|U|{1}|Artifact - Equipment|||Equipped creature gets +1/-1.$Whenever equipped creature dies, draw two cards.$Equip {1}| +Sol Ring|Commander 2015|268|U|{1}|Artifact|||{tap}: Add {2} to your mana pool.| +Solemn Simulacrum|Commander 2015|269|R|{4}|Artifact Creature - Golem|2|2|When Solemn Simulacrum enters the battlefield, you may search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library.$When Solemn Simulacrum dies, you may draw a card.| +Magus of the Wheel|Commander 2015|27|R|{2}{R}|Creature - Human Wizard|3|3|{1}{R}, {tap}, Sacrifice Magus of the Wheel: Each player discards his or her hand, then draws seven cards.| +Staff of Nin|Commander 2015|270|R|{6}|Artifact|||At the beginning of your upkeep, draw a card.${tap}: Staff of Nin deals 1 damage to target creature or player.| +Swiftfoot Boots|Commander 2015|271|U|{2}|Artifact - Equipment|||Equipped creature has hexproof and haste.$Equip {1}| +Sword of Vengeance|Commander 2015|272|R|{3}|Artifact - Equipment|||Equipped creature gets +2/+0 and has first strike, vigilance, trample, and haste.$Equip {3}| +Urza's Incubator|Commander 2015|273|R|{3}|Artifact|||As Urza's Incubator enters the battlefield, choose a creature type.$Creature spells of the chosen type cost {2} less to cast.| +Wayfarer's Bauble|Commander 2015|274|C|{1}|Artifact|||{2}, {tap}, Sacrifice Wayfarer's Bauble: Search your library for a basic land card and put that card onto the battlefield tapped. Then shuffle your library.| +Worn Powerstone|Commander 2015|275|U|{3}|Artifact|||Worn Powerstone enters the battlefield tapped.${tap}: Add {2} to your mana pool.| +Ancient Amphitheater|Commander 2015|276|R||Land|||As Ancient Amphitheater enters the battlefield, you may reveal a Giant card from your hand. If you don't, Ancient Amphitheater enters the battlefield tapped.${tap}: Add {R} or {W} to your mana pool.| +Barren Moor|Commander 2015|277|C||Land|||Barren Moor enters the battlefield tapped.${tap}: Add {B} to your mana pool.$Cycling {B} ({B}, Discard this card: Draw a card.)| +Blasted Landscape|Commander 2015|278|U||Land|||{tap}: Add {1} to your mana pool.$Cycling {2} ({2}, Discard this card: Draw a card.)| +Boros Garrison|Commander 2015|279|C||Land|||Boros Garrison enters the battlefield tapped.$When Boros Garrison enters the battlefield, return a land you control to its owner's hand.${tap}: Add {R}{W} to your mana pool.| +Meteor Blast|Commander 2015|28|U|{X}{R}{R}{R}|Sorcery|||Meteor Blast deals 4 damage to each of X target creatures and/or players.| +Boros Guildgate|Commander 2015|280|C||Land - Gate|||Boros Guildgate enters the battlefield tapped.${tap}: Add {R} or {W} to your mana pool.| +Command Tower|Commander 2015|281|C||Land|||{tap}: Add to your mana pool one mana of any color in your commander's color identity.| +Drifting Meadow|Commander 2015|282|C||Land|||Drifting Meadow enters the battlefield tapped.${tap}: Add {W} to your mana pool.$Cycling {2} ({2}, Discard this card: Draw a card.)| +Evolving Wilds|Commander 2015|283|C||Land|||{tap}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| +Forgotten Cave|Commander 2015|284|C||Land|||Forgotten Cave enters the battlefield tapped.${tap}: Add {R} to your mana pool.$Cycling {R} ({R}, Discard this card: Draw a card.)| +Ghost Quarter|Commander 2015|285|U||Land|||{tap}: Add {1} to your mana pool.${tap}, Sacrifice Ghost Quarter: Destroy target land. Its controller may search his or her library for a basic land card, put it onto the battlefield, then shuffle his or her library.| +Golgari Guildgate|Commander 2015|286|C||Land - Gate|||Golgari Guildgate enters the battlefield tapped.${tap}: Add {B} or {G} to your mana pool.| +Golgari Rot Farm|Commander 2015|287|C||Land|||Golgari Rot Farm enters the battlefield tapped.$When Golgari Rot Farm enters the battlefield, return a land you control to its owner's hand.${tap}: Add {B}{G} to your mana pool.| +Grim Backwoods|Commander 2015|288|R||Land|||{tap}: Add {1} to your mana pool.${2}{B}{G}, {tap}, Sacrifice a creature: Draw a card.| +High Market|Commander 2015|289|R||Land|||{tap}: Add {1} to your mana pool.${tap}, Sacrifice a creature: You gain 1 life.| +Mizzix's Mastery|Commander 2015|29|R|{3}{R}|Sorcery|||Exile target card that's an instant or sorcery from your graveyard. For each card exiled this way, copy it, and you may cast the copy without paying its mana cost. Exile Mizzix's Mastery.$Overload {5}{R}{R}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")| +Izzet Boilerworks|Commander 2015|290|C||Land|||Izzet Boilerworks enters the battlefield tapped.$When Izzet Boilerworks enters the battlefield, return a land you control to its owner's hand.${tap}: Add {U}{R} to your mana pool.| +Izzet Guildgate|Commander 2015|291|C||Land - Gate|||Izzet Guildgate enters the battlefield tapped.${tap}: Add {U} or {R} to your mana pool.| +Jungle Hollow|Commander 2015|292|C||Land|||Jungle Hollow enters the battlefield tapped.$When Jungle Hollow enters the battlefield, you gain 1 life.${tap}: Add {B} or {G} to your mana pool.| +Llanowar Reborn|Commander 2015|293|U||Land|||Llanowar Reborn enters the battlefield tapped.${tap}: Add {G} to your mana pool.$Graft 1 (This land enters the battlefield with a +1/+1 counter on it. Whenever a creature enters the battlefield, you may move a +1/+1 counter from this land onto it.)| +Mosswort Bridge|Commander 2015|294|R||Land|||Hideaway (This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.)${tap}: Add {G} to your mana pool.${G}, {tap}: You may play the exiled card without paying its mana cost if creatures you control have total power 10 or greater.| +New Benalia|Commander 2015|295|U||Land|||New Benalia enters the battlefield tapped.$When New Benalia enters the battlefield, scry 1. (Look at the top card of your library. You may put that card on the bottom of your library.)${tap}: Add {W} to your mana pool.| +Novijen, Heart of Progress|Commander 2015|296|U||Land|||{tap}: Add {1} to your mana pool.${G}{U}, {tap}: Put a +1/+1 counter on each creature that entered the battlefield this turn.| +Oran-Rief, the Vastwood|Commander 2015|297|R||Land|||Oran-Rief, the Vastwood enters the battlefield tapped.${tap}: Add {G} to your mana pool.${tap}: Put a +1/+1 counter on each green creature that entered the battlefield this turn.| +Orzhov Basilica|Commander 2015|298|C||Land|||Orzhov Basilica enters the battlefield tapped.$When Orzhov Basilica enters the battlefield, return a land you control to its owner's hand.${tap}: Add {W}{B} to your mana pool.| +Orzhov Guildgate|Commander 2015|299|C||Land - Gate|||Orzhov Guildgate enters the battlefield tapped.${tap}: Add {W} or {B} to your mana pool.| +Grasp of Fate|Commander 2015|3|R|{1}{W}{W}|Enchantment|||When Grasp of Fate enters the battlefield, for each opponent, exile up to one target nonland permanent that player controls until Grasp of Fate leaves the battlefield. (Those permanents return under their owners' control.)| +Rite of the Raging Storm|Commander 2015|30|U|{3}{R}{R}|Enchantment|||Creatures named Lightning Rager can't attack you or planeswalkers you control.$At the beginning of each player's upkeep, that player puts a 5/1 red Elemental creature token named Lightning Rager onto the battlefield. It has trample, haste, and "At the beginning of the end step, sacrifice this creature."| +Polluted Mire|Commander 2015|300|C||Land|||Polluted Mire enters the battlefield tapped.${tap}: Add {B} to your mana pool.$Cycling {2} ({2}, Discard this card: Draw a card.)| +Reliquary Tower|Commander 2015|301|U||Land|||You have no maximum hand size.${tap}: Add {1} to your mana pool.| +Rogue's Passage|Commander 2015|302|U||Land|||{tap}: Add {1} to your mana pool.${4}, {tap}: Target creature can't be blocked this turn.| +Scoured Barrens|Commander 2015|303|C||Land|||Scoured Barrens enters the battlefield tapped.$When Scoured Barrens enters the battlefield, you gain 1 life.${tap}: Add {W} or {B} to your mana pool.| +Secluded Steppe|Commander 2015|304|C||Land|||Secluded Steppe enters the battlefield tapped.${tap}: Add {W} to your mana pool.$Cycling {W} ({W}, Discard this card: Draw a card.)| +Simic Growth Chamber|Commander 2015|305|C||Land|||Simic Growth Chamber enters the battlefield tapped.$When Simic Growth Chamber enters the battlefield, return a land you control to its owner's hand.${tap}: Add {G}{U} to your mana pool.| +Simic Guildgate|Commander 2015|306|C||Land - Gate|||Simic Guildgate enters the battlefield tapped.${tap}: Add {G} or {U} to your mana pool.| +Slippery Karst|Commander 2015|307|C||Land|||Slippery Karst enters the battlefield tapped.${tap}: Add {G} to your mana pool.$Cycling {2} ({2}, Discard this card: Draw a card.)| +Smoldering Crater|Commander 2015|308|C||Land|||Smoldering Crater enters the battlefield tapped.${tap}: Add {R} to your mana pool.$Cycling {2} ({2}, Discard this card: Draw a card.)| +Spinerock Knoll|Commander 2015|309|R||Land|||Hideaway (This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.)${tap}: Add {R} to your mana pool.${R}, {tap}: You may play the exiled card without paying its mana cost if an opponent was dealt 7 or more damage this turn.| +Warchief Giant|Commander 2015|31|U|{3}{R}{R}|Creature - Giant Warrior|5|3|Haste$Myriad (Whenever this creature attacks, for each opponent other than defending player, you may put a token that's a copy of this creature onto the battlefield tapped and attacking that player or a planeswalker he or she controls. Exile the tokens at end of combat.)| +Swiftwater Cliffs|Commander 2015|310|C||Land|||Swiftwater Cliffs enters the battlefield tapped.$When Swiftwater Cliffs enters the battlefield, you gain 1 life.${tap}: Add {U} or {R} to your mana pool.| +Tainted Field|Commander 2015|311|U||Land|||{tap}: Add {1} to your mana pool.${tap}: Add {W} or {B} to your mana pool. Activate this ability only if you control a Swamp.| +Tainted Wood|Commander 2015|312|U||Land|||{tap}: Add {1} to your mana pool.${tap}: Add {B} or {G} to your mana pool. Activate this ability only if you control a Swamp.| +Temple of the False God|Commander 2015|313|U||Land|||{tap}: Add {2} to your mana pool. Activate this ability only if you control five or more lands.| +Terramorphic Expanse|Commander 2015|314|C||Land|||{tap}, Sacrifice Terramorphic Expanse: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| +Thornwood Falls|Commander 2015|315|C||Land|||Thornwood Falls enters the battlefield tapped.$When Thornwood Falls enters the battlefield, you gain 1 life.${tap}: Add {G} or {U} to your mana pool.| +Vivid Crag|Commander 2015|316|U||Land|||Vivid Crag enters the battlefield tapped with two charge counters on it.${tap}: Add {R} to your mana pool.${tap}, Remove a charge counter from Vivid Crag: Add one mana of any color to your mana pool.| +Vivid Creek|Commander 2015|317|U||Land|||Vivid Creek enters the battlefield tapped with two charge counters on it.${tap}: Add {U} to your mana pool.${tap}, Remove a charge counter from Vivid Creek: Add one mana of any color to your mana pool.| +Vivid Grove|Commander 2015|318|U||Land|||Vivid Grove enters the battlefield tapped with two charge counters on it.${tap}: Add {G} to your mana pool.${tap}, Remove a charge counter from Vivid Grove: Add one mana of any color to your mana pool.| +Vivid Marsh|Commander 2015|319|U||Land|||Vivid Marsh enters the battlefield tapped with two charge counters on it.${tap}: Add {B} to your mana pool.${tap}, Remove a charge counter from Vivid Marsh: Add one mana of any color to your mana pool.| +Arachnogenesis|Commander 2015|32|R|{2}{G}|Instant|||Put X 1/2 green Spider creature tokens with reach onto the battlefield, where X is the number of creatures attacking you. Prevent all combat damage that would be dealt this turn by non-Spider creatures.| +Vivid Meadow|Commander 2015|320|U||Land|||Vivid Meadow enters the battlefield tapped with two charge counters on it.${tap}: Add {W} to your mana pool.${tap}, Remove a charge counter from Vivid Meadow: Add one mana of any color to your mana pool.| +Wind-Scarred Crag|Commander 2015|321|C||Land|||Wind-Scarred Crag enters the battlefield tapped.$When Wind-Scarred Crag enters the battlefield, you gain 1 life.${tap}: Add {R} or {W} to your mana pool.| +Zoetic Cavern|Commander 2015|322|U||Land|||{tap}: Add {1} to your mana pool.$Morph {2} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)| +Plains|Commander 2015|323|L||Basic Land - Plains|||W| +Plains|Commander 2015|324|L||Basic Land - Plains|||W| +Plains|Commander 2015|325|L||Basic Land - Plains|||W| +Plains|Commander 2015|326|L||Basic Land - Plains|||W| +Island|Commander 2015|327|L||Basic Land - Island|||U| +Island|Commander 2015|328|L||Basic Land - Island|||U| +Island|Commander 2015|329|L||Basic Land - Island|||U| +Bloodspore Thrinax|Commander 2015|33|R|{2}{G}{G}|Creature - Lizard|2|2|Devour 1 (As this enters the battlefield, you may sacrifice any number of creatures. This creature enters the battlefield with that many +1/+1 counters on it.)$Each other creature you control enters the battlefield with an additional X +1/+1 counters on it, where X is the number of +1/+1 counters on Bloodspore Thrinax.| +Island|Commander 2015|330|L||Basic Land - Island|||U| +Swamp|Commander 2015|331|L||Basic Land - Swamp|||B| +Swamp|Commander 2015|332|L||Basic Land - Swamp|||B| +Swamp|Commander 2015|333|L||Basic Land - Swamp|||B| +Swamp|Commander 2015|334|L||Basic Land - Swamp|||B| +Mountain|Commander 2015|335|L||Basic Land - Mountain|||R| +Mountain|Commander 2015|336|L||Basic Land - Mountain|||R| +Mountain|Commander 2015|337|L||Basic Land - Mountain|||R| +Mountain|Commander 2015|338|L||Basic Land - Mountain|||R| +Forest|Commander 2015|339|L||Basic Land - Forest|||G| +Caller of the Pack|Commander 2015|34|U|{5}{G}{G}|Creature - Beast|8|6|Trample$Myriad (Whenever this creature attacks, for each opponent other than defending player, you may put a token that's a copy of this creature onto the battlefield tapped and attacking that player or a planeswalker he or she controls. Exile the tokens at end of combat.)| +Forest|Commander 2015|340|L||Basic Land - Forest|||G| +Forest|Commander 2015|341|L||Basic Land - Forest|||G| +Forest|Commander 2015|342|L||Basic Land - Forest|||G| +Centaur Vinecrasher|Commander 2015|35|R|{3}{G}|Creature - Plant Centaur|1|1|Trample$Centaur Vinecrasher enters the battlefield with a number of +1/+1 counters on it equal to the number of land cards in all graveyards.$Whenever a land card is put into a graveyard from anywhere, you may pay {G}{G}. If you do, return Centaur Vinecrasher from your graveyard to your hand.| +Ezuri's Predation|Commander 2015|36|R|{5}{G}{G}{G}|Sorcery|||For each creature your opponents control, put a 4/4 green Beast creature token onto the battlefield. Each of those Beasts fights a different one of those creatures.| +Great Oak Guardian|Commander 2015|37|U|{5}{G}|Creature - Treefolk|4|5|Flash (You may cast this spell any time you could cast an instant.)$Reach$When Great Oak Guardian enters the battlefield, creatures target player controls get +2/+2 until end of turn. Untap them.| +Pathbreaker Ibex|Commander 2015|38|R|{4}{G}{G}|Creature - Goat|3|3|Whenever Pathbreaker Ibex attacks, creatures you control gain trample and get +X/+X until end of turn, where X is the greatest power among creatures you control.| +Skullwinder|Commander 2015|39|U|{2}{G}|Creature - Snake|1|3|Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)$When Skullwinder enters the battlefield, return target card from your graveyard to your hand, then choose an opponent. That player returns a card from his or her graveyard to his or her hand.| +Herald of the Host|Commander 2015|4|U|{3}{W}{W}|Creature - Angel|4|4|Flying, vigilance$Myriad (Whenever this creature attacks, for each opponent other than defending player, you may put a token that's a copy of this creature onto the battlefield tapped and attacking that player or a planeswalker he or she controls. Exile the tokens at end of combat.)| +Verdant Confluence|Commander 2015|40|R|{4}{G}{G}|Sorcery|||Choose three. You may choose the same mode more than once.$• Put two +1/+1 counters on target creature.$• Return target permanent card from your graveyard to your hand.$• Search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library.| +Anya, Merciless Angel|Commander 2015|41|M|{3}{R}{W}|Legendary Creature - Angel|4|4|Flying$Anya, Merciless Angel gets +3/+3 for each opponent whose life total is less than half his or her starting life total.$As long as an opponent's life total is less than half his or her starting life total, Anya has indestructible.| +Arjun, the Shifting Flame|Commander 2015|42|M|{4}{U}{R}|Legendary Creature - Sphinx Wizard|5|5|Flying$Whenever you cast a spell, put the cards in your hand on the bottom of your library in any order, then draw that many cards.| +Daxos the Returned|Commander 2015|43|M|{1}{W}{B}|Legendary Creature - Zombie Soldier|2|2|Whenever you cast an enchantment spell, you get an experience counter.${1}{W}{B}: Put a white and black Spirit enchantment creature token onto the battlefield. It has "This creature's power and toughness are each equal to the number of experience counters you have."| +Ezuri, Claw of Progress|Commander 2015|44|M|{2}{G}{U}|Legendary Creature - Elf Warrior|3|3|Whenever a creature with power 2 or less enters the battlefield under your control, you get an experience counter.$At the beginning of combat on your turn, put X +1/+1 counters on another target creature you control, where X is the number of experience counters you have.| +Kalemne, Disciple of Iroas|Commander 2015|45|M|{2}{R}{W}|Legendary Creature - Giant Soldier|3|3|Double strike, vigilance$Whenever you cast a creature spell with converted mana cost 5 or greater, you get an experience counter.$Kalemne, Disciple of Iroas gets +1/+1 for each experience counter you have.| +Karlov of the Ghost Council|Commander 2015|46|M|{W}{B}|Legendary Creature - Spirit Advisor|2|2|Whenever you gain life, put two +1/+1 counters on Karlov of the Ghost Council.${W}{B}, Remove six +1/+1 counters from Karlov of the Ghost Council: Exile target creature.| +Kaseto, Orochi Archmage|Commander 2015|47|M|{1}{G}{U}|Legendary Creature - Snake Wizard|2|2|{G}{U}: Target creature can't be blocked this turn. If that creature is a Snake, it gets +2/+2 until end of turn.| +Mazirek, Kraul Death Priest|Commander 2015|48|M|{3}{B}{G}|Legendary Creature - Insect Shaman|2|2|Flying$Whenever a player sacrifices another permanent, put a +1/+1 counter on each creature you control.| +Meren of Clan Nel Toth|Commander 2015|49|M|{2}{B}{G}|Legendary Creature - Human Shaman|3|4|Whenever another creature you control dies, you get an experience counter.$At the beginning of your end step, choose target creature card in your graveyard. If that card's converted mana cost is less than or equal to the number of experience counters you have, return it to the battlefield. Otherwise, put it into your hand.| +Kalemne's Captain|Commander 2015|5|R|{3}{W}{W}|Creature - Giant Soldier|5|5|Vigilance${5}{W}{W}: Monstrosity 3. (If this creature isn't monstrous, put three +1/+1 counters on it and it becomes monstrous.)$When Kalemne's Captain becomes monstrous, exile all artifacts and enchantments.| +Mizzix of the Izmagnus|Commander 2015|50|M|{2}{U}{R}|Legendary Creature - Goblin Wizard|2|2|Whenever you cast an instant or sorcery spell with converted mana cost greater than the number of experience counters you have, you get an experience counter.$Instant and sorcery spells you cast cost {1} less to cast for each experience counter you have.| +Blade of Selves|Commander 2015|51|R|{2}|Artifact - Equipment|||Equipped creature has myriad. (Whenever it attacks, for each opponent other than defending player, you may put a token that's a copy of that creature onto the battlefield tapped and attacking that player or a planeswalker he or she controls. Exile the tokens at end of combat.)$Equip {4}| +Sandstone Oracle|Commander 2015|52|U|{7}|Artifact Creature - Sphinx|4|4|Flying$When Sandstone Oracle enters the battlefield, choose an opponent. If that player has more cards in hand than you, draw cards equal to the difference.| +Scytheclaw|Commander 2015|53|R|{5}|Artifact - Equipment|||Living weapon (When this Equipment enters the battlefield, put a 0/0 black Germ creature token onto the battlefield, then attach this to it.)$Equipped creature gets +1/+1.$Whenever equipped creature deals combat damage to a player, that player loses half his or her life, rounded up.$Equip {3}| +Seal of the Guildpact|Commander 2015|54|R|{5}|Artifact|||As Seal of the Guildpact enters the battlefield, choose two colors.$Each spell you cast costs {1} less to cast for each of the chosen colors it is.| +Thought Vessel|Commander 2015|55|C|{2}|Artifact|||You have no maximum hand size.${tap}: Add {1} to your mana pool.| +Command Beacon|Commander 2015|56|R||Land|||{tap}: Add {1} to your mana pool.${tap}, Sacrifice Command Beacon: Put your commander into your hand from the command zone.| +Ajani's Chosen|Commander 2015|57|R|{2}{W}{W}|Creature - Cat Soldier|3|3|Whenever an enchantment enters the battlefield under your control, put a 2/2 white Cat creature token onto the battlefield. If that enchantment is an Aura, you may attach it to the token.| +Angel of Serenity|Commander 2015|58|M|{4}{W}{W}{W}|Creature - Angel|5|6|Flying$When Angel of Serenity enters the battlefield, you may exile up to three other target creatures from the battlefield and/or creature cards from graveyards.$When Angel of Serenity leaves the battlefield, return the exiled cards to their owners' hands.| +Arbiter of Knollridge|Commander 2015|59|R|{6}{W}|Creature - Giant Wizard|5|5|Vigilance$When Arbiter of Knollridge enters the battlefield, each player's life total becomes the highest life total among all players.| +Oreskos Explorer|Commander 2015|6|U|{1}{W}|Creature - Cat Scout|2|2|When Oreskos Explorer enters the battlefield, search your library for up to X Plains cards, where X is the number of players who control more lands than you. Reveal those cards, put them into your hand, then shuffle your library.| +Aura of Silence|Commander 2015|60|U|{1}{W}{W}|Enchantment|||Artifact and enchantment spells your opponents cast cost {2} more to cast.$Sacrifice Aura of Silence: Destroy target artifact or enchantment.| +Banishing Light|Commander 2015|61|U|{2}{W}|Enchantment|||When Banishing Light enters the battlefield, exile target nonland permanent an opponent controls until Banishing Light leaves the battlefield. (That permanent returns under its owner's control.)| +Cage of Hands|Commander 2015|62|C|{2}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature can't attack or block.${1}{W}: Return Cage of Hands to its owner's hand.| +Celestial Ancient|Commander 2015|63|R|{3}{W}{W}|Creature - Elemental|3|3|Flying$Whenever you cast an enchantment spell, put a +1/+1 counter on each creature you control.| +Celestial Archon|Commander 2015|64|R|{3}{W}{W}|Enchantment Creature - Archon|4|4|Bestow {5}{W}{W} (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)$Flying, first strike$Enchanted creature gets +4/+4 and has flying and first strike.| +Crib Swap|Commander 2015|65|U|{2}{W}|Tribal Instant - Shapeshifter|||Changeling (This card is every creature type at all times.)$Exile target creature. Its controller puts a 1/1 colorless Shapeshifter creature token with changeling onto the battlefield.| +Dawn to Dusk|Commander 2015|66|U|{2}{W}{W}|Sorcery|||Choose one or both -$• Return target enchantment card from your graveyard to your hand.$• Destroy target enchantment.| +Dawnglare Invoker|Commander 2015|67|C|{2}{W}|Creature - Kor Wizard|2|1|Flying${8}: Tap all creatures target player controls.| +Dictate of Heliod|Commander 2015|68|R|{3}{W}{W}|Enchantment|||Flash$Creatures you control get +2/+2.| +Faith's Fetters|Commander 2015|69|C|{3}{W}|Enchantment - Aura|||Enchant permanent$When Faith's Fetters enters the battlefield, you gain 4 life.$Enchanted permanent's activated abilities can't be activated unless they're mana abilities. If enchanted permanent is a creature, it can't attack or block.| +Righteous Confluence|Commander 2015|7|R|{3}{W}{W}|Sorcery|||Choose three. You may choose the same mode more than once.$• Put a 2/2 white Knight creature token with vigilance onto the battlefield.$• Exile target enchantment.$• You gain 5 life.| +Ghostblade Eidolon|Commander 2015|70|U|{2}{W}|Enchantment Creature - Spirit|1|1|Bestow {5}{W} (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)$Double strike (This creature deals both first-strike and regular combat damage.)$Enchanted creature gets +1/+1 and has double strike.| +Jareth, Leonine Titan|Commander 2015|71|R|{3}{W}{W}{W}|Legendary Creature - Cat Giant|4|7|Whenever Jareth, Leonine Titan blocks, it gets +7/+7 until end of turn.${W}: Jareth gains protection from the color of your choice until end of turn.| +Karmic Justice|Commander 2015|72|R|{2}{W}|Enchantment|||Whenever a spell or ability an opponent controls destroys a noncreature permanent you control, you may destroy target permanent that opponent controls.| +Kor Sanctifiers|Commander 2015|73|C|{2}{W}|Creature - Kor Cleric|2|3|Kicker {W} (You may pay an additional {W} as you cast this spell.)$When Kor Sanctifiers enters the battlefield, if it was kicked, destroy target artifact or enchantment.| +Marshal's Anthem|Commander 2015|74|R|{2}{W}{W}|Enchantment|||Multikicker {1}{W} (You may pay an additional {1}{W} any number of times as you cast this spell.)$Creatures you control get +1/+1.$When Marshal's Anthem enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times Marshal's Anthem was kicked.| +Mesa Enchantress|Commander 2015|75|R|{1}{W}{W}|Creature - Human Druid|0|2|Whenever you cast an enchantment spell, you may draw a card.| +Monk Idealist|Commander 2015|76|U|{2}{W}|Creature - Human Monk Cleric|2|2|When Monk Idealist enters the battlefield, return target enchantment card from your graveyard to your hand.| +Open the Vaults|Commander 2015|77|R|{4}{W}{W}|Sorcery|||Return all artifact and enchantment cards from all graveyards to the battlefield under their owners' control. (Auras with nothing to enchant remain in graveyards.)| +Orim's Thunder|Commander 2015|78|C|{2}{W}|Instant|||Kicker {R} (You may pay an additional {R} as you cast this spell.)$Destroy target artifact or enchantment. If Orim's Thunder was kicked, it deals damage equal to that permanent's converted mana cost to target creature.| +Seal of Cleansing|Commander 2015|79|C|{1}{W}|Enchantment|||Sacrifice Seal of Cleansing: Destroy target artifact or enchantment.| +Shielded by Faith|Commander 2015|8|R|{1}{W}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature has indestructible.$Whenever a creature enters the battlefield, you may attach Shielded by Faith to that creature.| +Sigil of the Empty Throne|Commander 2015|80|R|{3}{W}{W}|Enchantment|||Whenever you cast an enchantment spell, put a 4/4 white Angel creature token with flying onto the battlefield.| +Silent Sentinel|Commander 2015|81|R|{5}{W}{W}|Creature - Archon|4|6|Flying$Whenever Silent Sentinel attacks, you may return target enchantment card from your graveyard to the battlefield.| +Sun Titan|Commander 2015|82|M|{4}{W}{W}|Creature - Giant|6|6|Vigilance$Whenever Sun Titan enters the battlefield or attacks, you may return target permanent card with converted mana cost 3 or less from your graveyard to the battlefield.| +Victory's Herald|Commander 2015|83|R|{3}{W}{W}{W}|Creature - Angel|4|4|Flying$Whenever Victory's Herald attacks, attacking creatures gain flying and lifelink until end of turn.| +Vow of Duty|Commander 2015|84|U|{2}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +2/+2, has vigilance, and can't attack you or a planeswalker you control.| +AEtherize|Commander 2015|85|U|{3}{U}|Instant|||Return all attacking creatures to their owner's hand.| +Bident of Thassa|Commander 2015|86|R|{2}{U}{U}|Legendary Enchantment Artifact|||Whenever a creature you control deals combat damage to a player, you may draw a card.${1}{U}, {tap}: Creatures your opponents control attack this turn if able.| +Blatant Thievery|Commander 2015|87|R|{4}{U}{U}{U}|Sorcery|||For each opponent, gain control of target permanent that player controls.| +Blue Sun's Zenith|Commander 2015|88|R|{X}{U}{U}{U}|Instant|||Target player draws X cards. Shuffle Blue Sun's Zenith into its owner's library.| +Blustersquall|Commander 2015|89|U|{U}|Instant|||Tap target creature you don't control.$Overload {3}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")| +AEthersnatch|Commander 2015|9|R|{4}{U}{U}|Instant|||Gain control of target spell. You may choose new targets for it. (If that spell becomes a permanent, it enters the battlefield under your control.)| +Brainstorm|Commander 2015|90|C|{U}|Instant|||Draw three cards, then put two cards from your hand on top of your library in any order.| +Day of the Dragons|Commander 2015|91|R|{4}{U}{U}{U}|Enchantment|||When Day of the Dragons enters the battlefield, exile all creatures you control. Then put that many 5/5 red Dragon creature tokens with flying onto the battlefield.$When Day of the Dragons leaves the battlefield, sacrifice all Dragons you control. Then return the exiled cards to the battlefield under your control.| +Dominate|Commander 2015|92|U|{X}{1}{U}{U}|Instant|||Gain control of target creature with converted mana cost X or less.| +Echoing Truth|Commander 2015|93|C|{1}{U}|Instant|||Return target nonland permanent and all other permanents with the same name as that permanent to their owners' hands.| +Fact or Fiction|Commander 2015|94|U|{3}{U}|Instant|||Reveal the top five cards of your library. An opponent separates those cards into two piles. Put one pile into your hand and the other into your graveyard.| +Jace's Archivist|Commander 2015|95|R|{1}{U}{U}|Creature - Vedalken Wizard|2|2|{U}, {tap}: Each player discards his or her hand, then draws cards equal to the greatest number of cards a player discarded this way.| +Lone Revenant|Commander 2015|96|R|{3}{U}{U}|Creature - Spirit|4|4|Hexproof (This creature can't be the target of spells or abilities your opponents control.)$Whenever Lone Revenant deals combat damage to a player, if you control no other creatures, look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.| +Mulldrifter|Commander 2015|97|U|{4}{U}|Creature - Elemental|2|2|Flying$When Mulldrifter enters the battlefield, draw two cards.$Evoke {2}{U} (You may cast this spell for its evoke cost. If you do, it's sacrificed when it enters the battlefield.)| +Mystic Retrieval|Commander 2015|98|U|{3}{U}|Sorcery|||Return target instant or sorcery card from your graveyard to your hand.$Flashback {2}{R} (You may cast this card from your graveyard for its flashback cost. Then exile it.)| +Ninja of the Deep Hours|Commander 2015|99|C|{3}{U}|Creature - Human Ninja|2|2|Ninjutsu {1}{U} ({1}{U}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand tapped and attacking.)$Whenever Ninja of the Deep Hours deals combat damage to a player, you may draw a card.| +Kozilek, the Great Distortion|Oath of the Gatewatch|4|M|{8}{D}{D}|Legendary Creature - Eldrazi|12|12|When you cast Kozilek, the Great Distortion, if you have fewer than seven cards in hand, draw cards equal to the difference.$Menace$Discard a card with converted mana cost X: Counter target spell with converted mana cost X.| +Mirrorpool|Oath of the Gatewatch|174|M||Land|||Mirrorpool enters the battlefield tapped.${T}: Add {D} to your mana pool.${2}{D}, {T}, Sacrifice Mirrorpool: Copy target instant or sorcery spell you control. You may choose new targets for the copy.${4}{D}, {T}, Sacrifice Mirrorpool: Put a token onto the battlefield that's a copy of target creature you control.| +Wastes|Oath of the Gatewatch|184|C||Basic Land|||{T}: Add {D} to your mana pool.| \ No newline at end of file diff --git a/Utils/mtg-sets-data.txt b/Utils/mtg-sets-data.txt index 090a2e72212..83318ee3973 100644 --- a/Utils/mtg-sets-data.txt +++ b/Utils/mtg-sets-data.txt @@ -25,6 +25,7 @@ Chronicles|CHR| Clash Pack|CLASH| Commander 2013 Edition|C13| Commander 2014 Edition|C14| +Commander 2015|C15| Conflux|CON| Coldsnap|CSP| Dark Ascension|DKA| @@ -53,6 +54,7 @@ Duel Decks: Phyrexia vs. the Coalition|DDE| Duel Decks: Sorin vs. Tibalt|DDK| Duel Decks: Speed vs. Cunning|DDN| Duel Decks: Venser vs. Koth|DDI| +Duel Decks: Zendikar vs. Eldrazi|DDP| Eventide|EVE| Exodus|EXO| Fallen Empires|FEM| @@ -109,6 +111,7 @@ MTGO Vanguard|VGO| New Phyrexia|NPH| Ninth Edition|9ED| Nemesis|NMS| +Oath of the Gatewatch|OGW| Odyssey|ODY| Onslaught|ONS| Prophecy|PCY| @@ -159,4 +162,5 @@ Weatherlight|WTH| World Magic Cup Qualifier|WMCQ| Worldwake|WWK| WPN Gateway|GRC| -Zendikar|ZEN| \ No newline at end of file +Zendikar|ZEN| +Zendikar Expeditions|EXP| \ No newline at end of file diff --git a/Utils/release/getting_implemented_cards.txt b/Utils/release/getting_implemented_cards.txt index 02ecd0925f6..59fd481cd09 100644 --- a/Utils/release/getting_implemented_cards.txt +++ b/Utils/release/getting_implemented_cards.txt @@ -6,157 +6,7 @@ git log tagOrSha1..HEAD --diff-filter=A --name-status | sed -ne 's/^A[^u]Mage.Se for Windows: you need to replace ' by "" and remove -u in sort -Example for cards implemented from 0.8.7 till 0.9: -git log 9ac166abc92f70aebdbe34825880ff8f909465ed..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.0.2-release: -git log 6b38cd5b18298b07962b969bfa2eb69c62839575..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.0.3-release: -git log 7ba3d451da95183b8c1cfb732b332f640963cc4a..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -git log 68333a2eff6b643b2028d18dad16d1f228be7a2c..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -20130901 -git log 10902581140fe4268fc12408f099ad82347d7cd0..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.1.0-release: -git log d6c1075125e657d4dd2e7bb120e108bb4c4536ff..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.1.2-2013_10_26-release: -git log 63889f5bd4faa0a0915bb1e845ca3a0bc1093070..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.2.0 -git log b724d7fe136abbe09144eb2824739df3238061ee..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-02-03 -git log 9c5d5208b96e28e1e767574e1143b845e6b7308f..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-02-15 -git log 88d8c30b6c3dbf7c90354eccfd04107641c308f1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-04-25 -git log a1cfd040d74dd6d2100168754961cfebb154f153..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-05-10 -git log e93cd580dd8ff985fbda018bb5ea652134c1865e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-05-10v2 -git log e484da4028e6c0498bbcd76b83af39bca93d26b1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-05-30v1 -git log 99a60c3063521551ab08c506386729f1feaee257..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-06-15 -git log 6c8b818d890e9e0ce4bc5e3128249bb9e62c0b23..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-06-28 -git log 1129858a6c5c0dae5d1e29ea931804c1165b8c38..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-07-11 -git log 458255cd0627af90c2ebeab4c410a16d55a36f41..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-07-19 -git log 75eb0bdfdf36ba83dd5a3e2c6a204ceb186c9d5e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-07-30 -git log 69ce53e6e8036bf01bdd090e8785f4d63c486d1e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-08-11 -git log 709dc83ae6fd6778e5b52e5176a978f1c6fda3b7..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-08-19 -git log edd1563c12422f69c10bc76d310e0a84421ab4a2..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-08-30 -git log fbc2a7258face1e908f3f08da1c2fec4ec0f86fe..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-09-13 -git log 632f711fe237defe43111f9b7236fda1da74bfc0..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-09-26 -git log b76102b0cdb911c7217fc2f510b4de86651f91d2..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-10-05 -git log 8121849a185b913ef2de59fff2f3d9a6c9b3a613..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-10-18v1 -git log 58bbe60c724c7940996cf33db690d5eb1abfce0a..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-10-18v2 (2014-10-20) -git log 974cb4435bb826769b935aaffc8335eeaa83d53f..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-10-18v3 (2014-10-25) -git log 26b5a277c4404a93e3b41ba477c5ec58dedcf826..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-11-01v1 -git log 8426816b0948991fdb100ce010f009a4aae7796a..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-11-08v1 -git log 0ce2348e3362c60972c7901b1c083361c926f861..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-11-29v1 -git log 3446953a9d594f324a4b4e36ea13560f1fe2685b..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-11-29v2 -git log 68f2b65c345d4f16f33f6f23d849d48b1924bbd1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-11-29v3 -git log 68fed320f79a43a4af21ed9238b7659df53a008e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-11-29v4 (2014-12-13) -git log 96ce77e9d0e21610569071c81e661f91c53a3a17..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.3.0-2014-11-29v5 (2014-12-27) -git log c4ad51c4af2467f3483204e29f23b76c53f8f880..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-11-29v7 (2015-01-01) -git log c370189787cff7fc129b1ccf1b223807143460de..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-11-29v8 (2015-01-17) -git log 79ceae999a72151e2fadd1e15ddd37ec76c3f205..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2014-11-29v10 (2015-01-23) -git log 79ceae999a72151e2fadd1e15ddd37ec76c3f205..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-02-07v1 -git log e0b17eacc7b3abff4f6a6e878c01ebfab577df9e..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-02-07v3 -git log ba1fb775b2efd63d4de60786ab9d7857e00c3a57..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-02-07v4 -git log 7d7afb60d6fbe6d3f15a8fae9af147df3d3f31c6..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-02-07v7 -git log 6bd17716cd23e0f19142fb59c9c1bc44d87441e3..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v1 -git log ece4d69f367536ffb80cdf94d5a3dd771ba40f04..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v2 -git log b78d6f69af6d2b565c95b3ac20f76dd7eeecb3f8..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v2 -git log 78df43fd30850568c6494fb12c1f9d8415ef850f..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v5 -git log 65f731557bb55d0c85723e382001bdf9701f0a7f..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v6 -git log b79d6e64cff01726be93cbbfffca8a6f18188a3c..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v8 -git log 47b17535194c6aa5397a966463c8b17d37f8bd44..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.3.0-2015-03-14v9 -git log 00692410273d4c2ff70eec7bfcf6a601fb404bf9..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.0.v0 -git log fa847e8feb646e94d77fc8abc35e1d9817622f8a..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.0.v1 -git log e8b2e01cd465f6a8ced2c83ec52a698ee093baa4..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt -since 1.4.0.v2 -git log eb96b08dfac3de4f78403d6f23e41ce8d41ece6f..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.1.v0 -git log 7a54d5364c9789ce2c3ef2c3eb4df7e0e0cde0cf..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.1.v1 -git log 3e9b4cfb7c22d363755d28f5ff1de351f6b7123c..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.1.v2 -git log 675801e8d493b023add4333e7835751d20da07a1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.1.v3 -git log 757b9ea99ec1f0ce46bb533f9f86f3473d122a60..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.2.v0 -git log cd0cba6ec7d8799bb85247b7b4f5d545e170b093..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.2.v1 -git log 0b26aaff6ec033a538179bf607b1c7a7736aedb2..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.2.v2 -git log 8d5137e40ebe1c029e737ef475935ff7cc40bb64..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.2.v3 -git log 60c7a2b34b5dd9a64bd415b65424a559294cf52b..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt - -since 1.4.2.v4 -git log 193177d9999d56729a687ca3b1a2fc3f3b96d9e2..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt +Example for cards implemented since hash: since 1.4.2.v5 git log 8dca887fadbbea41fb649ff17c5fe547a82ef23a..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt @@ -164,6 +14,37 @@ git log 8dca887fadbbea41fb649ff17c5fe547a82ef23a..HEAD --diff-filter=A --name-st since 1.4.3.v0 git log 5de4637d9c7967612c207d3cf915c2861d922029..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt +since 1.4.3.v2 +git log 6d8378d5e49629a2fa126baf84340156a28f25db..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + +since 1.4.3.v3 +git log 23039572f2206ade860f5835e9b85e82a9c4b2a1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + + +since 1.4.4.v0 +git log 0a458707ddaaa5e7e82ab06d17633084f67077c1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + +since 1.4.4.v3 +git log 3d8494edb5c0fddcb972758f7d983b8b66a9651e..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + +since 1.4.4.v4 +git log 513a574ae98aff3d7820e5411a8e5f2a6506e69c..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + +since 1.4.4.v6 +git log 7650f53dee0b4d480d2a63befed72b6c8197e752..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + +since 1.4.4.v8 +git log 8c7dc7b2da3630b6dfec1390854fa2be11631c79..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + +since 1.4.4.v9 +git log 1b71f505064b82893003207fc29954de533fbed5..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + +since 1.4.4.v12 +git log a5d7ca83d7ac5e13805bff58f2838384a97beed6..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + +since 1.4.5.v0 +git log f3019d70fd2ce7c0f2bdaeafafa36ef4d81330c5..head --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + 3. Copy added_cards.txt to trunk\Utils folder 4. Run script: > perl extract_in_wiki_format.perl diff --git a/clean_dbs.sh b/clean_dbs.sh old mode 100644 new mode 100755 index 9ccf51fd6d2..48141fedaec --- a/clean_dbs.sh +++ b/clean_dbs.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash # Cleans the DB from Server, Client and Test modules -find . -type f | grep -i cards.h2*.db | xargs rm -v \ No newline at end of file +find . -type f -iname 'cards.h2*.db' -print -delete diff --git a/pom.xml b/pom.xml index 65aa64f3d05..ecbd4a47039 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.3 + 1.4.5 pom Mage Root Mage Root POM @@ -83,7 +83,7 @@ - 1.4.3 + 1.4.5 UTF-8